diff options
author | Eugene Sandulenko | 2011-06-22 13:35:37 -0700 |
---|---|---|
committer | Eugene Sandulenko | 2011-06-22 13:35:37 -0700 |
commit | 33ce6e60fd98ea67e1e6606bfc7d693b27359bd7 (patch) | |
tree | 84caf43ce3848e1105a59539f2133471790ce760 /gui | |
parent | afdfff02f1415f66856f273fcf9f30d7621d8953 (diff) | |
parent | 154c584d44d689f0a7b521b49c5ce245a52fb992 (diff) | |
download | scummvm-rg350-33ce6e60fd98ea67e1e6606bfc7d693b27359bd7.tar.gz scummvm-rg350-33ce6e60fd98ea67e1e6606bfc7d693b27359bd7.tar.bz2 scummvm-rg350-33ce6e60fd98ea67e1e6606bfc7d693b27359bd7.zip |
Merge pull request #26 from Littleboy/taskbar
Taskbar integration
Diffstat (limited to 'gui')
-rw-r--r-- | gui/massadd.cpp | 23 | ||||
-rw-r--r-- | gui/massadd.h | 1 |
2 files changed, 20 insertions, 4 deletions
diff --git a/gui/massadd.cpp b/gui/massadd.cpp index b0adce3f47..70580e8b9c 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) { @@ -69,14 +71,14 @@ MassAddDialog::MassAddDialog(const Common::FSNode &startDir) // The dir we start our scan at _scanStack.push(startDir); -// Removed for now... Why would you put a title on mass add dialog called "Mass Add Dialog"? -// new StaticTextWidget(this, "massadddialog_caption", "Mass Add Dialog"); + // Removed for now... Why would you put a title on mass add dialog called "Mass Add Dialog"? + // new StaticTextWidget(this, "massadddialog_caption", "Mass Add Dialog"); _dirProgressText = new StaticTextWidget(this, "MassAdd.DirProgressText", - _("... progress ...")); + _("... progress ...")); _gameProgressText = new StaticTextWidget(this, "MassAdd.GameProgressText", - _("... progress ...")); + _("... progress ...")); _dirProgressText->setAlign(Graphics::kTextAlignCenter); _gameProgressText->setAlign(Graphics::kTextAlignCenter); @@ -130,6 +132,12 @@ struct GameDescLess { void MassAddDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { +#if defined(USE_TASKBAR) + // Remove progress bar and count from taskbar + g_system->getTaskbarManager()->setProgressState(Common::TaskbarManager::kTaskbarNoProgress); + g_system->getTaskbarManager()->setCount(0); +#endif + // 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 +234,17 @@ void MassAddDialog::handleTickle() { for (Common::FSList::const_iterator file = files.begin(); file != files.end(); ++file) { if (file->isDirectory()) { _scanStack.push(*file); + + _dirTotal++; } } _dirsScanned++; + +#if defined(USE_TASKBAR) + g_system->getTaskbarManager()->setProgressValue(_dirsScanned, _dirTotal); + g_system->getTaskbarManager()->setCount(_games.size()); +#endif } 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; |