Change PluginWizardPage to take and use MainWindow instead of appConfig #4823
This commit is contained in:
parent
19f5ad8cab
commit
6442bcb8f6
|
@ -22,16 +22,18 @@
|
||||||
#include "FileSysClient.h"
|
#include "FileSysClient.h"
|
||||||
#include "WebClient.h"
|
#include "WebClient.h"
|
||||||
#include "PluginManager.h"
|
#include "PluginManager.h"
|
||||||
|
#include "MainWindow.h"
|
||||||
|
|
||||||
#include <QMovie>
|
#include <QMovie>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
#include <QTime>
|
||||||
|
|
||||||
PluginWizardPage::PluginWizardPage(AppConfig& appConfig, QWidget *parent) :
|
PluginWizardPage::PluginWizardPage(MainWindow& mainWindow, QWidget *parent) :
|
||||||
QWizardPage(parent),
|
QWizardPage(parent),
|
||||||
m_Finished(false),
|
m_Finished(false),
|
||||||
m_pFileSysClient(NULL),
|
m_pFileSysClient(NULL),
|
||||||
m_pSslCertificate(NULL),
|
m_pSslCertificate(NULL),
|
||||||
m_AppConfig(appConfig)
|
m_mainWindow(mainWindow)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
|
@ -77,14 +79,18 @@ void PluginWizardPage::queryPluginDone()
|
||||||
showFinished();
|
showFinished();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
m_mainWindow.stopSynergy();
|
||||||
|
m_mainWindow.delay(5);
|
||||||
copyPlugins();
|
copyPlugins();
|
||||||
|
m_mainWindow.startSynergy();
|
||||||
|
m_mainWindow.delay(5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginWizardPage::finished()
|
void PluginWizardPage::finished()
|
||||||
{
|
{
|
||||||
// TODO: we should check if ns plugin exists
|
// TODO: we should check if ns plugin exists
|
||||||
m_AppConfig.setCryptoEnabled(true);
|
m_mainWindow.appConfig().setCryptoEnabled(true);
|
||||||
|
|
||||||
updateStatus(tr("Plugins installed successfully."));
|
updateStatus(tr("Plugins installed successfully."));
|
||||||
showFinished();
|
showFinished();
|
||||||
|
|
|
@ -27,13 +27,14 @@
|
||||||
class FileSysClient;
|
class FileSysClient;
|
||||||
class WebClient;
|
class WebClient;
|
||||||
class SslCertificate;
|
class SslCertificate;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class PluginWizardPage : public QWizardPage, public Ui::PluginWizardPage {
|
class PluginWizardPage : public QWizardPage, public Ui::PluginWizardPage {
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PluginWizardPage(AppConfig& appConfig, QWidget *parent = 0);
|
PluginWizardPage(MainWindow& mainWindow, QWidget *parent = 0);
|
||||||
~PluginWizardPage();
|
~PluginWizardPage();
|
||||||
|
|
||||||
void setFinished(bool b) { m_Finished = b; }
|
void setFinished(bool b) { m_Finished = b; }
|
||||||
|
@ -66,6 +67,6 @@ private:
|
||||||
PluginManager m_PluginManager;
|
PluginManager m_PluginManager;
|
||||||
SslCertificate* m_pSslCertificate;
|
SslCertificate* m_pSslCertificate;
|
||||||
QThread* m_pThread;
|
QThread* m_pThread;
|
||||||
AppConfig& m_AppConfig;
|
MainWindow& m_mainWindow;
|
||||||
};
|
};
|
||||||
#endif // PLUGINWIZARDPAGE_H
|
#endif // PLUGINWIZARDPAGE_H
|
||||||
|
|
|
@ -30,7 +30,7 @@ SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) :
|
||||||
m_Edition(Unknown)
|
m_Edition(Unknown)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
m_pPluginPage = new PluginWizardPage(mainWindow.appConfig());
|
m_pPluginPage = new PluginWizardPage(mainWindow);
|
||||||
addPage(m_pPluginPage);
|
addPage(m_pPluginPage);
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
|
|
Loading…
Reference in New Issue