Enable drag and drop by default #4122

Remove premium login from GUI
This commit is contained in:
Xinyu Hou 2014-10-14 17:20:57 +01:00
parent 70c8f98615
commit 38718a362f
12 changed files with 881 additions and 1362 deletions

19
.gitignore vendored
View File

@ -17,3 +17,22 @@
#doxygen #doxygen
/doc/doxygen /doc/doxygen
/doc/doxygen.cfg /doc/doxygen.cfg
build
cryptopp562
gmock-1.6.0
gtest-1.6.0
lib
/src/gui/Makefile.Debug
/src/gui/Makefile.Release
/src/gui/object_script.synergy.Debug
/src/gui/object_script.synergy.Release
/src/gui/Makefile
tmp
/src/gui/ui_ScreenSettingsDialogBase.h
/src/gui/ui_ServerConfigDialogBase.h
/src/gui/ui_SettingsDialogBase.h
/src/gui/ui_SetupWizardBase.h
/src/gui/ui_AboutDialogBase.h
/src/gui/ui_ActionDialogBase.h
/src/gui/ui_HotkeyDialogBase.h
/src/gui/ui_MainWindowBase.h

View File

@ -1,115 +1,113 @@
QT += widgets network QT += widgets \
network
TEMPLATE = app TEMPLATE = app
TARGET = synergy TARGET = synergy
DEPENDPATH += . \ DEPENDPATH += . \
res res
INCLUDEPATH += . \ INCLUDEPATH += . \
src src
FORMS += res/MainWindowBase.ui \ FORMS += res/MainWindowBase.ui \
res/AboutDialogBase.ui \ res/AboutDialogBase.ui \
res/ServerConfigDialogBase.ui \ res/ServerConfigDialogBase.ui \
res/ScreenSettingsDialogBase.ui \ res/ScreenSettingsDialogBase.ui \
res/ActionDialogBase.ui \ res/ActionDialogBase.ui \
res/HotkeyDialogBase.ui \ res/HotkeyDialogBase.ui \
res/SettingsDialogBase.ui \ res/SettingsDialogBase.ui \
res/SetupWizardBase.ui res/SetupWizardBase.ui
SOURCES += src/main.cpp \ SOURCES += src/main.cpp \
src/MainWindow.cpp \ src/MainWindow.cpp \
src/AboutDialog.cpp \ src/AboutDialog.cpp \
src/ServerConfig.cpp \ src/ServerConfig.cpp \
src/ServerConfigDialog.cpp \ src/ServerConfigDialog.cpp \
src/ScreenSetupView.cpp \ src/ScreenSetupView.cpp \
src/Screen.cpp \ src/Screen.cpp \
src/ScreenSetupModel.cpp \ src/ScreenSetupModel.cpp \
src/NewScreenWidget.cpp \ src/NewScreenWidget.cpp \
src/TrashScreenWidget.cpp \ src/TrashScreenWidget.cpp \
src/ScreenSettingsDialog.cpp \ src/ScreenSettingsDialog.cpp \
src/BaseConfig.cpp \ src/BaseConfig.cpp \
src/HotkeyDialog.cpp \ src/HotkeyDialog.cpp \
src/ActionDialog.cpp \ src/ActionDialog.cpp \
src/Hotkey.cpp \ src/Hotkey.cpp \
src/Action.cpp \ src/Action.cpp \
src/KeySequence.cpp \ src/KeySequence.cpp \
src/KeySequenceWidget.cpp \ src/KeySequenceWidget.cpp \
src/SettingsDialog.cpp \ src/SettingsDialog.cpp \
src/AppConfig.cpp \ src/AppConfig.cpp \
src/QSynergyApplication.cpp \ src/QSynergyApplication.cpp \
src/VersionChecker.cpp \ src/VersionChecker.cpp \
src/SetupWizard.cpp \ src/SetupWizard.cpp \
src/IpcClient.cpp \ src/IpcClient.cpp \
src/IpcReader.cpp \ src/IpcReader.cpp \
src/Ipc.cpp \ src/Ipc.cpp \
src/SynergyLocale.cpp \ src/SynergyLocale.cpp \
src/QUtility.cpp \ src/QUtility.cpp \
src/PremiumAuth.cpp \ src/ZeroconfServer.cpp \
src/ZeroconfServer.cpp \ src/ZeroconfThread.cpp \
src/ZeroconfThread.cpp \ src/ZeroconfRegister.cpp \
src/ZeroconfRegister.cpp \ src/ZeroconfBrowser.cpp \
src/ZeroconfBrowser.cpp \ src/ZeroconfService.cpp
src/ZeroconfService.cpp
HEADERS += src/MainWindow.h \ HEADERS += src/MainWindow.h \
src/AboutDialog.h \ src/AboutDialog.h \
src/ServerConfig.h \ src/ServerConfig.h \
src/ServerConfigDialog.h \ src/ServerConfigDialog.h \
src/ScreenSetupView.h \ src/ScreenSetupView.h \
src/Screen.h \ src/Screen.h \
src/ScreenSetupModel.h \ src/ScreenSetupModel.h \
src/NewScreenWidget.h \ src/NewScreenWidget.h \
src/TrashScreenWidget.h \ src/TrashScreenWidget.h \
src/ScreenSettingsDialog.h \ src/ScreenSettingsDialog.h \
src/BaseConfig.h \ src/BaseConfig.h \
src/HotkeyDialog.h \ src/HotkeyDialog.h \
src/ActionDialog.h \ src/ActionDialog.h \
src/Hotkey.h \ src/Hotkey.h \
src/Action.h \ src/Action.h \
src/KeySequence.h \ src/KeySequence.h \
src/KeySequenceWidget.h \ src/KeySequenceWidget.h \
src/SettingsDialog.h \ src/SettingsDialog.h \
src/AppConfig.h \ src/AppConfig.h \
src/QSynergyApplication.h \ src/QSynergyApplication.h \
src/VersionChecker.h \ src/VersionChecker.h \
src/SetupWizard.h \ src/SetupWizard.h \
src/IpcClient.h \ src/IpcClient.h \
src/IpcReader.h \ src/IpcReader.h \
src/Ipc.h \ src/Ipc.h \
src/SynergyLocale.h \ src/SynergyLocale.h \
src/QUtility.h \ src/QUtility.h \
src/PremiumAuth.h \ src/ZeroconfServer.h \
src/ZeroconfServer.h \ src/ZeroconfThread.h \
src/ZeroconfThread.h \ src/ZeroconfRegister.h \
src/ZeroconfRegister.h \ src/ZeroconfRecord.h \
src/ZeroconfRecord.h \ src/ZeroconfBrowser.h \
src/ZeroconfBrowser.h \ src/ZeroconfService.h
src/ZeroconfService.h
RESOURCES += res/Synergy.qrc RESOURCES += res/Synergy.qrc
RC_FILE = res/win/Synergy.rc RC_FILE = res/win/Synergy.rc
macx { macx {
HEADERS += src/AXDatabaseCleaner.h HEADERS += src/AXDatabaseCleaner.h
OBJECTIVE_SOURCES += src/AXDatabaseCleaner.mm OBJECTIVE_SOURCES += src/AXDatabaseCleaner.mm
QMAKE_INFO_PLIST = res/mac/Info.plist QMAKE_INFO_PLIST = res/mac/Info.plist
TARGET = Synergy TARGET = Synergy
QSYNERGY_ICON.files = res/mac/Synergy.icns QSYNERGY_ICON.files = res/mac/Synergy.icns
QSYNERGY_ICON.path = Contents/Resources QSYNERGY_ICON.path = Contents/Resources
QMAKE_BUNDLE_DATA += QSYNERGY_ICON QMAKE_BUNDLE_DATA += QSYNERGY_ICON
LIBS += $$MACX_LIBS LIBS += $$MACX_LIBS
}
unix:!macx {
LIBS += -ldns_sd
} }
unix:!macx:LIBS += -ldns_sd
debug { debug {
OBJECTS_DIR = tmp/debug OBJECTS_DIR = tmp/debug
MOC_DIR = tmp/debug MOC_DIR = tmp/debug
RCC_DIR = tmp/debug RCC_DIR = tmp/debug
} }
release { release {
OBJECTS_DIR = tmp/release OBJECTS_DIR = tmp/release
MOC_DIR = tmp/release MOC_DIR = tmp/release
RCC_DIR = tmp/release RCC_DIR = tmp/release
} }
win32 { win32 {
Debug:DESTDIR = ../../bin/Debug Debug:DESTDIR = ../../bin/Debug
Release:DESTDIR = ../../bin/Release Release:DESTDIR = ../../bin/Release
LIBS += -L"../../ext/bonjour/x64" -ldnssd LIBS += -L"../../ext/bonjour/x64" \
INCLUDEPATH += "$(BONJOUR_SDK_HOME)/Include" -ldnssd
INCLUDEPATH += "$(BONJOUR_SDK_HOME)/Include"
} }
else:DESTDIR = ../../bin else:DESTDIR = ../../bin

