aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/wince/CELauncherDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/wince/CELauncherDialog.cpp')
-rw-r--r--backends/platform/wince/CELauncherDialog.cpp53
1 files changed, 15 insertions, 38 deletions
diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp
index 8824af732f..9c832dd585 100644
--- a/backends/platform/wince/CELauncherDialog.cpp
+++ b/backends/platform/wince/CELauncherDialog.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
// Disable symbol overrides so that we can use system headers.
@@ -50,12 +47,9 @@ public:
CEAboutDialog()
: Dialog(10, 60, 300, 77) {
char tempo[100];
-
- // FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what
- // needs fixing, or remove it!
const int buttonWidth = g_gui.xmlEval()->getVar("Globals.Button.Width", 0);
const int buttonHeight = g_gui.xmlEval()->getVar("Globals.Button.Height", 0);
- new ButtonWidget(this, (_w - buttonWidth) / 2, 45, buttonWidth, buttonHeight, _("OK"), 0, kCloseCmd, '\r'); // Close dialog - FIXME
+ new ButtonWidget(this, (_w - buttonWidth) / 2, 55, buttonWidth, buttonHeight, _("OK"), 0, kCloseCmd, '\r');
Common::String videoDriver(_("Using SDL driver "));
SDL_VideoDriverName(tempo, sizeof(tempo));
@@ -64,7 +58,7 @@ public:
Common::String displayInfos(_("Display "));
sprintf(tempo, "%dx%d (real %dx%d)", GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), OSystem_WINCE3::getScreenWidth(), OSystem_WINCE3::getScreenHeight());
displayInfos += tempo;
- new StaticTextWidget(this, 0, 20, _w, kLineHeight, displayInfos, Graphics::kTextAlignCenter);
+ new StaticTextWidget(this, 0, 30, _w, kLineHeight, displayInfos, Graphics::kTextAlignCenter);
}
};
@@ -79,39 +73,22 @@ void CELauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 d
}
}
-void CELauncherDialog::automaticScanDirectory(const Common::FSNode &node) {
- // First check if we have a recognized game in the current directory
- Common::FSList files;
- node.getChildren(files, Common::FSNode::kListFilesOnly);
- // detect
- GameList candidates(EngineMan.detectGames(files));
- // insert
- if (candidates.size() >= 1) {
- GameDescriptor result = candidates[0];
- result["path"] = node.getPath();
- addGameToConf(result);
- }
- // Then recurse on the subdirectories
- Common::FSList dirs;
- node.getChildren(dirs, Common::FSNode::kListDirectoriesOnly);
- for (Common::FSList::const_iterator currentDir = dirs.begin(); currentDir != dirs.end(); ++currentDir)
- automaticScanDirectory(*currentDir);
-
-}
-
-/* FIXME: We do this here, replicating code of the launcher, because findfirst/next
- * returns some illegal paths atm.
- */
void CELauncherDialog::addGame() {
MessageDialog alert(_("Do you want to perform an automatic scan ?"), _("Yes"), _("No"));
if (alert.runModal() == kMessageOK && _browser->runModal() > 0) {
- // Clear existing domains
- ConfigManager::DomainMap &domains = (ConfigManager::DomainMap &)ConfMan.getGameDomains();
- domains.clear();
- ConfMan.flushToDisk();
- automaticScanDirectory(_browser->getResult());
- ConfMan.flushToDisk();
- updateListing();
+ MassAddDialog massAddDlg(_browser->getResult());
+
+ massAddDlg.runModal();
+
+ // Update the ListWidget and force a redraw
+
+ // If new target(s) were added, update the ListWidget and move
+ // the selection to to first newly detected game.
+ Common::String newTarget = massAddDlg.getFirstAddedTarget();
+ if (!newTarget.empty()) {
+ updateListing();
+ selectTarget(newTarget);
+ }
draw();
} else
GUILauncherDialog::addGame();