aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCeRiAl2011-04-28 06:49:04 +0800
committerIsmail Khatib2011-05-18 06:04:25 +0800
commit70fdec6411f3754bf14285dd00b13461a3d868ad (patch)
tree8ab2017b6337f6b249561d2c3fe0151a6dc01410
parente46f7dc1c02165bad9c7fae6a8fe1fc0a95d70d9 (diff)
downloadscummvm-rg350-70fdec6411f3754bf14285dd00b13461a3d868ad.tar.gz
scummvm-rg350-70fdec6411f3754bf14285dd00b13461a3d868ad.tar.bz2
scummvm-rg350-70fdec6411f3754bf14285dd00b13461a3d868ad.zip
WINCE: Replace custom massadd with the global one (shows progress now)
Replaces the formerly custom WinCE massadd function (CELauncherDialog::automaticScanDirectory) with the global one, which is better because it shows progress (massadd in combination with a uncached plugin build takes a very long time to complete and user thinks device has crashed when no progress is shown). Also fixes the additional custom WinCE about dialog (text was cut off before).
-rw-r--r--backends/platform/wince/CELauncherDialog.cpp50
-rw-r--r--backends/platform/wince/CELauncherDialog.h2
2 files changed, 16 insertions, 36 deletions
diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp
index 7fb8782298..9c832dd585 100644
--- a/backends/platform/wince/CELauncherDialog.cpp
+++ b/backends/platform/wince/CELauncherDialog.cpp
@@ -47,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));
@@ -61,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);
}
};
@@ -76,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();
diff --git a/backends/platform/wince/CELauncherDialog.h b/backends/platform/wince/CELauncherDialog.h
index 974b63c15d..ac84cd3e21 100644
--- a/backends/platform/wince/CELauncherDialog.h
+++ b/backends/platform/wince/CELauncherDialog.h
@@ -26,6 +26,7 @@
#include "base/plugins.h"
#include "common/fs.h"
#include "gui/launcher.h"
+#include "gui/massadd.h"
class CELauncherDialog : public GUI::LauncherDialog {
public:
@@ -33,7 +34,6 @@ public:
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
protected:
void addGame();
- void automaticScanDirectory(const Common::FSNode &node);
};
typedef GUI::LauncherDialog GUILauncherDialog;