Change PluginWizardPage to take and use MainWindow instead of appConfig #4823

This commit is contained in:
Adam Potolsky 2015-06-23 17:11:39 -07:00
parent 19f5ad8cab
commit 6442bcb8f6
3 changed files with 13 additions and 6 deletions

View File

@ -22,16 +22,18 @@
#include "FileSysClient.h"
#include "WebClient.h"
#include "PluginManager.h"
#include "MainWindow.h"
#include <QMovie>
#include <QThread>
#include <QTime>
PluginWizardPage::PluginWizardPage(AppConfig& appConfig, QWidget *parent) :
PluginWizardPage::PluginWizardPage(MainWindow& mainWindow, QWidget *parent) :
QWizardPage(parent),
m_Finished(false),
m_pFileSysClient(NULL),
m_pSslCertificate(NULL),
m_AppConfig(appConfig)
m_mainWindow(mainWindow)
{
setupUi(this);
@ -77,14 +79,18 @@ void PluginWizardPage::queryPluginDone()
showFinished();
}
else {
m_mainWindow.stopSynergy();
m_mainWindow.delay(5);
copyPlugins();
m_mainWindow.startSynergy();
m_mainWindow.delay(5);
}
}
void PluginWizardPage::finished()
{
// TODO: we should check if ns plugin exists
m_AppConfig.setCryptoEnabled(true);
m_mainWindow.appConfig().setCryptoEnabled(true);
updateStatus(tr("Plugins installed successfully."));
showFinished();

View File

@ -27,13 +27,14 @@
class FileSysClient;
class WebClient;
class SslCertificate;
class MainWindow;
class PluginWizardPage : public QWizardPage, public Ui::PluginWizardPage {
Q_OBJECT
public:
PluginWizardPage(AppConfig& appConfig, QWidget *parent = 0);
PluginWizardPage(MainWindow& mainWindow, QWidget *parent = 0);
~PluginWizardPage();
void setFinished(bool b) { m_Finished = b; }
@ -66,6 +67,6 @@ private:
PluginManager m_PluginManager;
SslCertificate* m_pSslCertificate;
QThread* m_pThread;
AppConfig& m_AppConfig;
MainWindow& m_mainWindow;
};
#endif // PLUGINWIZARDPAGE_H

View File

@ -30,7 +30,7 @@ SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) :
m_Edition(Unknown)
{
setupUi(this);
m_pPluginPage = new PluginWizardPage(mainWindow.appConfig());
m_pPluginPage = new PluginWizardPage(mainWindow);
addPage(m_pPluginPage);
#if defined(Q_OS_MAC)