diff options
author | Littleboy | 2011-03-31 06:35:43 -0400 |
---|---|---|
committer | Julien | 2011-06-16 10:36:33 -0400 |
commit | 2be35013f1d014620f222da9ed32110ce77814da (patch) | |
tree | 3d40ad1e600f0d624ba9fa001e7729b118b6cbf6 | |
parent | cd7822a29f22fd290a86281d65b965d32f667a49 (diff) | |
download | scummvm-rg350-2be35013f1d014620f222da9ed32110ce77814da.tar.gz scummvm-rg350-2be35013f1d014620f222da9ed32110ce77814da.tar.bz2 scummvm-rg350-2be35013f1d014620f222da9ed32110ce77814da.zip |
BACKENDS: Add progress to MassAdd dialog
-rw-r--r-- | gui/massadd.cpp | 9 | ||||
-rw-r--r-- | gui/massadd.h | 1 |
2 files changed, 10 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); } diff --git a/gui/massadd.h b/gui/massadd.h index 15cef7ba68..7350213835 100644 --- a/gui/massadd.h +++ b/gui/massadd.h @@ -60,6 +60,7 @@ private: int _dirsScanned; int _oldGamesCount; + int _dirTotal; Widget *_okButton; StaticTextWidget *_dirProgressText; |