зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 4744: Ability to customize localized browser (r=smeredith)
This commit is contained in:
Родитель
c422529b1a
Коммит
4a142a2681
|
@ -1182,7 +1182,9 @@ int interpret(char *cmd)
|
|||
strcat(temp, newvalue);
|
||||
newvalue = temp;
|
||||
}
|
||||
WritePrivateProfileString(section, key, newvalue, iniDstPath);
|
||||
CString encodedValue = newvalue;
|
||||
WritePrivateProfileString(section, key, ConvertUTF8toANSI(encodedValue),
|
||||
iniDstPath);
|
||||
}
|
||||
else if (strcmp(cmdname, "replaceXPI") == 0)
|
||||
{
|
||||
|
@ -1458,7 +1460,7 @@ void init_components()
|
|||
// Turn off components that aren't selected
|
||||
for (i=0; i<numComponents; i++)
|
||||
{
|
||||
if ((strstr(w->value, Components[i].name) == NULL))
|
||||
if ((strstr(ConvertUTF8toANSI(w->value), Components[i].name) == NULL))
|
||||
{
|
||||
if (!(Components[i].selected && Components[i].invisible))
|
||||
Components[i].selected = FALSE;
|
||||
|
@ -1593,8 +1595,8 @@ void AddThirdParty()
|
|||
{
|
||||
CString tpCompPath1 = GetGlobal("CustomComponentPath1");
|
||||
CString tpCompPath2 = GetGlobal("CustomComponentPath2");
|
||||
CString tpComp1 = GetGlobal("CustomComponentDesc1");
|
||||
CString tpComp2 = GetGlobal("CustomComponentDesc2");
|
||||
CString tpComp1 = ConvertUTF8toANSI(GetGlobal("CustomComponentDesc1"));
|
||||
CString tpComp2 = ConvertUTF8toANSI(GetGlobal("CustomComponentDesc2"));
|
||||
CString tpCompSize1 = GetGlobal("CustomComponentSize1");
|
||||
CString tpCompSize2 = GetGlobal("CustomComponentSize2");
|
||||
CString componentName;
|
||||
|
@ -2343,9 +2345,10 @@ int StartIB(/*CString parms, WIDGET *curWidget*/)
|
|||
CString MozBrowser = GetBrowser();
|
||||
// CreateShortcut(MozBrowser, TargetFile, "HelpLink", TargetDir, FALSE);
|
||||
|
||||
SetCurrentDirectory(configPath);
|
||||
EraseDirectory(tempPath);
|
||||
_chdir(configPath);
|
||||
_rmdir("Temp");
|
||||
RemoveDirectory(tempPath);
|
||||
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
#include <direct.h>
|
||||
#include "comp.h"
|
||||
#include "ib.h"
|
||||
#include <stdlib.h>
|
||||
#define LATIN1_CODEPAGE 1252
|
||||
|
||||
extern CString rootPath;// = GetGlobal("Root");
|
||||
extern CString configName;// = GetGlobal("CustomizationList");
|
||||
|
@ -60,11 +62,11 @@ void CreateRshell (void)
|
|||
|
||||
rshell <<jsprefname<<"\n";
|
||||
}
|
||||
rshell <<"caption="<<captionValue<<"\n";
|
||||
rshell <<"caption="<<ConvertUTF8toANSI(captionValue)<<"\n";
|
||||
// rshell <<"bk_bitmap="<<fvalue2<<"\n";
|
||||
// rshell <<"button2_cmdline=exe,"<<fvalue4<<"\n";
|
||||
|
||||
rshell <<"dialog_title_text="<<fvalue3<<"\n";
|
||||
rshell <<"dialog_title_text="<<ConvertUTF8toANSI(fvalue3)<<"\n";
|
||||
if(!part2) {
|
||||
cout << "cannot open the file \n";
|
||||
}
|
||||
|
@ -74,6 +76,23 @@ void CreateRshell (void)
|
|||
rshell <<jsprefname<<"\n";
|
||||
}
|
||||
rshell.close();
|
||||
|
||||
if (GetACP() != LATIN1_CODEPAGE)
|
||||
{
|
||||
// For non-western languages, change the western font specifications
|
||||
// to blank in order to use the sytem font appropriate to the user's
|
||||
// Windows regional setting
|
||||
WritePrivateProfileString("Dialog1", "dialog_title_text_font", "", Rsh);
|
||||
WritePrivateProfileString("Dialog1", "button_title_text_font", "", Rsh);
|
||||
WritePrivateProfileString("Dialog1", "body_text_font", "", Rsh);
|
||||
WritePrivateProfileString("Dialog2", "dialog_title_text_font", "", Rsh);
|
||||
WritePrivateProfileString("Dialog2", "button_title_text_font", "", Rsh);
|
||||
WritePrivateProfileString("Dialog2", "body_text_font", "", Rsh);
|
||||
WritePrivateProfileString("Dialog3", "dialog_title_text_font", "", Rsh);
|
||||
WritePrivateProfileString("Dialog3", "button_title_text_font", "", Rsh);
|
||||
WritePrivateProfileString("Dialog3", "body_text_font", "", Rsh);
|
||||
}
|
||||
|
||||
CString bmpdest = cdshellPath + "\\bmps\\Install.bmp";
|
||||
CString txtdest = configPath + "\\Output\\install.txt";
|
||||
CopyFile(fvalue2,bmpdest,FALSE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче