summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/CMakeSetupDialog.cxx
diff options
context:
space:
mode:
authorJulien Jomier <julien.jomier@kitware.com>2018-11-17 13:01:23 (GMT)
committerJulien Jomier <julien.jomier@kitware.com>2018-11-20 16:16:08 (GMT)
commit9175a378f5d8786a54e35576853e7e6b068f17b0 (patch)
tree70efe7860c9b4f5447e5db7c80069cacb3ee0bae /Source/QtDialog/CMakeSetupDialog.cxx
parent7aa41095fd23d31a4572966ba53ad85f61f5bc99 (diff)
downloadCMake-9175a378f5d8786a54e35576853e7e6b068f17b0.zip
CMake-9175a378f5d8786a54e35576853e7e6b068f17b0.tar.gz
CMake-9175a378f5d8786a54e35576853e7e6b068f17b0.tar.bz2
QtDialog: Add windows taskbar progress
Diffstat (limited to 'Source/QtDialog/CMakeSetupDialog.cxx')
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 3761bd3..444a980 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -21,6 +21,11 @@
#include <QToolButton>
#include <QUrl>
+#ifdef QT_WINEXTRAS
+# include <QWinTaskbarButton>
+# include <QWinTaskbarProgress>
+#endif
+
#include "AddCacheEntry.h"
#include "FirstConfigure.h"
#include "QCMake.h"
@@ -294,6 +299,12 @@ void CMakeSetupDialog::initialize()
} else {
this->onBinaryDirectoryChanged(this->BinaryDirectory->lineEdit()->text());
}
+
+#ifdef QT_WINEXTRAS
+ this->TaskbarButton = new QWinTaskbarButton(this);
+ this->TaskbarButton->setWindow(this->windowHandle());
+ this->TaskbarButton->setOverlayIcon(QIcon(":/loading.png"));
+#endif
}
CMakeSetupDialog::~CMakeSetupDialog()
@@ -381,6 +392,10 @@ void CMakeSetupDialog::doConfigure()
this->CacheValues->scrollToTop();
}
this->ProgressBar->reset();
+
+#ifdef QT_WINEXTRAS
+ this->TaskbarButton->progress()->reset();
+#endif
}
bool CMakeSetupDialog::doConfigureInternal()
@@ -495,6 +510,9 @@ void CMakeSetupDialog::doGenerate()
this->enterState(ReadyConfigure);
this->ProgressBar->reset();
+#ifdef QT_WINEXTRAS
+ this->TaskbarButton->progress()->reset();
+#endif
this->ConfigureNeeded = true;
}
@@ -674,6 +692,12 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
{
percent = (percent * ProgressFactor) + ProgressOffset;
this->ProgressBar->setValue(qRound(percent * 100));
+
+#ifdef QT_WINEXTRAS
+ QWinTaskbarProgress* progress = this->TaskbarButton->progress();
+ progress->setVisible(true);
+ progress->setValue(qRound(percent * 100));
+#endif
}
void CMakeSetupDialog::error(const QString& msg)