File diff suppressed because it is too large Load Diff

View File

@ -1,443 +1,245 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>SetupWizardBase</class> <class>SetupWizardBase</class>
<widget class="QWizard" name="SetupWizardBase"> <widget class="QWizard" name="SetupWizardBase">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>556</width> <width>556</width>
<height>464</height> <height>464</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>500</width> <width>500</width>
<height>390</height> <height>390</height>
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Setup Synergy</string> <string>Setup Synergy</string>
</property> </property>
<widget class="QWizardPage" name="m_pWelcomePage"> <widget class="QWizardPage" name="m_pWelcomePage">
<property name="title"> <property name="title">
<string>Welcome</string> <string>Welcome</string>
</property> </property>
<property name="subTitle"> <property name="subTitle">
<string notr="true"/> <string notr="true"/>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Thanks for installing Synergy!</string> <string>Thanks for installing Synergy!</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_6"> <spacer name="verticalSpacer_6">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum> <enum>QSizePolicy::Fixed</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>10</height> <height>10</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<layout class="QFormLayout" name="formLayout_3"> <layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string notr="true">&amp;Language:</string> <string notr="true">&amp;Language:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>m_pComboLanguage</cstring> <cstring>m_pComboLanguage</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QComboBox" name="m_pComboLanguage"> <widget class="QComboBox" name="m_pComboLanguage">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>200</width> <width>200</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_7"> <spacer name="verticalSpacer_7">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum> <enum>QSizePolicy::Fixed</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>10</height> <height>10</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="label_5">
<property name="locale"> <property name="locale">
<locale language="English" country="UnitedKingdom"/> <locale language="English" country="UnitedKingdom"/>
</property> </property>
<property name="text"> <property name="text">
<string>Synergy lets you easily share your mouse and keyboard between multiple computers on your desk, and it's Free and Open Source. Just move your mouse off the edge of one computer's screen on to another. You can even share all of your clipboards. All you need is a network connection. Synergy is cross-platform (works on Windows, Mac OS X and Linux).</string> <string>Synergy lets you easily share your mouse and keyboard between multiple computers on your desk, and it's Free and Open Source. Just move your mouse off the edge of one computer's screen on to another. You can even share all of your clipboards. All you need is a network connection. Synergy is cross-platform (works on Windows, Mac OS X and Linux).</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWizardPage" name="m_pPremiumUserPage"> <widget class="QWizardPage" name="m_pNodePage">
<property name="title"> <property name="sizePolicy">
<string>Synergy Premium</string> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
</property> <horstretch>0</horstretch>
<layout class="QVBoxLayout" name="verticalLayout_4"> <verstretch>0</verstretch>
<item> </sizepolicy>
<widget class="QRadioButton" name="m_pRadioButtonPremiumLogin"> </property>
<property name="text"> <property name="title">
<string>I donated to Synergy and have a premium login...</string> <string>Server or Client?</string>
</property> </property>
</widget> <property name="subTitle">
</item> <string/>
<item> </property>
<layout class="QFormLayout" name="formLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item row="0" column="0"> <item>
<widget class="QLabel" name="m_pLabel_28"> <widget class="QRadioButton" name="m_pServerRadioButton">
<property name="sizePolicy"> <property name="font">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <font>
<horstretch>0</horstretch> <weight>75</weight>
<verstretch>0</verstretch> <bold>true</bold>
</sizepolicy> </font>
</property> </property>
<property name="minimumSize"> <property name="text">
<size> <string>&amp;Server (share this computer's mouse and keyboard)</string>
<width>100</width> </property>
<height>0</height> </widget>
</size> </item>
</property> <item>
<property name="font"> <widget class="QLabel" name="m_pClientLabel">
<font> <property name="minimumSize">
<weight>75</weight> <size>
<bold>true</bold> <width>0</width>
</font> <height>0</height>
</property> </size>
<property name="text"> </property>
<string>&amp;Email:</string> <property name="text">
</property> <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
<property name="indent"> &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
<number>10</number> p, li { white-space: pre-wrap; }
</property> &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
<property name="buddy"> &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;My main mouse and keyboard are connected to this computer. This will allow you to move your mouse over to another computer's screen. There can only be one server in your setup.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<cstring>m_pLineEditPremiumEmail</cstring> </property>
</property> <property name="wordWrap">
</widget> <bool>true</bool>
</item> </property>
<item row="0" column="1"> </widget>
<widget class="QLineEdit" name="m_pLineEditPremiumEmail"> </item>
<property name="enabled"> <item>
<bool>true</bool> <spacer name="verticalSpacer">
</property> <property name="orientation">
<property name="sizePolicy"> <enum>Qt::Vertical</enum>
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> </property>
<horstretch>0</horstretch> <property name="sizeType">
<verstretch>0</verstretch> <enum>QSizePolicy::Fixed</enum>
</sizepolicy> </property>
</property> <property name="sizeHint" stdset="0">
<property name="minimumSize"> <size>
<size> <width>20</width>
<width>200</width> <height>20</height>
<height>0</height> </size>
</size> </property>
</property> </spacer>
<property name="sizeIncrement"> </item>
<size> <item>
<width>0</width> <widget class="QRadioButton" name="m_pClientRadioButton">
<height>0</height> <property name="font">
</size> <font>
</property> <weight>75</weight>
<property name="baseSize"> <bold>true</bold>
<size> </font>
<width>0</width> </property>
<height>0</height> <property name="text">
</size> <string>&amp;Client (use another computer's mouse and keyboard)</string>
</property> </property>
<property name="echoMode"> </widget>
<enum>QLineEdit::Normal</enum> </item>
</property> <item>
</widget> <widget class="QLabel" name="m_pServerLabel">
</item> <property name="minimumSize">
<item row="1" column="0"> <size>
<widget class="QLabel" name="m_pLabel_29"> <width>0</width>
<property name="minimumSize"> <height>0</height>
<size> </size>
<width>100</width> </property>
<height>0</height> <property name="text">
</size> <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
</property> &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
<property name="font"> p, li { white-space: pre-wrap; }
<font> &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
<weight>75</weight> &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;You have already set up a server. This computer will be controlled using the server's mouse and keyboard. There can be many clients in your setup.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<bold>true</bold> </property>
</font> <property name="wordWrap">
</property> <bool>true</bool>
<property name="text"> </property>
<string>&amp;Password:</string> </widget>
</property> </item>
<property name="indent"> <item>
<number>10</number> <spacer name="verticalSpacer_2">
</property> <property name="orientation">
<property name="buddy"> <enum>Qt::Vertical</enum>
<cstring>m_pLineEditPremiumPassword</cstring> </property>
</property> <property name="sizeType">
</widget> <enum>QSizePolicy::MinimumExpanding</enum>
</item> </property>
<item row="1" column="1"> <property name="sizeHint" stdset="0">
<widget class="QLineEdit" name="m_pLineEditPremiumPassword"> <size>
<property name="enabled"> <width>0</width>
<bool>true</bool> <height>0</height>
</property> </size>
<property name="sizePolicy"> </property>
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> </spacer>
<horstretch>0</horstretch> </item>
<verstretch>0</verstretch> </layout>
</sizepolicy> </widget>
</property> </widget>
<property name="minimumSize"> <tabstops>
<size> <tabstop>m_pComboLanguage</tabstop>
<width>200</width> <tabstop>m_pServerRadioButton</tabstop>
<height>0</height> <tabstop>m_pClientRadioButton</tabstop>
</size> </tabstops>
</property> <resources/>
<property name="sizeIncrement"> <connections/>
<size> </ui>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="m_pLabelForgotPassword">
<property name="text">
<string>&lt;a href=&quot;http://synergy-project.org/premium/reset/?source=gui&quot;&gt;Forgot password&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_12">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QRadioButton" name="m_pRadioButtonPremiumLater">
<property name="text">
<string>No, I have not donated to Synergy, skip this step</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_9">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>100</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="m_pNodePage">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Server or Client?</string>
</property>
<property name="subTitle">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QRadioButton" name="m_pServerRadioButton">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>&amp;Server (share this computer's mouse and keyboard)</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_pClientLabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;My main mouse and keyboard are connected to this computer. This will allow you to move your mouse over to another computer's screen. There can only be one server in your setup.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QRadioButton" name="m_pClientRadioButton">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>&amp;Client (use another computer's mouse and keyboard)</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_pServerLabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;You have already set up a server. This computer will be controlled using the server's mouse and keyboard. There can be many clients in your setup.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<tabstops>
<tabstop>m_pComboLanguage</tabstop>
<tabstop>m_pRadioButtonPremiumLogin</tabstop>
<tabstop>m_pLineEditPremiumEmail</tabstop>
<tabstop>m_pLineEditPremiumPassword</tabstop>
<tabstop>m_pRadioButtonPremiumLater</tabstop>
<tabstop>m_pServerRadioButton</tabstop>
<tabstop>m_pClientRadioButton</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -121,8 +121,6 @@ void AppConfig::loadSettings()
m_CryptoPass = settings().value("cryptoPass", "").toString(); m_CryptoPass = settings().value("cryptoPass", "").toString();
m_CryptoEnabled = settings().value("cryptoEnabled", false).toBool(); m_CryptoEnabled = settings().value("cryptoEnabled", false).toBool();
m_Language = settings().value("language", QLocale::system().name()).toString(); m_Language = settings().value("language", QLocale::system().name()).toString();
m_PremiumEmail = settings().value("premiumEmail", "").toString();
m_PremiumToken = settings().value("premiumToken", "").toString();
m_StartedBefore = settings().value("startedBefore", false).toBool(); m_StartedBefore = settings().value("startedBefore", false).toBool();
m_AutoConnect = settings().value("autoConnect", true).toBool(); m_AutoConnect = settings().value("autoConnect", true).toBool();
} }
@ -139,8 +137,6 @@ void AppConfig::saveSettings()
settings().setValue("cryptoPass", m_CryptoPass); settings().setValue("cryptoPass", m_CryptoPass);
settings().setValue("cryptoEnabled", m_CryptoEnabled); settings().setValue("cryptoEnabled", m_CryptoEnabled);
settings().setValue("language", m_Language); settings().setValue("language", m_Language);
settings().setValue("premiumEmail", m_PremiumEmail);
settings().setValue("premiumToken", m_PremiumToken);
settings().setValue("startedBefore", m_StartedBefore); settings().setValue("startedBefore", m_StartedBefore);
settings().setValue("autoConnect", m_AutoConnect); settings().setValue("autoConnect", m_AutoConnect);
} }
@ -161,13 +157,6 @@ void AppConfig::setCryptoPass(const QString &s)
} }
} }
bool AppConfig::isPremium()
{
QString hashSrc = m_PremiumEmail + getFirstMacAddress();
QString hashResult = hash(hashSrc);
return hashResult == m_PremiumToken;
}
void AppConfig::setAutoConnect(bool autoConnect) void AppConfig::setAutoConnect(bool autoConnect)
{ {
m_AutoConnect = autoConnect; m_AutoConnect = autoConnect;

View File

@ -30,7 +30,7 @@
// //
// 1: first version // 1: first version
// 2: added language page // 2: added language page
// 3: added premium page // 3: added premium page and removed
// //
const int kWizardVersion = 3; const int kWizardVersion = 3;
@ -67,8 +67,6 @@ class AppConfig
ProcessMode processMode() const { return m_ProcessMode; } ProcessMode processMode() const { return m_ProcessMode; }
bool wizardShouldRun() const { return m_WizardLastRun < kWizardVersion; } bool wizardShouldRun() const { return m_WizardLastRun < kWizardVersion; }
const QString& language() const { return m_Language; } const QString& language() const { return m_Language; }
const QString& premiumEmail() const { return m_PremiumEmail; }
const QString& premiumToken() const { return m_PremiumToken; }
bool startedBefore() const { return m_StartedBefore; } bool startedBefore() const { return m_StartedBefore; }
bool autoConnect() const { return m_AutoConnect; } bool autoConnect() const { return m_AutoConnect; }
void setAutoConnect(bool autoConnect); void setAutoConnect(bool autoConnect);
@ -80,7 +78,6 @@ class AppConfig
bool detectPath(const QString& name, QString& path); bool detectPath(const QString& name, QString& path);
void persistLogDir(); void persistLogDir();
bool isPremium();
protected: protected:
QSettings& settings() { return *m_pSettings; } QSettings& settings() { return *m_pSettings; }
@ -93,8 +90,6 @@ class AppConfig
void setCryptoEnabled(bool b) { m_CryptoEnabled = b; } void setCryptoEnabled(bool b) { m_CryptoEnabled = b; }
void setWizardHasRun() { m_WizardLastRun = kWizardVersion; } void setWizardHasRun() { m_WizardLastRun = kWizardVersion; }
void setLanguage(const QString language) { m_Language = language; } void setLanguage(const QString language) { m_Language = language; }
void setPremiumEmail(const QString premiumEmail) { m_PremiumEmail = premiumEmail; }
void setPremiumToken(const QString premiumToken) { m_PremiumToken = premiumToken; }
void setStartedBefore(bool b) { m_StartedBefore = b; } void setStartedBefore(bool b) { m_StartedBefore = b; }
void loadSettings(); void loadSettings();
@ -115,8 +110,6 @@ class AppConfig
QString m_CryptoPass; QString m_CryptoPass;
ProcessMode m_ProcessMode; ProcessMode m_ProcessMode;
QString m_Language; QString m_Language;
QString m_PremiumEmail;
QString m_PremiumToken;
bool m_StartedBefore; bool m_StartedBefore;
bool m_AutoConnect; bool m_AutoConnect;

View File

@ -128,8 +128,6 @@ MainWindow::~MainWindow()
void MainWindow::open() void MainWindow::open()
{ {
updatePremiumInfo();
createTrayIcon(); createTrayIcon();
showNormal(); showNormal();
@ -416,10 +414,9 @@ void MainWindow::startSynergy()
} }
#ifndef Q_OS_LINUX #ifndef Q_OS_LINUX
if (appConfig().isPremium())
{ args << "--enable-drag-drop";
args << "--enable-drag-drop";
}
#endif #endif
if ((synergyType() == synergyClient && !clientArgs(args, app)) if ((synergyType() == synergyClient && !clientArgs(args, app))
@ -781,7 +778,6 @@ void MainWindow::changeEvent(QEvent* event)
case QEvent::LanguageChange: case QEvent::LanguageChange:
retranslateUi(this); retranslateUi(this);
retranslateMenuBar(); retranslateMenuBar();
updatePremiumInfo();
break; break;
default: default:
@ -790,20 +786,6 @@ void MainWindow::changeEvent(QEvent* event)
} }
} }
void MainWindow::updatePremiumInfo()
{
if (m_AppConfig.isPremium())
{
m_pWidgetPremium->hide();
setWindowTitle(tr("Synergy Premium"));
}
else
{
m_pWidgetPremium->show();
setWindowTitle(tr("Synergy"));
}
}
void MainWindow::updateZeroconfService() void MainWindow::updateZeroconfService()
{ {
if (!m_AppConfig.wizardShouldRun()) { if (!m_AppConfig.wizardShouldRun()) {
@ -912,7 +894,6 @@ void MainWindow::on_m_pActionWizard_triggered()
{ {
SetupWizard wizard(*this, false); SetupWizard wizard(*this, false);
wizard.exec(); wizard.exec();
updatePremiumInfo();
} }
void MainWindow::on_m_pElevateCheckBox_toggled(bool checked) void MainWindow::on_m_pElevateCheckBox_toggled(bool checked)

View File

@ -147,7 +147,6 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void stopDesktop(); void stopDesktop();
void changeEvent(QEvent* event); void changeEvent(QEvent* event);
void retranslateMenuBar(); void retranslateMenuBar();
void updatePremiumInfo();
private: private:
QSettings& m_Settings; QSettings& m_Settings;

View File

@ -1,67 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2014 Bolton Software Ltd.
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file COPYING that should have accompanied this file.
*
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "PremiumAuth.h"
#include "QUtility.h"
#include <QProcess>
#include <QCoreApplication>
#include <stdexcept>
// we use syntool to authenticate because Qt's http library is very
// unreliable, and since we're writing platform specific code, use the
// synergy code since there we can use integ tests.
QString PremiumAuth::request(const QString& email, const QString& password)
{
QString program(QCoreApplication::applicationDirPath() + "/syntool");
QStringList args("--premium-auth");
QProcess process;
process.setReadChannel(QProcess::StandardOutput);
process.start(program, args);
bool success = process.waitForStarted();
QString out, error;
if (success)
{
// hash password in case it contains interesting chars.
QString credentials(email + ":" + hash(password) + "\n");
process.write(credentials.toStdString().c_str());
if (process.waitForFinished()) {
out = process.readAllStandardOutput();
error = process.readAllStandardError();
}
}
out = out.trimmed();
error = error.trimmed();
if (out.isEmpty() ||
!error.isEmpty() ||
!success ||
process.exitCode() != 0)
{
throw std::runtime_error(
QString("Code: %1\nError: %2")
.arg(process.exitCode())
.arg(error.isEmpty() ? "Unknown" : error)
.toStdString());
}
return out;
}

View File

@ -1,26 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2014 Bolton Software Ltd.
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file COPYING that should have accompanied this file.
*
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <QString>
class PremiumAuth
{
public:
QString request(const QString& email, const QString& password);
};

View File

@ -19,15 +19,8 @@
#include "MainWindow.h" #include "MainWindow.h"
#include "QSynergyApplication.h" #include "QSynergyApplication.h"
#include "QUtility.h" #include "QUtility.h"
#include "PremiumAuth.h"
#include <QMessageBox> #include <QMessageBox>
#include <QDesktopServices>
#include <QUrl>
#include <QNetworkRequest>
#include <QNetworkReply>
#define PREMIUM_REGISTER_URL "http://synergy-project.org/donate/?source=gui-wizard"
SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) : SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) :
m_MainWindow(mainWindow), m_MainWindow(mainWindow),
@ -58,13 +51,7 @@ SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) :
m_Locale.fillLanguageComboBox(m_pComboLanguage); m_Locale.fillLanguageComboBox(m_pComboLanguage);
setIndexFromItemData(m_pComboLanguage, m_MainWindow.appConfig().language()); setIndexFromItemData(m_pComboLanguage, m_MainWindow.appConfig().language());
AppConfig& appConfig = m_MainWindow.appConfig();
QString premiumEmail = appConfig.premiumEmail();
if (!premiumEmail.isEmpty())
{
m_pRadioButtonPremiumLogin->setChecked(true);
m_pLineEditPremiumEmail->setText(premiumEmail);
}
} }
SetupWizard::~SetupWizard() SetupWizard::~SetupWizard()
@ -89,32 +76,6 @@ bool SetupWizard::validateCurrentPage()
return false; return false;
} }
} }
else if (currentPage() == m_pPremiumUserPage)
{
if (m_pRadioButtonPremiumLogin->isChecked())
{
if (m_pLineEditPremiumEmail->text().isEmpty() ||
m_pLineEditPremiumPassword->text().isEmpty())
{
message.setText(tr("Please enter your email address and password."));
message.exec();
return false;
}
else if (!isPremiumLoginValid(message))
{
return false;
}
}
else if (m_pRadioButtonPremiumLater->isChecked())
{
return true;
}
else {
message.setText(tr("Please select an option."));
message.exec();
return false;
}
}
return true; return true;
} }
@ -144,19 +105,6 @@ void SetupWizard::accept()
AppConfig& appConfig = m_MainWindow.appConfig(); AppConfig& appConfig = m_MainWindow.appConfig();
appConfig.setLanguage(m_pComboLanguage->itemData(m_pComboLanguage->currentIndex()).toString()); appConfig.setLanguage(m_pComboLanguage->itemData(m_pComboLanguage->currentIndex()).toString());
appConfig.setPremiumEmail(m_pLineEditPremiumEmail->text());
if (!m_pRadioButtonPremiumLogin->isChecked())
{
appConfig.setPremiumToken("");
}
else
{
QString mac = getFirstMacAddress();
QString hashSrc = m_pLineEditPremiumEmail->text() + mac;
QString hashResult = hash(hashSrc);
appConfig.setPremiumToken(hashResult);
}
appConfig.setWizardHasRun(); appConfig.setWizardHasRun();
appConfig.saveSettings(); appConfig.saveSettings();
@ -205,65 +153,3 @@ void SetupWizard::on_m_pComboLanguage_currentIndexChanged(int index)
QString ietfCode = m_pComboLanguage->itemData(index).toString(); QString ietfCode = m_pComboLanguage->itemData(index).toString();
QSynergyApplication::getInstance()->switchTranslator(ietfCode); QSynergyApplication::getInstance()->switchTranslator(ietfCode);
} }
void SetupWizard::on_m_pRadioButtonPremiumLogin_toggled(bool checked)
{
m_pLineEditPremiumEmail->setEnabled(checked);
m_pLineEditPremiumPassword->setEnabled(checked);
}
bool SetupWizard::isPremiumLoginValid(QMessageBox& message)
{
QString email = m_pLineEditPremiumEmail->text();
QString password = m_pLineEditPremiumPassword->text();
QString responseJson;
try
{
PremiumAuth auth;
responseJson = auth.request(email, password);
}
catch (std::exception& e)
{
message.critical(
this, "Error",
tr("Sorry, an error occured while trying to sign in. "
"Please contact the help desk, and provide the "
"following details.\n\n%1")
.arg(e.what()));
return false;
}
QRegExp resultRegex(".*\"result\".*:.*(true|false).*");
if (resultRegex.exactMatch(responseJson)) {
QString boolString = resultRegex.cap(1);
if (boolString == "true") {
return true;
}
else if (boolString == "false") {
message.critical(
this, "Error",
tr("Login failed, invalid email or password."));
return false;
}
}
else {
QRegExp errorRegex(".*\"error\".*:.*\"(.+)\".*");
if (errorRegex.exactMatch(responseJson)) {
// replace "\n" with real new lines.
QString error = errorRegex.cap(1).replace("\\n", "\n");
message.critical(
this, "Error",
tr("Login failed, an error occurred.\n\n%1").arg(error));
return false;
}
}
message.critical(
this, "Error",
tr("Login failed, an error occurred.\n\nServer response:\n\n%1")
.arg(responseJson));
return false;
}

View File

@ -39,9 +39,6 @@ protected:
void accept(); void accept();
void reject(); void reject();
private:
bool isPremiumLoginValid(QMessageBox& message);
private: private:
MainWindow& m_MainWindow; MainWindow& m_MainWindow;
bool m_StartMain; bool m_StartMain;
@ -50,5 +47,4 @@ private:
private slots: private slots:
void on_m_pCheckBoxEnableCrypto_stateChanged(int ); void on_m_pCheckBoxEnableCrypto_stateChanged(int );
void on_m_pComboLanguage_currentIndexChanged(int index); void on_m_pComboLanguage_currentIndexChanged(int index);
void on_m_pRadioButtonPremiumLogin_toggled(bool checked);
}; };