#5629 Show the main window behind the activation dialog

This commit is contained in:
Andrew Nelless 2016-10-04 11:48:47 +01:00
parent 16ef224ba8
commit 15f2e27d18
2 changed files with 22 additions and 9 deletions

View File

@ -145,15 +145,8 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
} }
updateLocalFingerprint(); updateLocalFingerprint();
}
void connect (this, SIGNAL(windowShown()), this, SLOT(on_windowShown()), Qt::QueuedConnection);
MainWindow::showEvent(QShowEvent* event) {
QMainWindow::showEvent (event);
if (!m_AppConfig.activationHasRun() && (m_AppConfig.edition() == Unregistered)) {
ActivationDialog activationDialog (this, m_AppConfig);
activationDialog.exec();
}
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
@ -518,6 +511,12 @@ void MainWindow::proofreadInfo()
setSynergyState((qSynergyState)oldState); setSynergyState((qSynergyState)oldState);
} }
void MainWindow::showEvent(QShowEvent* event)
{
QMainWindow::showEvent(event);
emit windowShown();
}
void MainWindow::clearLog() void MainWindow::clearLog()
{ {
m_pLogOutput->clear(); m_pLogOutput->clear();
@ -1367,6 +1366,14 @@ void MainWindow::bonjourInstallFinished()
m_pCheckBoxAutoConfig->setChecked(true); m_pCheckBoxAutoConfig->setChecked(true);
} }
void MainWindow::on_windowShown()
{
if (!m_AppConfig.activationHasRun() && (m_AppConfig.edition() == Unregistered)) {
ActivationDialog activationDialog (this, m_AppConfig);
activationDialog.exec();
}
}
QString MainWindow::getProfileRootForArg() QString MainWindow::getProfileRootForArg()
{ {
CoreInterface coreInterface; CoreInterface coreInterface;

View File

@ -117,6 +117,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void serverDetected(const QString name); void serverDetected(const QString name);
void setEdition(int edition); void setEdition(int edition);
void updateLocalFingerprint(); void updateLocalFingerprint();
public slots: public slots:
void appendLogRaw(const QString& text); void appendLogRaw(const QString& text);
void appendLogInfo(const QString& text); void appendLogInfo(const QString& text);
@ -182,7 +183,8 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void restartSynergy(); void restartSynergy();
void proofreadInfo(); void proofreadInfo();
void showEvent(QShowEvent *event); void showEvent (QShowEvent*);
private: private:
QSettings& m_Settings; QSettings& m_Settings;
AppConfig& m_AppConfig; AppConfig& m_AppConfig;
@ -217,6 +219,10 @@ private slots:
void on_m_pComboServerList_currentIndexChanged(QString ); void on_m_pComboServerList_currentIndexChanged(QString );
void on_m_pButtonApply_clicked(); void on_m_pButtonApply_clicked();
void installBonjour(); void installBonjour();
void on_windowShown();
signals:
void windowShown();
}; };
#endif #endif