|
|
@@ -101,7 +101,8 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig, |
|
|
m_BonjourInstall(NULL),
|
|
|
m_SuppressEmptyServerWarning(false),
|
|
|
m_ExpectedRunningState(kStopped),
|
|
|
- m_pSslCertificate(NULL)
|
|
|
+ m_pSslCertificate(NULL),
|
|
|
+ m_ActivationDialogRunning(false)
|
|
|
{
|
|
|
setupUi(this);
|
|
|
|
|
|
@@ -1167,6 +1168,14 @@ void MainWindow::on_m_pActionSettings_triggered() |
|
|
void MainWindow::autoAddScreen(const QString name)
|
|
|
{
|
|
|
if (!m_ServerConfig.ignoreAutoConfigClient()) {
|
|
|
+ if (m_ActivationDialogRunning) {
|
|
|
+ // TODO: refactor this code
|
|
|
+ // add this screen to the pending list and check this list until
|
|
|
+ // users finish activation dialog
|
|
|
+ m_PendingClientNames.append(name);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
int r = m_ServerConfig.autoAddScreen(name);
|
|
|
if (r != kAutoAddScreenOk) {
|
|
|
switch (r) {
|
|
|
@@ -1205,6 +1214,9 @@ void MainWindow::on_m_pButtonConfigureServer_clicked() |
|
|
void MainWindow::on_m_pActivate_triggered()
|
|
|
{
|
|
|
ActivationDialog activationDialog(this, appConfig(), licenseManager());
|
|
|
+ m_ActivationDialogRunning = true;
|
|
|
+ connect (&activationDialog, SIGNAL(finished(int)),
|
|
|
+ this, SLOT(on_activationDialogFinish()), Qt::QueuedConnection);
|
|
|
activationDialog.exec();
|
|
|
}
|
|
|
|
|
|
@@ -1424,10 +1436,25 @@ void MainWindow::on_windowShown() |
|
|
{
|
|
|
if (!m_AppConfig->activationHasRun() && (m_AppConfig->edition() == kUnregistered)) {
|
|
|
ActivationDialog activationDialog (this, appConfig(), licenseManager());
|
|
|
+ m_ActivationDialogRunning = true;
|
|
|
+ connect (&activationDialog, SIGNAL(finished(int)),
|
|
|
+ this, SLOT(on_activationDialogFinish()), Qt::QueuedConnection);
|
|
|
activationDialog.exec();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void MainWindow::on_activationDialogFinish()
|
|
|
+{
|
|
|
+ m_ActivationDialogRunning = false;
|
|
|
+ if (!m_PendingClientNames.empty()) {
|
|
|
+ foreach (const QString& name, m_PendingClientNames) {
|
|
|
+ autoAddScreen(name);
|
|
|
+ }
|
|
|
+
|
|
|
+ m_PendingClientNames.clear();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
QString MainWindow::getProfileRootForArg()
|
|
|
{
|
|
|
CoreInterface coreInterface;
|
|
|
|
0 comments on commit
dfc7c31