Simplify compile options and use comprehensive edition logic (#7365)
* Simplify options * Use more sensible edition logic * Use set instead of option for string * Improve macro for product name * Add tests launch config * Restore unregistered state * Reorganize cases for title and improve function name * Code coverage on by default * Fixed copyright * Improve code coverage and test readability * Separate build-all and build-coverage * Back out coverage on by default * Fixed bad var in cmake * More verbose logging for coverage * Restore tasks * Restore preLaunchTask * Use default comparitor * Move temp files to temp dir * Add tasks for tests * Support for wstring * Upgrade sonar-scanner to 6 on Debian 12 * Use modern pip install * Install python for sonarcloud * Use Ubuntu and install deps * Fixed sonar-scanner URL * Fix exported dir * Persist build dir * Don't use venv for pip install gcovr * Fixed another path * Update actions/checkout to v4 for SonarCloud analysis workflow * Add coverage task * Improve coverage for SerialKeyEdition.cpp * Enable licensing for builds * Fixed invalid macro names, missing arguments, etc * Fixed more copyright * Fixed incorrect use of "enterprise" * Fixed incorrect use of "business" * Experiment with environment * Make package prefix variable * Add environment matrix to all OS * Improve job names * Make job names easier to read * Roll back environment matrix (too much noise) * Fixed: default should override required * Refactor CI with vars * Fixed arg for env.get_env
This commit is contained in:
parent
37bb0f989e
commit
4690b61551
46 changed files with 533 additions and 487 deletions
56
.github/workflows/ci.yml
vendored
56
.github/workflows/ci.yml
vendored
|
|
@ -23,6 +23,9 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
SYNERGY_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}
|
SYNERGY_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}
|
||||||
|
SYNERGY_PRODUCT_NAME: ${{ vars.SYNERGY_PRODUCT_NAME }}
|
||||||
|
SYNERGY_PACKAGE_PREFIX: ${{ vars.SYNERGY_PACKAGE_PREFIX }}
|
||||||
|
SYNERGY_ENABLE_LICENSING: ${{ vars.SYNERGY_ENABLE_LICENSING }}
|
||||||
PACKAGE_BUILD: ${{ !github.event.pull_request.draft }}
|
PACKAGE_BUILD: ${{ !github.event.pull_request.draft }}
|
||||||
PACKAGE_UPLOAD: ${{ !github.event.pull_request.draft && github.event_name != 'schedule' }}
|
PACKAGE_UPLOAD: ${{ !github.event.pull_request.draft && github.event_name != 'schedule' }}
|
||||||
UPLOAD_TO_GITHUB: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }}
|
UPLOAD_TO_GITHUB: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }}
|
||||||
|
|
@ -30,13 +33,20 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows:
|
windows:
|
||||||
name: windows-2022
|
name: ${{ matrix.target.name }}
|
||||||
runs-on: windows-2022
|
runs-on: ${{ matrix.target.runs-on }}
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
|
|
||||||
env:
|
env:
|
||||||
QT_BASE_DIR: ${{ github.workspace }}\deps\Qt
|
QT_BASE_DIR: ${{ github.workspace }}\deps\Qt
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- name: windows-2022
|
||||||
|
runs-on: windows-2022
|
||||||
|
arch: x64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -75,48 +85,48 @@ jobs:
|
||||||
run: ./build/bin/unittests
|
run: ./build/bin/unittests
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
if: ${{ env.PACKAGE_BUILD == 'true' }}
|
if: ${{ vars.SYNERGY_ENABLE_PACKAGING && env.PACKAGE_BUILD == 'true' }}
|
||||||
run: python ./scripts/package.py
|
run: python ./scripts/package.py
|
||||||
env:
|
env:
|
||||||
WINDOWS_PFX_CERTIFICATE: ${{ secrets.WINDOWS_PFX }}
|
WINDOWS_PFX_CERTIFICATE: ${{ secrets.WINDOWS_PFX }}
|
||||||
WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASS }}
|
WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASS }}
|
||||||
|
|
||||||
- name: Upload
|
- name: Upload
|
||||||
if: ${{ env.PACKAGE_UPLOAD == 'true' }}
|
if: ${{ vars.SYNERGY_ENABLE_PACKAGING && env.PACKAGE_UPLOAD == 'true' }}
|
||||||
uses: ./.github/actions/dist-upload
|
uses: ./.github/actions/dist-upload
|
||||||
with:
|
with:
|
||||||
use_github: ${{ env.UPLOAD_TO_GITHUB }}
|
use_github: ${{ env.UPLOAD_TO_GITHUB }}
|
||||||
use_gdrive: ${{ env.UPLOAD_TO_GDRIVE }}
|
use_gdrive: ${{ env.UPLOAD_TO_GDRIVE }}
|
||||||
github-target-filename: "synergy-windows-x64"
|
github-target-filename: "${{ env.SYNERGY_PACKAGE_PREFIX }}-windows-${{ matrix.target.name }}"
|
||||||
gdrive-target-base-dir: "synergy1/personal"
|
gdrive-target-base-dir: ${{ vars.GDRIVE_TARGET_BASE_DIR }}
|
||||||
gdrive-secret-key: ${{ secrets.GOOGLE_DRIVE_KEY }}
|
gdrive-secret-key: ${{ secrets.GOOGLE_DRIVE_KEY }}
|
||||||
gdrive-parent-folder-id: ${{ secrets.GOOGLE_DRIVE_TECH_DRIVE }}
|
gdrive-parent-folder-id: ${{ secrets.GOOGLE_DRIVE_TECH_DRIVE }}
|
||||||
package-version: ${{ env.SYNERGY_VERSION }}
|
package-version: ${{ env.SYNERGY_VERSION }}
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
runs-on: ${{ matrix.runtime.os }}
|
name: ${{ matrix.target.name }}
|
||||||
timeout-minutes: ${{ matrix.runtime.timeout }}
|
runs-on: ${{ matrix.target.os }}
|
||||||
name: ${{ matrix.runtime.name }}
|
timeout-minutes: ${{ matrix.target.timeout }}
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: ${{ matrix.runtime.shell }}
|
shell: ${{ matrix.target.shell }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
runtime:
|
target:
|
||||||
- name: "macos-11-arm64"
|
- name: "macos-11-arm64"
|
||||||
timeout: 10
|
timeout: 10
|
||||||
os: "macos-14"
|
os: "macos-14"
|
||||||
arch: arm64
|
arch: arm64
|
||||||
target: "11"
|
version: "11"
|
||||||
shell: "/usr/bin/arch -arch arm64e /bin/bash --noprofile --norc -eo pipefail {0}"
|
shell: "/usr/bin/arch -arch arm64e /bin/bash --noprofile --norc -eo pipefail {0}"
|
||||||
|
|
||||||
- name: "macos-10-intel"
|
- name: "macos-10-intel"
|
||||||
timeout: 20
|
timeout: 20
|
||||||
os: "macos-14-large"
|
os: "macos-14-large"
|
||||||
arch: x64
|
arch: x64
|
||||||
target: "10.14"
|
version: "10.14"
|
||||||
shell: "bash"
|
shell: "bash"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -130,7 +140,7 @@ jobs:
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
env:
|
env:
|
||||||
CMAKE_OSX_DEPLOYMENT_TARGET: ${{ matrix.runtime.target }}
|
CMAKE_OSX_DEPLOYMENT_TARGET: ${{ matrix.target.version }}
|
||||||
run: cmake -B build --preset=macos-release -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)
|
run: cmake -B build --preset=macos-release -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|
@ -140,7 +150,7 @@ jobs:
|
||||||
run: ./build/bin/unittests
|
run: ./build/bin/unittests
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
if: ${{ env.PACKAGE_BUILD == 'true' }}
|
if: ${{ vars.SYNERGY_ENABLE_PACKAGING && env.PACKAGE_BUILD == 'true' }}
|
||||||
run: ./scripts/package.py
|
run: ./scripts/package.py
|
||||||
env:
|
env:
|
||||||
APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }}
|
APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }}
|
||||||
|
|
@ -151,21 +161,21 @@ jobs:
|
||||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||||
|
|
||||||
- name: Upload
|
- name: Upload
|
||||||
if: ${{ env.PACKAGE_UPLOAD == 'true' }}
|
if: ${{ vars.SYNERGY_ENABLE_PACKAGING && env.PACKAGE_UPLOAD == 'true' }}
|
||||||
uses: ./.github/actions/dist-upload
|
uses: ./.github/actions/dist-upload
|
||||||
with:
|
with:
|
||||||
use_github: ${{ env.UPLOAD_TO_GITHUB }}
|
use_github: ${{ env.UPLOAD_TO_GITHUB }}
|
||||||
use_gdrive: ${{ env.UPLOAD_TO_GDRIVE }}
|
use_gdrive: ${{ env.UPLOAD_TO_GDRIVE }}
|
||||||
github-target-filename: "synergy-${{ matrix.runtime.name }}"
|
github-target-filename: "${{ env.SYNERGY_PACKAGE_PREFIX }}-${{ matrix.target.name }}"
|
||||||
gdrive-target-base-dir: "synergy1/personal"
|
gdrive-target-base-dir: ${{ vars.GDRIVE_TARGET_BASE_DIR }}
|
||||||
gdrive-secret-key: ${{ secrets.GOOGLE_DRIVE_KEY }}
|
gdrive-secret-key: ${{ secrets.GOOGLE_DRIVE_KEY }}
|
||||||
gdrive-parent-folder-id: ${{ secrets.GOOGLE_DRIVE_TECH_DRIVE }}
|
gdrive-parent-folder-id: ${{ secrets.GOOGLE_DRIVE_TECH_DRIVE }}
|
||||||
package-version: ${{ env.SYNERGY_VERSION }}
|
package-version: ${{ env.SYNERGY_VERSION }}
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
|
name: linux-${{ matrix.distro.name }}
|
||||||
runs-on: ${{ matrix.distro.runs-on }}
|
runs-on: ${{ matrix.distro.runs-on }}
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
name: linux-${{ matrix.distro.name }}
|
|
||||||
container: ${{ matrix.distro.container }}
|
container: ${{ matrix.distro.container }}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
|
@ -265,20 +275,20 @@ jobs:
|
||||||
run: ./build/bin/unittests
|
run: ./build/bin/unittests
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
if: ${{ env.PACKAGE_BUILD == 'true' }}
|
if: ${{ vars.SYNERGY_ENABLE_PACKAGING && env.PACKAGE_BUILD == 'true' }}
|
||||||
env:
|
env:
|
||||||
LINUX_EXTRA_PACKAGES: ${{ matrix.distro.extra-packages }}
|
LINUX_EXTRA_PACKAGES: ${{ matrix.distro.extra-packages }}
|
||||||
LINUX_PACKAGE_USER: ${{ matrix.distro.package-user }}
|
LINUX_PACKAGE_USER: ${{ matrix.distro.package-user }}
|
||||||
run: ./scripts/package.py
|
run: ./scripts/package.py
|
||||||
|
|
||||||
- name: Upload
|
- name: Upload
|
||||||
if: ${{ env.PACKAGE_UPLOAD == 'true' }}
|
if: ${{ vars.SYNERGY_ENABLE_PACKAGING && env.PACKAGE_UPLOAD == 'true' }}
|
||||||
uses: ./.github/actions/dist-upload
|
uses: ./.github/actions/dist-upload
|
||||||
with:
|
with:
|
||||||
use_github: ${{ env.UPLOAD_TO_GITHUB }}
|
use_github: ${{ env.UPLOAD_TO_GITHUB }}
|
||||||
use_gdrive: ${{ env.UPLOAD_TO_GDRIVE }}
|
use_gdrive: ${{ env.UPLOAD_TO_GDRIVE }}
|
||||||
github-target-filename: "synergy-${{ matrix.distro.name }}"
|
github-target-filename: "${{ env.SYNERGY_PACKAGE_PREFIX }}-${{ matrix.distro.name }}"
|
||||||
gdrive-target-base-dir: "synergy1/personal"
|
gdrive-target-base-dir: ${{ vars.GDRIVE_TARGET_BASE_DIR }}
|
||||||
gdrive-secret-key: ${{ secrets.GOOGLE_DRIVE_KEY }}
|
gdrive-secret-key: ${{ secrets.GOOGLE_DRIVE_KEY }}
|
||||||
gdrive-parent-folder-id: ${{ secrets.GOOGLE_DRIVE_TECH_DRIVE }}
|
gdrive-parent-folder-id: ${{ secrets.GOOGLE_DRIVE_TECH_DRIVE }}
|
||||||
package-version: ${{ env.SYNERGY_VERSION }}
|
package-version: ${{ env.SYNERGY_VERSION }}
|
||||||
|
|
|
||||||
36
.github/workflows/sonarcloud-analysis.yml
vendored
36
.github/workflows/sonarcloud-analysis.yml
vendored
|
|
@ -12,33 +12,35 @@ concurrency:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sonarcloud-analysis:
|
sonarcloud-analysis:
|
||||||
|
if: ${{ vars.SONAR_SCANNER_ENABLED }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: symless/synergy-core:debian10
|
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
|
|
||||||
env:
|
env:
|
||||||
SONAR_SCANNER_VERSION: 5.0.1.3006
|
SONAR_SCANNER_VERSION: 6.1.0.4477
|
||||||
SONAR_SCANNER_OPTS: -server
|
SONAR_SCANNER_OPTS: -server
|
||||||
|
SONAR_SCANNER_URL_BASE: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout git repo
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Installing gcovr
|
- name: Install dependencies
|
||||||
run: |
|
run: ./scripts/install_deps.py
|
||||||
apt-get update
|
|
||||||
apt-get install -y python python-pip
|
|
||||||
pip install gcovr
|
|
||||||
|
|
||||||
- name: Installing Sonar Scanner
|
- name: Install gcovr
|
||||||
|
run: pip install gcovr
|
||||||
|
|
||||||
|
- name: Install SonarScanner
|
||||||
run: |
|
run: |
|
||||||
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
|
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64
|
||||||
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
|
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip \
|
||||||
|
$SONAR_SCANNER_URL_BASE/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-x64.zip
|
||||||
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
|
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
|
||||||
|
|
||||||
- name: Installing build-wrapper
|
- name: Install build-wrapper
|
||||||
run: |
|
run: |
|
||||||
curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
|
curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
|
||||||
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
|
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
|
||||||
|
|
@ -46,19 +48,19 @@ jobs:
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
export PATH=$HOME/.sonar/build-wrapper-linux-x86:$PATH
|
export PATH=$HOME/.sonar/build-wrapper-linux-x86:$PATH
|
||||||
mkdir build
|
mkdir -p build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON ..
|
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON ..
|
||||||
build-wrapper-linux-x86-64 --out-dir bw-output make -j
|
build-wrapper-linux-x86-64 --out-dir bw-output make -j
|
||||||
|
|
||||||
- name: Running coverage
|
- name: Make coverage
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
make coverage
|
make coverage
|
||||||
|
|
||||||
- name: Run Sonar Scanner
|
- name: Run SonarScanner
|
||||||
run: |
|
run: |
|
||||||
export PATH=$HOME/.sonar/sonar-scanner-${SONAR_SCANNER_VERSION}-linux/bin:$PATH
|
export PATH=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64/bin:$PATH
|
||||||
cd build
|
cd build
|
||||||
sonar-scanner \
|
sonar-scanner \
|
||||||
-Dsonar.organization=symless \
|
-Dsonar.organization=symless \
|
||||||
|
|
|
||||||
3
.vscode/extensions.json
vendored
3
.vscode/extensions.json
vendored
|
|
@ -5,6 +5,7 @@
|
||||||
"llvm-vs-code-extensions.vscode-clangd",
|
"llvm-vs-code-extensions.vscode-clangd",
|
||||||
"ms-vscode.cpptools",
|
"ms-vscode.cpptools",
|
||||||
"vadimcn.vscode-lldb",
|
"vadimcn.vscode-lldb",
|
||||||
"cheshirekow.cmake-format"
|
"cheshirekow.cmake-format",
|
||||||
|
"jacqueslucke.gcov-viewer"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
.vscode/launch.json
vendored
14
.vscode/launch.json
vendored
|
|
@ -8,6 +8,20 @@
|
||||||
"program": "${workspaceFolder}/build/bin/synergy",
|
"program": "${workspaceFolder}/build/bin/synergy",
|
||||||
"preLaunchTask": "build"
|
"preLaunchTask": "build"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "unittests lldb",
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/build/bin/unittests",
|
||||||
|
"preLaunchTask": "build"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "integtests lldb",
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/build/bin/integtests",
|
||||||
|
"preLaunchTask": "build"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "win daemon attach",
|
"name": "win daemon attach",
|
||||||
"type": "cppvsdbg",
|
"type": "cppvsdbg",
|
||||||
|
|
|
||||||
20
.vscode/tasks.json
vendored
20
.vscode/tasks.json
vendored
|
|
@ -12,11 +12,31 @@
|
||||||
"isDefault": true
|
"isDefault": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "cmake",
|
||||||
|
"label": "coverage",
|
||||||
|
"command": "build",
|
||||||
|
"targets": ["coverage"],
|
||||||
|
"preset": "${command:cmake.activeBuildPresetName}",
|
||||||
|
"group": "build"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "reinstall windows daemon",
|
"label": "reinstall windows daemon",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "python scripts/windows_daemon.py",
|
"command": "python scripts/windows_daemon.py",
|
||||||
"dependsOn": ["build"]
|
"dependsOn": ["build"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "unittests",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "./build/bin/unittests",
|
||||||
|
"dependsOn": ["build"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "integtests",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "./build/bin/integtests",
|
||||||
|
"dependsOn": ["build"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
ChangeLog
20
ChangeLog
|
|
@ -69,7 +69,7 @@ Enhancements:
|
||||||
- #7190 Maintenance license serial key support
|
- #7190 Maintenance license serial key support
|
||||||
- #7193 Support for maintenance licenses in China
|
- #7193 Support for maintenance licenses in China
|
||||||
- #7197 Special contributor mentions on the about screen
|
- #7197 Special contributor mentions on the about screen
|
||||||
- #7203 License registration for Business edition
|
- #7203 License registration for more editions
|
||||||
- #7210 Update macos workflow to use macos-latest
|
- #7210 Update macos workflow to use macos-latest
|
||||||
- #7213 Update azure pipelines to use macos-latest
|
- #7213 Update azure pipelines to use macos-latest
|
||||||
|
|
||||||
|
|
@ -87,8 +87,8 @@ Bug fixes:
|
||||||
Enhancements:
|
Enhancements:
|
||||||
|
|
||||||
- #7143 Ability to stop Synergy on the login screen
|
- #7143 Ability to stop Synergy on the login screen
|
||||||
- #7157 Synergy Business accepts only business licenses
|
- #7157 Only accept correct license for specific edition
|
||||||
- #7188 Synergy Basic\Pro accepts business licenses
|
- #7188 Only accept correct license for personal edition
|
||||||
- #7166 Replace language notifications with warnings in logs
|
- #7166 Replace language notifications with warnings in logs
|
||||||
- #7181 Fedora 36 support to CI system
|
- #7181 Fedora 36 support to CI system
|
||||||
- #7177 Create workflow for flatpak build support
|
- #7177 Create workflow for flatpak build support
|
||||||
|
|
@ -127,7 +127,7 @@ Bug fixes:
|
||||||
- #7096 The system duplicates hotkeys in setup
|
- #7096 The system duplicates hotkeys in setup
|
||||||
- #7099 Compilation broken with msvc 2014
|
- #7099 Compilation broken with msvc 2014
|
||||||
- #7100 No configuration available on Windows
|
- #7100 No configuration available on Windows
|
||||||
- #7097 The title "Enterprise" disappeares after clicking on "Preferences"
|
- #7097 Title disappeares after clicking on "Preferences"
|
||||||
- #7108 Wrong characters on client for unicode
|
- #7108 Wrong characters on client for unicode
|
||||||
- #7114 Problem with reading languages on Linux system
|
- #7114 Problem with reading languages on Linux system
|
||||||
- #7115 Prevent notifications if language reading fails
|
- #7115 Prevent notifications if language reading fails
|
||||||
|
|
@ -279,9 +279,9 @@ Bug fixes:
|
||||||
|
|
||||||
- #6831 Incorporating Sonar's major
|
- #6831 Incorporating Sonar's major
|
||||||
- #6837 Memory leaks on macOS system
|
- #6837 Memory leaks on macOS system
|
||||||
- #6838 Enterprise asks for serial key on Linux system
|
- #6838 Serial key requested by mistake
|
||||||
- #6849 Auto-hide resets itself
|
- #6849 Auto-hide resets itself
|
||||||
- #6846 TLS certificate is not created by default for Synergy Enterprise.
|
- #6846 TLS certificate is not created by default
|
||||||
- #6859 Systray Icon on Ubuntu Auto Start
|
- #6859 Systray Icon on Ubuntu Auto Start
|
||||||
- #6863 Adding MacOS CI Build Steps for Homebrew Cleanup
|
- #6863 Adding MacOS CI Build Steps for Homebrew Cleanup
|
||||||
|
|
||||||
|
|
@ -307,7 +307,7 @@ Bug fixes:
|
||||||
- #6804 Synergy loses edition when creating a System scope config
|
- #6804 Synergy loses edition when creating a System scope config
|
||||||
- #6660 + #6582 Add missing XAtom for utf-8 handling with Xorg
|
- #6660 + #6582 Add missing XAtom for utf-8 handling with Xorg
|
||||||
- #6814 The system asks to save twice.
|
- #6814 The system asks to save twice.
|
||||||
- #6817 Configure requires dns_sd.h for enterprise version
|
- #6817 Configure requires dns_sd.h
|
||||||
- #6826 + #6829 SonarCloud Critical bugs
|
- #6826 + #6829 SonarCloud Critical bugs
|
||||||
- #6821 Blocker bugs found by sonar in synergy and in tests
|
- #6821 Blocker bugs found by sonar in synergy and in tests
|
||||||
- #6825 The system requires google test even when tests are disabled with BUILD_TESTS=OFF
|
- #6825 The system requires google test even when tests are disabled with BUILD_TESTS=OFF
|
||||||
|
|
@ -318,7 +318,7 @@ Enhancements:
|
||||||
|
|
||||||
- #6750 Integrate SonarCloud for static analysis and test coverage
|
- #6750 Integrate SonarCloud for static analysis and test coverage
|
||||||
- #6792 License key expiry
|
- #6792 License key expiry
|
||||||
- #6799 Synergy "Business" edition
|
- #6799 New edition
|
||||||
- #6803 Update Synergy icons
|
- #6803 Update Synergy icons
|
||||||
- #6800 Update behaviour when unregistered
|
- #6800 Update behaviour when unregistered
|
||||||
- #6806 Move to Github Action for general PR builds and tests
|
- #6806 Move to Github Action for general PR builds and tests
|
||||||
|
|
@ -430,7 +430,7 @@ Bug fixes:
|
||||||
- #6495 Event queue memory leak in server cleanup
|
- #6495 Event queue memory leak in server cleanup
|
||||||
- #6471 Unable to stop core retry loop in config app
|
- #6471 Unable to stop core retry loop in config app
|
||||||
- #6460 TLS memory leak on Linux server when using client
|
- #6460 TLS memory leak on Linux server when using client
|
||||||
- #6407 Enterprise config app shows auto-config elements
|
- #6407 Config app shows auto-config elements
|
||||||
- #6403 Mouse cursor movement drifts over time
|
- #6403 Mouse cursor movement drifts over time
|
||||||
- #6392 Hostname alert shows unnecessarily on every open
|
- #6392 Hostname alert shows unnecessarily on every open
|
||||||
- #6373 Compile fails on BSD Unix with dl error
|
- #6373 Compile fails on BSD Unix with dl error
|
||||||
|
|
@ -479,7 +479,7 @@ Enhancements:
|
||||||
- #6312 Removal of redundant CURL library
|
- #6312 Removal of redundant CURL library
|
||||||
- #6306 Show version number in config app title
|
- #6306 Show version number in config app title
|
||||||
- #6305 Support for Raspbian in package config
|
- #6305 Support for Raspbian in package config
|
||||||
- #6301 Combine enterprise and community codebases
|
- #6301 Combine codebases for all editions
|
||||||
|
|
||||||
# 1.9.1
|
# 1.9.1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,28 +22,37 @@ macro(configure_definitions)
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
||||||
|
|
||||||
|
set(PRODUCT_NAME "Synergy 1 Community Edition")
|
||||||
|
if(DEFINED $ENV{SYNERGY_PRODUCT_NAME})
|
||||||
|
message(STATUS "Product name: $ENV{SYNERGY_PRODUCT_NAME}")
|
||||||
|
set(PRODUCT_NAME $ENV{SYNERGY_PRODUCT_NAME})
|
||||||
|
endif()
|
||||||
|
add_definitions(-DSYNERGY_PRODUCT_NAME="${PRODUCT_NAME}")
|
||||||
|
|
||||||
configure_ninja()
|
configure_ninja()
|
||||||
configure_options()
|
configure_options()
|
||||||
|
|
||||||
if(SYNERGY_ENTERPRISE)
|
if(ENABLE_LICENSING)
|
||||||
add_definitions(-DSYNERGY_ENTERPRISE=1)
|
message(STATUS "Licensing enabled")
|
||||||
|
add_definitions(-DSYNERGY_ENABLE_LICENSING=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SYNERGY_BUSINESS)
|
if(ENABLE_AUTO_CONFIG)
|
||||||
add_definitions(-DSYNERGY_BUSINESS=1)
|
message(STATUS "Auto config enabled")
|
||||||
|
add_definitions(-DSYNERGY_ENABLE_AUTO_CONFIG=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
message(STATUS "Disabling debug build")
|
||||||
add_definitions(-DNDEBUG)
|
add_definitions(-DNDEBUG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# TODO: Find out why we need these, and remove them if we don't
|
# TODO: find out why we need these, and remove them if we don't
|
||||||
if(COMMAND cmake_policy)
|
if(COMMAND cmake_policy)
|
||||||
cmake_policy(SET CMP0003 NEW)
|
cmake_policy(SET CMP0003 NEW)
|
||||||
cmake_policy(SET CMP0005 NEW)
|
cmake_policy(SET CMP0005 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add headers to source list
|
|
||||||
if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
|
if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
|
||||||
set(SYNERGY_ADD_HEADERS FALSE)
|
set(SYNERGY_ADD_HEADERS FALSE)
|
||||||
else()
|
else()
|
||||||
|
|
@ -64,36 +73,49 @@ macro(configure_ninja)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(configure_options)
|
macro(configure_options)
|
||||||
if(DEFINED ENV{SYNERGY_BUILD_MINIMAL})
|
|
||||||
option(SYNERGY_BUILD_GUI "Build the GUI" OFF)
|
set(DEFAULT_BUILD_GUI ON)
|
||||||
option(SYNERGY_BUILD_INSTALLER "Build the installer" OFF)
|
set(DEFAULT_BUILD_INSTALLER ON)
|
||||||
else()
|
set(DEFAULT_BUILD_TESTS ON)
|
||||||
option(SYNERGY_BUILD_GUI "Build the GUI" ON)
|
|
||||||
option(SYNERGY_BUILD_INSTALLER "Build the installer" ON)
|
# unified binary is off by default for now, for backwards compatibility.
|
||||||
|
set(DEFAULT_BUILD_UNIFIED OFF)
|
||||||
|
|
||||||
|
# coverage is off by default because it's GCC only and a developer preference.
|
||||||
|
set(DEFAULT_ENABLE_COVERAGE OFF)
|
||||||
|
|
||||||
|
# licensing is off by default to make life easier for contributors.
|
||||||
|
set(DEFAULT_ENABLE_LICENSING OFF)
|
||||||
|
|
||||||
|
if(DEFINED $ENV{SYNERGY_BUILD_MINIMAL})
|
||||||
|
set(DEFAULT_BUILD_GUI OFF)
|
||||||
|
set(DEFAULT_BUILD_INSTALLER OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(DEFINED ENV{SYNERGY_NO_TESTS})
|
if(DEFINED $ENV{SYNERGY_NO_TESTS})
|
||||||
option(BUILD_TESTS "Override building of tests" OFF)
|
set(DEFAULT_BUILD_TESTS OFF)
|
||||||
else()
|
|
||||||
option(BUILD_TESTS "Override building of tests" ON)
|
|
||||||
option(ENABLE_COVERAGE "Build with coverage")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(DEFINED ENV{SYNERGY_UNIFIED_CORE})
|
if(DEFINED $ENV{SYNERGY_BUILD_UNIFIED})
|
||||||
option(UNIFIED_CORE "Build a single core binary" ON)
|
set(DEFAULT_BUILD_UNIFIED ON)
|
||||||
else()
|
|
||||||
option(UNIFIED_CORE "Build a single core binary" OFF)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if($ENV{SYNERGY_ENTERPRISE})
|
if(DEFINED $ENV{SYNERGY_ENABLE_LICENSING})
|
||||||
option(SYNERGY_ENTERPRISE "Build Enterprise" ON)
|
set(DEFAULT_ENABLE_LICENSING ON)
|
||||||
else()
|
|
||||||
option(SYNERGY_ENTERPRISE "Build Enterprise" OFF)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if($ENV{SYNERGY_BUSINESS})
|
if(DEFINED $ENV{SYNERGY_ENABLE_COVERAGE})
|
||||||
option(SYNERGY_BUSINESS "Build Business" ON)
|
set(DEFAULT_ENABLE_COVERAGE ON)
|
||||||
else()
|
|
||||||
option(SYNERGY_BUSINESS "Build Business" OFF)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
option(BUILD_GUI "Build GUI" ${DEFAULT_BUILD_GUI})
|
||||||
|
option(BUILD_INSTALLER "Build installer" ${DEFAULT_BUILD_INSTALLER})
|
||||||
|
option(BUILD_TESTS "Build tests" ${DEFAULT_BUILD_TESTS})
|
||||||
|
option(BUILD_UNIFIED "Build unified binary" ${DEFAULT_BUILD_UNIFIED})
|
||||||
|
option(ENABLE_LICENSING "Enable licensing" ${DEFAULT_ENABLE_LICENSING})
|
||||||
|
option(ENABLE_COVERAGE "Enable test coverage" ${DEFAULT_ENABLE_COVERAGE})
|
||||||
|
|
||||||
|
# auto config is off by default because it requires bonjour, which sucks.
|
||||||
|
option(ENABLE_AUTO_CONFIG "Enable auto config (zeroconf)" OFF)
|
||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
|
||||||
|
|
@ -326,6 +326,7 @@ macro(configure_test_libs)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_COVERAGE)
|
if(ENABLE_COVERAGE)
|
||||||
|
message(STATUS "Enabling code coverage")
|
||||||
include(cmake/CodeCoverage.cmake)
|
include(cmake/CodeCoverage.cmake)
|
||||||
append_coverage_compiler_flags()
|
append_coverage_compiler_flags()
|
||||||
setup_target_for_coverage_gcovr_xml(
|
setup_target_for_coverage_gcovr_xml(
|
||||||
|
|
@ -337,6 +338,8 @@ macro(configure_test_libs)
|
||||||
"${PROJECT_SOURCE_DIR}/src"
|
"${PROJECT_SOURCE_DIR}/src"
|
||||||
EXCLUDE
|
EXCLUDE
|
||||||
"ext/*")
|
"ext/*")
|
||||||
|
else()
|
||||||
|
message(STATUS "Code coverage is disabled")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(BEFORE SYSTEM
|
include_directories(BEFORE SYSTEM
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
#
|
#
|
||||||
macro(configure_packaging)
|
macro(configure_packaging)
|
||||||
|
|
||||||
if(${SYNERGY_BUILD_INSTALLER})
|
if(${BUILD_INSTALLER})
|
||||||
set(CPACK_PACKAGE_NAME "synergy")
|
set(CPACK_PACKAGE_NAME "synergy")
|
||||||
set(CPACK_PACKAGE_CONTACT "Synergy <support@symless.com>")
|
set(CPACK_PACKAGE_CONTACT "Synergy <support@symless.com>")
|
||||||
set(CPACK_PACKAGE_DESCRIPTION "Mouse and keyboard sharing utility")
|
set(CPACK_PACKAGE_DESCRIPTION "Mouse and keyboard sharing utility")
|
||||||
|
|
|
||||||
45
res/dist/flatpak/synergy-business.yml
vendored
45
res/dist/flatpak/synergy-business.yml
vendored
|
|
@ -1,45 +0,0 @@
|
||||||
app-id: com.symless.Synergy
|
|
||||||
runtime: org.kde.Platform
|
|
||||||
runtime-version: "5.15-21.08"
|
|
||||||
sdk: org.kde.Sdk
|
|
||||||
rename-icon: synergy
|
|
||||||
rename-desktop-file: synergy.desktop
|
|
||||||
build-options:
|
|
||||||
env:
|
|
||||||
SYNERGY_BUSINESS: "1"
|
|
||||||
modules:
|
|
||||||
- name: openssl
|
|
||||||
buildsystem: simple
|
|
||||||
build-commands:
|
|
||||||
- "./config --prefix=/var/run/host/usr/local/ssl"
|
|
||||||
- "make"
|
|
||||||
- "make install_sw"
|
|
||||||
sources:
|
|
||||||
- type: archive
|
|
||||||
url: https://github.com/openssl/openssl/archive/OpenSSL_1_1_1n.tar.gz
|
|
||||||
sha256: 6b2d2440ced8c802aaa61475919f0870ec556694c466ebea460e35ea2b14839e
|
|
||||||
- name: libnotify
|
|
||||||
buildsystem: meson
|
|
||||||
config-opts:
|
|
||||||
- "-Dman=false"
|
|
||||||
- "-Dgtk_doc=false"
|
|
||||||
sources:
|
|
||||||
- type: git
|
|
||||||
url: https://gitlab.gnome.org/GNOME/libnotify.git
|
|
||||||
- name: synergy
|
|
||||||
buildsystem: cmake-ninja
|
|
||||||
config-opts:
|
|
||||||
- "-DCMAKE_BUILD_TYPE=Release"
|
|
||||||
sources:
|
|
||||||
- type: dir
|
|
||||||
path: ../
|
|
||||||
- type: patch
|
|
||||||
path: flatpak-desktop.patch
|
|
||||||
command: synergy
|
|
||||||
finish-args:
|
|
||||||
- "--share=ipc"
|
|
||||||
- "--socket=x11"
|
|
||||||
- "--share=network"
|
|
||||||
- "--device=dri"
|
|
||||||
- "--talk-name=org.a11y.*"
|
|
||||||
- "--filesystem=host"
|
|
||||||
45
res/dist/flatpak/synergy-enterprise.yml
vendored
45
res/dist/flatpak/synergy-enterprise.yml
vendored
|
|
@ -1,45 +0,0 @@
|
||||||
app-id: com.symless.Synergy
|
|
||||||
runtime: org.kde.Platform
|
|
||||||
runtime-version: "5.15-21.08"
|
|
||||||
sdk: org.kde.Sdk
|
|
||||||
rename-icon: synergy
|
|
||||||
rename-desktop-file: synergy.desktop
|
|
||||||
build-options:
|
|
||||||
env:
|
|
||||||
SYNERGY_ENTERPRISE: "1"
|
|
||||||
modules:
|
|
||||||
- name: openssl
|
|
||||||
buildsystem: simple
|
|
||||||
build-commands:
|
|
||||||
- "./config --prefix=/var/run/host/usr/local/ssl"
|
|
||||||
- "make"
|
|
||||||
- "make install_sw"
|
|
||||||
sources:
|
|
||||||
- type: archive
|
|
||||||
url: https://github.com/openssl/openssl/archive/OpenSSL_1_1_1n.tar.gz
|
|
||||||
sha256: 6b2d2440ced8c802aaa61475919f0870ec556694c466ebea460e35ea2b14839e
|
|
||||||
- name: libnotify
|
|
||||||
buildsystem: meson
|
|
||||||
config-opts:
|
|
||||||
- "-Dman=false"
|
|
||||||
- "-Dgtk_doc=false"
|
|
||||||
sources:
|
|
||||||
- type: git
|
|
||||||
url: https://gitlab.gnome.org/GNOME/libnotify.git
|
|
||||||
- name: synergy
|
|
||||||
buildsystem: cmake-ninja
|
|
||||||
config-opts:
|
|
||||||
- "-DCMAKE_BUILD_TYPE=Release"
|
|
||||||
sources:
|
|
||||||
- type: dir
|
|
||||||
path: ../
|
|
||||||
- type: patch
|
|
||||||
path: flatpak-desktop.patch
|
|
||||||
command: synergy
|
|
||||||
finish-args:
|
|
||||||
- "--share=ipc"
|
|
||||||
- "--socket=x11"
|
|
||||||
- "--share=network"
|
|
||||||
- "--device=dri"
|
|
||||||
- "--talk-name=org.a11y.*"
|
|
||||||
- "--filesystem=host"
|
|
||||||
|
|
@ -62,14 +62,21 @@ def get_linux_distro():
|
||||||
return name, name_like, version
|
return name, name_like, version
|
||||||
|
|
||||||
|
|
||||||
def get_env(name, required=True):
|
def get_env(name, required=True, default=None):
|
||||||
"""Returns an env var (stripped) or optionally raises an error if not set."""
|
"""
|
||||||
|
Returns an env var (stripped) or optionally raises an error if not set.
|
||||||
|
|
||||||
|
If `default` is set, it will be returned even if `required` is True.
|
||||||
|
"""
|
||||||
value = os.getenv(name)
|
value = os.getenv(name)
|
||||||
if value:
|
if value:
|
||||||
value = value.strip()
|
value = value.strip()
|
||||||
|
|
||||||
if required and not value:
|
if not value:
|
||||||
raise ValueError(f"Required env var not set: {name}")
|
if default:
|
||||||
|
return default
|
||||||
|
elif required:
|
||||||
|
raise ValueError(f"Required env var not set: {name}")
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from lib.certificate import Certificate
|
||||||
cmake_env_var = "CMAKE_PREFIX_PATH"
|
cmake_env_var = "CMAKE_PREFIX_PATH"
|
||||||
shell_rc = "~/.zshrc"
|
shell_rc = "~/.zshrc"
|
||||||
dist_dir = "dist"
|
dist_dir = "dist"
|
||||||
product_name = "Synergy"
|
product_name = "Synergy 1"
|
||||||
settings_file = "res/dist/macos/dmgbuild/settings.py"
|
settings_file = "res/dist/macos/dmgbuild/settings.py"
|
||||||
app_path = "build/bundle/Synergy.app"
|
app_path = "build/bundle/Synergy.app"
|
||||||
security_path = "/usr/bin/security"
|
security_path = "/usr/bin/security"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import platform
|
||||||
import lib.env as env
|
import lib.env as env
|
||||||
|
|
||||||
env_file = ".env"
|
env_file = ".env"
|
||||||
package_name = "synergy"
|
default_package_prefix = "synergy"
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
@ -32,6 +32,8 @@ def main():
|
||||||
def get_filename_base(version, use_linux_distro=True):
|
def get_filename_base(version, use_linux_distro=True):
|
||||||
os = env.get_os()
|
os = env.get_os()
|
||||||
machine = platform.machine().lower()
|
machine = platform.machine().lower()
|
||||||
|
package_base = env.get_env("SYNERGY_PACKAGE_PREFIX", default=default_package_prefix)
|
||||||
|
|
||||||
if os == "linux" and use_linux_distro:
|
if os == "linux" and use_linux_distro:
|
||||||
distro_name, _distro_like, distro_version = env.get_linux_distro()
|
distro_name, _distro_like, distro_version = env.get_linux_distro()
|
||||||
if not distro_name:
|
if not distro_name:
|
||||||
|
|
@ -43,9 +45,9 @@ def get_filename_base(version, use_linux_distro=True):
|
||||||
else:
|
else:
|
||||||
distro = distro_name
|
distro = distro_name
|
||||||
|
|
||||||
return f"{package_name}-{distro}-{machine}-{version}"
|
return f"{package_base}-{distro}-{machine}-{version}"
|
||||||
else:
|
else:
|
||||||
return f"{package_name}-{os}-{machine}-{version}"
|
return f"{package_base}-{os}-{machine}-{version}"
|
||||||
|
|
||||||
|
|
||||||
def windows_package(filename_base):
|
def windows_package(filename_base):
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,10 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||||
|
|
||||||
add_subdirectory(lib)
|
add_subdirectory(lib)
|
||||||
add_subdirectory(cmd)
|
add_subdirectory(cmd)
|
||||||
if(SYNERGY_BUILD_GUI)
|
|
||||||
|
if(BUILD_GUI)
|
||||||
add_subdirectory(gui)
|
add_subdirectory(gui)
|
||||||
endif(SYNERGY_BUILD_GUI)
|
endif(BUILD_GUI)
|
||||||
|
|
||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,12 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
add_subdirectory(synergyd)
|
add_subdirectory(synergyd)
|
||||||
if(UNIFIED_CORE)
|
|
||||||
|
if(BUILD_UNIFIED)
|
||||||
add_subdirectory(synergy-core)
|
add_subdirectory(synergy-core)
|
||||||
else()
|
else()
|
||||||
add_subdirectory(synergyc)
|
add_subdirectory(synergyc)
|
||||||
add_subdirectory(synergys)
|
add_subdirectory(synergys)
|
||||||
endif(UNIFIED_CORE)
|
endif(BUILD_UNIFIED)
|
||||||
|
|
||||||
add_subdirectory(syntool)
|
add_subdirectory(syntool)
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
|
||||||
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
|
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
|
||||||
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
|
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
|
||||||
|
|
||||||
if(SYNERGY_ENTERPRISE)
|
if(NOT ENABLE_LICENSING)
|
||||||
list(REMOVE_ITEM GUI_SOURCE_FILES ${ACTIVATION_FILES})
|
list(REMOVE_ITEM GUI_SOURCE_FILES ${ACTIVATION_FILES})
|
||||||
list(REMOVE_ITEM GUI_UI_FILES ${ACTIVATION_FILES})
|
list(REMOVE_ITEM GUI_UI_FILES ${ACTIVATION_FILES})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* synergy -- mouse and keyboard sharing utility
|
* synergy -- mouse and keyboard sharing utility
|
||||||
* Copyright (C) 2015 Synergy Seamless Inc.
|
* Copyright (C) 2015 Synergy Ltd.
|
||||||
*
|
*
|
||||||
* This package is free software; you can redistribute it and/or
|
* This package is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* synergy -- mouse and keyboard sharing utility
|
* synergy -- mouse and keyboard sharing utility
|
||||||
* Copyright (C) 2015 Synergy Seamless Inc.
|
* Copyright (C) 2015 Synergy Ltd.
|
||||||
*
|
*
|
||||||
* This package is free software; you can redistribute it and/or
|
* This package is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -171,10 +171,9 @@ const QString &AppConfig::language() const { return m_Language; }
|
||||||
bool AppConfig::startedBefore() const { return m_StartedBefore; }
|
bool AppConfig::startedBefore() const { return m_StartedBefore; }
|
||||||
|
|
||||||
bool AppConfig::autoConfig() const {
|
bool AppConfig::autoConfig() const {
|
||||||
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
|
#ifdef ENABLE_AUTO_CONFIG
|
||||||
return m_AutoConfig;
|
return m_AutoConfig;
|
||||||
#else
|
#else
|
||||||
// always disable auto config for enterprise edition.
|
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -319,7 +318,7 @@ void AppConfig::saveSettings() {
|
||||||
m_unsavedChanges = false;
|
m_unsavedChanges = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
bool AppConfig::activationHasRun() const { return m_ActivationHasRun; }
|
bool AppConfig::activationHasRun() const { return m_ActivationHasRun; }
|
||||||
|
|
||||||
AppConfig &AppConfig::activationHasRun(bool value) {
|
AppConfig &AppConfig::activationHasRun(bool value) {
|
||||||
|
|
@ -378,7 +377,7 @@ void AppConfig::setAutoConfigServer(const QString &autoConfigServer) {
|
||||||
setSettingModified(m_AutoConfigServer, autoConfigServer);
|
setSettingModified(m_AutoConfigServer, autoConfigServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
void AppConfig::setEdition(Edition e) {
|
void AppConfig::setEdition(Edition e) {
|
||||||
setSettingModified(m_Edition, e);
|
setSettingModified(m_Edition, e);
|
||||||
setCommonSetting(kEditionSetting, m_Edition);
|
setCommonSetting(kEditionSetting, m_Edition);
|
||||||
|
|
@ -422,10 +421,10 @@ void AppConfig::setCryptoEnabled(bool newValue) {
|
||||||
bool AppConfig::isCryptoAvailable() const {
|
bool AppConfig::isCryptoAvailable() const {
|
||||||
bool result{true};
|
bool result{true};
|
||||||
|
|
||||||
#if !defined(SYNERGY_ENTERPRISE) && !defined(SYNERGY_BUSINESS)
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
result = (edition() == kPro || edition() == kPro_China ||
|
result = (edition() == kPro || edition() == kProChina ||
|
||||||
edition() == kBusiness || edition() == kUltimate);
|
edition() == kBusiness || edition() == kUltimate);
|
||||||
#endif
|
#endif // SYNERGY_ENABLE_LICENSING
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,8 @@ public:
|
||||||
void setAutoConfig(bool autoConfig);
|
void setAutoConfig(bool autoConfig);
|
||||||
QString autoConfigServer() const;
|
QString autoConfigServer() const;
|
||||||
void setAutoConfigServer(const QString &autoConfigServer);
|
void setAutoConfigServer(const QString &autoConfigServer);
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
|
||||||
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
void setEdition(Edition);
|
void setEdition(Edition);
|
||||||
Edition edition() const;
|
Edition edition() const;
|
||||||
void setSerialKey(const QString &serial);
|
void setSerialKey(const QString &serial);
|
||||||
|
|
@ -124,7 +125,7 @@ public:
|
||||||
bool getClientHostMode() const;
|
bool getClientHostMode() const;
|
||||||
bool getServerClientMode() const;
|
bool getServerClientMode() const;
|
||||||
bool getInitiateConnectionFromServer() const;
|
bool getInitiateConnectionFromServer() const;
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
bool activationHasRun() const;
|
bool activationHasRun() const;
|
||||||
AppConfig &activationHasRun(bool value);
|
AppConfig &activationHasRun(bool value);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* synergy -- mouse and keyboard sharing utility
|
* synergy -- mouse and keyboard sharing utility
|
||||||
* Copyright (C) 2015 Synergy Seamless Inc.
|
* Copyright (C) 2015 Synergy Ltd.
|
||||||
*
|
*
|
||||||
* This package is free software; you can redistribute it and/or
|
* This package is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -53,12 +53,11 @@ void checkSerialKey(const SerialKey &serialKey, bool acceptExpired) {
|
||||||
throw std::runtime_error("Serial key expired");
|
throw std::runtime_error("Serial key expired");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SYNERGY_BUSINESS
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
if (!serialKey.isValid()) {
|
if (!serialKey.isValid()) {
|
||||||
throw std::runtime_error("The serial key is not compatible with the "
|
throw std::runtime_error("The serial key is not valid.");
|
||||||
"business version of Synergy.");
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif // SYNERGY_ENABLE_LICENSING
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
@ -136,7 +135,7 @@ void LicenseManager::skipActivation() const {
|
||||||
|
|
||||||
QString LicenseManager::getEditionName(Edition const edition, bool trial) {
|
QString LicenseManager::getEditionName(Edition const edition, bool trial) {
|
||||||
SerialKeyEdition KeyEdition(edition);
|
SerialKeyEdition KeyEdition(edition);
|
||||||
std::string name = KeyEdition.getDisplayName();
|
std::string name = KeyEdition.getProductName();
|
||||||
|
|
||||||
if (trial) {
|
if (trial) {
|
||||||
name += " (Trial)";
|
name += " (Trial)";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* synergy -- mouse and keyboard sharing utility
|
* synergy -- mouse and keyboard sharing utility
|
||||||
* Copyright (C) 2015 Synergy Seamless Inc.
|
* Copyright (C) 2015 Synergy Ltd.
|
||||||
*
|
*
|
||||||
* This package is free software; you can redistribute it and/or
|
* This package is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* synergy -- mouse and keyboard sharing utility
|
* synergy -- mouse and keyboard sharing utility
|
||||||
* Copyright (C) 2022 Synergy Seamless Inc.
|
* Copyright (C) 2022 Synergy Ltd.
|
||||||
*
|
*
|
||||||
* This package is free software; you can redistribute it and/or
|
* This package is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* synergy -- mouse and keyboard sharing utility
|
* synergy -- mouse and keyboard sharing utility
|
||||||
* Copyright (C) 2022 Synergy Seamless Inc.
|
* Copyright (C) 2022 Synergy Ltd.
|
||||||
*
|
*
|
||||||
* This package is free software; you can redistribute it and/or
|
* This package is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -85,13 +85,13 @@ static const char *synergyDefaultIconFiles[] = {
|
||||||
":/res/icons/16x16/synergy-disconnected.png" // synergyPendingRetry
|
":/res/icons/16x16/synergy-disconnected.png" // synergyPendingRetry
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
MainWindow::MainWindow(AppConfig &appConfig)
|
|
||||||
#else
|
|
||||||
MainWindow::MainWindow(AppConfig &appConfig, LicenseManager &licenseManager)
|
MainWindow::MainWindow(AppConfig &appConfig, LicenseManager &licenseManager)
|
||||||
|
#else
|
||||||
|
MainWindow::MainWindow(AppConfig &appConfig)
|
||||||
#endif
|
#endif
|
||||||
:
|
:
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
m_LicenseManager(&licenseManager), m_ActivationDialogRunning(false),
|
m_LicenseManager(&licenseManager), m_ActivationDialogRunning(false),
|
||||||
#endif
|
#endif
|
||||||
m_pZeroconf(nullptr), m_AppConfig(&appConfig), m_pSynergy(NULL),
|
m_pZeroconf(nullptr), m_AppConfig(&appConfig), m_pSynergy(NULL),
|
||||||
|
|
@ -101,7 +101,7 @@ MainWindow::MainWindow(AppConfig &appConfig, LicenseManager &licenseManager)
|
||||||
m_pMenuWindow(NULL), m_pMenuHelp(NULL), m_pCancelButton(NULL),
|
m_pMenuWindow(NULL), m_pMenuHelp(NULL), m_pCancelButton(NULL),
|
||||||
m_ExpectedRunningState(kStopped), m_SecureSocket(false),
|
m_ExpectedRunningState(kStopped), m_SecureSocket(false),
|
||||||
m_serverConnection(*this), m_clientConnection(*this) {
|
m_serverConnection(*this), m_clientConnection(*this) {
|
||||||
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
|
#ifdef SYNERGY_ENABLE_AUTO_CONFIG
|
||||||
m_pZeroconf = new Zeroconf(this);
|
m_pZeroconf = new Zeroconf(this);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -157,7 +157,7 @@ MainWindow::MainWindow(AppConfig &appConfig, LicenseManager &licenseManager)
|
||||||
|
|
||||||
connect(this, SIGNAL(windowShown()), this, SLOT(on_windowShown()),
|
connect(this, SIGNAL(windowShown()), this, SLOT(on_windowShown()),
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
connect(m_LicenseManager, SIGNAL(editionChanged(Edition)), this,
|
connect(m_LicenseManager, SIGNAL(editionChanged(Edition)), this,
|
||||||
SLOT(setEdition(Edition)), Qt::QueuedConnection);
|
SLOT(setEdition(Edition)), Qt::QueuedConnection);
|
||||||
|
|
||||||
|
|
@ -179,16 +179,17 @@ MainWindow::MainWindow(AppConfig &appConfig, LicenseManager &licenseManager)
|
||||||
QString lastVersion = m_AppConfig->lastVersion();
|
QString lastVersion = m_AppConfig->lastVersion();
|
||||||
if (lastVersion != SYNERGY_VERSION) {
|
if (lastVersion != SYNERGY_VERSION) {
|
||||||
m_AppConfig->setLastVersion(SYNERGY_VERSION);
|
m_AppConfig->setLastVersion(SYNERGY_VERSION);
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
|
||||||
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
m_LicenseManager->notifyUpdate(lastVersion, SYNERGY_VERSION);
|
m_LicenseManager->notifyUpdate(lastVersion, SYNERGY_VERSION);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SYNERGY_ENTERPRISE
|
#ifndef SYNERGY_ENABLE_LICENSING
|
||||||
m_pActivate->setVisible(false);
|
m_pActivate->setVisible(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
|
#ifdef SYNERGY_ENABLE_AUTO_CONFIG
|
||||||
updateZeroconfService();
|
updateZeroconfService();
|
||||||
|
|
||||||
addZeroconfServer(m_AppConfig->autoConfigServer());
|
addZeroconfServer(m_AppConfig->autoConfigServer());
|
||||||
|
|
@ -209,7 +210,7 @@ MainWindow::~MainWindow() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
|
#ifdef SYNERGY_ENABLE_AUTO_CONFIG
|
||||||
delete m_pZeroconf;
|
delete m_pZeroconf;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -316,7 +317,7 @@ void MainWindow::saveSettings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::zeroConfToggled() {
|
void MainWindow::zeroConfToggled() {
|
||||||
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
|
#ifdef SYNERGY_ENABLE_AUTO_CONFIG
|
||||||
updateZeroconfService();
|
updateZeroconfService();
|
||||||
|
|
||||||
addZeroconfServer(m_AppConfig->autoConfigServer());
|
addZeroconfServer(m_AppConfig->autoConfigServer());
|
||||||
|
|
@ -438,7 +439,7 @@ void MainWindow::updateFromLogLine(const QString &line) {
|
||||||
checkOSXNotification(line);
|
checkOSXNotification(line);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
checkLicense(line);
|
checkLicense(line);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -475,7 +476,7 @@ void MainWindow::checkConnected(const QString &line) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
void MainWindow::checkLicense(const QString &line) {
|
void MainWindow::checkLicense(const QString &line) {
|
||||||
if (line.contains("trial has expired")) {
|
if (line.contains("trial has expired")) {
|
||||||
licenseManager().refresh();
|
licenseManager().refresh();
|
||||||
|
|
@ -589,7 +590,7 @@ void MainWindow::startSynergy() {
|
||||||
requestOSXNotificationPermission();
|
requestOSXNotificationPermission();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
SerialKey serialKey = m_LicenseManager->serialKey();
|
SerialKey serialKey = m_LicenseManager->serialKey();
|
||||||
if (!serialKey.isValid()) {
|
if (!serialKey.isValid()) {
|
||||||
if (QDialog::Rejected == raiseActivationDialog()) {
|
if (QDialog::Rejected == raiseActivationDialog()) {
|
||||||
|
|
@ -764,7 +765,7 @@ bool MainWindow::clientArgs(QStringList &args, QString &app) {
|
||||||
args << "--invert-scroll";
|
args << "--invert-scroll";
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
|
#ifdef SYNERGY_ENABLE_AUTO_CONFIG
|
||||||
// check auto config first, if it is disabled or no server detected,
|
// check auto config first, if it is disabled or no server detected,
|
||||||
// use line edit host name if it is not empty
|
// use line edit host name if it is not empty
|
||||||
if (appConfig().autoConfig()) {
|
if (appConfig().autoConfig()) {
|
||||||
|
|
@ -784,7 +785,7 @@ bool MainWindow::clientArgs(QStringList &args, QString &app) {
|
||||||
|
|
||||||
if (m_pLineEditHostname->text().isEmpty() &&
|
if (m_pLineEditHostname->text().isEmpty() &&
|
||||||
!appConfig().getClientHostMode()) {
|
!appConfig().getClientHostMode()) {
|
||||||
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
|
#ifdef SYNERGY_ENABLE_AUTO_CONFIG
|
||||||
// check if autoconfig mode is enabled
|
// check if autoconfig mode is enabled
|
||||||
if (!appConfig().autoConfig()) {
|
if (!appConfig().autoConfig()) {
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -794,7 +795,7 @@ bool MainWindow::clientArgs(QStringList &args, QString &app) {
|
||||||
"client to connect to."));
|
"client to connect to."));
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
|
#ifdef SYNERGY_ENABLE_AUTO_CONFIG
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -917,7 +918,7 @@ bool MainWindow::serverArgs(QStringList &args, QString &app) {
|
||||||
args << "-c" << configFilename << "--address" << address();
|
args << "-c" << configFilename << "--address" << address();
|
||||||
appendLogInfo("config file: " + configFilename);
|
appendLogInfo("config file: " + configFilename);
|
||||||
|
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
if (!appConfig().serialKey().isEmpty()) {
|
if (!appConfig().serialKey().isEmpty()) {
|
||||||
args << "--serial-key" << appConfig().serialKey();
|
args << "--serial-key" << appConfig().serialKey();
|
||||||
}
|
}
|
||||||
|
|
@ -1134,12 +1135,12 @@ void MainWindow::addZeroconfServer(const QString name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::setEdition(Edition edition) {
|
void MainWindow::setEdition(Edition edition) {
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
setWindowTitle(m_LicenseManager->getEditionName(edition));
|
setWindowTitle(m_LicenseManager->getEditionName(edition));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
void MainWindow::InvalidLicense() {
|
void MainWindow::InvalidLicense() {
|
||||||
stopSynergy();
|
stopSynergy();
|
||||||
m_AppConfig->activationHasRun(false);
|
m_AppConfig->activationHasRun(false);
|
||||||
|
|
@ -1166,7 +1167,7 @@ void MainWindow::updateLocalFingerprint() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
LicenseManager &MainWindow::licenseManager() const { return *m_LicenseManager; }
|
LicenseManager &MainWindow::licenseManager() const { return *m_LicenseManager; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -1184,18 +1185,8 @@ bool MainWindow::on_m_pActionSave_triggered() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_m_pActionAbout_triggered() {
|
void MainWindow::on_m_pActionAbout_triggered() {
|
||||||
#if defined(SYNERGY_ENTERPRISE) || defined(SYNERGY_BUSINESS)
|
|
||||||
AboutDialog dlg(this, appConfig());
|
AboutDialog dlg(this, appConfig());
|
||||||
dlg.exec();
|
dlg.exec();
|
||||||
#else
|
|
||||||
if (appConfig().edition() == Edition::kBusiness) {
|
|
||||||
AboutDialog dlg(this, appConfig());
|
|
||||||
dlg.exec();
|
|
||||||
} else {
|
|
||||||
AboutDialogEliteBackers dlg(this, appConfig());
|
|
||||||
dlg.exec();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_m_pActionHelp_triggered() {
|
void MainWindow::on_m_pActionHelp_triggered() {
|
||||||
|
|
@ -1203,7 +1194,7 @@ void MainWindow::on_m_pActionHelp_triggered() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateZeroconfService() {
|
void MainWindow::updateZeroconfService() {
|
||||||
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
|
#ifdef SYNERGY_ENABLE_AUTO_CONFIG
|
||||||
|
|
||||||
// reset the server list in case one has gone away.
|
// reset the server list in case one has gone away.
|
||||||
// it'll be re-added after the zeroconf service restarts.
|
// it'll be re-added after the zeroconf service restarts.
|
||||||
|
|
@ -1228,10 +1219,13 @@ void MainWindow::updateAutoConfigWidgets() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateWindowTitle() {
|
void MainWindow::updateWindowTitle() {
|
||||||
#ifdef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
setWindowTitle("Synergy 1 Enterprise");
|
|
||||||
#else
|
|
||||||
setWindowTitle(m_LicenseManager->activeEditionName());
|
setWindowTitle(m_LicenseManager->activeEditionName());
|
||||||
|
#else
|
||||||
|
setWindowTitle(SYNERGY_PRODUCT_NAME);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
m_LicenseManager->refresh();
|
m_LicenseManager->refresh();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -1255,7 +1249,7 @@ void MainWindow::autoAddScreen(const QString name) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
if (m_ActivationDialogRunning) {
|
if (m_ActivationDialogRunning) {
|
||||||
// TODO: refactor this code
|
// TODO: refactor this code
|
||||||
// add this screen to the pending list and check this list until
|
// add this screen to the pending list and check this list until
|
||||||
|
|
@ -1283,7 +1277,7 @@ void MainWindow::autoAddScreen(const QString name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showConfigureServer(const QString &message) {
|
void MainWindow::showConfigureServer(const QString &message) {
|
||||||
ServerConfigDialog dlg(this, serverConfig());
|
ServerConfigDialog dlg(this, serverConfig(), appConfig());
|
||||||
dlg.message(message);
|
dlg.message(message);
|
||||||
auto result = dlg.exec();
|
auto result = dlg.exec();
|
||||||
|
|
||||||
|
|
@ -1301,7 +1295,7 @@ void MainWindow::on_m_pButtonConfigureServer_clicked() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_m_pActivate_triggered() {
|
void MainWindow::on_m_pActivate_triggered() {
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
raiseActivationDialog();
|
raiseActivationDialog();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -1311,7 +1305,7 @@ void MainWindow::on_m_pButtonApply_clicked() {
|
||||||
restartSynergy();
|
restartSynergy();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
int MainWindow::raiseActivationDialog() {
|
int MainWindow::raiseActivationDialog() {
|
||||||
if (m_ActivationDialogRunning) {
|
if (m_ActivationDialogRunning) {
|
||||||
return QDialog::Rejected;
|
return QDialog::Rejected;
|
||||||
|
|
@ -1332,7 +1326,7 @@ int MainWindow::raiseActivationDialog() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void MainWindow::on_windowShown() {
|
void MainWindow::on_windowShown() {
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
auto serialKey = m_LicenseManager->serialKey();
|
auto serialKey = m_LicenseManager->serialKey();
|
||||||
if (!m_AppConfig->activationHasRun() && !serialKey.isValid()) {
|
if (!m_AppConfig->activationHasRun() && !serialKey.isValid()) {
|
||||||
setEdition(Edition::kUnregistered);
|
setEdition(Edition::kUnregistered);
|
||||||
|
|
|
||||||
|
|
@ -87,10 +87,10 @@ public:
|
||||||
enum qRuningState { kStarted, kStopped };
|
enum qRuningState { kStarted, kStopped };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#ifdef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
MainWindow(AppConfig &appConfig);
|
|
||||||
#else
|
|
||||||
MainWindow(AppConfig &appConfig, LicenseManager &licenseManager);
|
MainWindow(AppConfig &appConfig, LicenseManager &licenseManager);
|
||||||
|
#else
|
||||||
|
MainWindow(AppConfig &appConfig);
|
||||||
#endif
|
#endif
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
|
|
@ -113,7 +113,7 @@ public:
|
||||||
void autoAddScreen(const QString name);
|
void autoAddScreen(const QString name);
|
||||||
void addZeroconfServer(const QString name);
|
void addZeroconfServer(const QString name);
|
||||||
Zeroconf &zeroconf() { return *m_pZeroconf; }
|
Zeroconf &zeroconf() { return *m_pZeroconf; }
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
LicenseManager &licenseManager() const;
|
LicenseManager &licenseManager() const;
|
||||||
int raiseActivationDialog();
|
int raiseActivationDialog();
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -122,7 +122,7 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setEdition(Edition edition);
|
void setEdition(Edition edition);
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
void InvalidLicense();
|
void InvalidLicense();
|
||||||
void showLicenseNotice(const QString &message);
|
void showLicenseNotice(const QString &message);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -202,7 +202,7 @@ protected:
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
void checkOSXNotification(const QString &line);
|
void checkOSXNotification(const QString &line);
|
||||||
#endif
|
#endif
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
void checkLicense(const QString &line);
|
void checkLicense(const QString &line);
|
||||||
#endif
|
#endif
|
||||||
QString getTimeStamp();
|
QString getTimeStamp();
|
||||||
|
|
@ -215,7 +215,7 @@ protected:
|
||||||
void windowStateChanged();
|
void windowStateChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
LicenseManager *m_LicenseManager;
|
LicenseManager *m_LicenseManager;
|
||||||
bool m_ActivationDialogRunning;
|
bool m_ActivationDialogRunning;
|
||||||
QStringList m_PendingClientNames;
|
QStringList m_PendingClientNames;
|
||||||
|
|
|
||||||
|
|
@ -566,7 +566,7 @@ QSettings &ServerConfig::settings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ServerConfig::isHotkeysAvailable() const {
|
bool ServerConfig::isHotkeysAvailable() const {
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
return (m_pAppConfig->edition() != Edition::kLite);
|
return (m_pAppConfig->edition() != Edition::kLite);
|
||||||
#else
|
#else
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -22,13 +22,15 @@
|
||||||
#include "ScreenSettingsDialog.h"
|
#include "ScreenSettingsDialog.h"
|
||||||
#include "ServerConfig.h"
|
#include "ServerConfig.h"
|
||||||
#include "UpgradeDialog.h"
|
#include "UpgradeDialog.h"
|
||||||
|
#include "shared/EditionType.h"
|
||||||
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
ServerConfigDialog::ServerConfigDialog(QWidget *parent, ServerConfig &config)
|
ServerConfigDialog::ServerConfigDialog(QWidget *parent, ServerConfig &config,
|
||||||
|
AppConfig &appConfig)
|
||||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||||
Ui::ServerConfigDialogBase(), m_OrigServerConfig(config),
|
Ui::ServerConfigDialogBase(), m_OrigServerConfig(config),
|
||||||
m_OrigServerAppConfigUseExternalConfig(config.getUseExternalConfig()),
|
m_OrigServerAppConfigUseExternalConfig(config.getUseExternalConfig()),
|
||||||
|
|
@ -36,7 +38,7 @@ ServerConfigDialog::ServerConfigDialog(QWidget *parent, ServerConfig &config)
|
||||||
m_ServerConfig(config),
|
m_ServerConfig(config),
|
||||||
m_ScreenSetupModel(serverConfig().screens(), serverConfig().numColumns(),
|
m_ScreenSetupModel(serverConfig().screens(), serverConfig().numColumns(),
|
||||||
serverConfig().numRows()),
|
serverConfig().numRows()),
|
||||||
m_Message("") {
|
m_Message(""), m_appConfig(appConfig) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
m_pEditConfigFile->setText(serverConfig().getConfigFile());
|
m_pEditConfigFile->setText(serverConfig().getConfigFile());
|
||||||
|
|
@ -266,10 +268,18 @@ void ServerConfigDialog::on_m_pButtonNewHotkey_clicked() {
|
||||||
onChange();
|
onChange();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
UpgradeDialog upgradeDialog(this);
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
upgradeDialog.showDialog(
|
auto edition = appConfig().edition();
|
||||||
"Configuring custom hotkeys is a Synergy Ultimate feature.",
|
if (edition == Edition::kLite || edition == Edition::kBasic) {
|
||||||
"synergy/purchase/purchase-ultimate-upgrade?source=gui");
|
UpgradeDialog upgradeDialog(this);
|
||||||
|
if (appConfig().edition() == Edition::kLite) {
|
||||||
|
upgradeDialog.showDialog(
|
||||||
|
"Upgrade to Synergy 1 Ultimate to enable hotkeys");
|
||||||
|
} else if (appConfig().edition() == Edition::kBasic) {
|
||||||
|
upgradeDialog.showDialog("Upgrade to Synergy 1 Pro to enable hotkeys");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // SYNERGY_ENABLE_LICENSING
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#define SERVERCONFIGDIALOG__H
|
#define SERVERCONFIGDIALOG__H
|
||||||
|
|
||||||
|
#include "AppConfig.h"
|
||||||
#include "ScreenSetupModel.h"
|
#include "ScreenSetupModel.h"
|
||||||
#include "ServerConfig.h"
|
#include "ServerConfig.h"
|
||||||
|
|
||||||
|
|
@ -31,7 +32,8 @@ class ServerConfigDialog : public QDialog, public Ui::ServerConfigDialogBase {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ServerConfigDialog(QWidget *parent, ServerConfig &config);
|
ServerConfigDialog(QWidget *parent, ServerConfig &config,
|
||||||
|
AppConfig &appConfig);
|
||||||
bool addClient(const QString &clientName);
|
bool addClient(const QString &clientName);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
@ -61,6 +63,7 @@ protected:
|
||||||
ServerConfig &serverConfig() { return m_ServerConfig; }
|
ServerConfig &serverConfig() { return m_ServerConfig; }
|
||||||
void setOrigServerConfig(const ServerConfig &s) { m_OrigServerConfig = s; }
|
void setOrigServerConfig(const ServerConfig &s) { m_OrigServerConfig = s; }
|
||||||
ScreenSetupModel &model() { return m_ScreenSetupModel; }
|
ScreenSetupModel &model() { return m_ScreenSetupModel; }
|
||||||
|
AppConfig &appConfig() { return m_appConfig; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ServerConfig &m_OrigServerConfig;
|
ServerConfig &m_OrigServerConfig;
|
||||||
|
|
@ -69,6 +72,7 @@ private:
|
||||||
ServerConfig m_ServerConfig;
|
ServerConfig m_ServerConfig;
|
||||||
ScreenSetupModel m_ScreenSetupModel;
|
ScreenSetupModel m_ScreenSetupModel;
|
||||||
QString m_Message;
|
QString m_Message;
|
||||||
|
AppConfig &m_appConfig;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onChange();
|
void onChange();
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#include "ServerConnection.h"
|
#include "ServerConnection.h"
|
||||||
|
|
||||||
|
#include "AppConfig.h"
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "ServerConfigDialog.h"
|
#include "ServerConfigDialog.h"
|
||||||
#include "ServerMessage.h"
|
#include "ServerMessage.h"
|
||||||
|
|
@ -68,7 +69,8 @@ void ServerConnection::addClient(const QString &clientName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerConnection::configureClient(const QString &clientName) {
|
void ServerConnection::configureClient(const QString &clientName) {
|
||||||
ServerConfigDialog dlg(&m_parent, m_parent.serverConfig());
|
ServerConfigDialog dlg(&m_parent, m_parent.serverConfig(),
|
||||||
|
m_parent.appConfig());
|
||||||
|
|
||||||
if (dlg.addClient(clientName) && dlg.exec() == QDialog::Accepted) {
|
if (dlg.addClient(clientName) && dlg.exec() == QDialog::Accepted) {
|
||||||
m_parent.restartSynergy();
|
m_parent.restartSynergy();
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@ void SettingsDialog::loadFromConfig() {
|
||||||
allowAutoConfig();
|
allowAutoConfig();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
|
#ifdef SYNERGY_ENABLE_AUTO_CONFIG
|
||||||
m_pCheckBoxAutoConfig->setChecked(appConfig().autoConfig());
|
m_pCheckBoxAutoConfig->setChecked(appConfig().autoConfig());
|
||||||
#else
|
#else
|
||||||
m_pCheckBoxAutoConfig->hide();
|
m_pCheckBoxAutoConfig->hide();
|
||||||
|
|
@ -274,17 +274,20 @@ void SettingsDialog::on_m_pCheckBoxEnableCrypto_clicked(bool checked) {
|
||||||
buttonBox->button(QDialogButtonBox::Save)->setEnabled(isModified());
|
buttonBox->button(QDialogButtonBox::Save)->setEnabled(isModified());
|
||||||
} else {
|
} else {
|
||||||
m_pCheckBoxEnableCrypto->setChecked(false);
|
m_pCheckBoxEnableCrypto->setChecked(false);
|
||||||
#if !defined(SYNERGY_ENTERPRISE) && !defined(SYNERGY_BUSINESS)
|
|
||||||
UpgradeDialog upgradeDialog(this);
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
if (appConfig().edition() == Edition::kLite) {
|
auto edition = appConfig().edition();
|
||||||
upgradeDialog.showDialog(
|
if (edition == Edition::kLite || edition == Edition::kBasic) {
|
||||||
"TLS encryption is a Synergy Ultimate feature.",
|
UpgradeDialog upgradeDialog(this);
|
||||||
"synergy/purchase/purchase-ultimate-upgrade?source=gui");
|
if (appConfig().edition() == Edition::kLite) {
|
||||||
} else {
|
upgradeDialog.showDialog(
|
||||||
upgradeDialog.showDialog("TLS encryption is a Synergy Pro feature.",
|
"Upgrade to Synergy Ultimate to enable TLS encryption.");
|
||||||
"synergy/purchase/upgrade?source=gui");
|
} else if (appConfig().edition() == Edition::kBasic) {
|
||||||
|
upgradeDialog.showDialog(
|
||||||
|
"Upgrade to Synergy Pro to enable TLS encryption.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif // SYNERGY_ENABLE_LICENSING
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@ UpgradeDialog::UpgradeDialog(QWidget *parent) : QMessageBox(parent) {
|
||||||
addButton(QObject::tr("Upgrade"), QMessageBox::AcceptRole);
|
addButton(QObject::tr("Upgrade"), QMessageBox::AcceptRole);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpgradeDialog::showDialog(const QString &text, const QString &link) {
|
void UpgradeDialog::showDialog(const QString &text) {
|
||||||
setText(QObject::tr(text.toStdString().c_str()));
|
setText(QObject::tr(text.toStdString().c_str()));
|
||||||
|
|
||||||
if (exec() == QMessageBox::Accepted) {
|
if (exec() == QMessageBox::Accepted) {
|
||||||
QDesktopServices::openUrl(
|
QDesktopServices::openUrl(QUrl(QCoreApplication::organizationDomain() +
|
||||||
QUrl(QCoreApplication::organizationDomain() + link));
|
"/synergy/purchase/upgrade?source=gui"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,5 +20,5 @@
|
||||||
class UpgradeDialog : public QMessageBox {
|
class UpgradeDialog : public QMessageBox {
|
||||||
public:
|
public:
|
||||||
explicit UpgradeDialog(QWidget *parent = nullptr);
|
explicit UpgradeDialog(QWidget *parent = nullptr);
|
||||||
void showDialog(const QString &text, const QString &link);
|
void showDialog(const QString &text);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -83,16 +83,16 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
AppConfig appConfig;
|
AppConfig appConfig;
|
||||||
qRegisterMetaType<Edition>("Edition");
|
qRegisterMetaType<Edition>("Edition");
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
LicenseManager licenseManager(&appConfig);
|
LicenseManager licenseManager(&appConfig);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
app.switchTranslator(appConfig.language());
|
app.switchTranslator(appConfig.language());
|
||||||
|
|
||||||
#ifdef SYNERGY_ENTERPRISE
|
#ifdef SYNERGY_ENABLE_LICENSING
|
||||||
MainWindow mainWindow(appConfig);
|
|
||||||
#else
|
|
||||||
MainWindow mainWindow(appConfig, licenseManager);
|
MainWindow mainWindow(appConfig, licenseManager);
|
||||||
|
#else
|
||||||
|
MainWindow mainWindow(appConfig);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QObject::connect(dynamic_cast<QObject *>(&app), SIGNAL(aboutToQuit()),
|
QObject::connect(dynamic_cast<QObject *>(&app), SIGNAL(aboutToQuit()),
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* synergy -- mouse and keyboard sharing utility
|
* synergy -- mouse and keyboard sharing utility
|
||||||
* Copyright (C) 2015-2016 Symless Ltd.
|
* Copyright (C) 2015 Symless Ltd.
|
||||||
*
|
*
|
||||||
* This package is free software; you can redistribute it and/or
|
* This package is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -23,11 +23,11 @@
|
||||||
enum Edition {
|
enum Edition {
|
||||||
kBasic,
|
kBasic,
|
||||||
kPro,
|
kPro,
|
||||||
Trial_DO_NOT_USE_OR_THERE_WILL_BE_PAIN,
|
kValueNotUsed,
|
||||||
kUnregistered,
|
kUnregistered,
|
||||||
kBusiness,
|
kBusiness,
|
||||||
kBasic_China,
|
kBasicChina,
|
||||||
kPro_China,
|
kProChina,
|
||||||
kLite,
|
kLite,
|
||||||
kUltimate
|
kUltimate
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "SerialKeyEdition.h"
|
#include "SerialKeyEdition.h"
|
||||||
|
|
|
||||||
|
|
@ -1,133 +1,126 @@
|
||||||
#include <algorithm>
|
/*
|
||||||
|
* synergy -- mouse and keyboard sharing utility
|
||||||
|
* Copyright (C) 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 <map>
|
#include <map>
|
||||||
|
|
||||||
#include "SerialKeyEdition.h"
|
#include "SerialKeyEdition.h"
|
||||||
|
|
||||||
const std::string SerialKeyEdition::PRO = "pro";
|
const std::string SerialKeyEdition::Pro = "pro";
|
||||||
const std::string SerialKeyEdition::PRO_CHINA = "pro_china";
|
const std::string SerialKeyEdition::ProChina = "pro_china";
|
||||||
const std::string SerialKeyEdition::BASIC = "basic";
|
const std::string SerialKeyEdition::Basic = "basic";
|
||||||
const std::string SerialKeyEdition::BASIC_CHINA = "basic_china";
|
const std::string SerialKeyEdition::BasicChina = "basic_china";
|
||||||
const std::string SerialKeyEdition::BUSINESS = "business";
|
const std::string SerialKeyEdition::Buisiness = "business";
|
||||||
const std::string SerialKeyEdition::UNREGISTERED = "unregistered";
|
const std::string SerialKeyEdition::Unregistered = "community";
|
||||||
const std::string SerialKeyEdition::ULTIMATE = "ultimate";
|
const std::string SerialKeyEdition::Ultimate = "ultimate";
|
||||||
const std::string SerialKeyEdition::LITE = "lite";
|
const std::string SerialKeyEdition::Lite = "lite";
|
||||||
|
|
||||||
namespace {
|
const std::map<std::string, Edition, std::less<>> serialTypes{
|
||||||
|
{SerialKeyEdition::Basic, kBasic},
|
||||||
|
{SerialKeyEdition::Pro, kPro},
|
||||||
|
{SerialKeyEdition::BasicChina, kBasicChina},
|
||||||
|
{SerialKeyEdition::ProChina, kProChina},
|
||||||
|
{SerialKeyEdition::Buisiness, kBusiness},
|
||||||
|
{SerialKeyEdition::Lite, kLite},
|
||||||
|
{SerialKeyEdition::Ultimate, kUltimate}};
|
||||||
|
|
||||||
const std::map<std::string, Edition> &getSerialTypes() {
|
SerialKeyEdition::SerialKeyEdition(Edition type) : m_type(type) {}
|
||||||
#ifdef SYNERGY_BUSINESS
|
|
||||||
static const std::map<std::string, Edition> serialTypes = {
|
|
||||||
{SerialKeyEdition::BUSINESS, kBusiness}};
|
|
||||||
#else
|
|
||||||
static const std::map<std::string, Edition> serialTypes{
|
|
||||||
{SerialKeyEdition::BASIC, kBasic},
|
|
||||||
{SerialKeyEdition::PRO, kPro},
|
|
||||||
{SerialKeyEdition::BASIC_CHINA, kBasic_China},
|
|
||||||
{SerialKeyEdition::PRO_CHINA, kPro_China},
|
|
||||||
{SerialKeyEdition::BUSINESS, kBusiness},
|
|
||||||
{SerialKeyEdition::LITE, kLite},
|
|
||||||
{SerialKeyEdition::ULTIMATE, kUltimate}};
|
|
||||||
#endif
|
|
||||||
return serialTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
SerialKeyEdition::SerialKeyEdition() {}
|
|
||||||
|
|
||||||
SerialKeyEdition::SerialKeyEdition(Edition type) : m_Type(type) {}
|
|
||||||
|
|
||||||
SerialKeyEdition::SerialKeyEdition(const std::string &type) { setType(type); }
|
SerialKeyEdition::SerialKeyEdition(const std::string &type) { setType(type); }
|
||||||
|
|
||||||
Edition SerialKeyEdition::getType() const { return m_Type; }
|
Edition SerialKeyEdition::getType() const { return m_type; }
|
||||||
|
|
||||||
std::string SerialKeyEdition::getName() const {
|
std::string SerialKeyEdition::getName() const {
|
||||||
std::string Name;
|
|
||||||
|
|
||||||
switch (getType()) {
|
switch (getType()) {
|
||||||
case kPro:
|
|
||||||
Name = PRO;
|
|
||||||
break;
|
|
||||||
case kBasic:
|
|
||||||
Name = BASIC;
|
|
||||||
break;
|
|
||||||
case kBusiness:
|
|
||||||
Name = BUSINESS;
|
|
||||||
break;
|
|
||||||
case kUnregistered:
|
|
||||||
Name = UNREGISTERED;
|
|
||||||
break;
|
|
||||||
case kBasic_China:
|
|
||||||
Name = BASIC_CHINA;
|
|
||||||
break;
|
|
||||||
case kPro_China:
|
|
||||||
Name = PRO_CHINA;
|
|
||||||
break;
|
|
||||||
case kLite:
|
case kLite:
|
||||||
Name = LITE;
|
return Lite;
|
||||||
break;
|
|
||||||
case kUltimate:
|
|
||||||
Name = ULTIMATE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Name;
|
case kUltimate:
|
||||||
|
return Ultimate;
|
||||||
|
|
||||||
|
case kPro:
|
||||||
|
return Pro;
|
||||||
|
|
||||||
|
case kBasic:
|
||||||
|
return Basic;
|
||||||
|
|
||||||
|
case kBusiness:
|
||||||
|
return Buisiness;
|
||||||
|
|
||||||
|
case kBasicChina:
|
||||||
|
return BasicChina;
|
||||||
|
|
||||||
|
case kProChina:
|
||||||
|
return ProChina;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return Unregistered;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string SerialKeyEdition::getDisplayName() const {
|
std::string SerialKeyEdition::getProductName() const {
|
||||||
const std::string ApplicationName = "Synergy 1 ";
|
const std::string nameBase = "Synergy 1";
|
||||||
std::string DisplayName(ApplicationName);
|
|
||||||
|
|
||||||
switch (getType()) {
|
switch (getType()) {
|
||||||
case kBasic_China:
|
|
||||||
DisplayName = "Synergy 中文版";
|
|
||||||
break;
|
|
||||||
case kPro_China:
|
|
||||||
DisplayName = "Synergy Pro 中文版";
|
|
||||||
break;
|
|
||||||
case kLite:
|
|
||||||
DisplayName = "Synergy 1";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
std::string EditionName = getName();
|
|
||||||
if (!EditionName.empty()) {
|
|
||||||
if (EditionName == UNREGISTERED) {
|
|
||||||
std::transform(EditionName.begin(), EditionName.end(),
|
|
||||||
EditionName.begin(), ::toupper);
|
|
||||||
EditionName = "(" + EditionName + ")";
|
|
||||||
} else {
|
|
||||||
EditionName[0] = static_cast<char>(::toupper(EditionName[0]));
|
|
||||||
}
|
|
||||||
DisplayName = ApplicationName + EditionName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return DisplayName;
|
case kLite:
|
||||||
|
return nameBase;
|
||||||
|
|
||||||
|
case kUltimate:
|
||||||
|
return nameBase + " Ultimate";
|
||||||
|
|
||||||
|
case kPro:
|
||||||
|
return nameBase + " Pro";
|
||||||
|
|
||||||
|
case kBasic:
|
||||||
|
return nameBase + " Basic";
|
||||||
|
|
||||||
|
case kBusiness:
|
||||||
|
return nameBase + " Business";
|
||||||
|
|
||||||
|
case kBasicChina:
|
||||||
|
return nameBase + " 中文版";
|
||||||
|
|
||||||
|
case kProChina:
|
||||||
|
return nameBase + " Pro 中文版";
|
||||||
|
|
||||||
|
default:
|
||||||
|
return nameBase + " (Unregistered)";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SerialKeyEdition::setType(Edition type) {
|
void SerialKeyEdition::setType(Edition type) {
|
||||||
m_Type = type;
|
m_type = type;
|
||||||
setType(getName());
|
setType(getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SerialKeyEdition::setType(const std::string &type) {
|
void SerialKeyEdition::setType(const std::string &name) {
|
||||||
auto types = getSerialTypes();
|
const auto &pType = serialTypes.find(name);
|
||||||
const auto &pType = types.find(type);
|
|
||||||
|
|
||||||
if (pType != types.end()) {
|
if (pType != serialTypes.end()) {
|
||||||
m_Type = pType->second;
|
m_type = pType->second;
|
||||||
} else {
|
} else {
|
||||||
m_Type = kUnregistered;
|
m_type = kUnregistered;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SerialKeyEdition::isValid() const {
|
bool SerialKeyEdition::isValid() const {
|
||||||
auto types = getSerialTypes();
|
return serialTypes.contains(getName());
|
||||||
return (types.find(getName()) != types.end());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SerialKeyEdition::isChina() const {
|
bool SerialKeyEdition::isChina() const {
|
||||||
return ((m_Type == kBasic_China) || (m_Type == kPro_China));
|
return ((m_type == kBasicChina) || (m_type == kProChina));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,22 +14,24 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "EditionType.h"
|
#include "EditionType.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class SerialKeyEdition {
|
class SerialKeyEdition {
|
||||||
friend bool operator==(SerialKeyEdition const &, SerialKeyEdition const &);
|
friend bool operator==(SerialKeyEdition const &,
|
||||||
|
SerialKeyEdition const &) = default;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SerialKeyEdition();
|
SerialKeyEdition() = default;
|
||||||
explicit SerialKeyEdition(Edition type);
|
explicit SerialKeyEdition(Edition type);
|
||||||
explicit SerialKeyEdition(const std::string &type);
|
explicit SerialKeyEdition(const std::string &name);
|
||||||
|
|
||||||
Edition getType() const;
|
Edition getType() const;
|
||||||
std::string getName() const;
|
std::string getName() const;
|
||||||
std::string getDisplayName() const;
|
std::string getProductName() const;
|
||||||
|
|
||||||
void setType(Edition type);
|
void setType(Edition type);
|
||||||
void setType(const std::string &type);
|
void setType(const std::string &type);
|
||||||
|
|
@ -37,25 +39,15 @@ public:
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
bool isChina() const;
|
bool isChina() const;
|
||||||
|
|
||||||
static const std::string PRO;
|
static const std::string Pro;
|
||||||
static const std::string PRO_CHINA;
|
static const std::string ProChina;
|
||||||
static const std::string BASIC;
|
static const std::string Basic;
|
||||||
static const std::string BASIC_CHINA;
|
static const std::string BasicChina;
|
||||||
static const std::string BUSINESS;
|
static const std::string Buisiness;
|
||||||
static const std::string UNREGISTERED;
|
static const std::string Unregistered;
|
||||||
static const std::string ULTIMATE;
|
static const std::string Ultimate;
|
||||||
static const std::string LITE;
|
static const std::string Lite;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Edition m_Type = kUnregistered;
|
Edition m_type = kUnregistered;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool operator==(SerialKeyEdition const &lhs,
|
|
||||||
SerialKeyEdition const &rhs) {
|
|
||||||
return (lhs.m_Type == rhs.m_Type);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool operator!=(SerialKeyEdition const &lhs,
|
|
||||||
SerialKeyEdition const &rhs) {
|
|
||||||
return !(lhs == rhs);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* synergy -- mouse and keyboard sharing utility
|
* synergy -- mouse and keyboard sharing utility
|
||||||
* Copyright (C) 2015 Synergy Seamless Inc.
|
* Copyright (C) 2015 Synergy Ltd.
|
||||||
*
|
*
|
||||||
* This package is free software; you can redistribute it and/or
|
* This package is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -17,16 +17,16 @@
|
||||||
|
|
||||||
#include "SerialKeyType.h"
|
#include "SerialKeyType.h"
|
||||||
|
|
||||||
const std::string SerialKeyType::TRIAL = "trial";
|
const std::string SerialKeyType::Trial = "trial";
|
||||||
const std::string SerialKeyType::SUBSCRIPTION = "subscription";
|
const std::string SerialKeyType::Subscription = "subscription";
|
||||||
const std::string SerialKeyType::MAINTENANCE = "maintenance";
|
const std::string SerialKeyType::Maintenance = "maintenance";
|
||||||
|
|
||||||
SerialKeyType::SerialKeyType() {}
|
SerialKeyType::SerialKeyType() {}
|
||||||
|
|
||||||
void SerialKeyType::setKeyType(const std::string &Type) {
|
void SerialKeyType::setKeyType(const std::string &Type) {
|
||||||
m_isTrial = (Type == SerialKeyType::TRIAL);
|
m_isTrial = (Type == SerialKeyType::Trial);
|
||||||
m_isTemporary = (m_isTrial || (Type == SerialKeyType::SUBSCRIPTION));
|
m_isTemporary = (m_isTrial || (Type == SerialKeyType::Subscription));
|
||||||
m_isMaintenance = (Type == SerialKeyType::MAINTENANCE);
|
m_isMaintenance = (Type == SerialKeyType::Maintenance);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SerialKeyType::isTrial() const { return m_isTrial; }
|
bool SerialKeyType::isTrial() const { return m_isTrial; }
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
@ -23,13 +24,13 @@ private:
|
||||||
friend bool operator==(SerialKeyType const &, SerialKeyType const &);
|
friend bool operator==(SerialKeyType const &, SerialKeyType const &);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const std::string TRIAL;
|
static const std::string Trial;
|
||||||
static const std::string SUBSCRIPTION;
|
static const std::string Subscription;
|
||||||
static const std::string MAINTENANCE;
|
static const std::string Maintenance;
|
||||||
|
|
||||||
SerialKeyType();
|
SerialKeyType();
|
||||||
|
|
||||||
void setKeyType(const std::string &Type);
|
void setKeyType(const std::string &type);
|
||||||
bool isTrial() const;
|
bool isTrial() const;
|
||||||
bool isTemporary() const;
|
bool isTemporary() const;
|
||||||
bool isMaintenance() const;
|
bool isMaintenance() const;
|
||||||
|
|
|
||||||
|
|
@ -16,15 +16,22 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "base/Path.h"
|
#include "base/Path.h"
|
||||||
|
#include <filesystem>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include "test/global/gtest.h"
|
#include "test/global/gtest.h"
|
||||||
|
|
||||||
|
const std::string testDir = "tmp/test";
|
||||||
|
const std::wstring testDirW = L"tmp/test";
|
||||||
|
|
||||||
TEST(PathTests, open_file_using_path) {
|
TEST(PathTests, open_file_using_path) {
|
||||||
std::string utf8FileName = "тіás.txt";
|
std::filesystem::create_directories(testDir);
|
||||||
|
|
||||||
|
std::string utf8FileName = testDir + "/тіás.txt";
|
||||||
#if SYSAPI_WIN32
|
#if SYSAPI_WIN32
|
||||||
// Windows uses UTF-16 for file path and names
|
// Windows uses UTF-16 for file path and names
|
||||||
std::wstring fileName = L"\x0442\x0456\x00E1\x0073\x002E\x0074\x0078\x0074";
|
std::wstring fileName =
|
||||||
|
testDirW + L"/\x0442\x0456\x00E1\x0073\x002E\x0074\x0078\x0074";
|
||||||
#else
|
#else
|
||||||
std::string fileName = utf8FileName;
|
std::string fileName = utf8FileName;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* synergy -- mouse and keyboard sharing utility
|
* synergy -- mouse and keyboard sharing utility
|
||||||
* Copyright (C) 2016 Symless Inc.
|
* Copyright (C) 2016 Symless Ltd.
|
||||||
*
|
*
|
||||||
* This package is free software; you can redistribute it and/or
|
* This package is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -15,85 +15,119 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "shared/EditionType.h"
|
||||||
#define TEST_ENV
|
#define TEST_ENV
|
||||||
|
|
||||||
#include "shared/SerialKeyEdition.h"
|
#include "shared/SerialKeyEdition.h"
|
||||||
#include "test/global/gtest.h"
|
#include "test/global/gtest.h"
|
||||||
|
|
||||||
TEST(SerialKeyEditionTests, DefaultEditionType_Unregistered) {
|
TEST(SerialKeyEditionTests, equal_operator) {
|
||||||
|
SerialKeyEdition edition1(kPro);
|
||||||
|
SerialKeyEdition edition2(kPro);
|
||||||
|
|
||||||
|
EXPECT_EQ(edition1, edition2);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(SerialKeyEditionTests, ctor_default_unregistered) {
|
||||||
SerialKeyEdition edition;
|
SerialKeyEdition edition;
|
||||||
|
|
||||||
EXPECT_EQ(kUnregistered, edition.getType());
|
EXPECT_EQ(kUnregistered, edition.getType());
|
||||||
EXPECT_EQ(SerialKeyEdition::UNREGISTERED, edition.getName());
|
EXPECT_EQ(SerialKeyEdition::Unregistered, edition.getName());
|
||||||
EXPECT_EQ("Synergy 1 (UNREGISTERED)", edition.getDisplayName());
|
EXPECT_EQ("Synergy 1 (Unregistered)", edition.getProductName());
|
||||||
EXPECT_FALSE(edition.isValid());
|
EXPECT_FALSE(edition.isValid());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(SerialKeyEditionTests, SetEditionType_edition) {
|
TEST(SerialKeyEditionTests, ctor_businessName_isValid) {
|
||||||
|
SerialKeyEdition edition(SerialKeyEdition::Buisiness);
|
||||||
|
|
||||||
|
EXPECT_EQ(kBusiness, edition.getType());
|
||||||
|
EXPECT_TRUE(edition.isValid());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(SerialKeyEditionTests, ctor_basicType_isValid) {
|
||||||
|
SerialKeyEdition edition(kBasic);
|
||||||
|
|
||||||
|
EXPECT_TRUE(edition.isValid());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(SerialKeyEditionTests, setType_invalidType_unregistered) {
|
||||||
SerialKeyEdition edition;
|
SerialKeyEdition edition;
|
||||||
|
|
||||||
|
edition.setType("stub");
|
||||||
|
|
||||||
|
EXPECT_EQ(kUnregistered, edition.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(SerialKeyEditionTests, setType_lite_isValid) {
|
||||||
|
SerialKeyEdition edition;
|
||||||
|
|
||||||
|
edition.setType(kLite);
|
||||||
|
|
||||||
|
EXPECT_EQ(kLite, edition.getType());
|
||||||
|
EXPECT_EQ(SerialKeyEdition::Lite, edition.getName());
|
||||||
|
EXPECT_EQ("Synergy 1", edition.getProductName());
|
||||||
|
EXPECT_TRUE(edition.isValid());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(SerialKeyEditionTests, setType_ultimate_isValid) {
|
||||||
|
SerialKeyEdition edition;
|
||||||
|
|
||||||
|
edition.setType(SerialKeyEdition::Ultimate);
|
||||||
|
|
||||||
|
EXPECT_EQ(kUltimate, edition.getType());
|
||||||
|
EXPECT_EQ(SerialKeyEdition::Ultimate, edition.getName());
|
||||||
|
EXPECT_EQ("Synergy 1 Ultimate", edition.getProductName());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(SerialKeyEditionTests, setType_pro_isValid) {
|
||||||
|
SerialKeyEdition edition;
|
||||||
|
|
||||||
edition.setType(kPro);
|
edition.setType(kPro);
|
||||||
|
|
||||||
EXPECT_EQ(kPro, edition.getType());
|
EXPECT_EQ(kPro, edition.getType());
|
||||||
EXPECT_EQ(SerialKeyEdition::PRO, edition.getName());
|
EXPECT_EQ(SerialKeyEdition::Pro, edition.getName());
|
||||||
EXPECT_EQ("Synergy 1 Pro", edition.getDisplayName());
|
EXPECT_EQ("Synergy 1 Pro", edition.getProductName());
|
||||||
EXPECT_TRUE(edition.isValid());
|
EXPECT_TRUE(edition.isValid());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(SerialKeyEditionTests, SetEditionType_string) {
|
TEST(SerialKeyEditionTests, setType_basic_isValid) {
|
||||||
SerialKeyEdition edition;
|
SerialKeyEdition edition;
|
||||||
edition.setType(SerialKeyEdition::BASIC);
|
|
||||||
|
edition.setType(kBasic);
|
||||||
|
|
||||||
EXPECT_EQ(kBasic, edition.getType());
|
EXPECT_EQ(kBasic, edition.getType());
|
||||||
EXPECT_EQ(SerialKeyEdition::BASIC, edition.getName());
|
EXPECT_EQ(SerialKeyEdition::Basic, edition.getName());
|
||||||
EXPECT_EQ("Synergy 1 Basic", edition.getDisplayName());
|
EXPECT_EQ("Synergy 1 Basic", edition.getProductName());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(SerialKeyEditionTests, SetEditionBusiness) {
|
TEST(SerialKeyEditionTests, setType_business_isValid) {
|
||||||
SerialKeyEdition edition;
|
SerialKeyEdition edition;
|
||||||
|
|
||||||
edition.setType(kBusiness);
|
edition.setType(kBusiness);
|
||||||
|
|
||||||
EXPECT_EQ(kBusiness, edition.getType());
|
EXPECT_EQ(kBusiness, edition.getType());
|
||||||
EXPECT_EQ(SerialKeyEdition::BUSINESS, edition.getName());
|
EXPECT_EQ(SerialKeyEdition::Buisiness, edition.getName());
|
||||||
EXPECT_EQ("Synergy 1 Business", edition.getDisplayName());
|
EXPECT_EQ("Synergy 1 Business", edition.getProductName());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(SerialKeyEditionTests, SetEditionBasicChina) {
|
TEST(SerialKeyEditionTests, setType_basicChina_isValid) {
|
||||||
SerialKeyEdition edition;
|
SerialKeyEdition edition;
|
||||||
edition.setType(kBasic_China);
|
|
||||||
EXPECT_EQ(kBasic_China, edition.getType());
|
edition.setType(kBasicChina);
|
||||||
EXPECT_EQ(SerialKeyEdition::BASIC_CHINA, edition.getName());
|
|
||||||
EXPECT_EQ("Synergy 中文版", edition.getDisplayName());
|
EXPECT_EQ(kBasicChina, edition.getType());
|
||||||
|
EXPECT_EQ(SerialKeyEdition::BasicChina, edition.getName());
|
||||||
|
EXPECT_EQ("Synergy 1 中文版", edition.getProductName());
|
||||||
EXPECT_TRUE(edition.isChina());
|
EXPECT_TRUE(edition.isChina());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(SerialKeyEditionTests, SetEditionProChina) {
|
TEST(SerialKeyEditionTests, setType_proChina_isValid) {
|
||||||
SerialKeyEdition edition;
|
SerialKeyEdition edition;
|
||||||
edition.setType(kPro_China);
|
|
||||||
EXPECT_EQ(kPro_China, edition.getType());
|
edition.setType(kProChina);
|
||||||
EXPECT_EQ(SerialKeyEdition::PRO_CHINA, edition.getName());
|
|
||||||
EXPECT_EQ("Synergy Pro 中文版", edition.getDisplayName());
|
EXPECT_EQ(kProChina, edition.getType());
|
||||||
|
EXPECT_EQ(SerialKeyEdition::ProChina, edition.getName());
|
||||||
|
EXPECT_EQ("Synergy 1 Pro 中文版", edition.getProductName());
|
||||||
EXPECT_TRUE(edition.isChina());
|
EXPECT_TRUE(edition.isChina());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(SerialKeyEditionTests, NameConstructor) {
|
|
||||||
SerialKeyEdition edition(SerialKeyEdition::BUSINESS);
|
|
||||||
EXPECT_EQ(kBusiness, edition.getType());
|
|
||||||
EXPECT_TRUE(edition.isValid());
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(SerialKeyEditionTests, isValid) {
|
|
||||||
SerialKeyEdition edition;
|
|
||||||
edition.setType(Edition::kBasic);
|
|
||||||
EXPECT_TRUE(edition.isValid());
|
|
||||||
|
|
||||||
edition.setType(Edition::kBasic_China);
|
|
||||||
EXPECT_TRUE(edition.isValid());
|
|
||||||
|
|
||||||
edition.setType(Edition::kBusiness);
|
|
||||||
EXPECT_TRUE(edition.isValid());
|
|
||||||
|
|
||||||
edition.setType(Edition::kPro);
|
|
||||||
EXPECT_TRUE(edition.isValid());
|
|
||||||
|
|
||||||
edition.setType(Edition::kPro_China);
|
|
||||||
EXPECT_TRUE(edition.isValid());
|
|
||||||
|
|
||||||
edition.setType(Edition::kUnregistered);
|
|
||||||
EXPECT_FALSE(edition.isValid());
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* synergy -- mouse and keyboard sharing utility
|
* synergy -- mouse and keyboard sharing utility
|
||||||
* Copyright (C) 2016 Symless Inc.
|
* Copyright (C) 2016 Symless Ltd.
|
||||||
*
|
*
|
||||||
* This package is free software; you can redistribute it and/or
|
* This package is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* synergy -- mouse and keyboard sharing utility
|
* synergy -- mouse and keyboard sharing utility
|
||||||
* Copyright (C) 2016 Symless Inc.
|
* Copyright (C) 2016 Symless Ltd.
|
||||||
*
|
*
|
||||||
* This package is free software; you can redistribute it and/or
|
* This package is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,19 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <gtest/gtest.h>
|
||||||
#if WINAPI_XWINDOWS
|
#if WINAPI_XWINDOWS
|
||||||
#include "synergy/unix/X11LayoutsParser.h"
|
#include "synergy/unix/X11LayoutsParser.h"
|
||||||
#include "test/global/gtest.h"
|
#include "test/global/gtest.h"
|
||||||
|
#include <filesystem>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
const std::string testDir = "tmp/test";
|
||||||
|
|
||||||
void createTestFiles() {
|
void createTestFiles() {
|
||||||
std::ofstream correctEvdevFile("correctEvdev.xml");
|
std::filesystem::create_directories(testDir);
|
||||||
|
|
||||||
|
std::ofstream correctEvdevFile(testDir + "/correctEvdev.xml");
|
||||||
if (!correctEvdevFile.is_open()) {
|
if (!correctEvdevFile.is_open()) {
|
||||||
FAIL();
|
FAIL();
|
||||||
}
|
}
|
||||||
|
|
@ -74,7 +80,7 @@ void createTestFiles() {
|
||||||
correctEvdevFile << "</xkbConfigRegistry>" << std::endl;
|
correctEvdevFile << "</xkbConfigRegistry>" << std::endl;
|
||||||
correctEvdevFile.close();
|
correctEvdevFile.close();
|
||||||
|
|
||||||
std::ofstream evdevFromFutureFile("evdevFromFuture.xml");
|
std::ofstream evdevFromFutureFile(testDir + "/evdevFromFuture.xml");
|
||||||
if (!evdevFromFutureFile.is_open()) {
|
if (!evdevFromFutureFile.is_open()) {
|
||||||
FAIL();
|
FAIL();
|
||||||
}
|
}
|
||||||
|
|
@ -95,7 +101,7 @@ void createTestFiles() {
|
||||||
evdevFromFutureFile << "</xkbConfigRegistry>" << std::endl;
|
evdevFromFutureFile << "</xkbConfigRegistry>" << std::endl;
|
||||||
evdevFromFutureFile.close();
|
evdevFromFutureFile.close();
|
||||||
|
|
||||||
std::ofstream incorrectEvdevFile1("incorrectEvdev1.xml");
|
std::ofstream incorrectEvdevFile1(testDir + "/incorrectEvdev1.xml");
|
||||||
if (!incorrectEvdevFile1.is_open()) {
|
if (!incorrectEvdevFile1.is_open()) {
|
||||||
FAIL();
|
FAIL();
|
||||||
}
|
}
|
||||||
|
|
@ -103,7 +109,7 @@ void createTestFiles() {
|
||||||
incorrectEvdevFile1 << "<incorrectRootTag></incorrectRootTag>" << std::endl;
|
incorrectEvdevFile1 << "<incorrectRootTag></incorrectRootTag>" << std::endl;
|
||||||
incorrectEvdevFile1.close();
|
incorrectEvdevFile1.close();
|
||||||
|
|
||||||
std::ofstream incorrectEvdevFile2("incorrectEvdev2.xml");
|
std::ofstream incorrectEvdevFile2(testDir + "/incorrectEvdev2.xml");
|
||||||
if (!incorrectEvdevFile2.is_open()) {
|
if (!incorrectEvdevFile2.is_open()) {
|
||||||
FAIL();
|
FAIL();
|
||||||
}
|
}
|
||||||
|
|
@ -114,7 +120,7 @@ void createTestFiles() {
|
||||||
incorrectEvdevFile2 << "</xkbConfigRegistry>" << std::endl;
|
incorrectEvdevFile2 << "</xkbConfigRegistry>" << std::endl;
|
||||||
incorrectEvdevFile2.close();
|
incorrectEvdevFile2.close();
|
||||||
|
|
||||||
std::ofstream incorrectEvdevFile3("incorrectEvdev3.xml");
|
std::ofstream incorrectEvdevFile3(testDir + "/incorrectEvdev3.xml");
|
||||||
if (!incorrectEvdevFile3.is_open()) {
|
if (!incorrectEvdevFile3.is_open()) {
|
||||||
FAIL();
|
FAIL();
|
||||||
}
|
}
|
||||||
|
|
@ -133,35 +139,41 @@ void createTestFiles() {
|
||||||
TEST(X11LayoutsParsingTests, xmlCorrectParsingTest) {
|
TEST(X11LayoutsParsingTests, xmlCorrectParsingTest) {
|
||||||
createTestFiles();
|
createTestFiles();
|
||||||
std::vector<String> expectedResult = {"en", "ru"};
|
std::vector<String> expectedResult = {"en", "ru"};
|
||||||
auto parsedResult = X11LayoutsParser::getX11LanguageList("correctEvdev.xml");
|
auto parsedResult =
|
||||||
|
X11LayoutsParser::getX11LanguageList(testDir + "/correctEvdev.xml");
|
||||||
|
|
||||||
EXPECT_EQ(parsedResult, parsedResult);
|
EXPECT_EQ(parsedResult, parsedResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(X11LayoutsParsingTests, xmlParsingMissedEvdevFileTest) {
|
TEST(X11LayoutsParsingTests, xmlParsingMissedEvdevFileTest) {
|
||||||
auto parsedResult = X11LayoutsParser::getX11LanguageList("missedFile");
|
auto parsedResult =
|
||||||
|
X11LayoutsParser::getX11LanguageList(testDir + "/missedFile");
|
||||||
EXPECT_TRUE(parsedResult.empty());
|
EXPECT_TRUE(parsedResult.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(X11LayoutsParsingTests, xmlParsingIncorrectEvdevFileTest) {
|
TEST(X11LayoutsParsingTests, xmlParsingIncorrectEvdevFileTest) {
|
||||||
std::vector<String> parsedResult;
|
std::vector<String> parsedResult;
|
||||||
parsedResult = X11LayoutsParser::getX11LanguageList("incorrectEvdev1.xml");
|
parsedResult =
|
||||||
|
X11LayoutsParser::getX11LanguageList(testDir + "/incorrectEvdev1.xml");
|
||||||
EXPECT_TRUE(parsedResult.empty());
|
EXPECT_TRUE(parsedResult.empty());
|
||||||
parsedResult = X11LayoutsParser::getX11LanguageList("incorrectEvdev2.xml");
|
parsedResult =
|
||||||
|
X11LayoutsParser::getX11LanguageList(testDir + "/incorrectEvdev2.xml");
|
||||||
EXPECT_TRUE(parsedResult.empty());
|
EXPECT_TRUE(parsedResult.empty());
|
||||||
parsedResult = X11LayoutsParser::getX11LanguageList("incorrectEvdev3.xml");
|
parsedResult =
|
||||||
|
X11LayoutsParser::getX11LanguageList(testDir + "/incorrectEvdev3.xml");
|
||||||
EXPECT_TRUE(parsedResult.empty());
|
EXPECT_TRUE(parsedResult.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(X11LayoutsParsingTests, layoutConvertTest) {
|
TEST(X11LayoutsParsingTests, layoutConvertTest) {
|
||||||
EXPECT_EQ(X11LayoutsParser::convertLayotToISO("correctEvdev.xml", "us", true),
|
EXPECT_EQ(X11LayoutsParser::convertLayotToISO(testDir + "/correctEvdev.xml",
|
||||||
|
"us", true),
|
||||||
"en");
|
"en");
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(X11LayoutsParser::convertLayotToISO(
|
||||||
X11LayoutsParser::convertLayotToISO("incorrectEvdev1.xml", "us", true),
|
testDir + "/incorrectEvdev1.xml", "us", true),
|
||||||
"");
|
"");
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(X11LayoutsParser::convertLayotToISO(
|
||||||
X11LayoutsParser::convertLayotToISO("evdevFromFuture.xml", "us", true),
|
testDir + "/evdevFromFuture.xml", "us", true),
|
||||||
"");
|
"");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue