From 2be35013f1d014620f222da9ed32110ce77814da Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 31 Mar 2011 06:35:43 -0400 Subject: BACKENDS: Add progress to MassAdd dialog --- gui/massadd.cpp | 9 +++++++++ gui/massadd.h | 1 + 2 files changed, 10 insertions(+) (limited to 'gui') 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; -- cgit v1.2.3 From e1dc9cdc0b89609753d3558f9603bef1cc12f1d8 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Mon, 4 Apr 2011 12:49:49 -0400 Subject: BACKENDS: Add support for count status to TaskbarManager - Show the number of found games when using the massadd dialog --- gui/massadd.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'gui') diff --git a/gui/massadd.cpp b/gui/massadd.cpp index 1578e75b25..29a2b1886a 100644 --- a/gui/massadd.cpp +++ b/gui/massadd.cpp @@ -71,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); @@ -132,8 +132,9 @@ struct GameDescLess { void MassAddDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { - // Remove progress bar from taskbar + // Remove progress bar and count from taskbar g_system->getTaskbarManager()->setProgressState(Common::TaskbarManager::kTaskbarNoProgress); + g_system->getTaskbarManager()->setCount(0); // FIXME: It's a really bad thing that we use two arbitrary constants if (cmd == kOkCmd) { @@ -239,6 +240,7 @@ void MassAddDialog::handleTickle() { _dirsScanned++; g_system->getTaskbarManager()->setProgressValue(_dirsScanned, _dirTotal); + g_system->getTaskbarManager()->setCount(_games.size()); } -- cgit v1.2.3 From 96148345483dd0e7667f0b7541d5956524181dd5 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Fri, 29 Apr 2011 12:15:49 -0400 Subject: BACKENDS/COMMON/GUI: Remove complete support for TaskbarManager when taskbar integration is not enabled --- gui/massadd.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gui') diff --git a/gui/massadd.cpp b/gui/massadd.cpp index 29a2b1886a..70580e8b9c 100644 --- a/gui/massadd.cpp +++ b/gui/massadd.cpp @@ -132,9 +132,11 @@ 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) { @@ -239,8 +241,10 @@ void MassAddDialog::handleTickle() { _dirsScanned++; +#if defined(USE_TASKBAR) g_system->getTaskbarManager()->setProgressValue(_dirsScanned, _dirTotal); g_system->getTaskbarManager()->setCount(_games.size()); +#endif } -- cgit v1.2.3