aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/vcsbase
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-05-18 12:26:18 +0200
committerTobias Hunger <tobias.hunger@theqtcompany.com>2015-05-18 10:53:05 +0000
commit097ff14be39a58d103628018d00583d02b714267 (patch)
tree122cf63f02fe442599b4c18dd3f31e226fa427e7 /src/plugins/vcsbase
parentebf051be27974dd4eac6a517c066e77777c7ae7a (diff)
VcsCommandPage: Disable back button when command is run
QWizard used to enable the back-button again after we were done disabling it. Change-Id: I14d756536de7d23cc4e6bac3a4e5a1d18b91f46d Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/vcsbase')
-rw-r--r--src/plugins/vcsbase/wizard/vcscommandpage.cpp8
-rw-r--r--src/plugins/vcsbase/wizard/vcscommandpage.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/vcsbase/wizard/vcscommandpage.cpp b/src/plugins/vcsbase/wizard/vcscommandpage.cpp
index 0ab6fa3e1a..d8d488eda2 100644
--- a/src/plugins/vcsbase/wizard/vcscommandpage.cpp
+++ b/src/plugins/vcsbase/wizard/vcscommandpage.cpp
@@ -41,6 +41,7 @@
#include <QDir>
#include <QDebug>
+#include <QTimer>
using namespace Core;
using namespace ProjectExplorer;
@@ -161,6 +162,13 @@ VcsCommandPage::VcsCommandPage()
void VcsCommandPage::initializePage()
{
+ // Delay real initialization till after QWizard is done with its setup.
+ // Otherwise QWizard will reset our disabled back button again.
+ QTimer::singleShot(0, this, &VcsCommandPage::delayedInitialize);
+}
+
+void VcsCommandPage::delayedInitialize()
+{
auto wiz = qobject_cast<JsonWizard *>(wizard());
QTC_ASSERT(wiz, return);
diff --git a/src/plugins/vcsbase/wizard/vcscommandpage.h b/src/plugins/vcsbase/wizard/vcscommandpage.h
index da8351e200..860f9f265b 100644
--- a/src/plugins/vcsbase/wizard/vcscommandpage.h
+++ b/src/plugins/vcsbase/wizard/vcscommandpage.h
@@ -69,6 +69,9 @@ public:
void setVersionControlId(const QString &id);
void setRunMessage(const QString &msg);
+private slots:
+ void delayedInitialize();
+
private:
QString m_vcsId;
QString m_repository;