Skip to content

Commit

Permalink
#5629 Show the main window behind the activation dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
SymlessRemoved authored and Andrew Nelless committed Oct 4, 2016
1 parent 3b33083 commit 6b8c370
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
23 changes: 15 additions & 8 deletions src/gui/src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,8 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
}

updateLocalFingerprint();
}

void
MainWindow::showEvent(QShowEvent* event) {
QMainWindow::showEvent (event);
if (!m_AppConfig.activationHasRun() && (m_AppConfig.edition() == Unregistered)) {
ActivationDialog activationDialog (this, m_AppConfig);
activationDialog.exec();
}
connect (this, SIGNAL(windowShown()), this, SLOT(on_windowShown()), Qt::QueuedConnection);
}

MainWindow::~MainWindow()
Expand Down Expand Up @@ -518,6 +511,12 @@ void MainWindow::proofreadInfo()
setSynergyState((qSynergyState)oldState);
}

void MainWindow::showEvent(QShowEvent* event)
{
QMainWindow::showEvent(event);
emit windowShown();
}

void MainWindow::clearLog()
{
m_pLogOutput->clear();
Expand Down Expand Up @@ -1367,6 +1366,14 @@ void MainWindow::bonjourInstallFinished()
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()
{
CoreInterface coreInterface;
Expand Down
8 changes: 7 additions & 1 deletion src/gui/src/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void serverDetected(const QString name);
void setEdition(int edition);
void updateLocalFingerprint();

public slots:
void appendLogRaw(const QString& text);
void appendLogInfo(const QString& text);
Expand Down Expand Up @@ -182,7 +183,8 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void restartSynergy();
void proofreadInfo();

void showEvent(QShowEvent *event);
void showEvent (QShowEvent*);

private:
QSettings& m_Settings;
AppConfig& m_AppConfig;
Expand Down Expand Up @@ -217,6 +219,10 @@ private slots:
void on_m_pComboServerList_currentIndexChanged(QString );
void on_m_pButtonApply_clicked();
void installBonjour();
void on_windowShown();

signals:
void windowShown();
};

#endif
Expand Down

0 comments on commit 6b8c370

Please sign in to comment.