TheIDE: Sort packages by name

git-svn-id: svn://ultimatepp.org/upp/trunk@1066 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-04-17 13:16:32 +00:00
parent 9850da3658
commit 01774ea7d7
6 changed files with 14 additions and 3 deletions

View file

@ -12,7 +12,7 @@ const char *t_GetLngString(const char *id);
const char *GetENUS(const char *id);
// t_ and tt_ would cause translation files sync to report error, so that
// t_ and tt_ would cause translation files sync to report error, therefore it
// has to be included from file that is not part of package...
#include "t_.h"

View file

@ -327,6 +327,7 @@ void Ide::SetupFormat() {
(ide.show_status_bar, show_status_bar)
(ide.toolbar_in_row, toolbar_in_row)
(ide.splash_screen, splash_screen)
(ide.sort, sort)
(ide.mute_sounds, mute_sounds)
(ide.wrap_console_text, wrap_console_text)
(ide.assist, editor.auto_assist)

View file

@ -159,6 +159,7 @@ struct WorkspaceWork {
bool organizer;
bool showtime;
bool sort;
virtual void PackageCursor();
virtual void FileCursor();

View file

@ -41,8 +41,13 @@ void WorkspaceWork::ScanWorkspace() {
actualfileindex = -1;
filelist.Clear();
package.Clear();
Vector<String> pks;
for(int i = 0; i < wspc.package.GetCount(); i++)
pks.Add(wspc.package.GetKey(i));
if(sort)
Sort(pks.Begin() + 1, pks.End(), StdLess<String>());
for(int i = 0; i < wspc.package.GetCount(); i++) {
String pk = wspc.package.GetKey(i);
String pk = pks[i];
Font fnt = ListFont();
if(i == 0)
fnt.Bold();
@ -750,6 +755,7 @@ WorkspaceWork::WorkspaceWork()
package.BackPaintHint();
filelist.BackPaintHint();
showtime = false;
sort = true;
}
void WorkspaceWork::SerializeClosed(Stream& s)

View file

@ -442,6 +442,7 @@ LAYOUT(SetupIdeLayout, 520, 264)
ITEM(Button, xterm, SetLabel(t_("xterm")).LeftPosZ(264, 52).TopPosZ(240, 20))
ITEM(Button, gnome, SetLabel(t_("Gnome")).LeftPosZ(320, 52).TopPosZ(240, 20))
ITEM(Button, kde, SetLabel(t_("KDE")).LeftPosZ(376, 52).TopPosZ(240, 20))
ITEM(Option, sort, SetLabel(t_("Sort packages by names")).LeftPosZ(8, 160).TopPosZ(148, 16))
END_LAYOUT
LAYOUT(SetupAstyleLayout, 544, 280)

View file

@ -80,7 +80,7 @@ void Ide::ConsolePaste()
}
void Ide::Serialize(Stream& s) {
int version = 12;
int version = 13;
s.Magic(0x1234);
s / version;
s % main;
@ -184,6 +184,8 @@ void Ide::Serialize(Stream& s) {
}
if(version >= 12)
s % DiffFs();
if(version >= 13)
s % sort;
s.Magic();
}