From a71b7dfa69ddeeec6993f4b7d718a4f2ec31a2cb Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 3 Dec 2020 08:44:45 +0000 Subject: [PATCH] ide: Repo sync now shows 'cd' in console before git commands git-svn-id: svn://ultimatepp.org/upp/trunk@15564 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/SetupSVN.cpp | 1 - uppsrc/ide/idetool.cpp | 2 -- uppsrc/urepo/Console.cpp | 3 ++- uppsrc/urepo/urepo.h | 2 -- uppsrc/urepo/urepo.lay | 36 ++++++++++++++++++------------------ 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/uppsrc/ide/SetupSVN.cpp b/uppsrc/ide/SetupSVN.cpp index 329a1ccae..120b490ef 100644 --- a/uppsrc/ide/SetupSVN.cpp +++ b/uppsrc/ide/SetupSVN.cpp @@ -70,7 +70,6 @@ bool SetupSVNTrunk() }; UrepoConsole console; - console.WithCancel(); String dir, tempdir; for(;;) { if(dlg.Run() != IDOK) diff --git a/uppsrc/ide/idetool.cpp b/uppsrc/ide/idetool.cpp index e64040211..96738419c 100644 --- a/uppsrc/ide/idetool.cpp +++ b/uppsrc/ide/idetool.cpp @@ -470,8 +470,6 @@ INITBLOCK { void RepoSyncDirs(const Vector& working) { -// if(!CheckSvn()) -// return; Ptr f = Ctrl::GetFocusCtrl(); RepoSync repo; String repocfg = ConfigFile("repo.cfg"); diff --git a/uppsrc/urepo/Console.cpp b/uppsrc/urepo/Console.cpp index cbd6d61ce..169f8a3f8 100644 --- a/uppsrc/urepo/Console.cpp +++ b/uppsrc/urepo/Console.cpp @@ -39,7 +39,7 @@ int UrepoConsole::System(const char *cmd) return -1; String out; canceled = false; - cancel.Show(withcancel); + cancel.Show(); while(p.IsRunning() && IsOpen()) { String h = p.Get(); out.Cat(h); @@ -82,6 +82,7 @@ int UrepoConsole::Git(const char *dir, const char *command) { String h = GetCurrentDirectory(); SetCurrentDirectory(dir); + list.Add(AttrText(String("cd ") + dir).SetFont(font().Bold().Italic()).Ink(SLtBlue())); int code = CheckSystem(String() << "git " << command); SetCurrentDirectory(h); return code; diff --git a/uppsrc/urepo/urepo.h b/uppsrc/urepo/urepo.h index 41ed70ff0..bac8d38b6 100644 --- a/uppsrc/urepo/urepo.h +++ b/uppsrc/urepo/urepo.h @@ -13,7 +13,6 @@ class UrepoConsole : public WithUrepoConsoleLayout { Font font; void AddResult(const String& out); - bool withcancel = false; bool canceled = false; public: @@ -22,7 +21,6 @@ public: int Git(const char *dir, const char *command); void Log(const Value& s, Color ink = SColorText()); void Perform() { exit.Show(); Execute(); } - void WithCancel(bool b = true) { withcancel = b; } void Clear() { list.Clear(); } UrepoConsole(); diff --git a/uppsrc/urepo/urepo.lay b/uppsrc/urepo/urepo.lay index 0f9d8bb4a..308e6d0f0 100644 --- a/uppsrc/urepo/urepo.lay +++ b/uppsrc/urepo/urepo.lay @@ -1,33 +1,33 @@ LAYOUT(RepoSyncLayout, 680, 400) - ITEM(ArrayCtrl, list, AutoHideSb(true).HSizePosZ(4, 4).VSizePosZ(4, 36)) - ITEM(Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(4, 64).BottomPosZ(4, 24)) - ITEM(Button, credentials, SetLabel(t_("Credentials..")).RightPosZ(96, 84).BottomPosZ(4, 24)) - ITEM(Button, ok, SetLabel(t_("Synchronize!")).RightPosZ(4, 84).BottomPosZ(4, 24)) + ITEM(Upp::ArrayCtrl, list, AutoHideSb(true).HSizePosZ(4, 4).VSizePosZ(4, 36)) + ITEM(Upp::Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(4, 64).BottomPosZ(4, 24)) + ITEM(Upp::Button, credentials, SetLabel(t_("Credentials..")).RightPosZ(96, 84).BottomPosZ(4, 24)) + ITEM(Upp::Button, ok, SetLabel(t_("Synchronize!")).RightPosZ(4, 84).BottomPosZ(4, 24)) END_LAYOUT LAYOUT(CredentialsLayout, 680, 400) - ITEM(ArrayCtrl, list, AutoHideSb(true).HSizePosZ(4, 4).VSizePosZ(4, 36)) - ITEM(Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(544, 64).BottomPosZ(4, 24)) - ITEM(Button, ok, SetLabel(t_("OK")).LeftPosZ(612, 64).BottomPosZ(4, 24)) - ITEM(Option, remember, SetLabel(t_("Remember (credentials will be stored in configuration as clear text)")).LeftPosZ(120, 348).TopPosZ(372, 20)) - ITEM(Option, show_passwords, SetLabel(t_("Show passwords")).LeftPosZ(4, 108).TopPosZ(372, 20)) - ITEM(Button, clear, SetLabel(t_("Clear all")).LeftPosZ(476, 64).TopPosZ(372, 24)) + ITEM(Upp::ArrayCtrl, list, AutoHideSb(true).HSizePosZ(4, 4).VSizePosZ(4, 36)) + ITEM(Upp::Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(544, 64).BottomPosZ(4, 24)) + ITEM(Upp::Button, ok, SetLabel(t_("OK")).LeftPosZ(612, 64).BottomPosZ(4, 24)) + ITEM(Upp::Option, remember, SetLabel(t_("Remember (credentials will be stored in configuration as clear text)")).LeftPosZ(120, 348).TopPosZ(372, 20)) + ITEM(Upp::Option, show_passwords, SetLabel(t_("Show passwords")).LeftPosZ(4, 108).TopPosZ(372, 20)) + ITEM(Upp::Button, clear, SetLabel(t_("Clear all")).LeftPosZ(476, 64).TopPosZ(372, 24)) END_LAYOUT LAYOUT(UrepoConsoleLayout, 680, 660) - ITEM(ArrayCtrl, list, HSizePosZ(4, 4).VSizePosZ(4, 40)) - ITEM(Button, exit, SetLabel(t_("Close")).RightPosZ(4, 64).BottomPosZ(8, 24)) - ITEM(Button, cancel, SetLabel(t_("Cancel")).RightPosZ(612, 64).BottomPosZ(8, 24)) + ITEM(Upp::ArrayCtrl, list, HSizePosZ(4, 4).VSizePosZ(4, 40)) + ITEM(Upp::Button, exit, SetLabel(t_("Close")).RightPosZ(4, 64).BottomPosZ(8, 24)) + ITEM(Upp::Button, cancel, SetLabel(t_("Abort")).RightPosZ(612, 64).BottomPosZ(8, 24)) END_LAYOUT LAYOUT(SvnOptionsLayout, 140, 16) - ITEM(Option, commit, SetLabel(t_("Commit")).LeftPosZ(0, 68).VCenterPosZ(16, 0)) - ITEM(Option, update, SetLabel(t_("Update")).LeftPosZ(72, 68).VCenterPosZ(16, 0)) + ITEM(Upp::Option, commit, SetLabel(t_("Commit")).LeftPosZ(0, 68).VCenterPosZ(16, 0)) + ITEM(Upp::Option, update, SetLabel(t_("Update")).LeftPosZ(72, 68).VCenterPosZ(16, 0)) END_LAYOUT LAYOUT(GitOptionsLayout, 164, 16) - ITEM(Option, commit, SetLabel(t_("Commit")).LeftPosZ(0, 68).VCenterPosZ(16, 0)) - ITEM(Option, push, SetLabel(t_("Push")).LeftPosZ(68, 48).VCenterPosZ(16, 0)) - ITEM(Option, pull, SetLabel(t_("Pull")).LeftPosZ(116, 48).VCenterPosZ(16, 0)) + ITEM(Upp::Option, commit, SetLabel(t_("Commit")).LeftPosZ(0, 68).VCenterPosZ(16, 0)) + ITEM(Upp::Option, push, SetLabel(t_("Push")).LeftPosZ(68, 48).VCenterPosZ(16, 0)) + ITEM(Upp::Option, pull, SetLabel(t_("Pull")).LeftPosZ(116, 48).VCenterPosZ(16, 0)) END_LAYOUT