ui: Added cancel button to enter license window

This commit is contained in:
Eberhard Graether
2016-04-26 18:28:57 +02:00
parent 9a92422984
commit 3d2d434125
4 changed files with 24 additions and 6 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ if [ $PLATFORM == "Linux" ] || [ $PLATFORM == "MacOS" ]; then
cd build/Debug && cmake -G Ninja -DCMAKE_BUILD_TYPE="Debug" ../.. cd build/Debug && cmake -G Ninja -DCMAKE_BUILD_TYPE="Debug" ../..
echo -e $INFO "run cmake with Release configuration" echo -e $INFO "run cmake with Release configuration"
cd ../Release && cmake -G Ninja -DCMAKE_BUILD_TYPE="Release" ../.. cd ../Release && cmake -G Xcode -DCMAKE_BUILD_TYPE="Release" ../..
fi fi
echo -e $SUCCESS "setup complete" echo -e $SUCCESS "setup complete"
+18 -3
View File
@@ -13,6 +13,7 @@
QtLicense::QtLicense(QWidget *parent) QtLicense::QtLicense(QWidget *parent)
: QtWindow(parent) : QtWindow(parent)
, m_forced(false)
{ {
raise(); raise();
} }
@@ -45,6 +46,15 @@ void QtLicense::load()
{ {
m_licenseText->setText(licenseString.c_str()); m_licenseText->setText(licenseString.c_str());
} }
m_forced = false;
updateCloseButton("Cancel");
}
void QtLicense::loadForced()
{
m_forced = true;
updateCloseButton("Quit Coati");
} }
void QtLicense::setErrorMessage(const QString& errorMessage) void QtLicense::setErrorMessage(const QString& errorMessage)
@@ -122,14 +132,19 @@ void QtLicense::windowReady()
updateNextButton("Activate"); updateNextButton("Activate");
setPreviousVisible(false); setPreviousVisible(false);
updateCloseButton("Quit Coati");
m_title->hide(); m_title->hide();
} }
void QtLicense::handleClose() void QtLicense::handleClose()
{ {
QApplication::quit(); if (m_forced)
{
QApplication::quit();
}
else
{
emit canceled();
}
} }
void QtLicense::handleNext() void QtLicense::handleNext()
+3
View File
@@ -18,6 +18,7 @@ public:
void clear(); void clear();
void load(); void load();
void loadForced();
void setErrorMessage(const QString& errorMessage); void setErrorMessage(const QString& errorMessage);
@@ -32,6 +33,8 @@ protected:
private: private:
QTextEdit* m_licenseText; QTextEdit* m_licenseText;
QLabel* m_errorLabel; QLabel* m_errorLabel;
bool m_forced;
}; };
#endif // QT_LICENSE_H #endif // QT_LICENSE_H
+2 -2
View File
@@ -282,9 +282,10 @@ void QtMainWindow::forceEnterLicense(bool expired)
enterLicenseWindow->clear(); enterLicenseWindow->clear();
} }
enterLicenseWindow->loadForced();
this->setEnabled(false); this->setEnabled(false);
enterLicenseWindow->setEnabled(true); enterLicenseWindow->setEnabled(true);
enterLicenseWindow->setCloseVisible(true);
} }
bool QtMainWindow::event(QEvent* event) bool QtMainWindow::event(QEvent* event)
@@ -348,7 +349,6 @@ void QtMainWindow::enterLicense()
connect(enterLicenseWindow, SIGNAL(finished()), this, SLOT(activateWindow())); connect(enterLicenseWindow, SIGNAL(finished()), this, SLOT(activateWindow()));
enterLicenseWindow->load(); enterLicenseWindow->load();
enterLicenseWindow->setCloseVisible(false);
} }
void QtMainWindow::showStartScreen() void QtMainWindow::showStartScreen()