diff --git a/uppsrc/ide/Install.cpp b/uppsrc/ide/Install.cpp index 07b389a82..09d01d3f7 100644 --- a/uppsrc/ide/Install.cpp +++ b/uppsrc/ide/Install.cpp @@ -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 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; diff --git a/uppsrc/ide/ide.lay b/uppsrc/ide/ide.lay index 85452793e..69305a340 100644 --- a/uppsrc/ide/ide.lay +++ b/uppsrc/ide/ide.lay @@ -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, 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) diff --git a/uppsrc/ide/ide.upp b/uppsrc/ide/ide.upp index 59eb3abc6..b8bee49f1 100644 --- a/uppsrc/ide/ide.upp +++ b/uppsrc/ide/ide.upp @@ -86,7 +86,8 @@ mainconfig "" = "GUI", "" = "GUI .USEMALLOC", "" = ".NOGTK GUI", - "" = "GUI HEAPDBG CHECKINIT"; + "" = "GUI HEAPDBG CHECKINIT", + "" = "GUI TESTINSTALL"; custom() "", "", diff --git a/uppsrc/ide/idewin.cpp b/uppsrc/ide/idewin.cpp index 670f48987..ea63d5225 100644 --- a/uppsrc/ide/idewin.cpp +++ b/uppsrc/ide/idewin.cpp @@ -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;