aboutsummaryrefslogtreecommitdiff
path: root/gui/massadd.cpp
diff options
context:
space:
mode:
authorLittleboy2011-03-31 06:35:43 -0400
committerJulien2011-06-16 10:36:33 -0400
commit2be35013f1d014620f222da9ed32110ce77814da (patch)
tree3d40ad1e600f0d624ba9fa001e7729b118b6cbf6 /gui/massadd.cpp
parentcd7822a29f22fd290a86281d65b965d32f667a49 (diff)
downloadscummvm-rg350-2be35013f1d014620f222da9ed32110ce77814da.tar.gz
scummvm-rg350-2be35013f1d014620f222da9ed32110ce77814da.tar.bz2
scummvm-rg350-2be35013f1d014620f222da9ed32110ce77814da.zip
BACKENDS: Add progress to MassAdd dialog
Diffstat (limited to 'gui/massadd.cpp')
-rw-r--r--gui/massadd.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/gui/massadd.cpp b/gui/massadd.cpp
index b0adce3f47..1578e75b25 100644
--- a/gui/massadd.cpp
+++ b/gui/massadd.cpp
@@ -24,6 +24,7 @@
#include "common/config-manager.h"
#include "common/debug.h"
#include "common/system.h"
+#include "common/taskbar.h"
#include "common/translation.h"
#include "gui/launcher.h" // For addGameToConf()
@@ -60,6 +61,7 @@ MassAddDialog::MassAddDialog(const Common::FSNode &startDir)
: Dialog("MassAdd"),
_dirsScanned(0),
_oldGamesCount(0),
+ _dirTotal(0),
_okButton(0),
_dirProgressText(0),
_gameProgressText(0) {
@@ -130,6 +132,9 @@ struct GameDescLess {
void MassAddDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
+ // Remove progress bar from taskbar
+ g_system->getTaskbarManager()->setProgressState(Common::TaskbarManager::kTaskbarNoProgress);
+
// FIXME: It's a really bad thing that we use two arbitrary constants
if (cmd == kOkCmd) {
// Sort the detected games. This is not strictly necessary, but nice for
@@ -226,10 +231,14 @@ void MassAddDialog::handleTickle() {
for (Common::FSList::const_iterator file = files.begin(); file != files.end(); ++file) {
if (file->isDirectory()) {
_scanStack.push(*file);
+
+ _dirTotal++;
}
}
_dirsScanned++;
+
+ g_system->getTaskbarManager()->setProgressValue(_dirsScanned, _dirTotal);
}