[Scummvm-cvs-logs] CVS: scummvm/gui launcher.cpp,1.102.2.1,1.102.2.2 launcher.h,1.19,1.19.2.1
Max Horn
fingolfin at users.sourceforge.net
Tue Jan 4 17:46:49 CET 2005
Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6307
Modified Files:
Tag: branch-0-7-0
launcher.cpp launcher.h
Log Message:
After adding a new game, select the new entry
Index: launcher.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/launcher.cpp,v
retrieving revision 1.102.2.1
retrieving revision 1.102.2.2
diff -u -d -r1.102.2.1 -r1.102.2.2
--- launcher.cpp 30 Dec 2004 13:14:04 -0000 1.102.2.1
+++ launcher.cpp 5 Jan 2005 01:43:31 -0000 1.102.2.2
@@ -444,22 +444,26 @@
// Restore last selection
String last = ConfMan.get(String("lastselectedgame"), ConfigManager::kApplicationDomain);
- if (!last.isEmpty()) {
+ selectGame(last);
+
+ // En-/Disable the buttons depending on the list selection
+ updateButtons();
+
+ // Create file browser dialog
+ _browser = new BrowserDialog("Select directory with game data");
+}
+
+void LauncherDialog::selectGame(const String &name) {
+ if (!name.isEmpty()) {
int itemToSelect = 0;
StringList::const_iterator iter;
for (iter = _domains.begin(); iter != _domains.end(); ++iter, ++itemToSelect) {
- if (last == *iter) {
+ if (name == *iter) {
_list->setSelected(itemToSelect);
break;
}
}
}
-
- // En-/Disable the buttons depending on the list selection
- updateButtons();
-
- // Create file browser dialog
- _browser = new BrowserDialog("Select directory with game data");
}
LauncherDialog::~LauncherDialog() {
@@ -610,8 +614,9 @@
// Write config to disk
ConfMan.flushToDisk();
- // Update the ListWidget and force a redraw
+ // Update the ListWidget, select the new item, and force a redraw
updateListing();
+ selectGame(domain);
draw();
} else {
// User aborted, remove the the new domain again
Index: launcher.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/launcher.h,v
retrieving revision 1.19
retrieving revision 1.19.2.1
diff -u -d -r1.19 -r1.19.2.1
--- launcher.h 1 Oct 2004 21:12:18 -0000 1.19
+++ launcher.h 5 Jan 2005 01:43:33 -0000 1.19.2.1
@@ -56,6 +56,8 @@
virtual void addGame();
void removeGame(int item);
void editGame(int item);
+
+ void selectGame(const String &name);
};
} // End of namespace GUI
More information about the Scummvm-git-logs
mailing list