Compare commits

...

260 Commits

Author SHA1 Message Date
Andrew Nelless
c30301e234 Merge branch 'master' into v1.8.8 2017-03-03 14:05:27 +00:00
Andrew Nelless
5909df9ee7 v1.8.8-stable 2017-03-03 13:41:07 +00:00
Epakai
c5b83ce4c4 Fix ClipboardChunkTests unit test (Fixes #5840) 2017-02-12 21:18:44 +00:00
Andrew Nelless
fc3cc78c3e Update changelog... again 2017-02-06 12:47:19 +00:00
Martin Wilck
ed17e9275d XRandR: fix screen size calculation
XWindowsScreen::saveShape() using XRRSizes / XRRRotations to
calculate screen dimensions when XRandR and a rotated screen
was detected. This is wrong. The screen dimensions in the
display properties already reflect rotation.

Moreover, on servers supporting XRandR >= 1.2, the XRRSizes()
and XRRRotations calls from XRandR 1.1 will return the
properties of the "primary output" in XRandR 1.2 terms rather than
the properties of the entire screen.
2017-02-06 12:45:39 +00:00
Andrew Nelless
2d9ed0d335 Updated Changelog 2017-02-06 12:04:52 +00:00
Andrew Nelless
2643cea67b #5074 Nuke -Werror. It's dumb right now 2017-02-06 11:10:26 +00:00
Andrew Nelless
4b913b5599 v1.8.8-rc1 2017-01-31 12:39:18 +00:00
Reinder Feenstra
1499f7b27c #5525 Add support for floating point start/end range values 2017-01-25 21:11:13 +00:00
Jiwoong Yoo
f35e3e5e06 #5578 Virtual key table mapped for inactive IMEs
Virtual key table is mapped for all IMEs not just active IME.

And this causes the wrong modifier key to be pressed. For example, if you use Korean and Japanese IMEs, pressing the Hangul key makes alt key pressed. So when I press just 'a', client interprets that as 'alt-a'.
2017-01-25 21:07:44 +00:00
Jiwoong Yoo
180d3e57d2 #5196 Korean and Japanese keyboards have same key code 2017-01-25 21:04:13 +00:00
Mike Hobbs
adf34eba40 #5785 Fix screen switch problem when cursor is in a corner 2017-01-25 20:55:20 +00:00
Andrew Nelless
b5a81579ed #5809 macOS: Add a version key to Info.plist 2017-01-25 20:46:59 +00:00
James McMullan
0eff5a95be #3992 macOS: Dragging broken in Unity
OSXScreen was not adding mouse movement deltas to mouse events while
dragging. Some 3D applications rely on these deltas to implement
dragging. Adding the mouse deltas to the mouse event fixes dragging in
these applications. Ex: Unity3d
2017-01-25 20:46:00 +00:00
Andreas Eriksson
ba55369d42 #3197 Disable regular motion events when using XInput 2 2017-01-25 20:36:56 +00:00
Jee-Yong Um
8e6bf53233 #4504 Improve Korean language description 2017-01-25 20:32:59 +00:00
Christian Schmidt
21d4e6a908 #4477 Only allow mouse buttons 1-10 for XTestFakeButtons call.
These are the only valid ones:
[~]>for i in `seq 0 1 11`; do echo Testing $i; xte "mouseclick $i"; done
Testing 0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  132 (XTEST)
  Minor opcode of failed request:  2 (X_XTestFakeInput)
  Value in failed request:  0x0
  Serial number of failed request:  12
  Current serial number in output stream:  15
Testing 1
Testing 2
Testing 3
Testing 4
Testing 5
Testing 6
Testing 7
Testing 8
Testing 9
Testing 10
Testing 11
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  132 (XTEST)
  Minor opcode of failed request:  2 (X_XTestFakeInput)
  Value in failed request:  0xb
  Serial number of failed request:  12

And there are mice out there where buttons 11+ can be pressed accidentally,
terminating the synergy client and often leaving the system in a bad state.
2017-01-25 20:30:15 +00:00
zbrode
f5944278ed #4419 We never define _BYTE_ORDER so don't test for it. 2017-01-25 20:28:11 +00:00
Fábio Oliveira
3d3b7ca881 #4288 Remove auto Alt+Printscreen on Windows
As per issue https://github.com/synergy/synergy/issues/4288
2017-01-25 20:25:49 +00:00
伊冲
3bb833b798 #4193 System tray is unavailable on KDE5 2017-01-21 11:28:12 +00:00
Nye Liu
a5140aa1b9 Fix typo in compiler flags 2017-01-21 11:12:27 +00:00
Andrew Nelless
9799e96903 Update changelog for v1.8.7 2017-01-19 13:18:10 +00:00
XinyuHou
487d8c99a1 Merge branch 'issue5784-edition-switching' into v1.8.7 2017-01-18 12:44:10 +00:00
XinyuHou
fd6ea65f1a Version to1.8.7-stable 2017-01-18 12:43:17 +00:00
Jerry (Xinyu Hou)
b69570ec2c #5784 Fix using the wrong serial key 2016-12-28 15:57:15 +00:00
XinyuHou
ade4b7f8a2 Merge branch 'v1.8.6' 2016-12-12 18:32:00 +00:00
XinyuHou
2ab21aaa01 Version to 1.8.6-stable 2016-12-12 16:55:31 +00:00
XinyuHou
5061f51a66 Update Changelog 2016-12-12 16:55:05 +00:00
XinyuHou
c31f908fb2 Fix warning in IPC proxy classes 2016-12-07 17:35:52 +00:00
XinyuHou
74d63df244 Fix incorrect check of return code from dup 2016-12-07 17:28:15 +00:00
XinyuHou
3b92a87261 Merge branch 'beefnog-mac-directions' of https://github.com/beefnog/synergy into beefnog-beefnog-mac-directions 2016-12-07 17:13:47 +00:00
XinyuHou
c764e26144 Merge branch 'mac-msg' of https://github.com/j2gl/synergy into j2gl-mac-msg 2016-12-07 16:39:40 +00:00
XinyuHou
e1dc29799f Fix wrong usage example in hm 2016-12-06 15:18:18 +00:00
Epakai
4297673387 spelling error "implmented => implemented" 2016-12-06 14:56:47 +00:00
Epakai
72b1ebcdb2 spelling error "unknow => unknown" 2016-12-06 14:56:38 +00:00
XinyuHou
a49de58738 #5752 Correct tab order in settings dialog 2016-12-06 12:03:40 +00:00
XinyuHou
d8cd60f057 Version to 1.8.6-rc2 2016-12-06 11:22:54 +00:00
Jerry (Xinyu Hou)
00db51cd93 Ask for logs in issue template 2016-12-05 11:01:53 +00:00
Jerry (Xinyu Hou)
e8145aa779 #5592 Post keyboard events to lower level HID client 2016-11-22 15:19:58 +00:00
Jerry (Xinyu Hou)
7c12608f20 Merge remote-tracking branch 'origin/issue5722-malformed-keys' into v1.8.6 2016-11-11 11:40:17 +00:00
Jerry (Xinyu Hou)
265cc5c687 Merge branch 'issue5699-unified-installers' into v1.8.6 2016-11-03 17:28:00 +00:00
Jerry (Xinyu Hou)
a279348cf9 Merge branch 'issue5186-different-dpi' into v1.8.6 2016-11-03 17:27:24 +00:00
Jerry (Xinyu Hou)
e6ca9e417d #5699 load deploy target on load config so dist command is aware of it 2016-11-03 16:42:38 +00:00
Andrew Nelless
f2f4b05c6f #5699 Only put MacOSX version number in filename when deploying for exact SDK 2016-11-03 14:55:36 +00:00
Jerry (Xinyu Hou)
b8233fc146 #5186 Add deprecated arguments warnings 2016-11-03 14:31:27 +00:00
Jerry (Xinyu Hou)
5cccac360c #5699 Add deploy target to GUI configure 2016-11-02 11:55:39 +00:00
Andrew Nelless
24a548273e #5722 Trim serial keys already stored 2016-11-02 11:28:04 +00:00
Andrew Nelless
1a7920f80d #5722 Make LicenseManager accept SerialKey object instead of string 2016-11-01 17:29:25 +00:00
Jerry (Xinyu Hou)
7ce6905935 Version to 1.8.6-rc1 2016-11-01 15:22:33 +00:00
Jerry (Xinyu Hou)
340ee43d90 #5699 Add Mac deploy argument in configure command
If deploy target is not specified, it would use the specified sdk
version
2016-10-31 17:40:54 +00:00
Jerry (Xinyu Hou)
514e2475c3 Merge branch 'v1.8.6' into issue5186-different-dpi 2016-10-31 16:31:30 +00:00
Andrew Nelless
6a7703f229 Merge branch 'v1.8.5' 2016-10-31 14:53:34 +00:00
Jerry (Xinyu Hou)
a18eba7520 Version to 1.8.5-stable 2016-10-31 12:45:42 +00:00
Jerry (Xinyu Hou)
20a34e5abf Update changelog for 1.8.5-stable 2016-10-31 12:45:20 +00:00
Jerry (Xinyu Hou)
771d2a419b Fix 1.8.4 changelog 2016-10-31 12:38:16 +00:00
Andrew Nelless
c9bb421fb5 Version to v1.8.5-rc2 2016-10-28 17:48:20 +01:00
Andrew Nelless
2f2dd7742f #5707 Don't send update notifications for new users 2016-10-28 17:45:58 +01:00
Andrew Nelless
3e9815dfdd #5707 Add newline to update notification string 2016-10-28 17:45:52 +01:00
Andrew Nelless
ef9842c819 #5707 Change update notification url 2016-10-28 17:45:47 +01:00
Andrew Nelless
af62174b59 #5707 Only notify activation on user action 2016-10-28 17:45:42 +01:00
Andrew Nelless
af9037276c #5707 Prefer 'update' over 'upgrade' 2016-10-28 17:45:35 +01:00
Andrew Nelless
fa7daa48f7 Revert "Update buildbot to Qt 4.8.7"
This reverts commit b7e0473cb4.
2016-10-28 17:45:34 +01:00
Andrew Nelless
73685c3d92 #5707 Tweak notify url for upgrades 2016-10-28 17:45:30 +01:00
Andrew Nelless
4206799ae3 #5707 Add from and to version numbers to version update notification 2016-10-28 17:45:26 +01:00
Andrew Nelless
2de06b9727 #5707 Add support for upgrade notifications 2016-10-28 17:45:20 +01:00
Andrew Nelless
9f1e91cc76 Remove pointless call to curl_free 2016-10-28 17:45:18 +01:00
Andrew Nelless
906fd15b4a #5707 Store and update last version uses in settings 2016-10-28 17:45:13 +01:00
Jerry (Xinyu Hou)
8d193c76b5 #5186 Apply DPI aware option in local machine rather than current user in registry 2016-10-28 06:00:46 -07:00
Jerry (Xinyu Hou)
0d4fd6dcef #5186 Reorder some functions call to make it clear 2016-10-28 06:00:11 -07:00
Jerry (Xinyu Hou)
c2372bc9a8 #5186 Remove accumulate fraction DPI calculation 2016-10-28 05:24:07 -07:00
Jerry (Xinyu Hou)
cf397a0d6f #5186 Remove Dpi calculation code 2016-10-28 04:50:06 -07:00
Jerry (Xinyu Hou)
c62c4d503d #5186 Remove dpiaware manifest 2016-10-28 03:38:08 -07:00
Jerry (Xinyu Hou)
640262dfff #5186 Only add DPI related registry key on Windows 8 or above 2016-10-26 08:43:55 -07:00
Jerry (Xinyu Hou)
6b0cd35527 #5186 Update registry keys to enable Windows 7 compatibility and disable DPI scaling 2016-10-26 08:10:09 -07:00
Andrew Nelless
b7e0473cb4 Update buildbot to Qt 4.8.7 2016-10-26 15:34:36 +01:00
Andrew Nelless
f08f0b3f37 #5657 Fix activation dialog tab order 2016-10-25 16:40:33 +01:00
Andrew Nelless
492df1f3fd #5657 Stop service and refresh license when trial expires 2016-10-25 16:27:12 +01:00
Andrew Nelless
b66043e000 #5657 Tweak plurality of trial countdown 2016-10-20 17:59:03 +01:00
Andrew Nelless
a59c437fd3 Merge icon reversion 2016-10-20 14:55:55 +01:00
Andrew Nelless
1842a68a0e #5657 Always show trial counter, fix plurality 2016-10-20 14:55:21 +01:00
Jerry (Xinyu Hou)
e17130f060 Revert "#5640 Update icon to the new hotness"
This reverts commit 833c73f1bd.
2016-10-20 14:02:47 +01:00
Jerry (Xinyu Hou)
3048ca5fc6 Revert "#5640 About dialog tweaks"
This reverts commit 03b8788660.
2016-10-20 14:02:34 +01:00
Jerry (Xinyu Hou)
bdf5546058 Revert "#5640 About dialog tweaks"
This reverts commit 9837c982cd.
2016-10-20 14:02:01 +01:00
Andrew Nelless
7bae07d34e #5657 Merge trial support 2016-10-20 11:30:25 +01:00
Andrew Nelless
868887155d #5657 Update buy now links 2016-10-20 11:30:02 +01:00
Andrew Nelless
ae590907a8 #5657 Remind users to activate all devices if they might be using SSL 2016-10-19 17:50:44 +01:00
Andrew Nelless
f2a1d962bc #5657 Fix skip activation loop 2016-10-19 17:40:34 +01:00
Andrew Nelless
e01d0ce4c7 #5657 Raise activation dialog when key expires 2016-10-19 16:01:15 +01:00
Andrew Nelless
f441c24a23 #5657 Minor activation UI tweaks 2016-10-19 11:36:48 +01:00
Jerry (Xinyu Hou)
984ca48f34 Merge remote-tracking branch 'origin/issue5620-sierra' into v1.8.5 2016-10-19 10:54:31 +01:00
Andrew Nelless
6a7d1dd43c #5657 Merge core fixes for trial support 2016-10-19 10:46:52 +01:00
Andrew Nelless
47913e57b8 #5657 Raise activation dialog when trial expires 2016-10-18 18:45:15 +01:00
Andrew Nelless
02c23905d6 #5657 Handle expired keys properly 2016-10-18 17:01:44 +01:00
Jerry (Xinyu Hou)
dc4beba9e9 #5680 Stop deleting socket twice if it's been adopted by PacketStream 2016-10-18 16:48:32 +01:00
Jerry (Xinyu Hou)
dfc7c31d67 #5657 Delay auto client adding while activation dialog is shown 2016-10-18 15:43:15 +01:00
Andrew Nelless
020b7974df #5657 Fix trial warning label and serial key serialisation 2016-10-18 15:32:59 +01:00
Josh Harris
17961501f6 Update ISSUE_TEMPLATE.md
Moved the 'Server' and 'Client' fields around
2016-10-18 15:26:56 +01:00
Andrew Nelless
e5aae66ff7 #5657 Don't clear edition when appconfig contains an invalid serial key 2016-10-18 15:13:19 +01:00
Jerry (Xinyu Hou)
880864a249 Version to 1.8.5-rc1 2016-10-18 14:57:34 +01:00
Jerry (Xinyu Hou)
45f37c508c #5657 Make serial key argument for server only 2016-10-18 14:56:48 +01:00
Jerry (Xinyu Hou)
e48be9099d #5657 Remove whitespace for serial key input 2016-10-18 13:05:29 +01:00
Jerry (Xinyu Hou)
e65631c451 #5657 Fix wrong logic about checking if serial key expired 2016-10-18 13:02:36 +01:00
Andrew Nelless
859608424d #5657 Link synergyd against Synergy shared library 2016-10-17 18:06:29 +01:00
Andrew Nelless
98610fabde #5657 Remove unused CoreInterfaces 2016-10-17 17:59:01 +01:00
Andrew Nelless
fc67cdf56e #5657 Rename SubscriptionManager to LicenseManager 2016-10-17 17:57:14 +01:00
Andrew Nelless
5a34da3ce0 #5657 Refresh UI when synergys reports trial expired 2016-10-17 17:49:14 +01:00
Andrew Nelless
99dbdc5eb3 #5657 Use SerialKey class in ServerArgs 2016-10-17 17:38:05 +01:00
Andrew Nelless
88c59b4ca6 #5657 Fix unit tests after SerialKey::isValid removal 2016-10-17 17:37:30 +01:00
Andrew Nelless
599415f047 #5657 Only check trial times when using a trial 2016-10-17 17:11:30 +01:00
Andrew Nelless
8b4d7abfb0 #5657 Remove SerialKey::m_valid 2016-10-17 17:08:26 +01:00
Andrew Nelless
c7dc198d82 #5657 Fix SerialKey whitespace 2016-10-17 16:34:44 +01:00
Andrew Nelless
b5a6ae0a94 #5657 Fix SerialKey expiring unit test 2016-10-17 16:27:40 +01:00
Andrew Nelless
7eefa49c77 #5657 Fix SerialKey construction in unit tests 2016-10-17 16:12:33 +01:00
Andrew Nelless
714b2f6440 #5657 Make trial expiry notification live 2016-10-17 15:26:42 +01:00
Andrew Nelless
e05ced287c #5657 Enable external links on trial label 2016-10-17 11:57:32 +01:00
Andrew Nelless
e14ff8935b #5657 Fix SerialKey unit test 2016-10-15 16:25:04 +01:00
Andrew Nelless
0dd0e65e2a #5657 Remove more C++11 enum qualifiers 2016-10-15 16:07:05 +01:00
Andrew Nelless
b20d04d80c #5657 Add missing include for runtime_error 2016-10-15 15:59:27 +01:00
Andrew Nelless
3ee9ac5d49 #5657 Remove C++11 enum qualifier 2016-10-15 15:49:36 +01:00
Andrew Nelless
4ad7c7fe39 #5657 Rename edition to activeLicense. WSFs 2016-10-15 15:30:28 +01:00
Andrew Nelless
3b98a7b785 #5657 Add trial label to main window 2016-10-15 14:58:03 +01:00
Andrew Nelless
1f93b4a918 #5657 Rename dayLeft to daysLeft in unit tests 2016-10-15 12:37:00 +01:00
Andrew Nelless
d244683ac4 #5657 Merge core changes 2016-10-15 12:03:55 +01:00
XinyuHou
dc31f395cc #5657 Fixed integtests using the old server constructor 2016-10-14 09:44:02 -07:00
Andrew Nelless
55414e4581 #5657 Make SubscriptionManager backward compatible 2016-10-14 17:38:31 +01:00
Jerry (Xinyu Hou)
89851fddc3 #5657 Exited server if trial is expired 2016-10-14 17:14:21 +01:00
Jerry (Xinyu Hou)
2b1b0640ea #5657 Added serial argument parsing unit test 2016-10-14 13:51:46 +01:00
Jerry (Xinyu Hou)
92b29276d0 #5657 Added serial argument in core 2016-10-14 13:51:27 +01:00
Jerry (Xinyu Hou)
1e5dfd3cb5 #5657 Added more unit tests for member functions in SerialKey 2016-10-14 12:43:58 +01:00
Jerry (Xinyu Hou)
dce4b382e6 #5657 Fixed passing in the raw serial key 2016-10-14 12:43:33 +01:00
Jerry (Xinyu Hou)
33ebe61ef2 #5657 Counted expiring within 1 day as 1 day left 2016-10-14 12:43:01 +01:00
Andrew Nelless
727fc5c220 #5659 Move activation notification to SubscriptionManager 2016-10-14 12:16:23 +01:00
Andrew Nelless
540882056f #5657 Create a global SubscriptionManager instance 2016-10-14 11:59:25 +01:00
Andrew Nelless
743e96f277 #5657 Don't store activation email 2016-10-14 11:35:33 +01:00
Andrew Nelless
fd8e778b2a #5657 Fix serial key file path in GUI 2016-10-14 11:35:33 +01:00
Jerry (Xinyu Hou)
719e64dc8f #5657 Added missing dependencies on Linux and Windows 2016-10-13 18:07:21 +01:00
Jerry (Xinyu Hou)
235f528dd9 #5657 Added unit tests for SerialKey 2016-10-13 17:55:38 +01:00
Jerry (Xinyu Hou)
2a452307cd #5657 Fleshed out the implementation of SerialKey 2016-10-13 17:55:09 +01:00
Jerry (Xinyu Hou)
92a885524b #5657 Added temporary implementation for SerialKey 2016-10-13 14:00:19 +01:00
Jerry (Xinyu Hou)
92680b2877 #5657 Extracted shared code between GUI and core 2016-10-13 13:53:09 +01:00
Jerry (Xinyu Hou)
82e55702ef #5657 Removed serial key code from syntool 2016-10-13 11:20:43 +01:00
Jerry (Xinyu Hou)
4be9fc1800 Removed unused code 2016-10-13 11:18:03 +01:00
Jerry (Xinyu Hou)
d92fcd2453 #5657 Added version 2 trial serial key support 2016-10-13 11:15:38 +01:00
Jerry (Xinyu Hou)
c7cd74ab5f Fixed code style 2016-10-13 11:11:56 +01:00
Jerry (Xinyu Hou)
817f8f2bcb Updated git ignore list 2016-10-13 11:11:37 +01:00
Andrew Nelless
c21fc4a6dd #3797 Revert to using hardcoded SDK path for buildbot 2016-10-12 16:50:11 +01:00
Andrew Nelless
5ea1fdc7c6 #5620 Remove deprecated NXClickTime call 2016-10-12 16:10:57 +01:00
Andrew Nelless
df88faaad8 #5620 Convert OSXScreen into Objective C++ 2016-10-12 15:43:01 +01:00
rishubil
d1396c9767 #3797 Fix "Unix Makefile" build on macOS 2016-10-12 15:30:58 +01:00
Andrew Nelless
2b9f48602c #5620 Make Xcode 8 happy with null cast 2016-10-12 15:09:29 +01:00
Jerry (Xinyu Hou)
a50ae2ad36 Fixed code style 2016-10-12 12:59:38 +01:00
Jerry (Xinyu Hou)
fc879323bc #5657 Removed password log in in activation window 2016-10-12 12:56:52 +01:00
Andrew Nelless
a6ff90794f v1.8.4 stable 2016-10-11 10:14:27 +01:00
Andrew Nelless
0e209aa903 Update Changelog 2016-10-11 10:13:50 +01:00
Andrew Nelless
fcd8153002 v1.8.4 rc3 2016-10-06 15:49:44 +01:00
Andrew Magill
217eb475de #5183 Accumulate fractional moves across updates. 2016-10-06 15:42:29 +01:00
Andrew Nelless
42ba77ae04 v1.8.4 rc2 2016-10-06 13:11:07 +01:00
Andrew Nelless
9ae146add0 Merge branding changes into v1.8.4 2016-10-06 13:04:28 +01:00
Andrew Nelless
ef3b79e585 Merge activation dialog branch into v1.8.4 2016-10-06 13:01:18 +01:00
Andrew Nelless
9837c982cd #5640 About dialog tweaks 2016-10-06 12:58:57 +01:00
Andrew Nelless
742cd70f98 #5627 Toggle fingerprint visibility when toggling SSL state 2016-10-06 11:29:34 +01:00
Andrew Nelless
176d7c9286 Update installer graphics 2016-10-05 22:12:00 +01:00
Andrew Nelless
03b8788660 #5640 About dialog tweaks 2016-10-05 21:53:58 +01:00
Andrew Nelless
833c73f1bd #5640 Update icon to the new hotness 2016-10-05 21:53:54 +01:00
Andrew Nelless
6892664f4a Fix cast of XRRNotifyEvent 2016-10-05 15:10:40 +01:00
Andrew Nelless
360d5a7c17 Merge Linux xrandr branch into v1.8.4 2016-10-05 15:05:31 +01:00
Andrew Nelless
dd88e324d7 #4420 Send screen shape change event on Linux (xrandr) 2016-10-05 12:54:57 +01:00
Benedikt Morbach
5b7392d302 #4420 Fix check for XRRNotifyEvent
use CheckTypeSize instead of CheckSymbolExists

From http://www.cmake.org/cmake/help/v3.0/module/CheckSymbolExists.html :
    If the symbol is a type or enum value it will not be recognized
    (consider using CheckTypeSize or CheckCSourceCompiles).
2016-10-05 12:54:57 +01:00
Andrew Nelless
26c11ec3c9 Restore horrible reinterpret_casts in OSXUchrKeyResource 2016-10-05 12:46:17 +01:00
Andrew Nelless
602fd3f649 Restore safe reinterpret_casts in OSXKeyState 2016-10-05 12:46:17 +01:00
Andrew Nelless
8072594008 Restore safe reinterpret_casts in OSXClipboardBMPConverter 2016-10-05 12:46:17 +01:00
Andrew Nelless
23cf284a66 Restore safe reinterpret_casts in MSWindowsClientTaskBarReceiver 2016-10-05 12:46:17 +01:00
Andrew Nelless
19b9be4593 Restore safe reinterpret_casts in MSWindowsScreenSaver 2016-10-05 12:46:17 +01:00
Andrew Nelless
788f6eab9f Restore safe reinterpret_casts in MSWindowsScreen 2016-10-05 12:46:17 +01:00
Andrew Nelless
2a5dc62747 Restore safe reinterpret_casts in MSWindowsDesks 2016-10-05 12:46:17 +01:00
Andrew Nelless
f7ad162634 Fix up casts in MSWindowsClipboardBitmapConverter 2016-10-05 12:46:17 +01:00
Andrew Nelless
2e30dc2c68 Restore safe reinterpret_cast of Windows thread handle 2016-10-05 12:46:17 +01:00
Andrew Nelless
702f095efd Fix cast in Windows TaskBar 2016-10-05 12:46:17 +01:00
Andrew Nelless
7e386c0bf9 Fix cast of port number in Winsock 2016-10-05 12:46:16 +01:00
Andrew Nelless
d77b5f1176 Restore safe reinterpret_casts in Windows TaskBar 2016-10-05 12:46:16 +01:00
Andrew Nelless
5a03e37d15 Restore safe reinterpret_casts in misc Windows code 2016-10-05 12:46:16 +01:00
Andrew Nelless
f1cd215f28 Restore safe reinterpret_cast in Synergy GUI 2016-10-05 12:46:16 +01:00
Andrew Nelless
0568271506 Partially remove reinterpret_casts in network tests 2016-10-05 12:46:16 +01:00
Andrew Nelless
a13dc92f2e Restore safe reinterpret_casts in SecureSocket 2016-10-05 12:46:16 +01:00
Andrew Nelless
16977788d3 Restore safe reinterpret_casts in XWindowsClipboardBMPConverter 2016-10-05 12:46:16 +01:00
Andrew Nelless
5b8fb69124 Partially de-reinterpret_cast XWindowsClipboard 2016-10-05 12:46:16 +01:00
Andrew Nelless
5272c9dde4 Restore safe reinterpret_casts in XWindowsUtil 2016-10-05 12:46:16 +01:00
Andrew Nelless
50807bfcb6 Restore safe reinterpret_casts in XWindowsScreen 2016-10-05 12:46:16 +01:00
Andrew Nelless
055370412c Restore safe reinterpret_cast in clipboard converter 2016-10-05 12:46:16 +01:00
Andrew Nelless
fb5e2bb171 Restore safe reinterpret_cast in readUInt32 2016-10-05 12:46:16 +01:00
Andrew Nelless
e81f7ab8c7 Replace unsafe casts with memcpy ops 2016-10-05 12:46:16 +01:00
Andrew Nelless
90c3dd6622 Restore evil-enabling reinterpret_cast in SocketMultiplexer 2016-10-05 12:46:16 +01:00
Andrew Nelless
0371002497 Restore use of reinterpret_cast in unicode routines 2016-10-05 12:46:16 +01:00
Andrew Nelless
f174614655 Remove bizarre cast of sockaddr to char* 2016-10-05 12:46:16 +01:00
Andrew Nelless
9ed9bde4e7 Restore use of reinterpret_cast for sockaddr_in 2016-10-05 12:46:16 +01:00
Andrew Nelless
f3d1470e58 Brutally replace all reinterpret_casts with static_casts 2016-10-05 12:46:16 +01:00
Andrew Nelless
e6a3caaf75 #5628 Fix net lib linkage on Ubuntu 2016-10-04 15:51:07 +01:00
Andrew Nelless
b345eb4067 v1.8.4-rc1 2016-10-04 15:30:53 +01:00
Andrew Nelless
0c76f9feeb Merge DPI scaling branch 2016-10-04 15:29:29 +01:00
Andrew Nelless
d99bd8e031 Merge fix for #5329 2016-10-04 15:23:27 +01:00
Andrew Nelless
c288918d68 #5629 Fix height of settings dialog 2016-10-04 15:12:27 +01:00
Andrew Nelless
002bcebbd2 #5629 Fix main window AppConfig naming conventions 2016-10-04 13:47:28 +01:00
Andrew Nelless
783056f7cc #5629 Ensure setEdition signals main UI 2016-10-04 13:41:27 +01:00
Andrew Nelless
15f2e27d18 #5629 Show the main window behind the activation dialog 2016-10-04 11:48:47 +01:00
Andrew Nelless
16ef224ba8 #5629 Save activation dialog seen state on reject 2016-10-04 11:15:53 +01:00
Andrew Nelless
603b12dc59 #5629 Trigger main window show event before opening activation dialog 2016-10-04 10:45:27 +01:00
Andrew Nelless
15a6a27dc6 #5629 Show activation dialog only after main window 2016-10-03 19:48:05 +01:00
Andrew Nelless
176d7e4725 #5617 Don't copy plugins directory on Windows 2016-10-03 19:47:55 +01:00
Andrew Nelless
912ed9be9c #5629 Ensure settings are saved when AppConfig updates them 2016-10-03 19:47:45 +01:00
Andrew Nelless
d1a180f652 #5627 Automatically generate SSL cert when enabling SSL 2016-10-03 19:47:38 +01:00
Andrew Nelless
32f143f52b #5627 Update Main Window fingerprint after SSL cert gen 2016-10-03 19:47:32 +01:00
Andrew Nelless
d6bcdcbea7 #5629 Change activation failure to a QDialog 2016-10-03 19:47:24 +01:00
Andrew Nelless
c799041ce8 #5627 Only generate an SSL certificate when it doesn't exist 2016-10-03 19:47:18 +01:00
Andrew Nelless
4924f2faff #5627 Save settings after creating MainWindow 2016-10-03 19:47:06 +01:00
Andrew Nelless
d6b7d8e357 #5627 Enable encryption for Pro users 2016-10-03 19:46:52 +01:00
Andrew Nelless
2809530793 #5629 Remove 'Run Wizard' from file menu 2016-10-03 19:46:48 +01:00
Andrew Nelless
bcf2d5de0d #5629 Trigger activation dialog if previously unseen 2016-10-03 19:46:43 +01:00
Andrew Nelless
02d75cd370 #5603 Ignore exceptions in getOSInformation() 2016-10-03 19:46:41 +01:00
Andrew Nelless
088ac82e18 #5629 Remove activation from the wizard 2016-10-03 19:46:25 +01:00
Andrew Nelless
6033f0c946 #5629 Minor grammar tweaks 2016-10-03 19:46:20 +01:00
Andrew Nelless
0f95c6e941 #5629 Complete activation support for activation dialog 2016-10-03 19:46:06 +01:00
Andrew Nelless
8788faffdd Enable Windows 7 compatibility mode for core binaries 2016-10-03 14:41:53 +01:00
Andrew Nelless
d48f6801f0 Disable DPI scaling on core binaries 2016-10-03 13:44:21 +01:00
Andrew Nelless
60a4e62779 #5629 Enable activation cancellation dialog 2016-09-29 16:17:38 +01:00
Andrew Nelless
0d5d7e11c0 #5629 Simplify Activation dialog 2016-09-29 16:16:49 +01:00
Andrew Nelless
d4646b1cc6 #5629 Add activation cancellation dialog 2016-09-29 16:14:09 +01:00
Andrew Nelless
81ae0c211a #5629 Move activation widgets to new activation dialog 2016-09-29 13:53:44 +01:00
Andrew Nelless
663e3f5854 #5629 Add rudimentary activation dialog 2016-09-29 13:45:06 +01:00
Andrew Nelless
45da1dfc7c #5628 Make enableCrypto directly enable SSL 2016-09-29 13:11:09 +01:00
Andrew Nelless
55a2d1231f #5628 Initialize SSL on secure client sockets 2016-09-29 13:11:09 +01:00
Andrew Nelless
0d84e4eed6 #5617 Make PacketStreamFilter adopt all socket types 2016-09-29 13:11:09 +01:00
Andrew Nelless
f4f57e1f95 #5617 Remove plugins from RPM spec 2016-09-29 13:11:09 +01:00
Andrew Nelless
3b5940ac18 #5628 Restore copying of SSL libs on Windows 2016-09-29 13:11:09 +01:00
Andrew Nelless
e18f8c62e7 #5617 Remove plugins support from toolchain 2016-09-29 13:11:09 +01:00
Andrew Nelless
964e6d2f12 #5617 Remove PluginManager from SettingsDialog 2016-09-29 13:11:09 +01:00
Andrew Nelless
1fceb2b646 #5617 Remove PluginManager from MainWindow 2016-09-29 13:11:05 +01:00
Andrew Nelless
5db78acab4 #5628 Link Synergy core against OpenSSL 2016-09-29 13:05:04 +01:00
Andrew Nelless
52c8763d97 #5617 Add SecureSocket to TCPSocketFactory 2016-09-29 13:05:04 +01:00
Andrew Nelless
6456271141 #5617 Remove plugin interface from Arch 2016-09-29 13:05:04 +01:00
Andrew Nelless
79fc6239fd #5617 Revert "Remove plugin interface from Arch"
This reverts commit 4613edc17ced61d6aca80cff661323ede0cb9d30.
2016-09-29 13:05:04 +01:00
Andrew Nelless
c3889667ba #5617 Remove online check for plugins 2016-09-29 13:05:04 +01:00
Andrew Nelless
5f5153f450 #5617 Remove the plugin wizard from GUI 2016-09-29 13:05:04 +01:00
Andrew Nelless
b55b8f0038 #5617 Revert "Remove plugin args from ArgParser"
This reverts commit cd58a8f0d0abe344d8e31a817386f613c7acde25.
2016-09-29 13:05:04 +01:00
Andrew Nelless
b1a991e8cd #5617 Revert "Remove plugin directory support"
This reverts commit fc697d2ab79bbd2d607c97658c986b629a1280ed.
2016-09-29 13:05:04 +01:00
Andrew Nelless
45ef3e1080 #5617 Remove plugin interface from Arch 2016-09-29 13:05:04 +01:00
Andrew Nelless
77d6b83b0c #5617 Remove stray PluginVersion includes 2016-09-29 13:05:04 +01:00
Andrew Nelless
aee8e2874e #5617 Remove plugins from Windows installer 2016-09-29 13:05:04 +01:00
Andrew Nelless
a2ad4cb0dc #5617 Remove plugin args from ArgParser 2016-09-29 13:05:04 +01:00
Andrew Nelless
011da60cca #5617 Remove plugin infra from ClientApp 2016-09-29 13:05:04 +01:00
Andrew Nelless
85227f41a1 #5617 Remove plugin infra from ServerApp 2016-09-29 13:05:04 +01:00
Andrew Nelless
f7e588dfff #5617 Remove plugin directory support 2016-09-29 13:05:03 +01:00
Andrew Nelless
dc93b063b7 #5617 Remove plugin infra from TCPSocketFactory 2016-09-29 13:05:03 +01:00
Andrew Nelless
5774f5a291 #5617 Remove plugin infra from Client 2016-09-29 13:05:03 +01:00
Andrew Nelless
27ccddbea4 #5617 Remove plugin infra from ClientListener 2016-09-29 13:05:03 +01:00
Andrew Nelless
76b2558f1a #5617 Delete the plugin infrastructure 2016-09-29 13:05:03 +01:00
Andrew Nelless
665bd91dbd #5628 Move SSL socket code from plugin to lib/net 2016-09-29 13:04:57 +01:00
Andrew Nelless
a70a2bf864 #5329 Fix build date in about dialog 2016-09-27 11:37:16 +01:00
Andrew Nelless
f58e95c96f v1.8.4 beta 2016-09-26 15:46:57 +01:00
j2gl
5a03ece50b Update MacOS warning 2015-11-20 01:35:23 -06:00
Robby Stahl
f00f60a8fe Update mac directions to not require a root user
I updated the directions such that a clear installation path is provided that does not require the direct use of root.
2015-09-10 14:04:01 -07:00
164 changed files with 2774 additions and 4254 deletions

View File

@@ -1,8 +1,7 @@
### Operating Systems ###
Client: Applesoft Windy OS 10
Server: microOS Tiara
Client: Applesoft Windy OS 10
**READ ME, DELETE ME**: On Windows, hold the Windows key and press 'r', type 'winver' and hit return to get your OS version. On Mac, hit the Apple menu (top left of the screen) and check 'About this Mac'. Linux users... you know what you're using ;)
@@ -28,4 +27,6 @@ Server: microOS Tiara
* Is there a way to work around it? No/Yes, you can...
* Does this bug prevent you from using Synergy entirely? Yes/No
Please follow the link below to send us logs from both your server and client sides if it's appropriate. https://github.com/symless/synergy/wiki/Sending-logs
Put anything else you can think of here.

3
.gitignore vendored
View File

@@ -1,7 +1,10 @@
config.h
.DS_Store
*.pyc
*.o
*~
\.*.swp
*build-gui-Desktop_Qt*
/bin
/lib
/build

View File

@@ -17,7 +17,7 @@
# Version number for Synergy
set(VERSION_MAJOR 1)
set(VERSION_MINOR 8)
set(VERSION_REV 3)
set(VERSION_REV 8)
set(VERSION_STAGE stable)
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}")
@@ -74,11 +74,6 @@ endif()
# Depending on the platform, pass in the required defines.
if (UNIX)
# warnings as errors:
# we have a problem with people checking in code with warnings.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-unused-local-typedef")
if (NOT APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
@@ -205,7 +200,10 @@ if (UNIX)
set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/local/include")
set(XKBlib "X11/Xlib.h;X11/XKBlib.h")
check_symbol_exists("XRRNotifyEvent" "${XKBlib};X11/extensions/Xrandr.h" HAVE_X11_EXTENSIONS_XRANDR_H)
set(CMAKE_EXTRA_INCLUDE_FILES "${XKBlib};X11/extensions/Xrandr.h")
check_type_size("XRRNotifyEvent" X11_EXTENSIONS_XRANDR_H)
set(HAVE_X11_EXTENSIONS_XRANDR_H "${X11_EXTENSIONS_XRANDR_H}")
set(CMAKE_EXTRA_INCLUDE_FILES)
check_include_files("${XKBlib};X11/extensions/dpms.h" HAVE_X11_EXTENSIONS_DPMS_H)
check_include_files("X11/extensions/Xinerama.h" HAVE_X11_EXTENSIONS_XINERAMA_H)

View File

@@ -1,3 +1,51 @@
v1.8.8-rc1
==========
Bug #5196 - Some keys on Korean and Japanese keyboards have the same keycode
Bug #5578 - Pressing Hangul key results in alt+'a'
Bug #5785 - Can't switch screens when cursor is in a corner
Bug #3992 - macOS: Dragging is broken in Unity 3D
Bug #5075 - macOS: Build fails on macOS 10.9 due to unknown compiler flag
Bug #5809 - macOS: No version number is shown in the App Info dialog
Bug #3197 - Linux: switchDoubleTap option is not working
Bug #4477 - Linux: Mouse buttons higher than id 10 result in crash
Bug #5832 - Linux: Screen size misdetected on multi-monitor display
Enhancement #4504 - Improved Korean language description
Enhancement #5525 - Added support for precise screen positioning in config file
Enhancement #4290 - Windows: Removed annoying alt+print screen functionality
v1.8.7-stable
=============
Bug #5784 - Edition changes when reopening GUI
v1.8.6-stable
=============
Bug #5592 - Some keys don't work for macOS Sierra clients
Bug #5186 - Cursor stuck on client when using multi-DPI server
Bug #5722 - Malformed serial key in registry will crash GUI on startup
Bug #5752 - Tab order is incorrect on Settings dialog
Enhancement #5699 - Unified installers on macOS
Feature #4836 - macOS Sierra build
v1.8.5-stable
=============
Bug #5680 - Server crashes when disconnecting SSL clients
Bug #5626 - Build fails using Xcode 8 and macOS SDK 10.12
Feature #5657 - Trial version support
Feature #5707 - User upgrade statistics
v1.8.4-stable
=============
Bug #5183 - Slowly moving the cursor has no effect on high DPI clients
Bug #4041 - UHD/4K DPI scaling broken on Windows servers
Bug #4420 - When XRandR adds a screen, it is inaccessible
Bug #5603 - Activation notification depends on existence of /etc/os-release
Bug #5624 - Update notification sometimes requests a downgrade
Bug #5329 - Current date is shown for build date in the about dialog
Enhancement #5617 - Remove redundant plugin infrastructure
Enhancement #5627 - Move SSL certificate generation to main window
Enhancement #5628 - Move SSL implementation into core binary
Enhancement #5629 - Move activation from wizard into new dialog window
v1.8.3-stable
=============
Bug #2765 - A letter appears on macOS clients when the spacebar is pressed

View File

@@ -5,10 +5,10 @@ To install on Mac OS X with the .zip distribution (first seen in 1.3.6) you must
1. Extract the zip file to any location (usually double click will do this)
2. Open Terminal, and cd to the extracted directory (e.g. /Users/my-name/Downloads/extracted-dir/)
3. Change to super user (use the su command)
4. Copy the binaries to /usr/bin using: cp synergy* /usr/bin
3. Copy the binaries to /usr/bin using: sudo cp synergy* /usr/bin
4. Correct the permissions and ownership: sudo chown root:wheel /usr/bin/synergy*; sudo chmod 555 /usr/bin/synergy*
How to enable the root user in Mac OS X:
Alternatively, you can copy the binaries as root. How to enable the root user in Mac OS X:
http://support.apple.com/en-us/ht1528
Once the binaries have been copied to /usr/bin, you should follow the configuration guide:

View File

@@ -41,7 +41,7 @@ class Toolchain:
cmd_opt_dict = {
'about' : ['', []],
'setup' : ['g:', ['generator=']],
'configure' : ['g:dr', ['generator=', 'debug', 'release', 'mac-sdk=', 'mac-identity=']],
'configure' : ['g:dr', ['generator=', 'debug', 'release', 'mac-sdk=', 'mac-deploy=', 'mac-identity=']],
'build' : ['dr', ['debug', 'release']],
'clean' : ['dr', ['debug', 'release']],
'update' : ['', []],
@@ -244,6 +244,9 @@ class InternalCommands:
# by default, unknown
macSdk = None
# by default, unknown
macDeploy = None
# by default, unknown
macIdentity = None
@@ -306,7 +309,7 @@ class InternalCommands:
' genlist Shows the list of available platform generators\n'
' usage Shows the help screen\n'
'\n'
'Example: %s build -g 3'
'Example: %s conf -g 3'
) % (app, app)
def configureAll(self, targets, extraArgs=''):
@@ -365,7 +368,7 @@ class InternalCommands:
# ensure latest setup and do not ask config for generator (only fall
# back to prompt if not specified as arg)
self.ensure_setup_latest()
if sys.platform == "darwin":
config = self.getConfig()
@@ -374,6 +377,11 @@ class InternalCommands:
elif config.has_option("hm", "macSdk"):
self.macSdk = config.get('hm', 'macSdk')
if self.macDeploy:
config.set('hm', 'macDeploy', self.macDeploy)
elif config.has_option("hm", "macDeploy"):
self.macSdk = config.get('hm', 'macDeploy')
if self.macIdentity:
config.set('hm', 'macIdentity', self.macIdentity)
elif config.has_option("hm", "macIdentity"):
@@ -383,7 +391,10 @@ class InternalCommands:
if not self.macSdk:
raise Exception("Arg missing: --mac-sdk <version>");
if not self.macDeploy:
self.macDeploy = self.macSdk
if not self.macIdentity:
raise Exception("Arg missing: --mac-identity <name>");
@@ -430,14 +441,16 @@ class InternalCommands:
if generator.cmakeName.find('Unix Makefiles') != -1:
cmake_args += ' -DCMAKE_BUILD_TYPE=' + target.capitalize()
elif sys.platform == "darwin":
if sys.platform == "darwin":
macSdkMatch = re.match("(\d+)\.(\d+)", self.macSdk)
if not macSdkMatch:
raise Exception("unknown osx version: " + self.macSdk)
sdkDir = self.getMacSdkDir()
cmake_args += " -DCMAKE_OSX_SYSROOT=" + sdkDir
cmake_args += " -DCMAKE_OSX_DEPLOYMENT_TARGET=" + self.macSdk
if generator.cmakeName.find('Unix Makefiles') == -1:
sdkDir = self.getMacSdkDir()
cmake_args += " -DCMAKE_OSX_SYSROOT=" + sdkDir
cmake_args += " -DCMAKE_OSX_DEPLOYMENT_TARGET=" + self.macDeploy
cmake_args += " -DOSX_TARGET_MAJOR=" + macSdkMatch.group(1)
cmake_args += " -DOSX_TARGET_MINOR=" + macSdkMatch.group(2)
@@ -496,8 +509,8 @@ class InternalCommands:
sdkDir = self.getMacSdkDir()
shortForm = "macosx" + self.macSdk
version = str(major) + "." + str(minor)
qmake_cmd_string += " QMAKE_MACOSX_DEPLOYMENT_TARGET=" + version
qmake_cmd_string += " QMAKE_MACOSX_DEPLOYMENT_TARGET=" + self.macDeploy
(qMajor, qMinor, qRev) = self.getQmakeVersion()
if qMajor <= 4:
@@ -551,6 +564,7 @@ class InternalCommands:
if os.path.exists(sdkPath):
return sdkPath
# return os.popen('xcodebuild -version -sdk macosx' + self.macSdk + ' Path').read().strip()
return "/Developer/SDKs/" + sdkDirName + ".sdk"
# http://tinyurl.com/cs2rxxb
@@ -653,6 +667,9 @@ class InternalCommands:
if config.has_option("hm", "macSdk"):
self.macSdk = config.get("hm", "macSdk")
if config.has_option("hm", "macDeploy"):
self.macDeploy = config.get("hm", "macDeploy")
if config.has_option("hm", "macIdentity"):
self.macIdentity = config.get("hm", "macIdentity")
@@ -741,16 +758,6 @@ class InternalCommands:
shutil.copy(targetDir + "/synergys", bundleBinDir)
shutil.copy(targetDir + "/syntool", bundleBinDir)
# Copy all generated plugins to the package
bundlePluginDir = bundleBinDir + "plugins"
pluginDir = targetDir + "/plugins"
print "Copying plugins dirtree: " + pluginDir
if os.path.isdir(pluginDir):
print "Copying to: " + bundlePluginDir
shutil.copytree(pluginDir, bundlePluginDir)
else:
print "pluginDir doesn't exist, skipping"
self.loadConfig()
if not self.macIdentity:
raise Exception("run config with --mac-identity")
@@ -1151,14 +1158,12 @@ class InternalCommands:
controlFile.close()
targetBin = '%s/%s/usr/bin' % (debDir, package)
targetPlugin = '%s/%s/usr/lib/synergy/plugins' % (debDir, package)
targetShare = '%s/%s/usr/share' % (debDir, package)
targetApplications = "%s/applications" % targetShare
targetIcons = "%s/icons" % targetShare
targetDocs = "%s/doc/%s" % (targetShare, self.project)
os.makedirs(targetBin)
os.makedirs(targetPlugin)
os.makedirs(targetApplications)
os.makedirs(targetIcons)
os.makedirs(targetDocs)
@@ -1176,17 +1181,6 @@ class InternalCommands:
if err != 0:
raise Exception('strip failed: ' + str(err))
pluginDir = "%s/plugins" % binDir
pluginFiles = [ 'libns.so']
for f in pluginFiles:
shutil.copy("%s/%s" % (pluginDir, f), targetPlugin)
target = "%s/%s" % (targetPlugin, f)
os.chmod(target, 0o0644)
err = os.system("strip " + target)
if err != 0:
raise Exception('strip failed: ' + str(err))
shutil.copy("%s/synergy.desktop" % resDir, targetApplications)
shutil.copy("%s/synergy.ico" % resDir, targetIcons)
@@ -1402,13 +1396,6 @@ class InternalCommands:
packageTarget = filename
ftp.upload(packageSource, packageTarget)
if type != 'src':
pluginsDir = binDir + '/plugins'
nsPluginSource = self.findLibraryFile(type, pluginsDir, 'ns')
if nsPluginSource:
nsPluginTarget = self.getLibraryDistFilename(type, pluginsDir, 'ns')
ftp.upload(nsPluginSource, nsPluginTarget, "plugins")
def getLibraryDistFilename(self, type, dir, name):
(platform, packageExt, libraryExt) = self.getDistributePlatformInfo(type)
firstPart = '%s-%s-%s' % (name, self.getVersionForFilename(), platform)
@@ -1870,7 +1857,10 @@ class InternalCommands:
# version is major and minor with no dots (e.g. 106)
version = str(major) + str(minor)
return "MacOSX%s-%s" % (version, arch)
if (self.macDeploy == self.macSdk):
return "MacOSX%s-%s" % (version, arch)
else:
return "MacOSX-%s" % arch
def reset(self):
if os.path.exists('build'):
@@ -1925,6 +1915,8 @@ class CommandHandler:
self.qtDir = a
elif o == '--mac-sdk':
self.ic.macSdk = a
elif o == '--mac-deploy':
self.ic.macDeploy = a
elif o == '--mac-identity':
self.ic.macIdentity = a

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 KiB

After

Width:  |  Height:  |  Size: 601 KiB

View File

@@ -20,7 +20,6 @@ source=%{_topdir}/../..
mkdir -p %{buildroot}/%{_datarootdir}/applications
mkdir -p %{buildroot}/%{_datarootdir}/icons
mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/%{_bindir}/../lib/synergy/plugins
cp $source/bin/synergy %{buildroot}%{_bindir}
cp $source/bin/synergyc %{buildroot}%{_bindir}
@@ -29,7 +28,6 @@ cp $source/bin/synergyd %{buildroot}%{_bindir}
cp $source/bin/syntool %{buildroot}%{_bindir}
cp $source/res/synergy.desktop %{buildroot}%{_datarootdir}/applications
cp $source/res/synergy.ico %{buildroot}%{_datarootdir}/icons
cp $source/bin/plugins/* %{buildroot}%{_bindir}/../lib/synergy/plugins
%files
%defattr(755,root,root,-)
@@ -40,7 +38,6 @@ cp $source/bin/plugins/* %{buildroot}%{_bindir}/../lib/synergy/plugins
%{_bindir}/syntool
%attr(644,-,-) %{_datarootdir}/applications/synergy.desktop
%attr(644,-,-) %{_datarootdir}/icons/synergy.ico
%attr(644,-,-) %{_bindir}/../lib/synergy/plugins/*
%changelog
* Thu Mar 20 2014 Nick Bolton <nick@symless.com>

View File

@@ -14,6 +14,38 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if (WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(OPENSSL_PLAT_DIR openssl-win64)
else()
set(OPENSSL_PLAT_DIR openssl-win32)
endif()
set(OPENSSL_INCLUDE ${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/inc32)
endif()
if (APPLE)
set(OPENSSL_PLAT_DIR openssl-osx)
set(OPENSSL_INCLUDE ${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/include)
endif()
if (WIN32)
set(OPENSSL_LIBS
${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/out32dll/libeay32.lib
${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/out32dll/ssleay32.lib
)
endif()
if (UNIX)
if (APPLE)
set(OPENSSL_LIBS
${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/libssl.a
${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/libcrypto.a
)
else()
set(OPENSSL_LIBS ssl crypto)
endif()
endif()
add_subdirectory(lib)
add_subdirectory(cmd)
add_subdirectory(micro)

View File

@@ -58,7 +58,7 @@ endif()
add_executable(synergyc ${sources})
target_link_libraries(synergyc
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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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,33 +62,32 @@ 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; }
void setEdition(Edition);
Edition edition() const;
QString setSerialKey(QString serial);
void clearSerialKey();
QString serialKey();
int lastExpiringWarningTime() const;
void setLastExpiringWarningTime(int t);
QString synergysName() const { return m_SynergysName; }
QString synergycName() const { return m_SynergycName; }
QString synergysName() const;
QString synergycName() const;
QString synergyProgramDir() const;
QString synergyLogDir() const;
@@ -92,26 +95,32 @@ class AppConfig
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 setAutoHide(bool b);
bool getAutoHide();
bool activationHasRun() const;
AppConfig& activationHasRun(bool value);
QString lastVersion() const;
void saveSettings();
void setLastVersion(QString version);
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; }
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 File

@@ -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 File

@@ -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 File

@@ -22,20 +22,22 @@
#include <QCoreApplication>
#include <QProcess>
#include <QtGlobal>
#include <QDir>
#include <stdexcept>
static const char kCoreBinary[] = "syntool";
#ifdef Q_WS_WIN
static const char kSerialKeyFilename[] = "Synergy.subkey";
#else
static const char kSerialKeyFilename[] = ".synergy.subkey";
#endif
CoreInterface::CoreInterface()
{
}
QString CoreInterface::getPluginDir()
{
QStringList args("--get-plugin-dir");
return run(args);
}
QString CoreInterface::getProfileDir()
{
QStringList args("--get-profile-dir");
@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -23,18 +23,18 @@
#include "MainWindow.h"
#include "Fingerprint.h"
#include "PluginManager.h"
#include "AboutDialog.h"
#include "ServerConfigDialog.h"
#include "SettingsDialog.h"
#include "SetupWizard.h"
#include "ActivationDialog.h"
#include "ZeroconfService.h"
#include "DataDownloader.h"
#include "CommandProcess.h"
#include "SubscriptionManager.h"
#include "LicenseManager.h"
#include "EditionType.h"
#include "QUtility.h"
#include "ProcessorArch.h"
#include "SslCertificate.h"
#include <QtCore>
#include <QtGui>
@@ -76,12 +76,14 @@ static const char* synergyIconFiles[] =
":/res/icons/16x16/synergy-transfering.png"
};
MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig,
LicenseManager& licenseManager) :
m_Settings(settings),
m_AppConfig(appConfig),
m_AppConfig(&appConfig),
m_LicenseManager(&licenseManager),
m_pSynergy(NULL),
m_SynergyState(synergyDisconnected),
m_ServerConfig(&m_Settings, 5, 3, m_AppConfig.screenName(), this),
m_ServerConfig(&m_Settings, 5, 3, m_AppConfig->screenName(), this),
m_pTempConfigFile(NULL),
m_pTrayIcon(NULL),
m_pTrayIconMenu(NULL),
@@ -98,7 +100,9 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
m_SuppressAutoConfigWarning(false),
m_BonjourInstall(NULL),
m_SuppressEmptyServerWarning(false),
m_ExpectedRunningState(kStopped)
m_ExpectedRunningState(kStopped),
m_pSslCertificate(NULL),
m_ActivationDialogRunning(false)
{
setupUi(this);
@@ -133,12 +137,34 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
m_SuppressAutoConfigWarning = false;
m_pComboServerList->hide();
setEdition(m_AppConfig.edition());
m_pLabelPadlock->hide();
m_trialWidget->hide();
updateLocalFingerprint();
connect (this, SIGNAL(windowShown()),
this, SLOT(on_windowShown()), Qt::QueuedConnection);
connect (m_LicenseManager, SIGNAL(editionChanged(Edition)),
this, SLOT(setEdition(Edition)), Qt::QueuedConnection);
connect (m_LicenseManager, SIGNAL(beginTrial(bool)),
this, SLOT(beginTrial(bool)), Qt::QueuedConnection);
connect (m_LicenseManager, SIGNAL(endTrial(bool)),
this, SLOT(endTrial(bool)), Qt::QueuedConnection);
connect (m_AppConfig, SIGNAL(sslToggled(bool)),
this, SLOT(sslToggled(bool)), Qt::QueuedConnection);
setWindowTitle (m_LicenseManager->activeEditionName());
m_LicenseManager->refresh();
QString lastVersion = m_AppConfig->lastVersion();
QString currentVersion = m_VersionChecker.getVersion();
if (lastVersion != currentVersion) {
m_AppConfig->setLastVersion (currentVersion);
m_AppConfig->saveSettings();
m_LicenseManager->notifyUpdate (lastVersion, currentVersion);
}
}
MainWindow::~MainWindow()
@@ -159,6 +185,8 @@ MainWindow::~MainWindow()
if (m_BonjourInstall != NULL) {
delete m_BonjourInstall;
}
delete m_pSslCertificate;
}
void MainWindow::open()
@@ -263,7 +291,8 @@ void MainWindow::createMenuBar()
m_pMenuFile->addAction(m_pActionStartSynergy);
m_pMenuFile->addAction(m_pActionStopSynergy);
m_pMenuFile->addSeparator();
m_pMenuFile->addAction(m_pActionWizard);
m_pMenuFile->addAction(m_pActivate);
m_pMenuFile->addSeparator();
m_pMenuFile->addAction(m_pActionSave);
m_pMenuFile->addSeparator();
m_pMenuFile->addAction(m_pActionQuit);
@@ -392,15 +421,17 @@ void MainWindow::appendLogRaw(const QString& text)
foreach(QString line, text.split(QRegExp("\r|\n|\r\n"))) {
if (!line.isEmpty()) {
m_pLogOutput->append(line);
updateStateFromLogLine(line);
updateFromLogLine(line);
}
}
}
void MainWindow::updateStateFromLogLine(const QString &line)
void MainWindow::updateFromLogLine(const QString &line)
{
// TODO: this code makes Andrew cry
checkConnected(line);
checkFingerprint(line);
checkLicense(line);
}
void MainWindow::checkConnected(const QString& line)
@@ -425,6 +456,14 @@ void MainWindow::checkConnected(const QString& line)
}
}
void MainWindow::checkLicense(const QString &line)
{
if (line.contains("trial has expired")) {
licenseManager().refresh();
raiseActivationDialog();
}
}
void MainWindow::checkFingerprint(const QString& line)
{
QRegExp fingerprintRegex(".*server fingerprint: ([A-F0-9:]+)");
@@ -493,13 +532,19 @@ void MainWindow::restartSynergy()
void MainWindow::proofreadInfo()
{
setEdition(m_AppConfig.edition());
setEdition(m_AppConfig->edition()); // Why is this here?
int oldState = m_SynergyState;
m_SynergyState = synergyDisconnected;
setSynergyState((qSynergyState)oldState);
}
void MainWindow::showEvent(QShowEvent* event)
{
QMainWindow::showEvent(event);
emit windowShown();
}
void MainWindow::clearLog()
{
m_pLogOutput->clear();
@@ -507,6 +552,14 @@ void MainWindow::clearLog()
void MainWindow::startSynergy()
{
SerialKey serialKey = m_LicenseManager->serialKey();
time_t currentTime = ::time(0);
if (serialKey.isExpired(currentTime)) {
if (QDialog::Rejected == raiseActivationDialog()) {
return;
}
}
bool desktopMode = appConfig().processMode() == Desktop;
bool serviceMode = appConfig().processMode() == Service;
@@ -555,7 +608,7 @@ void MainWindow::startSynergy()
#endif
if (m_AppConfig.getCryptoEnabled()) {
if (m_AppConfig->getCryptoEnabled()) {
args << "--enable-crypto";
}
@@ -618,6 +671,16 @@ void MainWindow::startSynergy()
}
}
void
MainWindow::sslToggled (bool enabled)
{
if (enabled) {
m_pSslCertificate = new SslCertificate(this);
m_pSslCertificate->generateCertificate();
}
updateLocalFingerprint();
}
bool MainWindow::clientArgs(QStringList& args, QString& app)
{
app = appPath(appConfig().synergycName());
@@ -713,19 +776,6 @@ QString MainWindow::appPath(const QString& name)
bool MainWindow::serverArgs(QStringList& args, QString& app)
{
int edition;
SubscriptionManager subscriptionManager(this, appConfig(), edition);
if (subscriptionManager.fileExists())
{
if (!subscriptionManager.checkSubscription()) {
return false;
}
else {
setEdition(edition);
}
}
app = appPath(appConfig().synergysName());
if (!QFile::exists(app))
@@ -754,25 +804,10 @@ bool MainWindow::serverArgs(QStringList& args, QString& app)
#endif
args << "-c" << configFilename << "--address" << address();
#if defined(Q_OS_WIN)
// pass in physical resolution and primary screen center
// TODO: get this information in the core binary even when
// high DPI is used
int height = QApplication::desktop()->height();
int width = QApplication::desktop()->width();
if (!appConfig().serialKey().isEmpty()) {
args << "--serial-key" << appConfig().serialKey();
}
QRect rec = QApplication::desktop()->screenGeometry();
int heightCenter = rec.height() / 2;
int widthCenter = rec.width() / 2;
appendLogDebug(tr("screen resolution: %1 %2 primary screen center: %3 %4")
.arg(width).arg(height).arg(widthCenter).arg(heightCenter));
args << "--res-w" << QString::number(width);
args << "--res-h" << QString::number(height);
args << "--prm-wc" << QString::number(widthCenter);
args << "--prm-hc" << QString::number(heightCenter);
#endif
return true;
}
@@ -874,7 +909,7 @@ void MainWindow::setSynergyState(qSynergyState state)
switch (state)
{
case synergyConnected: {
if (m_AppConfig.getCryptoEnabled()) {
if (m_AppConfig->getCryptoEnabled()) {
m_pLabelPadlock->show();
}
else {
@@ -989,13 +1024,13 @@ void MainWindow::updateZeroconfService()
QMutexLocker locker(&m_UpdateZeroconfMutex);
if (isBonjourRunning()) {
if (!m_AppConfig.wizardShouldRun()) {
if (!m_AppConfig->wizardShouldRun()) {
if (m_pZeroconfService) {
delete m_pZeroconfService;
m_pZeroconfService = NULL;
}
if (m_AppConfig.autoConfig() || synergyType() == synergyServer) {
if (m_AppConfig->autoConfig() || synergyType() == synergyServer) {
m_pZeroconfService = new ZeroconfService(this);
}
}
@@ -1014,28 +1049,71 @@ void MainWindow::serverDetected(const QString name)
}
}
void MainWindow::setEdition(int type)
void MainWindow::setEdition(Edition edition)
{
QString title;
if (type == Basic) {
title = "Synergy Basic";
}
else if (type == Pro) {
title = "Synergy Pro";
}
else if (type == Trial) {
title = "Synergy Trial";
}
else {
title = "Synergy (UNREGISTERED)";
setWindowTitle(m_LicenseManager->getEditionName (edition));
if (m_AppConfig->getCryptoEnabled()) {
m_pSslCertificate = new SslCertificate(this);
m_pSslCertificate->generateCertificate();
}
updateLocalFingerprint();
saveSettings();
}
setWindowTitle(title);
void MainWindow::beginTrial(bool isExpiring)
{
//Hack
//if (isExpiring) {
time_t daysLeft = m_LicenseManager->serialKey().daysLeft(::time(0));
QString expiringNotice ("<html><head/><body><p><span style=\""
"font-weight:600;\">%1</span> day%3 of "
"your %2 trial remain%5. <a href="
"\"https://symless.com/synergy/trial/thanks?id=%4\">"
"<span style=\"text-decoration: underline;"
" color:#0000ff;\">Buy now!</span></a>"
"</p></body></html>");
expiringNotice = expiringNotice
.arg (daysLeft)
.arg (LicenseManager::getEditionName
(m_LicenseManager->activeEdition()))
.arg ((daysLeft == 1) ? "" : "s")
.arg (QString::fromStdString
(m_LicenseManager->serialKey().toString()))
.arg ((daysLeft == 1) ? "s" : "");
this->m_trialLabel->setText(expiringNotice);
this->m_trialWidget->show();
//}
setWindowTitle (m_LicenseManager->activeEditionName());
}
void MainWindow::endTrial(bool isExpired)
{
if (isExpired) {
QString expiredNotice (
"<html><head/><body><p>Your %1 trial has expired. <a href="
"\"https://symless.com/synergy/trial/thanks?id=%2\">"
"<span style=\"text-decoration: underline;color:#0000ff;\">"
"Buy now!</span></a></p></body></html>"
);
expiredNotice = expiredNotice
.arg(LicenseManager::getEditionName
(m_LicenseManager->activeEdition()))
.arg(QString::fromStdString
(m_LicenseManager->serialKey().toString()));
this->m_trialLabel->setText(expiredNotice);
this->m_trialWidget->show();
stopSynergy();
m_AppConfig->activationHasRun(false);
} else {
this->m_trialWidget->hide();
}
setWindowTitle (m_LicenseManager->activeEditionName());
}
void MainWindow::updateLocalFingerprint()
{
if (Fingerprint::local().fileExists()) {
if (m_AppConfig->getCryptoEnabled() && Fingerprint::local().fileExists()) {
m_pLabelFingerprint->setVisible(true);
m_pLabelLocalFingerprint->setVisible(true);
m_pLabelLocalFingerprint->setText(Fingerprint::local().readFirst());
@@ -1046,6 +1124,12 @@ void MainWindow::updateLocalFingerprint()
}
}
LicenseManager&
MainWindow::licenseManager() const
{
return *m_LicenseManager;
}
void MainWindow::on_m_pGroupClient_toggled(bool on)
{
m_pGroupServer->setChecked(!on);
@@ -1110,6 +1194,14 @@ void MainWindow::on_m_pActionSettings_triggered()
void MainWindow::autoAddScreen(const QString name)
{
if (!m_ServerConfig.ignoreAutoConfigClient()) {
if (m_ActivationDialogRunning) {
// TODO: refactor this code
// add this screen to the pending list and check this list until
// users finish activation dialog
m_PendingClientNames.append(name);
return;
}
int r = m_ServerConfig.autoAddScreen(name);
if (r != kAutoAddScreenOk) {
switch (r) {
@@ -1145,10 +1237,9 @@ void MainWindow::on_m_pButtonConfigureServer_clicked()
showConfigureServer();
}
void MainWindow::on_m_pActionWizard_triggered()
void MainWindow::on_m_pActivate_triggered()
{
SetupWizard wizard(*this, false);
wizard.exec();
raiseActivationDialog();
}
void MainWindow::on_m_pButtonApply_clicked()
@@ -1308,16 +1399,16 @@ void MainWindow::promptAutoConfig()
QMessageBox::Yes | QMessageBox::No);
if (r == QMessageBox::Yes) {
m_AppConfig.setAutoConfig(true);
m_AppConfig->setAutoConfig(true);
downloadBonjour();
}
else {
m_AppConfig.setAutoConfig(false);
m_AppConfig->setAutoConfig(false);
m_pCheckBoxAutoConfig->setChecked(false);
}
}
m_AppConfig.setAutoConfigPrompted(true);
m_AppConfig->setAutoConfigPrompted(true);
}
void MainWindow::on_m_pComboServerList_currentIndexChanged(QString )
@@ -1363,6 +1454,40 @@ void MainWindow::bonjourInstallFinished()
m_pCheckBoxAutoConfig->setChecked(true);
}
int MainWindow::raiseActivationDialog()
{
if (m_ActivationDialogRunning) {
return QDialog::Rejected;
}
ActivationDialog activationDialog (this, appConfig(), licenseManager());
m_ActivationDialogRunning = true;
connect (&activationDialog, SIGNAL(finished(int)),
this, SLOT(on_activationDialogFinish()), Qt::QueuedConnection);
int result = activationDialog.exec();
m_ActivationDialogRunning = false;
if (!m_PendingClientNames.empty()) {
foreach (const QString& name, m_PendingClientNames) {
autoAddScreen(name);
}
m_PendingClientNames.clear();
}
if (result == QDialog::Accepted) {
restartSynergy();
}
return result;
}
void MainWindow::on_windowShown()
{
time_t currentTime = ::time(0);
if (!m_AppConfig->activationHasRun()
&& ((m_AppConfig->edition() == kUnregistered) ||
(m_LicenseManager->serialKey().isExpired(currentTime)))) {
raiseActivationDialog();
}
}
QString MainWindow::getProfileRootForArg()
{
CoreInterface coreInterface;

View File

@@ -33,6 +33,7 @@
#include "VersionChecker.h"
#include "IpcClient.h"
#include "Ipc.h"
#include "ActivationDialog.h"
#include <QMutex>
@@ -56,6 +57,8 @@ class SetupWizard;
class ZeroconfService;
class DataDownloader;
class CommandProcess;
class SslCertificate;
class LicenseManager;
class MainWindow : public QMainWindow, public Ui::MainWindowBase
{
@@ -63,7 +66,8 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
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,10 +117,15 @@ 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);
@@ -123,6 +133,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
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();
@@ -130,7 +141,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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

View File

@@ -18,12 +18,14 @@
#include "SettingsDialog.h"
#include "PluginManager.h"
#include "CoreInterface.h"
#include "SynergyLocale.h"
#include "QSynergyApplication.h"
#include "QUtility.h"
#include "AppConfig.h"
#include "EditionType.h"
#include "SslCertificate.h"
#include "MainWindow.h"
#include <QtCore>
#include <QtGui>
@@ -36,7 +38,7 @@ static const char networkSecurity[] = "ns";
SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::SettingsDialogBase(),
m_AppConfig(config)
m_appConfig(config)
{
setupUi(this);
@@ -61,13 +63,8 @@ SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) :
m_pComboElevate->hide();
#endif
if (!PluginManager::exist(networkSecurity)) {
m_pGroupNetworkSecurity->setEnabled(false);
m_pCheckBoxEnableCrypto->setChecked(false);
}
else {
m_pCheckBoxEnableCrypto->setChecked(m_AppConfig.getCryptoEnabled());
}
m_pCheckBoxEnableCrypto->setChecked(m_appConfig.getCryptoEnabled());
m_pCheckBoxEnableCrypto->setEnabled(m_appConfig.edition() == kPro);
}
void SettingsDialog::accept()
@@ -147,5 +144,12 @@ void SettingsDialog::on_m_pComboLanguage_currentIndexChanged(int index)
void SettingsDialog::on_m_pCheckBoxEnableCrypto_toggled(bool checked)
{
m_AppConfig.setCryptoEnabled(checked);
m_appConfig.setCryptoEnabled(checked);
m_appConfig.saveSettings();
if (checked) {
SslCertificate sslCertificate;
sslCertificate.generateCertificate();
MainWindow& mainWindow = dynamic_cast<MainWindow&> (*this->parent());
mainWindow.updateLocalFingerprint();
}
}

View File

@@ -40,10 +40,10 @@ class SettingsDialog : public QDialog, public Ui::SettingsDialogBase
void accept();
void reject();
void changeEvent(QEvent* event);
AppConfig& appConfig() { return m_AppConfig; }
AppConfig& appConfig() { return m_appConfig; }
private:
AppConfig& m_AppConfig;
AppConfig& m_appConfig;
SynergyLocale m_Locale;
CoreInterface m_CoreInterface;

View File

@@ -19,7 +19,7 @@
#include "MainWindow.h"
#include "WebClient.h"
#include "ActivationNotifier.h"
#include "SubscriptionManager.h"
#include "LicenseManager.h"
#include "EditionType.h"
#include "QSynergyApplication.h"
#include "QUtility.h"
@@ -28,13 +28,9 @@
SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) :
m_MainWindow(mainWindow),
m_StartMain(startMain),
m_Edition(Unknown),
m_LoginAttemps(0)
m_StartMain(startMain)
{
setupUi(this);
m_pPluginPage = new PluginWizardPage(mainWindow);
addPage(m_pPluginPage);
#if defined(Q_OS_MAC)
@@ -59,13 +55,6 @@ SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) :
m_Locale.fillLanguageComboBox(m_pComboLanguage);
setIndexFromItemData(m_pComboLanguage, m_MainWindow.appConfig().language());
AppConfig& appConfig = m_MainWindow.appConfig();
m_pLineEditEmail->setText(appConfig.activateEmail());
m_pTextEditSerialKey->setText(appConfig.serialKey());
m_pTextEditSerialKey->setEnabled(false);
}
SetupWizard::~SetupWizard()
@@ -78,70 +67,7 @@ bool SetupWizard::validateCurrentPage()
message.setWindowTitle(tr("Setup Synergy"));
message.setIcon(QMessageBox::Information);
if (currentPage() == m_pActivatePage)
{
if (m_pRadioButtonActivate->isChecked()) {
if (m_pLineEditEmail->text().isEmpty() ||
m_pLineEditPassword->text().isEmpty()) {
message.setText(tr("Please enter your email address and password."));
message.exec();
return false;
}
else {
WebClient webClient;
m_Edition = webClient.getEdition(
m_pLineEditEmail->text(),
m_pLineEditPassword->text(),
message,
this);
if (m_Edition == Unknown) {
m_LoginAttemps++;
if (m_LoginAttemps == kMaximiumLoginAttemps) {
m_LoginAttemps = 0;
QMessageBox::StandardButton reply =
QMessageBox::information(
this, tr("Setup Synergy"),
tr("Would you like to use your serial key instead?"),
QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes) {
m_pRadioButtonSubscription->setChecked(true);
}
}
return false;
}
else {
m_pPluginPage->setEdition(m_Edition);
return true;
}
}
}
else if (m_pRadioButtonSubscription->isChecked()) {
if (m_pTextEditSerialKey->toPlainText().isEmpty()) {
message.setText(tr("Please enter your subscription serial key."));
message.exec();
return false;
}
else {
// create subscription file in profile directory
SubscriptionManager subscriptionManager(this, m_MainWindow.appConfig(), m_Edition);
if (!subscriptionManager.activateSerial(m_pTextEditSerialKey->toPlainText())) {
return false;
}
m_pPluginPage->setEdition(m_Edition);
return true;
}
}
else {
return true;
}
}
else if (currentPage() == m_pNodePage)
if (currentPage() == m_pNodePage)
{
bool result = m_pClientRadioButton->isChecked() ||
m_pServerRadioButton->isChecked();
@@ -198,31 +124,6 @@ void SetupWizard::accept()
settings.setValue("groupServerChecked", false);
}
if (m_pRadioButtonActivate->isChecked()) {
appConfig.setActivateEmail(m_pLineEditEmail->text());
notifyActivation("login:" + m_pLineEditEmail->text());
}
if (m_pRadioButtonSubscription->isChecked())
{
appConfig.setSerialKey(m_pTextEditSerialKey->toPlainText());
notifyActivation("serial:" + m_pTextEditSerialKey->toPlainText());
}
if (m_pRadioButtonSkip->isChecked())
{
notifyActivation("skip:unknown");
}
appConfig.setEdition(m_Edition);
m_MainWindow.setEdition(m_Edition);
m_MainWindow.updateLocalFingerprint();
appConfig.saveSettings();
settings.sync();
QWizard::accept();
if (m_StartMain)
@@ -238,60 +139,14 @@ void SetupWizard::reject()
if (m_StartMain)
{
m_MainWindow.setEdition(m_Edition);
m_MainWindow.open();
}
// treat cancel as skip
notifyActivation("skip:unknown");
QWizard::reject();
}
void SetupWizard::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);
}
void SetupWizard::on_m_pComboLanguage_currentIndexChanged(int index)
{
QString ietfCode = m_pComboLanguage->itemData(index).toString();
QSynergyApplication::getInstance()->switchTranslator(ietfCode);
}
void SetupWizard::on_m_pRadioButtonSkip_toggled(bool checked)
{
if (checked) {
m_pLineEditEmail->setEnabled(false);
m_pLineEditPassword->setEnabled(false);
m_pTextEditSerialKey->setEnabled(false);
}
}
void SetupWizard::on_m_pRadioButtonActivate_toggled(bool checked)
{
if (checked) {
m_pLineEditEmail->setEnabled(true);
m_pLineEditPassword->setEnabled(true);
m_pTextEditSerialKey->setEnabled(false);
}
}
void SetupWizard::on_m_pRadioButtonSubscription_toggled(bool checked)
{
if (checked) {
m_pLineEditEmail->setEnabled(false);
m_pLineEditPassword->setEnabled(false);
m_pTextEditSerialKey->setEnabled(true);
}
}

View File

@@ -19,7 +19,6 @@
#include "ui_SetupWizardBase.h"
#include "SynergyLocale.h"
#include "PluginWizardPage.h"
#include <QWizard>
#include <QNetworkAccessManager>
@@ -43,19 +42,12 @@ protected:
void changeEvent(QEvent* event);
void accept();
void reject();
void notifyActivation(QString identity);
private:
MainWindow& m_MainWindow;
bool m_StartMain;
SynergyLocale m_Locale;
int m_Edition;
PluginWizardPage* m_pPluginPage;
int m_LoginAttemps;
private slots:
void on_m_pRadioButtonSubscription_toggled(bool checked);
void on_m_pRadioButtonActivate_toggled(bool checked);
void on_m_pRadioButtonSkip_toggled(bool checked);
void on_m_pComboLanguage_currentIndexChanged(int index);
};

View File

@@ -90,56 +90,59 @@ bool SslCertificate::runTool(const QStringList& args)
void SslCertificate::generateCertificate()
{
QStringList arguments;
// self signed certificate
arguments.append("req");
arguments.append("-x509");
arguments.append("-nodes");
// valide duration
arguments.append("-days");
arguments.append(kCertificateLifetime);
// subject information
arguments.append("-subj");
QString subInfo(kCertificateSubjectInfo);
arguments.append(subInfo);
// private key
arguments.append("-newkey");
arguments.append("rsa:1024");
QString sslDirPath = QString("%1%2%3")
.arg(m_ProfileDir)
.arg(QDir::separator())
.arg(kSslDir);
QDir sslDir(sslDirPath);
if (!sslDir.exists()) {
sslDir.mkpath(".");
}
QString filename = QString("%1%2%3")
.arg(sslDirPath)
.arg(QDir::separator())
.arg(kCertificateFilename);
// key output filename
arguments.append("-keyout");
arguments.append(filename);
QFile file(filename);
if (!file.exists()) {
QStringList arguments;
// certificate output filename
arguments.append("-out");
arguments.append(filename);
// self signed certificate
arguments.append("req");
arguments.append("-x509");
arguments.append("-nodes");
if (!runTool(arguments)) {
return;
// valide duration
arguments.append("-days");
arguments.append(kCertificateLifetime);
// subject information
arguments.append("-subj");
QString subInfo(kCertificateSubjectInfo);
arguments.append(subInfo);
// private key
arguments.append("-newkey");
arguments.append("rsa:1024");
QDir sslDir(sslDirPath);
if (!sslDir.exists()) {
sslDir.mkpath(".");
}
// key output filename
arguments.append("-keyout");
arguments.append(filename);
// certificate output filename
arguments.append("-out");
arguments.append(filename);
if (!runTool(arguments)) {
return;
}
emit info(tr("SSL certificate generated."));
}
emit info(tr("SSL certificate generated."));
generateFingerprint(filename);
emit generateFinished();

View File

@@ -1,167 +0,0 @@
/*
* 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 "SubscriptionManager.h"
#include "CoreInterface.h"
#include "EditionType.h"
#include "AppConfig.h"
#include <QMessageBox>
#include <QDir>
#include <QFile>
#include <QDateTime>
#include <QDate>
static const char purchaseURL[] = "https://symless.com/account/";
SubscriptionManager::SubscriptionManager(QWidget* parent, AppConfig& appConfig, int& edition) :
m_pParent(parent),
m_AppConfig(appConfig),
m_Edition(edition)
{
}
bool SubscriptionManager::activateSerial(const QString& serial)
{
m_Edition = Unknown;
persistDirectory();
CoreInterface coreInterface;
QString output;
try
{
output = coreInterface.activateSerial(serial);
}
catch (std::exception& e)
{
m_ErrorMessage = e.what();
checkError(m_ErrorMessage);
return false;
}
checkOutput(output);
return true;
}
bool SubscriptionManager::checkSubscription()
{
m_Edition = Unknown;
persistDirectory();
CoreInterface coreInterface;
QString output;
try
{
output = coreInterface.checkSubscription();
}
catch (std::exception& e)
{
m_ErrorMessage = e.what();
checkError(m_ErrorMessage);
return false;
}
checkOutput(output);
return true;
}
bool SubscriptionManager::fileExists()
{
CoreInterface coreInterface;
QString subscriptionFilename = coreInterface.getSubscriptionFilename();
return QFile::exists(subscriptionFilename);
}
void SubscriptionManager::checkError(QString& error)
{
if (error.contains("trial has expired")) {
QMessageBox::warning(m_pParent, tr("Subscription warning"),
tr("Your trial has expired. Click <a href='%1'>here</a> to purchase").arg(purchaseURL));
}
else {
QMessageBox::warning(m_pParent, tr("Subscription error"),
tr("An error occurred while trying to activate using a serial key. "
"Please contact the helpdesk, and provide the "
"following details.\n\n%1").arg(error));
}
}
void SubscriptionManager::checkOutput(QString& output)
{
getEditionType(output);
checkExpiring(output);
}
void SubscriptionManager::getEditionType(QString& output)
{
if (output.contains("pro subscription valid")) {
m_Edition = Pro;
}
else if (output.contains("basic subscription valid")) {
m_Edition = Basic;
}
else if (output.contains("trial subscription valid")) {
m_Edition = Trial;
}
}
void SubscriptionManager::checkExpiring(QString& output)
{
if (output.contains("trial will end in") && shouldWarnExpiring()) {
QRegExp dayLeftRegex(".*trial will end in ([0-9]+) day.*");
if (dayLeftRegex.exactMatch(output)) {
QString dayLeft = dayLeftRegex.cap(1);
QMessageBox::warning(m_pParent, tr("Subscription warning"),
tr("Your trial will end in %1 %2. Click <a href='%3'>here</a> to purchase")
.arg(dayLeft)
.arg(dayLeft == "1" ? "day" : "days")
.arg(purchaseURL));
}
}
}
bool SubscriptionManager::shouldWarnExpiring()
{
// warn users about expiring subscription once a day
int lastExpiringWarningTime = m_AppConfig.lastExpiringWarningTime();
QDateTime currentDateTime = QDateTime::currentDateTime();
int currentTime = currentDateTime.toTime_t();
const int secondPerDay = 60 * 60 * 24;
bool result = false;
if ((currentTime - lastExpiringWarningTime) > secondPerDay) {
result = true;
m_AppConfig.setLastExpiringWarningTime(currentTime);
}
return result;
}
void SubscriptionManager::persistDirectory()
{
CoreInterface coreInterface;
QString profileDir = coreInterface.getProfileDir();
QDir dir(profileDir);
if (!dir.exists()) {
dir.mkpath(".");
}
}

View File

@@ -1,47 +0,0 @@
/*
* 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 <QWidget>
class AppConfig;
class SubscriptionManager : public QWidget
{
public:
SubscriptionManager(QWidget* parent, AppConfig& appConfig, int& edition);
bool activateSerial(const QString& serial);
bool checkSubscription();
bool fileExists();
QString getLastError(){ return m_ErrorMessage; }
private:
void checkError(QString& error);
void checkOutput(QString& output);
void getEditionType(QString& output);
void checkExpiring(QString& output);
bool shouldWarnExpiring();
void persistDirectory();
private:
QString m_ErrorMessage;
QWidget* m_pParent;
AppConfig& m_AppConfig;
int& m_Edition;
};

View File

@@ -51,8 +51,10 @@ void VersionChecker::replyFinished(QNetworkReply* reply)
if (!newestVersion.isEmpty())
{
QString currentVersion = getVersion();
if (compareVersions(currentVersion, newestVersion) > 0)
emit updateFound(newestVersion);
if (currentVersion != "Unknown") {
if (compareVersions(currentVersion, newestVersion) > 0)
emit updateFound(newestVersion);
}
}
}

View File

@@ -25,76 +25,60 @@
#include <QCoreApplication>
#include <stdexcept>
int WebClient::getEdition(
const QString& email,
const QString& password,
QMessageBox& message,
QWidget* w)
{
QString responseJson;
int edition = Unknown;
try {
responseJson = request(email, password);
}
catch (std::exception& e)
{
message.critical(
w, "Error",
tr("An error occurred while trying to sign in. "
"Please contact the helpdesk, and provide the "
"following details.\n\n%1").arg(e.what()));
return edition;
}
bool
WebClient::getEdition (int& edition, QString& errorOut) {
QString responseJson = request();
/* TODO: This is horrible and should be ripped out as soon as we move
* to Qt 5. See issue #5630
*/
QRegExp resultRegex(".*\"result\".*:.*(true|false).*");
if (resultRegex.exactMatch(responseJson)) {
if (resultRegex.exactMatch (responseJson)) {
QString boolString = resultRegex.cap(1);
if (boolString == "true") {
QRegExp editionRegex(".*\"edition\".*:.*\"([^\"]+)\".*");
if (editionRegex.exactMatch(responseJson)) {
QString e = editionRegex.cap(1);
edition = e.toInt();
return true;
} else {
throw std::runtime_error ("Unrecognised server response.");
}
return edition;
} else {
errorOut = tr("Login failed. Invalid email address or password.");
return false;
}
else if (boolString == "false") {
message.critical(
w, "Error",
tr("Login failed, invalid email or password."));
return edition;
}
}
else {
} else {
QRegExp errorRegex(".*\"error\".*:.*\"([^\"]+)\".*");
if (errorRegex.exactMatch(responseJson)) {
// replace "\n" with real new lines.
QString error = errorRegex.cap(1).replace("\\n", "\n");
message.critical(
w, "Error",
tr("Login failed, an error occurred.\n\n%1").arg(error));
return edition;
if (errorRegex.exactMatch (responseJson)) {
errorOut = errorRegex.cap(1).replace("\\n", "\n");
return false;
} else {
throw std::runtime_error ("Unrecognised server response.");
}
}
message.critical(
w, "Error",
tr("Login failed, an error occurred.\n\nServer response:\n\n%1")
.arg(responseJson));
return edition;
}
QString WebClient::request(
const QString& email,
const QString& password)
{
bool
WebClient::setEmail (QString email, QString& errorOut) {
if (email.isEmpty()) {
errorOut = tr("Your email address cannot be left blank.");
return false;
}
m_Email = email;
return true;
}
bool
WebClient::setPassword (QString password, QString&) {
m_Password = password;
return true;
}
QString
WebClient::request() {
QStringList args("--login-auth");
// hash password in case it contains interesting chars.
QString credentials(email + ":" + hash(password) + "\n");
return m_CoreInterface.run(args, credentials);
QString credentials (m_Email + ":" + hash(m_Password) + "\n");
return m_CoreInterface.run (args, credentials);
}

View File

@@ -32,21 +32,15 @@ class WebClient : public QObject
Q_OBJECT
public:
int getEdition(const QString& email,
const QString& password,
QMessageBox& message,
QWidget* w);
void setEmail(QString& e) { m_Email = e; }
void setPassword(QString& p) { m_Password = p; }
bool getEdition (int& edition, QString& errorOut);
bool setEmail (QString email, QString& errorOut);
bool setPassword (QString password, QString& errorOut);
signals:
void error(QString e);
private:
QString request(const QString& email,
const QString& password);
private:
QString request();
QString m_Email;
QString m_Password;
CoreInterface m_CoreInterface;

View File

@@ -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,6 +20,7 @@
#define TRAY_RETRY_WAIT 2000
#include "QSynergyApplication.h"
#include "LicenseManager.h"
#include "MainWindow.h"
#include "AppConfig.h"
#include "SetupWizard.h"
@@ -65,7 +66,7 @@ int main(int argc, char* argv[])
"Please drag Synergy to the Applications folder, and open it from there.");
return 1;
}
if (!checkMacAssistiveDevices())
{
return 1;
@@ -82,11 +83,13 @@ int main(int argc, char* argv[])
#endif
QSettings settings;
AppConfig appConfig(&settings);
AppConfig appConfig (&settings);
qRegisterMetaType<Edition>("Edition");
LicenseManager licenseManager (&appConfig);
app.switchTranslator(appConfig.language());
MainWindow mainWindow(settings, appConfig);
MainWindow mainWindow(settings, appConfig, licenseManager);
SetupWizard setupWizard(mainWindow, true);
if (appConfig.wizardShouldRun())
@@ -116,8 +119,8 @@ int waitForTray()
if (++trayAttempts > TRAY_RETRY_COUNT)
{
QMessageBox::critical(NULL, "Synergy",
QObject::tr("System tray is unavailable, quitting."));
return false;
QObject::tr("System tray is unavailable, don't close your window."));
return true;
}
QThreadImpl::msleep(TRAY_RETRY_WAIT);
@@ -156,7 +159,8 @@ bool checkMacAssistiveDevices()
QMessageBox::information(
NULL, "Synergy",
"Please enable access to assistive devices "
"(System Preferences), then re-open Synergy.");
"System Preferences -> Security & Privacy -> "
"Privacy -> Accessibility, then re-open Synergy.");
}
return result;

