U++ Win32: Improved installation (browse button for MyApps, drop button for MyApps, update link to SDK)

git-svn-id: svn://ultimatepp.org/upp/trunk@1877 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2010-01-08 10:38:38 +00:00
parent 4dde32e31b
commit 17f71af281
4 changed files with 27 additions and 8 deletions

View file

@ -172,6 +172,16 @@ bool CheckLicense()
return true;
}
void BrowseField(EditField *f)
{
FileSel fs;
String s = ~*f;
if(DirectoryExists(s))
fs.ActiveDir(s);
if(fs.ExecuteSelectDir("Select the directory for MyApps"))
*f <<= ~fs;
}
bool Install()
{
{
@ -185,7 +195,11 @@ bool Install()
return false;
WithInstallLayout<TopWindow> dlg;
CtrlLayoutOKCancel(dlg, "Ultimate++ user-code setup");
dlg.myapps <<= GetExeFilePath().Mid(0, 3) + "MyApps";
String h = GetExeFilePath().Mid(0, 3) + "MyApps";
dlg.myapps <<= h;
dlg.myapps.AddList(h);
dlg.myapps.AddList(GetHomeDirFile("MyApps"));
dlg.browse <<= callback1(BrowseField, &dlg.myapps);
dlg.ActiveFocus(dlg.myapps);
if(dlg.Run() != IDOK)
return false;

View file

@ -254,12 +254,13 @@ LAYOUT(OutputModeLayout, 616, 480)
ITEM(Button, cancel, SetLabel(t_("Cancel")).HCenterPosZ(64, 268).TopPosZ(448, 24))
END_LAYOUT
LAYOUT(InstallLayout, 312, 112)
ITEM(Label, dv___0, SetLabel(t_("MyApps directory")).LeftPosZ(8, 84).TopPosZ(4, 19))
ITEM(EditString, myapps, LeftPosZ(8, 296).TopPosZ(24, 19))
ITEM(Option, icon, SetLabel(t_("Create desktop icon")).LeftPosZ(8, 184).TopPosZ(48, 20))
ITEM(Button, ok, SetLabel(t_("OK")).LeftPosZ(168, 64).TopPosZ(76, 24))
ITEM(Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(236, 64).TopPosZ(76, 24))
LAYOUT(InstallLayout, 400, 88)
ITEM(Label, dv___0, SetLabel(t_("MyApps directory")).LeftPosZ(8, 84).TopPosZ(8, 19))
ITEM(WithDropChoice<EditString>, myapps, LeftPosZ(8, 316).TopPosZ(28, 19))
ITEM(Button, browse, SetLabel(t_("Browse..")).LeftPosZ(328, 64).TopPosZ(28, 20))
ITEM(Option, icon, SetLabel(t_("Create desktop icon")).LeftPosZ(8, 184).TopPosZ(56, 20))
ITEM(Button, ok, SetLabel(t_("OK")).LeftPosZ(260, 64).TopPosZ(56, 24))
ITEM(Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(328, 64).TopPosZ(56, 24))
END_LAYOUT
LAYOUT(InfoLayout, 732, 556)

View file

@ -86,7 +86,8 @@ mainconfig
"" = "GUI",
"" = "GUI .USEMALLOC",
"" = ".NOGTK GUI",
"" = "GUI HEAPDBG CHECKINIT";
"" = "GUI HEAPDBG CHECKINIT",
"" = "GUI TESTINSTALL";
custom() "",
"",

View file

@ -728,6 +728,9 @@ void AppMain___()
if(!CheckLicense())
return;
firstinstall = !IsNull(LoadFile(GetExeDirFile("install.upp")));
#ifdef flagTESTINSTALL
firstinstall = true;
#endif
if(firstinstall) {
if(!Install())
return;