[Scummvm-cvs-logs] CVS: scummvm/gui launcher.cpp,1.6,1.7

Max Horn fingolfin at users.sourceforge.net
Tue Oct 15 08:33:05 CEST 2002


Update of /cvsroot/scummvm/scummvm/gui
In directory usw-pr-cvs1:/tmp/cvs-serv24751

Modified Files:
	launcher.cpp 
Log Message:
sort the games in the launcher list by name

Index: launcher.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/launcher.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- launcher.cpp	13 Oct 2002 11:51:48 -0000	1.6
+++ launcher.cpp	15 Oct 2002 15:32:54 -0000	1.7
@@ -31,6 +31,7 @@
 	kStartCmd = 'STRT',
 	kOptionsCmd = 'OPTN',
 	kAddGameCmd = 'ADDG',
+	kConfigureGameCmd = 'CONF',
 	kQuitCmd = 'QUIT'
 };
 	
@@ -70,13 +71,16 @@
 	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 @@
 	// 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)





More information about the Scummvm-git-logs mailing list