View File

@@ -23,10 +23,9 @@ add_subdirectory(ipc)
add_subdirectory(mt)
add_subdirectory(net)
add_subdirectory(platform)
add_subdirectory(plugin)
add_subdirectory(server)
add_subdirectory(synergy)
add_subdirectory(shared)
if (WIN32)
add_subdirectory(synwinhk)

View File

@@ -50,7 +50,6 @@
# include "arch/win32/ArchSystemWindows.h"
# include "arch/win32/ArchTaskBarWindows.h"
# include "arch/win32/ArchTimeWindows.h"
# include "arch/win32/ArchPluginWindows.h"
# include "arch/win32/ArchInternetWindows.h"
#elif SYSAPI_UNIX
# include "arch/unix/ArchConsoleUnix.h"
@@ -66,7 +65,6 @@
# include "arch/unix/ArchSystemUnix.h"
# include "arch/unix/ArchTaskBarXWindows.h"
# include "arch/unix/ArchTimeUnix.h"
# include "arch/unix/ArchPluginUnix.h"
# include "arch/unix/ArchInternetUnix.h"
#endif
@@ -122,12 +120,10 @@ public:
static void setInstance(Arch* s) { s_instance = s; }
ARCH_PLUGIN& plugin() const { return (ARCH_PLUGIN&)m_plugin; }
ARCH_INTERNET& internet() const { return (ARCH_INTERNET&)m_internet; }
private:
static Arch* s_instance;
ARCH_PLUGIN m_plugin;
ARCH_INTERNET m_internet;
};

