added download plugin page in wizard #4168

This commit is contained in:
XinyuHou 2015-02-05 15:52:50 +00:00
parent aa46fe91a7
commit 82b932b1c4
8 changed files with 217 additions and 3 deletions

View File

@ -14,7 +14,8 @@ FORMS += res/MainWindowBase.ui \
res/HotkeyDialogBase.ui \
res/SettingsDialogBase.ui \
res/SetupWizardBase.ui \
res/AddClientDialogBase.ui
res/AddClientDialogBase.ui \
res/PluginWizardPageBase.ui
SOURCES += src/main.cpp \
src/MainWindow.cpp \
src/AboutDialog.cpp \
@ -51,7 +52,8 @@ SOURCES += src/main.cpp \
src/DataDownloader.cpp \
src/AddClientDialog.cpp \
src/CommandProcess.cpp \
src/WebClient.cpp
src/WebClient.cpp \
src/PluginWizardPage.cpp
HEADERS += src/MainWindow.h \
src/AboutDialog.h \
src/ServerConfig.h \
@ -89,7 +91,8 @@ HEADERS += src/MainWindow.h \
src/AddClientDialog.h \
src/CommandProcess.h \
src/WebClient.h \
src/EditionType.h
src/EditionType.h \
src/PluginWizardPage.h
RESOURCES += res/Synergy.qrc
RC_FILE = res/win/Synergy.rc
macx {

View File

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PluginWizardPage</class>
<widget class="QWizardPage" name="PluginWizardPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Setup Synergy</string>
</property>
<property name="title">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QLabel" name="m_pLabelSpinning">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QLabel" name="m_pLabelTip">
<property name="text">
<string>Finalizing, please wait.</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -51,5 +51,6 @@
<file>lang/gui_zh-TW.qm</file>
<file>lang/Languages.xml</file>
<file>icons/16x16/money.png</file>
<file>image/spinning-wheel.gif</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -0,0 +1,43 @@
#include "PluginWizardPage.h"
#include "ui_PluginWizardPageBase.h"
#include <QMovie>
PluginWizardPage::PluginWizardPage(QWidget *parent) :
QWizardPage(parent),
m_Finished(false)
{
setupUi(this);
QMovie *movie = new QMovie(":/res/image/spinning-wheel.gif");
m_pLabelSpinning->setMovie(movie);
movie->start();
}
PluginWizardPage::~PluginWizardPage()
{
}
void PluginWizardPage::changeEvent(QEvent *e)
{
QWizardPage::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
retranslateUi(this);
break;
default:
break;
}
}
bool PluginWizardPage::isComplete() const
{
return m_Finished;
}
void PluginWizardPage::initializePage()
{
QWizardPage::initializePage();
m_Finished = true;
emit completeChanged();
}

View File

@ -0,0 +1,26 @@
#ifndef PLUGINWIZARDPAGE_H
#define PLUGINWIZARDPAGE_H
#include "ui_PluginWizardPageBase.h"
#include <QWizardPage>
class PluginWizardPage : public QWizardPage, public Ui::PluginWizardPage {
Q_OBJECT
public:
PluginWizardPage(QWidget *parent = 0);
~PluginWizardPage();
void setFinished(bool b) { m_Finished = b; }
bool isComplete() const;
void initializePage();
protected:
void changeEvent(QEvent *e);
private:
bool m_Finished;
};
#endif // PLUGINWIZARDPAGE_H

View File

@ -21,6 +21,7 @@
#include "EditionType.h"
#include "QSynergyApplication.h"
#include "QUtility.h"
#include "PluginWizardPage.h"
#include <QMessageBox>
@ -30,6 +31,8 @@ SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) :
m_Edition(Unknown)
{
setupUi(this);
m_pPluginPage = new PluginWizardPage();
addPage(m_pPluginPage);
#if defined(Q_OS_MAC)

View File

@ -44,6 +44,7 @@ private:
bool m_StartMain;
SynergyLocale m_Locale;
int m_Edition;
QWizardPage* m_pPluginPage;
private slots:
void on_m_pRadioButtonActivate_toggled(bool checked);