aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorMax Horn2002-10-15 15:32:54 +0000
committerMax Horn2002-10-15 15:32:54 +0000
commitd8b72c31c9219ba04760f9a23f0bc58e8008b1c4 (patch)
tree3a9c215e170ad154b231f4f23817b3a4d81b364b /gui
parentd8c26a61aef379c9ad43d4f5cc101ee1ed22440b (diff)
downloadscummvm-rg350-d8b72c31c9219ba04760f9a23f0bc58e8008b1c4.tar.gz
scummvm-rg350-d8b72c31c9219ba04760f9a23f0bc58e8008b1c4.tar.bz2
scummvm-rg350-d8b72c31c9219ba04760f9a23f0bc58e8008b1c4.zip
sort the games in the launcher list by name
svn-id: r5154
Diffstat (limited to 'gui')
-rw-r--r--gui/launcher.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 034dc7a942..f8e734ece6 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -31,6 +31,7 @@ enum {
kStartCmd = 'STRT',
kOptionsCmd = 'OPTN',
kAddGameCmd = 'ADDG',
+ kConfigureGameCmd = 'CONF',
kQuitCmd = 'QUIT'
};
@@ -70,13 +71,16 @@ LauncherDialog::LauncherDialog(NewGui *gui, GameDetector &detector)
const VersionSettings *v = version_settings;
ScummVM::StringList l;
- // TODO - sort by name ?
// TODO - maybe only display those games for which settings are known
// (i.e. a path to the game data was set and is accesible) ?
while (v->filename && v->gamename) {
if (g_config->has_domain(v->filename)) {
- l.push_back(v->gamename);
- _filenames.push_back(v->filename);
+ String name = v->gamename;
+ int pos = 0, size = l.size();
+ while (pos < size && (name > l[pos]))
+ pos++;
+ l.insert_at(pos, name);
+ _filenames.insert_at(pos, v->filename);
}
v++;
}
@@ -87,7 +91,8 @@ LauncherDialog::LauncherDialog(NewGui *gui, GameDetector &detector)
// Two more buttons directly below the list box
bw = new ButtonWidget(this, 10, 144, 80, 16, "Add Game...", kAddGameCmd, 'A');
bw->setEnabled(false);
-// addButton(20 + 4 + kButtonWidth, 144, "Change Setting...");
+ bw = new ButtonWidget(this, 320-90, 144, 80, 16, "Configure...", kConfigureGameCmd, 'C');
+ bw->setEnabled(false);
}
void LauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data)