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
+18 -3
View File
@@ -13,6 +13,7 @@
QtLicense::QtLicense(QWidget *parent)
: QtWindow(parent)
, m_forced(false)
{
raise();
}
@@ -45,6 +46,15 @@ void QtLicense::load()
{
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)
@@ -122,14 +132,19 @@ void QtLicense::windowReady()
updateNextButton("Activate");
setPreviousVisible(false);
updateCloseButton("Quit Coati");
m_title->hide();
}
void QtLicense::handleClose()
{
QApplication::quit();
if (m_forced)
{
QApplication::quit();
}
else
{
emit canceled();
}
}
void QtLicense::handleNext()
+3
View File
@@ -18,6 +18,7 @@ public:
void clear();
void load();
void loadForced();
void setErrorMessage(const QString& errorMessage);
@@ -32,6 +33,8 @@ protected:
private:
QTextEdit* m_licenseText;
QLabel* m_errorLabel;
bool m_forced;
};
#endif // QT_LICENSE_H
+2 -2
View File
@@ -282,9 +282,10 @@ void QtMainWindow::forceEnterLicense(bool expired)
enterLicenseWindow->clear();
}
enterLicenseWindow->loadForced();
this->setEnabled(false);
enterLicenseWindow->setEnabled(true);
enterLicenseWindow->setCloseVisible(true);
}
bool QtMainWindow::event(QEvent* event)
@@ -348,7 +349,6 @@ void QtMainWindow::enterLicense()
connect(enterLicenseWindow, SIGNAL(finished()), this, SLOT(activateWindow()));
enterLicenseWindow->load();
enterLicenseWindow->setCloseVisible(false);
}
void QtMainWindow::showStartScreen()