From 820ce4a2aaa4c5ad933cd1b8eaaeaa0fa1cdf0a1 Mon Sep 17 00:00:00 2001 From: cxl Date: Fri, 1 May 2020 10:45:02 +0000 Subject: [PATCH] CtrlCore: Fix of serialization on armhf, ide: lxde terminal support git-svn-id: svn://ultimatepp.org/upp/trunk@14414 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/Stream.h | 2 +- uppsrc/TabBar/TabBar.cpp | 4 ++-- uppsrc/ide/Config.cpp | 11 +++++++---- uppsrc/ide/Core/Host.cpp | 1 + uppsrc/ide/Debuggers/Terminal.cpp | 1 + uppsrc/ide/Setup.cpp | 2 ++ uppsrc/ide/ide.h | 2 +- uppsrc/ide/ide.lay | 11 ++++++----- 8 files changed, 21 insertions(+), 13 deletions(-) diff --git a/uppsrc/Core/Stream.h b/uppsrc/Core/Stream.h index 7de44670c..76e3f65cc 100644 --- a/uppsrc/Core/Stream.h +++ b/uppsrc/Core/Stream.h @@ -120,7 +120,7 @@ public: #else int Get16() { return _Get16(); } int Get32() { return _Get32(); } - int Get64() { return _Get32(); } + int64 Get64() { return _Get64(); } #endif #ifdef CPU_LE diff --git a/uppsrc/TabBar/TabBar.cpp b/uppsrc/TabBar/TabBar.cpp index 99518fe73..4799bf83a 100644 --- a/uppsrc/TabBar/TabBar.cpp +++ b/uppsrc/TabBar/TabBar.cpp @@ -2667,14 +2667,14 @@ void TabBar::Serialize(Stream& s) int n = groups.GetCount(); s % n; - groups.SetCount(n); + groups.SetCount(clamp(n, 0, 10000)); for(int i = 0; i < groups.GetCount(); i++) s % groups[i]; n = tabs.GetCount(); s % n; - tabs.SetCount(n); + tabs.SetCount(clamp(n, 0, 10000)); for(int i = 0; i < tabs.GetCount(); i++) s % tabs[i]; diff --git a/uppsrc/ide/Config.cpp b/uppsrc/ide/Config.cpp index 47f82d588..fe0e460c4 100644 --- a/uppsrc/ide/Config.cpp +++ b/uppsrc/ide/Config.cpp @@ -4,7 +4,7 @@ void Ide::SerializeWorkspace(Stream& s) { int i; - int version = 18; + int version = 19; s / version; s.Magic(0x12354); if(s.IsStoring()) { @@ -62,8 +62,9 @@ void Ide::SerializeWorkspace(Stream& s) { if(version >= 18) s % darkmode; s % editfile; - for(i = 0; i < 10; i++) + for(i = 0; i < 10; i++) { s % bookmark[i]; + } editor.Serialize(s); if(version >= 5) s % editorsplit; @@ -107,9 +108,11 @@ void Ide::SerializeWorkspace(Stream& s) { SerializeOutputMode(s); SerializeClosed(s); if(version >= 10) { - if(tabs_serialize) { + bool dotabs = tabs_serialize; + if(version >= 19) + s % dotabs; + if(dotabs) s % tabs; - } } if(version >= 11) { s % find_file_search_string; diff --git a/uppsrc/ide/Core/Host.cpp b/uppsrc/ide/Core/Host.cpp index 36439ded3..530d6d208 100644 --- a/uppsrc/ide/Core/Host.cpp +++ b/uppsrc/ide/Core/Host.cpp @@ -235,6 +235,7 @@ void LocalHost::Launch(const char *_cmdline, bool console) "/usr/bin/mate-terminal -x", "/usr/bin/gnome-terminal --window -x", "/usr/bin/konsole -e", + "/usr/bin/lxterminal -e", "/usr/bin/xterm -e", }; int ii = 0; diff --git a/uppsrc/ide/Debuggers/Terminal.cpp b/uppsrc/ide/Debuggers/Terminal.cpp index 8b400d68e..487b5fc4b 100644 --- a/uppsrc/ide/Debuggers/Terminal.cpp +++ b/uppsrc/ide/Debuggers/Terminal.cpp @@ -34,6 +34,7 @@ String CreateDebugTTY() "/usr/bin/mate-terminal -e 'tail -f /dev/null'", "/usr/bin/gnome-terminal -e 'tail -f /dev/null'", "/usr/bin/konsole -e 'tail -f /dev/null'", + "/usr/bin/lxterminal -e 'tail -f /dev/null'", "/usr/bin/xterm -e 'tail -f /dev/null'", }; diff --git a/uppsrc/ide/Setup.cpp b/uppsrc/ide/Setup.cpp index 7f527e044..339f85d1c 100644 --- a/uppsrc/ide/Setup.cpp +++ b/uppsrc/ide/Setup.cpp @@ -398,10 +398,12 @@ void Ide::SetupFormat() { ide.gnome.Hide(); ide.xterm.Hide(); ide.mate.Hide(); + ide.lxde.Hide(); #endif ide.kde <<= callback2(SetConsole, &ide.console, "/usr/bin/konsole -e"); ide.gnome <<= callback2(SetConsole, &ide.console, "/usr/bin/gnome-terminal -x"); ide.mate <<= callback2(SetConsole, &ide.console, "/usr/bin/mate-terminal -x"); + ide.lxde <<= callback2(SetConsole, &ide.console, "/usr/bin/lxterminal -e"); ide.xterm <<= callback2(SetConsole, &ide.console, "/usr/bin/xterm -e"); edt.lineends diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index b84688b90..4aadb73eb 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -490,7 +490,7 @@ public: String file; LineEdit::EditPos pos; - void Serialize(Stream& s) { s % file % pos; } + void Serialize(Stream& s) { s % file; s % pos; } } bookmark[10]; diff --git a/uppsrc/ide/ide.lay b/uppsrc/ide/ide.lay index 3e0c4620a..dbc88ff5a 100644 --- a/uppsrc/ide/ide.lay +++ b/uppsrc/ide/ide.lay @@ -596,24 +596,25 @@ LAYOUT(SetupIdeLayout, 512, 316) ITEM(Label, dv___8, SetLabel(t_("GUI theme")).LeftPosZ(4, 112).TopPosZ(168, 19)) ITEM(DropList, chstyle, LeftPosZ(120, 144).TopPosZ(168, 19)) ITEM(Label, console_txt, SetLabel(t_("Use console in Linux")).LeftPosZ(4, 112).TopPosZ(216, 19)) - ITEM(EditString, console, LeftPosZ(120, 236).TopPosZ(216, 19)) + ITEM(EditString, console, LeftPosZ(120, 296).TopPosZ(216, 19)) ITEM(Button, xterm, SetLabel(t_("xterm")).LeftPosZ(120, 56).TopPosZ(240, 20)) ITEM(Button, gnome, SetLabel(t_("Gnome")).LeftPosZ(180, 56).TopPosZ(240, 20)) ITEM(Button, kde, SetLabel(t_("KDE")).LeftPosZ(240, 56).TopPosZ(240, 20)) ITEM(Button, mate, SetLabel(t_("Mate")).LeftPosZ(300, 56).TopPosZ(240, 20)) + ITEM(Button, lxde, SetLabel(t_("LXDE")).LeftPosZ(360, 56).TopPosZ(240, 20)) ITEM(Option, output_per_assembly, SetLabel(t_("Use unique output directory per assembly (append assembly name to output directory)")).HSizePosZ(4, 4).TopPosZ(268, 16)) - ITEM(Label, dv___17, SetLabel(t_("In editor mode, path for .usc files")).LeftPosZ(4, 192).TopPosZ(288, 20)) + ITEM(Label, dv___18, SetLabel(t_("In editor mode, path for .usc files")).LeftPosZ(4, 192).TopPosZ(288, 20)) ITEM(EditString, uscpath, HSizePosZ(172, 4).TopPosZ(288, 19)) ITEM(DropDate, showtimeafter, LeftPosZ(220, 136).TopPosZ(123, 19)) - ITEM(Label, dv___20, SetLabel(t_("HYDRA threads")).LeftPosZ(212, 80).TopPosZ(4, 19)) + ITEM(Label, dv___21, SetLabel(t_("HYDRA threads")).LeftPosZ(212, 80).TopPosZ(4, 19)) ITEM(EditIntSpin, hydra1_threads, Max(64).Min(1).LeftPosZ(344, 48).TopPosZ(4, 19)) ITEM(Option, gui_font, SetLabel(t_("Override GUI font")).LeftPosZ(4, 112).TopPosZ(192, 19)) ITEM(DropList, face, LeftPosZ(120, 144).TopPosZ(192, 19)) ITEM(DropList, height, LeftPosZ(268, 50).TopPosZ(192, 19)) ITEM(Option, bold, SetLabel(t_("Bold")).LeftPosZ(322, 44).TopPosZ(192, 19)) ITEM(Option, italic, SetLabel(t_("Italic")).LeftPosZ(370, 44).TopPosZ(192, 19)) - ITEM(Label, dv___27, SetLabel(t_("(needs restart)")).LeftPosZ(416, 88).TopPosZ(192, 19)) - ITEM(Label, dv___28, SetLabel(t_("(needs restart)")).LeftPosZ(272, 88).TopPosZ(168, 19)) + ITEM(Label, dv___28, SetLabel(t_("(needs restart)")).LeftPosZ(416, 88).TopPosZ(192, 19)) + ITEM(Label, dv___29, SetLabel(t_("(needs restart)")).LeftPosZ(272, 88).TopPosZ(168, 19)) END_LAYOUT LAYOUT(SetupAstyleLayout, 544, 312)