View File

@@ -1,80 +0,0 @@
/*
* 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
* 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 "common/IInterface.h"
#include "common/stdmap.h"
#include "base/String.h"
class IEventQueue;
//! Interface for plugin manager.
/*!
A plugin manager should load all 3rd party plugins from the plugins dir,
and then look for common function names in the plugins.
*/
class IArchPlugin : public IInterface {
public:
//! @name manipulators
//@{
//!Load plugins
/*!
Scan the plugins dir and load plugins.
*/
virtual void load() = 0;
//!Unload plugins
/*!
Look through the loaded plugins and unload them.
*/
virtual void unload() = 0;
//! Init the common parts
/*!
Initializes common parts like log and arch.
*/
virtual void init(void* log, void* arch) = 0;
//! Init the event part
/*!
Initializes event parts.
*/
virtual void initEvent(void* eventTarget, IEventQueue* events) = 0;
//! Check if exists
/*!
Returns true if the plugin exists and is loaded.
*/
virtual bool exists(const char* name) = 0;
//! Invoke function
/*!
Invokes a function from the plugin.
*/
virtual void* invoke(const char* plugin,
const char* command,
void** args,
void* library = NULL) = 0;
//@}
protected:
typedef std::map<String, void*> PluginTable;
};

View File

@@ -117,9 +117,11 @@ ArchDaemonUnix::daemonize(const char* name, DaemonFunc func)
open("/dev/null", O_RDWR);
int dupErr = dup(1);
if (dupErr)
if (dupErr < 0) {
// NB: file logging actually isn't working at this point!
LOG((CLOG_ERR "dup error: %i", dupErr));
}
#ifdef __APPLE__
return execSelfNonDaemonized();

