ui: Added cancel button to enter license window
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user