View
@@ -221,7 +221,7 @@ MSWindowsClientTaskBarReceiver::primaryAction()
const IArchTaskBarReceiver::Icon
MSWindowsClientTaskBarReceiver::getIcon() const
{
- return reinterpret_cast<Icon>(m_icon[getStatus()]);
+ return static_cast<Icon>(m_icon[getStatus()]);
}
void
@@ -263,7 +263,7 @@ MSWindowsClientTaskBarReceiver::loadIcon(UINT id)
IMAGE_ICON,
0, 0,
LR_DEFAULTCOLOR);
- return reinterpret_cast<HICON>(icon);
+ return static_cast<HICON>(icon);
}
void
@@ -288,7 +288,7 @@ MSWindowsClientTaskBarReceiver::createWindow()
NULL,
(DLGPROC)&MSWindowsClientTaskBarReceiver::staticDlgProc,
reinterpret_cast<LPARAM>(
- reinterpret_cast<void*>(this)));
+ static_cast<void*>(this)));
// window should appear on top of everything, including (especially)
// the task bar.
@@ -337,7 +337,7 @@ MSWindowsClientTaskBarReceiver::staticDlgProc(HWND hwnd,
// and put it in the extra window data then forward the call.
MSWindowsClientTaskBarReceiver* self = NULL;
if (msg == WM_INITDIALOG) {
- self = reinterpret_cast<MSWindowsClientTaskBarReceiver*>(
+ self = static_cast<MSWindowsClientTaskBarReceiver*>(
reinterpret_cast<void*>(lParam));
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) lParam);
}
View
@@ -1,11 +1,11 @@
# synergy -- mouse and keyboard sharing utility
# Copyright (C) 2012-2016 Symless Ltd.
# Copyright (C) 2012 Nick Bolton
-#
+#
# 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 LICENSE 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
@@ -35,7 +35,7 @@ else()
endif()
target_link_libraries(synergyd
- arch base common io ipc mt net platform synergy ${libs})
+ arch base common io ipc mt net platform synergy shared ${libs} ${OPENSSL_LIBS})
if (CONF_CPACK)
install(TARGETS
View
@@ -63,7 +63,7 @@ else()
endif()
target_link_libraries(synergyp
- arch base client common io mt net ipc platform server synergy client ${libs})
+ arch base client common io mt net ipc platform server synergy client ${libs} ${OPENSSL_LIBS})
if (CONF_CPACK)
install(TARGETS
View
@@ -238,7 +238,7 @@ MSWindowsPortableTaskBarReceiver::primaryAction()
const IArchTaskBarReceiver::Icon
MSWindowsPortableTaskBarReceiver::getIcon() const
{
- return reinterpret_cast<Icon>(m_icon[getStatus()]);
+ return static_cast<Icon>(m_icon[getStatus()]);
}
void
@@ -280,7 +280,7 @@ MSWindowsPortableTaskBarReceiver::loadIcon(UINT id)
IMAGE_ICON,
0, 0,
LR_DEFAULTCOLOR);
- return reinterpret_cast<HICON>(icon);
+ return static_cast<HICON>(icon);
}
void
@@ -305,7 +305,7 @@ MSWindowsPortableTaskBarReceiver::createWindow()
NULL,
(DLGPROC)&MSWindowsPortableTaskBarReceiver::staticDlgProc,
reinterpret_cast<LPARAM>(
- reinterpret_cast<void*>(this)));
+ static_cast<void*>(this)));
// window should appear on top of everything, including (especially)
// the task bar.
@@ -354,15 +354,15 @@ MSWindowsPortableTaskBarReceiver::staticDlgProc(HWND hwnd,
// and put it in the extra window data then forward the call.
MSWindowsPortableTaskBarReceiver* self = NULL;
if (msg == WM_INITDIALOG) {
- self = reinterpret_cast<MSWindowsPortableTaskBarReceiver*>(
+ self = static_cast<MSWindowsPortableTaskBarReceiver*>(
reinterpret_cast<void*>(lParam));
SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
}
else {
// get the extra window data and forward the call
- LONG data = (LONG)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ LONG_PTR data = GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (data != 0) {
- self = reinterpret_cast<MSWindowsPortableTaskBarReceiver*>(
+ self = static_cast<MSWindowsPortableTaskBarReceiver*>(
reinterpret_cast<void*>(data));
}
}
View
@@ -58,7 +58,7 @@ endif()
add_executable(synergys ${sources})
target_link_libraries(synergys
- arch base client common io mt net ipc platform server synergy ${libs})
+ arch base client common io mt net ipc platform server synergy ${libs} ${OPENSSL_LIBS})
if (CONF_CPACK)
install(TARGETS
View
@@ -252,7 +252,7 @@ MSWindowsServerTaskBarReceiver::primaryAction()
const IArchTaskBarReceiver::Icon
MSWindowsServerTaskBarReceiver::getIcon() const
{
- return reinterpret_cast<Icon>(m_icon[getStatus()]);
+ return static_cast<Icon>(m_icon[getStatus()]);
}
void
@@ -294,7 +294,7 @@ MSWindowsServerTaskBarReceiver::loadIcon(UINT id)
IMAGE_ICON,
0, 0,
LR_DEFAULTCOLOR);
- return reinterpret_cast<HICON>(icon);
+ return static_cast<HICON>(icon);
}
void
@@ -319,7 +319,7 @@ MSWindowsServerTaskBarReceiver::createWindow()
NULL,
(DLGPROC)&MSWindowsServerTaskBarReceiver::staticDlgProc,
reinterpret_cast<LPARAM>(
- reinterpret_cast<void*>(this)));
+ static_cast<void*>(this)));
// window should appear on top of everything, including (especially)
// the task bar.
@@ -368,15 +368,15 @@ MSWindowsServerTaskBarReceiver::staticDlgProc(HWND hwnd,
// and put it in the extra window data then forward the call.
MSWindowsServerTaskBarReceiver* self = NULL;
if (msg == WM_INITDIALOG) {
- self = reinterpret_cast<MSWindowsServerTaskBarReceiver*>(
+ self = static_cast<MSWindowsServerTaskBarReceiver*>(
reinterpret_cast<void*>(lParam));
SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
}
else {
// get the extra window data and forward the call
- LONG data = (LONG)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ LONG_PTR data = GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (data != 0) {
- self = reinterpret_cast<MSWindowsServerTaskBarReceiver*>(
+ self = static_cast<MSWindowsServerTaskBarReceiver*>(
reinterpret_cast<void*>(data));
}
}
View
@@ -29,7 +29,7 @@ endif()
add_executable(syntool ${sources})
target_link_libraries(syntool
- synergy arch base client common io ipc mt net platform server ${libs})
+ synergy arch base client common io ipc mt net platform server ${libs} ${OPENSSL_LIBS})
if (CONF_CPACK)
install(TARGETS
View
@@ -7,7 +7,8 @@ DEFINES += VERSION_REVISION=\\\"$$QMAKE_VERSION_REVISION\\\"
DEPENDPATH += . \
res
INCLUDEPATH += . \
- src
+ src \
+ ../lib/shared/
FORMS += res/MainWindowBase.ui \
res/AboutDialogBase.ui \
res/ServerConfigDialogBase.ui \
@@ -17,7 +18,9 @@ FORMS += res/MainWindowBase.ui \
res/SettingsDialogBase.ui \
res/SetupWizardBase.ui \
res/AddClientDialogBase.ui \
- res/PluginWizardPageBase.ui
+ res/ActivationDialog.ui \
+ res/CancelActivationDialog.ui \
+ res/FailedLoginDialog.ui
SOURCES += src/main.cpp \
src/MainWindow.cpp \
src/AboutDialog.cpp \
@@ -54,16 +57,16 @@ SOURCES += src/main.cpp \
src/DataDownloader.cpp \
src/AddClientDialog.cpp \
src/CommandProcess.cpp \
- src/PluginWizardPage.cpp \
- src/PluginManager.cpp \
src/CoreInterface.cpp \
src/Fingerprint.cpp \
src/SslCertificate.cpp \
- src/Plugin.cpp \
src/WebClient.cpp \
- ../lib/common/PluginVersion.cpp \
- src/SubscriptionManager.cpp \
- src/ActivationNotifier.cpp
+ src/ActivationNotifier.cpp \
+ src/ActivationDialog.cpp \
+ src/CancelActivationDialog.cpp \
+ src/FailedLoginDialog.cpp \
+ ../lib/shared/SerialKey.cpp \
+ src/LicenseManager.cpp
HEADERS += src/MainWindow.h \
src/AboutDialog.h \
src/ServerConfig.h \
@@ -100,19 +103,19 @@ HEADERS += src/MainWindow.h \
src/DataDownloader.h \
src/AddClientDialog.h \
src/CommandProcess.h \
- src/EditionType.h \
- src/PluginWizardPage.h \
src/ProcessorArch.h \
- src/PluginManager.h \
src/CoreInterface.h \
src/Fingerprint.h \
src/SslCertificate.h \
- src/Plugin.h \
src/WebClient.h \
- ../lib/common/PluginVersion.h \
- src/SubscriptionManager.h \
src/ActivationNotifier.h \
- src/ElevateMode.h
+ src/ElevateMode.h \
+ src/ActivationDialog.h \
+ src/CancelActivationDialog.h \
+ src/FailedLoginDialog.h \
+ ../lib/shared/EditionType.h \
+ ../lib/shared/SerialKey.h \
+ src/LicenseManager.h
RESOURCES += res/Synergy.qrc
RC_FILE = res/win/Synergy.rc
macx {
View
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ActivationDialog</class>
+ <widget class="QDialog" name="ActivationDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>410</width>
+ <height>211</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Activate Synergy</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Serial key</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This can be found on your &lt;a href=&quot;https://symless.com/account/?source=gui&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;account&lt;/span&gt;&lt;/a&gt; page.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="openExternalLinks">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="m_pTextEditSerialKey">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="tabChangesFocus">
+ <bool>true</bool>
+ </property>
+ <property name="html">
+ <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:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="acceptRichText">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QWidget" name="m_trialWidget" native="true">
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <property name="leftMargin">
+ <number>2</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>8</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="Synergy.qrc">:/res/icons/16x16/money.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="m_trialLabel">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Your trial has expired. &lt;a href=&quot;http://symless.com/pricing?src=gui&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Buy now!&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="openExternalLinks">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <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>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>m_pTextEditSerialKey</tabstop>
+ </tabstops>
+ <resources>
+ <include location="Synergy.qrc"/>
+ </resources>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>ActivationDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>ActivationDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
View
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>CancelActivationDialog</class>
+ <widget class="QDialog" name="CancelActivationDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>165</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Cancel Activation</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Are you sure?
+
+If you don't activate Synergy you'll be missing out on some great features.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ <property name="openExternalLinks">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://symless.com/pricing?source=gui&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Buy now&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="openExternalLinks">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::No|QDialogButtonBox::Yes</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>CancelActivationDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>CancelActivationDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
View
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>FailedLoginDialog</class>
+ <widget class="QDialog" name="FailedLoginDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>165</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Activation Error</string>
+ </property>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="geometry">
+ <rect>
+ <x>50</x>
+ <y>120</y>
+ <width>341</width>
+ <height>32</height>
+ </rect>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Close</set>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_2">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>90</y>
+ <width>382</width>
+ <height>30</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://symless.com/account/reset/?source=gui&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Forgotten your password?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="openExternalLinks">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" name="messageLabel">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>382</width>
+ <height>72</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>An error occurred while trying to activate Synergy. The Symless server returned the following error:
+
+%1</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ <property name="openExternalLinks">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <zorder>label_2</zorder>
+ <zorder>messageLabel</zorder>
+ <zorder>buttonBox</zorder>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>FailedLoginDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>FailedLoginDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
View
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindowBase</class>
<widget class="QMainWindow" name="MainWindowBase">
@@ -27,6 +27,57 @@
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QWidget" name="m_trialWidget" native="true">
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <property name="leftMargin">
+ <number>2</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>8</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="Synergy.qrc">:/res/icons/16x16/warning.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="m_trialLabel">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;%1&lt;/span&gt; days of your Synergy Pro trial remain. &lt;a href=&quot;http://symless.com/pricing?src=gui&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Buy now!&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="openExternalLinks">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <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>
+ </layout>
+ </widget>
+ </item>
<item>
<widget class="QWidget" name="m_pWidgetUpdate" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
@@ -40,7 +91,7 @@
<number>0</number>
</property>
<property name="bottomMargin">
- <number>7</number>
+ <number>8</number>
</property>
<item>
<widget class="QLabel" name="m_pIconUpdate">
@@ -128,7 +179,7 @@
</sizepolicy>
</property>
<property name="text">
- <string>Fingerprint:</string>
+ <string>SSL Fingerprint:</string>
</property>
</widget>
</item>
@@ -481,12 +532,12 @@
<string notr="true"/>
</property>
</action>
- <action name="m_pActionWizard">
+ <action name="m_pActivate">
<property name="text">
- <string>Run Wizard</string>
+ <string>Activate</string>
</property>
- <property name="shortcut">
- <string notr="true"/>
+ <property name="toolTip">
+ <string>Activate</string>
</property>
</action>
</widget>
View
@@ -1,137 +0,0 @@
-<?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> </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_pLabelStatus">
- <property name="text">
- <string>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
@@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="m_pTabWidget">
<property name="currentIndex">
- <number>2</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="m_pTabScreens">
<attribute name="title">
View
@@ -176,8 +176,11 @@
</property>
<item row="0" column="0">
<widget class="QCheckBox" name="m_pCheckBoxEnableCrypto">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="text">
- <string>Use &amp;SSL encryption (unique certificate)</string>
+ <string>Use &amp;SSL encryption</string>
</property>
</widget>
</item>
@@ -327,11 +330,13 @@
<tabstop>m_pLineEditScreenName</tabstop>
<tabstop>m_pSpinBoxPort</tabstop>
<tabstop>m_pLineEditInterface</tabstop>
+ <tabstop>m_pComboElevate</tabstop>
+ <tabstop>m_pCheckBoxAutoHide</tabstop>
+ <tabstop>m_pCheckBoxEnableCrypto</tabstop>
<tabstop>m_pComboLogLevel</tabstop>
<tabstop>m_pCheckBoxLogToFile</tabstop>
<tabstop>m_pLineEditLogFilename</tabstop>
<tabstop>m_pButtonBrowseLog</tabstop>
- <tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections>
View
@@ -120,214 +120,6 @@
</item>
</layout>
</widget>
- <widget class="QWizardPage" name="m_pActivatePage">
- <property name="title">
- <string>Activate</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QLabel" name="label_9">
- <property name="text">
- <string>Enable your &lt;a href=&quot;http://symless.com/pricing?source=gui&quot;&gt;Synergy Pro&lt;/a&gt; and Synergy Basic features.</string>
- </property>
- <property name="openExternalLinks">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer_4">
- <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>10</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QRadioButton" name="m_pRadioButtonActivate">
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>&amp;Account login</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QFormLayout" name="formLayout">
- <property name="fieldGrowthPolicy">
- <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
- </property>
- <property name="horizontalSpacing">
- <number>20</number>
- </property>
- <property name="verticalSpacing">
- <number>10</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="m_pLabelEmail">
- <property name="text">
- <string>Email:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="m_pLineEditEmail">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>20</height>
- </size>
- </property>
- <property name="echoMode">
- <enum>QLineEdit::Normal</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Password:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="m_pLineEditPassword">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>20</height>
- </size>
- </property>
- <property name="echoMode">
- <enum>QLineEdit::Password</enum>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>&lt;a href=&quot;https://symless.com/account/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_8">
- <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>10</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QRadioButton" name="m_pRadioButtonSubscription">
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>&amp;Serial key</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QTextEdit" name="m_pTextEditSerialKey"/>
- </item>
- <item>
- <spacer name="verticalSpacer_5">
- <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>10</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QRadioButton" name="m_pRadioButtonSkip">
- <property name="text">
- <string>S&amp;kip activation</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_8">
- <property name="styleSheet">
- <string notr="true">color: rgb(100, 100, 100);</string>
- </property>
- <property name="text">
- <string>You will see UNREGISTERED in the window title (not recommended).</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer_3">
- <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>500</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
<widget class="QWizardPage" name="m_pNodePage">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
View
@@ -36,11 +36,11 @@
<language ietfCode="ar" name="العربية" />
<language ietfCode="pes-IR" name="فارسی" />
<language ietfCode="ur" name="اردو" />
- <language ietfCode="mr" name="मराठी" />
+ <language ietfCode="mr" name="मराठी" />
<language ietfCode="si" name="Sඉන්හල" />
<language ietfCode="th-TH" name="ภาษาไทย" />
<language ietfCode="zh-CN" name="中文 (简体)" />
<language ietfCode="zh-TW" name="中文 (繁體)" />
<language ietfCode="ja-JP" name="日本語" />
- <language ietfCode="ko" name="한국의" />
+ <language ietfCode="ko" name="한국어" />
</languages>
View
@@ -1,20 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
-<dict>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
- <key>CFBundleIconFile</key>
- <string>Synergy.icns</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleExecutable</key>
- <string>Synergy</string>
- <key>CFBundleIdentifier</key>
- <string>synergy</string>
-</dict>
+ <dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDisplayName</key>
+ <string>Synergy</string>
+ <key>CFBundleExecutable</key>
+ <string>Synergy</string>
+ <key>CFBundleIconFile</key>
+ <string>Synergy.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>synergy</string>
+ <!-- TODO: Fix this in v2.0 //-->
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Synergy</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.8.8</string>
+ <key>CFBundleVersion</key>
+ <string>1.8.8</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>© 2012-2016, Symless Ltd</string>
+ </dict>
</plist>
View
@@ -32,7 +32,9 @@ AboutDialog::AboutDialog(QWidget* parent, const QString& synergyApp) :
version = version + '-' + VERSION_STAGE + '-' + VERSION_REVISION;
m_pLabelSynergyVersion->setText(version);
- m_pLabelBuildDate->setText(QDate::currentDate().toString());
+ QString buildDateString = QString::fromLocal8Bit(__DATE__).simplified();
+ QDate buildDate = QLocale("en_US").toDate(buildDateString, "MMM d yyyy");
+ m_pLabelBuildDate->setText(buildDate.toString(Qt::SystemLocaleLongDate));
// change default size based on os
#if defined(Q_OS_MAC)
View
@@ -0,0 +1,123 @@
+#include "ActivationDialog.h"
+#include "ui_ActivationDialog.h"
+#include "CancelActivationDialog.h"
+#include "AppConfig.h"
+#include "WebClient.h"
+#include "EditionType.h"
+#include "ActivationNotifier.h"
+#include "MainWindow.h"
+#include "QUtility.h"
+#include "LicenseManager.h"
+#include "FailedLoginDialog.h"
+
+#include <QMessageBox>
+#include <QThread>
+#include <iostream>
+
+ActivationDialog::ActivationDialog(QWidget* parent, AppConfig& appConfig,
+ LicenseManager& licenseManager) :
+ QDialog(parent),
+ ui(new Ui::ActivationDialog),
+ m_appConfig(&appConfig),
+ m_LicenseManager (&licenseManager)
+{
+ ui->setupUi(this);
+ refreshSerialKey();
+ time_t currentTime = ::time(0);
+ if (!m_LicenseManager->serialKey().isExpired(currentTime)) {
+ ui->m_trialWidget->hide();
+ }
+}
+
+void ActivationDialog::refreshSerialKey()
+{
+ ui->m_pTextEditSerialKey->setText(m_appConfig->serialKey());
+ ui->m_pTextEditSerialKey->setFocus();
+ ui->m_pTextEditSerialKey->moveCursor(QTextCursor::End);
+ ui->m_trialLabel->setText(tr("<html><head/><body><p>Your trial has "
+ "expired. <a href=\"https://symless.com/"
+ "synergy/trial/thanks?id=%1\"><span "
+ "style=\"text-decoration: underline; "
+ "color:#0000ff;\">Buy now!</span></a>"
+ "</p></body></html>")
+ .arg (m_appConfig->serialKey()));
+}
+
+ActivationDialog::~ActivationDialog()
+{
+ delete ui;
+}
+
+void ActivationDialog::reject()
+{
+ if (m_LicenseManager->activeEdition() == kUnregistered) {
+ CancelActivationDialog cancelActivationDialog(this);
+ if (QDialog::Accepted == cancelActivationDialog.exec()) {
+ m_LicenseManager->skipActivation();
+ m_appConfig->activationHasRun(true);
+ m_appConfig->saveSettings();
+ } else {
+ return;
+ }
+ }
+ QDialog::reject();
+}
+
+void ActivationDialog::accept()
+{
+ QMessageBox message;
+ m_appConfig->activationHasRun(true);
+ m_appConfig->saveSettings();
+
+ std::pair<bool, QString> result;
+ try {
+ SerialKey serialKey (ui->m_pTextEditSerialKey->toPlainText().
+ trimmed().toStdString());
+ result = m_LicenseManager->setSerialKey(serialKey);
+ }
+ catch (std::exception& e) {
+ message.critical(this, "Unknown Error",
+ tr("An error occurred while trying to activate Synergy. "
+ "Please contact the helpdesk, and provide the "
+ "following information:\n\n%1").arg(e.what()));
+ refreshSerialKey();
+ return;
+ }
+
+ if (!result.first) {
+ message.critical(this, "Activation failed",
+ tr("%1").arg(result.second));
+ refreshSerialKey();
+ return;
+ }
+
+ m_LicenseManager->notifyActivation("serial:" + m_appConfig->serialKey());
+ Edition edition = m_LicenseManager->activeEdition();
+ time_t daysLeft = m_LicenseManager->serialKey().daysLeft(::time(0));
+ if (edition != kUnregistered) {
+ QString thanksMessage = tr("Thanks for trying %1! %5\n\n%2 day%3 of "
+ "your trial remain%4").
+ arg (m_LicenseManager->getEditionName(edition)).
+ arg (daysLeft).
+ arg ((daysLeft == 1) ? "" : "s").
+ arg ((daysLeft == 1) ? "s" : "");
+
+ if (edition == kPro) {
+ thanksMessage = thanksMessage.arg("If you're using SSL, "
+ "remember to activate all of your devices.");
+ } else {
+ thanksMessage = thanksMessage.arg("");
+ }
+
+ if (m_LicenseManager->serialKey().isTrial()) {
+ message.information(this, "Thanks!", thanksMessage);
+ }
+ else {
+ message.information(this, "Activated!",
+ tr("Thanks for activating %1!").arg
+ (m_LicenseManager->getEditionName(edition)));
+ }
+ }
+
+ QDialog::accept();
+}
View
@@ -0,0 +1,35 @@
+#ifndef ACTIVATIONDIALOG_H
+#define ACTIVATIONDIALOG_H
+
+#include <QDialog>
+#include <LicenseManager.h>
+
+namespace Ui {
+class ActivationDialog;
+}
+
+class AppConfig;
+
+class ActivationDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ ActivationDialog(QWidget *parent, AppConfig& appConfig,
+ LicenseManager& licenseManager);
+ ~ActivationDialog();
+
+public slots:
+ void reject();
+ void accept();
+
+protected:
+ void refreshSerialKey();
+
+private:
+ Ui::ActivationDialog *ui;
+ AppConfig* m_appConfig;
+ LicenseManager* m_LicenseManager;
+};
+
+#endif // ACTIVATIONDIALOG_H
View
@@ -20,7 +20,7 @@
#include "CoreInterface.h"
ActivationNotifier::ActivationNotifier(QObject *parent) :
- QObject(parent)
+ QObject(parent)
{
}
@@ -29,6 +29,15 @@ void ActivationNotifier::setIdentity(QString identity)
m_Identity = identity;
}
+void ActivationNotifier::setUpdateInfo(QString const& fromVersion,
+ QString const& toVersion,
+ QString const& serialKey)
+{
+ m_fromVersion = fromVersion;
+ m_toVersion = toVersion;
+ m_serialKey = serialKey;
+}
+
void ActivationNotifier::notify()
{
CoreInterface coreInterface;
@@ -39,3 +48,13 @@ void ActivationNotifier::notify()
// catch all exceptions and fails silently
}
}
+
+void ActivationNotifier::notifyUpdate()
+{
+ try {
+ CoreInterface coreInterface;
+ coreInterface.notifyUpdate(m_fromVersion, m_toVersion,
+ m_serialKey);
+ } catch (...) {
+ }
+}
View
@@ -24,18 +24,24 @@ class ActivationNotifier : public QObject
{
Q_OBJECT
public:
- explicit ActivationNotifier(QObject *parent = 0);
+ explicit ActivationNotifier(QObject *parent = 0);
void setIdentity(QString identity);
+ void setUpdateInfo(QString const& fromVersion,
+ QString const& toVersion, QString const& serialKey);
public slots:
void notify();
+ void notifyUpdate();
signals:
void finished();
private:
QString m_Identity;
+ QString m_fromVersion;
+ QString m_toVersion;
+ QString m_serialKey;
};
#endif // ACTIVATIONNOTIFIER_H
View
@@ -2,11 +2,11 @@
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012-2016 Symless Ltd.
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
+ *
* 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 LICENSE 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
@@ -73,6 +73,18 @@ AppConfig::~AppConfig()
saveSettings();
}
+const QString &AppConfig::screenName() const { return m_ScreenName; }
+
+int AppConfig::port() const { return m_Port; }
+
+const QString &AppConfig::interface() const { return m_Interface; }
+
+int AppConfig::logLevel() const { return m_LogLevel; }
+
+bool AppConfig::logToFile() const { return m_LogToFile; }
+
+const QString &AppConfig::logFilename() const { return m_LogFilename; }
+
QString AppConfig::synergyLogDir() const
{
#if defined(Q_OS_WIN)
@@ -116,6 +128,16 @@ QString AppConfig::logLevelText() const
return logLevelNames[logLevel()];
}
+ProcessMode AppConfig::processMode() const { return m_ProcessMode; }
+
+bool AppConfig::wizardShouldRun() const { return m_WizardLastRun < kWizardVersion; }
+
+const QString &AppConfig::language() const { return m_Language; }
+
+bool AppConfig::startedBefore() const { return m_StartedBefore; }
+
+bool AppConfig::autoConfig() const { return m_AutoConfig; }
+
void AppConfig::loadSettings()
{
m_ScreenName = settings().value("screenName", QHostInfo::localHostName()).toString();
@@ -131,16 +153,18 @@ void AppConfig::loadSettings()
QVariant elevateMode = settings().value("elevateModeEnum");
if (!elevateMode.isValid()) {
elevateMode = settings().value ("elevateMode",
- QVariant(static_cast<int>(defaultElevateMode)));
+ QVariant(static_cast<int>(defaultElevateMode)));
}
m_ElevateMode = static_cast<ElevateMode>(elevateMode.toInt());
m_AutoConfigPrompted = settings().value("autoConfigPrompted", false).toBool();
- m_Edition = settings().value("edition", Unknown).toInt();
+ m_Edition = static_cast<Edition>(settings().value("edition", kUnregistered).toInt());
m_ActivateEmail = settings().value("activateEmail", "").toString();
- m_CryptoEnabled = settings().value("cryptoEnabled", false).toBool();
+ m_CryptoEnabled = settings().value("cryptoEnabled", true).toBool();
m_AutoHide = settings().value("autoHide", false).toBool();
- m_Serialkey = settings().value("serialKey", "").toString();
+ m_Serialkey = settings().value("serialKey", "").toString().trimmed();
+ m_lastVersion = settings().value("lastVersion", "Unknown").toString();
m_LastExpiringWarningTime = settings().value("lastExpiringWarningTime", 0).toInt();
+ m_ActivationHasRun = settings().value("activationHasRun", false).toBool();
}
void AppConfig::saveSettings()
@@ -155,30 +179,116 @@ void AppConfig::saveSettings()
settings().setValue("language", m_Language);
settings().setValue("startedBefore", m_StartedBefore);
settings().setValue("autoConfig", m_AutoConfig);
- // Refer to enum ElevateMode declaration for insight in to why this
- // flag is mapped this way
+ // Refer to enum ElevateMode declaration for insight in to why this
+ // flag is mapped this way
settings().setValue("elevateMode", m_ElevateMode == ElevateAlways);
settings().setValue("elevateModeEnum", static_cast<int>(m_ElevateMode));
settings().setValue("autoConfigPrompted", m_AutoConfigPrompted);
settings().setValue("edition", m_Edition);
- settings().setValue("activateEmail", m_ActivateEmail);
settings().setValue("cryptoEnabled", m_CryptoEnabled);
settings().setValue("autoHide", m_AutoHide);
settings().setValue("serialKey", m_Serialkey);
+ settings().setValue("lastVersion", m_lastVersion);
settings().setValue("lastExpiringWarningTime", m_LastExpiringWarningTime);
+ settings().setValue("activationHasRun", m_ActivationHasRun);
+ settings().sync();
+}
+
+bool AppConfig::activationHasRun() const
+{
+ return m_ActivationHasRun;
+}
+
+AppConfig& AppConfig::activationHasRun(bool value)
+{
+ m_ActivationHasRun = value;
+ return *this;
+}
+
+QString AppConfig::lastVersion() const
+{
+ return m_lastVersion;
+}
+
+void AppConfig::setLastVersion(QString version) {
+ m_lastVersion = version;
}
+QSettings &AppConfig::settings() { return *m_pSettings; }
+
+void AppConfig::setScreenName(const QString &s) { m_ScreenName = s; }
+
+void AppConfig::setPort(int i) { m_Port = i; }
+
+void AppConfig::setInterface(const QString &s) { m_Interface = s; }
+
+void AppConfig::setLogLevel(int i) { m_LogLevel = i; }
+
+void AppConfig::setLogToFile(bool b) { m_LogToFile = b; }
+
+void AppConfig::setLogFilename(const QString &s) { m_LogFilename = s; }
+
+void AppConfig::setWizardHasRun() { m_WizardLastRun = kWizardVersion; }
+
+void AppConfig::setLanguage(const QString language) { m_Language = language; }
+
+void AppConfig::setStartedBefore(bool b) { m_StartedBefore = b; }
+
+void AppConfig::setElevateMode(ElevateMode em) { m_ElevateMode = em; }
+
void AppConfig::setAutoConfig(bool autoConfig)
{
m_AutoConfig = autoConfig;
}
+bool AppConfig::autoConfigPrompted() { return m_AutoConfigPrompted; }
+
void AppConfig::setAutoConfigPrompted(bool prompted)
{
m_AutoConfigPrompted = prompted;
}
+void AppConfig::setEdition(Edition e) {
+ m_Edition = e;
+}
+
+Edition AppConfig::edition() const { return m_Edition; }
+
+QString AppConfig::setSerialKey(QString serial) {
+ using std::swap;
+ swap (serial, m_Serialkey);
+ return serial;
+}
+
+void AppConfig::clearSerialKey()
+{
+ m_Serialkey.clear();
+}
+
+QString AppConfig::serialKey() { return m_Serialkey; }
+
+int AppConfig::lastExpiringWarningTime() const { return m_LastExpiringWarningTime; }
+
+void AppConfig::setLastExpiringWarningTime(int t) { m_LastExpiringWarningTime = t; }
+
+QString AppConfig::synergysName() const { return m_SynergysName; }
+
+QString AppConfig::synergycName() const { return m_SynergycName; }
+
ElevateMode AppConfig::elevateMode()
{
return m_ElevateMode;
}
+
+void AppConfig::setCryptoEnabled(bool e) {
+ m_CryptoEnabled = e;
+ emit sslToggled(e);
+}
+
+bool AppConfig::getCryptoEnabled() const {
+ return (edition() == kPro) && m_CryptoEnabled;
+}
+
+void AppConfig::setAutoHide(bool b) { m_AutoHide = b; }
+
+bool AppConfig::getAutoHide() { return m_AutoHide; }
View
@@ -2,11 +2,11 @@
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012-2016 Symless Ltd.
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
+ *
* 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 LICENSE 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
@@ -20,8 +20,10 @@
#define APPCONFIG_H
+#include <QObject>
#include <QString>
#include "ElevateMode.h"
+#include <EditionType.h>
// this should be incremented each time a new page is added. this is
// saved to settings when the user finishes running the wizard. if
@@ -47,8 +49,10 @@ enum ProcessMode {
Desktop
};
-class AppConfig
+class AppConfig: public QObject
{
+ Q_OBJECT
+
friend class SettingsDialog;
friend class MainWindow;
friend class SetupWizard;
@@ -58,60 +62,65 @@ class AppConfig
~AppConfig();
public:
- const QString& screenName() const { return m_ScreenName; }
- int port() const { return m_Port; }
- const QString& interface() const { return m_Interface; }
- int logLevel() const { return m_LogLevel; }
- bool logToFile() const { return m_LogToFile; }
- const QString& logFilename() const { return m_LogFilename; }
+ const QString& screenName() const;
+ int port() const;
+ const QString& interface() const;
+ int logLevel() const;
+ bool logToFile() const;
+ const QString& logFilename() const;
const QString logFilenameCmd() const;
QString logLevelText() const;
- ProcessMode processMode() const { return m_ProcessMode; }
- bool wizardShouldRun() const { return m_WizardLastRun < kWizardVersion; }
- const QString& language() const { return m_Language; }
- bool startedBefore() const { return m_StartedBefore; }
- bool autoConfig() const { return m_AutoConfig; }
+ ProcessMode processMode() const;
+ bool wizardShouldRun() const;
+ const QString& language() const;
+ bool startedBefore() const;
+ bool autoConfig() const;
void setAutoConfig(bool autoConfig);
- bool autoConfigPrompted() { return m_AutoConfigPrompted; }
+ bool autoConfigPrompted();
void setAutoConfigPrompted(bool prompted);
- void setEdition(int e) { m_Edition = e; }
- int edition() { return m_Edition; }
- void setActivateEmail(QString e) { m_ActivateEmail = e; }
- QString activateEmail() { return m_ActivateEmail; }
- void setSerialKey(QString serial) { m_Serialkey = serial; }
- QString serialKey() { return m_Serialkey; }
- int lastExpiringWarningTime() const { return m_LastExpiringWarningTime; }
- void setLastExpiringWarningTime(int t) { m_LastExpiringWarningTime = t; }
-
- QString synergysName() const { return m_SynergysName; }
- QString synergycName() const { return m_SynergycName; }
+ void setEdition(Edition);
+ Edition edition() const;
+ QString setSerialKey(QString serial);
+ void clearSerialKey();
+ QString serialKey();
+ int lastExpiringWarningTime() const;
+ void setLastExpiringWarningTime(int t);
+
+ QString synergysName() const;
+ QString synergycName() const;
QString synergyProgramDir() const;
QString synergyLogDir() const;
bool detectPath(const QString& name, QString& path);
void persistLogDir();
ElevateMode elevateMode();
- void setCryptoEnabled(bool e) { m_CryptoEnabled = e; }
- bool getCryptoEnabled() { return m_CryptoEnabled; }
- void setAutoHide(bool b) { m_AutoHide = b; }
- bool getAutoHide() { return m_AutoHide; }
+ void setCryptoEnabled(bool e);
+ bool getCryptoEnabled() const;
- void saveSettings();
+ void setAutoHide(bool b);
+ bool getAutoHide();
- protected:
- QSettings& settings() { return *m_pSettings; }
- void setScreenName(const QString& s) { m_ScreenName = s; }
- void setPort(int i) { m_Port = i; }
- void setInterface(const QString& s) { m_Interface = s; }
- void setLogLevel(int i) { m_LogLevel = i; }
- void setLogToFile(bool b) { m_LogToFile = b; }
- void setLogFilename(const QString& s) { m_LogFilename = s; }
- void setWizardHasRun() { m_WizardLastRun = kWizardVersion; }
- void setLanguage(const QString language) { m_Language = language; }
- void setStartedBefore(bool b) { m_StartedBefore = b; }
- void setElevateMode(ElevateMode em) { m_ElevateMode = em; }
+ bool activationHasRun() const;
+ AppConfig& activationHasRun(bool value);
+ QString lastVersion() const;
+
+ void saveSettings();
+ void setLastVersion(QString version);
+
+protected:
+ QSettings& settings();
+ void setScreenName(const QString& s);
+ void setPort(int i);
+ void setInterface(const QString& s);
+ void setLogLevel(int i);
+ void setLogToFile(bool b);
+ void setLogFilename(const QString& s);
+ void setWizardHasRun();
+ void setLanguage(const QString language);
+ void setStartedBefore(bool b);
+ void setElevateMode(ElevateMode em);
void loadSettings();
private:
@@ -129,16 +138,21 @@ class AppConfig
bool m_AutoConfig;
ElevateMode m_ElevateMode;
bool m_AutoConfigPrompted;
- int m_Edition;
+ Edition m_Edition;
QString m_ActivateEmail;
bool m_CryptoEnabled;
bool m_AutoHide;
QString m_Serialkey;
+ QString m_lastVersion;
int m_LastExpiringWarningTime;
+ bool m_ActivationHasRun;
static const char m_SynergysName[];
static const char m_SynergycName[];
static const char m_SynergyLogDir[];
+
+ signals:
+ void sslToggled(bool enabled);
};
#endif
View
@@ -0,0 +1,14 @@
+#include "CancelActivationDialog.h"
+#include "ui_CancelActivationDialog.h"
+
+CancelActivationDialog::CancelActivationDialog(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::CancelActivationDialog)
+{
+ ui->setupUi(this);
+}
+
+CancelActivationDialog::~CancelActivationDialog()
+{
+ delete ui;
+}
View
@@ -0,0 +1,22 @@
+#ifndef CANCELACTIVATIONDIALOG_H
+#define CANCELACTIVATIONDIALOG_H
+
+#include <QDialog>
+
+namespace Ui {
+class CancelActivationDialog;
+}
+
+class CancelActivationDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit CancelActivationDialog(QWidget *parent = 0);
+ ~CancelActivationDialog();
+
+private:
+ Ui::CancelActivationDialog *ui;
+};
+
+#endif // CANCELACTIVATIONDIALOG_H
View
@@ -22,18 +22,20 @@
#include <QCoreApplication>
#include <QProcess>
+#include <QtGlobal>
+#include <QDir>
#include <stdexcept>
static const char kCoreBinary[] = "syntool";
-CoreInterface::CoreInterface()
-{
-}
+#ifdef Q_WS_WIN
+static const char kSerialKeyFilename[] = "Synergy.subkey";
+#else
+static const char kSerialKeyFilename[] = ".synergy.subkey";
+#endif
-QString CoreInterface::getPluginDir()
+CoreInterface::CoreInterface()
{
- QStringList args("--get-plugin-dir");
- return run(args);
}
QString CoreInterface::getProfileDir()
@@ -54,24 +56,19 @@ QString CoreInterface::getArch()
return run(args);
}
-QString CoreInterface::getSubscriptionFilename()
+QString CoreInterface::getSerialKeyFilePath()
{
- QStringList args("--get-subscription-filename");
- return run(args);
+ QString filename = getProfileDir() + QDir::separator() + kSerialKeyFilename;
+ return filename;
}
-QString CoreInterface::activateSerial(const QString& serial)
-{
- QStringList args("--subscription-serial");
- args << serial;
-
- return run(args);
-}
-
-QString CoreInterface::checkSubscription()
-{
- QStringList args("--check-subscription");
- return run(args);
+QString CoreInterface::notifyUpdate (QString const& fromVersion,
+ QString const& toVersion,
+ QString const& serialKey) {
+ QStringList args("--notify-update");
+ QString input(fromVersion + ":" + toVersion + ":" + serialKey);
+ input.append("\n");
+ return run(args, input);
}
QString CoreInterface::notifyActivation(const QString& identity)
View
@@ -24,13 +24,13 @@ class CoreInterface
public:
CoreInterface();
- QString getPluginDir();
QString getProfileDir();
QString getInstalledDir();
QString getArch();
- QString getSubscriptionFilename();
- QString activateSerial(const QString& serial);
- QString checkSubscription();
+ QString getSerialKeyFilePath();
QString notifyActivation(const QString& identity);
+ QString notifyUpdate (QString const& fromVersion,
+ QString const& toVersion,
+ QString const& serialKey);
QString run(const QStringList& args, const QString& input = "");
};
View
@@ -0,0 +1,15 @@
+#include "FailedLoginDialog.h"
+#include "ui_FailedLoginDialog.h"
+
+FailedLoginDialog::FailedLoginDialog(QWidget *parent, QString message):
+ QDialog(parent),
+ ui(new Ui::FailedLoginDialog)
+{
+ ui->setupUi(this);
+ ui->messageLabel->setText(ui->messageLabel->text().arg(message));
+}
+
+FailedLoginDialog::~FailedLoginDialog()
+{
+ delete ui;
+}
View
@@ -0,0 +1,23 @@
+#ifndef FAILEDLOGINDIALOG_H
+#define FAILEDLOGINDIALOG_H
+
+#include <QDialog>
+#include <QString>
+
+namespace Ui {
+class FailedLoginDialog;
+}
+
+class FailedLoginDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit FailedLoginDialog(QWidget *parent = 0, QString message = "");
+ ~FailedLoginDialog();
+
+private:
+ Ui::FailedLoginDialog *ui;
+};
+
+#endif // FAILEDLOGINDIALOG_H
View
@@ -0,0 +1,169 @@
+/*
+ * synergy -- mouse and keyboard sharing utility
+ * Copyright (C) 2015 Synergy Seamless Inc.
+ *
+ * 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 LICENSE 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 "LicenseManager.h"
+#include "EditionType.h"
+#include "AppConfig.h"
+#include <ctime>
+#include <stdexcept>
+#include <utility>
+#include <QThread>
+
+LicenseManager::LicenseManager(AppConfig* appConfig) :
+ m_AppConfig(appConfig),
+ m_serialKey(appConfig->edition()) {
+}
+
+std::pair<bool, QString>
+LicenseManager::setSerialKey(SerialKey serialKey, bool acceptExpired)
+{
+ std::pair<bool, QString> ret (true, "");
+ time_t currentTime = ::time(0);
+
+ if (!acceptExpired && serialKey.isExpired(currentTime)) {
+ ret.first = false;
+ ret.second = "Serial key expired";
+ return ret;
+ }
+
+ if (serialKey != m_serialKey) {
+ using std::swap;
+ swap (serialKey, m_serialKey);
+ m_AppConfig->setSerialKey(QString::fromStdString
+ (m_serialKey.toString()));
+ emit serialKeyChanged(m_serialKey);
+
+ if (serialKey.isTrial()) {
+ emit endTrial(false);
+ }
+
+ if (m_serialKey.edition() != serialKey.edition()) {
+ m_AppConfig->setEdition(m_serialKey.edition());
+ emit editionChanged(m_serialKey.edition());
+ }
+
+ if (m_serialKey.isTrial()) {
+ if (m_serialKey.isExpired(currentTime)) {
+ emit endTrial(true);
+ } else {
+ emit beginTrial(m_serialKey.isExpiring(currentTime));
+ }
+ }
+
+ m_AppConfig->saveSettings();
+ }
+
+ return ret;
+}
+
+void
+LicenseManager::notifyUpdate(QString fromVersion, QString toVersion) {
+ if ((fromVersion == "Unknown")
+ && (m_serialKey == SerialKey(kUnregistered))) {
+ return;
+ }
+
+ ActivationNotifier* notifier = new ActivationNotifier();
+ notifier->setUpdateInfo (fromVersion, toVersion,
+ QString::fromStdString(m_serialKey.toString()));
+
+ QThread* thread = new QThread();
+ connect(notifier, SIGNAL(finished()), thread, SLOT(quit()));
+ connect(notifier, SIGNAL(finished()), notifier, SLOT(deleteLater()));
+ connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
+
+ notifier->moveToThread(thread);
+ thread->start();
+
+ QMetaObject::invokeMethod(notifier, "notifyUpdate",
+ Qt::QueuedConnection);
+}
+
+Edition
+LicenseManager::activeEdition() const
+{
+ return m_serialKey.edition();
+}
+
+QString
+LicenseManager::activeEditionName() const
+{
+ return getEditionName(activeEdition(), m_serialKey.isTrial());
+}
+
+SerialKey
+LicenseManager::serialKey() const
+{
+ return m_serialKey;
+}
+
+void LicenseManager::refresh()
+{
+ if (!m_AppConfig->serialKey().isEmpty()) {
+ try {
+ SerialKey serialKey (m_AppConfig->serialKey().toStdString());
+ setSerialKey(serialKey, true);
+ } catch (...) {
+ m_AppConfig->clearSerialKey();
+ m_AppConfig->saveSettings();
+ }
+ }
+ if (m_serialKey.isExpired(::time(0))) {
+ emit endTrial(true);
+ }
+}
+
+void LicenseManager::skipActivation()
+{
+ notifyActivation ("skip:unknown");
+}
+
+QString
+LicenseManager::getEditionName(Edition const edition, bool trial)
+{
+ std::string name ("Synergy");
+ switch (edition) {
+ case kUnregistered:
+ name += " (UNREGISTERED)";
+ return QString::fromUtf8 (name.c_str(), name.size());
+ case kBasic:
+ name += " Basic";
+ break;
+ default:
+ name += " Pro";
+ }
+ if (trial) {
+ name += " (Trial)";
+ }
+ return QString::fromUtf8 (name.c_str(), name.size());
+}
+
+void LicenseManager::notifyActivation(QString identity)
+{
+ ActivationNotifier* notifier = new ActivationNotifier();
+ notifier->setIdentity(identity);
+
+ QThread* thread = new QThread();
+ connect(notifier, SIGNAL(finished()), thread, SLOT(quit()));
+ connect(notifier, SIGNAL(finished()), notifier, SLOT(deleteLater()));
+ connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
+
+ notifier->moveToThread(thread);
+ thread->start();
+
+ QMetaObject::invokeMethod(notifier, "notify", Qt::QueuedConnection);
+}
View
@@ -0,0 +1,53 @@
+/*
+ * synergy -- mouse and keyboard sharing utility
+ * Copyright (C) 2015 Synergy Seamless Inc.
+ *
+ * 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 LICENSE 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 <QObject>
+#include <SerialKey.h>
+#include <ActivationNotifier.h>
+#include <utility>
+
+class AppConfig;
+
+class LicenseManager: public QObject
+{
+ Q_OBJECT
+
+public:
+ LicenseManager(AppConfig* appConfig);
+ std::pair<bool, QString> setSerialKey(SerialKey serialKey,
+ bool acceptExpired = false);
+ void refresh();
+ Edition activeEdition() const;
+ QString activeEditionName() const;
+ SerialKey serialKey() const;
+ void skipActivation();
+ void notifyUpdate(QString fromVersion, QString toVersion);
+ static QString getEditionName(Edition edition, bool trial = false);
+ void notifyActivation(QString identity);
+
+private:
+ AppConfig* m_AppConfig;
+ SerialKey m_serialKey;
+
+signals:
+ void serialKeyChanged (SerialKey) const;
+ void editionChanged (Edition) const;
+ void beginTrial (bool expiring) const;
+ void endTrial (bool expired) const;
+};
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -33,6 +33,7 @@
#include "VersionChecker.h"
#include "IpcClient.h"
#include "Ipc.h"
+#include "ActivationDialog.h"
#include <QMutex>
@@ -56,14 +57,17 @@ class SetupWizard;
class ZeroconfService;
class DataDownloader;
class CommandProcess;
+class SslCertificate;
+class LicenseManager;
class MainWindow : public QMainWindow, public Ui::MainWindowBase
{
Q_OBJECT
friend class QSynergyApplication;
friend class SetupWizard;
- friend class PluginWizardPage;
+ friend class ActivationDialog;
+ friend class SettingsDialog;
public:
enum qSynergyState
@@ -91,7 +95,8 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
};
public:
- MainWindow(QSettings& settings, AppConfig& appConfig);
+ MainWindow(QSettings& settings, AppConfig& appConfig,
+ LicenseManager& licenseManager);
~MainWindow();
public:
@@ -112,25 +117,31 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void autoAddScreen(const QString name);
void updateZeroconfService();
void serverDetected(const QString name);
- void setEdition(int type);
void updateLocalFingerprint();
+ LicenseManager& licenseManager() const;
- public slots:
+ int raiseActivationDialog();
+
+public slots:
+ void setEdition(Edition edition);
+ void beginTrial(bool isExpiring);
+ void endTrial(bool isExpired);
void appendLogRaw(const QString& text);
void appendLogInfo(const QString& text);
void appendLogDebug(const QString& text);
void appendLogError(const QString& text);
void startSynergy();
protected slots:
+ void sslToggled(bool enabled);
void on_m_pGroupClient_toggled(bool on);
void on_m_pGroupServer_toggled(bool on);
bool on_m_pButtonBrowseConfigFile_clicked();
void on_m_pButtonConfigureServer_clicked();
bool on_m_pActionSave_triggered();
void on_m_pActionAbout_triggered();
void on_m_pActionSettings_triggered();
- void on_m_pActionWizard_triggered();
+ void on_m_pActivate_triggered();
void synergyFinished(int exitCode, QProcess::ExitStatus);
void trayActivated(QSystemTrayIcon::ActivationReason reason);
void stopSynergy();
@@ -141,7 +152,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
protected:
QSettings& settings() { return m_Settings; }
- AppConfig& appConfig() { return m_AppConfig; }
+ AppConfig& appConfig() { return *m_AppConfig; }
QProcess* synergyProcess() { return m_pSynergy; }
void setSynergyProcess(QProcess* p) { m_pSynergy = p; }
void initConnections();
@@ -158,7 +169,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void setStatus(const QString& status);
void sendIpcMessage(qIpcMessageType type, const char* buffer, bool showErrors);
void onModeChanged(bool startDesktop, bool applyService);
- void updateStateFromLogLine(const QString& line);
+ void updateFromLogLine(const QString& line);
QString getIPAddresses();
void stopService();
void stopDesktop();
@@ -174,15 +185,19 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void promptAutoConfig();
QString getProfileRootForArg();
void checkConnected(const QString& line);
+ void checkLicense(const QString& line);
void checkFingerprint(const QString& line);
bool autoHide();
QString getTimeStamp();
void restartSynergy();
void proofreadInfo();
+ void showEvent (QShowEvent*);
+
private:
QSettings& m_Settings;
- AppConfig& m_AppConfig;
+ AppConfig* m_AppConfig;
+ LicenseManager* m_LicenseManager;
QProcess* m_pSynergy;
int m_SynergyState;
ServerConfig m_ServerConfig;
@@ -207,12 +222,19 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
bool m_SuppressEmptyServerWarning;
qRuningState m_ExpectedRunningState;
QMutex m_StopDesktopMutex;
+ SslCertificate* m_pSslCertificate;
+ bool m_ActivationDialogRunning;
+ QStringList m_PendingClientNames;
private slots:
void on_m_pCheckBoxAutoConfig_toggled(bool checked);
void on_m_pComboServerList_currentIndexChanged(QString );
void on_m_pButtonApply_clicked();
void installBonjour();
+ void on_windowShown();
+
+signals:
+ void windowShown();
};
#endif
View
@@ -1,73 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2015-2016 Symless 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 LICENSE 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 "Plugin.h"
-
-#include "CoreInterface.h"
-
-static const char kBaseUrl[] = "http://symless.com/files";
-static const char kDefaultVersion[] = "1.1";
-static const char kWinPackagePlatform32[] = "Windows-x86";
-static const char kWinPackagePlatform64[] = "Windows-x64";
-static const char kMacPackagePlatform[] = "MacOSX%1-i386";
-static const char kLinuxPackagePlatformDeb32[] = "Linux-i686-deb";
-static const char kLinuxPackagePlatformDeb64[] = "Linux-x86_64-deb";
-static const char kLinuxPackagePlatformRpm32[] = "Linux-i686-rpm";
-static const char kLinuxPackagePlatformRpm64[] = "Linux-x86_64-rpm";
-
-#if defined(Q_OS_WIN)
-static const char kWinPluginExt[] = ".dll";
-static const char kInstallerPluginLocation[] = "Plugins";
-#elif defined(Q_OS_MAC)
-static const char kMacPluginPrefix[] = "lib";
-static const char kMacPluginExt[] = ".dylib";
-static const char kInstallerPluginLocation[] = "plugins"; // TODO: Fix for mac
-#else
-static const char kLinuxPluginPrefix[] = "lib";
-static const char kLinuxPluginExt[] = ".so";
-// /usr/bin becomes /usr/bin/../lib/syn...
-static const char kInstallerPluginLocation[] = "../lib/synergy/plugins";
-#endif
-
-QString Plugin::getOsSpecificExt()
-{
-
-#if defined(Q_OS_WIN)
- return kWinPluginExt;
-#elif defined(Q_OS_MAC)
- return kMacPluginExt;
-#else
- return kLinuxPluginExt;
-#endif
-}
-
-QString Plugin::getOsSpecificName(const QString& pluginName)
-{
- QString result = pluginName;
-#if defined(Q_OS_WIN)
- result.append(getOsSpecificExt());
-#elif defined(Q_OS_MAC)
- result = kMacPluginPrefix + pluginName + getOsSpecificExt();
-#else
- result = kLinuxPluginPrefix + pluginName + getOsSpecificExt();
-#endif
- return result;
-}
-
-QString Plugin::getOsSpecificInstallerLocation() {
- return kInstallerPluginLocation;
-}
View
@@ -1,53 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2015-2016 Symless 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 LICENSE 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/>.
- */
-#ifndef PLUGIN_H
-#define PLUGIN_H
-
-#include <QString>
-#include <QStringList>
-#include <QObject>
-
-#include "SslCertificate.h"
-#include "CoreInterface.h"
-#include "DataDownloader.h"
-
-class Plugin : public QObject
-{
- Q_OBJECT
-
-public:
- //Plugin();
- //~PluginManager();
-
- static QString getOsSpecificName(const QString& pluginName);
- static QString getOsSpecificExt();
- static QString getOsSpecificLocation();
- static QString getOsSpecificInstallerLocation();
- static QString getOsSpecificUserLocation();
-
-public slots:
-
-private:
-// CoreInterface m_CoreInterface;
-
-signals:
-
-private:
-
-};
-
-#endif // PLUGIN_H
View
@@ -1,186 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2015-2016 Symless 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 LICENSE 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 "PluginManager.h"
-
-#include "CoreInterface.h"
-#include "DataDownloader.h"
-#include "QUtility.h"
-#include "ProcessorArch.h"
-#include "Fingerprint.h"
-#include "Plugin.h"
-#include "../lib/common/PluginVersion.h"
-
-#include <QTextStream>
-
-#include <QFile>
-#include <QDir>
-#include <QProcess>
-#include <QCoreApplication>
-
-
-PluginManager::PluginManager() :
- m_PluginList()
-{
- init();
-}
-
-PluginManager::~PluginManager()
-{
-}
-
-void PluginManager::init()
-{
- m_PluginDir = m_CoreInterface.getPluginDir();
- if (m_PluginDir.isEmpty()) {
- emit error(tr("Failed to get plugin directory."));
- }
-
- m_ProfileDir = m_CoreInterface.getProfileDir();
- if (m_ProfileDir.isEmpty()) {
- emit error(tr("Failed to get profile directory."));
- }
-
- m_InstalledDir = m_CoreInterface.getInstalledDir();
- if (m_InstalledDir.isEmpty()) {
- emit error(tr("Failed to get installed directory."));
- }
-}
-
-bool PluginManager::exist(QString name)
-{
- CoreInterface coreInterface;
- QString PluginDir = coreInterface.getPluginDir();
- QString pluginName = Plugin::getOsSpecificName(name);
- QString filename;
- filename.append(PluginDir);
- filename.append(QDir::separator()).append(pluginName);
- QFile file(filename);
- bool exist = false;
- if (file.exists()) {
- exist = true;
- }
-
- return exist;
-}
-
-void PluginManager::copyPlugins()
-{
- try {
- // Get the Directory where plugins are put on installation
- // If it doesn't exist, there is nothing to do
- QString srcDirName(m_InstalledDir.append(QDir::separator())
- .append(Plugin::getOsSpecificInstallerLocation()));
-
- QDir srcDir(srcDirName);
- if (!srcDir.exists()) {
- emit info(
- tr("No plugins found to copy from %1")
- .arg(srcDirName));
- emit copyFinished();
- }
-
- // Get the directory where Plugins are installed into Synergy
- // If it doesn't exist make it
- QString destDirName = m_PluginDir;
-
- QDir destDir(destDirName);
- if (!destDir.exists()) {
- destDir.mkpath(".");
- }
- // Run through the list of plugins and copy them
- for ( int i = 0 ; i < m_PluginList.size() ; i++ ) {
- // Get a file entry for the plugin using the full path
- QFile file(srcDirName + QDir::separator() + m_PluginList.at(i));
-
- // construct the destination file name
- QString newName(destDirName + QDir::separator() + m_PluginList.at(i));
-
- // Check to see if the plugin already exists
- QFile newFile(newName);
- if(newFile.exists()) {
- // If it does, delete it. TODO: Check to see if same and leave
- bool result = newFile.remove();
- if( !result ) {
- emit error(
- tr( "Unable to delete plugin:\n%1\n"
- "Please stop synergy and run the wizard again.")
- .arg(newName));
- return;
- }
- }
- // make a copy of the plugin in the new location
- #if defined(Q_OS_WIN)
- bool result = file.copy(newName);
- #else
- bool result = file.link(newName);
- #endif
- if ( !result ) {
- emit error(
- tr("Failed to copy plugin '%1' to: %2\n%3\n"
- "Please stop synergy and run the wizard again.")
- .arg(m_PluginList.at(i))
- .arg(newName)
- .arg(file.errorString()));
- return;
- }
- else {
- emit info(
- tr("Copying '%1' plugin (%2/%3)...")
- .arg(m_PluginList.at(i))
- .arg(i+1)
- .arg(m_PluginList.size()));
- }
- }
- }
- catch (std::exception& e)
- {
- emit error(tr( "An error occurred while trying to copy the "
- "plugin list. Please contact the help desk, and "
- "provide the following details.\n\n%1").arg(e.what()));
- }
-
- emit copyFinished();
- return;
-}
-
-void PluginManager::queryPluginList()
-{
- try {
- setDone(false);
- QString extension = "*" + Plugin::getOsSpecificExt();
- QStringList nameFilter(extension);
-
- QString installDir(m_CoreInterface.getInstalledDir()
- .append(QDir::separator())
- .append(Plugin::getOsSpecificInstallerLocation()));
-
- QString searchDirectory(installDir);
- QDir directory(searchDirectory);
- m_PluginList = directory.entryList(nameFilter);
- setDone(true);
- }
- catch (std::exception& e)
- {
- setDone(true);
- emit error(tr( "An error occurred while trying to load the "
- "plugin list. Please contact the help desk, and "
- "provide the following details.\n\n%1").arg(e.what()));
- }
- emit queryPluginDone();
- return;
-}
View
@@ -1,75 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2015-2016 Symless 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 LICENSE 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/>.
- */
-
-#ifndef PLUGINMANAGER_H
-#define PLUGINMANAGER_H
-
-#include <QString>
-#include <QStringList>
-#include <QObject>
-
-#include "SslCertificate.h"
-#include "CoreInterface.h"
-#include "DataDownloader.h"
-#include "Plugin.h"
-
-class PluginManager : public QObject
-{
- Q_OBJECT
-
-public:
- PluginManager();
- ~PluginManager();
-
- void init();
-
- int pluginCount() { return m_PluginList.count(); }
- QStringList& getPluginList() { return m_PluginList; }
-
- bool isDone() { return done; }
- void setDone(bool b) { done = b; }
- static bool exist(QString name);
-
-public slots:
- void copyPlugins();
- void queryPluginList();
-
-private:
- QString getPluginUrl(const QString& pluginName);
- bool runProgram(
- const QString& program,
- const QStringList& args,
- const QStringList& env);
-
-signals:
- void error(QString e);
- void info(QString i);
- void updateCopyStatus(int);
- void copyFinished();
- void queryPluginDone();
-
-private:
- QStringList m_PluginList;
- QString m_PluginDir;
- QString m_ProfileDir;
- QString m_InstalledDir;
- CoreInterface m_CoreInterface;
- SslCertificate m_SslCertificate;
- bool done;
-};
-
-#endif // PLUGINMANAGER_H
View
@@ -1,206 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2015-2016 Symless 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 LICENSE 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 "PluginWizardPage.h"
-#include "ui_PluginWizardPageBase.h"
-
-#include "SslCertificate.h"
-#include "PluginManager.h"
-#include "MainWindow.h"
-#include "EditionType.h"
-
-#include <QMovie>
-#include <QThread>
-#include <QTime>
-
-PluginWizardPage::PluginWizardPage(MainWindow& mainWindow, QWidget *parent) :
- QWizardPage(parent),
- m_Finished(false),
- m_Edition(Unknown),
- m_pSslCertificate(NULL),
- m_mainWindow(mainWindow)
-{
- setupUi(this);
-
- QMovie *movie = new QMovie(":/res/image/spinning-wheel.gif");
- m_pLabelSpinning->setMovie(movie);
- movie->start();
-
- m_pSslCertificate = new SslCertificate(this);
-}
-
-PluginWizardPage::~PluginWizardPage()
-{
- delete m_pSslCertificate;
-}
-
-void PluginWizardPage::changeEvent(QEvent *e)
-{
- QWizardPage::changeEvent(e);
- switch (e->type()) {
- case QEvent::LanguageChange:
- retranslateUi(this);
- break;
- default:
- break;
- }
-}
-
-void PluginWizardPage::initializePage()
-{
- QWizardPage::initializePage();
-
- if (m_Edition != Pro) {
- updateStatus(tr("Setup complete."));
- showFinished();
- return;
- }
-
- m_pLabelSpinning->show();
-
- QThread* thread = new QThread;
-
- connect(&m_PluginManager,
- SIGNAL(error(QString)),
- this,
- SLOT(showError(QString)));
-
- connect(&m_PluginManager,
- SIGNAL(info(QString)),
- this,
- SLOT(updateStatus(QString)));
-
- connect(&m_PluginManager,
- SIGNAL(queryPluginDone()),
- this,
- SLOT(queryPluginDone()));
-
- connect(&m_PluginManager,
- SIGNAL(queryPluginDone()),
- thread,
- SLOT(quit()));
-
- connect(&m_PluginManager,
- SIGNAL(error(QString)),
- thread,
- SLOT(quit()));
-
- connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
-
- m_PluginManager.moveToThread(thread);
- thread->start();
-
- QMetaObject::invokeMethod(&m_PluginManager, "queryPluginList", Qt::QueuedConnection);
-}
-
-void PluginWizardPage::queryPluginDone()
-{
- QStringList pluginList = m_PluginManager.getPluginList();
- if (pluginList.isEmpty()) {
- updateStatus(tr("Setup complete."));
- showFinished();
- }
- else {
- m_mainWindow.stopSynergy();
- copyPlugins();
- m_mainWindow.startSynergy();
- }
-}
-
-void PluginWizardPage::copyPlugins()
-{
- m_pThread = new QThread;
-
- connect(&m_PluginManager,
- SIGNAL(copyFinished()),
- this,
- SLOT(generateCertificate()));
-
- connect(&m_PluginManager,
- SIGNAL(error(QString)),
- m_pThread,
- SLOT(quit()));
-
- connect(m_pThread,
- SIGNAL(finished()),
- m_pThread,
- SLOT(deleteLater()));
-
- updateStatus(
- tr("Copying plugins..."));
-
- m_PluginManager.moveToThread(m_pThread);
- m_pThread->start();
-
- QMetaObject::invokeMethod(
- &m_PluginManager,
- "copyPlugins",
- Qt::QueuedConnection);
-}
-
-void PluginWizardPage::generateCertificate()
-{
- connect(m_pSslCertificate,
- SIGNAL(generateFinished()),
- this,
- SLOT(finished()));
-
- connect(m_pSslCertificate,
- SIGNAL(generateFinished()),
- m_pThread,
- SLOT(quit()));
-
- updateStatus(tr("Generating SSL certificate..."));
-
- QMetaObject::invokeMethod(
- m_pSslCertificate,
- "generateCertificate",
- Qt::QueuedConnection);
-}
-
-void PluginWizardPage::showError(QString error)
-{
- updateStatus(tr("Error: %1").arg(error));
- showFinished();
-}
-
-
-void PluginWizardPage::updateStatus(QString info)
-{
- m_pLabelStatus->setText(info);
-}
-
-void PluginWizardPage::finished()
-{
- // TODO: we should check if ns plugin exists
- m_mainWindow.appConfig().setCryptoEnabled(true);
-
- updateStatus(tr("Plugins installed successfully."));
- showFinished();
-}
-
-void PluginWizardPage::showFinished()
-{
- m_pLabelSpinning->hide();
- m_Finished = true;
- emit completeChanged();
-}
-
-bool PluginWizardPage::isComplete() const
-{
- return m_Finished;
-}
View
@@ -1,66 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2015-2016 Symless 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 LICENSE 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/>.
- */
-
-#ifndef PLUGINWIZARDPAGE_H
-#define PLUGINWIZARDPAGE_H
-
-#include "AppConfig.h"
-
-#include "ui_PluginWizardPageBase.h"
-#include "PluginManager.h"
-#include <QWizardPage>
-
-class SslCertificate;
-class MainWindow;
-
-class PluginWizardPage : public QWizardPage, public Ui::PluginWizardPage {
-
- Q_OBJECT
-
-public:
- PluginWizardPage(MainWindow& mainWindow, QWidget *parent = 0);
- ~PluginWizardPage();
-
- void setFinished(bool b) { m_Finished = b; }
- void setEdition(int edition) { m_Edition = edition; }
-
- bool isComplete() const;
- void initializePage();
-
-protected:
- void changeEvent(QEvent *e);
-
-protected slots:
- void showError(QString error);
- void updateStatus(QString info);
- void queryPluginDone();
- void generateCertificate();
- void finished();
-
-private:
- void copyPlugins();
- void showFinished();
-
-private:
- bool m_Finished;
- int m_Edition;
- PluginManager m_PluginManager;
- SslCertificate* m_pSslCertificate;
- QThread* m_pThread;
- MainWindow& m_mainWindow;
-};
-#endif // PLUGINWIZARDPAGE_H
View
@@ -19,6 +19,7 @@
#include "ProcessorArch.h"
#include "CommandProcess.h"
+#include "EditionType.h"
#if defined(Q_OS_LINUX)
#include <QProcess>
@@ -97,15 +98,18 @@ QString getOSInformation()
QString result;
#if defined(Q_OS_LINUX)
- QStringList arguments;
- arguments.append("/etc/os-release");
- CommandProcess cp("/bin/cat", arguments);
- QString output = cp.run();
+ result = "Linux";
+ try {
+ QStringList arguments;
+ arguments.append("/etc/os-release");
+ CommandProcess cp("/bin/cat", arguments);
+ QString output = cp.run();
- QRegExp resultRegex(".*PRETTY_NAME=\"([^\"]+)\".*");
- if (resultRegex.exactMatch(output)) {
- QString OSInfo = resultRegex.cap(1);
- result = OSInfo;
+ QRegExp resultRegex(".*PRETTY_NAME=\"([^\"]+)\".*");
+ if (resultRegex.exactMatch(output)) {
+ result = resultRegex.cap(1);
+ }
+ } catch (...) {
}
#endif
Oops, something went wrong.