View File

@@ -116,7 +116,6 @@ CurlFacade::urlEncode(const String& url)
char* resultCStr = curl_easy_escape(m_curl, url.c_str(), 0);
if (resultCStr == NULL) {
curl_free(resultCStr);
throw XArch("CURL escape failed.");
}

View File

@@ -697,7 +697,7 @@ void*
ArchMultithreadPosix::threadFunc(void* vrep)
{
// get the thread
ArchThreadImpl* thread = reinterpret_cast<ArchThreadImpl*>(vrep);
ArchThreadImpl* thread = static_cast<ArchThreadImpl*>(vrep);
// setup pthreads
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);

View File

@@ -646,7 +646,7 @@ ArchNetworkBSD::newAnyAddr(EAddressFamily family)
switch (family) {
case kINET: {
struct sockaddr_in* ipAddr =
reinterpret_cast<struct sockaddr_in*>(&addr->m_addr);
reinterpret_cast<struct sockaddr_in*>(&addr->m_addr);
ipAddr->sin_family = AF_INET;
ipAddr->sin_port = 0;
ipAddr->sin_addr.s_addr = INADDR_ANY;
@@ -737,8 +737,7 @@ ArchNetworkBSD::addrToName(ArchNetAddress addr)
// mutexed name lookup (ugh)
ARCH->lockMutex(m_mutex);
struct hostent* info = gethostbyaddr(
reinterpret_cast<const char*>(&addr->m_addr),
struct hostent* info = gethostbyaddr(&addr->m_addr,
addr->m_len, addr->m_addr.sa_family);
if (info == NULL) {
ARCH->unlockMutex(m_mutex);
@@ -834,7 +833,7 @@ ArchNetworkBSD::isAnyAddr(ArchNetAddress addr)
switch (getAddrFamily(addr)) {
case kINET: {
struct sockaddr_in* ipAddr =
reinterpret_cast<struct sockaddr_in*>(&addr->m_addr);
reinterpret_cast<struct sockaddr_in*>(&addr->m_addr);
return (ipAddr->sin_addr.s_addr == INADDR_ANY &&
addr->m_len == (socklen_t)sizeof(struct sockaddr_in));
}

View File

@@ -1,239 +0,0 @@
/*
* 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
* 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 "arch/unix/ArchPluginUnix.h"
#include "arch/unix/XArchUnix.h"
#include "common/PluginVersion.h"
#include "base/IEventQueue.h"
#include "base/Event.h"
#include "base/Log.h"
#include <vector>
#include <sys/types.h>
#include <dirent.h>
#include <dlfcn.h>
typedef void (*initFunc)(void*, void*);
typedef int (*initEventFunc)(void (*sendEvent)(const char*, void*));
typedef void* (*invokeFunc)(const char*, void*);
typedef void (*cleanupFunc)();
void* g_eventTarget = NULL;
IEventQueue* g_events = NULL;
ArchPluginUnix::ArchPluginUnix()
{
}
ArchPluginUnix::~ArchPluginUnix()
{
}
void
ArchPluginUnix::load()
{
String pluginsDir = getPluginsDir();
LOG((CLOG_DEBUG "plugins dir: %s", pluginsDir.c_str()));
struct dirent* de = NULL;
DIR* dir = NULL;
dir = opendir(pluginsDir.c_str());
if (dir == NULL) {
LOG((CLOG_DEBUG "can't open plugins dir: %s",
pluginsDir.c_str()));
return;
}
std::vector<String> plugins;
while ((de = readdir(dir)) != NULL) {
// ignore hidden files and diretories like .. and .
if (de->d_name[0] != '.') {
plugins.push_back(de->d_name);
}
}
closedir(dir);
std::vector<String>::iterator it;
for (it = plugins.begin(); it != plugins.end(); ++it) {
String filename = *it;
String path = synergy::string::sprintf(
"%s/%s", pluginsDir.c_str(), filename.c_str());
String name = synergy::string::removeFileExt(filename.substr(3));
LOG((CLOG_DEBUG "loading plugin: %s", filename.c_str()));
void* handle = dlopen(path.c_str(), RTLD_LAZY);
if (handle == NULL) {
LOG((CLOG_ERR "failed to load plugin '%s', error: %s",
filename.c_str(), dlerror()));
continue;
}
String expectedVersion = getExpectedPluginVersion(name.c_str());
String currentVersion = getCurrentVersion(name, handle);
if (currentVersion.empty() || (expectedVersion != currentVersion)) {
LOG((CLOG_ERR
"failed to load plugin '%s', "
"expected version %s but was %s",
filename.c_str(),
expectedVersion.c_str(),
currentVersion.empty() ? "unknown" : currentVersion.c_str()));
dlclose(handle);
continue;
}
LOG((CLOG_DEBUG "plugin loaded: %s (version %s)",
filename.c_str(),
currentVersion.c_str()));
m_pluginTable.insert(std::make_pair(name, handle));
}
}
void
ArchPluginUnix::unload()
{
PluginTable::iterator it;
for (it = m_pluginTable.begin(); it != m_pluginTable.end(); it++) {
cleanupFunc cleanup = (cleanupFunc)dlsym(it->second, "cleanup");
if (cleanup != NULL) {
cleanup();
}
else {
LOG((CLOG_DEBUG "no cleanup function in %s", it->first.c_str()));
}
LOG((CLOG_DEBUG "unloading plugin: %s", it->first.c_str()));
dlclose(it->second);
}
}
void
ArchPluginUnix::init(void* log, void* arch)
{
PluginTable::iterator it;
for (it = m_pluginTable.begin(); it != m_pluginTable.end(); it++) {
initFunc initPlugin = (initFunc)dlsym(it->second, "init");
if (initPlugin != NULL) {
initPlugin(log, arch);
}
else {
LOG((CLOG_DEBUG "no init function in %s", it->first.c_str()));
}
}
}
void
ArchPluginUnix::initEvent(void* eventTarget, IEventQueue* events)
{
g_eventTarget = eventTarget;
g_events = events;
PluginTable::iterator it;
for (it = m_pluginTable.begin(); it != m_pluginTable.end(); it++) {
initEventFunc initEventPlugin = (initEventFunc)dlsym(it->second, "initEvent");
if (initEventPlugin != NULL) {
initEventPlugin(&sendEvent);
}
else {
LOG((CLOG_DEBUG "no init event function in %s", it->first.c_str()));
}
}
}
bool
ArchPluginUnix::exists(const char* name)
{
PluginTable::iterator it;
it = m_pluginTable.find(name);
return it != m_pluginTable.end() ? true : false;
}
void*
ArchPluginUnix::invoke(
const char* plugin,
const char* command,
void** args,
void* library)
{
void* lib = NULL;
if (library == NULL) {
PluginTable::iterator it;
it = m_pluginTable.find(plugin);
if (it != m_pluginTable.end()) {
lib = it->second;
}
else {
LOG((CLOG_DEBUG "invoke command failed, plugin: %s command: %s",
plugin, command));
return NULL;
}
}
else {
lib = library;
}
invokeFunc invokePlugin = (invokeFunc)dlsym(lib, "invoke");
void* result = NULL;
if (invokePlugin != NULL) {
result = invokePlugin(command, args);
}
else {
LOG((CLOG_DEBUG "no invoke function in %s", plugin));
}
return result;
}
String
ArchPluginUnix::getPluginsDir()
{
return ARCH->getPluginDirectory();
}
String
ArchPluginUnix::getCurrentVersion(const String& name, void* handle)
{
char* version = (char*)invoke(name.c_str(), "version", NULL, handle);
if (version == NULL) {
return "";
}
return version;
}
void
sendEvent(const char* eventName, void* data)
{
LOG((CLOG_DEBUG5 "plugin sending event"));
Event::Type type = g_events->getRegisteredType(eventName);
g_events->addEvent(Event(type, g_eventTarget, data));
}
void
log(const char* text)
{
LOG((CLOG_DEBUG "plugin: %s", text));
}

View File

@@ -1,53 +0,0 @@
/*
* 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
* 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 "arch/IArchPlugin.h"
#define ARCH_PLUGIN ArchPluginUnix
class IEventQueue;
//! Unix implementation of IArchPlugin
class ArchPluginUnix : public IArchPlugin {
public:
ArchPluginUnix();
virtual ~ArchPluginUnix();
// IArchPlugin overrides
void load();
void unload();
void init(void* log, void* arch);
void initEvent(void* eventTarget, IEventQueue* events);
bool exists(const char* name);
virtual void* invoke(const char* pluginName,
const char* functionName,
void** args,
void* library = NULL);
private:
String getPluginsDir();
String getCurrentVersion(const String& name, void* handle);
private:
PluginTable m_pluginTable;
};
void sendEvent(const char* text, void* data);
void log(const char* text);

View File

@@ -76,5 +76,5 @@ ArchSystemUnix::setting(const std::string&, const std::string&) const
std::string
ArchSystemUnix::getLibsUsed(void) const
{
return "not implmented.\nuse lsof on shell";
return "not implemented.\nuse lsof on shell";
}

View File

@@ -661,7 +661,7 @@ unsigned int __stdcall
ArchMultithreadWindows::threadFunc(void* vrep)
{
// get the thread
ArchThreadImpl* thread = reinterpret_cast<ArchThreadImpl*>(vrep);
ArchThreadImpl* thread = static_cast<ArchThreadImpl*>(vrep);
// run thread
s_instance->doThreadFunc(thread);

View File

@@ -805,7 +805,7 @@ ArchNetworkWinsock::setAddrPort(ArchNetAddress addr, int port)
case kINET: {
struct sockaddr_in* ipAddr =
reinterpret_cast<struct sockaddr_in*>(&addr->m_addr);
ipAddr->sin_port = htons_winsock(static_cast<u_short>(port));
ipAddr->sin_port = htons_winsock(port);
break;
}

View File

@@ -1,250 +0,0 @@
/*
* 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
* 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 "arch/win32/ArchPluginWindows.h"
#include "arch/win32/XArchWindows.h"
#include "common/PluginVersion.h"
#include "base/Log.h"
#include "base/IEventQueue.h"
#include "base/Event.h"
#include "synergy/Screen.h"
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <iostream>
typedef void (*initFunc)(void*, void*);
typedef int (*initEventFunc)(void (*sendEvent)(const char*, void*));
typedef void* (*invokeFunc)(const char*, void**);
typedef void (*cleanupFunc)();
void* g_eventTarget = NULL;
IEventQueue* g_events = NULL;
static const char * kPre174Plugin = "Pre-1.7.v";
ArchPluginWindows::ArchPluginWindows()
{
}
ArchPluginWindows::~ArchPluginWindows()
{
}
void
ArchPluginWindows::load()
{
String dir = getPluginsDir();
LOG((CLOG_DEBUG "plugins dir: %s", dir.c_str()));
String pattern = String(dir).append("\\*.dll");
std::vector<String> plugins;
getFilenames(pattern, plugins);
std::vector<String>::iterator it;
for (it = plugins.begin(); it != plugins.end(); ++it) {
String filename = *it;
String name = synergy::string::removeFileExt(filename);
String path = synergy::string::sprintf(
"%s\\%s", dir.c_str(), filename.c_str());
LOG((CLOG_DEBUG "loading plugin: %s", filename.c_str()));
HINSTANCE handle = LoadLibrary(path.c_str());
void* voidHandle = reinterpret_cast<void*>(handle);
if (handle == NULL) {
String error = XArchEvalWindows().eval();
LOG((CLOG_ERR "failed to load plugin '%s', error: %s",
filename.c_str(), error.c_str()));
continue;
}
String expectedVersion = getExpectedPluginVersion(name.c_str());
String currentVersion = getCurrentVersion(name.c_str(), voidHandle);
if (currentVersion.empty() || (expectedVersion != currentVersion)) {
LOG((CLOG_ERR
"failed to load plugin '%s', "
"expected version %s but was %s",
filename.c_str(),
expectedVersion.c_str(),
currentVersion.empty() ? "unknown" : currentVersion.c_str()));
FreeLibrary(handle);
continue;
}
LOG((CLOG_DEBUG "plugin loaded: %s (version %s)",
filename.c_str(),
currentVersion.c_str()));
m_pluginTable.insert(std::make_pair(name, voidHandle));
}
}
void
ArchPluginWindows::unload()
{
PluginTable::iterator it;
HINSTANCE lib;
for (it = m_pluginTable.begin(); it != m_pluginTable.end(); it++) {
lib = reinterpret_cast<HINSTANCE>(it->second);
cleanupFunc cleanup = (cleanupFunc)GetProcAddress(lib, "cleanup");
if (cleanup != NULL) {
cleanup();
}
else {
LOG((CLOG_DEBUG "no cleanup function in %s", it->first.c_str()));
}
LOG((CLOG_DEBUG "unloading plugin: %s", it->first.c_str()));
FreeLibrary(lib);
}
}
void
ArchPluginWindows::init(void* log, void* arch)
{
PluginTable::iterator it;
HINSTANCE lib;
for (it = m_pluginTable.begin(); it != m_pluginTable.end(); it++) {
lib = reinterpret_cast<HINSTANCE>(it->second);
initFunc initPlugin = (initFunc)GetProcAddress(lib, "init");
if (initPlugin != NULL) {
initPlugin(log, arch);
}
else {
LOG((CLOG_DEBUG "no init function in %s", it->first.c_str()));
}
}
}
void
ArchPluginWindows::initEvent(void* eventTarget, IEventQueue* events)
{
g_eventTarget = eventTarget;
g_events = events;
PluginTable::iterator it;
HINSTANCE lib;
for (it = m_pluginTable.begin(); it != m_pluginTable.end(); it++) {
lib = reinterpret_cast<HINSTANCE>(it->second);
initEventFunc initEventPlugin = (initEventFunc)GetProcAddress(lib, "initEvent");
if (initEventPlugin != NULL) {
initEventPlugin(&sendEvent);
}
else {
LOG((CLOG_DEBUG "no init event function in %s", it->first.c_str()));
}
}
}
bool
ArchPluginWindows::exists(const char* name)
{
PluginTable::iterator it;
it = m_pluginTable.find(name);
return it != m_pluginTable.end() ? true : false;
}
void*
ArchPluginWindows::invoke(
const char* plugin,
const char* command,
void** args,
void* library)
{
HINSTANCE lib = NULL;
if (library == NULL) {
PluginTable::iterator it;
it = m_pluginTable.find(plugin);
if (it != m_pluginTable.end()) {
lib = reinterpret_cast<HINSTANCE>(it->second);
}
else {
LOG((CLOG_DEBUG "invoke command failed, plugin: %s command: %s",
plugin, command));
return NULL;
}
}
else {
lib = reinterpret_cast<HINSTANCE>(library);
}
invokeFunc invokePlugin = (invokeFunc)GetProcAddress(lib, "invoke");
void* result = NULL;
if (invokePlugin != NULL) {
result = invokePlugin(command, args);
}
else {
LOG((CLOG_DEBUG "no invoke function in %s", plugin));
}
return result;
}
void
ArchPluginWindows::getFilenames(const String& pattern, std::vector<String>& filenames)
{
WIN32_FIND_DATA data;
HANDLE find = FindFirstFile(pattern.c_str(), &data);
if (find == INVALID_HANDLE_VALUE) {
FindClose(find);
LOG((CLOG_DEBUG "plugins dir is empty: %s", pattern.c_str()));
return;
}
do {
filenames.push_back(data.cFileName);
} while (FindNextFile(find, &data));
FindClose(find);
}
String
ArchPluginWindows::getPluginsDir()
{
return ARCH->getPluginDirectory();
}
String
ArchPluginWindows::getCurrentVersion(const String& name, void* handle)
{
char* version = (char*)invoke(name.c_str(), "version", NULL, handle);
if (version == NULL) {
return "";
}
return version;
}
void
sendEvent(const char* eventName, void* data)
{
LOG((CLOG_DEBUG5 "plugin sending event"));
Event::Type type = g_events->getRegisteredType(eventName);
g_events->addEvent(Event(type, g_eventTarget, data));
}
void
log(const char* text)
{
LOG((CLOG_DEBUG "plugin: %s", text));
}

View File

@@ -1,57 +0,0 @@
/*
* 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
* 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 "arch/IArchPlugin.h"
#include <vector>
#define ARCH_PLUGIN ArchPluginWindows
class Screen;
class IEventQueue;
//! Windows implementation of IArchPlugin
class ArchPluginWindows : public IArchPlugin {
public:
ArchPluginWindows();
virtual ~ArchPluginWindows();
// IArchPlugin overrides
void load();
void unload();
void init(void* log, void* arch);
void initEvent(void* eventTarget, IEventQueue* events);
bool exists(const char* name);
void* invoke(const char* pluginName,
const char* functionName,
void** args,
void* library = NULL);
private:
void getFilenames(const String& pattern, std::vector<String>& filenames);
String getPluginsDir();
String getCurrentVersion(const String& name, void* handle);
private:
PluginTable m_pluginTable;
};
void sendEvent(const char* text, void* data);
void log(const char* text);

View File

@@ -245,7 +245,7 @@ ArchTaskBarWindows::modifyIconNoLock(
receiver->lock();
// get icon data
HICON icon = reinterpret_cast<HICON>(
HICON icon = static_cast<HICON>(
const_cast<IArchTaskBarReceiver::Icon>(receiver->getIcon()));
// get tool tip
@@ -415,16 +415,15 @@ ArchTaskBarWindows::staticWndProc(HWND hwnd, UINT msg,
if (msg == WM_NCCREATE) {
CREATESTRUCT* createInfo;
createInfo = reinterpret_cast<CREATESTRUCT*>(lParam);
self = reinterpret_cast<ArchTaskBarWindows*>(
self = static_cast<ArchTaskBarWindows*>(
createInfo->lpCreateParams);
SetWindowLong(hwnd, 0, reinterpret_cast<LONG>(self));
SetWindowLongPtr(hwnd, 0, reinterpret_cast<LONG_PTR>(createInfo->lpCreateParams));
}
else {
// get the extra window data and forward the call
LONG data = GetWindowLong(hwnd, 0);
LONG_PTR data = GetWindowLongPtr(hwnd, 0);
if (data != 0) {
self = reinterpret_cast<ArchTaskBarWindows*>(
reinterpret_cast<void*>(data));
self = static_cast<ArchTaskBarWindows*>(reinterpret_cast<void*>(data));
}
}
@@ -444,6 +443,7 @@ ArchTaskBarWindows::threadMainLoop()
m_taskBarRestart = RegisterWindowMessage(TEXT("TaskbarCreated"));
// register a window class
LPCTSTR className = TEXT("SynergyTaskBar");
WNDCLASSEX classInfo;
classInfo.cbSize = sizeof(classInfo);
classInfo.style = CS_NOCLOSE;
@@ -455,20 +455,20 @@ ArchTaskBarWindows::threadMainLoop()
classInfo.hCursor = NULL;
classInfo.hbrBackground = NULL;
classInfo.lpszMenuName = NULL;
classInfo.lpszClassName = TEXT("SynergyTaskBar");
classInfo.lpszClassName = className;
classInfo.hIconSm = NULL;
ATOM windowClass = RegisterClassEx(&classInfo);
// create window
m_hwnd = CreateWindowEx(WS_EX_TOOLWINDOW,
reinterpret_cast<LPCTSTR>(windowClass),
className,
TEXT("Synergy Task Bar"),
WS_POPUP,
0, 0, 1, 1,
NULL,
NULL,
instanceWin32(),
reinterpret_cast<void*>(this));
static_cast<void*>(this));
// signal ready
ARCH->lockMutex(m_mutex);
@@ -478,7 +478,7 @@ ArchTaskBarWindows::threadMainLoop()
// handle failure
if (m_hwnd == NULL) {
UnregisterClass(reinterpret_cast<LPCTSTR>(windowClass), instanceWin32());
UnregisterClass(className, instanceWin32());
return;
}
@@ -494,13 +494,13 @@ ArchTaskBarWindows::threadMainLoop()
// clean up
removeAllIcons();
DestroyWindow(m_hwnd);
UnregisterClass(reinterpret_cast<LPCTSTR>(windowClass), instanceWin32());
UnregisterClass(className, instanceWin32());
}
void*
ArchTaskBarWindows::threadEntry(void* self)
{
reinterpret_cast<ArchTaskBarWindows*>(self)->threadMainLoop();
static_cast<ArchTaskBarWindows*>(self)->threadMainLoop();
return NULL;
}

View File

@@ -65,7 +65,7 @@ ArchTimeWindows::~ArchTimeWindows()
{
s_freq = 0.0;
if (s_mmInstance == NULL) {
FreeLibrary(reinterpret_cast<HMODULE>(s_mmInstance));
FreeLibrary(static_cast<HMODULE>(s_mmInstance));
s_tgt = NULL;
s_mmInstance = NULL;
}

View File

@@ -54,7 +54,7 @@ static
void
interrupt(Arch::ESignal, void* data)
{
EventQueue* events = reinterpret_cast<EventQueue*>(data);
EventQueue* events = static_cast<EventQueue*>(data);
events->addEvent(Event(Event::kQuit));
}

View File

@@ -18,7 +18,6 @@
#include "client/Client.h"
#include "../plugin/ns/SecureSocket.h"
#include "client/ServerProxy.h"
#include "synergy/Screen.h"
#include "synergy/FileChunk.h"
@@ -33,12 +32,12 @@
#include "net/TCPSocket.h"
#include "net/IDataSocket.h"
#include "net/ISocketFactory.h"
#include "net/SecureSocket.h"
#include "arch/Arch.h"
#include "base/Log.h"
#include "base/IEventQueue.h"
#include "base/TMethodEventJob.h"
#include "base/TMethodJob.h"
#include "common/PluginVersion.h"
#include "common/stdexcept.h"
#include <cstring>
@@ -72,7 +71,7 @@ Client::Client(
m_sendFileThread(NULL),
m_writeToDropDirThread(NULL),
m_socket(NULL),
m_useSecureNetwork(false),
m_useSecureNetwork(args.m_enableCrypto),
m_args(args),
m_enableClipboard(true)
{
@@ -99,13 +98,6 @@ Client::Client(
new TMethodEventJob<Client>(this,
&Client::handleFileRecieveCompleted));
}
if (m_args.m_enableCrypto) {
m_useSecureNetwork = ARCH->plugin().exists(s_pluginNames[kSecureSocket]);
if (m_useSecureNetwork == false) {
LOG((CLOG_NOTE "crypto disabled because of ns plugin not available"));
}
}
}
Client::~Client()
@@ -160,8 +152,7 @@ Client::connect()
// filter socket messages, including a packetizing filter
m_stream = socket;
bool adopt = !m_useSecureNetwork;
m_stream = new PacketStreamFilter(m_events, m_stream, adopt);
m_stream = new PacketStreamFilter(m_events, m_stream, true);
// connect
LOG((CLOG_DEBUG1 "connecting to server"));
@@ -439,7 +430,7 @@ Client::sendConnectionFailedEvent(const char* msg)
void
Client::sendFileChunk(const void* data)
{
FileChunk* chunk = reinterpret_cast<FileChunk*>(const_cast<void*>(data));
FileChunk* chunk = static_cast<FileChunk*>(const_cast<void*>(data));
LOG((CLOG_DEBUG1 "send file chunk"));
assert(m_server != NULL);
@@ -593,13 +584,6 @@ Client::cleanupStream()
{
delete m_stream;
m_stream = NULL;
// PacketStreamFilter doen't adopt secure socket, because
// we need to tell the dynamic lib that allocated this object
// to do the deletion.
if (m_useSecureNetwork) {
ARCH->plugin().invoke(s_pluginNames[kSecureSocket], "deleteSocket", NULL);
}
}
void
@@ -621,7 +605,7 @@ void
Client::handleConnectionFailed(const Event& event, void*)
{
IDataSocket::ConnectionFailedInfo* info =
reinterpret_cast<IDataSocket::ConnectionFailedInfo*>(event.getData());
static_cast<IDataSocket::ConnectionFailedInfo*>(event.getData());
cleanupTimer();
cleanupConnecting();
@@ -677,7 +661,7 @@ Client::handleClipboardGrabbed(const Event& event, void*)
}
const IScreen::ClipboardInfo* info =
reinterpret_cast<const IScreen::ClipboardInfo*>(event.getData());
static_cast<const IScreen::ClipboardInfo*>(event.getData());
// grab ownership
m_server->onGrabClipboard(info->m_id);
@@ -826,14 +810,14 @@ Client::sendFileToServer(const char* filename)
m_sendFileThread = new Thread(
new TMethodJob<Client>(
this, &Client::sendFileThread,
reinterpret_cast<void*>(const_cast<char*>(filename))));
static_cast<void*>(const_cast<char*>(filename))));
}
void
Client::sendFileThread(void* filename)
{
try {
char* name = reinterpret_cast<char*>(filename);
char* name = static_cast<char*>(filename);
StreamChunker::sendFile(name, m_events, this);
}
catch (std::runtime_error error) {

View File

@@ -1,36 +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 "PluginVersion.h"
#include <string.h>
static const char kUnknownVersion[] = "unknown";
const char* s_pluginNames[] = { "ns" };
static const char* s_pluginVersions[] = { "1.3" };
const char* getExpectedPluginVersion(const char* name)
{
for (int i = 0; i < kPluginCount; i++) {
if (strcmp(name, s_pluginNames[i]) == 0) {
return s_pluginVersions[i];
break;
}
}
return kUnknownVersion;
}

View File

@@ -1,31 +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/>.
*/
#pragma once
enum EPluginType {
kSecureSocket,
kPluginCount
};
extern const char* s_pluginNames[];
//! Get expected plugin version
/*!
Returns the plugin version expected by the plugin loader.
*/
const char* getExpectedPluginVersion(const char* name);

View File

@@ -59,7 +59,7 @@ StreamBuffer::peek(UInt32 n)
scan = m_chunks.erase(scan);
}
return reinterpret_cast<const void*>(&(head->begin()[m_headUsed]));
return static_cast<const void*>(&(head->begin()[m_headUsed]));
}
void
@@ -104,7 +104,7 @@ StreamBuffer::write(const void* vdata, UInt32 n)
m_size += n;
// cast data to bytes
const UInt8* data = reinterpret_cast<const UInt8*>(vdata);
const UInt8* data = static_cast<const UInt8*>(vdata);
// point to last chunk if it has space, otherwise append an empty chunk
ChunkList::iterator scan = m_chunks.end();

View File

@@ -83,7 +83,7 @@ StreamFilter::shutdownOutput()
void*
StreamFilter::getEventTarget() const
{
return const_cast<void*>(reinterpret_cast<const void*>(this));
return const_cast<void*>(static_cast<const void*>(this));
}
bool

View File

@@ -146,7 +146,7 @@ IpcClientProxy::send(const IpcMessage& message)
switch (message.type()) {
case kIpcLogLine: {
const IpcLogLineMessage& llm = static_cast<const IpcLogLineMessage&>(message);
String logLine = llm.logLine();
const String logLine = llm.logLine();
ProtocolUtil::writef(&m_stream, kIpcMsgLogLine, &logLine);
break;
}

View File

@@ -94,7 +94,7 @@ IpcServerProxy::send(const IpcMessage& message)
case kIpcCommand: {
const IpcCommandMessage& cm = static_cast<const IpcCommandMessage&>(message);
String command = cm.command();
const String command = cm.command();
ProtocolUtil::writef(&m_stream, kIpcMsgCommand, &command);
break;
}

View File

@@ -147,7 +147,7 @@ Thread::threadFunc(void* vjob)
}
// get job
IJob* job = reinterpret_cast<IJob*>(vjob);
IJob* job = static_cast<IJob*>(vjob);
// run job
void* result = NULL;

View File

@@ -23,6 +23,7 @@ endif()
include_directories(
../
${OPENSSL_INCLUDE}
)
if (UNIX)
@@ -33,6 +34,23 @@ endif()
add_library(net STATIC ${sources})
if (UNIX)
target_link_libraries(net mt io)
if (WIN32)
add_custom_command(
TARGET net
POST_BUILD
COMMAND xcopy /Y /Q
..\\..\\..\\..\\ext\\${OPENSSL_PLAT_DIR}\\out32dll\\libeay32.*
..\\..\\..\\..\\bin\\${CMAKE_CFG_INTDIR}
)
add_custom_command(
TARGET net
POST_BUILD
COMMAND xcopy /Y /Q
..\\..\\..\\..\\ext\\${OPENSSL_PLAT_DIR}\\out32dll\\ssleay32.*
..\\..\\..\\..\\bin\\${CMAKE_CFG_INTDIR}
)
endif()
if (UNIX)
target_link_libraries(net mt io ${OPENSSL_LIBS})
endif()

View File

@@ -41,14 +41,7 @@ public:
*/
virtual IDataSocket*
accept() = 0;
//! Delete connection socket
/*!
This is used when the socket was created but not adopted by a client
proxy.
*/
virtual void deleteSocket(void*) = 0;
//@}
// ISocket overrides

View File

@@ -93,14 +93,3 @@ SecureListenSocket::accept()
throw ex;
}
}
void
SecureListenSocket::deleteSocket(void* socket)
{
SecureSocketSet::iterator it;
it = m_secureSocketSet.find((IDataSocket*)socket);
if (it != m_secureSocketSet.end()) {
delete *it;
m_secureSocketSet.erase(it);
}
}

View File

@@ -33,7 +33,6 @@ public:
// IListenSocket overrides
virtual IDataSocket*
accept();
void deleteSocket(void*);
private:
typedef std::set<IDataSocket*> SecureSocketSet;

View File

@@ -46,6 +46,7 @@ SocketMultiplexer::SocketMultiplexer() :
// this pointer just has to be unique and not NULL. it will
// never be dereferenced. it's used to identify cursor nodes
// in the jobs list.
// TODO: Remove this evilness
m_cursorMark = reinterpret_cast<ISocketMultiplexerJob*>(this);
// start thread

View File

@@ -102,7 +102,7 @@ TCPListenSocket::close()
void*
TCPListenSocket::getEventTarget() const
{
return const_cast<void*>(reinterpret_cast<const void*>(this));
return const_cast<void*>(static_cast<const void*>(this));
}
IDataSocket*

View File

@@ -43,7 +43,6 @@ public:
// IListenSocket overrides
virtual IDataSocket*
accept();
virtual void deleteSocket(void*) { }
protected:
void setListeningJob();

View File

@@ -125,7 +125,7 @@ TCPSocket::close()
void*
TCPSocket::getEventTarget() const
{
return const_cast<void*>(reinterpret_cast<const void*>(this));
return const_cast<void*>(static_cast<const void*>(this));
}
UInt32

View File

@@ -17,11 +17,11 @@
*/
#include "net/TCPSocketFactory.h"
#include "net/TCPSocket.h"
#include "net/TCPListenSocket.h"
#include "net/SecureSocket.h"
#include "net/SecureListenSocket.h"
#include "arch/Arch.h"
#include "common/PluginVersion.h"
#include "base/Log.h"
//
@@ -43,20 +43,14 @@ TCPSocketFactory::~TCPSocketFactory()
IDataSocket*
TCPSocketFactory::create(bool secure) const
{
IDataSocket* socket = NULL;
if (secure) {
void* args[2] = {
m_events,
m_socketMultiplexer
};
socket = static_cast<IDataSocket*>(
ARCH->plugin().invoke(s_pluginNames[kSecureSocket], "getSocket", args));
SecureSocket* secureSocket = new SecureSocket(m_events, m_socketMultiplexer);
secureSocket->initSsl (false);
return secureSocket;
}
else {
socket = new TCPSocket(m_events, m_socketMultiplexer);
return new TCPSocket(m_events, m_socketMultiplexer);
}
return socket;
}
IListenSocket*
@@ -64,12 +58,7 @@ TCPSocketFactory::createListen(bool secure) const
{
IListenSocket* socket = NULL;
if (secure) {
void* args[2] = {
m_events,
m_socketMultiplexer
};
socket = static_cast<IListenSocket*>(
ARCH->plugin().invoke(s_pluginNames[kSecureSocket], "getListenSocket", args));
socket = new SecureListenSocket(m_events, m_socketMultiplexer);
}
else {
socket = new TCPListenSocket(m_events, m_socketMultiplexer);

Some files were not shown because too many files have changed in this diff Show More