Compare commits
393 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bc96ddebdd | |||
| 80606ef040 | |||
| 836d9b9a2b | |||
| f2063f9e05 | |||
| a74d792b5b | |||
| 256ba2411b | |||
| 0a23e62093 | |||
| e38a8e6b15 | |||
| 6f022ff700 | |||
| 265c2c2a2c | |||
| 1594b8e760 | |||
| 029cb8fc0b | |||
| 8e236e7e5c | |||
| 38b2798bb7 | |||
| d580dfba57 | |||
| da4237f349 | |||
| a78d1acc71 | |||
| 24d5b26da2 | |||
| 9c81f1c045 | |||
| 899a49d09a | |||
| 3a4bf35e22 | |||
| 495331108b | |||
| a7ce936d68 | |||
| f6ccd2a25b | |||
| 5d310be807 | |||
| bd674f546b | |||
| cc821f750d | |||
| 2485e993a4 | |||
| b5d12b8aa5 | |||
| 3ef5793beb | |||
| b64942e3a3 | |||
| 9de268d293 | |||
| 1f08cafffe | |||
| 9eeda33293 | |||
| 17bedb1072 | |||
| 8cca8440b7 | |||
| b2dadba6fa | |||
| 4f057d706f | |||
| 5e69657176 | |||
| 2638cce0c0 | |||
| 5eac984757 | |||
| 1bd3f5060e | |||
| 55b4cffd3f | |||
| 51ec36f23d | |||
| 58cb2b76de | |||
| 8d4a715b1c | |||
| 997d4a9473 | |||
| 0f11b61576 | |||
| 98aba612c0 | |||
| b0547f6713 | |||
| 40fefb9369 | |||
| 48e1c43a01 | |||
| d8d022e9fe | |||
| 84194cf5ef | |||
| cd5ba1382d | |||
| c84b4e3f00 | |||
| be8029deb6 | |||
| dbb9b3bf5a | |||
| 32bf9aa02a | |||
| 0891afdd63 | |||
| f7ab6aba58 | |||
| 74e8a63dcd | |||
| 475172597a | |||
| 8c30ed7a59 | |||
| 44f72a29e9 | |||
| 4db77ba2f7 | |||
| 5e29fa93ac | |||
| ce8c262a9c | |||
| 3b30065ec3 | |||
| 54483f26ba | |||
| 13ed447a93 | |||
| 74812fbf75 | |||
| bdf5a0f352 | |||
| b425b43801 | |||
| f0c60f5ca9 | |||
| b2ca9bc17b | |||
| f46474c9f2 | |||
| a99d408be1 | |||
| 19c41e2ac5 | |||
| 890fd61e6e | |||
| 1c42552b3b | |||
| a6956b9516 | |||
| 5a7f6bd1c0 | |||
| a3b0ec28fc | |||
| fa1ab27ee9 | |||
| e07a2efbcc | |||
| e967944c1e | |||
| 389028ccf9 | |||
| dc6383d593 | |||
| 1c7adf5add | |||
| 5743db3040 | |||
| 5733541b2a | |||
| 5980fb741b | |||
| 7c672b06d8 | |||
| 53038760de | |||
| d6228416a1 | |||
| 80cc323f5a | |||
| 90e63e2e9e | |||
| 24c57e46e2 | |||
| e72faf1446 | |||
| c1d7474700 | |||
| 0d2d9f385d | |||
| c0094554b1 | |||
| 95603c82ec | |||
| 8debc1ea7f | |||
| b4f703562d | |||
| 34b61cc8cd | |||
| 551e0211ac | |||
| 0fc5368253 | |||
| 383b39636e | |||
| f56a3ba305 | |||
| 0bca094fce | |||
| 220711c2d7 | |||
| 66acf9038b | |||
| aa5a704131 | |||
| bae494476b | |||
| 3ae2de52f4 | |||
| 088d69fec8 | |||
| 63744ddbd6 | |||
| 2d04e0be4d | |||
| 4f2ef7174a | |||
| 1003de21b5 | |||
| b3866b69b2 | |||
| 9bd7fce45c | |||
| f0d33ce9de | |||
| 07bf6de093 | |||
| 9c463a557a | |||
| 566d716feb | |||
| e7e518d76e | |||
| 08be9fa33f | |||
| 72d27c70e0 | |||
| 6de1920d88 | |||
| 2d3f64f662 | |||
| 193c28af53 | |||
| 5b54849fd6 | |||
| b7eb5c467b | |||
| f9b6bcc950 | |||
| 5d5e32a676 | |||
| d52939a3fc | |||
| 173e521004 | |||
| 038c8af949 | |||
| 9f68514577 | |||
| d5624ba65e | |||
| d5ee57f349 | |||
| 6a08305338 | |||
| 05ed47be2e | |||
| 29d04ea8e0 | |||
| ab118a3aa3 | |||
| 10e5a305bb | |||
| e9c8965066 | |||
| 53d2b3bd2e | |||
| d4cc66a9f9 | |||
| 18cc8565f9 | |||
| caee2b149a | |||
| e808eed413 | |||
| 16c57d7960 | |||
| 200d32db80 | |||
| 2322f312a9 | |||
| 09c157f9e1 | |||
| c9a360a144 | |||
| 3de2c1bcf0 | |||
| 73292f05c8 | |||
| 48407d7f8f | |||
| 83c190c385 | |||
| ad79ba907d | |||
| 9294f2a026 | |||
| bfb64f0653 | |||
| 6f66fe767f | |||
| 63846292ff | |||
| 2f8b78e2a6 | |||
| 8d0491f1ad | |||
| 79dc858446 | |||
| 0667f5de73 | |||
| e51956e2c7 | |||
| 60c7e512f2 | |||
| e996471e37 | |||
| 638349b48a | |||
| 3e7b14cbd4 | |||
| 3abf38aff9 | |||
| 12a56f4df0 | |||
| 9bd5fe9afb | |||
| 6ff5d2d5d3 | |||
| c04610c561 | |||
| 67e2f56724 | |||
| 5288546231 | |||
| d8e311fe59 | |||
| 500067a778 | |||
| 3c12915fd3 | |||
| eb19547b45 | |||
| 65eed64f04 | |||
| fbaa0a8433 | |||
| 743c3feef3 | |||
| d0d5182425 | |||
| 298b1047c4 | |||
| e257501072 | |||
| aaa64e986e | |||
| 7d79a4d729 | |||
| 2058519e57 | |||
| 5a71d63923 | |||
| fb32f141cc | |||
| 39da277ead | |||
| a98f2d745e | |||
| 524c3b0e7b | |||
| e420b9b986 | |||
| cb14d158cc | |||
| ac6809d40f | |||
| 92603df93d | |||
| a5f28616f4 | |||
| cad1243d75 | |||
| 610786ad2e | |||
| d093894743 | |||
| 942070950d | |||
| ddc24ffb22 | |||
| b14de6f9e2 | |||
| 10c50c9740 | |||
| 60577f00dc | |||
| fedd9d33c9 | |||
| ae30237f90 | |||
| 169422a0eb | |||
| 76fd40a3ec | |||
| 816d66b703 | |||
| 774f1fded9 | |||
| 9365091c79 | |||
| 9dcfb6cc9b | |||
| e2c3af4e5e | |||
| 26367635d9 | |||
| 0ba35fca7a | |||
| beb4069845 | |||
| 71b7e819a9 | |||
| 55772e1133 | |||
| 43c6bec790 | |||
| 8f219b735e | |||
| 59ebb6fde4 | |||
| 30a37a8a50 | |||
| 415fc3ea63 | |||
| 7f6caec162 | |||
| d61bce4534 | |||
| 1085df54ed | |||
| 480776cb38 | |||
| 2ca1c69335 | |||
| 2c2045b6bb | |||
| 9d3b32c824 | |||
| c2b3f551d2 | |||
| f255d77eee | |||
| 3125eba014 | |||
| 9b1489384c | |||
| ac54a97a3f | |||
| 0112a5eac8 | |||
| a7beed48f8 | |||
| cc4701a0c2 | |||
| 30263f3c70 | |||
| 4c3d6c7080 | |||
| 90661c9f13 | |||
| 2040df435f | |||
| 62f53bbb92 | |||
| f49f616ad6 | |||
| 6eec07b6dc | |||
| b65b3678c7 | |||
| 1ec6d02339 | |||
| 6b29e1c6ef | |||
| b13afbbbb9 | |||
| f969e0a03b | |||
| ffe8153c35 | |||
| afc736e2c8 | |||
| ae7e2f70ce | |||
| 9a1cb5941b | |||
| fa35d2913d | |||
| 1115d3287e | |||
| 46cfb281af | |||
| 365d6f76c2 | |||
| 05275b303f | |||
| 535d241f7b | |||
| 3e9289328a | |||
| bac86455d2 | |||
| b394f32c01 | |||
| 312347bc17 | |||
| 6541ce3f84 | |||
| b4a5b580bd | |||
| d72fd2b3d9 | |||
| 5ce9aaea13 | |||
| cc6bfcc1c2 | |||
| efca38babc | |||
| 401326e9d7 | |||
| 09bd4006d1 | |||
| c84a8c20c1 | |||
| b91681a125 | |||
| f578da16c0 | |||
| c583ab7d2c | |||
| e6ae6bd0d1 | |||
| d51437b6a1 | |||
| 6954a4dfa3 | |||
| 24b2d9b0c1 | |||
| 0adef8d781 | |||
| 3cce11f9d9 | |||
| 0f5bcd6d12 | |||
| 2ccf0c6639 | |||
| 6bb84309b7 | |||
| 89ec18a8e4 | |||
| 067d6810f3 | |||
| 19920801fa | |||
| 08ad64eb4d | |||
| dc5e971043 | |||
| e0017c1c31 | |||
| e58e5c420b | |||
| ca8c405b5e | |||
| aff25415ff | |||
| 5be1e9f9b9 | |||
| 3f3116da05 | |||
| 16396bdbaa | |||
| 660a50d0cf | |||
| 93cd71d046 | |||
| 90c081c889 | |||
| a08b0c41e0 | |||
| 793f40e582 | |||
| 96092df4fc | |||
| 27eb83c981 | |||
| 7487eeaa3a | |||
| 1ed49e7487 | |||
| ba11eba91e | |||
| 8ea20cf6da | |||
| ab61fcc007 | |||
| f71db61bd3 | |||
| 626ff0a5fa | |||
| 7a72658963 | |||
| b8d12a0895 | |||
| 692860f9e9 | |||
| 4b6d0059c5 | |||
| 1dadc2ddf4 | |||
| 328a719d49 | |||
| a9f55f8dfc | |||
| f6dd2881c8 | |||
| 7152119014 | |||
| 29eaa19d95 | |||
| 4db2b80d4e | |||
| 04f73cfcb7 | |||
| 1386ac91dc | |||
| 4e913a90eb | |||
| c36c0f2938 | |||
| 0944d918b7 | |||
| 3572bd28b6 | |||
| c21595e598 | |||
| 096ab3b8ed | |||
| 1129303254 | |||
| 4b456bf835 | |||
| 8533348c88 | |||
| dd0812c201 | |||
| 9a3a89efab | |||
| 3875e41154 | |||
| 74dcd9bd4e | |||
| 9501b59f81 | |||
| 6c95daf0a1 | |||
| 3991e0c1a1 | |||
| 42a17726d9 | |||
| fc6d39ae6c | |||
| 5d41537505 | |||
| f505bfd3e7 | |||
| d5e651bae9 | |||
| 1a35a8bdf7 | |||
| 261d85b423 | |||
| fcc8c3d344 | |||
| 112c665480 | |||
| 4c70f4fde5 | |||
| 665049b723 | |||
| 13a3c2d281 | |||
| abdab2d06d | |||
| fd4ffb6f60 | |||
| c165413e5b | |||
| 9f1c1da1aa | |||
| a55fafb4fc | |||
| b0852bfda5 | |||
| 9eb0371a92 | |||
| ef0d929251 | |||
| 20a5b8eb0b | |||
| 404458aab0 | |||
| 4702fa56d4 | |||
| 6f744d2278 | |||
| 49622a24b2 | |||
| 329afb47be | |||
| d4addceb09 | |||
| ca5f41684f | |||
| 9c3e08001e | |||
| 6bfde029fe | |||
| 351c5123ef | |||
| ba334d5411 | |||
| 08d4b348e0 | |||
| 58563d36ca | |||
| ce02bb85b3 | |||
| df089dab53 | |||
| 86ee88d17d | |||
| 4f9494245f | |||
| 2294981525 | |||
| 13b58f2f7a | |||
| 2455e0e29f |
20
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
20
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -22,12 +22,16 @@ body:
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
- type: textarea
|
||||
id: version
|
||||
attributes:
|
||||
label: Deskflow version number
|
||||
description: You can find the Deskflow version number on the about screen.
|
||||
placeholder: 1.2.3.4
|
||||
label: Deskflow version info
|
||||
description: You can find the Deskflow version number on the About screen.
|
||||
placeholder: |
|
||||
Deskflow: 1.2.3.4 (deadc0de)
|
||||
Qt: 3.2.1
|
||||
System: Hannah Montana Linux (Workstation Edition)
|
||||
Session: Unity (Compiz)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@ -51,7 +55,7 @@ body:
|
||||
id: os
|
||||
attributes:
|
||||
label: Operating systems (OS)
|
||||
description: Which operating systems (OS) are you using?
|
||||
description: Operating systems (OS) in use for all servers and clients
|
||||
options:
|
||||
- label: Windows
|
||||
- label: macOS
|
||||
@ -110,8 +114,7 @@ body:
|
||||
label: Deskflow configuration
|
||||
description: |
|
||||
Please provide a very brief description of your configuration.
|
||||
Let us know the OS of the server/host/primary and the OS of the client/guest/secondary.
|
||||
This will help us understand how you're using Deskflow.
|
||||
Let us know what OS your server and client are running.
|
||||
placeholder: |
|
||||
- Windows 11 server, macOS 15 client
|
||||
- Each computer has a single monitor
|
||||
@ -122,9 +125,8 @@ body:
|
||||
attributes:
|
||||
label: What steps will reproduce the problem?
|
||||
description: |
|
||||
Please list the steps to reproduce the issue.
|
||||
Please list the _numbered steps_ to reproduce the issue.
|
||||
If you're not sure, please provide as much detail as possible.
|
||||
This will help us understand the problem.
|
||||
placeholder: |
|
||||
1. Start Deskflow
|
||||
2. Click 'Configure Server'
|
||||
|
||||
19
.github/actions/install-dependencies/action.yml
vendored
19
.github/actions/install-dependencies/action.yml
vendored
@ -9,8 +9,12 @@ inputs:
|
||||
description: "Used only on linux distro type: debian, fedora, suse, arch"
|
||||
required: false
|
||||
|
||||
mac-qt-version:
|
||||
description: "The verison of Qt to install on mac os"
|
||||
qt-version:
|
||||
description: "The version of Qt to install (Windows & macOS)"
|
||||
required: false
|
||||
|
||||
qt-install-dir:
|
||||
description: "The path to install Qt into (Windows & macOS)"
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
@ -67,13 +71,13 @@ runs:
|
||||
shell: bash
|
||||
|
||||
- name: Install Qt
|
||||
if: ${{runner.os == 'macOS' }}
|
||||
if: ${{runner.os != 'Linux' }}
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
dir: "/Users/runner"
|
||||
version: ${{inputs.mac-qt-version}}
|
||||
dir: ${{inputs.qt-install-dir}}
|
||||
version: ${{inputs.qt-version}}
|
||||
cache: true
|
||||
cache-key-prefix: ${{matrix.target.os}}-${{env.qt-version}}
|
||||
cache-key-prefix: ${{matrix.target.os}}-${{inputs.qt-version}}
|
||||
|
||||
# Install Ninja with an action instead of using Chocolatey, as it's more
|
||||
# reliable and faster. The Ninja install action is pretty good as it
|
||||
@ -87,7 +91,8 @@ runs:
|
||||
id: vcpkg
|
||||
uses: johnwason/vcpkg-action@v6
|
||||
with:
|
||||
manifest-dir: ${{ github.workspace }}
|
||||
pkgs: wintoast gtest pkgconf openssl
|
||||
extra-args: --classic
|
||||
triplet: x64-windows-release
|
||||
token: ${{ github.token }}
|
||||
github-binarycache: true
|
||||
|
||||
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@ -44,7 +44,7 @@ jobs:
|
||||
apt install -qqq git > /dev/null
|
||||
|
||||
- name: Fancy Checkout
|
||||
uses: sithlord48/fancy-checkout@v1.0.0
|
||||
uses: sithlord48/fancy-checkout@v1
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/install-dependencies
|
||||
|
||||
105
.github/workflows/continuous-integration.yml
vendored
105
.github/workflows/continuous-integration.yml
vendored
@ -82,7 +82,18 @@ jobs:
|
||||
- name: Test summary
|
||||
uses: ./.github/actions/test-summary
|
||||
|
||||
reuse-lint:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: REUSE Compliance Check
|
||||
uses: fsfe/reuse-action@v4
|
||||
|
||||
lint-check:
|
||||
needs: [reuse-lint]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
|
||||
@ -120,19 +131,22 @@ jobs:
|
||||
target:
|
||||
- name: "windows-2022-x64"
|
||||
runs-on: "windows-2022"
|
||||
timeout: 120 #Windows can take while if it has to build vcpkg cache
|
||||
timeout: 30
|
||||
config-args: "-G Ninja"
|
||||
qt-install-dir: "C:"
|
||||
|
||||
- name: "macos-14-arm64"
|
||||
runs-on: "macos-14"
|
||||
timeout: 10
|
||||
arch: arm64
|
||||
config-args: "-DCMAKE_OSX_ARCHITECTURES=\"arm64\""
|
||||
qt-install-dir: "/Users/runner"
|
||||
|
||||
- name: "macos-13-x64"
|
||||
runs-on: macos-13
|
||||
timeout: 20
|
||||
config-args: "-DCMAKE_OSX_ARCHITECTURES=\"x86_64\""
|
||||
qt-install-dir: "/Users/runner"
|
||||
|
||||
- name: "debian-13-x86_64"
|
||||
runs-on: ubuntu-latest
|
||||
@ -141,6 +155,13 @@ jobs:
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "debian-13-arm64"
|
||||
runs-on: ubuntu-24.04-arm
|
||||
container: debian:trixie-slim
|
||||
like: "debian"
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "fedora-41-x86_64"
|
||||
runs-on: ubuntu-latest
|
||||
container: fedora:41
|
||||
@ -148,6 +169,13 @@ jobs:
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "fedora-41-arm64"
|
||||
runs-on: ubuntu-24.04-arm
|
||||
container: fedora:41
|
||||
like: "fedora"
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "fedora-40-x86_84"
|
||||
runs-on: ubuntu-latest
|
||||
container: fedora:40
|
||||
@ -155,6 +183,13 @@ jobs:
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "fedora-40-arm64"
|
||||
runs-on: ubuntu-24.04-arm
|
||||
container: fedora:40
|
||||
like: "fedora"
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "opensuse-x86_84"
|
||||
runs-on: ubuntu-latest
|
||||
container: opensuse/tumbleweed:latest
|
||||
@ -162,6 +197,13 @@ jobs:
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "opensuse-arm64"
|
||||
runs-on: ubuntu-24.04-arm
|
||||
container: opensuse/tumbleweed:latest
|
||||
like: "suse"
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "archlinux-x86_84"
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:latest
|
||||
@ -169,6 +211,20 @@ jobs:
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "ubuntu-25.04-x86_64"
|
||||
runs-on: ubuntu-latest
|
||||
container: ubuntu:25.04
|
||||
like: "debian"
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "ubuntu-25.04-arm64"
|
||||
runs-on: ubuntu-24.04-arm
|
||||
container: ubuntu:25.04
|
||||
like: "debian"
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
steps:
|
||||
# Make sure the container has git before we do anything else
|
||||
- name: Install Git on Container
|
||||
@ -190,7 +246,7 @@ jobs:
|
||||
# Fancy checkout gets all the tags
|
||||
# it also makes sure we can use git --describe correctly
|
||||
- name: Fancy Checkout
|
||||
uses: sithlord48/fancy-checkout@v1.0.0
|
||||
uses: sithlord48/fancy-checkout@v1
|
||||
|
||||
# This effectively runs `vcvarsall.bat`, etc. It's not actually installing
|
||||
# VC++ as that's already pre-installed on the Windows runner.
|
||||
@ -202,7 +258,8 @@ jobs:
|
||||
id: get-deps
|
||||
uses: ./.github/actions/install-dependencies
|
||||
with:
|
||||
mac-qt-version: 6.7.2
|
||||
qt-version: 6.8.2
|
||||
qt-install-dir: ${{matrix.target.qt-install-dir}}
|
||||
like: ${{ matrix.target.like }}
|
||||
|
||||
- name: Get version
|
||||
@ -258,7 +315,7 @@ jobs:
|
||||
# Fancy checkout gets all the tags
|
||||
# it also makes sure we can use git --describe correctly
|
||||
- name: Fancy Checkout
|
||||
uses: sithlord48/fancy-checkout@v1.0.0
|
||||
uses: sithlord48/fancy-checkout@v1
|
||||
|
||||
- name: Build on FreeBSD
|
||||
if: ${{ matrix.distro.name == 'freebsd' }}
|
||||
@ -276,31 +333,51 @@ jobs:
|
||||
./build/bin/integtests || true
|
||||
flatpak:
|
||||
needs: lint-check
|
||||
runs-on: ubuntu-latest
|
||||
name: flatpak-${{matrix.flatpak.arch}}
|
||||
runs-on: ${{matrix.flatpak.runs-on}}
|
||||
timeout-minutes: 60
|
||||
container:
|
||||
image: bilelmoussaoui/flatpak-github-actions:kde-6.7
|
||||
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.8
|
||||
options: --privileged
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flatpak:
|
||||
- runs-on: ubuntu-latest
|
||||
arch: x86_64
|
||||
- runs-on: ubuntu-24.04-arm
|
||||
arch: aarch64
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: sithlord48/fancy-checkout@v1.0.0
|
||||
uses: sithlord48/fancy-checkout@v1
|
||||
|
||||
- run: git config --global protocol.file.allow always
|
||||
|
||||
- name: Get version
|
||||
uses: ./.github/actions/get-version
|
||||
|
||||
- uses: flatpak/flatpak-github-actions/flatpak-builder@master
|
||||
name: "Build"
|
||||
- name: Lint appsteam
|
||||
run: flatpak-builder-lint appstream deploy/linux/org.deskflow.deskflow.metainfo.xml
|
||||
|
||||
- name: Lint manifest
|
||||
run: flatpak-builder-lint manifest deploy/linux/flatpak/org.deskflow.deskflow.yml
|
||||
|
||||
- name: Build
|
||||
uses: flathub-infra/flatpak-github-actions/flatpak-builder@53987ffa5f687586936d85fdce3f440848bea04d
|
||||
with:
|
||||
bundle: deskflow-${{env.DESKFLOW_PACKAGE_VERSION}}-linux-x86_64.flatpak
|
||||
bundle: deskflow-${{env.DESKFLOW_PACKAGE_VERSION}}-linux-${{matrix.flatpak.arch}}.flatpak
|
||||
manifest-path: deploy/linux/flatpak/org.deskflow.deskflow.yml
|
||||
cache-key: flatpak-builder-${{ github.sha }}
|
||||
cache-key: flatpak-builder-${{matrix.flatpak.arch}}-2.0
|
||||
arch: ${{matrix.flatpak.arch}}
|
||||
upload-artifact: false
|
||||
|
||||
- name: Validate build
|
||||
run: flatpak-builder-lint --exceptions --user-exceptions deploy/linux/flatpak/ci-build-lint-exceptions.json repo repo
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: package-${{ env.PACKAGE_PREFIX }}-flatpak-x86_64
|
||||
name: package-${{ env.PACKAGE_PREFIX }}-flatpak-${{matrix.flatpak.arch}}
|
||||
path: ${{github.workspace}}/deskflow[-_]*.flatpak
|
||||
|
||||
release:
|
||||
@ -310,7 +387,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Fancy Checkout
|
||||
uses: sithlord48/fancy-checkout@v1.0.0
|
||||
uses: sithlord48/fancy-checkout@v1
|
||||
|
||||
- name: Get version
|
||||
uses: ./.github/actions/get-version
|
||||
@ -355,7 +432,7 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Fancy Checkout
|
||||
uses: sithlord48/fancy-checkout@v1.0.0
|
||||
uses: sithlord48/fancy-checkout@v1
|
||||
|
||||
- name: Get version
|
||||
uses: ./.github/actions/get-version
|
||||
|
||||
2
.github/workflows/sonarcloud-analysis.yml
vendored
2
.github/workflows/sonarcloud-analysis.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
||||
apt install -qqq git curl unzip gcovr > /dev/null
|
||||
|
||||
- name: Fancy Checkout
|
||||
uses: sithlord48/fancy-checkout@v1.0.0
|
||||
uses: sithlord48/fancy-checkout@v1
|
||||
|
||||
- name: Install project dependencies
|
||||
uses: ./.github/actions/install-dependencies
|
||||
|
||||
2
.github/workflows/valgrind-analysis.yml
vendored
2
.github/workflows/valgrind-analysis.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
apt install -qqq git valgrind > /dev/null
|
||||
|
||||
- name: Fancy Checkout
|
||||
uses: sithlord48/fancy-checkout@v1.0.0
|
||||
uses: sithlord48/fancy-checkout@v1
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/install-dependencies
|
||||
|
||||
117
CMakeLists.txt
117
CMakeLists.txt
@ -1,24 +1,8 @@
|
||||
# Deskflow -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2024 Symless Ltd.
|
||||
# Copyright (C) 2009 Nick Bolton
|
||||
#
|
||||
# This package is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# found in the file LICENSE that should have accompanied this file.
|
||||
#
|
||||
# This package is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# SPDX-FileCopyrightText: 2024 Deskflow Developers
|
||||
# SPDX-FileCopyrightText: 2012 - 2024 Symless Ltd
|
||||
# SPDX-FileCopyrightText: 2009 - 2012 Nick Bolton
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Why CMake 3.8?
|
||||
# This allows package maintainers to create reproducible builds:
|
||||
# > New in version 3.8: If the SOURCE_DATE_EPOCH environment variable is set,
|
||||
# > its value will be used instead of the current time.
|
||||
# > See https://reproducible-builds.org/specs/source-date-epoch/ for details.
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
|
||||
# Link items by fill path
|
||||
@ -34,12 +18,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Fallback for when git can not be found
|
||||
set(DESKFLOW_VERSION_MAJOR 1)
|
||||
set(DESKFLOW_VERSION_MINOR 18)
|
||||
set(DESKFLOW_VERSION_PATCH 0)
|
||||
set(DESKFLOW_VERSION_MINOR 20)
|
||||
set(DESKFLOW_VERSION_PATCH 1)
|
||||
set(DESKFLOW_VERSION_TWEAK 0)
|
||||
|
||||
# Get the version from git if it's a git repository
|
||||
# cmake-format: off
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||
find_package(Git)
|
||||
if(GIT_FOUND)
|
||||
@ -50,44 +33,60 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --long --match v* --always
|
||||
COMMAND ${GIT_EXECUTABLE} rev-list --tags --count
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE GITREV
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(FIND ${GITREV} "v" isRev)
|
||||
if(NOT ifRev EQUAL -1)
|
||||
string(REGEX MATCH [0-9]+ MAJOR ${GITREV})
|
||||
string(REGEX MATCH \\.[0-9]+ MINOR ${GITREV})
|
||||
string(REPLACE "." "" MINOR "${MINOR}")
|
||||
string(REGEX MATCH [0-9]+\- PATCH ${GITREV})
|
||||
string(REPLACE "-" "" PATCH "${PATCH}")
|
||||
string(REGEX MATCH \-[0-9]+\- TWEAK ${GITREV})
|
||||
string(REPLACE "-" "" TWEAK "${TWEAK}")
|
||||
set(DESKFLOW_VERSION_MAJOR ${MAJOR})
|
||||
set(DESKFLOW_VERSION_MINOR ${MINOR})
|
||||
set(DESKFLOW_VERSION_PATCH ${PATCH})
|
||||
set(DESKFLOW_VERSION_TWEAK ${TWEAK})
|
||||
elseif(NOT ${GITREV} STREQUAL "")
|
||||
set(DESKFLOW_VERSION_TWEAK ${GITREV})
|
||||
OUTPUT_VARIABLE GIT_TAG_COUNT
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if(GIT_TAG_COUNT EQUAL 0)
|
||||
set(DESKFLOW_VERSION_TWEAK "9999")
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --long --match v* --always
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE GITREV
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
string(FIND ${GITREV} "v" isRev)
|
||||
if(NOT ifRev EQUAL -1)
|
||||
string(REGEX MATCH [0-9]+ MAJOR ${GITREV})
|
||||
string(REGEX MATCH \\.[0-9]+ MINOR ${GITREV})
|
||||
string(REPLACE "." "" MINOR "${MINOR}")
|
||||
string(REGEX MATCH [0-9]+\- PATCH ${GITREV})
|
||||
string(REPLACE "-" "" PATCH "${PATCH}")
|
||||
string(REGEX MATCH \-[0-9]+\- TWEAK ${GITREV})
|
||||
string(REPLACE "-" "" TWEAK "${TWEAK}")
|
||||
set(DESKFLOW_VERSION_MAJOR ${MAJOR})
|
||||
set(DESKFLOW_VERSION_MINOR ${MINOR})
|
||||
set(DESKFLOW_VERSION_PATCH ${PATCH})
|
||||
set(DESKFLOW_VERSION_TWEAK ${TWEAK})
|
||||
elseif(NOT ${GITREV} STREQUAL "")
|
||||
set(DESKFLOW_VERSION_TWEAK ${GITREV})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
# cmake-format: on
|
||||
|
||||
set(DESKFLOW_VERSION
|
||||
"${DESKFLOW_VERSION_MAJOR}.${DESKFLOW_VERSION_MINOR}.${DESKFLOW_VERSION_PATCH}.${DESKFLOW_VERSION_TWEAK}"
|
||||
)
|
||||
set(DESKFLOW_VERSION_MS_CSV
|
||||
"${DESKFLOW_VERSION_MAJOR},${DESKFLOW_VERSION_MINOR},${DESKFLOW_VERSION_PATCH},${DESKFLOW_VERSION_TWEAK}"
|
||||
)
|
||||
|
||||
#Define our project
|
||||
project(
|
||||
deskflow
|
||||
VERSION ${DESKFLOW_VERSION}
|
||||
VERSION "${DESKFLOW_VERSION_MAJOR}.${DESKFLOW_VERSION_MINOR}.${DESKFLOW_VERSION_PATCH}.${DESKFLOW_VERSION_TWEAK}"
|
||||
DESCRIPTION "Mouse and keyboard sharing utility"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
# Define Additional "PROJECT" vars for packaging and metadata
|
||||
set(CMAKE_PROJECT_PROPER_NAME "Deskflow")
|
||||
set(CMAKE_PROJECT_VENDOR "${CMAKE_PROJECT_PROPER_NAME} Devs")
|
||||
set(CMAKE_PROJECT_COPYRIGHT "(C) 2024-2025 ${CMAKE_PROJECT_VENDOR}")
|
||||
set(CMAKE_PROJECT_CONTACT "${CMAKE_PROJECT_PROPER_NAME} <maintainers@deskflow.org>")
|
||||
|
||||
#Unset the vars used in the project call
|
||||
unset(DESKFLOW_VERSION_MAJOR)
|
||||
unset(DESKFLOW_VERSION_MINOR)
|
||||
unset(DESKFLOW_VERSION_PATCH)
|
||||
unset(DESKFLOW_VERSION_TWEAK)
|
||||
|
||||
message(STATUS "Building ${CMAKE_PROJECT_NAME}-${CMAKE_PROJECT_VERSION}")
|
||||
|
||||
# Set lib versions
|
||||
@ -124,18 +123,24 @@ add_subdirectory(src)
|
||||
# Install License, License is in the App Bundle on mac os (src/gui)
|
||||
if(WIN32)
|
||||
install(
|
||||
FILES
|
||||
${PROJECT_SOURCE_DIR}/LICENSE
|
||||
${PROJECT_SOURCE_DIR}/LICENSE_EXCEPTION
|
||||
FILES ${PROJECT_SOURCE_DIR}/LICENSE
|
||||
DESTINATION .
|
||||
)
|
||||
install(
|
||||
FILES ${PROJECT_SOURCE_DIR}/LICENSES/LicenseRef-OpenSSL-Exception.txt
|
||||
DESTINATION .
|
||||
RENAME LICENSE_EXCEPTION
|
||||
)
|
||||
elseif(UNIX AND NOT APPLE)
|
||||
install(
|
||||
FILES
|
||||
${PROJECT_SOURCE_DIR}/LICENSE
|
||||
${PROJECT_SOURCE_DIR}/LICENSE_EXCEPTION
|
||||
FILES ${PROJECT_SOURCE_DIR}/LICENSE
|
||||
DESTINATION share/licenses/deskflow
|
||||
)
|
||||
install(
|
||||
FILES ${PROJECT_SOURCE_DIR}/LICENSES/LicenseRef-OpenSSL-Exception.txt
|
||||
DESTINATION share/licenses/deskflow
|
||||
RENAME LICENSE_EXCEPTION
|
||||
)
|
||||
endif()
|
||||
|
||||
option(BUILD_INSTALLER "Build installer" ON)
|
||||
|
||||
117
LICENSES/GPL-2.0-only.txt
Normal file
117
LICENSES/GPL-2.0-only.txt
Normal file
@ -0,0 +1,117 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice
|
||||
176
LICENSES/LGPL-2.1-only.txt
Normal file
176
LICENSES/LGPL-2.1-only.txt
Normal file
@ -0,0 +1,176 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
one line to give the library's name and an idea of what it does.
|
||||
Copyright (C) year name of author
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in
|
||||
the library `Frob' (a library for tweaking knobs) written
|
||||
by James Random Hacker.
|
||||
|
||||
signature of Ty Coon, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
That's all there is to it!
|
||||
18
LICENSES/MIT.txt
Normal file
18
LICENSES/MIT.txt
Normal file
@ -0,0 +1,18 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial
|
||||
portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
||||
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
38
README.md
38
README.md
@ -1,13 +1,14 @@
|
||||

|
||||
|
||||
> [!NOTE]
|
||||
> **Deskflow** is the official upstream project for [Synergy](https://symless.com/synergy).
|
||||
> [!TIP]
|
||||
> [Synergy](https://symless.com/synergy) sponsors the Deskflow project by contributing code and providing financial support.
|
||||
>
|
||||
> - [**Bounties**](https://github.com/deskflow/deskflow/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22%F0%9F%92%8E%20bounty%22) - Earn while contributing to open source
|
||||
> - [**Rewarded**](https://github.com/deskflow/deskflow/issues?q=label%3A%22%F0%9F%92%B0%20rewarded%22%20) - Issues with a rewarded bounty
|
||||
>
|
||||
> **Deskflow** is the official upstream project for Synergy.
|
||||
> Purchasing a Synergy license is one way to support Deskflow’s growth and sustainability.
|
||||
>
|
||||
> The Deskflow project was established to cultivate community-driven development where everyone can collaborate.
|
||||
> Synergy sponsors the Deskflow project by contributing code and providing financial support.
|
||||
>
|
||||
> More info: [Relationship with Synergy](https://github.com/deskflow/deskflow/wiki/Relationship-with-Synergy)
|
||||
> Learn more: [Relationship with Synergy](https://github.com/deskflow/deskflow/wiki/Relationship-with-Synergy)
|
||||
|
||||
**Deskflow** is a free and open source keyboard and mouse sharing app.
|
||||
Use the keyboard, mouse, or trackpad of one computer to control nearby computers,
|
||||
@ -25,6 +26,7 @@ To use Deskflow you can use one of our [packages](https://github.com/deskflow/de
|
||||
[](https://github.com/deskflow/deskflow/commits/master/)
|
||||
[](https://github.com/deskflow/deskflow/commits/master/)
|
||||
[](LICENSE)
|
||||
[](https://api.reuse.software/info/github.com/deskflow/deskflow)
|
||||
|
||||
[](https://sonarcloud.io/summary/new_code?id=deskflow_deskflow)
|
||||
[](https://sonarcloud.io/summary/new_code?id=deskflow_deskflow)
|
||||
@ -34,7 +36,6 @@ To use Deskflow you can use one of our [packages](https://github.com/deskflow/de
|
||||
[](https://github.com/deskflow/deskflow/actions/workflows/continuous-integration.yml)
|
||||
[](https://github.com/deskflow/deskflow/actions/workflows/codeql-analysis.yml)
|
||||
[](https://github.com/deskflow/deskflow/actions/workflows/sonarcloud-analysis.yml)
|
||||
|
||||
## Project Values
|
||||
|
||||
- Motivated by the community interests (not business-driven)
|
||||
@ -63,12 +64,17 @@ For instructions on building Deskflow, use the wiki page: [Building](https://git
|
||||
|
||||
We support all major operating systems, including Windows, macOS, Linux, and Unix-like BSD-derived.
|
||||
|
||||
Windows 10 or higher is required.
|
||||
> [!NOTE]
|
||||
> On Windows, you will need to install the
|
||||
> [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version).
|
||||
> Download latest: [`vc_redist.x64.exe`](https://aka.ms/vs/17/release/vc_redist.x64.exe)
|
||||
|
||||
Windows 10 or higher is required.
|
||||
|
||||
macOS 12 or higher is required.
|
||||
|
||||
All Linux distributions are supported, primarily focusing on:
|
||||
Debian, Ubuntu, Linux Mint, Fedora, RHEL, AlmaLinux, Rocky Linux, Arch Linux, openSUSE, Gentoo.
|
||||
Linux requires libei 1.3+ and libportal 0.8+ for the server/client. Additionally, Qt 6.7+ is required for the GUI.
|
||||
Linux users with systems not meeting these requirements should use flatpak in place of a native package.
|
||||
|
||||
We officially support FreeBSD, and would also like to support: OpenBSD, NetBSD, DragonFly, Solaris.
|
||||
|
||||
@ -135,8 +141,10 @@ Learn more: [Relationship with Synergy](https://github.com/deskflow/deskflow/wik
|
||||
Yes, Deskflow has network compatibility with all forks:
|
||||
- Requires Deskflow >= v1.17.0.96
|
||||
- Deskflow will *just work* with Input Leap and Barrier (server or client).
|
||||
- Connecting a Deskflow client to a Synergy server will also *just work*.
|
||||
- To connect a Synergy client, you need to select the Synergy protocol in the Deskflow server settings.
|
||||
- Connecting a Deskflow client to a Synergy 1 server will also *just work*.
|
||||
- To connect a Synergy 1 client, you need to select the Synergy protocol in the Deskflow server settings.
|
||||
|
||||
_Note:_ Only Synergy 1 is compatible with Deskflow (Synergy 3 is not yet compatible).
|
||||
|
||||
### Is Deskflow compatible with Lan Mouse?
|
||||
|
||||
@ -164,6 +172,8 @@ who is the author of `libei`, a major contributor to `libportal`, and the author
|
||||
implementation in Deskflow. Others such as Olivier Fourdan and Povilas Kanapickas helped with the
|
||||
Wayland implementation.
|
||||
|
||||
Some features _may_ be unavailable or broken on Wayland. Please see the [known Wayland issues](https://github.com/deskflow/deskflow/discussions/7499).
|
||||
|
||||
### Where did it all start?
|
||||
|
||||
Deskflow was first created as Synergy in 2001 by Chris Schoeneman.
|
||||
@ -185,4 +195,4 @@ Deskflow is made by possible by these contributors.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under [GPL-2.0](LICENSE) with an [OpenSSL exception](LICENSE_EXCEPTION).
|
||||
This project is licensed under [GPL-2.0](LICENSE) with an [OpenSSL exception](LICENSES/LicenseRef-OpenSSL-Exception.txt).
|
||||
|
||||
206
REUSE.toml
Normal file
206
REUSE.toml
Normal file
@ -0,0 +1,206 @@
|
||||
# SPDX-FileCopyrightText: 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
version = 1
|
||||
SPDX-PackageName = "deskflow"
|
||||
SPDX-PackageSupplier = "Deskflow Devs"
|
||||
SPDX-PackageDownloadLocation = "https://github.com/deskflow/deskflow"
|
||||
|
||||
[[annotations]]
|
||||
path = ".github/**"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = ".clang-format"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = ".editorconfig"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = ".gitattributes"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = ".gitignore"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "cspell.json"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "README.md"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "SECURITY.md"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "sonar-project.properties"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "vcpkg.json"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "vcpkg-configuration.json"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "doc/**"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/mac/dmg-background.tiff"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/mac/dmg-volume.icns"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/linux/deskflow.png"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/linux/flatpak/**"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/linux/org.deskflow.deskflow.metainfo.xml"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/windows/wix-banner.png"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/windows/wix-dialog.png"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "deploy/windows/wix-patch.xml.in"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/deskflow-client/deskflow-client.exe.manifest"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/deskflow-core/deskflow-core.exe.manifest"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/deskflow-server/deskflow-server.exe.manifest"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/icons/deskflow-**/**/**/**.svg"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Kde Breeze Icons"
|
||||
SPDX-License-Identifier = "LGPL-2.1-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/icons/deskflow-**/apps/64/deskflow*.svg"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/image/welcome.png"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/Deskflow.icns"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/deskflow.ico"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/deskflow.plist.in"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/deskflow.qrc"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/res/icons/deskflow-**/index.theme"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Chris Rizzitello <sithlord48@gmail.com>"
|
||||
SPDX-License-Identifier = "LGPL-2.1-only"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/deskflow-gui/MainWindow.ui"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only WITH LicenseRef-OpenSSL-Exception"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/apps/deskflow-gui/dialogs/*.ui"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only WITH LicenseRef-OpenSSL-Exception"
|
||||
11
SECURITY.md
Normal file
11
SECURITY.md
Normal file
@ -0,0 +1,11 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
The latest minor release is supported and receives security updates:
|
||||
https://github.com/deskflow/deskflow/releases
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please report vulnerabilities on our issue tracker as bugs:
|
||||
https://github.com/deskflow/deskflow/issues
|
||||
@ -1,72 +1,11 @@
|
||||
# SOURCE https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake
|
||||
# Copyright (c) 2012 - 2017, Lars Bilke
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this
|
||||
# list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without
|
||||
# specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# CHANGES:
|
||||
#
|
||||
# 2012-01-31, Lars Bilke
|
||||
# - Enable Code Coverage
|
||||
#
|
||||
# 2013-09-17, Joakim Söderberg
|
||||
# - Added support for Clang.
|
||||
# - Some additional usage instructions.
|
||||
#
|
||||
# 2016-02-03, Lars Bilke
|
||||
# - Refactored functions to use named parameters
|
||||
#
|
||||
# 2017-06-02, Lars Bilke
|
||||
# - Merged with modified version from github.com/ufz/ogs
|
||||
#
|
||||
# 2019-05-06, Anatolii Kurotych
|
||||
# - Remove unnecessary --coverage flag
|
||||
#
|
||||
# 2019-12-13, FeRD (Frank Dana)
|
||||
# - Deprecate COVERAGE_LCOVR_EXCLUDES and COVERAGE_GCOVR_EXCLUDES lists in favor
|
||||
# of tool-agnostic COVERAGE_EXCLUDES variable, or EXCLUDE setup arguments.
|
||||
# - CMake 3.4+: All excludes can be specified relative to BASE_DIRECTORY
|
||||
# - All setup functions: accept BASE_DIRECTORY, EXCLUDE list
|
||||
# - Set lcov basedir with -b argument
|
||||
# - Add automatic --demangle-cpp in lcovr, if 'c++filt' is available (can be
|
||||
# overridden with NO_DEMANGLE option in setup_target_for_coverage_lcovr().)
|
||||
# - Delete output dir, .info file on 'make clean'
|
||||
# - Remove Python detection, since version mismatches will break gcovr
|
||||
# - Minor cleanup (lowercase function names, update examples...)
|
||||
#
|
||||
# 2019-12-19, FeRD (Frank Dana)
|
||||
# - Rename Lcov outputs, make filtered file canonical, fix cleanup for targets
|
||||
#
|
||||
# 2020-01-19, Bob Apthorpe
|
||||
# - Added gfortran support
|
||||
#
|
||||
# 2020-02-17, FeRD (Frank Dana)
|
||||
# - Make all add_custom_target()s VERBATIM to auto-escape wildcard characters
|
||||
# in EXCLUDEs, and remove manual escaping from gcovr targets
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020 Bob Apthrope
|
||||
# SPDX-FileCopyrightText: 2019 Anatolii Kurotych
|
||||
# SPDX-FileCopyrightText: 2019 - 2020 Frank Dana
|
||||
# SPDX-FileCopyrightText: 2013 Joakim Söderberg
|
||||
# SPDX-FileCopyrightText: 2012 - 2017 Lars Bilke
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# USAGE:
|
||||
#
|
||||
# 1. Copy this file into your cmake modules path.
|
||||
|
||||
@ -1,17 +1,6 @@
|
||||
# Deskflow -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2024 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/>.
|
||||
# SPDX-FileCopyrightText: 2024 - 2025 Deskflow Developers
|
||||
# SPDX-FileCopyrightText: 2024 Symless Ltd
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
macro(configure_libs)
|
||||
|
||||
@ -19,10 +8,9 @@ macro(configure_libs)
|
||||
if(UNIX)
|
||||
configure_unix_libs()
|
||||
elseif(WIN32)
|
||||
find_package(Python REQUIRED QUIET)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /D _BIND_TO_CURRENT_VCLIBS_VERSION=1")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /O2 /Ob2")
|
||||
list(APPEND libs Wtsapi32 Userenv Wininet comsuppw Shlwapi)
|
||||
list(APPEND libs Wtsapi32 Userenv Wininet comsuppw Shlwapi version)
|
||||
add_definitions(
|
||||
/DWIN32
|
||||
/D_WINDOWS
|
||||
@ -32,34 +20,27 @@ macro(configure_libs)
|
||||
endif()
|
||||
|
||||
find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Widgets Network)
|
||||
if(UNIX AND NOT APPLE)
|
||||
find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS DBus)
|
||||
endif()
|
||||
|
||||
# Define the location of Qt deployment tool
|
||||
if(WIN32)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT VCPKG_INSTALL_DIR STREQUAL "")
|
||||
find_program(DEPLOYQT windeployqt.debug.bat)
|
||||
else()
|
||||
find_program(DEPLOYQT windeployqt)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
find_program(DEPLOYQT macdeployqt)
|
||||
endif()
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
message(STATUS "Qt version: ${Qt6_VERSION}")
|
||||
|
||||
# TODO SSL check can happen in lib/net when don't have to deploy it any longer on windows
|
||||
|
||||
# Apple has to use static libraries because "Use of the Apple-provided OpenSSL
|
||||
# libraries by apps is strongly discouraged."
|
||||
# https://developer.apple.com/library/archive/documentation/Security/Conceptual/cryptoservices/SecureNetworkCommunicationAPIs/SecureNetworkCommunicationAPIs.html
|
||||
if(APPLE)
|
||||
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
||||
endif()
|
||||
|
||||
find_package(OpenSSL ${REQUIRED_OPENSSL_VERSION} REQUIRED COMPONENTS SSL Crypto)
|
||||
if(WIN32) #Used for dev in TLS and WIX
|
||||
cmake_path(SET OPENSSL_ROOT_DIR NORMALIZE "${OPENSSL_INCLUDE_DIR}/..")
|
||||
message(VERBOSE "Set OPENSSL_ROOT_DIR: ${OPENSSL_ROOT_DIR}")
|
||||
set(OPENSSL_EXE_DIR "${OPENSSL_ROOT_DIR}/tools/openssl")
|
||||
add_definitions(-DOPENSSL_EXE_DIR="${OPENSSL_EXE_DIR}")
|
||||
# HACK Install a copy of openssl on windows
|
||||
install(
|
||||
FILES
|
||||
${OPENSSL_EXE_DIR}/openssl.exe
|
||||
${OPENSSL_EXE_DIR}/openssl.cnf
|
||||
DESTINATION .
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
option(ENABLE_COVERAGE "Enable test coverage" OFF)
|
||||
if(ENABLE_COVERAGE)
|
||||
message(STATUS "Enabling code coverage")
|
||||
@ -112,15 +93,9 @@ macro(configure_unix_libs)
|
||||
check_include_file_cxx(ostream HAVE_OSTREAM)
|
||||
check_include_file_cxx(sstream HAVE_SSTREAM)
|
||||
|
||||
check_include_files(inttypes.h HAVE_INTTYPES_H)
|
||||
check_include_files(locale.h HAVE_LOCALE_H)
|
||||
check_include_files(memory.h HAVE_MEMORY_H)
|
||||
check_include_files(stdlib.h HAVE_STDLIB_H)
|
||||
check_include_files(strings.h HAVE_STRINGS_H)
|
||||
check_include_files(string.h HAVE_STRING_H)
|
||||
check_include_files(sys/select.h HAVE_SYS_SELECT_H)
|
||||
check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
|
||||
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
|
||||
check_include_files(sys/time.h HAVE_SYS_TIME_H)
|
||||
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
|
||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||
@ -130,8 +105,6 @@ macro(configure_unix_libs)
|
||||
check_function_exists(gmtime_r HAVE_GMTIME_R)
|
||||
check_function_exists(nanosleep HAVE_NANOSLEEP)
|
||||
check_function_exists(sigwait HAVE_POSIX_SIGWAIT)
|
||||
check_function_exists(strftime HAVE_STRFTIME)
|
||||
check_function_exists(vsnprintf HAVE_VSNPRINTF)
|
||||
check_function_exists(inet_aton HAVE_INET_ATON)
|
||||
|
||||
# For some reason, the check_function_exists macro doesn't detect the
|
||||
@ -158,11 +131,6 @@ macro(configure_unix_libs)
|
||||
|
||||
endif()
|
||||
|
||||
check_type_size(char SIZEOF_CHAR)
|
||||
check_type_size(int SIZEOF_INT)
|
||||
check_type_size(long SIZEOF_LONG)
|
||||
check_type_size(short SIZEOF_SHORT)
|
||||
|
||||
# pthread is used on both Linux and Mac
|
||||
check_library_exists("pthread" pthread_create "" HAVE_PTHREAD)
|
||||
if(HAVE_PTHREAD)
|
||||
@ -222,17 +190,10 @@ macro(configure_unix_libs)
|
||||
|
||||
# For config.h, set some static values; it may be a good idea to make these
|
||||
# values dynamic for non-standard UNIX compilers.
|
||||
set(ACCEPT_TYPE_ARG3 socklen_t)
|
||||
set(HAVE_CXX_BOOL 1)
|
||||
set(HAVE_CXX_CASTS 1)
|
||||
set(HAVE_CXX_EXCEPTIONS 1)
|
||||
set(HAVE_CXX_MUTABLE 1)
|
||||
set(HAVE_CXX_STDLIB 1)
|
||||
set(HAVE_PTHREAD_SIGNAL 1)
|
||||
set(SELECT_TYPE_ARG1 int)
|
||||
set(SELECT_TYPE_ARG234 " (fd_set *)")
|
||||
set(SELECT_TYPE_ARG5 " (struct timeval *)")
|
||||
set(STDC_HEADERS 1)
|
||||
set(TIME_WITH_SYS_TIME 1)
|
||||
set(HAVE_SOCKLEN_T 1)
|
||||
|
||||
@ -264,8 +225,6 @@ macro(configure_xorg_libs)
|
||||
HAVE_X11_EXTENSIONS_DPMS_H)
|
||||
check_include_files("X11/extensions/Xinerama.h"
|
||||
HAVE_X11_EXTENSIONS_XINERAMA_H)
|
||||
check_include_files("${XKBlib};X11/extensions/XKBstr.h"
|
||||
HAVE_X11_EXTENSIONS_XKBSTR_H)
|
||||
check_include_files("X11/extensions/XKB.h" HAVE_XKB_EXTENSION)
|
||||
check_include_files("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H)
|
||||
check_include_files("${XKBlib}" HAVE_X11_XKBLIB_H)
|
||||
|
||||
10
cspell.json
10
cspell.json
@ -11,9 +11,10 @@
|
||||
"codesigning",
|
||||
"Compat",
|
||||
"contribs",
|
||||
"daemonized",
|
||||
"Daun",
|
||||
"Devs",
|
||||
"Deskflow",
|
||||
"Devs",
|
||||
"distro",
|
||||
"distros",
|
||||
"dmgbuild",
|
||||
@ -24,6 +25,7 @@
|
||||
"gdrive",
|
||||
"Hadzhylov",
|
||||
"Hetu",
|
||||
"HINSTANCE",
|
||||
"hotspots",
|
||||
"Hutterer",
|
||||
"ifdef",
|
||||
@ -39,6 +41,7 @@
|
||||
"Libera",
|
||||
"libportal",
|
||||
"LLDB",
|
||||
"logonui",
|
||||
"Lysytsia",
|
||||
"macdeployqt",
|
||||
"msvc",
|
||||
@ -48,6 +51,8 @@
|
||||
"Oleksandr",
|
||||
"Olena",
|
||||
"outputdir",
|
||||
"outputter",
|
||||
"outputters",
|
||||
"pacman",
|
||||
"Petroules",
|
||||
"Pixmap",
|
||||
@ -57,6 +62,7 @@
|
||||
"Priddy",
|
||||
"psutil",
|
||||
"pyproject",
|
||||
"qobject",
|
||||
"qputenv",
|
||||
"readf",
|
||||
"Regen",
|
||||
@ -67,9 +73,11 @@
|
||||
"Schoeneman",
|
||||
"Serhii",
|
||||
"shemp",
|
||||
"SNAPPROCESS",
|
||||
"Sorin",
|
||||
"subproject",
|
||||
"subprojects",
|
||||
"Toolhelp",
|
||||
"trackpad",
|
||||
"Trixie",
|
||||
"unittests",
|
||||
|
||||
@ -12,9 +12,9 @@ file(COPY_FILE
|
||||
# Generic Package Items
|
||||
set(CPACK_STRIP_FILES TRUE)
|
||||
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
|
||||
set(CPACK_PACKAGE_CONTACT "Deskflow <maintainers@deskflow.org>")
|
||||
set(CPACK_PACKAGE_CONTACT ${CMAKE_PROJECT_CONTACT})
|
||||
set(CPACK_PACKAGE_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION})
|
||||
set(CPACK_PACKAGE_VENDOR "Deskflow")
|
||||
set(CPACK_PACKAGE_VENDOR ${CMAKE_PROJECT_VENDOR})
|
||||
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt)
|
||||
|
||||
set(CPACK_PACKAGE_VERSION ${CMAKE_PROJECT_VERSION})
|
||||
|
||||
@ -1,12 +1,16 @@
|
||||
# SPDX-FileCopyrightText: 2024 Deskflow Developers
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Maintainer: Deskflow Developers
|
||||
|
||||
pkgname=deskflow
|
||||
pkgver=@DESKFLOW_VERSION@
|
||||
pkgver=@CMAKE_PROJECT_VERSION@
|
||||
pkgrel=1
|
||||
pkgdesc="Mouse and keyboard sharing utility"
|
||||
url='https://deskflow.org'
|
||||
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
|
||||
license=('GPL-2.0-only')
|
||||
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
|
||||
license=(LicenseRef-GPL-2.0-only-WITH-OpenSSL-Exception)
|
||||
conflicts=('synergy-git' 'synergy-1.6' 'synergy1-bin' 'synergy2-bin' 'synergy3-bin' 'synergy3-beta-bin' 'synergy3-stable-bin' 'barrier' 'barrier-git' 'barrier-headless' 'barrier-headless-git' 'input-leap' 'input-leap-git' 'input-leap-headless-git' 'input-leap-headless' 'waynergy' 'waynergy-git' 'qsynergy' 'slim-synergy' 'quicksynergy' 'deskflow')
|
||||
provides=("deskflow-git${pkgver}")
|
||||
depends=(
|
||||
'gcc-libs'
|
||||
'glibc'
|
||||
@ -28,7 +32,6 @@ depends=(
|
||||
'tomlplusplus'
|
||||
'cli11'
|
||||
)
|
||||
conflicts=('synergy-git' 'synergy1-bin' 'synergy2-bin' 'synergy3-bin')
|
||||
options=('!debug')
|
||||
|
||||
package() {
|
||||
|
||||
@ -67,7 +67,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
# Check if Debian-link
|
||||
string(REGEX MATCH debian|buntu DEBTYPE "${DISTRO_LIKE}")
|
||||
if((NOT ("${DEBTYPE}" STREQUAL "")) OR ("${DISTRO_NAME}" STREQUAL "debian"))
|
||||
string(REGEX MATCH debian|deepin|uos DEBNAME "${DISTRO_NAME}")
|
||||
if((NOT ("${DEBTYPE}" STREQUAL "")) OR (NOT ("${DEBNAME}" STREQUAL "")))
|
||||
set(CPACK_GENERATOR "DEB")
|
||||
endif()
|
||||
|
||||
|
||||
6
deploy/linux/flatpak/ci-build-lint-exceptions.json
Normal file
6
deploy/linux/flatpak/ci-build-lint-exceptions.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"org.deskflow.deskflow": [
|
||||
"appstream-external-screenshot-url",
|
||||
"appstream-screenshots-not-mirrored-in-ostree"
|
||||
]
|
||||
}
|
||||
@ -1,3 +1,6 @@
|
||||
# SPDX-FileCopyrightText: 2024 Deskflow Developers
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Version=1.0
|
||||
|
||||
@ -4,7 +4,9 @@
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-2.0+</project_license>
|
||||
<name>Deskflow</name>
|
||||
<developer_name>Deskflow Developers</developer_name>
|
||||
<developer id="org.deskflow">
|
||||
<name>Deskflow Developers</name>
|
||||
</developer>
|
||||
<summary>Software Keyboard and mouse sharing</summary>
|
||||
<description>
|
||||
<p>
|
||||
@ -16,7 +18,12 @@
|
||||
<url type="bugtracker">https://github.com/deskflow/deskflow/issues</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://github.com/user-attachments/assets/883660dc-f3f5-4b69-8821-a079a58d3882</image>
|
||||
<image>https://deskflow.org/screenshots/deskflow.png</image>
|
||||
<caption>Deskflow's mainwindow on KDE</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://deskflow.org/screenshots/deskflow-dark.png</image>
|
||||
<caption>Deskflow's mainwindow on KDE (dark mode)</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<provides> <id>org.deskflow.deskflow.desktop</id> </provides>
|
||||
@ -35,9 +42,56 @@
|
||||
</branding>
|
||||
<content_rating type="oars-1.0" />
|
||||
<releases>
|
||||
<release version="1.20.1" date="2025-03-07" urgency="low">
|
||||
<description>
|
||||
<p>This stable release introduces a Windows dependency requirement and fixes a macOS bug.</p>
|
||||
<ul>
|
||||
<li>Fix: macOS menu bar icon invisible when menu bar is light</li>
|
||||
<li>Feature: Add Windows installer check for Visual C++ Redistributable</li>
|
||||
<li>Feature: Prevent Windows binaries running if MSVC runtime too old</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.20.1</url>
|
||||
</release>
|
||||
<release version="1.20.0" date="2025-03-03" urgency="high">
|
||||
<description>
|
||||
<p>This stable release fixes a few security issues, additionally fixes several bugs and adds a few new features. For the full changelog see the release page.</p>
|
||||
<ul>
|
||||
<li>Feature: Peer Id Checking - Fixes CVE-2021-42072 and CVE-2021-42073</li>
|
||||
<li>Feature: Use Sha256 fingerprints</li>
|
||||
<li>Feature: Gui cleanup and improvements</li>
|
||||
<li>Remove: Inverse connection option</li>
|
||||
<li>Fix: Screen Corner option</li>
|
||||
<li>Fix: Show new client dialog</li>
|
||||
<li>Win32: Daemon Improvements</li>
|
||||
<li>Win32: Fix clear settings</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.20.0</url>
|
||||
</release>
|
||||
<release version="1.19.0" date="2025-01-31" urgency="high">
|
||||
<description>
|
||||
<p>This stable release fixes several bugs and adds a few new features. For the full changelog see the release page.</p>
|
||||
<ul>
|
||||
<li>Feature: New Fallback icon theme</li>
|
||||
<li>Feature: Allow only one gui instance</li>
|
||||
<li>Fix: Modifier remapping on macOS</li>
|
||||
<li>Fix: Show Screen icons again in the server settings</li>
|
||||
<li>Fix: Show the TLS Label</li>
|
||||
<li>Fix: Mainwindow restore </li>
|
||||
<li>Fix: Hotkey with more then one action now work again</li>
|
||||
<li>Better Detection of evdev on BSD</li>
|
||||
<li>Better language detection on X11</li>
|
||||
<li>Better deal with screen changes on wayland</li>
|
||||
<li>Remove Legacy tray icons</li>
|
||||
<li>Lots of Internal Cleanup</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.19.0</url>
|
||||
</release>
|
||||
<release version="1.18.0" date="2024-12-26" urgency="high">
|
||||
<description>
|
||||
<p>This stable Release Fixes a few security issues, additionally fixes several bugs and adds a few new features. For the full changelog see the relase page.</p>
|
||||
<p>This stable release fixes a few security issues, additionally fixes several bugs and adds a few new features. For the full changelog see the release page.</p>
|
||||
<ul>
|
||||
<li>Fix CVE-2021-42075: Close connection on app-level handshake failure</li>
|
||||
<li>Fix CVE-2021-42074: Handle SSL race conditions and segmentation fault</li>
|
||||
@ -52,7 +106,7 @@
|
||||
<li>Update the windows clipboard format listener to monitor the clipboard</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.18.0</url>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.18.0</url>
|
||||
</release>
|
||||
<release version="1.17.2" date="2024-11-20" urgency="medium">
|
||||
<description>
|
||||
@ -106,11 +160,11 @@
|
||||
<li>ci: build flatpaks</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.17.2</url>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.17.2</url>
|
||||
</release>
|
||||
<release version="1.17.1" date="2024-11-7" urgency="high">
|
||||
<release version="1.17.1" date="2024-11-07" urgency="high">
|
||||
<description>
|
||||
<p>This stable Release Has a very long chagelog some notable ones are.</p>
|
||||
<p>This stable release has a very long changelog some notable ones are.</p>
|
||||
<ul>
|
||||
<li>Remove word 'beta' from Wayland message</li>
|
||||
<li>docs: Update `README.md` with Matrix link</li>
|
||||
@ -223,11 +277,11 @@
|
||||
<li>ci: adjust pacakge script to use the names we would like when in cpack</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.17.1</url>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.17.1</url>
|
||||
</release>
|
||||
<release version="1.17.0" date="2024-10-02" urgency="low">
|
||||
<description>
|
||||
<p>This is the first Deskflow Release.</p>
|
||||
<p>This is the first Deskflow release.</p>
|
||||
<ul>
|
||||
<li>Use Deskflow Name</li>
|
||||
<li>fix: windows build typos</li>
|
||||
@ -273,7 +327,7 @@
|
||||
<li>Use sonarsource/sonarcloud-github-c-cpp</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.17.0</url>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.17.0</url>
|
||||
</release>
|
||||
</releases>
|
||||
</component>
|
||||
|
||||
@ -5,11 +5,16 @@
|
||||
# calling CMAKE_CURRENT_LIST_DIR after include would return the wrong scope var
|
||||
set(MY_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
install(CODE "execute_process(COMMAND
|
||||
${DEPLOYQT}
|
||||
\"\${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_PROPER_NAME}.app\"
|
||||
-timestamp -codesign=-
|
||||
)")
|
||||
|
||||
set(OS_STRING "macos-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set(CMAKE_INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks")
|
||||
set(CPACK_PACKAGE_ICON "${MY_DIR}/dmg-volume.icns")
|
||||
set(CPACK_DMG_BACKGROUND_IMAGE "${MY_DIR}/dmg-background.tiff")
|
||||
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${MY_DIR}/generate_ds_store.applescript")
|
||||
set(CPACK_DMG_VOLUME_NAME "Deskflow")
|
||||
set(CPACK_DMG_VOLUME_NAME "${CMAKE_PROJECT_PROPER_NAME}")
|
||||
set(CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE ON)
|
||||
set(CPACK_GENERATOR "DragNDrop")
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
-- SPDX-FileCopyrightText: 2020 Chris Rizzitello <sithlord48@gmail.com>
|
||||
-- SPDX-License-Identifier: MIT
|
||||
|
||||
on run argv
|
||||
set image_name to item 1 of argv
|
||||
|
||||
|
||||
Binary file not shown.
@ -5,12 +5,9 @@
|
||||
# calling CMAKE_CURRENT_LIST_DIR after include would return the wrong scope var
|
||||
set(MY_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
|
||||
# Configure the windows version rc file
|
||||
configure_file(
|
||||
${MY_DIR}/version.rc.in
|
||||
${PROJECT_BINARY_DIR}/src/version.rc @ONLY
|
||||
)
|
||||
install(CODE "execute_process(
|
||||
COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network \"\${CMAKE_INSTALL_PREFIX}/deskflow.exe\"
|
||||
)")
|
||||
|
||||
# Setup OS_STRING
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES AMD64)
|
||||
@ -28,14 +25,14 @@ if (NOT "${WIX_APP}" STREQUAL "")
|
||||
list(APPEND CPACK_GENERATOR "WIX")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_NAME "Deskflow")
|
||||
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_PROPER_NAME}")
|
||||
|
||||
# Menu Entry
|
||||
set(CPACK_WIX_PROGRAM_MENU_FOLDER "Deskflow")
|
||||
set(CPACK_PACKAGE_EXECUTABLES "deskflow" "Deskflow")
|
||||
set(CPACK_WIX_PROGRAM_MENU_FOLDER "${CMAKE_PROJECT_PROPER_NAME}")
|
||||
set(CPACK_PACKAGE_EXECUTABLES "deskflow" "${CMAKE_PROJECT_PROPER_NAME}")
|
||||
|
||||
# Default Install Path
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Deskflow")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_PROPER_NAME}")
|
||||
|
||||
# Wix Specific Values
|
||||
set(CPACK_WIX_UPGRADE_GUID "027D1C8A-E7A5-4754-BB93-B2D45BFDBDC8")
|
||||
@ -49,7 +46,6 @@ list(APPEND CPACK_WIX_EXTENSIONS "WixToolset.Util.wixext" "WixToolset.Firewall.w
|
||||
list(APPEND CPACK_WIX_CUSTOM_XMLNS "util=http://wixtoolset.org/schemas/v4/wxs/util" "firewall=http://wixtoolset.org/schemas/v4/wxs/firewall")
|
||||
|
||||
# The patch has to know the full path of our msm file
|
||||
set(CPACK_WIX_MSM_FILE "${MY_DIR}/Microsoft_VC142_CRT_x64.msm")
|
||||
configure_file(
|
||||
${MY_DIR}/wix-patch.xml.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wix-patch.xml @ONLY
|
||||
|
||||
@ -1,54 +0,0 @@
|
||||
/*
|
||||
Based on example from:
|
||||
https://learn.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource?redirectedfrom=MSDN
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <verrsrc.h>
|
||||
|
||||
#define VER_FILEVERSION @DESKFLOW_VERSION_MS_CSV@
|
||||
#define VER_FILEVERSION_STR "@DESKFLOW_VERSION_MS@\0"
|
||||
|
||||
#define VER_PRODUCTVERSION @DESKFLOW_VERSION_MS_CSV@
|
||||
#define VER_PRODUCTVERSION_STR "@DESKFLOW_VERSION@\0"
|
||||
|
||||
#define VER_COMPANYNAME_STR "Deskflow\0"
|
||||
#define VER_FILEDESCRIPTION_STR "Deskflow\0"
|
||||
#define VER_INTERNALNAME_STR "Deskflow\0"
|
||||
#define VER_LEGALCOPYRIGHT_STR "© 2024 Deskflow Developers\0"
|
||||
#define VER_LEGALTRADEMARKS1_STR "All Rights Reserved\0"
|
||||
#define VER_LEGALTRADEMARKS2_STR "\0"
|
||||
#define VER_ORIGINALFILENAME_STR "\0"
|
||||
#define VER_PRODUCTNAME_STR "Deskflow\0"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION VER_FILEVERSION
|
||||
PRODUCTVERSION VER_PRODUCTVERSION
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
FILEFLAGS 0 // No flags
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILETYPE VFT_DLL
|
||||
FILESUBTYPE VFT2_UNKNOWN
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904E4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", VER_COMPANYNAME_STR
|
||||
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
|
||||
VALUE "FileVersion", VER_FILEVERSION_STR
|
||||
VALUE "InternalName", VER_INTERNALNAME_STR
|
||||
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
|
||||
VALUE "LegalTrademarks1", VER_LEGALTRADEMARKS1_STR
|
||||
VALUE "LegalTrademarks2", VER_LEGALTRADEMARKS2_STR
|
||||
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
|
||||
VALUE "ProductName", VER_PRODUCTNAME_STR
|
||||
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1252
|
||||
END
|
||||
END
|
||||
@ -1,25 +1,50 @@
|
||||
<CPackWiXPatch>
|
||||
<CPackWiXFragment Id="CM_CP_deskflow_daemon.exe">
|
||||
<ServiceInstall Description="Controls the Deskflow foreground processes." DisplayName="Deskflow" ErrorControl="normal" Id="ServiceInstall" Name="Deskflow" Start="auto" Type="ownProcess">
|
||||
<util:ServiceConfig FirstFailureActionType="restart" ResetPeriodInDays="1" RestartServiceDelayInSeconds="1" SecondFailureActionType="restart" ThirdFailureActionType="restart"/>
|
||||
<ServiceInstall
|
||||
Id="ServiceInstall"
|
||||
Name="Deskflow"
|
||||
DisplayName="Deskflow"
|
||||
Description="Runs the Core process on secure desktops (UAC prompts, login screen, etc)."
|
||||
ErrorControl="normal"
|
||||
Start="auto"
|
||||
Type="ownProcess">
|
||||
<util:ServiceConfig
|
||||
ResetPeriodInDays="1"
|
||||
RestartServiceDelayInSeconds="1"
|
||||
FirstFailureActionType="restart"
|
||||
SecondFailureActionType="restart"
|
||||
ThirdFailureActionType="none"
|
||||
/>
|
||||
</ServiceInstall>
|
||||
<ServiceControl Id="ServiceControl" Name="Deskflow" Remove="uninstall" Start="install" Stop="both"/>
|
||||
</CPackWiXFragment>
|
||||
|
||||
<CPackWiXFragment Id="CM_CP_deskflow_server.exe">
|
||||
<firewall:FirewallException Id="ServerFirewallException" Name="Deskflow Server" Program="[INSTALL_ROOT]deskflow-server.exe" Scope="any"/>
|
||||
</CPackWiXFragment>
|
||||
|
||||
<CPackWiXFragment Id="CM_CP_deskflow_client.exe">
|
||||
<firewall:FirewallException Id="ClientFirewallException" Name="Deskflow Client" Program="[INSTALL_ROOT]deskflow-client.exe" Scope="any"/>
|
||||
</CPackWiXFragment>
|
||||
|
||||
<CPackWiXFragment Id="#PRODUCT">
|
||||
<StandardDirectory Id="TARGETDIR">
|
||||
<Merge Id="VCRedist" SourceFile="@CPACK_WIX_MSM_FILE@" DiskId="1" Language="0"/>
|
||||
</StandardDirectory >
|
||||
<Feature Id="VCRedist" Title="Visual C++ Runtime" AllowAbsent="no" AllowAdvertise="yes" Display="hidden" InstallDefault="local" TypicalDefault="install">
|
||||
<MergeRef Id="VCRedist" Primary="yes"/>
|
||||
</Feature>
|
||||
<Property Id="VC_REDIST_INSTALLED">
|
||||
<RegistrySearch
|
||||
Id="FindVCRedist"
|
||||
Root="HKLM"
|
||||
Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64"
|
||||
Name="Installed"
|
||||
Type="raw" />
|
||||
</Property>
|
||||
|
||||
<CustomAction Id="Run_Deskflow" ExeCommand="Deskflow" FileRef="CM_FP_deskflow.exe" Return="asyncNoWait"/>
|
||||
|
||||
<CustomAction
|
||||
Id="ShowVCRedistError"
|
||||
Error="Latest Microsoft Visual C++ Redistributable is required. Please install it before proceeding."/>
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action="ShowVCRedistError" Before="InstallServices" Condition="NOT Installed AND NOT VC_REDIST_INSTALLED"/>
|
||||
<Custom Action="Run_Deskflow" OnExit="success" Condition="NOT Installed"/>
|
||||
</InstallExecuteSequence>
|
||||
</CPackWiXFragment>
|
||||
|
||||
@ -6,7 +6,10 @@ sonar.exclusions=subprojects/**,build/**
|
||||
sonar.coverage.exclusions=subprojects/**,src/test/**,src/apps/deskflow-gui/**,src/apps/res/**
|
||||
sonar.cpd.exclusions=**/*Test*.cpp
|
||||
sonar.host.url=https://sonarcloud.io
|
||||
sonar.coverageReportPaths=${{ steps.coverage-paths.outputs.csv }}
|
||||
sonar.cfamily.compile-commands=build/compile_commands.json
|
||||
sonar.cfamily.threads=${{ env.CPU_CORE_COUNT }}
|
||||
sonar.python.version=3.10
|
||||
|
||||
# Allow use of `new` which is idiomatic for Qt code.
|
||||
sonar.issue.ignore.multicriteria=e1
|
||||
sonar.issue.ignore.multicriteria.e1.ruleKey=cpp:S5025
|
||||
sonar.issue.ignore.multicriteria.e1.resourceKey=**
|
||||
|
||||
@ -1,18 +1,7 @@
|
||||
# Deskflow -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2012-2024 Symless Ltd.
|
||||
# Copyright (C) 2009-2012 Nick Bolton
|
||||
#
|
||||
# This package is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# found in the file LICENSE that should have accompanied this file.
|
||||
#
|
||||
# This package is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# SPDX-FileCopyrightText: 2024 Deskflow Developers
|
||||
# SPDX-FileCopyrightText: 2012 - 2024 Symless Ltd
|
||||
# SPDX-FileCopyrightText: 2009 - 2012 Nick Bolton
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
include_directories(./lib)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||
|
||||
@ -1,18 +1,7 @@
|
||||
# Deskflow -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2012-2024 Symless Ltd.
|
||||
# Copyright (C) 2009-2012 Nick Bolton
|
||||
#
|
||||
# This package is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# found in the file LICENSE that should have accompanied this file.
|
||||
#
|
||||
# This package is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# SPDX-FileCopyrightText: 2024 Deskflow Developers
|
||||
# SPDX-FileCopyrightText: 2012 - 2024 Symless Ltd
|
||||
# SPDX-FileCopyrightText: 2009 - 2012 Nick Bolton
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
option(BUILD_UNIFIED "Build unified binary" OFF)
|
||||
if(BUILD_UNIFIED)
|
||||
|
||||
1
src/apps/deskflow-client/.gitignore
vendored
1
src/apps/deskflow-client/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/*.aps
|
||||
@ -1,48 +1,28 @@
|
||||
# Deskflow -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# Copyright (C) 2012-2024 Symless Ltd.
|
||||
# Copyright (C) 2009-2012 Nick Bolton
|
||||
#
|
||||
# This package is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# found in the file LICENSE that should have accompanied this file.
|
||||
#
|
||||
# This package is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# SPDX-FileCopyrightText: 2024 - 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2012 - 2024 Symless Ltd
|
||||
# SPDX-FileCopyrightText: 2009 - 2012 Nick Bolton
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set(target deskflow-client)
|
||||
set(target ${CMAKE_PROJECT_NAME}-client)
|
||||
|
||||
if(WIN32)
|
||||
# Generate rc file
|
||||
set(EXE_DESCRIPTION "${CMAKE_PROJECT_PROPER_NAME} client application")
|
||||
|
||||
set(EXE_ICON "
|
||||
IDI_DESKFLOW ICON DISCARDABLE \"${CMAKE_SOURCE_DIR}/src/apps/res/deskflow.ico\"
|
||||
")
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/windows.rc.in ${target}.rc)
|
||||
|
||||
set(PLATFORM_SOURCES
|
||||
deskflow-client.exe.manifest
|
||||
deskflow-client.rc
|
||||
MSWindowsClientTaskBarReceiver.cpp
|
||||
MSWindowsClientTaskBarReceiver.h
|
||||
resource.h
|
||||
${target}.exe.manifest
|
||||
${PROJECT_SOURCE_DIR}/src/apps/res/deskflow.ico
|
||||
${PROJECT_SOURCE_DIR}/src/apps/res/tb_error.ico
|
||||
${PROJECT_SOURCE_DIR}/src/apps/res/tb_idle.ico
|
||||
${PROJECT_SOURCE_DIR}/src/apps/res/tb_run.ico
|
||||
${PROJECT_BINARY_DIR}/src/version.rc
|
||||
)
|
||||
elseif(APPLE)
|
||||
set(PLATFORM_SOURCES
|
||||
OSXClientTaskBarReceiver.cpp
|
||||
OSXClientTaskBarReceiver.h
|
||||
)
|
||||
elseif(UNIX)
|
||||
set(PLATFORM_SOURCES
|
||||
XWindowsClientTaskBarReceiver.cpp
|
||||
XWindowsClientTaskBarReceiver.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}.rc
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable(${target} ${PLATFORM_SOURCES} deskflow-client.cpp)
|
||||
add_executable(${target} ${PLATFORM_SOURCES} ${target}.cpp)
|
||||
|
||||
target_link_libraries(
|
||||
${target}
|
||||
@ -52,17 +32,20 @@ target_link_libraries(
|
||||
io
|
||||
mt
|
||||
net
|
||||
ipc
|
||||
platform
|
||||
server
|
||||
app
|
||||
${libs})
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY $<TARGET_BUNDLE_CONTENT_DIR:Deskflow>/MacOS)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
if(APPLE)
|
||||
set_target_properties(${target} PROPERTIES
|
||||
BUILD_WITH_INSTALL_RPATH TRUE
|
||||
INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks"
|
||||
RUNTIME_OUTPUT_DIRECTORY $<TARGET_BUNDLE_CONTENT_DIR:${CMAKE_PROJECT_PROPER_NAME}>/MacOS
|
||||
)
|
||||
elseif(UNIX)
|
||||
install(TARGETS ${target} DESTINATION bin)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
elseif(WIN32)
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME_DEPENDENCY_SET clientDeps
|
||||
|
||||
@ -1,333 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2003 Chris Schoeneman
|
||||
*
|
||||
* 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 "MSWindowsClientTaskBarReceiver.h"
|
||||
|
||||
#include "arch/Arch.h"
|
||||
#include "arch/win32/ArchMiscWindows.h"
|
||||
#include "arch/win32/ArchTaskBarWindows.h"
|
||||
#include "base/EventQueue.h"
|
||||
#include "base/EventTypes.h"
|
||||
#include "base/log_outputters.h"
|
||||
#include "client/Client.h"
|
||||
#include "platform/MSWindowsClipboard.h"
|
||||
#include "platform/MSWindowsScreen.h"
|
||||
#include "resource.h"
|
||||
|
||||
//
|
||||
// MSWindowsClientTaskBarReceiver
|
||||
//
|
||||
|
||||
const UINT MSWindowsClientTaskBarReceiver::s_stateToIconID[kMaxState] = {
|
||||
IDI_TASKBAR_NOT_RUNNING, IDI_TASKBAR_NOT_WORKING, IDI_TASKBAR_NOT_CONNECTED, IDI_TASKBAR_CONNECTED
|
||||
};
|
||||
|
||||
MSWindowsClientTaskBarReceiver::MSWindowsClientTaskBarReceiver(
|
||||
HINSTANCE appInstance, const BufferedLogOutputter *logBuffer, IEventQueue *events
|
||||
)
|
||||
: ClientTaskBarReceiver(events),
|
||||
m_appInstance(appInstance),
|
||||
m_window(NULL),
|
||||
m_logBuffer(logBuffer)
|
||||
{
|
||||
for (UInt32 i = 0; i < kMaxState; ++i) {
|
||||
m_icon[i] = loadIcon(s_stateToIconID[i]);
|
||||
}
|
||||
m_menu = LoadMenu(m_appInstance, MAKEINTRESOURCE(IDR_TASKBAR));
|
||||
|
||||
// don't create the window yet. we'll create it on demand. this
|
||||
// has the side benefit of being created in the thread used for
|
||||
// the task bar. that's good because it means the existence of
|
||||
// the window won't prevent changing the main thread's desktop.
|
||||
|
||||
// add ourself to the task bar
|
||||
ARCH->addReceiver(this);
|
||||
}
|
||||
|
||||
MSWindowsClientTaskBarReceiver::~MSWindowsClientTaskBarReceiver()
|
||||
{
|
||||
cleanup();
|
||||
}
|
||||
|
||||
void MSWindowsClientTaskBarReceiver::cleanup()
|
||||
{
|
||||
ARCH->removeReceiver(this);
|
||||
for (UInt32 i = 0; i < kMaxState; ++i) {
|
||||
deleteIcon(m_icon[i]);
|
||||
}
|
||||
DestroyMenu(m_menu);
|
||||
destroyWindow();
|
||||
}
|
||||
|
||||
void MSWindowsClientTaskBarReceiver::showStatus()
|
||||
{
|
||||
// create the window
|
||||
createWindow();
|
||||
|
||||
// lock self while getting status
|
||||
lock();
|
||||
|
||||
// get the current status
|
||||
std::string status = getToolTip();
|
||||
|
||||
// done getting status
|
||||
unlock();
|
||||
|
||||
// update dialog
|
||||
HWND child = GetDlgItem(m_window, IDC_TASKBAR_STATUS_STATUS);
|
||||
SendMessage(child, WM_SETTEXT, 0, (LPARAM)status.c_str());
|
||||
|
||||
if (!IsWindowVisible(m_window)) {
|
||||
// position it by the mouse
|
||||
POINT cursorPos;
|
||||
GetCursorPos(&cursorPos);
|
||||
RECT windowRect;
|
||||
GetWindowRect(m_window, &windowRect);
|
||||
int x = cursorPos.x;
|
||||
int y = cursorPos.y;
|
||||
int fw = GetSystemMetrics(SM_CXDLGFRAME);
|
||||
int fh = GetSystemMetrics(SM_CYDLGFRAME);
|
||||
int ww = windowRect.right - windowRect.left;
|
||||
int wh = windowRect.bottom - windowRect.top;
|
||||
int sw = GetSystemMetrics(SM_CXFULLSCREEN);
|
||||
int sh = GetSystemMetrics(SM_CYFULLSCREEN);
|
||||
if (fw < 1) {
|
||||
fw = 1;
|
||||
}
|
||||
if (fh < 1) {
|
||||
fh = 1;
|
||||
}
|
||||
if (x + ww - fw > sw) {
|
||||
x -= ww - fw;
|
||||
} else {
|
||||
x -= fw;
|
||||
}
|
||||
if (x < 0) {
|
||||
x = 0;
|
||||
}
|
||||
if (y + wh - fh > sh) {
|
||||
y -= wh - fh;
|
||||
} else {
|
||||
y -= fh;
|
||||
}
|
||||
if (y < 0) {
|
||||
y = 0;
|
||||
}
|
||||
SetWindowPos(m_window, HWND_TOPMOST, x, y, ww, wh, SWP_SHOWWINDOW);
|
||||
}
|
||||
}
|
||||
|
||||
void MSWindowsClientTaskBarReceiver::runMenu(int x, int y)
|
||||
{
|
||||
// do popup menu. we need a window to pass to TrackPopupMenu().
|
||||
// the SetForegroundWindow() and SendMessage() calls around
|
||||
// TrackPopupMenu() are to get the menu to be dismissed when
|
||||
// another window gets activated and are just one of those
|
||||
// win32 weirdnesses.
|
||||
createWindow();
|
||||
SetForegroundWindow(m_window);
|
||||
HMENU menu = GetSubMenu(m_menu, 0);
|
||||
SetMenuDefaultItem(menu, IDC_TASKBAR_STATUS, FALSE);
|
||||
HMENU logLevelMenu = GetSubMenu(menu, 3);
|
||||
CheckMenuRadioItem(logLevelMenu, 0, 6, CLOG->getFilter() - kERROR, MF_BYPOSITION);
|
||||
int n =
|
||||
TrackPopupMenu(menu, TPM_NONOTIFY | TPM_RETURNCMD | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, x, y, 0, m_window, NULL);
|
||||
SendMessage(m_window, WM_NULL, 0, 0);
|
||||
|
||||
// perform the requested operation
|
||||
switch (n) {
|
||||
case IDC_TASKBAR_STATUS:
|
||||
showStatus();
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG:
|
||||
copyLog();
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_SHOW_LOG:
|
||||
ARCH->showConsole(true);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_ERROR:
|
||||
CLOG->setFilter(kERROR);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_WARNING:
|
||||
CLOG->setFilter(kWARNING);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_NOTE:
|
||||
CLOG->setFilter(kNOTE);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_INFO:
|
||||
CLOG->setFilter(kINFO);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_DEBUG:
|
||||
CLOG->setFilter(kDEBUG);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_DEBUG1:
|
||||
CLOG->setFilter(kDEBUG1);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_DEBUG2:
|
||||
CLOG->setFilter(kDEBUG2);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_QUIT:
|
||||
quit();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MSWindowsClientTaskBarReceiver::primaryAction()
|
||||
{
|
||||
showStatus();
|
||||
}
|
||||
|
||||
IArchTaskBarReceiver::Icon MSWindowsClientTaskBarReceiver::getIcon() const
|
||||
{
|
||||
return static_cast<Icon>(m_icon[getStatus()]);
|
||||
}
|
||||
|
||||
void MSWindowsClientTaskBarReceiver::copyLog() const
|
||||
{
|
||||
if (m_logBuffer != NULL) {
|
||||
// collect log buffer
|
||||
String data;
|
||||
for (BufferedLogOutputter::const_iterator index = m_logBuffer->begin(); index != m_logBuffer->end(); ++index) {
|
||||
data += *index;
|
||||
data += "\n";
|
||||
}
|
||||
|
||||
// copy log to clipboard
|
||||
if (!data.empty()) {
|
||||
MSWindowsClipboard clipboard(m_window);
|
||||
clipboard.open(0);
|
||||
clipboard.emptyUnowned();
|
||||
clipboard.add(IClipboard::kText, data);
|
||||
clipboard.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MSWindowsClientTaskBarReceiver::onStatusChanged()
|
||||
{
|
||||
if (IsWindowVisible(m_window)) {
|
||||
showStatus();
|
||||
}
|
||||
}
|
||||
|
||||
HICON
|
||||
MSWindowsClientTaskBarReceiver::loadIcon(UINT id)
|
||||
{
|
||||
HANDLE icon = LoadImage(m_appInstance, MAKEINTRESOURCE(id), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
|
||||
return static_cast<HICON>(icon);
|
||||
}
|
||||
|
||||
void MSWindowsClientTaskBarReceiver::deleteIcon(HICON icon)
|
||||
{
|
||||
if (icon != NULL) {
|
||||
DestroyIcon(icon);
|
||||
}
|
||||
}
|
||||
|
||||
void MSWindowsClientTaskBarReceiver::createWindow()
|
||||
{
|
||||
// ignore if already created
|
||||
if (m_window != NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
// get the status dialog
|
||||
m_window = CreateDialogParam(
|
||||
m_appInstance, MAKEINTRESOURCE(IDD_TASKBAR_STATUS), NULL, (DLGPROC)&MSWindowsClientTaskBarReceiver::staticDlgProc,
|
||||
reinterpret_cast<LPARAM>(static_cast<void *>(this))
|
||||
);
|
||||
|
||||
// window should appear on top of everything, including (especially)
|
||||
// the task bar.
|
||||
LONG_PTR style = GetWindowLongPtr(m_window, GWL_EXSTYLE);
|
||||
style |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
|
||||
SetWindowLongPtr(m_window, GWL_EXSTYLE, style);
|
||||
|
||||
// tell the task bar about this dialog
|
||||
ArchTaskBarWindows::addDialog(m_window);
|
||||
}
|
||||
|
||||
void MSWindowsClientTaskBarReceiver::destroyWindow()
|
||||
{
|
||||
if (m_window != NULL) {
|
||||
ArchTaskBarWindows::removeDialog(m_window);
|
||||
DestroyWindow(m_window);
|
||||
m_window = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL MSWindowsClientTaskBarReceiver::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM)
|
||||
{
|
||||
switch (msg) {
|
||||
case WM_INITDIALOG:
|
||||
// use default focus
|
||||
return TRUE;
|
||||
|
||||
case WM_ACTIVATE:
|
||||
// hide when another window is activated
|
||||
if (LOWORD(wParam) == WA_INACTIVE) {
|
||||
ShowWindow(hwnd, SW_HIDE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK MSWindowsClientTaskBarReceiver::staticDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
// if msg is WM_INITDIALOG, extract the MSWindowsClientTaskBarReceiver*
|
||||
// and put it in the extra window data then forward the call.
|
||||
MSWindowsClientTaskBarReceiver *self = NULL;
|
||||
if (msg == WM_INITDIALOG) {
|
||||
self = static_cast<MSWindowsClientTaskBarReceiver *>(reinterpret_cast<void *>(lParam));
|
||||
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)lParam);
|
||||
} else {
|
||||
// get the extra window data and forward the call
|
||||
LONG_PTR data = GetWindowLongPtr(hwnd, GWLP_USERDATA);
|
||||
if (data != 0) {
|
||||
self = (MSWindowsClientTaskBarReceiver *)data;
|
||||
}
|
||||
}
|
||||
|
||||
// forward the message
|
||||
if (self != NULL) {
|
||||
return self->dlgProc(hwnd, msg, wParam, lParam);
|
||||
} else {
|
||||
return (msg == WM_INITDIALOG) ? TRUE : FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
IArchTaskBarReceiver *createTaskBarReceiver(const BufferedLogOutputter *logBuffer, IEventQueue *events)
|
||||
{
|
||||
ArchMiscWindows::setIcons(
|
||||
(HICON)LoadImage(ArchMiscWindows::instanceWin32(), MAKEINTRESOURCE(IDI_DESKFLOW), IMAGE_ICON, 32, 32, LR_SHARED),
|
||||
(HICON)LoadImage(ArchMiscWindows::instanceWin32(), MAKEINTRESOURCE(IDI_DESKFLOW), IMAGE_ICON, 16, 16, LR_SHARED)
|
||||
);
|
||||
|
||||
return new MSWindowsClientTaskBarReceiver(MSWindowsScreen::getWindowInstance(), logBuffer, events);
|
||||
}
|
||||
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2003 Chris Schoeneman
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "deskflow/ClientTaskBarReceiver.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
|
||||
class BufferedLogOutputter;
|
||||
class IEventQueue;
|
||||
|
||||
//! Implementation of ClientTaskBarReceiver for Microsoft Windows
|
||||
class MSWindowsClientTaskBarReceiver : public ClientTaskBarReceiver
|
||||
{
|
||||
public:
|
||||
MSWindowsClientTaskBarReceiver(HINSTANCE, const BufferedLogOutputter *, IEventQueue *events);
|
||||
virtual ~MSWindowsClientTaskBarReceiver();
|
||||
|
||||
// IArchTaskBarReceiver overrides
|
||||
void showStatus() override;
|
||||
void runMenu(int x, int y) override;
|
||||
void primaryAction() override;
|
||||
Icon getIcon() const override;
|
||||
void cleanup();
|
||||
|
||||
protected:
|
||||
void copyLog() const;
|
||||
|
||||
// ClientTaskBarReceiver overrides
|
||||
virtual void onStatusChanged();
|
||||
|
||||
private:
|
||||
HICON loadIcon(UINT);
|
||||
void deleteIcon(HICON);
|
||||
void createWindow();
|
||||
void destroyWindow();
|
||||
|
||||
BOOL dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
static BOOL CALLBACK staticDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
private:
|
||||
HINSTANCE m_appInstance;
|
||||
HWND m_window;
|
||||
HMENU m_menu;
|
||||
HICON m_icon[kMaxState];
|
||||
const BufferedLogOutputter *m_logBuffer;
|
||||
|
||||
static const UINT s_stateToIconID[];
|
||||
};
|
||||
@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2004 Chris Schoeneman
|
||||
*
|
||||
* 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 "OSXClientTaskBarReceiver.h"
|
||||
#include "arch/Arch.h"
|
||||
|
||||
//
|
||||
// OSXClientTaskBarReceiver
|
||||
//
|
||||
|
||||
OSXClientTaskBarReceiver::OSXClientTaskBarReceiver(const BufferedLogOutputter *, IEventQueue *events)
|
||||
: ClientTaskBarReceiver(events)
|
||||
{
|
||||
// add ourself to the task bar
|
||||
ARCH->addReceiver(this);
|
||||
}
|
||||
|
||||
OSXClientTaskBarReceiver::~OSXClientTaskBarReceiver()
|
||||
{
|
||||
ARCH->removeReceiver(this);
|
||||
}
|
||||
|
||||
void OSXClientTaskBarReceiver::showStatus()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void OSXClientTaskBarReceiver::runMenu(int, int)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void OSXClientTaskBarReceiver::primaryAction()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
IArchTaskBarReceiver::Icon OSXClientTaskBarReceiver::getIcon() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
IArchTaskBarReceiver *createTaskBarReceiver(const BufferedLogOutputter *logBuffer, IEventQueue *events)
|
||||
{
|
||||
return new OSXClientTaskBarReceiver(logBuffer, events);
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2004 Chris Schoeneman
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "deskflow/ClientTaskBarReceiver.h"
|
||||
|
||||
class BufferedLogOutputter;
|
||||
class IEventQueue;
|
||||
|
||||
//! Implementation of ClientTaskBarReceiver for OS X
|
||||
class OSXClientTaskBarReceiver : public ClientTaskBarReceiver
|
||||
{
|
||||
public:
|
||||
OSXClientTaskBarReceiver(const BufferedLogOutputter *, IEventQueue *events);
|
||||
virtual ~OSXClientTaskBarReceiver();
|
||||
|
||||
// IArchTaskBarReceiver overrides
|
||||
void showStatus() override;
|
||||
void runMenu(int x, int y) override;
|
||||
void primaryAction() override;
|
||||
Icon getIcon() const override;
|
||||
};
|
||||
@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2003 Chris Schoeneman
|
||||
*
|
||||
* 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 "XWindowsClientTaskBarReceiver.h"
|
||||
#include "arch/Arch.h"
|
||||
|
||||
//
|
||||
// CXWindowsClientTaskBarReceiver
|
||||
//
|
||||
|
||||
CXWindowsClientTaskBarReceiver::CXWindowsClientTaskBarReceiver(const BufferedLogOutputter *, IEventQueue *events)
|
||||
: ClientTaskBarReceiver(events)
|
||||
{
|
||||
// add ourself to the task bar
|
||||
ARCH->addReceiver(this);
|
||||
}
|
||||
|
||||
CXWindowsClientTaskBarReceiver::~CXWindowsClientTaskBarReceiver()
|
||||
{
|
||||
ARCH->removeReceiver(this);
|
||||
}
|
||||
|
||||
void CXWindowsClientTaskBarReceiver::showStatus()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void CXWindowsClientTaskBarReceiver::runMenu(int, int)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void CXWindowsClientTaskBarReceiver::primaryAction()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
IArchTaskBarReceiver::Icon CXWindowsClientTaskBarReceiver::getIcon() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
IArchTaskBarReceiver *createTaskBarReceiver(const BufferedLogOutputter *logBuffer, IEventQueue *events)
|
||||
{
|
||||
return new CXWindowsClientTaskBarReceiver(logBuffer, events);
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2003 Chris Schoeneman
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "deskflow/ClientTaskBarReceiver.h"
|
||||
|
||||
class BufferedLogOutputter;
|
||||
class IEventQueue;
|
||||
|
||||
//! Implementation of ClientTaskBarReceiver for X Windows
|
||||
class CXWindowsClientTaskBarReceiver : public ClientTaskBarReceiver
|
||||
{
|
||||
public:
|
||||
CXWindowsClientTaskBarReceiver(const BufferedLogOutputter *, IEventQueue *events);
|
||||
CXWindowsClientTaskBarReceiver(const CXWindowsClientTaskBarReceiver &) = delete;
|
||||
CXWindowsClientTaskBarReceiver(CXWindowsClientTaskBarReceiver &&) = delete;
|
||||
virtual ~CXWindowsClientTaskBarReceiver();
|
||||
|
||||
CXWindowsClientTaskBarReceiver &operator=(const CXWindowsClientTaskBarReceiver &) = delete;
|
||||
CXWindowsClientTaskBarReceiver &operator=(CXWindowsClientTaskBarReceiver &&) = delete;
|
||||
|
||||
// IArchTaskBarReceiver overrides
|
||||
void showStatus() override;
|
||||
void runMenu(int x, int y) override;
|
||||
void primaryAction() override;
|
||||
Icon getIcon() const override;
|
||||
};
|
||||
@ -1,19 +1,9 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2002 Chris Schoeneman
|
||||
*
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "arch/Arch.h"
|
||||
@ -25,19 +15,11 @@
|
||||
#include "arch/win32/ArchMiscWindows.h"
|
||||
#endif
|
||||
|
||||
#if WINAPI_MSWINDOWS
|
||||
#include "MSWindowsClientTaskBarReceiver.h"
|
||||
#elif WINAPI_XWINDOWS
|
||||
#include "XWindowsClientTaskBarReceiver.h"
|
||||
#elif WINAPI_CARBON
|
||||
#include "OSXClientTaskBarReceiver.h"
|
||||
#else
|
||||
#error Platform not supported.
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#if SYSAPI_WIN32
|
||||
ArchMiscWindows::guardRuntimeVersion();
|
||||
|
||||
// record window instance for tray icon, etc
|
||||
ArchMiscWindows::setInstanceWin32(GetModuleHandle(NULL));
|
||||
#endif
|
||||
@ -48,6 +30,6 @@ int main(int argc, char **argv)
|
||||
Log log;
|
||||
EventQueue events;
|
||||
|
||||
ClientApp app(&events, createTaskBarReceiver);
|
||||
ClientApp app(&events);
|
||||
return app.run(argc, argv);
|
||||
}
|
||||
|
||||
@ -1,141 +0,0 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include <winresrc.h>
|
||||
#if !defined(IDC_STATIC)
|
||||
#define IDC_STATIC (-1)
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include <winresrc.h>\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_DESKFLOW ICON DISCARDABLE "../res/deskflow.ico"
|
||||
IDI_TASKBAR_NOT_RUNNING ICON DISCARDABLE "../res/tb_idle.ico"
|
||||
IDI_TASKBAR_NOT_WORKING ICON DISCARDABLE "../res/tb_error.ico"
|
||||
IDI_TASKBAR_NOT_CONNECTED ICON DISCARDABLE "../res/deskflow.ico"
|
||||
IDI_TASKBAR_CONNECTED ICON DISCARDABLE "../res/tb_run.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_TASKBAR_STATUS DIALOG DISCARDABLE 0, 0, 145, 18
|
||||
STYLE DS_MODALFRAME | WS_POPUP
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
EDITTEXT IDC_TASKBAR_STATUS_STATUS,3,3,139,12,ES_AUTOHSCROLL |
|
||||
ES_READONLY | NOT WS_BORDER
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_TASKBAR MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "Deskflow"
|
||||
BEGIN
|
||||
MENUITEM "Show Status", IDC_TASKBAR_STATUS
|
||||
MENUITEM "Show Log", IDC_TASKBAR_SHOW_LOG
|
||||
MENUITEM "Copy Log To Clipboard", IDC_TASKBAR_LOG
|
||||
POPUP "Set Log Level"
|
||||
BEGIN
|
||||
MENUITEM "Error", IDC_TASKBAR_LOG_LEVEL_ERROR
|
||||
|
||||
MENUITEM "Warning", IDC_TASKBAR_LOG_LEVEL_WARNING
|
||||
|
||||
MENUITEM "Note", IDC_TASKBAR_LOG_LEVEL_NOTE
|
||||
|
||||
MENUITEM "Info", IDC_TASKBAR_LOG_LEVEL_INFO
|
||||
|
||||
MENUITEM "Debug", IDC_TASKBAR_LOG_LEVEL_DEBUG
|
||||
|
||||
MENUITEM "Debug1", IDC_TASKBAR_LOG_LEVEL_DEBUG1
|
||||
|
||||
MENUITEM "Debug2", IDC_TASKBAR_LOG_LEVEL_DEBUG2
|
||||
|
||||
END
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Quit", IDC_TASKBAR_QUIT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_FAILED "Deskflow is about to quit with errors or warnings. Please check the log then click OK."
|
||||
IDS_INIT_FAILED "Deskflow failed to initialize: %{1}"
|
||||
IDS_UNCAUGHT_EXCEPTION "Uncaught exception: %{1}"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by deskflowc.rc
|
||||
//
|
||||
#define IDS_FAILED 1
|
||||
#define IDS_INIT_FAILED 2
|
||||
#define IDS_UNCAUGHT_EXCEPTION 3
|
||||
#define IDI_DESKFLOW 101
|
||||
#define IDI_TASKBAR_NOT_RUNNING 102
|
||||
#define IDI_TASKBAR_NOT_WORKING 103
|
||||
#define IDI_TASKBAR_NOT_CONNECTED 104
|
||||
#define IDI_TASKBAR_CONNECTED 105
|
||||
#define IDR_TASKBAR 107
|
||||
#define IDD_TASKBAR_STATUS 108
|
||||
#define IDC_TASKBAR_STATUS_STATUS 1000
|
||||
#define IDC_TASKBAR_QUIT 40001
|
||||
#define IDC_TASKBAR_STATUS 40002
|
||||
#define IDC_TASKBAR_LOG 40003
|
||||
#define IDC_TASKBAR_SHOW_LOG 40004
|
||||
#define IDC_TASKBAR_LOG_LEVEL_ERROR 40009
|
||||
#define IDC_TASKBAR_LOG_LEVEL_WARNING 40010
|
||||
#define IDC_TASKBAR_LOG_LEVEL_NOTE 40011
|
||||
#define IDC_TASKBAR_LOG_LEVEL_INFO 40012
|
||||
#define IDC_TASKBAR_LOG_LEVEL_DEBUG 40013
|
||||
#define IDC_TASKBAR_LOG_LEVEL_DEBUG1 40014
|
||||
#define IDC_TASKBAR_LOG_LEVEL_DEBUG2 40015
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 109
|
||||
#define _APS_NEXT_COMMAND_VALUE 40016
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@ -1,27 +1,21 @@
|
||||
# Deskflow -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# Copyright (C) 2012-2024 Symless Ltd.
|
||||
# Copyright (C) 2009-2012 Nick Bolton
|
||||
#
|
||||
# This package is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# found in the file LICENSE that should have accompanied this file.
|
||||
#
|
||||
# This package is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# SPDX-FileCopyrightText: 2024 - 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2012 - 2024 Symless Ltd
|
||||
# SPDX-FileCopyrightText: 2009 - 2012 Nick Bolton
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set(target deskflow-core)
|
||||
set(target ${CMAKE_PROJECT_NAME}-core)
|
||||
|
||||
add_executable(${target} "${target}.cpp")
|
||||
if(WIN32)
|
||||
# Generate rc file
|
||||
set(EXE_DESCRIPTION "${CMAKE_PROJECT_PROPER_NAME} combined server and client application")
|
||||
set(EXE_ICON "IDI_DESKFLOW ICON DISCARDABLE \"${CMAKE_SOURCE_DIR}/src/apps/res/deskflow.ico\"")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/windows.rc.in ${target}.rc)
|
||||
|
||||
target_sources(${target} PRIVATE
|
||||
"${target}.exe.manifest"
|
||||
"${PROJECT_BINARY_DIR}/src/version.rc"
|
||||
${target}.exe.manifest
|
||||
${CMAKE_SOURCE_DIR}/src/apps/res/deskflow.ico
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}.rc
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -33,17 +27,20 @@ target_link_libraries(
|
||||
io
|
||||
mt
|
||||
net
|
||||
ipc
|
||||
platform
|
||||
server
|
||||
app
|
||||
${libs})
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY $<TARGET_BUNDLE_CONTENT_DIR:Deskflow>/MacOS)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
if(APPLE)
|
||||
set_target_properties(${target} PROPERTIES
|
||||
BUILD_WITH_INSTALL_RPATH TRUE
|
||||
INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks"
|
||||
RUNTIME_OUTPUT_DIRECTORY $<TARGET_BUNDLE_CONTENT_DIR:${CMAKE_PROJECT_PROPER_NAME}>/MacOS
|
||||
)
|
||||
elseif(UNIX)
|
||||
install(TARGETS ${target} DESTINATION bin)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
elseif(WIN32)
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME_DEPENDENCY_SET coreDeps
|
||||
|
||||
@ -1,36 +1,28 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2022 Symless Ltd.
|
||||
* Copyright (C) 2002 Chris Schoeneman
|
||||
*
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "arch/Arch.h"
|
||||
#include "base/EventQueue.h"
|
||||
#include "base/Log.h"
|
||||
#include "deskflow/ClientApp.h"
|
||||
#include "deskflow/ServerApp.h"
|
||||
#include <iostream>
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
#include "arch/win32/ArchMiscWindows.h"
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
|
||||
void showHelp()
|
||||
{
|
||||
std::cout << "Usage: " CORE_BINARY_NAME " <server | client> [...options]" << std::endl;
|
||||
std::cout << "server - start as a server ( deskflow-server)" << std::endl;
|
||||
std::cout << "client - start as a client ( deslflow-client)" << std::endl;
|
||||
std::cout << "Usage: deskflow-core <server | client> [...options]" << std::endl;
|
||||
std::cout << "server - start as a server (deskflow-server)" << std::endl;
|
||||
std::cout << "client - start as a client (deskflow-client)" << std::endl;
|
||||
std::cout << "use deskflow-core <server|client> --help for more information." << std::endl;
|
||||
}
|
||||
|
||||
@ -57,10 +49,10 @@ int main(int argc, char **argv)
|
||||
EventQueue events;
|
||||
|
||||
if (isServer(argc, argv)) {
|
||||
ServerApp app(&events, nullptr);
|
||||
ServerApp app(&events);
|
||||
return app.run(argc, argv);
|
||||
} else if (isClient(argc, argv)) {
|
||||
ClientApp app(&events, nullptr);
|
||||
ClientApp app(&events);
|
||||
return app.run(argc, argv);
|
||||
} else {
|
||||
showHelp();
|
||||
|
||||
@ -1,39 +1,31 @@
|
||||
# Deskflow -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# Copyright (C) 2012-2024 Symless Ltd.
|
||||
# Copyright (C) 2009-2012 Nick Bolton
|
||||
#
|
||||
# This package is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# found in the file LICENSE that should have accompanied this file.
|
||||
#
|
||||
# This package is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# SPDX-FileCopyrightText: 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2012 - 2024 Symless Ltd
|
||||
# SPDX-FileCopyrightText: 2009 - 2012 Nick Bolton
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Daemon is only needed on Windows for elevating processes to deal with UAC.
|
||||
if(WIN32)
|
||||
set(target deskflow-daemon)
|
||||
add_executable(${target} WIN32
|
||||
deskflow-daemon.cpp
|
||||
"${PROJECT_BINARY_DIR}/src/version.rc"
|
||||
)
|
||||
set(target ${CMAKE_PROJECT_NAME}-daemon)
|
||||
|
||||
# Generate rc file
|
||||
set(EXE_DESCRIPTION "${CMAKE_PROJECT_PROPER_NAME} Daemon for handling secure desktops (UAC prompts, login screen, etc)")
|
||||
set(EXE_ICON "IDI_DESKFLOW ICON DISCARDABLE \"${CMAKE_SOURCE_DIR}/src/apps/res/deskflow.ico\"")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/windows.rc.in ${target}.rc)
|
||||
|
||||
add_executable(${target} WIN32 ${target}.cpp ${CMAKE_CURRENT_BINARY_DIR}/${target}.rc)
|
||||
|
||||
target_link_libraries(
|
||||
${target}
|
||||
arch
|
||||
base
|
||||
io
|
||||
ipc
|
||||
mt
|
||||
net
|
||||
platform
|
||||
app
|
||||
${libs})
|
||||
common
|
||||
${libs}
|
||||
Qt6::Core)
|
||||
|
||||
install(
|
||||
TARGETS ${target}
|
||||
|
||||
@ -1,42 +1,147 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2012 Nick Bolton
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016, 2025 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2012 Nick Bolton
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "arch/Arch.h"
|
||||
#include "base/EventQueue.h"
|
||||
#include "base/Log.h"
|
||||
#include "common/constants.h"
|
||||
#include "deskflow/DaemonApp.h"
|
||||
#include "deskflow/ipc/DaemonIpcServer.h"
|
||||
|
||||
#include <iostream>
|
||||
#if SYSAPI_WIN32
|
||||
|
||||
#ifdef SYSAPI_UNIX
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
DaemonApp app;
|
||||
return app.run(argc, argv);
|
||||
}
|
||||
|
||||
#elif SYSAPI_WIN32
|
||||
#include "arch/win32/ArchMiscWindows.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QThread>
|
||||
|
||||
using namespace deskflow::core;
|
||||
|
||||
void handleError(const char *message);
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#if SYSAPI_WIN32
|
||||
ArchMiscWindows::guardRuntimeVersion();
|
||||
|
||||
// Save window instance for later use, e.g. `GetModuleFileName` which is used when installing the daemon.
|
||||
ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr));
|
||||
#endif
|
||||
|
||||
Arch arch;
|
||||
arch.init();
|
||||
|
||||
Log log;
|
||||
EventQueue events;
|
||||
|
||||
auto &daemon = DaemonApp::instance();
|
||||
DaemonApp::InitResult initResult;
|
||||
try {
|
||||
initResult = daemon.init(&events, argc, argv);
|
||||
} catch (std::exception &e) {
|
||||
handleError(e.what());
|
||||
return kExitFailed;
|
||||
} catch (...) {
|
||||
handleError("Unrecognized error.");
|
||||
return kExitFailed;
|
||||
}
|
||||
|
||||
// Important: Log the app name and version number to the log file after the daemon app init
|
||||
// because the file log outputter is created there. Logging before would only log to stdout
|
||||
// which is not useful for troubleshooting Windows services.
|
||||
// It's important to write the version number to the log file so we can be certain the old daemon
|
||||
// was uninstalled, since sometimes Windows services can get stuck and fail to be removed.
|
||||
LOG_PRINT("%s Daemon v%s", kAppName, kDisplayVersion);
|
||||
|
||||
switch (initResult) {
|
||||
using enum DaemonApp::InitResult;
|
||||
|
||||
case StartDaemon: {
|
||||
LOG_INFO("starting daemon");
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
QThread daemonThread;
|
||||
daemon.moveToThread(&daemonThread);
|
||||
|
||||
QObject::connect(&daemonThread, &QThread::started, [&daemon, &daemonThread]() {
|
||||
LOG_DEBUG("daemon thread started");
|
||||
daemon.run();
|
||||
daemonThread.quit();
|
||||
LOG_DEBUG("daemon thread finished");
|
||||
});
|
||||
QObject::connect(&daemonThread, &QThread::finished, &app, &QCoreApplication::quit);
|
||||
|
||||
ipc::DaemonIpcServer ipcServer(&app, QString::fromStdString(daemon.logFilename()));
|
||||
|
||||
// Use direct connection as the daemon app is on it's own thread, and so is on a different event loop.
|
||||
QObject::connect(
|
||||
&ipcServer, &ipc::DaemonIpcServer::logLevelChanged, &daemon, &DaemonApp::saveLogLevel, //
|
||||
Qt::DirectConnection
|
||||
);
|
||||
QObject::connect(
|
||||
&ipcServer, &ipc::DaemonIpcServer::elevateModeChanged, &daemon, &DaemonApp::setElevate, //
|
||||
Qt::DirectConnection
|
||||
);
|
||||
QObject::connect(
|
||||
&ipcServer, &ipc::DaemonIpcServer::commandChanged, &daemon, &DaemonApp::setCommand, //
|
||||
Qt::DirectConnection
|
||||
);
|
||||
QObject::connect(
|
||||
&ipcServer, &ipc::DaemonIpcServer::startProcessRequested, &daemon, &DaemonApp::applyWatchdogCommand, //
|
||||
Qt::DirectConnection
|
||||
);
|
||||
QObject::connect(
|
||||
&ipcServer, &ipc::DaemonIpcServer::stopProcessRequested, &daemon, &DaemonApp::clearWatchdogCommand, //
|
||||
Qt::DirectConnection
|
||||
);
|
||||
QObject::connect(
|
||||
&ipcServer, &ipc::DaemonIpcServer::clearSettingsRequested, &daemon, &DaemonApp::clearSettings, //
|
||||
Qt::DirectConnection
|
||||
);
|
||||
|
||||
daemonThread.start();
|
||||
const auto exitCode = QCoreApplication::exec();
|
||||
daemonThread.wait();
|
||||
|
||||
LOG_DEBUG("daemon exited, code: %d", exitCode);
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
case FatalError:
|
||||
return kExitFailed;
|
||||
|
||||
default:
|
||||
return kExitSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
|
||||
// Win32 subsystem entry point (simply forwards to main).
|
||||
// We need this because using regular main under the Win32 subsystem results in empty args.
|
||||
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
{
|
||||
DaemonApp app;
|
||||
return app.run(__argc, __argv);
|
||||
return main(__argc, __argv);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void handleError(const char *message)
|
||||
{
|
||||
// Always print error to stdout in case run as CLI program.
|
||||
LOG_ERR("%s", message);
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
// Show a message box for when run from MSI in Win32 subsystem.
|
||||
MessageBoxA(nullptr, message, "Deskflow daemon error", MB_OK | MB_ICONERROR);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1,19 +1,8 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "Action.h"
|
||||
@ -21,111 +10,98 @@
|
||||
#include <QSettings>
|
||||
#include <QTextStream>
|
||||
|
||||
const char *Action::m_ActionTypeNames[] = {
|
||||
"keyDown", "keyUp", "keystroke", "switchToScreen", "switchInDirection", "lockCursorToScreen",
|
||||
"restartServer", "mouseDown", "mouseUp", "mousebutton"
|
||||
};
|
||||
|
||||
const char *Action::m_SwitchDirectionNames[] = {"left", "right", "up", "down"};
|
||||
const char *Action::m_LockCursorModeNames[] = {"toggle", "on", "off"};
|
||||
|
||||
QString Action::text() const
|
||||
{
|
||||
QString text = QString(m_ActionTypeNames[keySequence().isMouseButton() ? type() + 6 : type()]) + "(";
|
||||
QString text = QString(m_actionTypeNames.at(keySequence().isMouseButton() ? type() + 6 : type()));
|
||||
|
||||
switch (type()) {
|
||||
case keyDown:
|
||||
case keyUp:
|
||||
case keystroke: {
|
||||
text += keySequence().toString();
|
||||
QString commandArgs = keySequence().toString();
|
||||
|
||||
if (!keySequence().isMouseButton()) {
|
||||
const QStringList &screens = typeScreenNames();
|
||||
if (haveScreens() && !screens.isEmpty()) {
|
||||
text += ",";
|
||||
|
||||
QString screenList;
|
||||
for (int i = 0; i < screens.size(); i++) {
|
||||
text += screens[i];
|
||||
screenList.append(screens[i]);
|
||||
if (i != screens.size() - 1)
|
||||
text += ":";
|
||||
screenList.append(QStringLiteral(":"));
|
||||
}
|
||||
commandArgs.append(QStringLiteral(",%1").arg(screenList));
|
||||
} else
|
||||
text += ",*";
|
||||
commandArgs.append(QStringLiteral(",*"));
|
||||
}
|
||||
text.append(m_commandTemplate.arg(commandArgs));
|
||||
} break;
|
||||
|
||||
case switchToScreen:
|
||||
text += switchScreenName();
|
||||
text.append(m_commandTemplate.arg(m_switchScreenName));
|
||||
break;
|
||||
|
||||
case switchInDirection:
|
||||
text += m_SwitchDirectionNames[m_SwitchDirection];
|
||||
text.append(m_commandTemplate.arg(m_switchDirectionNames.at(m_switchDirection)));
|
||||
break;
|
||||
|
||||
case lockCursorToScreen:
|
||||
text += m_LockCursorModeNames[m_LockCursorMode];
|
||||
text.append(m_commandTemplate.arg(m_lockCursorModeNames.at(m_lockCursorMode)));
|
||||
break;
|
||||
|
||||
case restartAllConnections:
|
||||
text += "restart";
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT(0);
|
||||
break;
|
||||
}
|
||||
|
||||
text += ")";
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
void Action::loadSettings(QSettings &settings)
|
||||
{
|
||||
keySequence().loadSettings(settings);
|
||||
setType(settings.value("type", keyDown).toInt());
|
||||
setType(settings.value(SettingsKeys::ActionType, keyDown).toInt());
|
||||
|
||||
typeScreenNames().clear();
|
||||
int numTypeScreens = settings.beginReadArray("typeScreenNames");
|
||||
int numTypeScreens = settings.beginReadArray(SettingsKeys::ScreenNames);
|
||||
for (int i = 0; i < numTypeScreens; i++) {
|
||||
settings.setArrayIndex(i);
|
||||
typeScreenNames().append(settings.value("typeScreenName").toString());
|
||||
typeScreenNames().append(settings.value(SettingsKeys::ScreenName).toString());
|
||||
}
|
||||
settings.endArray();
|
||||
|
||||
setSwitchScreenName(settings.value("switchScreenName").toString());
|
||||
setSwitchDirection(settings.value("switchInDirection", switchLeft).toInt());
|
||||
setLockCursorMode(settings.value("lockCursorToScreen", lockCursorToggle).toInt());
|
||||
setActiveOnRelease(settings.value("activeOnRelease", false).toBool());
|
||||
setHaveScreens(settings.value("hasScreens", false).toBool());
|
||||
setRestartServer(settings.value("restartServer", false).toBool());
|
||||
setSwitchScreenName(settings.value(SettingsKeys::SwitchToScreen).toString());
|
||||
setSwitchDirection(settings.value(SettingsKeys::SwitchDirection, switchLeft).toInt());
|
||||
setLockCursorMode(settings.value(SettingsKeys::LockToScreen, lockCursorToggle).toInt());
|
||||
setActiveOnRelease(settings.value(SettingsKeys::ActiveOnRelease, false).toBool());
|
||||
setHaveScreens(settings.value(SettingsKeys::HasScreens, false).toBool());
|
||||
setRestartServer(settings.value(SettingsKeys::RestartServer, false).toBool());
|
||||
}
|
||||
|
||||
void Action::saveSettings(QSettings &settings) const
|
||||
{
|
||||
keySequence().saveSettings(settings);
|
||||
settings.setValue("type", type());
|
||||
settings.setValue(SettingsKeys::ActionType, type());
|
||||
|
||||
settings.beginWriteArray("typeScreenNames");
|
||||
settings.beginWriteArray(SettingsKeys::ScreenNames);
|
||||
for (int i = 0; i < typeScreenNames().size(); i++) {
|
||||
settings.setArrayIndex(i);
|
||||
settings.setValue("typeScreenName", typeScreenNames()[i]);
|
||||
settings.setValue(SettingsKeys::ScreenName, typeScreenNames()[i]);
|
||||
}
|
||||
settings.endArray();
|
||||
|
||||
settings.setValue("switchScreenName", switchScreenName());
|
||||
settings.setValue("switchInDirection", switchDirection());
|
||||
settings.setValue("lockCursorToScreen", lockCursorMode());
|
||||
settings.setValue("activeOnRelease", activeOnRelease());
|
||||
settings.setValue("hasScreens", haveScreens());
|
||||
settings.setValue("restartServer", restartServer());
|
||||
settings.setValue(SettingsKeys::SwitchToScreen, switchScreenName());
|
||||
settings.setValue(SettingsKeys::SwitchDirection, switchDirection());
|
||||
settings.setValue(SettingsKeys::LockToScreen, lockCursorMode());
|
||||
settings.setValue(SettingsKeys::ActiveOnRelease, activeOnRelease());
|
||||
settings.setValue(SettingsKeys::HasScreens, haveScreens());
|
||||
settings.setValue(SettingsKeys::RestartServer, restartServer());
|
||||
}
|
||||
|
||||
bool Action::operator==(const Action &a) const
|
||||
{
|
||||
return m_KeySequence == a.m_KeySequence && m_Type == a.m_Type && m_TypeScreenNames == a.m_TypeScreenNames &&
|
||||
m_SwitchScreenName == a.m_SwitchScreenName && m_SwitchDirection == a.m_SwitchDirection &&
|
||||
m_LockCursorMode == a.m_LockCursorMode && m_ActiveOnRelease == a.m_ActiveOnRelease &&
|
||||
m_HasScreens == a.m_HasScreens && m_restartServer == a.m_restartServer;
|
||||
return m_keySequence == a.m_keySequence && m_type == a.m_type && m_typeScreenNames == a.m_typeScreenNames &&
|
||||
m_switchScreenName == a.m_switchScreenName && m_switchDirection == a.m_switchDirection &&
|
||||
m_lockCursorMode == a.m_lockCursorMode && m_activeOnRelease == a.m_activeOnRelease &&
|
||||
m_hasScreens == a.m_hasScreens && m_restartServer == a.m_restartServer;
|
||||
}
|
||||
|
||||
QTextStream &operator<<(QTextStream &outStream, const Action &action)
|
||||
|
||||
@ -1,19 +1,8 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@ -28,6 +17,18 @@ class ActionDialog;
|
||||
class QSettings;
|
||||
class QTextStream;
|
||||
|
||||
namespace SettingsKeys {
|
||||
inline static const QString ActionType = QStringLiteral("type");
|
||||
inline static const QString ScreenNames = QStringLiteral("typeScreenNames");
|
||||
inline static const QString ScreenName = QStringLiteral("typeScreenName");
|
||||
inline static const QString SwitchToScreen = QStringLiteral("switchScreenName");
|
||||
inline static const QString SwitchDirection = QStringLiteral("switchInDirection");
|
||||
inline static const QString LockToScreen = QStringLiteral("lockCursorToScreen");
|
||||
inline static const QString ActiveOnRelease = QStringLiteral("activeOnRelease");
|
||||
inline static const QString HasScreens = QStringLiteral("hasScreens");
|
||||
inline static const QString RestartServer = QStringLiteral("restartServer");
|
||||
}; // namespace SettingsKeys
|
||||
|
||||
class Action
|
||||
{
|
||||
friend class ActionDialog;
|
||||
@ -68,37 +69,37 @@ public:
|
||||
QString text() const;
|
||||
const KeySequence &keySequence() const
|
||||
{
|
||||
return m_KeySequence;
|
||||
return m_keySequence;
|
||||
}
|
||||
void loadSettings(QSettings &settings);
|
||||
void saveSettings(QSettings &settings) const;
|
||||
int type() const
|
||||
{
|
||||
return m_Type;
|
||||
return m_type;
|
||||
}
|
||||
const QStringList &typeScreenNames() const
|
||||
{
|
||||
return m_TypeScreenNames;
|
||||
return m_typeScreenNames;
|
||||
}
|
||||
const QString &switchScreenName() const
|
||||
{
|
||||
return m_SwitchScreenName;
|
||||
return m_switchScreenName;
|
||||
}
|
||||
int switchDirection() const
|
||||
{
|
||||
return m_SwitchDirection;
|
||||
return m_switchDirection;
|
||||
}
|
||||
int lockCursorMode() const
|
||||
{
|
||||
return m_LockCursorMode;
|
||||
return m_lockCursorMode;
|
||||
}
|
||||
bool activeOnRelease() const
|
||||
{
|
||||
return m_ActiveOnRelease;
|
||||
return m_activeOnRelease;
|
||||
}
|
||||
bool haveScreens() const
|
||||
{
|
||||
return m_HasScreens;
|
||||
return m_hasScreens;
|
||||
}
|
||||
bool restartServer() const
|
||||
{
|
||||
@ -110,39 +111,39 @@ public:
|
||||
protected:
|
||||
KeySequence &keySequence()
|
||||
{
|
||||
return m_KeySequence;
|
||||
return m_keySequence;
|
||||
}
|
||||
void setKeySequence(const KeySequence &seq)
|
||||
{
|
||||
m_KeySequence = seq;
|
||||
m_keySequence = seq;
|
||||
}
|
||||
void setType(int t)
|
||||
{
|
||||
m_Type = t;
|
||||
m_type = t;
|
||||
}
|
||||
QStringList &typeScreenNames()
|
||||
{
|
||||
return m_TypeScreenNames;
|
||||
return m_typeScreenNames;
|
||||
}
|
||||
void setSwitchScreenName(const QString &n)
|
||||
{
|
||||
m_SwitchScreenName = n;
|
||||
m_switchScreenName = n;
|
||||
}
|
||||
void setSwitchDirection(int d)
|
||||
{
|
||||
m_SwitchDirection = d;
|
||||
m_switchDirection = d;
|
||||
}
|
||||
void setLockCursorMode(int m)
|
||||
{
|
||||
m_LockCursorMode = m;
|
||||
m_lockCursorMode = m;
|
||||
}
|
||||
void setActiveOnRelease(bool b)
|
||||
{
|
||||
m_ActiveOnRelease = b;
|
||||
m_activeOnRelease = b;
|
||||
}
|
||||
void setHaveScreens(bool b)
|
||||
{
|
||||
m_HasScreens = b;
|
||||
m_hasScreens = b;
|
||||
}
|
||||
void setRestartServer(bool b)
|
||||
{
|
||||
@ -150,19 +151,32 @@ protected:
|
||||
}
|
||||
|
||||
private:
|
||||
KeySequence m_KeySequence;
|
||||
int m_Type = keystroke;
|
||||
QStringList m_TypeScreenNames = QStringList();
|
||||
QString m_SwitchScreenName = QString();
|
||||
int m_SwitchDirection = switchLeft;
|
||||
int m_LockCursorMode = lockCursorToggle;
|
||||
bool m_ActiveOnRelease = false;
|
||||
bool m_HasScreens = false;
|
||||
KeySequence m_keySequence;
|
||||
int m_type = keystroke;
|
||||
QStringList m_typeScreenNames = QStringList();
|
||||
QString m_switchScreenName = QString();
|
||||
int m_switchDirection = switchLeft;
|
||||
int m_lockCursorMode = lockCursorToggle;
|
||||
bool m_activeOnRelease = false;
|
||||
bool m_hasScreens = false;
|
||||
bool m_restartServer;
|
||||
|
||||
static const char *m_ActionTypeNames[];
|
||||
static const char *m_SwitchDirectionNames[];
|
||||
static const char *m_LockCursorModeNames[];
|
||||
inline static const QString m_commandTemplate = QStringLiteral("(%1)");
|
||||
inline static const QStringList m_actionTypeNames{
|
||||
QStringLiteral("keyDown"), QStringLiteral("keyUp"),
|
||||
QStringLiteral("keystroke"), QStringLiteral("switchToScreen"),
|
||||
QStringLiteral("switchInDirection"), QStringLiteral("lockCursorToScreen"),
|
||||
QStringLiteral("restartServer"), QStringLiteral("mouseDown"),
|
||||
QStringLiteral("mouseUp"), QStringLiteral("mousebutton")
|
||||
};
|
||||
|
||||
inline static const QStringList m_switchDirectionNames{
|
||||
QStringLiteral("left"), QStringLiteral("right"), QStringLiteral("up"), QStringLiteral("down")
|
||||
};
|
||||
|
||||
inline static const QStringList m_lockCursorModeNames{
|
||||
QStringLiteral("toggle"), QStringLiteral("on"), QStringLiteral("off")
|
||||
};
|
||||
};
|
||||
|
||||
using ActionList = QList<Action>;
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#if OSX_DEPLOYMENT_TARGET >= 1014
|
||||
#import <UserNotifications/UNUserNotificationCenter.h>
|
||||
@interface AppDelegate
|
||||
: NSObject <NSApplicationDelegate, NSUserNotificationCenterDelegate, UNUserNotificationCenterDelegate>
|
||||
#else
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate, NSUserNotificationCenterDelegate>
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@ -1,38 +0,0 @@
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@interface AppDelegate ()
|
||||
|
||||
@property(strong) IBOutlet NSWindow *window;
|
||||
@end
|
||||
|
||||
@implementation AppDelegate {
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
{
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self];
|
||||
#if OSX_DEPLOYMENT_TARGET >= 1014
|
||||
[[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center
|
||||
shouldPresentNotification:(NSUserNotification *)notification
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
#if OSX_DEPLOYMENT_TARGET >= 1014
|
||||
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
|
||||
willPresentNotification:(UNNotification *)notification
|
||||
withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
|
||||
{
|
||||
UNNotificationPresentationOptions presentationOptions = UNNotificationPresentationOptionSound |
|
||||
UNNotificationPresentationOptionAlert |
|
||||
UNNotificationPresentationOptionBadge;
|
||||
|
||||
completionHandler(presentationOptions);
|
||||
}
|
||||
#endif
|
||||
|
||||
@end
|
||||
@ -1,17 +1,6 @@
|
||||
# Deskflow -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2024 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/>.
|
||||
# SPDX-FileCopyrightText: 2024 - 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2024 Symless Ltd
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if(APPLE)
|
||||
set(target Deskflow)
|
||||
@ -19,43 +8,102 @@ else()
|
||||
set(target deskflow)
|
||||
endif()
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
file(
|
||||
GLOB
|
||||
sources
|
||||
../res/deskflow.qrc
|
||||
*.cpp
|
||||
*.h
|
||||
dialogs/*.h
|
||||
dialogs/*.cpp
|
||||
validators/*
|
||||
widgets/*)
|
||||
file(GLOB ui_files *.ui dialogs/*.ui)
|
||||
|
||||
if(WIN32)
|
||||
set(platform_extra deskflow.rc ${PROJECT_BINARY_DIR}/src/version.rc)
|
||||
set(EXE_DESCRIPTION "${CMAKE_PROJECT_PROPER_NAME} GUI configuration tool")
|
||||
set(EXE_ICON "IDI_ICON1 ICON DISCARDABLE \"${CMAKE_SOURCE_DIR}/src/apps/res/deskflow.ico\" ")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/windows.rc.in deskflow.rc)
|
||||
set(platform_extra deskflow.rc)
|
||||
elseif(APPLE)
|
||||
set(platform_extra Deskflow.icns ${PROJECT_SOURCE_DIR}/LICENSE ${PROJECT_SOURCE_DIR}/LICENSE_EXCEPTION)
|
||||
#setup our bundle plist file
|
||||
set(BUNDLE_EXECUTABLE_NAME "${target}")
|
||||
set(BUNDLE_BUNDLE_NAME "${target}")
|
||||
set(BUNDLE_DISPLAY_NAME "${target}")
|
||||
set(BUNDLE_GUI_IDENTIFIER "org.deskflow.deskflow")
|
||||
set(BUNDLE_ICON_FILE ${target}.icns)
|
||||
set(BUNDLE_INFO_STRING "${CMAKE_PROJECT_DESCRIPTION}")
|
||||
set(BUNDLE_COPYRIGHT "${CMAKE_PROJECT_COPYRIGHT}")
|
||||
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../res/deskflow.plist.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/deskflow.plist
|
||||
@ONLY
|
||||
)
|
||||
|
||||
file(COPY_FILE
|
||||
${PROJECT_SOURCE_DIR}/LICENSES/LicenseRef-OpenSSL-Exception.txt
|
||||
${CMAKE_CURRENT_BINARY_DIR}/LICENSE_EXCEPTION
|
||||
ONLY_IF_DIFFERENT
|
||||
)
|
||||
|
||||
set(platform_extra ../res/Deskflow.icns ${CMAKE_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE_EXCEPTION)
|
||||
set_source_files_properties(${platform_extra} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||
endif()
|
||||
|
||||
# gui library autogen headers:
|
||||
# qt doesn't seem to auto include the autogen headers for libraries.
|
||||
include_directories(${PROJECT_BINARY_DIR}/src/lib/gui/gui_autogen/include)
|
||||
|
||||
# generated includes
|
||||
include_directories(${PROJECT_BINARY_DIR}/config)
|
||||
|
||||
add_executable(${target} WIN32 MACOSX_BUNDLE ${sources} ${ui_files} ${platform_extra})
|
||||
add_executable(${target} WIN32 MACOSX_BUNDLE
|
||||
${platform_extra}
|
||||
../res/deskflow.qrc
|
||||
Action.cpp
|
||||
Action.h
|
||||
DataDownloader.cpp
|
||||
DataDownloader.h
|
||||
Hotkey.cpp
|
||||
Hotkey.h
|
||||
KeySequence.cpp
|
||||
KeySequence.h
|
||||
main.cpp
|
||||
MainWindow.cpp
|
||||
MainWindow.h
|
||||
MainWindow.ui
|
||||
ProcessorArch.h
|
||||
QUtility.cpp
|
||||
QUtility.h
|
||||
ScreenSetupModel.cpp
|
||||
ScreenSetupModel.h
|
||||
ServerConfig.cpp
|
||||
ServerConfig.h
|
||||
VersionChecker.cpp
|
||||
VersionChecker.h
|
||||
dialogs/AboutDialog.cpp
|
||||
dialogs/AboutDialog.h
|
||||
dialogs/AboutDialog.ui
|
||||
dialogs/ActionDialog.cpp
|
||||
dialogs/ActionDialog.h
|
||||
dialogs/ActionDialog.ui
|
||||
dialogs/AddClientDialog.cpp
|
||||
dialogs/AddClientDialog.h
|
||||
dialogs/AddClientDialog.ui
|
||||
dialogs/FingerprintDialog.h
|
||||
dialogs/FingerprintDialog.cpp
|
||||
dialogs/HotkeyDialog.cpp
|
||||
dialogs/HotkeyDialog.h
|
||||
dialogs/HotkeyDialog.ui
|
||||
dialogs/ScreenSettingsDialog.cpp
|
||||
dialogs/ScreenSettingsDialog.h
|
||||
dialogs/ScreenSettingsDialog.ui
|
||||
dialogs/ServerConfigDialog.cpp
|
||||
dialogs/ServerConfigDialog.h
|
||||
dialogs/ServerConfigDialog.ui
|
||||
dialogs/SettingsDialog.cpp
|
||||
dialogs/SettingsDialog.h
|
||||
dialogs/SettingsDialog.ui
|
||||
widgets/FingerprintPreview.h
|
||||
widgets/FingerprintPreview.cpp
|
||||
widgets/KeySequenceWidget.cpp
|
||||
widgets/KeySequenceWidget.h
|
||||
widgets/NewScreenWidget.h
|
||||
widgets/NewScreenWidget.cpp
|
||||
widgets/ScreenSetupView.cpp
|
||||
widgets/ScreenSetupView.h
|
||||
widgets/TrashScreenWidget.cpp
|
||||
widgets/TrashScreenWidget.h
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
${target}
|
||||
${DESKFLOW_GUI_HOOK_LIB}
|
||||
gui
|
||||
common
|
||||
Qt6::Core
|
||||
Qt6::Widgets
|
||||
Qt6::Network)
|
||||
@ -76,33 +124,15 @@ if(WIN32)
|
||||
".*system32.*"
|
||||
RUNTIME DESTINATION .
|
||||
)
|
||||
find_program(DEPLOYQT windeployqt6)
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/qtDeploy
|
||||
COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network --dir ${CMAKE_BINARY_DIR}/qtDeploy $<TARGET_FILE:${target}>
|
||||
)
|
||||
install(
|
||||
DIRECTORY ${CMAKE_BINARY_DIR}/qtDeploy/
|
||||
DESTINATION .
|
||||
FILES_MATCHING PATTERN "*.*"
|
||||
COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network $<TARGET_FILE:${target}>
|
||||
)
|
||||
elseif(APPLE)
|
||||
set_target_properties(${target} PROPERTIES
|
||||
MACOSX_BUNDLE_BUNDLE_NAME "Deskflow"
|
||||
MACOSX_BUNDLE_DISPLAY_NAME "Deskflow"
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER "org.deskflow.deskflow"
|
||||
MACOSX_BUNDLE_ICON_FILE Deskflow.icns
|
||||
MACOSX_BUNDLE_INFO_STRING "${CMAKE_PROJECT_DESCRIPTION}"
|
||||
MACOSX_BUNDLE_COPYRIGHT "© 2024 Deskflow Developers"
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION ${CMAKE_PROJECT_VERSION}
|
||||
MACOSX_BUNDLE_LONG_VERSION_STRING ${CMAKE_PROJECT_VERSION}
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${CMAKE_PROJECT_VERSION}
|
||||
)
|
||||
find_program(MACDEPLOYQT_BIN macdeployqt6)
|
||||
add_custom_command(
|
||||
TARGET ${target} POST_BUILD
|
||||
COMMAND ${MACDEPLOYQT_BIN} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target}.app"
|
||||
INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks"
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/deskflow.plist"
|
||||
)
|
||||
install(TARGETS ${target} BUNDLE DESTINATION .)
|
||||
else()
|
||||
|
||||
@ -1,18 +1,7 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2014-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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2014 - 2016 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "DataDownloader.h"
|
||||
|
||||
@ -1,18 +1,7 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2014-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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2014 - 2016 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -1,50 +1,36 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "Hotkey.h"
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
Hotkey::Hotkey() : m_KeySequence(), m_Actions()
|
||||
Hotkey::Hotkey() : m_keySequence{}, m_actions{}
|
||||
{
|
||||
}
|
||||
|
||||
QString Hotkey::text() const
|
||||
{
|
||||
QString text = keySequence().toString();
|
||||
|
||||
if (keySequence().isMouseButton())
|
||||
return "mousebutton(" + text + ")";
|
||||
|
||||
return "keystroke(" + text + ")";
|
||||
return m_keySequence.isMouseButton() ? kMousebutton.arg(m_keySequence.toString())
|
||||
: kKeystroke.arg(m_keySequence.toString());
|
||||
}
|
||||
|
||||
void Hotkey::loadSettings(QSettings &settings)
|
||||
{
|
||||
keySequence().loadSettings(settings);
|
||||
m_keySequence.loadSettings(settings);
|
||||
|
||||
actions().clear();
|
||||
int num = settings.beginReadArray("actions");
|
||||
m_actions.clear();
|
||||
int num = settings.beginReadArray(kSectionActions);
|
||||
for (int i = 0; i < num; i++) {
|
||||
settings.setArrayIndex(i);
|
||||
Action a;
|
||||
a.loadSettings(settings);
|
||||
actions().append(a);
|
||||
m_actions.append(a);
|
||||
}
|
||||
|
||||
settings.endArray();
|
||||
@ -52,25 +38,36 @@ void Hotkey::loadSettings(QSettings &settings)
|
||||
|
||||
void Hotkey::saveSettings(QSettings &settings) const
|
||||
{
|
||||
keySequence().saveSettings(settings);
|
||||
m_keySequence.saveSettings(settings);
|
||||
|
||||
settings.beginWriteArray("actions");
|
||||
for (int i = 0; i < actions().size(); i++) {
|
||||
settings.beginWriteArray(kSectionActions);
|
||||
for (int i = 0; i < m_actions.size(); i++) {
|
||||
settings.setArrayIndex(i);
|
||||
actions()[i].saveSettings(settings);
|
||||
m_actions.at(i).saveSettings(settings);
|
||||
}
|
||||
settings.endArray();
|
||||
}
|
||||
|
||||
bool Hotkey::operator==(const Hotkey &hk) const
|
||||
{
|
||||
return m_KeySequence == hk.m_KeySequence && m_Actions == hk.m_Actions;
|
||||
return m_keySequence == hk.keySequence() && m_actions == hk.actions();
|
||||
}
|
||||
|
||||
QTextStream &operator<<(QTextStream &outStream, const Hotkey &hotkey)
|
||||
{
|
||||
for (int i = 0; i < hotkey.actions().size(); i++)
|
||||
outStream << "\t" << hotkey.text() << " = " << hotkey.actions()[i] << Qt::endl;
|
||||
// Don't write a config if there is no actions
|
||||
if (hotkey.actions().size() == 0)
|
||||
return outStream;
|
||||
|
||||
QString outText = QStringLiteral("\t%1 = ").arg(hotkey.text());
|
||||
for (int i = 0; i < hotkey.actions().size(); i++) {
|
||||
outText.append(hotkey.actions().at(i).text());
|
||||
if (i != hotkey.actions().size() - 1) {
|
||||
outText.append(QStringLiteral(", "));
|
||||
}
|
||||
}
|
||||
outText.append(QStringLiteral("\n"));
|
||||
|
||||
outStream << outText;
|
||||
return outStream;
|
||||
}
|
||||
|
||||
@ -1,20 +1,11 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QList>
|
||||
@ -41,11 +32,11 @@ public:
|
||||
QString text() const;
|
||||
const KeySequence &keySequence() const
|
||||
{
|
||||
return m_KeySequence;
|
||||
return m_keySequence;
|
||||
}
|
||||
const ActionList &actions() const
|
||||
{
|
||||
return m_Actions;
|
||||
return m_actions;
|
||||
}
|
||||
|
||||
void loadSettings(QSettings &settings);
|
||||
@ -56,20 +47,23 @@ public:
|
||||
protected:
|
||||
KeySequence &keySequence()
|
||||
{
|
||||
return m_KeySequence;
|
||||
return m_keySequence;
|
||||
}
|
||||
void setKeySequence(const KeySequence &seq)
|
||||
{
|
||||
m_KeySequence = seq;
|
||||
m_keySequence = seq;
|
||||
}
|
||||
ActionList &actions()
|
||||
{
|
||||
return m_Actions;
|
||||
return m_actions;
|
||||
}
|
||||
|
||||
private:
|
||||
KeySequence m_KeySequence;
|
||||
ActionList m_Actions;
|
||||
KeySequence m_keySequence;
|
||||
ActionList m_actions;
|
||||
inline static const QString kSectionActions = QStringLiteral("actions");
|
||||
inline static const QString kMousebutton = QStringLiteral("mousebutton(%1)");
|
||||
inline static const QString kKeystroke = QStringLiteral("keystroke(%1)");
|
||||
};
|
||||
|
||||
using HotkeyList = QList<Hotkey>;
|
||||
|
||||
@ -1,19 +1,8 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "KeySequence.h"
|
||||
|
||||
@ -1,19 +1,8 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,20 +1,9 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2024 Chris Rizzitello <sithord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2024 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@ -22,14 +11,13 @@
|
||||
#include <QMainWindow>
|
||||
#include <QMutex>
|
||||
#include <QProcess>
|
||||
#include <QRegularExpression>
|
||||
#include <QSettings>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QThread>
|
||||
|
||||
#include "ServerConfig.h"
|
||||
#include "TrayIcon.h"
|
||||
#include "VersionChecker.h"
|
||||
#include "common/ipc.h"
|
||||
#include "gui/config/AppConfig.h"
|
||||
#include "gui/config/ConfigScopes.h"
|
||||
#include "gui/config/ServerConfigDialogState.h"
|
||||
@ -39,26 +27,36 @@
|
||||
#include "gui/core/WaylandWarnings.h"
|
||||
#include "gui/tls/TlsUtility.h"
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include "gui/OSXHelpers.h"
|
||||
#endif
|
||||
|
||||
class QAction;
|
||||
class QMenu;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QGroupBox;
|
||||
class QPushButton;
|
||||
class QTextEdit;
|
||||
class QComboBox;
|
||||
class QTabWidget;
|
||||
class QToolButton;
|
||||
class QCheckBox;
|
||||
class QRadioButton;
|
||||
class QMessageBox;
|
||||
class QAbstractButton;
|
||||
class QLocalServer;
|
||||
|
||||
class DeskflowApplication;
|
||||
class SetupWizard;
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
namespace deskflow::gui::ipc {
|
||||
class DaemonIpcClient;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
using CoreMode = deskflow::gui::CoreProcess::Mode;
|
||||
@ -67,7 +65,6 @@ class MainWindow : public QMainWindow
|
||||
Q_OBJECT
|
||||
|
||||
friend class DeskflowApplication;
|
||||
friend class SetupWizard;
|
||||
friend class SettingsDialog;
|
||||
|
||||
public:
|
||||
@ -81,48 +78,42 @@ public:
|
||||
explicit MainWindow(deskflow::gui::ConfigScopes &configScopes, AppConfig &appConfig);
|
||||
~MainWindow() override;
|
||||
|
||||
void setVisible(bool visible) override;
|
||||
CoreMode coreMode() const
|
||||
{
|
||||
return m_CoreProcess.mode();
|
||||
return m_coreProcess.mode();
|
||||
}
|
||||
QString address() const;
|
||||
void open();
|
||||
ServerConfig &serverConfig()
|
||||
{
|
||||
return m_ServerConfig;
|
||||
return m_serverConfig;
|
||||
}
|
||||
void autoAddScreen(const QString name);
|
||||
|
||||
void hide();
|
||||
|
||||
signals:
|
||||
void shown();
|
||||
|
||||
public slots:
|
||||
void onAppAboutToQuit();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void toggleLogVisible(bool visible);
|
||||
//
|
||||
// Manual slots
|
||||
//
|
||||
void onShown();
|
||||
void onConfigScopesSaving();
|
||||
void onAppConfigTlsChanged();
|
||||
void onAppConfigScreenNameChanged();
|
||||
void onAppConfigInvertConnection();
|
||||
void onCoreProcessStarting();
|
||||
void onCoreProcessError(CoreProcess::Error error);
|
||||
void onCoreConnectionStateChanged(CoreProcess::ConnectionState state);
|
||||
void onCoreProcessStateChanged(CoreProcess::ProcessState state);
|
||||
void onCoreProcessSecureSocket(bool enabled);
|
||||
void onVersionCheckerUpdateFound(const QString &version);
|
||||
void onTrayIconActivated(QSystemTrayIcon::ActivationReason reason);
|
||||
void onWindowSaveTimerTimeout();
|
||||
void onServerConnectionConfigureClient(const QString &clientName);
|
||||
|
||||
void firstShown();
|
||||
|
||||
void configScopesSaving();
|
||||
void appConfigTlsChanged();
|
||||
void coreProcessStarting();
|
||||
void coreProcessError(CoreProcess::Error error);
|
||||
void coreConnectionStateChanged(CoreProcess::ConnectionState state);
|
||||
void coreProcessStateChanged(CoreProcess::ProcessState state);
|
||||
void versionCheckerUpdateFound(const QString &version);
|
||||
void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
|
||||
void serverConnectionConfigureClient(const QString &clientName);
|
||||
|
||||
void clearSettings();
|
||||
void openAboutDialog();
|
||||
void openHelpUrl() const;
|
||||
void openGetNewVersionUrl() const;
|
||||
void openSettings();
|
||||
void startCore();
|
||||
void stopCore();
|
||||
@ -132,30 +123,28 @@ private slots:
|
||||
void resetCore();
|
||||
|
||||
void showMyFingerprint();
|
||||
void setModeServer();
|
||||
void setModeClient();
|
||||
void updateSecurityIcon(bool visible);
|
||||
|
||||
void coreModeToggled();
|
||||
void updateModeControls(bool serverMode);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::MainWindow> ui;
|
||||
|
||||
void updateSize();
|
||||
AppConfig &appConfig()
|
||||
{
|
||||
return m_AppConfig;
|
||||
return m_appConfig;
|
||||
}
|
||||
AppConfig const &appConfig() const
|
||||
{
|
||||
return m_AppConfig;
|
||||
return m_appConfig;
|
||||
}
|
||||
void createMenuBar();
|
||||
void createStatusBar();
|
||||
void createTrayIcon();
|
||||
void setupTrayIcon();
|
||||
void applyConfig();
|
||||
void applyCloseToTray() const;
|
||||
void setIcon();
|
||||
bool checkForApp(int which, QString &app);
|
||||
void setStatus(const QString &status);
|
||||
void sendIpcMessage(IpcMessageType type, const char *buffer, bool showErrors);
|
||||
void updateFromLogLine(const QString &line);
|
||||
QString getIPAddresses() const;
|
||||
void enableServer(bool enable);
|
||||
@ -176,40 +165,65 @@ private:
|
||||
QString configFilename();
|
||||
void showConfigureServer(const QString &message);
|
||||
void restoreWindow();
|
||||
void saveWindow();
|
||||
void setupControls();
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void moveEvent(QMoveEvent *event) override;
|
||||
void showFirstConnectedMessage();
|
||||
void updateStatus();
|
||||
void showAndActivate();
|
||||
void showHostNameEditor();
|
||||
void setHostName();
|
||||
|
||||
VersionChecker m_VersionChecker;
|
||||
deskflow::gui::TrayIcon m_TrayIcon;
|
||||
QAbstractButton *m_pCancelButton = nullptr;
|
||||
bool m_SecureSocket = false;
|
||||
bool m_SaveWindow = false;
|
||||
bool m_Quitting = false;
|
||||
deskflow::gui::config::ServerConfigDialogState m_ServerConfigDialogState;
|
||||
bool m_SaveOnExit = true;
|
||||
deskflow::gui::core::WaylandWarnings m_WaylandWarnings;
|
||||
QString getTlsPath();
|
||||
|
||||
deskflow::gui::ConfigScopes &m_ConfigScopes;
|
||||
AppConfig &m_AppConfig;
|
||||
ServerConfig m_ServerConfig;
|
||||
deskflow::gui::CoreProcess m_CoreProcess;
|
||||
deskflow::gui::ServerConnection m_ServerConnection;
|
||||
deskflow::gui::ClientConnection m_ClientConnection;
|
||||
deskflow::gui::TlsUtility m_TlsUtility;
|
||||
QTimer m_WindowSaveTimer;
|
||||
/**
|
||||
* @brief localFingerprintDb
|
||||
* @return The path to the local fingerprint file
|
||||
*/
|
||||
QString localFingerprintDb();
|
||||
|
||||
/**
|
||||
* @brief trustedFingerprintDb get the fingerprintDb for the trusted clients or trusted servers.
|
||||
* @return The path to the trusted fingerprint file
|
||||
*/
|
||||
QString trustedFingerprintDb();
|
||||
|
||||
// Generate prints if they are missing
|
||||
// Returns true if successful
|
||||
bool regenerateLocalFingerprints();
|
||||
|
||||
inline static const auto m_guiSocketName = QStringLiteral("deskflow-gui");
|
||||
inline static const auto m_nameRegEx = QRegularExpression(QStringLiteral("^[\\w\\-_\\.]{0,255}$"));
|
||||
|
||||
VersionChecker m_versionChecker;
|
||||
bool m_secureSocket = false;
|
||||
deskflow::gui::config::ServerConfigDialogState m_serverConfigDialogState;
|
||||
bool m_saveOnExit = true;
|
||||
deskflow::gui::core::WaylandWarnings m_waylandWarnings;
|
||||
deskflow::gui::ConfigScopes &m_configScopes;
|
||||
AppConfig &m_appConfig;
|
||||
ServerConfig m_serverConfig;
|
||||
deskflow::gui::CoreProcess m_coreProcess;
|
||||
deskflow::gui::ServerConnection m_serverConnection;
|
||||
deskflow::gui::ClientConnection m_clientConnection;
|
||||
deskflow::gui::TlsUtility m_tlsUtility;
|
||||
QSize m_expandedSize = QSize();
|
||||
QStringList m_checkedClients;
|
||||
QStringList m_checkedServers;
|
||||
QSystemTrayIcon *m_trayIcon = nullptr;
|
||||
QLocalServer *m_guiDupeChecker = nullptr;
|
||||
deskflow::gui::ipc::DaemonIpcClient *m_daemonIpcClient = nullptr;
|
||||
|
||||
QLabel *m_lblSecurityStatus = nullptr;
|
||||
QLabel *m_lblStatus = nullptr;
|
||||
QToolButton *m_btnFingerprint = nullptr;
|
||||
QPushButton *m_btnUpdate = nullptr;
|
||||
|
||||
// Window Actions
|
||||
QAction *m_actionAbout = nullptr;
|
||||
QAction *m_actionClearSettings = nullptr;
|
||||
QAction *m_actionHelp = nullptr;
|
||||
QAction *m_actionReportBug = nullptr;
|
||||
QAction *m_actionMinimize = nullptr;
|
||||
QAction *m_actionQuit = nullptr;
|
||||
QAction *m_actionTrayQuit = nullptr;
|
||||
QAction *m_actionRestore = nullptr;
|
||||
QAction *m_actionSave = nullptr;
|
||||
QAction *m_actionSettings = nullptr;
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>883</width>
|
||||
<height>690</height>
|
||||
<width>730</width>
|
||||
<height>520</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -19,62 +19,129 @@
|
||||
<property name="windowTitle">
|
||||
<string>Deskflow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="m_pWidgetTopLevel">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<widget class="QWidget" name="topLevelWidget">
|
||||
<layout class="QVBoxLayout" name="_2">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="m_layoutName">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SizeConstraint::SetMinAndMaxSize</enum>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblComputerName">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">This computer's name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="m_pSpacerUpdate">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelUpdate">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">m_pLabelUpdate</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelComputerName">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">This computer's name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblComputerName">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>lblName</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEditName">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Name can't have have spaces or special characters</p><p>Use Enter to save the name change.</p></body></html></string>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>255</number>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnEditName">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Edit Computer Name</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="document-edit"/>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelIpAddresses">
|
||||
<widget class="QLabel" name="lblIpAddresses">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@ -90,7 +157,176 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="m_pWidgetModes" native="true">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QWidget" name="widgetModeSelection" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbModeServer">
|
||||
<property name="text">
|
||||
<string>Use this computer's keyboard and mouse
|
||||
(make this computer the server)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbModeClient">
|
||||
<property name="text">
|
||||
<string>Use another computer’s mouse and keyboard
|
||||
(make this computer the client)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widgetModeOptions" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QWidget" name="serverOptions" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnConfigureServer">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Configure Server</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>5</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblNoMode">
|
||||
<property name="text">
|
||||
<string>You must select a mode</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="clientOptions" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelServerName">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Server IP address or hostname:</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineHostname">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Hostname or IP address of the server computer.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnConnect">
|
||||
<property name="text">
|
||||
<string>Connect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widgetModes" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@ -113,321 +349,6 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupServer">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignmentFlag::AlignTop">
|
||||
<widget class="QWidget" name="m_pWidgetServerRadio" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbModeServer">
|
||||
<property name="text">
|
||||
<string>Use this computer's keyboard and mouse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>(make this computer the server)</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignmentFlag::AlignTop">
|
||||
<widget class="QWidget" name="m_pWidgetServer" native="true">
|
||||
<layout class="QVBoxLayout" name="m_pLayoutServer">
|
||||
<property name="spacing">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="m_pWidgetServerInput" native="true">
|
||||
<layout class="QVBoxLayout" name="m_pLayoutServerInverse">
|
||||
<property name="spacing">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelClientIp">
|
||||
<property name="text">
|
||||
<string>Client IP address or hostname:</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineClientIp"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnConnectToClient">
|
||||
<property name="text">
|
||||
<string>Connect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="deskflow::gui::widgets::ServerStateLabel" name="m_pLabelServerState">
|
||||
<property name="text">
|
||||
<string>No clients connected</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblMyFingerprint">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>TLS enabled (<a href="#"><span style=" text-decoration: underline; color:#4285f4;">fingerprint</span></a>)</p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::TextFormat::RichText</enum>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<spacer name="spacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnConfigureServer">
|
||||
<property name="text">
|
||||
<string>&Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupClient">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="spacing">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignmentFlag::AlignTop">
|
||||
<widget class="QWidget" name="m_pWidgetClientRadio" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbModeClient">
|
||||
<property name="text">
|
||||
<string>Use another computer’s mouse and keyboard</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>(make this computer the client)</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignmentFlag::AlignTop">
|
||||
<widget class="QWidget" name="m_pWidgetClientInput" native="true">
|
||||
<layout class="QVBoxLayout" name="m_pLayoutClient">
|
||||
<property name="spacing">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelServerName">
|
||||
<property name="text">
|
||||
<string>Server IP address or hostname:</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineHostname">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Hostname or IP address of the server computer.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnConnect">
|
||||
<property name="text">
|
||||
<string>Connect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="deskflow::gui::widgets::ClientStateLabel" name="m_pLabelClientState">
|
||||
<property name="text">
|
||||
<string>Connected to server</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -440,22 +361,19 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
<enum>QFrame::Shape::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
<enum>QFrame::Shadow::Plain</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QVBoxLayout" name="_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QHBoxLayout" name="_4">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SizeConstraint::SetMinAndMaxSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnToggleLog">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@ -477,6 +395,39 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnApplySettings">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnToggleCore">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Start</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
@ -493,9 +444,6 @@
|
||||
<kerning>true</kerning>
|
||||
</font>
|
||||
</property>
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QPlainTextEdit::LineWrapMode::NoWrap</enum>
|
||||
</property>
|
||||
@ -510,149 +458,14 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="m_pLayoutActions">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelPadlock">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../res/deskflow.qrc">:/icons/64x64/padlock.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pStatusLabel">
|
||||
<property name="text">
|
||||
<string>Ready</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelNotice">
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">m_pLabelNotice</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnApplySettings">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnToggleCore">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Start</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>deskflow::gui::widgets::ServerStateLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>widgets/ServerStateLabel.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>deskflow::gui::widgets::ClientStateLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>widgets/ClientStateLabel.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>rbModeServer</tabstop>
|
||||
<tabstop>lineClientIp</tabstop>
|
||||
<tabstop>btnConnectToClient</tabstop>
|
||||
<tabstop>btnConfigureServer</tabstop>
|
||||
<tabstop>rbModeClient</tabstop>
|
||||
<tabstop>lineHostname</tabstop>
|
||||
<tabstop>btnConnect</tabstop>
|
||||
<tabstop>btnToggleLog</tabstop>
|
||||
<tabstop>textLog</tabstop>
|
||||
<tabstop>btnApplySettings</tabstop>
|
||||
<tabstop>btnToggleCore</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../res/deskflow.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@ -1,18 +1,7 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2015-2016 Symless Ltd.
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* SPDX-FileCopyrightText: (C) 2015 - 2016 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -1,18 +1,7 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2013 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2013 - 2016 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "QUtility.h"
|
||||
|
||||
@ -1,18 +1,7 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2013-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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2013 - 2016 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -1,19 +1,9 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "ScreenSetupModel.h"
|
||||
@ -48,28 +38,26 @@ ScreenSetupModel::ScreenSetupModel(ScreenList &screens, int numColumns, int numR
|
||||
|
||||
QVariant ScreenSetupModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (index.isValid() && index.row() < m_NumRows && index.column() < m_NumColumns) {
|
||||
switch (role) {
|
||||
case Qt::DecorationRole:
|
||||
if (screen(index).isNull())
|
||||
break;
|
||||
return QIcon(screen(index).pixmap());
|
||||
if (!index.isValid() || index.row() > m_NumRows || index.row() < 0 || index.column() < 0 ||
|
||||
index.column() > m_NumColumns)
|
||||
return QVariant();
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
if (screen(index).isNull())
|
||||
break;
|
||||
return QString(tr("<center>Screen: <b>%1</b></center>"
|
||||
"<br>Double click to edit settings"
|
||||
"<br>Drag screen to the trashcan to remove it"))
|
||||
.arg(screen(index).name());
|
||||
if (screen(index).isNull())
|
||||
return QVariant();
|
||||
|
||||
case Qt::DisplayRole:
|
||||
if (screen(index).isNull())
|
||||
break;
|
||||
return screen(index).name();
|
||||
}
|
||||
switch (role) {
|
||||
case Qt::DecorationRole:
|
||||
return screen(index).pixmap();
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
return QString(tr("<center>Screen: <b>%1</b></center>"
|
||||
"<br>Double click to edit settings"
|
||||
"<br>Drag screen to the trashcan to remove it"))
|
||||
.arg(screen(index).name());
|
||||
|
||||
case Qt::DisplayRole:
|
||||
return screen(index).name();
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
@ -1,19 +1,8 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -1,19 +1,9 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "ServerConfig.h"
|
||||
@ -141,10 +131,6 @@ void ServerConfig::commit()
|
||||
settings().setValue("clipboardSharing", clipboardSharing());
|
||||
settings().setValue("clipboardSharingSize", QVariant::fromValue(clipboardSharingSize()));
|
||||
|
||||
if (!getClientAddress().isEmpty()) {
|
||||
settings().setValue("clientAddress", getClientAddress());
|
||||
}
|
||||
|
||||
writeSettings(settings(), switchCorners(), "switchCorner");
|
||||
|
||||
settings().beginWriteArray("screens");
|
||||
@ -197,9 +183,8 @@ void ServerConfig::recall()
|
||||
settings().value("clipboardSharingSize", (int)ServerConfig::defaultClipboardSharingSize()).toULongLong()
|
||||
);
|
||||
setClipboardSharing(settings().value("clipboardSharing", true).toBool());
|
||||
setClientAddress(settings().value("clientAddress", "").toString());
|
||||
|
||||
readSettings(settings(), switchCorners(), "switchCorner", 0, static_cast<int>(NumSwitchCorners));
|
||||
readSettings(settings(), switchCorners(), "switchCorner", false, static_cast<int>(NumSwitchCorners));
|
||||
|
||||
int numScreens = settings().beginReadArray("screens");
|
||||
Q_ASSERT(numScreens <= screens().size());
|
||||
@ -250,7 +235,7 @@ QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config)
|
||||
|
||||
for (const Screen &s : config.screens()) {
|
||||
if (!s.isNull())
|
||||
s.writeScreensSection(outStream);
|
||||
outStream << s.screensSection();
|
||||
}
|
||||
|
||||
outStream << "end" << Qt::endl << Qt::endl;
|
||||
@ -259,7 +244,7 @@ QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config)
|
||||
|
||||
for (const Screen &s : config.screens()) {
|
||||
if (!s.isNull())
|
||||
s.writeAliasesSection(outStream);
|
||||
outStream << s.aliasesSection();
|
||||
}
|
||||
|
||||
outStream << "end" << Qt::endl << Qt::endl;
|
||||
@ -304,11 +289,6 @@ QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config)
|
||||
outStream << "\t"
|
||||
<< "clipboardSharingSize = " << config.clipboardSharingSize() << Qt::endl;
|
||||
|
||||
if (!config.getClientAddress().isEmpty()) {
|
||||
outStream << "\t"
|
||||
<< "clientAddress = " << config.getClientAddress() << Qt::endl;
|
||||
}
|
||||
|
||||
if (config.hasSwitchDelay())
|
||||
outStream << "\t"
|
||||
<< "switchDelay = " << config.switchDelay() << Qt::endl;
|
||||
@ -556,24 +536,6 @@ size_t ServerConfig::setClipboardSharingSize(size_t size)
|
||||
return size;
|
||||
}
|
||||
|
||||
void ServerConfig::setClientAddress(const QString &address)
|
||||
{
|
||||
if (m_pAppConfig->invertConnection()) {
|
||||
m_ClientAddress = address;
|
||||
}
|
||||
}
|
||||
|
||||
QString ServerConfig::getClientAddress() const
|
||||
{
|
||||
QString clientAddress;
|
||||
|
||||
if (m_pAppConfig->invertConnection()) {
|
||||
clientAddress = m_ClientAddress.trimmed();
|
||||
}
|
||||
|
||||
return clientAddress;
|
||||
}
|
||||
|
||||
QSettingsProxy &ServerConfig::settings()
|
||||
{
|
||||
return m_pAppConfig->scopes().activeSettings();
|
||||
|
||||
@ -1,19 +1,8 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -1,90 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
*
|
||||
* SPDX-FileCopyrightText: Copyright (C) 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: Copyright (C) 2012 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
#include "SetupWizard.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QFormLayout>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "common/constants.h"
|
||||
#include "gui/config/AppConfig.h"
|
||||
#include "gui/styles.h"
|
||||
#include "gui/validators/ScreenNameValidator.h"
|
||||
#include "gui/validators/ValidationError.h"
|
||||
|
||||
SetupWizard::SetupWizard(AppConfig &appConfig)
|
||||
: m_appConfig{appConfig},
|
||||
m_lblError{new QLabel(this)},
|
||||
m_lineName{new QLineEdit(this)},
|
||||
m_btnApply{new QPushButton(tr("Continue"), this)}
|
||||
{
|
||||
setWindowTitle(tr("Setup %1").arg(kAppName));
|
||||
|
||||
setFixedSize(740, 550);
|
||||
|
||||
auto headerFont = QFont(QStringLiteral("Cantarell"), 18, 600);
|
||||
|
||||
auto labelTitle = new QLabel(this);
|
||||
labelTitle->setFont(headerFont);
|
||||
labelTitle->setText(tr("Name your computer"));
|
||||
labelTitle->setAlignment(Qt::AlignHCenter | Qt::AlignHCenter);
|
||||
|
||||
auto labelName = new QLabel(this);
|
||||
labelName->setText(tr("Computer Name"));
|
||||
|
||||
auto formLayout = new QFormLayout();
|
||||
formLayout->addRow(labelName, m_lineName);
|
||||
formLayout->addWidget(m_lblError);
|
||||
formLayout->addWidget(new QLabel(tr("Call your computer something short and meaningful, but it must have:"), this));
|
||||
formLayout->addWidget(new QLabel(tr("\t⬤ No spaces"), this));
|
||||
formLayout->addWidget(new QLabel(tr("\t⬤ Only these special characters: _ - ."), this));
|
||||
formLayout->addWidget(new QLabel(tr("\t⬤ Only English characters and numbers"), this));
|
||||
formLayout->addWidget(new QLabel(tr("\t⬤ A different name from other computers"), this));
|
||||
|
||||
auto labelImage = new QLabel(this);
|
||||
labelImage->setPixmap(QPixmap(QStringLiteral(":/image/welcome.png")));
|
||||
|
||||
auto mainLayout = new QVBoxLayout();
|
||||
mainLayout->setContentsMargins(9, 30, 9, 9);
|
||||
mainLayout->addWidget(labelImage, 0, Qt::AlignHCenter);
|
||||
mainLayout->addWidget(labelTitle);
|
||||
mainLayout->addLayout(formLayout);
|
||||
mainLayout->addSpacerItem(new QSpacerItem(0, 25, QSizePolicy::Fixed, QSizePolicy::Fixed));
|
||||
mainLayout->addWidget(m_btnApply);
|
||||
|
||||
setLayout(mainLayout);
|
||||
|
||||
m_lblError->setStyleSheet(deskflow::gui::kStyleErrorActiveLabel);
|
||||
|
||||
m_lineName->setText(appConfig.screenName());
|
||||
m_lineName->setValidator(
|
||||
new validators::ScreenNameValidator(m_lineName, new validators::ValidationError(this, m_lblError))
|
||||
);
|
||||
|
||||
connect(m_btnApply, &QPushButton::clicked, this, &SetupWizard::accept);
|
||||
connect(m_lineName, &QLineEdit::textChanged, this, &SetupWizard::nameChanged);
|
||||
}
|
||||
|
||||
void SetupWizard::accept()
|
||||
{
|
||||
m_appConfig.setWizardHasRun();
|
||||
m_appConfig.setScreenName(m_lineName->text());
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void SetupWizard::nameChanged(const QString &error)
|
||||
{
|
||||
m_btnApply->setEnabled(m_lineName->hasAcceptableInput());
|
||||
}
|
||||
|
||||
void SetupWizard::reject()
|
||||
{
|
||||
QDialog::reject();
|
||||
QApplication::exit();
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
*
|
||||
* SPDX-FileCopyrightText: Copyright (C) 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: Copyright (C) 2012 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class AppConfig;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
|
||||
class SetupWizard : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SetupWizard(AppConfig &appConfig);
|
||||
~SetupWizard() = default;
|
||||
|
||||
protected:
|
||||
void accept() override;
|
||||
void reject() override;
|
||||
|
||||
private:
|
||||
void nameChanged(const QString &error);
|
||||
|
||||
AppConfig &m_appConfig;
|
||||
QLabel *m_lblError = nullptr;
|
||||
QLineEdit *m_lineName = nullptr;
|
||||
QPushButton *m_btnApply = nullptr;
|
||||
};
|
||||
@ -1,77 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2021 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 "TrayIcon.h"
|
||||
|
||||
#include "common/constants.h"
|
||||
#include "gui/Logger.h"
|
||||
|
||||
namespace deskflow::gui {
|
||||
|
||||
const auto kShowRetryInterval = 1000;
|
||||
|
||||
void TrayIcon::setIcon(const QIcon &icon)
|
||||
{
|
||||
m_icon = icon;
|
||||
if (m_pTrayIcon && !icon.isNull()) {
|
||||
m_pTrayIcon->setIcon(icon);
|
||||
}
|
||||
}
|
||||
|
||||
void TrayIcon::showRetryLoop()
|
||||
{
|
||||
// HACK: apparently this is needed to create a dbus connection, and the hide
|
||||
// is needed to make use of the object so the dbus connection doesn't get
|
||||
// optimized away by the compiler.
|
||||
// TODO: we should verify that this hack actually works.
|
||||
QSystemTrayIcon trayIcon;
|
||||
trayIcon.hide();
|
||||
|
||||
if (QSystemTrayIcon::isSystemTrayAvailable()) {
|
||||
m_pTrayIcon->show();
|
||||
} else {
|
||||
// on some platforms, it's not always possible to create the tray when the
|
||||
// app starts, so keep trying until it is possible.
|
||||
logVerbose(QString("system tray not ready yet, retrying in %1 ms").arg(kShowRetryInterval));
|
||||
QTimer::singleShot(kShowRetryInterval, this, &TrayIcon::showRetryLoop);
|
||||
}
|
||||
}
|
||||
|
||||
void TrayIcon::create(const QList<QAction *> &actions)
|
||||
{
|
||||
m_pTrayIconMenu = std::make_unique<QMenu>();
|
||||
|
||||
for (auto action : actions) {
|
||||
if (action) {
|
||||
m_pTrayIconMenu->addAction(action);
|
||||
} else {
|
||||
m_pTrayIconMenu->addSeparator();
|
||||
}
|
||||
}
|
||||
|
||||
m_pTrayIcon = std::make_unique<QSystemTrayIcon>();
|
||||
setIcon(m_icon);
|
||||
|
||||
connect(m_pTrayIcon.get(), &QSystemTrayIcon::activated, this, &TrayIcon::activated);
|
||||
|
||||
m_pTrayIcon->setContextMenu(m_pTrayIconMenu.get());
|
||||
m_pTrayIcon->setToolTip(kAppName);
|
||||
|
||||
showRetryLoop();
|
||||
}
|
||||
|
||||
} // namespace deskflow::gui
|
||||
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2021 Symless Ltd.
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QMenu>
|
||||
#include <QObject>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QTimer>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace deskflow::gui {
|
||||
|
||||
class TrayIcon : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TrayIcon() = default;
|
||||
|
||||
void create(const QList<QAction *> &actions);
|
||||
void setIcon(const QIcon &icon);
|
||||
|
||||
signals:
|
||||
void activated(QSystemTrayIcon::ActivationReason reason);
|
||||
|
||||
private:
|
||||
void showRetryLoop();
|
||||
|
||||
std::unique_ptr<QSystemTrayIcon> m_pTrayIcon;
|
||||
std::unique_ptr<QMenu> m_pTrayIconMenu;
|
||||
std::function<void()> m_init;
|
||||
std::function<void(const QIcon &icon)> m_setIcon;
|
||||
QIcon m_icon;
|
||||
};
|
||||
|
||||
} // namespace deskflow::gui
|
||||
@ -1,18 +1,7 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "VersionChecker.h"
|
||||
@ -58,7 +47,7 @@ void VersionChecker::replyFinished(QNetworkReply *reply)
|
||||
return;
|
||||
}
|
||||
|
||||
qInfo("version check server success, http status: %d", httpStatus);
|
||||
qDebug("version check server success, http status: %d", httpStatus);
|
||||
|
||||
const auto newestVersion = QString(reply->readAll());
|
||||
qDebug("version check response: %s", qPrintable(newestVersion));
|
||||
@ -85,7 +74,7 @@ int VersionChecker::getStageVersion(QString stage)
|
||||
|
||||
if (stage.isEmpty() || stage == stableName) {
|
||||
return stableValue;
|
||||
} else if (stage.toLower().startsWith(rcName)) {
|
||||
} else if (stage.startsWith(rcName, Qt::CaseInsensitive)) {
|
||||
static QRegularExpression re("\\d*", QRegularExpression::CaseInsensitiveOption);
|
||||
auto match = re.match(stage);
|
||||
if (match.hasMatch()) {
|
||||
|
||||
@ -1,18 +1,7 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -1 +0,0 @@
|
||||
IDI_ICON1 ICON DISCARDABLE "../res/deskflow.ico"
|
||||
@ -1,26 +1,15 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* Copyright (C) 2012 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "AboutDialog.h"
|
||||
#include "ui_AboutDialog.h"
|
||||
|
||||
#include "common/constants.h"
|
||||
#include "gui/style_utils.h"
|
||||
|
||||
#include <QClipboard>
|
||||
#include <QDateTime>
|
||||
@ -29,60 +18,42 @@
|
||||
#include <QPushButton>
|
||||
#include <QStyle>
|
||||
|
||||
AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent)
|
||||
AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui{std::make_unique<Ui::AboutDialog>()}
|
||||
{
|
||||
setWindowTitle(tr("About Deskflow"));
|
||||
ui->setupUi(this);
|
||||
|
||||
auto copyIcon = QIcon::fromTheme(
|
||||
QIcon::ThemeIcon::EditCopy, deskflow::gui::isDarkMode() ? QIcon(s_darkCopy) : QIcon(s_lightCopy)
|
||||
);
|
||||
const int px = (fontMetrics().height() * 6);
|
||||
const QSize pixmapSize(px, px);
|
||||
ui->lblIcon->setFixedSize(pixmapSize);
|
||||
|
||||
auto btnCopyVersion = new QPushButton(copyIcon, QString(), this);
|
||||
btnCopyVersion->setFlat(true);
|
||||
connect(btnCopyVersion, &QPushButton::clicked, this, [] { QGuiApplication::clipboard()->setText(kVersion); });
|
||||
ui->lblIcon->setPixmap(QPixmap(QIcon::fromTheme("deskflow").pixmap(QSize().scaled(pixmapSize, Qt::KeepAspectRatio))));
|
||||
|
||||
// Set up the displayed version number
|
||||
auto versionString = QString(kVersion);
|
||||
if (versionString.endsWith(QStringLiteral(".0"))) {
|
||||
versionString.chop(2);
|
||||
} else {
|
||||
versionString.append(QStringLiteral(" (%1)").arg(kVersionGitSha));
|
||||
}
|
||||
ui->btnCopyVersion->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::EditCopy));
|
||||
connect(ui->btnCopyVersion, &QPushButton::clicked, this, &AboutDialog::copyVersionText);
|
||||
|
||||
auto versionLayout = new QHBoxLayout();
|
||||
versionLayout->addWidget(new QLabel(tr("Version:")));
|
||||
versionLayout->addWidget(new QLabel(versionString, this));
|
||||
versionLayout->addWidget(btnCopyVersion);
|
||||
versionLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Fixed));
|
||||
ui->lblVersion->setText(kDisplayVersion);
|
||||
|
||||
auto lblLogo = new QLabel(this);
|
||||
lblLogo->setPixmap(deskflow::gui::isDarkMode() ? s_darkLogo : s_lightLogo);
|
||||
ui->lblDescription->setText(kAppDescription);
|
||||
ui->lblCopyright->setText(kCopyright);
|
||||
ui->lblImportantDevs->setText(QStringLiteral("%1\n").arg(s_awesomeDevs.join(", ")));
|
||||
|
||||
auto lblCopyright = new QLabel(kCopyright, this);
|
||||
ui->btnOk->setDefault(true);
|
||||
connect(ui->btnOk, &QPushButton::clicked, this, [this] { close(); });
|
||||
|
||||
auto boldFont = font();
|
||||
boldFont.setBold(true);
|
||||
|
||||
auto lblDevsTitle = new QLabel(tr("Important developers"));
|
||||
lblDevsTitle->setFont(boldFont);
|
||||
|
||||
auto lblDevsBody = new QLabel(QStringLiteral("%1\n").arg(s_awesomeDevs.join(", ")));
|
||||
lblDevsBody->setWordWrap(true);
|
||||
|
||||
auto btnOk = new QPushButton(tr("Ok"), this);
|
||||
btnOk->setDefault(true);
|
||||
connect(btnOk, &QPushButton::clicked, this, [this] { close(); });
|
||||
|
||||
auto mainLayout = new QVBoxLayout();
|
||||
mainLayout->addWidget(lblLogo);
|
||||
mainLayout->addLayout(versionLayout);
|
||||
mainLayout->addWidget(new QLabel(tr("Keyboard and mouse sharing application"), this));
|
||||
mainLayout->addWidget(lblCopyright);
|
||||
mainLayout->addWidget(lblDevsTitle);
|
||||
mainLayout->addWidget(lblDevsBody);
|
||||
mainLayout->addWidget(btnOk);
|
||||
|
||||
setLayout(mainLayout);
|
||||
setFixedWidth(600);
|
||||
adjustSize();
|
||||
setFixedSize(size());
|
||||
setMinimumSize(size());
|
||||
}
|
||||
|
||||
void AboutDialog::copyVersionText()
|
||||
{
|
||||
QString infoString = QStringLiteral("Deskflow: %1 (%2)\nQt: %3\nSystem: %4")
|
||||
.arg(kVersion, kVersionGitSha, qVersion(), QSysInfo::prettyProductName());
|
||||
#ifdef Q_OS_LINUX
|
||||
infoString.append(QStringLiteral("\nSession: %1 (%2)")
|
||||
.arg(qEnvironmentVariable("XDG_CURRENT_DESKTOP"), qEnvironmentVariable("XDG_SESSION_TYPE")));
|
||||
#endif
|
||||
QGuiApplication::clipboard()->setText(infoString);
|
||||
}
|
||||
|
||||
AboutDialog::~AboutDialog() = default;
|
||||
|
||||
@ -1,38 +1,30 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* Copyright (C) 2012 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class AboutDialog;
|
||||
}
|
||||
|
||||
class AboutDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AboutDialog(QWidget *parent = nullptr);
|
||||
~AboutDialog() = default;
|
||||
~AboutDialog() override;
|
||||
|
||||
private:
|
||||
inline static const auto s_lightCopy = QStringLiteral(":/icons/64x64/copy-light.png");
|
||||
inline static const auto s_darkCopy = QStringLiteral(":/icons/64x64/copy-dark.png");
|
||||
inline static const auto s_lightLogo = QStringLiteral(":/image/logo-light.png");
|
||||
inline static const auto s_darkLogo = QStringLiteral(":/image/logo-dark.png");
|
||||
std::unique_ptr<Ui::AboutDialog> ui;
|
||||
void copyVersionText();
|
||||
|
||||
inline static const auto s_awesomeDevs = QStringList{
|
||||
// Chris is the ultimate creator, and the one who started it all in 2001.
|
||||
QStringLiteral("Chris Schoeneman"),
|
||||
|
||||
436
src/apps/deskflow-gui/dialogs/AboutDialog.ui
Normal file
436
src/apps/deskflow-gui/dialogs/AboutDialog.ui
Normal file
@ -0,0 +1,436 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AboutDialog</class>
|
||||
<widget class="QDialog" name="AboutDialog">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::ApplicationModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>475</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>About Deskflow</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset theme="help-about"/>
|
||||
</property>
|
||||
<property name="modal">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="frameLogo" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="linkGpl">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"><span style=" text-decoration: underline; color:#508ed8;">License: GNU GPL Version 2</a></span></p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>5</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="lblName">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>28</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Deskflow</string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="program_name" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="9">
|
||||
<widget class="QLabel" name="lblIcon">
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Version: </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblVersion">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>lbl_version</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="smaller_text" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCopyVersion">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Copy version info</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/icons/64x64/copy-dark.png</normaloff>:/icons/64x64/copy-dark.png</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="linkContributors">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/deskflow/deskflow/graphs/contributors"><span style=" text-decoration: underline; color:#508ed8;">Code Contributors</span></a></p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblDescription">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>lblDescription</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblCopyright">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">lblCopyright</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>574</width>
|
||||
<height>191</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Icons from <a href="https://develop.kde.org/frameworks/breeze-icons/"><span style=" text-decoration: underline; color:#007af4;">KDE Breeze</span></a></p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Important Developers</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblImportantDevs">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>lblImportantDevs</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget1" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnOk">
|
||||
<property name="text">
|
||||
<string>&Close</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="window-close"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -1,19 +1,9 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "ActionDialog.h"
|
||||
@ -24,101 +14,138 @@
|
||||
#include "KeySequence.h"
|
||||
#include "ServerConfig.h"
|
||||
|
||||
#include <QButtonGroup>
|
||||
#include <QTimer>
|
||||
|
||||
ActionDialog::ActionDialog(QWidget *parent, ServerConfig &config, Hotkey &hotkey, Action &action)
|
||||
ActionDialog::ActionDialog(QWidget *parent, const ServerConfig &config, Hotkey &hotkey, Action &action)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
ui{std::make_unique<Ui::ActionDialog>()},
|
||||
m_ServerConfig(config),
|
||||
m_Hotkey(hotkey),
|
||||
m_Action(action),
|
||||
m_pButtonGroupType(new QButtonGroup(this))
|
||||
m_hotkey(hotkey),
|
||||
m_action(action)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->keySequenceWidget, &KeySequenceWidget::keySequenceChanged, this, &ActionDialog::keySequenceChanged);
|
||||
connect(
|
||||
ui->comboActionType, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ActionDialog::actionTypeChanged
|
||||
);
|
||||
connect(ui->listScreens, &QListWidget::itemChanged, this, [&] {
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(canSave());
|
||||
});
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &ActionDialog::accept);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &ActionDialog::reject);
|
||||
|
||||
// work around Qt Designer's lack of a QButtonGroup; we need it to get
|
||||
// at the button id of the checked radio button
|
||||
QRadioButton *const typeButtons[] = {
|
||||
ui->m_pRadioPress,
|
||||
ui->m_pRadioRelease,
|
||||
ui->m_pRadioPressAndRelease,
|
||||
ui->m_pRadioSwitchToScreen,
|
||||
ui->m_pRadioSwitchInDirection,
|
||||
ui->m_pRadioLockCursorToScreen,
|
||||
ui->m_pRadioRestartAllConnections
|
||||
};
|
||||
ui->keySequenceWidget->setText(m_action.keySequence().toString());
|
||||
ui->keySequenceWidget->setKeySequence(m_action.keySequence());
|
||||
|
||||
for (unsigned int i = 0; i < sizeof(typeButtons) / sizeof(typeButtons[0]); i++)
|
||||
m_pButtonGroupType->addButton(typeButtons[i], i);
|
||||
ui->comboSwitchInDirection->setCurrentIndex(m_action.switchDirection());
|
||||
ui->comboLockCursorToScreen->setCurrentIndex(m_action.lockCursorMode());
|
||||
|
||||
ui->m_pKeySequenceWidgetHotkey->setText(m_Action.keySequence().toString());
|
||||
ui->m_pKeySequenceWidgetHotkey->setKeySequence(m_Action.keySequence());
|
||||
m_pButtonGroupType->button(m_Action.type())->setChecked(true);
|
||||
ui->m_pComboSwitchInDirection->setCurrentIndex(m_Action.switchDirection());
|
||||
ui->m_pComboLockCursorToScreen->setCurrentIndex(m_Action.lockCursorMode());
|
||||
ui->comboActionType->setCurrentIndex(m_action.type());
|
||||
ui->comboTriggerOn->setCurrentIndex(m_action.activeOnRelease());
|
||||
|
||||
if (m_Action.activeOnRelease())
|
||||
ui->m_pRadioHotkeyReleased->setChecked(true);
|
||||
else
|
||||
ui->m_pRadioHotkeyPressed->setChecked(true);
|
||||
for (const Screen &screen : config.screens()) {
|
||||
if (screen.isNull())
|
||||
continue;
|
||||
auto *newListItem = new QListWidgetItem(screen.name());
|
||||
newListItem->setCheckState(Qt::Checked);
|
||||
if ((m_action.typeScreenNames().indexOf(screen.name()) == -1) &&
|
||||
(m_action.haveScreens() && !m_action.typeScreenNames().isEmpty()))
|
||||
newListItem->setCheckState(Qt::Unchecked);
|
||||
|
||||
ui->m_pGroupBoxScreens->setChecked(m_Action.haveScreens());
|
||||
ui->listScreens->addItem(newListItem);
|
||||
|
||||
int idx = 0;
|
||||
for (const Screen &screen : serverConfig().screens()) {
|
||||
if (!screen.isNull()) {
|
||||
QListWidgetItem *pListItem = new QListWidgetItem(screen.name());
|
||||
ui->m_pListScreens->addItem(pListItem);
|
||||
if (m_Action.typeScreenNames().indexOf(screen.name()) != -1)
|
||||
ui->m_pListScreens->setCurrentItem(pListItem);
|
||||
|
||||
ui->m_pComboSwitchToScreen->addItem(screen.name());
|
||||
if (screen.name() == m_Action.switchScreenName())
|
||||
ui->m_pComboSwitchToScreen->setCurrentIndex(idx);
|
||||
|
||||
idx++;
|
||||
}
|
||||
ui->comboSwitchToScreen->addItem(tr("Switch to %1").arg(screen.name()));
|
||||
if (screen.name() == m_action.switchScreenName())
|
||||
ui->comboSwitchToScreen->setCurrentIndex(ui->comboSwitchToScreen->count() - 1);
|
||||
}
|
||||
|
||||
ui->keySequenceWidget->setVisible(false);
|
||||
ui->groupScreens->setVisible(false);
|
||||
ui->listScreens->setEnabled(!ui->keySequenceWidget->keySequence().isMouseButton());
|
||||
ui->comboSwitchToScreen->setVisible(false);
|
||||
ui->comboSwitchInDirection->setVisible(false);
|
||||
ui->comboLockCursorToScreen->setVisible(false);
|
||||
|
||||
actionTypeChanged(ui->comboActionType->currentIndex());
|
||||
}
|
||||
|
||||
void ActionDialog::accept()
|
||||
{
|
||||
if (!sequenceWidget()->valid() && m_pButtonGroupType->checkedId() >= 0 && m_pButtonGroupType->checkedId() < 3)
|
||||
if (!canSave())
|
||||
return;
|
||||
|
||||
m_Action.setKeySequence(sequenceWidget()->keySequence());
|
||||
m_Action.setType(m_pButtonGroupType->checkedId());
|
||||
m_Action.setHaveScreens(ui->m_pGroupBoxScreens->isChecked());
|
||||
m_action.setKeySequence(ui->keySequenceWidget->keySequence());
|
||||
m_action.setType(ui->comboActionType->currentIndex());
|
||||
|
||||
m_Action.typeScreenNames().clear();
|
||||
m_action.typeScreenNames().clear();
|
||||
|
||||
const auto &selection = ui->m_pListScreens->selectedItems();
|
||||
for (const QListWidgetItem *pItem : selection)
|
||||
m_Action.typeScreenNames().append(pItem->text());
|
||||
int screenCount = ui->listScreens->count();
|
||||
|
||||
m_Action.setSwitchScreenName(ui->m_pComboSwitchToScreen->currentText());
|
||||
m_Action.setSwitchDirection(ui->m_pComboSwitchInDirection->currentIndex());
|
||||
m_Action.setLockCursorMode(ui->m_pComboLockCursorToScreen->currentIndex());
|
||||
m_Action.setActiveOnRelease(ui->m_pRadioHotkeyReleased->isChecked());
|
||||
m_Action.setRestartServer(ui->m_pRadioRestartAllConnections->isChecked());
|
||||
for (int i = 0; i < ui->listScreens->count(); i++) {
|
||||
const auto &item = ui->listScreens->item(i);
|
||||
m_action.typeScreenNames().append(item->text());
|
||||
if (item->checkState() == Qt::Unchecked) {
|
||||
screenCount--;
|
||||
m_action.typeScreenNames().removeLast();
|
||||
}
|
||||
}
|
||||
|
||||
if (screenCount == ui->listScreens->count())
|
||||
m_action.typeScreenNames().clear();
|
||||
|
||||
m_action.setHaveScreens(screenCount);
|
||||
|
||||
m_action.setSwitchScreenName(ui->comboSwitchToScreen->currentText().remove(tr("Switch to ")));
|
||||
m_action.setSwitchDirection(ui->comboSwitchInDirection->currentIndex());
|
||||
m_action.setLockCursorMode(ui->comboLockCursorToScreen->currentIndex());
|
||||
m_action.setActiveOnRelease(ui->comboTriggerOn->currentIndex());
|
||||
m_action.setRestartServer(ui->comboActionType->currentIndex() == ActionTypes::RestartServer);
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void ActionDialog::on_m_pKeySequenceWidgetHotkey_keySequenceChanged()
|
||||
void ActionDialog::updateSize()
|
||||
{
|
||||
if (sequenceWidget()->keySequence().isMouseButton()) {
|
||||
ui->m_pGroupBoxScreens->setEnabled(false);
|
||||
ui->m_pListScreens->setEnabled(false);
|
||||
} else {
|
||||
ui->m_pGroupBoxScreens->setEnabled(true);
|
||||
ui->m_pListScreens->setEnabled(true);
|
||||
}
|
||||
setMaximumSize(QSize(16777215, 1677215));
|
||||
adjustSize();
|
||||
if (!isKeyAction(ui->comboActionType->currentIndex()))
|
||||
setMaximumSize(size());
|
||||
}
|
||||
|
||||
const KeySequenceWidget *ActionDialog::sequenceWidget() const
|
||||
void ActionDialog::keySequenceChanged()
|
||||
{
|
||||
return ui->m_pKeySequenceWidgetHotkey;
|
||||
ui->listScreens->setEnabled(!ui->keySequenceWidget->keySequence().isMouseButton());
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(canSave());
|
||||
}
|
||||
|
||||
void ActionDialog::actionTypeChanged(int index)
|
||||
{
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(canSave());
|
||||
ui->keySequenceWidget->setVisible(isKeyAction(index));
|
||||
ui->groupScreens->setVisible(isKeyAction(index));
|
||||
ui->listScreens->setEnabled(!ui->keySequenceWidget->keySequence().isMouseButton());
|
||||
ui->comboSwitchToScreen->setVisible(index == ActionTypes::SwitchTo);
|
||||
ui->comboSwitchInDirection->setVisible(index == ActionTypes::SwitchInDirection);
|
||||
ui->comboLockCursorToScreen->setVisible(index == ActionTypes::ModifyCursorLock);
|
||||
QTimer::singleShot(1, this, &ActionDialog::updateSize);
|
||||
}
|
||||
|
||||
bool ActionDialog::isKeyAction(int index)
|
||||
{
|
||||
return ((index == ActionTypes::PressKey) || (index == ActionTypes::ReleaseKey) || (index == ActionTypes::ToggleKey));
|
||||
}
|
||||
|
||||
bool ActionDialog::canSave()
|
||||
{
|
||||
if (isKeyAction(ui->comboActionType->currentIndex())) {
|
||||
const QList<QListWidgetItem *> items = ui->listScreens->findItems("*", Qt::MatchWildcard);
|
||||
int totalChecked = 0;
|
||||
for (const auto &item : items) {
|
||||
if (item->checkState() == Qt::Checked)
|
||||
totalChecked++;
|
||||
};
|
||||
return (!ui->keySequenceWidget->keySequence().toString().isEmpty() && (totalChecked > 0));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
ActionDialog::~ActionDialog() = default;
|
||||
|
||||
@ -1,19 +1,9 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@ -22,8 +12,6 @@
|
||||
|
||||
class Hotkey;
|
||||
class Action;
|
||||
class QRadioButton;
|
||||
class QButtonGroup;
|
||||
class ServerConfig;
|
||||
class KeySequenceWidget;
|
||||
|
||||
@ -36,25 +24,31 @@ class ActionDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ActionDialog(QWidget *parent, ServerConfig &config, Hotkey &hotkey, Action &action);
|
||||
enum ActionTypes
|
||||
{
|
||||
PressKey,
|
||||
ReleaseKey,
|
||||
ToggleKey,
|
||||
SwitchTo,
|
||||
SwitchInDirection,
|
||||
ModifyCursorLock,
|
||||
RestartServer
|
||||
};
|
||||
|
||||
ActionDialog(QWidget *parent, const ServerConfig &config, Hotkey &hotkey, Action &action);
|
||||
~ActionDialog() override;
|
||||
|
||||
protected slots:
|
||||
void accept() override;
|
||||
void on_m_pKeySequenceWidgetHotkey_keySequenceChanged();
|
||||
|
||||
protected:
|
||||
const KeySequenceWidget *sequenceWidget() const;
|
||||
const ServerConfig &serverConfig() const
|
||||
{
|
||||
return m_ServerConfig;
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::ActionDialog> ui;
|
||||
const ServerConfig &m_ServerConfig;
|
||||
Hotkey &m_Hotkey;
|
||||
Action &m_Action;
|
||||
void updateSize();
|
||||
void keySequenceChanged();
|
||||
void actionTypeChanged(int index);
|
||||
bool isKeyAction(int index);
|
||||
bool canSave();
|
||||
|
||||
QButtonGroup *m_pButtonGroupType;
|
||||
std::unique_ptr<Ui::ActionDialog> ui;
|
||||
Hotkey &m_hotkey;
|
||||
Action &m_action;
|
||||
};
|
||||
|
||||
@ -6,283 +6,156 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>375</width>
|
||||
<height>528</height>
|
||||
<width>706</width>
|
||||
<height>256</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Configure Action</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<layout class="QVBoxLayout" name="_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupType">
|
||||
<property name="font">
|
||||
<font>
|
||||
<kerning>true</kerning>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Choose the action to perform</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioPress">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboTriggerOn">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Press a hotkey</string>
|
||||
<string>When the hotkey is pressed</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioRelease">
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Release a hotkey</string>
|
||||
<string>When the hotkey is released</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioPressAndRelease">
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboActionType">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Press and release a hotkey</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KeySequenceWidget" name="m_pKeySequenceWidgetHotkey">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>256</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
<string>Press key(s)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string>Release key(s)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupBoxScreens">
|
||||
<property name="title">
|
||||
<string>only on these screens</string>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Press and release key(s)</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Switch to a computer</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Switch in a direction</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="m_pListScreens">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Modify the cursor lock</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioSwitchToScreen">
|
||||
<property name="text">
|
||||
<string>Switch to screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="m_pComboSwitchToScreen">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioSwitchInDirection">
|
||||
<property name="text">
|
||||
<string>Switch in direction</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="m_pComboSwitchInDirection">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>right</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>up</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>down</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioLockCursorToScreen">
|
||||
<property name="text">
|
||||
<string>Lock cursor to screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="m_pComboLockCursorToScreen">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>toggle</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>on</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>off</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioRestartAllConnections">
|
||||
<property name="text">
|
||||
<string>Restart server</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Restart the server</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<kerning>false</kerning>
|
||||
</font>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboSwitchToScreen">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboSwitchInDirection">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Switch to the computer on the left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Switch to the computer on the right</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Switch to the computer above</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Switch to the computer below</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboLockCursorToScreen">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Toggle the cursor lock</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Enable the cursor lock</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Disable the cursor lock</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KeySequenceWidget" name="keySequenceWidget"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupScreens">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>This action is performed when</string>
|
||||
<string>Computers to recieve this event</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout">
|
||||
<layout class="QHBoxLayout" name="_3">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioHotkeyPressed">
|
||||
<property name="text">
|
||||
<string>the hotkey is pressed</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioHotkeyReleased">
|
||||
<property name="text">
|
||||
<string>the hotkey is released</string>
|
||||
<widget class="QListWidget" name="listScreens">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustToContentsOnFirstShow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -291,11 +164,8 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -309,326 +179,5 @@
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>ActionDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>245</x>
|
||||
<y>474</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>ActionDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>313</x>
|
||||
<y>474</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pGroupType</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pKeySequenceWidgetHotkey</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>104</x>
|
||||
<y>194</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>110</x>
|
||||
<y>132</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioSwitchInDirection</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pKeySequenceWidgetHotkey</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>118</x>
|
||||
<y>322</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>81</x>
|
||||
<y>129</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioLockCursorToScreen</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pKeySequenceWidgetHotkey</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>101</x>
|
||||
<y>353</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>68</x>
|
||||
<y>126</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioRestartAllConnections</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pKeySequenceWidgetHotkey</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>101</x>
|
||||
<y>353</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>68</x>
|
||||
<y>126</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioPress</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pKeySequenceWidgetHotkey</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>48</x>
|
||||
<y>48</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>45</x>
|
||||
<y>129</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioRelease</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pKeySequenceWidgetHotkey</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>135</x>
|
||||
<y>70</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>148</x>
|
||||
<y>125</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioPressAndRelease</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pKeySequenceWidgetHotkey</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>194</x>
|
||||
<y>100</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>201</x>
|
||||
<y>125</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioSwitchToScreen</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pComboSwitchToScreen</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>148</x>
|
||||
<y>291</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>350</x>
|
||||
<y>290</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioSwitchInDirection</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pComboSwitchInDirection</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>158</x>
|
||||
<y>322</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>350</x>
|
||||
<y>321</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioLockCursorToScreen</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pComboLockCursorToScreen</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>180</x>
|
||||
<y>353</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>350</x>
|
||||
<y>352</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioPress</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pGroupBoxScreens</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>25</x>
|
||||
<y>47</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>33</x>
|
||||
<y>155</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioSwitchToScreen</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pGroupBoxScreens</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>48</x>
|
||||
<y>278</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>98</x>
|
||||
<y>153</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioRelease</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pGroupBoxScreens</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>264</x>
|
||||
<y>67</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>241</x>
|
||||
<y>158</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioPressAndRelease</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pGroupBoxScreens</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>286</x>
|
||||
<y>98</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>290</x>
|
||||
<y>156</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioSwitchInDirection</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pGroupBoxScreens</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>38</x>
|
||||
<y>313</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>64</x>
|
||||
<y>195</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioLockCursorToScreen</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pGroupBoxScreens</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>48</x>
|
||||
<y>339</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>79</x>
|
||||
<y>234</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioRestartAllConnections</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pGroupBoxScreens</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>48</x>
|
||||
<y>339</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>79</x>
|
||||
<y>234</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pRadioSwitchToScreen</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_pKeySequenceWidgetHotkey</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>84</x>
|
||||
<y>280</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>185</x>
|
||||
<y>123</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@ -1,18 +1,7 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2014-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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2014 - 2016 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "AddClientDialog.h"
|
||||
|
||||
@ -1,18 +1,7 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2014-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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2014 - 2016 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
77
src/apps/deskflow-gui/dialogs/FingerprintDialog.cpp
Normal file
77
src/apps/deskflow-gui/dialogs/FingerprintDialog.cpp
Normal file
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "FingerprintDialog.h"
|
||||
|
||||
#include "widgets/FingerprintPreview.h"
|
||||
|
||||
#include <QFont>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
FingerprintDialog::FingerprintDialog(
|
||||
QWidget *parent, const QList<deskflow::FingerprintData> &fingerprints, FingerprintDialogMode mode
|
||||
)
|
||||
: QDialog(parent),
|
||||
m_lblHeader{new QLabel(this)},
|
||||
m_lblFooter{new QLabel(this)},
|
||||
m_fingerprintPreview{new FingerprintPreview(this, fingerprints)},
|
||||
m_buttonBox{new QDialogButtonBox(this)}
|
||||
{
|
||||
setWindowIcon(QIcon::fromTheme("fingerprint"));
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
|
||||
m_lblHeader->setWordWrap(true);
|
||||
m_lblFooter->setWordWrap(true);
|
||||
m_lblFooter->setAlignment(Qt::AlignHCenter);
|
||||
|
||||
auto layout = new QVBoxLayout();
|
||||
layout->addWidget(m_lblHeader);
|
||||
layout->addSpacerItem(new QSpacerItem(0, 10, QSizePolicy::Fixed, QSizePolicy::Fixed));
|
||||
layout->addWidget(m_fingerprintPreview, 0, Qt::AlignTop | Qt::AlignHCenter);
|
||||
layout->addWidget(m_lblFooter);
|
||||
layout->addWidget(m_buttonBox);
|
||||
setLayout(layout);
|
||||
|
||||
if (mode == Local) {
|
||||
setWindowTitle(tr("Local Fingerprints"));
|
||||
m_lblHeader->setText(tr("Local computer's fingerprints"));
|
||||
m_lblFooter->setVisible(false);
|
||||
m_buttonBox->setStandardButtons(QDialogButtonBox::Ok);
|
||||
connect(m_buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &QDialog::accept);
|
||||
} else {
|
||||
setWindowTitle(tr("Security Question"));
|
||||
auto body = tr("Compare the fingerprints in this dialog to those on the %1.\n"
|
||||
"Only connect if they match!");
|
||||
|
||||
if (mode == FingerprintDialogMode::Server) {
|
||||
m_lblHeader->setText(tr("A new client is connecting.\n%1").arg(body.arg(tr("client"))));
|
||||
m_lblFooter->setText(tr("\nDo you want connect to and trust the client?\n"));
|
||||
} else {
|
||||
m_lblHeader->setText(tr("You are connecting to a new server.\n%1").arg(body.arg(tr("server"))));
|
||||
m_lblFooter->setText(tr("\nDo you want connect to the server?\n"));
|
||||
}
|
||||
|
||||
m_buttonBox->setStandardButtons(QDialogButtonBox::Help | QDialogButtonBox::Yes | QDialogButtonBox::No);
|
||||
|
||||
// Use help to request a dialog with the host prints
|
||||
// Help is used because its always to the furthest from the other buttons.
|
||||
m_buttonBox->button(QDialogButtonBox::Help)->setText(tr("View local fingerprints"));
|
||||
m_buttonBox->button(QDialogButtonBox::Help)->setIcon(QIcon::fromTheme("fingerprint"));
|
||||
m_buttonBox->button(QDialogButtonBox::Help)->setToolTip(tr("Show the local machines fingerprints"));
|
||||
connect(
|
||||
m_buttonBox->button(QDialogButtonBox::Help), &QPushButton::clicked, this,
|
||||
&FingerprintDialog::requestLocalPrintsDialog
|
||||
);
|
||||
|
||||
m_buttonBox->button(QDialogButtonBox::No)->setFocus();
|
||||
connect(m_buttonBox->button(QDialogButtonBox::No), &QPushButton::clicked, this, &QDialog::reject);
|
||||
connect(m_buttonBox->button(QDialogButtonBox::Yes), &QPushButton::clicked, this, &QDialog::accept);
|
||||
}
|
||||
adjustSize();
|
||||
setFixedSize(size());
|
||||
}
|
||||
43
src/apps/deskflow-gui/dialogs/FingerprintDialog.h
Normal file
43
src/apps/deskflow-gui/dialogs/FingerprintDialog.h
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "net/FingerprintData.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
enum FingerprintDialogMode
|
||||
{
|
||||
Local,
|
||||
Client,
|
||||
Server
|
||||
};
|
||||
|
||||
class QLabel;
|
||||
class FingerprintPreview;
|
||||
|
||||
class FingerprintDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FingerprintDialog(
|
||||
QWidget *parent = nullptr, const QList<deskflow::FingerprintData> &fingerprints = {},
|
||||
FingerprintDialogMode mode = FingerprintDialogMode::Local
|
||||
);
|
||||
~FingerprintDialog() = default;
|
||||
|
||||
signals:
|
||||
void requestLocalPrintsDialog();
|
||||
|
||||
private:
|
||||
QLabel *m_lblHeader = nullptr;
|
||||
QLabel *m_lblFooter = nullptr;
|
||||
FingerprintPreview *m_fingerprintPreview = nullptr;
|
||||
QDialogButtonBox *m_buttonBox = nullptr;
|
||||
};
|
||||
@ -1,19 +1,8 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "HotkeyDialog.h"
|
||||
|
||||
@ -1,20 +1,10 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Hotkey.h"
|
||||
|
||||
@ -1,19 +1,8 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "ScreenSettingsDialog.h"
|
||||
|
||||
@ -1,19 +1,8 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -1,19 +1,9 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "ServerConfigDialog.h"
|
||||
@ -45,46 +35,115 @@ ServerConfigDialog::ServerConfigDialog(QWidget *parent, ServerConfig &config, Ap
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
const auto folderIcon =
|
||||
QIcon::fromTheme(QIcon::ThemeIcon::DocumentOpen, QIcon(QStringLiteral(":/icons/64x64/folder.png")));
|
||||
ui->m_pButtonBrowseConfigFile->setIcon(folderIcon);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &ServerConfigDialog::accept);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &ServerConfigDialog::reject);
|
||||
|
||||
ui->lblRemoveScreen->setPixmap(QIcon::fromTheme("user-trash").pixmap(QSize(64, 64)));
|
||||
connect(ui->lblRemoveScreen, &TrashScreenWidget::screenRemoved, this, &ServerConfigDialog::onScreenRemoved);
|
||||
|
||||
ui->lblNewScreen->setEnabled(!model().isFull());
|
||||
ui->lblNewScreen->setPixmap(QIcon::fromTheme("video-display").pixmap(QSize(64, 64)));
|
||||
|
||||
connect(ui->btnNewHotkey, &QPushButton::clicked, this, &ServerConfigDialog::addHotkey);
|
||||
connect(ui->btnEditHotkey, &QPushButton::clicked, this, &ServerConfigDialog::editHotkey);
|
||||
connect(ui->btnRemoveHotkey, &QPushButton::clicked, this, &ServerConfigDialog::removeHotkey);
|
||||
connect(ui->listHotkeys, &QListView::doubleClicked, this, &ServerConfigDialog::editHotkey);
|
||||
connect(
|
||||
ui->listHotkeys->selectionModel(), &QItemSelectionModel::selectionChanged, this,
|
||||
&ServerConfigDialog::listHotkeysSelectionChanged
|
||||
);
|
||||
|
||||
connect(ui->btnNewAction, &QPushButton::clicked, this, &ServerConfigDialog::addAction);
|
||||
connect(ui->btnEditAction, &QPushButton::clicked, this, &ServerConfigDialog::editAction);
|
||||
connect(ui->btnRemoveAction, &QPushButton::clicked, this, &ServerConfigDialog::removeAction);
|
||||
connect(ui->listActions, &QListView::doubleClicked, this, &ServerConfigDialog::editAction);
|
||||
connect(
|
||||
ui->listActions->selectionModel(), &QItemSelectionModel::selectionChanged, this,
|
||||
&ServerConfigDialog::listActionsSelectionChanged
|
||||
);
|
||||
|
||||
// force the first tab, since qt creator sets the active tab as the last one
|
||||
// the developer was looking at, and it's easy to accidentally save that.
|
||||
ui->m_pTabWidget->setCurrentIndex(0);
|
||||
ui->tabWidget->setCurrentIndex(0);
|
||||
|
||||
ui->m_pEditConfigFile->setText(serverConfig().configFile());
|
||||
ui->m_pCheckBoxUseExternalConfig->setChecked(serverConfig().useExternalConfig());
|
||||
ui->m_pCheckBoxHeartbeat->setChecked(serverConfig().hasHeartbeat());
|
||||
ui->m_pRadioProtocolSynergy->setChecked(serverConfig().protocol() == ServerProtocol::kSynergy);
|
||||
ui->m_pRadioProtocolBarrier->setChecked(serverConfig().protocol() == ServerProtocol::kBarrier);
|
||||
ui->m_pSpinBoxHeartbeat->setValue(serverConfig().heartbeat());
|
||||
ui->btnBrowseConfigFile->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::DocumentOpen));
|
||||
ui->lineConfigFile->setText(serverConfig().configFile());
|
||||
|
||||
ui->m_pCheckBoxRelativeMouseMoves->setChecked(serverConfig().relativeMouseMoves());
|
||||
ui->m_pCheckBoxWin32KeepForeground->setChecked(serverConfig().win32KeepForeground());
|
||||
ui->groupExternalConfig->setChecked(serverConfig().useExternalConfig());
|
||||
|
||||
ui->m_pCheckBoxSwitchDelay->setChecked(serverConfig().hasSwitchDelay());
|
||||
ui->m_pSpinBoxSwitchDelay->setValue(serverConfig().switchDelay());
|
||||
ui->rbProtocolSynergy->setChecked(serverConfig().protocol() == ServerProtocol::kSynergy);
|
||||
ui->rbProtocolBarrier->setChecked(serverConfig().protocol() == ServerProtocol::kBarrier);
|
||||
connect(ui->rbProtocolBarrier, &QRadioButton::toggled, this, &ServerConfigDialog::toggleProtocol);
|
||||
|
||||
ui->m_pCheckBoxSwitchDoubleTap->setChecked(serverConfig().hasSwitchDoubleTap());
|
||||
ui->m_pSpinBoxSwitchDoubleTap->setValue(serverConfig().switchDoubleTap());
|
||||
ui->cbHeartbeat->setChecked(serverConfig().hasHeartbeat());
|
||||
connect(ui->cbHeartbeat, &QCheckBox::toggled, this, &ServerConfigDialog::toggleHeartbeat);
|
||||
|
||||
ui->m_pCheckBoxCornerTopLeft->setChecked(serverConfig().switchCorner(static_cast<int>(TopLeft)));
|
||||
ui->m_pCheckBoxCornerTopRight->setChecked(serverConfig().switchCorner(static_cast<int>(TopRight)));
|
||||
ui->m_pCheckBoxCornerBottomLeft->setChecked(serverConfig().switchCorner(static_cast<int>(BottomLeft)));
|
||||
ui->m_pCheckBoxCornerBottomRight->setChecked(serverConfig().switchCorner(static_cast<int>(BottomRight)));
|
||||
ui->m_pSpinBoxSwitchCornerSize->setValue(serverConfig().switchCornerSize());
|
||||
ui->m_pCheckBoxDisableLockToScreen->setChecked(serverConfig().disableLockToScreen());
|
||||
ui->sbHeartbeat->setValue(serverConfig().heartbeat());
|
||||
connect(ui->sbHeartbeat, QOverload<int>::of(&QSpinBox::valueChanged), this, &ServerConfigDialog::setHeartbeat);
|
||||
|
||||
ui->m_pCheckBoxEnableClipboard->setChecked(serverConfig().clipboardSharing());
|
||||
ui->cbRelativeMouseMoves->setChecked(serverConfig().relativeMouseMoves());
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
ui->cbWin32KeepForeground->setVisible(false);
|
||||
#endif
|
||||
ui->cbWin32KeepForeground->setChecked(serverConfig().win32KeepForeground());
|
||||
connect(ui->cbWin32KeepForeground, &QCheckBox::toggled, this, &ServerConfigDialog::toggleWin32Foreground);
|
||||
|
||||
ui->cbSwitchDelay->setChecked(serverConfig().hasSwitchDelay());
|
||||
connect(ui->cbSwitchDelay, &QCheckBox::toggled, this, &ServerConfigDialog::toggleSwitchDelay);
|
||||
|
||||
ui->sbSwitchDelay->setValue(serverConfig().switchDelay());
|
||||
connect(ui->sbSwitchDelay, QOverload<int>::of(&QSpinBox::valueChanged), this, &ServerConfigDialog::setSwitchDelay);
|
||||
|
||||
ui->cbSwitchDoubleTap->setChecked(serverConfig().hasSwitchDoubleTap());
|
||||
connect(ui->cbSwitchDoubleTap, &QCheckBox::toggled, this, &ServerConfigDialog::toggleSwitchDoubleTap);
|
||||
|
||||
ui->sbSwitchDoubleTap->setValue(serverConfig().switchDoubleTap());
|
||||
connect(
|
||||
ui->sbSwitchDoubleTap, QOverload<int>::of(&QSpinBox::valueChanged), this, &ServerConfigDialog::setSwitchDoubleTap
|
||||
);
|
||||
|
||||
connect(ui->cbRelativeMouseMoves, &QCheckBox::toggled, this, &ServerConfigDialog::toggleRelativeMouseMoves);
|
||||
connect(ui->cbEnableClipboard, &QCheckBox::toggled, this, &ServerConfigDialog::toggleClipboard);
|
||||
|
||||
connect(ui->groupExternalConfig, &QGroupBox::toggled, this, &ServerConfigDialog::toggleExternalConfig);
|
||||
connect(ui->btnBrowseConfigFile, &QPushButton::clicked, this, &ServerConfigDialog::browseConfigFile);
|
||||
|
||||
connect(
|
||||
ui->sbSwitchCornerSize, QOverload<int>::of(&QSpinBox::valueChanged), this,
|
||||
&ServerConfigDialog::setSwitchCornerSize
|
||||
);
|
||||
connect(
|
||||
ui->sbClipboardSizeLimit, QOverload<int>::of(&QSpinBox::valueChanged), this,
|
||||
&ServerConfigDialog::setClipboardLimit
|
||||
);
|
||||
|
||||
ui->cbCornerTopLeft->setChecked(serverConfig().switchCorner(static_cast<int>(TopLeft)));
|
||||
connect(ui->cbCornerTopLeft, &QCheckBox::toggled, this, &ServerConfigDialog::toggleCornerTopLeft);
|
||||
|
||||
ui->cbCornerTopRight->setChecked(serverConfig().switchCorner(static_cast<int>(TopRight)));
|
||||
connect(ui->cbCornerTopRight, &QCheckBox::toggled, this, &ServerConfigDialog::toggleCornerTopRight);
|
||||
|
||||
ui->cbCornerBottomLeft->setChecked(serverConfig().switchCorner(static_cast<int>(BottomLeft)));
|
||||
connect(ui->cbCornerBottomLeft, &QCheckBox::toggled, this, &ServerConfigDialog::toggleCornerBottomLeft);
|
||||
|
||||
ui->cbCornerBottomRight->setChecked(serverConfig().switchCorner(static_cast<int>(BottomRight)));
|
||||
connect(ui->cbCornerBottomRight, &QCheckBox::toggled, this, &ServerConfigDialog::toggleCornerBottomRight);
|
||||
|
||||
ui->sbSwitchCornerSize->setValue(serverConfig().switchCornerSize());
|
||||
|
||||
ui->cbDisableLockToScreen->setChecked(serverConfig().disableLockToScreen());
|
||||
connect(ui->cbDisableLockToScreen, &QCheckBox::toggled, this, &ServerConfigDialog::toggleLockToScreen);
|
||||
|
||||
ui->cbEnableClipboard->setChecked(serverConfig().clipboardSharing());
|
||||
int clipboardSharingSizeM = static_cast<int>(serverConfig().clipboardSharingSize() / 1024);
|
||||
ui->m_pSpinBoxClipboardSizeLimit->setValue(clipboardSharingSizeM);
|
||||
ui->m_pSpinBoxClipboardSizeLimit->setEnabled(serverConfig().clipboardSharing());
|
||||
ui->sbClipboardSizeLimit->setValue(clipboardSharingSizeM);
|
||||
ui->sbClipboardSizeLimit->setEnabled(serverConfig().clipboardSharing());
|
||||
|
||||
for (const Hotkey &hotkey : std::as_const(serverConfig().hotkeys()))
|
||||
ui->m_pListHotkeys->addItem(hotkey.text());
|
||||
ui->listHotkeys->addItem(hotkey.text());
|
||||
|
||||
ui->m_pScreenSetupView->setModel(&m_ScreenSetupModel);
|
||||
ui->screenSetupView->setModel(&m_ScreenSetupModel);
|
||||
|
||||
auto &screens = serverConfig().screens();
|
||||
auto server = std::find_if(screens.begin(), screens.end(), [this](const Screen &screen) {
|
||||
@ -99,170 +158,10 @@ ServerConfigDialog::ServerConfigDialog(QWidget *parent, ServerConfig &config, Ap
|
||||
server->markAsServer();
|
||||
}
|
||||
|
||||
ui->m_pButtonAddComputer->setEnabled(!model().isFull());
|
||||
connect(ui->m_pTrashScreenWidget, &TrashScreenWidget::screenRemoved, this, &ServerConfigDialog::onScreenRemoved);
|
||||
|
||||
onChange();
|
||||
|
||||
// computers
|
||||
connect(&m_ScreenSetupModel, &ScreenSetupModel::screensChanged, this, &ServerConfigDialog::onChange);
|
||||
|
||||
// Above Qt 6.7 the checkbox signal signature has changed from int to Qt::CheckState
|
||||
#if QT_VERSION <= QT_VERSION_CHECK(6, 7, 0)
|
||||
// advanced
|
||||
connect(ui->m_pCheckBoxSwitchDelay, &QCheckBox::stateChanged, this, [this](const int &v) {
|
||||
serverConfig().haveSwitchDelay(v);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxSwitchDoubleTap, &QCheckBox::stateChanged, this, [this](const int &v) {
|
||||
serverConfig().haveSwitchDoubleTap(v);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxEnableClipboard, &QCheckBox::stateChanged, this, [this](const int &v) {
|
||||
serverConfig().setClipboardSharing(v);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxHeartbeat, &QCheckBox::stateChanged, this, [this](const int &v) {
|
||||
serverConfig().haveHeartbeat(v);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxRelativeMouseMoves, &QCheckBox::stateChanged, this, [this](const int &v) {
|
||||
serverConfig().setRelativeMouseMoves(v);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxWin32KeepForeground, &QCheckBox::stateChanged, this, [this](const int &v) {
|
||||
serverConfig().setWin32KeepForeground(v);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxDisableLockToScreen, &QCheckBox::stateChanged, this, [this](const int &v) {
|
||||
serverConfig().setDisableLockToScreen(v);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxCornerTopLeft, &QCheckBox::stateChanged, this, [this](const int &v) {
|
||||
serverConfig().setSwitchCorner(static_cast<int>(TopLeft), v);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxCornerTopRight, &QCheckBox::stateChanged, this, [this](const int &v) {
|
||||
serverConfig().setSwitchCorner(static_cast<int>(TopRight), v);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxCornerBottomLeft, &QCheckBox::stateChanged, this, [this](const int &v) {
|
||||
serverConfig().setSwitchCorner(static_cast<int>(BottomLeft), v);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxCornerBottomRight, &QCheckBox::stateChanged, this, [this](const int &v) {
|
||||
serverConfig().setSwitchCorner(static_cast<int>(BottomRight), v);
|
||||
onChange();
|
||||
});
|
||||
// config
|
||||
connect(ui->m_pCheckBoxUseExternalConfig, &QCheckBox::stateChanged, this, [this](const int &v) {
|
||||
serverConfig().setUseExternalConfig(v);
|
||||
onChange();
|
||||
});
|
||||
#else
|
||||
connect(ui->m_pCheckBoxSwitchDelay, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
|
||||
serverConfig().haveSwitchDelay(v == Qt::Checked);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxSwitchDoubleTap, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
|
||||
serverConfig().haveSwitchDoubleTap(v == Qt::Checked);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxEnableClipboard, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
|
||||
serverConfig().setClipboardSharing(v == Qt::Checked);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxHeartbeat, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
|
||||
serverConfig().haveHeartbeat(v == Qt::Checked);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxRelativeMouseMoves, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
|
||||
serverConfig().setRelativeMouseMoves(v == Qt::Checked);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxWin32KeepForeground, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
|
||||
serverConfig().setWin32KeepForeground(v == Qt::Checked);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxDisableLockToScreen, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
|
||||
serverConfig().setDisableLockToScreen(v == Qt::Checked);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxCornerTopLeft, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
|
||||
serverConfig().setSwitchCorner(static_cast<int>(TopLeft), v == Qt::Checked);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxCornerTopRight, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
|
||||
serverConfig().setSwitchCorner(static_cast<int>(TopRight), v == Qt::Checked);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxCornerBottomLeft, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
|
||||
serverConfig().setSwitchCorner(static_cast<int>(BottomLeft), v == Qt::Checked);
|
||||
onChange();
|
||||
});
|
||||
connect(ui->m_pCheckBoxCornerBottomRight, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
|
||||
serverConfig().setSwitchCorner(static_cast<int>(BottomRight), v == Qt::Checked);
|
||||
onChange();
|
||||
});
|
||||
// config
|
||||
connect(ui->m_pCheckBoxUseExternalConfig, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
|
||||
serverConfig().setUseExternalConfig(v == Qt::Checked);
|
||||
onChange();
|
||||
});
|
||||
#endif
|
||||
|
||||
connect(
|
||||
ui->m_pSpinBoxSwitchDelay, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
|
||||
[this](const int &v) {
|
||||
serverConfig().setSwitchDelay(v);
|
||||
onChange();
|
||||
}
|
||||
);
|
||||
connect(
|
||||
ui->m_pSpinBoxSwitchDoubleTap, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
|
||||
[this](const int &v) {
|
||||
serverConfig().setSwitchDoubleTap(v);
|
||||
onChange();
|
||||
}
|
||||
);
|
||||
connect(
|
||||
ui->m_pSpinBoxClipboardSizeLimit, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
|
||||
[this](const int &v) {
|
||||
serverConfig().setClipboardSharingSize(v * 1024);
|
||||
onChange();
|
||||
}
|
||||
);
|
||||
connect(
|
||||
ui->m_pSpinBoxHeartbeat, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
|
||||
[this](const int &v) {
|
||||
serverConfig().setHeartbeat(v);
|
||||
onChange();
|
||||
}
|
||||
);
|
||||
connect(
|
||||
ui->m_pSpinBoxSwitchCornerSize, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
|
||||
[this](const int &v) {
|
||||
serverConfig().setSwitchCornerSize(v);
|
||||
onChange();
|
||||
}
|
||||
);
|
||||
connect(ui->m_pRadioProtocolSynergy, &QRadioButton::toggled, this, [this](const bool &v) {
|
||||
if (v) {
|
||||
serverConfig().setProtocol(ServerProtocol::kSynergy);
|
||||
onChange();
|
||||
}
|
||||
});
|
||||
connect(ui->m_pRadioProtocolBarrier, &QRadioButton::toggled, this, [this](const bool &v) {
|
||||
if (v) {
|
||||
serverConfig().setProtocol(ServerProtocol::kBarrier);
|
||||
onChange();
|
||||
}
|
||||
});
|
||||
|
||||
connect(ui->m_pEditConfigFile, &QLineEdit::textChanged, this, [this]() {
|
||||
serverConfig().setConfigFile(ui->m_pEditConfigFile->text());
|
||||
onChange();
|
||||
});
|
||||
}
|
||||
|
||||
ServerConfigDialog::~ServerConfigDialog() = default;
|
||||
@ -274,13 +173,13 @@ bool ServerConfigDialog::addClient(const QString &clientName)
|
||||
|
||||
void ServerConfigDialog::accept()
|
||||
{
|
||||
if (ui->m_pCheckBoxUseExternalConfig->isChecked() && !QFile::exists(ui->m_pEditConfigFile->text())) {
|
||||
if (ui->groupExternalConfig->isChecked() && !QFile::exists(ui->lineConfigFile->text())) {
|
||||
|
||||
auto selectedButton = QMessageBox::warning(
|
||||
this, "Filename invalid", "Please select a valid configuration file.", QMessageBox::Ok | QMessageBox::Ignore
|
||||
);
|
||||
|
||||
if (selectedButton != QMessageBox::Ok || !on_m_pButtonBrowseConfigFile_clicked()) {
|
||||
if (selectedButton != QMessageBox::Ok || !browseConfigFile()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -300,152 +199,267 @@ void ServerConfigDialog::reject()
|
||||
QDialog::reject();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonNewHotkey_clicked()
|
||||
void ServerConfigDialog::addHotkey()
|
||||
{
|
||||
Hotkey hotkey;
|
||||
HotkeyDialog dlg(this, hotkey);
|
||||
if (dlg.exec() == QDialog::Accepted) {
|
||||
serverConfig().hotkeys().append(hotkey);
|
||||
ui->m_pListHotkeys->addItem(hotkey.text());
|
||||
ui->listHotkeys->addItem(hotkey.text());
|
||||
onChange();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonEditHotkey_clicked()
|
||||
void ServerConfigDialog::editHotkey()
|
||||
{
|
||||
int idx = ui->m_pListHotkeys->currentRow();
|
||||
Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
|
||||
Hotkey &hotkey = serverConfig().hotkeys()[idx];
|
||||
int row = ui->listHotkeys->currentRow();
|
||||
if (row < 0 || row >= serverConfig().hotkeys().size()) {
|
||||
qDebug() << "Attempt to editing out of bounds hotkey row: " << row;
|
||||
return;
|
||||
}
|
||||
|
||||
Hotkey &hotkey = serverConfig().hotkeys()[row];
|
||||
HotkeyDialog dlg(this, hotkey);
|
||||
if (dlg.exec() == QDialog::Accepted) {
|
||||
ui->m_pListHotkeys->currentItem()->setText(hotkey.text());
|
||||
ui->listHotkeys->currentItem()->setText(hotkey.text());
|
||||
onChange();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonRemoveHotkey_clicked()
|
||||
void ServerConfigDialog::removeHotkey()
|
||||
{
|
||||
int idx = ui->m_pListHotkeys->currentRow();
|
||||
Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
|
||||
serverConfig().hotkeys().removeAt(idx);
|
||||
ui->m_pListActions->clear();
|
||||
delete ui->m_pListHotkeys->item(idx);
|
||||
int row = ui->listHotkeys->currentRow();
|
||||
if (row < 0 || row >= serverConfig().hotkeys().size()) {
|
||||
qDebug() << "Attempt to remove out of bounds hotkey row: " << row;
|
||||
return;
|
||||
}
|
||||
|
||||
serverConfig().hotkeys().removeAt(row);
|
||||
ui->listActions->clear();
|
||||
delete ui->listHotkeys->item(row);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pListHotkeys_itemSelectionChanged()
|
||||
void ServerConfigDialog::listHotkeysSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
|
||||
{
|
||||
bool itemsSelected = !ui->m_pListHotkeys->selectedItems().isEmpty();
|
||||
ui->m_pButtonEditHotkey->setEnabled(itemsSelected);
|
||||
ui->m_pButtonRemoveHotkey->setEnabled(itemsSelected);
|
||||
ui->m_pButtonNewAction->setEnabled(itemsSelected);
|
||||
bool itemsSelected = !selected.isEmpty();
|
||||
ui->btnEditHotkey->setEnabled(itemsSelected);
|
||||
ui->btnRemoveHotkey->setEnabled(itemsSelected);
|
||||
ui->btnNewAction->setEnabled(itemsSelected);
|
||||
|
||||
if (itemsSelected && serverConfig().hotkeys().size() > 0) {
|
||||
ui->m_pListActions->clear();
|
||||
|
||||
int idx = ui->m_pListHotkeys->row(ui->m_pListHotkeys->selectedItems()[0]);
|
||||
|
||||
// There's a bug somewhere around here: We get idx == 1 right after we
|
||||
// deleted the next to last item, so idx can only possibly be 0. GDB shows
|
||||
// we got called indirectly from the delete line in
|
||||
// on_m_pButtonRemoveHotkey_clicked() above, but the delete is of course
|
||||
// necessary and seems correct. The while() is a generalized workaround for
|
||||
// all that and shouldn't be required.
|
||||
while (idx >= 0 && idx >= serverConfig().hotkeys().size())
|
||||
idx--;
|
||||
|
||||
Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
|
||||
|
||||
const Hotkey &hotkey = serverConfig().hotkeys()[idx];
|
||||
if (itemsSelected && !serverConfig().hotkeys().isEmpty()) {
|
||||
ui->listActions->clear();
|
||||
const Hotkey &hotkey = serverConfig().hotkeys().at(selected.indexes().first().row());
|
||||
for (const Action &action : hotkey.actions())
|
||||
ui->m_pListActions->addItem(action.text());
|
||||
ui->listActions->addItem(action.text());
|
||||
}
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonNewAction_clicked()
|
||||
void ServerConfigDialog::addAction()
|
||||
{
|
||||
int idx = ui->m_pListHotkeys->currentRow();
|
||||
Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
|
||||
Hotkey &hotkey = serverConfig().hotkeys()[idx];
|
||||
int row = ui->listHotkeys->currentRow();
|
||||
if (row < 0 || row >= serverConfig().hotkeys().size()) {
|
||||
qDebug() << "Attempt to add action to out of bounds hotkey row: " << row;
|
||||
return;
|
||||
}
|
||||
|
||||
Hotkey &hotkey = serverConfig().hotkeys()[row];
|
||||
Action action;
|
||||
ActionDialog dlg(this, serverConfig(), hotkey, action);
|
||||
if (dlg.exec() == QDialog::Accepted) {
|
||||
hotkey.actions().append(action);
|
||||
ui->m_pListActions->addItem(action.text());
|
||||
ui->listActions->addItem(action.text());
|
||||
onChange();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonEditAction_clicked()
|
||||
void ServerConfigDialog::editAction()
|
||||
{
|
||||
int idxHotkey = ui->m_pListHotkeys->currentRow();
|
||||
Q_ASSERT(idxHotkey >= 0 && idxHotkey < serverConfig().hotkeys().size());
|
||||
Hotkey &hotkey = serverConfig().hotkeys()[idxHotkey];
|
||||
int hotkeyRow = ui->listHotkeys->currentRow();
|
||||
if (hotkeyRow < 0 || hotkeyRow >= serverConfig().hotkeys().size()) {
|
||||
qDebug() << "Attempt to edit action from out of bounds hotkey row: " << hotkeyRow;
|
||||
return;
|
||||
}
|
||||
Hotkey &hotkey = serverConfig().hotkeys()[hotkeyRow];
|
||||
|
||||
int idxAction = ui->m_pListActions->currentRow();
|
||||
Q_ASSERT(idxAction >= 0 && idxAction < hotkey.actions().size());
|
||||
Action &action = hotkey.actions()[idxAction];
|
||||
int actionRow = ui->listActions->currentRow();
|
||||
if (actionRow < 0 || actionRow >= hotkey.actions().size()) {
|
||||
qDebug() << "Attempt to remove out of bounds action row: " << actionRow;
|
||||
return;
|
||||
}
|
||||
Action &action = hotkey.actions()[actionRow];
|
||||
|
||||
ActionDialog dlg(this, serverConfig(), hotkey, action);
|
||||
if (dlg.exec() == QDialog::Accepted) {
|
||||
ui->m_pListActions->currentItem()->setText(action.text());
|
||||
ui->listActions->currentItem()->setText(action.text());
|
||||
onChange();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonRemoveAction_clicked()
|
||||
void ServerConfigDialog::removeAction()
|
||||
{
|
||||
int idxHotkey = ui->m_pListHotkeys->currentRow();
|
||||
Q_ASSERT(idxHotkey >= 0 && idxHotkey < serverConfig().hotkeys().size());
|
||||
Hotkey &hotkey = serverConfig().hotkeys()[idxHotkey];
|
||||
int hotkeyRow = ui->listHotkeys->currentRow();
|
||||
if (hotkeyRow < 0 || hotkeyRow >= serverConfig().hotkeys().size()) {
|
||||
qDebug() << "Attempt to remove action from out of bounds hotkey row: " << hotkeyRow;
|
||||
return;
|
||||
}
|
||||
Hotkey &hotkey = serverConfig().hotkeys()[hotkeyRow];
|
||||
|
||||
int idxAction = ui->m_pListActions->currentRow();
|
||||
Q_ASSERT(idxAction >= 0 && idxAction < hotkey.actions().size());
|
||||
int actionRow = ui->listActions->currentRow();
|
||||
if (actionRow < 0 || actionRow >= hotkey.actions().size()) {
|
||||
qDebug() << "Attempt to remove out of bounds action row: " << actionRow;
|
||||
return;
|
||||
}
|
||||
|
||||
hotkey.actions().removeAt(idxAction);
|
||||
delete ui->m_pListActions->currentItem();
|
||||
hotkey.actions().removeAt(actionRow);
|
||||
delete ui->listActions->currentItem();
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pCheckBoxEnableClipboard_stateChanged(int const state)
|
||||
void ServerConfigDialog::toggleClipboard(bool enabled)
|
||||
{
|
||||
ui->m_pSpinBoxClipboardSizeLimit->setEnabled(state == Qt::Checked);
|
||||
if ((state == Qt::Checked) && (!ui->m_pSpinBoxClipboardSizeLimit->value())) {
|
||||
ui->sbClipboardSizeLimit->setEnabled(enabled);
|
||||
if (enabled && !ui->sbClipboardSizeLimit->value()) {
|
||||
int size = static_cast<int>((serverConfig().defaultClipboardSharingSize() + 512) / 1024);
|
||||
ui->m_pSpinBoxClipboardSizeLimit->setValue(size ? size : 1);
|
||||
ui->sbClipboardSizeLimit->setValue(size ? size : 1);
|
||||
}
|
||||
serverConfig().setClipboardSharing(enabled);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pListActions_itemSelectionChanged()
|
||||
void ServerConfigDialog::setClipboardLimit(int limit)
|
||||
{
|
||||
ui->m_pButtonEditAction->setEnabled(!ui->m_pListActions->selectedItems().isEmpty());
|
||||
ui->m_pButtonRemoveAction->setEnabled(!ui->m_pListActions->selectedItems().isEmpty());
|
||||
serverConfig().setClipboardSharingSize(limit * 1024);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonAddComputer_clicked()
|
||||
void ServerConfigDialog::toggleHeartbeat(bool enabled)
|
||||
{
|
||||
ui->sbHeartbeat->setEnabled(enabled);
|
||||
serverConfig().haveHeartbeat(enabled);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::setHeartbeat(int rate)
|
||||
{
|
||||
serverConfig().setHeartbeat(rate);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::toggleRelativeMouseMoves(bool enabled)
|
||||
{
|
||||
serverConfig().setRelativeMouseMoves(enabled);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::toggleProtocol()
|
||||
{
|
||||
ServerProtocol proto = ui->rbProtocolBarrier->isChecked() ? ServerProtocol::kBarrier : ServerProtocol::kSynergy;
|
||||
serverConfig().setProtocol(proto);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::setSwitchCornerSize(int size)
|
||||
{
|
||||
serverConfig().setSwitchCornerSize(size);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::toggleCornerBottomLeft(bool enable)
|
||||
{
|
||||
serverConfig().setSwitchCorner(static_cast<int>(BottomLeft), enable);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::toggleCornerTopLeft(bool enable)
|
||||
{
|
||||
serverConfig().setSwitchCorner(static_cast<int>(TopLeft), enable);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::toggleCornerBottomRight(bool enable)
|
||||
{
|
||||
serverConfig().setSwitchCorner(static_cast<int>(BottomRight), enable);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::toggleCornerTopRight(bool enable)
|
||||
{
|
||||
serverConfig().setSwitchCorner(static_cast<int>(TopRight), enable);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::listActionsSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
|
||||
{
|
||||
bool enabled = !selected.isEmpty();
|
||||
ui->btnEditAction->setEnabled(enabled);
|
||||
ui->btnRemoveAction->setEnabled(enabled);
|
||||
}
|
||||
|
||||
void ServerConfigDialog::toggleSwitchDoubleTap(bool enable)
|
||||
{
|
||||
ui->sbSwitchDoubleTap->setEnabled(enable);
|
||||
serverConfig().haveSwitchDoubleTap(enable);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::setSwitchDoubleTap(int within)
|
||||
{
|
||||
serverConfig().setSwitchDoubleTap(within);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::toggleSwitchDelay(bool enable)
|
||||
{
|
||||
ui->sbSwitchDelay->setEnabled(enable);
|
||||
serverConfig().haveSwitchDelay(enable);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::setSwitchDelay(int delay)
|
||||
{
|
||||
serverConfig().setSwitchDelay(delay);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::toggleLockToScreen(bool disabled)
|
||||
{
|
||||
serverConfig().setDisableLockToScreen(disabled);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::toggleWin32Foreground(bool enabled)
|
||||
{
|
||||
serverConfig().setWin32KeepForeground(enabled);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::addClient()
|
||||
{
|
||||
addComputer("", false);
|
||||
}
|
||||
|
||||
void ServerConfigDialog::onScreenRemoved()
|
||||
{
|
||||
ui->m_pButtonAddComputer->setEnabled(true);
|
||||
ui->lblNewScreen->setEnabled(true);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pCheckBoxUseExternalConfig_toggled(bool checked)
|
||||
void ServerConfigDialog::toggleExternalConfig(bool checked)
|
||||
{
|
||||
ui->m_pLabelConfigFile->setEnabled(checked);
|
||||
ui->m_pEditConfigFile->setEnabled(checked);
|
||||
ui->m_pButtonBrowseConfigFile->setEnabled(checked);
|
||||
ui->labelConfigFile->setEnabled(checked);
|
||||
ui->lineConfigFile->setEnabled(checked);
|
||||
ui->btnBrowseConfigFile->setEnabled(checked);
|
||||
|
||||
ui->m_pTabWidget->setTabEnabled(0, !checked);
|
||||
ui->m_pTabWidget->setTabEnabled(1, !checked);
|
||||
ui->m_pTabWidget->setTabEnabled(2, !checked);
|
||||
ui->tabWidget->setTabEnabled(0, !checked);
|
||||
ui->tabWidget->setTabEnabled(1, !checked);
|
||||
ui->tabWidget->setTabEnabled(2, !checked);
|
||||
|
||||
serverConfig().setUseExternalConfig(checked);
|
||||
onChange();
|
||||
}
|
||||
|
||||
bool ServerConfigDialog::on_m_pButtonBrowseConfigFile_clicked()
|
||||
bool ServerConfigDialog::browseConfigFile()
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
static const auto configExt = QStringLiteral("sgc");
|
||||
@ -458,7 +472,9 @@ bool ServerConfigDialog::on_m_pButtonBrowseConfigFile_clicked()
|
||||
QFileDialog::getOpenFileName(this, "Browse for a config file", "", deskflowConfigFilter.arg(kAppName, configExt));
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->m_pEditConfigFile->setText(fileName);
|
||||
ui->lineConfigFile->setText(fileName);
|
||||
serverConfig().setConfigFile(ui->lineConfigFile->text());
|
||||
onChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -476,7 +492,7 @@ bool ServerConfigDialog::addComputer(const QString &clientName, bool doSilent)
|
||||
isAccepted = true;
|
||||
}
|
||||
|
||||
ui->m_pButtonAddComputer->setEnabled(!model().isFull());
|
||||
ui->lblNewScreen->setEnabled(!model().isFull());
|
||||
return isAccepted;
|
||||
}
|
||||
|
||||
@ -484,6 +500,6 @@ void ServerConfigDialog::onChange()
|
||||
{
|
||||
bool isAppConfigDataEqual = m_OriginalServerConfigIsExternal == serverConfig().useExternalConfig() &&
|
||||
m_OriginalServerConfigUsesExternalFile == serverConfig().configFile();
|
||||
ui->m_pButtonBox->button(QDialogButtonBox::Ok)
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)
|
||||
->setEnabled(!isAppConfigDataEqual || !(m_OriginalServerConfig == m_ServerConfig));
|
||||
}
|
||||
|
||||
@ -1,19 +1,9 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012-2016 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@ -24,6 +14,8 @@
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class QItemSelection;
|
||||
|
||||
namespace Ui {
|
||||
class ServerConfigDialog;
|
||||
}
|
||||
@ -46,23 +38,49 @@ public slots:
|
||||
}
|
||||
|
||||
protected slots:
|
||||
void on_m_pButtonNewHotkey_clicked();
|
||||
void on_m_pListHotkeys_itemSelectionChanged();
|
||||
void on_m_pButtonEditHotkey_clicked();
|
||||
void on_m_pButtonRemoveHotkey_clicked();
|
||||
|
||||
void on_m_pButtonNewAction_clicked();
|
||||
void on_m_pListActions_itemSelectionChanged();
|
||||
void on_m_pButtonEditAction_clicked();
|
||||
void on_m_pButtonRemoveAction_clicked();
|
||||
void on_m_pCheckBoxEnableClipboard_stateChanged(int state);
|
||||
void on_m_pButtonAddComputer_clicked();
|
||||
void onScreenRemoved();
|
||||
void on_m_pCheckBoxUseExternalConfig_toggled(bool checked = false);
|
||||
bool on_m_pButtonBrowseConfigFile_clicked();
|
||||
|
||||
protected:
|
||||
void addClient();
|
||||
bool addComputer(const QString &clientName, bool doSilent);
|
||||
|
||||
void addHotkey();
|
||||
void editHotkey();
|
||||
void removeHotkey();
|
||||
void listHotkeysSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
||||
|
||||
void addAction();
|
||||
void editAction();
|
||||
void removeAction();
|
||||
void listActionsSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
||||
|
||||
void toggleSwitchDoubleTap(bool enable);
|
||||
void setSwitchDoubleTap(int within);
|
||||
|
||||
void toggleSwitchDelay(bool enable);
|
||||
void setSwitchDelay(int delay);
|
||||
|
||||
void toggleLockToScreen(bool disabled);
|
||||
void toggleWin32Foreground(bool enabled);
|
||||
|
||||
void toggleClipboard(bool enabled);
|
||||
void setClipboardLimit(int limit);
|
||||
|
||||
void toggleHeartbeat(bool enabled);
|
||||
void setHeartbeat(int rate);
|
||||
|
||||
void toggleRelativeMouseMoves(bool enabled);
|
||||
void toggleProtocol();
|
||||
|
||||
void setSwitchCornerSize(int size);
|
||||
void toggleCornerBottomLeft(bool enable);
|
||||
void toggleCornerTopLeft(bool enable);
|
||||
void toggleCornerBottomRight(bool enable);
|
||||
void toggleCornerTopRight(bool enable);
|
||||
|
||||
void toggleExternalConfig(bool enable = false);
|
||||
bool browseConfigFile();
|
||||
|
||||
ServerConfig &serverConfig()
|
||||
{
|
||||
return m_ServerConfig;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,19 +1,9 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "SettingsDialog.h"
|
||||
@ -23,12 +13,6 @@
|
||||
#include "gui/messages.h"
|
||||
#include "gui/tls/TlsCertificate.h"
|
||||
#include "gui/tls/TlsUtility.h"
|
||||
#include "gui/validators/ScreenNameValidator.h"
|
||||
#include "gui/validators/ValidationError.h"
|
||||
|
||||
#ifdef DESKFLOW_GUI_HOOK_HEADER
|
||||
#include DESKFLOW_GUI_HOOK_HEADER
|
||||
#endif
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
@ -49,95 +33,63 @@ SettingsDialog::SettingsDialog(
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
const auto folderIcon =
|
||||
QIcon::fromTheme(QIcon::ThemeIcon::DocumentOpen, QIcon(QStringLiteral(":/icons/64x64/folder.png")));
|
||||
ui->m_pPushButtonTlsCertPath->setIcon(folderIcon);
|
||||
ui->m_pButtonBrowseLog->setIcon(folderIcon);
|
||||
ui->comboTlsKeyLength->setItemIcon(0, QIcon::fromTheme(QIcon::ThemeIcon::SecurityLow));
|
||||
ui->comboTlsKeyLength->setItemIcon(1, QIcon::fromTheme(QStringLiteral("security-medium")));
|
||||
ui->comboTlsKeyLength->setItemIcon(2, QIcon::fromTheme(QIcon::ThemeIcon::SecurityHigh));
|
||||
|
||||
ui->rbIconMono->setIcon(QIcon::fromTheme(QStringLiteral("deskflow-symbolic")));
|
||||
ui->rbIconColorful->setIcon(QIcon::fromTheme(QStringLiteral("deskflow")));
|
||||
|
||||
// force the first tab, since qt creator sets the active tab as the last one
|
||||
// the developer was looking at, and it's easy to accidentally save that.
|
||||
ui->m_pTabWidget->setCurrentIndex(0);
|
||||
ui->tabWidget->setCurrentIndex(0);
|
||||
|
||||
loadFromConfig();
|
||||
m_wasOriginallySystemScope = m_appConfig.isActiveScopeSystem();
|
||||
updateControls();
|
||||
|
||||
m_pScreenNameError = new validators::ValidationError(this);
|
||||
ui->m_pLineEditScreenName->setValidator(
|
||||
new validators::ScreenNameValidator(ui->m_pLineEditScreenName, m_pScreenNameError, &serverConfig.screens())
|
||||
);
|
||||
|
||||
connect(ui->m_pCheckBoxEnableTls, &QCheckBox::toggled, this, &SettingsDialog::updateTlsControlsEnabled);
|
||||
|
||||
connect(
|
||||
this, &SettingsDialog::shown, this,
|
||||
[this] {
|
||||
if (!m_appConfig.isActiveScopeWritable()) {
|
||||
showReadOnlyMessage();
|
||||
}
|
||||
},
|
||||
Qt::QueuedConnection
|
||||
);
|
||||
|
||||
#ifdef DESKFLOW_GUI_HOOK_SETTINGS
|
||||
DESKFLOW_GUI_HOOK_SETTINGS
|
||||
#endif
|
||||
adjustSize();
|
||||
QApplication::processEvents();
|
||||
setFixedHeight(height());
|
||||
setWindowFlags((windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowMinMaxButtonsHint);
|
||||
|
||||
initConnections();
|
||||
}
|
||||
|
||||
//
|
||||
// Auto-connect slots
|
||||
//
|
||||
|
||||
void SettingsDialog::on_m_pCheckBoxLogToFile_stateChanged(int i)
|
||||
void SettingsDialog::initConnections()
|
||||
{
|
||||
bool checked = i == 2;
|
||||
connect(this, &SettingsDialog::shown, this, &SettingsDialog::showReadOnlyMessage, Qt::QueuedConnection);
|
||||
|
||||
ui->m_pLabelLogPath->setEnabled(checked);
|
||||
ui->m_pLineEditLogFilename->setEnabled(checked);
|
||||
ui->m_pButtonBrowseLog->setEnabled(checked);
|
||||
}
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &SettingsDialog::accept);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &SettingsDialog::reject);
|
||||
|
||||
void SettingsDialog::on_m_pButtonBrowseLog_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getSaveFileName(
|
||||
this, tr("Save log file to..."), ui->m_pLineEditLogFilename->text(), "Logs (*.log *.txt)"
|
||||
);
|
||||
connect(ui->groupSecurity, &QGroupBox::toggled, this, &SettingsDialog::updateTlsControlsEnabled);
|
||||
connect(ui->cbServiceEnabled, &QCheckBox::toggled, this, &SettingsDialog::updateControls);
|
||||
connect(ui->btnTlsRegenCert, &QPushButton::clicked, this, &SettingsDialog::regenCertificates);
|
||||
connect(ui->btnTlsCertPath, &QPushButton::clicked, this, &SettingsDialog::browseCertificatePath);
|
||||
connect(ui->btnBrowseLog, &QPushButton::clicked, this, &SettingsDialog::browseLogPath);
|
||||
connect(ui->cbLogToFile, &QCheckBox::toggled, this, &SettingsDialog::setLogToFile);
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->m_pLineEditLogFilename->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::on_m_pCheckBoxEnableTls_clicked(bool)
|
||||
{
|
||||
updateTlsControlsEnabled();
|
||||
}
|
||||
|
||||
void SettingsDialog::on_m_pRadioSystemScope_toggled(bool checked)
|
||||
{
|
||||
// We only need to test the System scoped Radio as they are connected
|
||||
m_appConfig.setLoadFromSystemScope(checked);
|
||||
loadFromConfig();
|
||||
updateControls();
|
||||
connect(ui->rbScopeSystem, &QRadioButton::toggled, this, &SettingsDialog::setSystemScope);
|
||||
}
|
||||
|
||||
if (isVisible() && !m_appConfig.isActiveScopeWritable()) {
|
||||
showReadOnlyMessage();
|
||||
void SettingsDialog::regenCertificates()
|
||||
{
|
||||
if (m_tlsUtility.generateCertificate()) {
|
||||
QMessageBox::information(this, tr("TLS Certificate Regenerated"), tr("TLS certificate regenerated successfully."));
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::on_m_pPushButtonTlsCertPath_clicked()
|
||||
void SettingsDialog::browseCertificatePath()
|
||||
{
|
||||
QString fileName = QFileDialog::getSaveFileName(
|
||||
this, tr("Select a TLS certificate to use..."), ui->m_pLineEditTlsCertPath->text(), "Cert (*.pem)", nullptr,
|
||||
this, tr("Select a TLS certificate to use..."), ui->lineTlsCertPath->text(), "Cert (*.pem)", nullptr,
|
||||
QFileDialog::DontConfirmOverwrite
|
||||
);
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->m_pLineEditTlsCertPath->setText(fileName);
|
||||
ui->lineTlsCertPath->setText(fileName);
|
||||
|
||||
if (QFile(fileName).exists()) {
|
||||
updateKeyLengthOnFile(fileName);
|
||||
@ -147,21 +99,31 @@ void SettingsDialog::on_m_pPushButtonTlsCertPath_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::on_m_pPushButtonTlsRegenCert_clicked()
|
||||
void SettingsDialog::browseLogPath()
|
||||
{
|
||||
if (m_tlsUtility.generateCertificate()) {
|
||||
QMessageBox::information(this, tr("TLS Certificate Regenerated"), tr("TLS certificate regenerated successfully."));
|
||||
QString fileName =
|
||||
QFileDialog::getSaveFileName(this, tr("Save log file to..."), ui->lineLogFilename->text(), "Logs (*.log *.txt)");
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->lineLogFilename->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::on_m_pCheckBoxServiceEnabled_toggled(bool)
|
||||
void SettingsDialog::setLogToFile(bool logToFile)
|
||||
{
|
||||
updateControls();
|
||||
ui->widgetLogFilename->setEnabled(logToFile);
|
||||
}
|
||||
|
||||
//
|
||||
// End of auto-connect slots
|
||||
//
|
||||
void SettingsDialog::setSystemScope(bool systemScope)
|
||||
{
|
||||
m_appConfig.setLoadFromSystemScope(systemScope);
|
||||
loadFromConfig();
|
||||
updateControls();
|
||||
|
||||
if (isVisible() && !m_appConfig.isActiveScopeWritable()) {
|
||||
showReadOnlyMessage();
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::showEvent(QShowEvent *event)
|
||||
{
|
||||
@ -171,36 +133,33 @@ void SettingsDialog::showEvent(QShowEvent *event)
|
||||
|
||||
void SettingsDialog::showReadOnlyMessage()
|
||||
{
|
||||
if (m_appConfig.isActiveScopeWritable())
|
||||
return;
|
||||
const auto activeScopeFilename = m_appConfig.scopes().activeFilePath();
|
||||
messages::showReadOnlySettings(this, activeScopeFilename);
|
||||
}
|
||||
|
||||
void SettingsDialog::accept()
|
||||
{
|
||||
if (!ui->m_pLineEditScreenName->hasAcceptableInput()) {
|
||||
QMessageBox::warning(this, tr("Invalid screen name"), m_pScreenNameError->message());
|
||||
return;
|
||||
}
|
||||
|
||||
m_appConfig.setLoadFromSystemScope(ui->m_pRadioSystemScope->isChecked());
|
||||
m_appConfig.setScreenName(ui->m_pLineEditScreenName->text());
|
||||
m_appConfig.setPort(ui->m_pSpinBoxPort->value());
|
||||
m_appConfig.setNetworkInterface(ui->m_pLineEditInterface->text());
|
||||
m_appConfig.setLogLevel(ui->m_pComboLogLevel->currentIndex());
|
||||
m_appConfig.setLogToFile(ui->m_pCheckBoxLogToFile->isChecked());
|
||||
m_appConfig.setLogFilename(ui->m_pLineEditLogFilename->text());
|
||||
m_appConfig.setElevateMode(static_cast<ElevateMode>(ui->m_pComboElevate->currentIndex()));
|
||||
m_appConfig.setAutoHide(ui->m_pCheckBoxAutoHide->isChecked());
|
||||
m_appConfig.setEnableUpdateCheck(ui->m_pCheckBoxAutoUpdate->isChecked());
|
||||
m_appConfig.setPreventSleep(ui->m_pCheckBoxPreventSleep->isChecked());
|
||||
m_appConfig.setTlsCertPath(ui->m_pLineEditTlsCertPath->text());
|
||||
m_appConfig.setTlsKeyLength(ui->m_pComboBoxTlsKeyLength->currentText().toInt());
|
||||
m_appConfig.setTlsEnabled(ui->m_pCheckBoxEnableTls->isChecked());
|
||||
m_appConfig.setLanguageSync(ui->m_pCheckBoxLanguageSync->isChecked());
|
||||
m_appConfig.setInvertScrollDirection(ui->m_pCheckBoxScrollDirection->isChecked());
|
||||
m_appConfig.setEnableService(ui->m_pCheckBoxServiceEnabled->isChecked());
|
||||
m_appConfig.setCloseToTray(ui->m_pCheckBoxCloseToTray->isChecked());
|
||||
m_appConfig.setInvertConnection(ui->m_pInvertConnection->isChecked());
|
||||
m_appConfig.setLoadFromSystemScope(ui->rbScopeSystem->isChecked());
|
||||
m_appConfig.setPort(ui->sbPort->value());
|
||||
m_appConfig.setNetworkInterface(ui->lineInterface->text());
|
||||
m_appConfig.setLogLevel(ui->comboLogLevel->currentIndex());
|
||||
m_appConfig.setLogToFile(ui->cbLogToFile->isChecked());
|
||||
m_appConfig.setLogFilename(ui->lineLogFilename->text());
|
||||
m_appConfig.setElevateMode(static_cast<ElevateMode>(ui->comboElevate->currentIndex()));
|
||||
m_appConfig.setAutoHide(ui->cbAutoHide->isChecked());
|
||||
m_appConfig.setEnableUpdateCheck(ui->cbAutoUpdate->isChecked());
|
||||
m_appConfig.setPreventSleep(ui->cbPreventSleep->isChecked());
|
||||
m_appConfig.setTlsCertPath(ui->lineTlsCertPath->text());
|
||||
m_appConfig.setTlsKeyLength(ui->comboTlsKeyLength->currentText().toInt());
|
||||
m_appConfig.setTlsEnabled(ui->groupSecurity->isChecked());
|
||||
m_appConfig.setLanguageSync(ui->cbLanguageSync->isChecked());
|
||||
m_appConfig.setInvertScrollDirection(ui->cbScrollDirection->isChecked());
|
||||
m_appConfig.setEnableService(ui->cbServiceEnabled->isChecked());
|
||||
m_appConfig.setCloseToTray(ui->cbCloseToTray->isChecked());
|
||||
m_appConfig.setColorfulTrayIcon(ui->rbIconColorful->isChecked());
|
||||
m_appConfig.setRequireClientCerts(ui->cbRequireClientCert->isChecked());
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
@ -218,34 +177,37 @@ void SettingsDialog::reject()
|
||||
void SettingsDialog::loadFromConfig()
|
||||
{
|
||||
|
||||
ui->m_pLineEditScreenName->setText(m_appConfig.screenName());
|
||||
ui->m_pSpinBoxPort->setValue(m_appConfig.port());
|
||||
ui->m_pLineEditInterface->setText(m_appConfig.networkInterface());
|
||||
ui->m_pComboLogLevel->setCurrentIndex(m_appConfig.logLevel());
|
||||
ui->m_pCheckBoxLogToFile->setChecked(m_appConfig.logToFile());
|
||||
ui->m_pLineEditLogFilename->setText(m_appConfig.logFilename());
|
||||
ui->m_pCheckBoxAutoHide->setChecked(m_appConfig.autoHide());
|
||||
ui->m_pCheckBoxPreventSleep->setChecked(m_appConfig.preventSleep());
|
||||
ui->m_pCheckBoxLanguageSync->setChecked(m_appConfig.languageSync());
|
||||
ui->m_pCheckBoxScrollDirection->setChecked(m_appConfig.invertScrollDirection());
|
||||
ui->m_pCheckBoxServiceEnabled->setChecked(m_appConfig.enableService());
|
||||
ui->m_pCheckBoxCloseToTray->setChecked(m_appConfig.closeToTray());
|
||||
ui->m_pComboElevate->setCurrentIndex(static_cast<int>(m_appConfig.elevateMode()));
|
||||
ui->sbPort->setValue(m_appConfig.port());
|
||||
ui->lineInterface->setText(m_appConfig.networkInterface());
|
||||
ui->comboLogLevel->setCurrentIndex(m_appConfig.logLevel());
|
||||
ui->cbLogToFile->setChecked(m_appConfig.logToFile());
|
||||
ui->lineLogFilename->setText(m_appConfig.logFilename());
|
||||
ui->cbAutoHide->setChecked(m_appConfig.autoHide());
|
||||
ui->cbPreventSleep->setChecked(m_appConfig.preventSleep());
|
||||
ui->cbLanguageSync->setChecked(m_appConfig.languageSync());
|
||||
ui->cbScrollDirection->setChecked(m_appConfig.invertScrollDirection());
|
||||
ui->cbServiceEnabled->setChecked(m_appConfig.enableService());
|
||||
ui->cbCloseToTray->setChecked(m_appConfig.closeToTray());
|
||||
ui->comboElevate->setCurrentIndex(static_cast<int>(m_appConfig.elevateMode()));
|
||||
|
||||
if (m_appConfig.enableUpdateCheck().has_value()) {
|
||||
ui->m_pCheckBoxAutoUpdate->setChecked(m_appConfig.enableUpdateCheck().value());
|
||||
ui->cbAutoUpdate->setChecked(m_appConfig.enableUpdateCheck().value());
|
||||
} else {
|
||||
ui->m_pCheckBoxAutoUpdate->setChecked(false);
|
||||
ui->cbAutoUpdate->setChecked(false);
|
||||
}
|
||||
|
||||
if (m_appConfig.isActiveScopeSystem()) {
|
||||
ui->m_pRadioSystemScope->setChecked(true);
|
||||
ui->rbScopeSystem->setChecked(true);
|
||||
} else {
|
||||
ui->m_pRadioUserScope->setChecked(true);
|
||||
ui->rbScopeUser->setChecked(true);
|
||||
}
|
||||
|
||||
ui->m_pInvertConnection->setChecked(m_appConfig.invertConnection());
|
||||
if (m_appConfig.colorfulTrayIcon())
|
||||
ui->rbIconColorful->setChecked(true);
|
||||
else
|
||||
ui->rbIconMono->setChecked(true);
|
||||
|
||||
qDebug() << "load from config done";
|
||||
updateTlsControls();
|
||||
}
|
||||
|
||||
@ -256,30 +218,38 @@ void SettingsDialog::updateTlsControls()
|
||||
updateKeyLengthOnFile(m_appConfig.tlsCertPath());
|
||||
} else {
|
||||
const auto keyLengthText = QString::number(m_appConfig.tlsKeyLength());
|
||||
ui->m_pComboBoxTlsKeyLength->setCurrentIndex(ui->m_pComboBoxTlsKeyLength->findText(keyLengthText));
|
||||
ui->comboTlsKeyLength->setCurrentIndex(ui->comboTlsKeyLength->findText(keyLengthText));
|
||||
}
|
||||
|
||||
const auto tlsEnabled = m_tlsUtility.isEnabled();
|
||||
const auto writable = m_appConfig.isActiveScopeWritable();
|
||||
const auto enabled = writable && tlsEnabled;
|
||||
|
||||
ui->m_pCheckBoxEnableTls->setEnabled(writable);
|
||||
ui->m_pCheckBoxEnableTls->setChecked(writable && tlsEnabled);
|
||||
ui->m_pLineEditTlsCertPath->setText(m_appConfig.tlsCertPath());
|
||||
ui->lineTlsCertPath->setText(m_appConfig.tlsCertPath());
|
||||
ui->cbRequireClientCert->setChecked(m_appConfig.requireClientCerts());
|
||||
ui->groupSecurity->setChecked(tlsEnabled);
|
||||
|
||||
ui->groupSecurity->setEnabled(writable);
|
||||
ui->comboTlsKeyLength->setEnabled(enabled);
|
||||
ui->widgetTlsCert->setEnabled(enabled);
|
||||
ui->lblTlsKeyLength->setEnabled(enabled);
|
||||
ui->btnTlsRegenCert->setEnabled(enabled);
|
||||
ui->cbRequireClientCert->setEnabled(enabled);
|
||||
}
|
||||
|
||||
void SettingsDialog::updateTlsControlsEnabled()
|
||||
{
|
||||
const auto writable = m_appConfig.isActiveScopeWritable();
|
||||
const auto clientMode = m_appConfig.clientGroupChecked();
|
||||
const auto tlsChecked = ui->m_pCheckBoxEnableTls->isChecked();
|
||||
const auto tlsChecked = ui->groupSecurity->isChecked();
|
||||
|
||||
auto enabled = writable && tlsChecked && !clientMode;
|
||||
ui->m_pLabelTlsKeyLength->setEnabled(enabled);
|
||||
ui->m_pComboBoxTlsKeyLength->setEnabled(enabled);
|
||||
ui->m_pLabelTlsCert->setEnabled(enabled);
|
||||
ui->m_pLineEditTlsCertPath->setEnabled(enabled);
|
||||
ui->m_pPushButtonTlsCertPath->setEnabled(enabled);
|
||||
ui->m_pPushButtonTlsRegenCert->setEnabled(enabled);
|
||||
ui->lblTlsKeyLength->setEnabled(enabled);
|
||||
ui->comboTlsKeyLength->setEnabled(enabled);
|
||||
ui->lblTlsCert->setEnabled(enabled);
|
||||
ui->widgetTlsCert->setEnabled(enabled);
|
||||
ui->btnTlsRegenCert->setEnabled(enabled);
|
||||
ui->cbRequireClientCert->setEnabled(enabled);
|
||||
}
|
||||
|
||||
bool SettingsDialog::isClientMode() const
|
||||
@ -295,8 +265,8 @@ void SettingsDialog::updateKeyLengthOnFile(const QString &path)
|
||||
}
|
||||
|
||||
auto length = ssl.getCertKeyLength(path);
|
||||
auto index = ui->m_pComboBoxTlsKeyLength->findText(QString::number(length));
|
||||
ui->m_pComboBoxTlsKeyLength->setCurrentIndex(index);
|
||||
auto index = ui->comboTlsKeyLength->findText(QString::number(length));
|
||||
ui->comboTlsKeyLength->setCurrentIndex(index);
|
||||
m_appConfig.setTlsKeyLength(length);
|
||||
}
|
||||
|
||||
@ -308,35 +278,31 @@ void SettingsDialog::updateControls()
|
||||
#else
|
||||
// service not supported on unix yet, so always disable.
|
||||
const auto serviceAvailable = false;
|
||||
ui->m_pGroupService->setTitle("Service (Windows only)");
|
||||
ui->groupService->setTitle("Service (Windows only)");
|
||||
#endif
|
||||
|
||||
const bool writable = m_appConfig.isActiveScopeWritable();
|
||||
const bool serviceChecked = ui->m_pCheckBoxServiceEnabled->isChecked();
|
||||
const bool logToFile = ui->m_pCheckBoxLogToFile->isChecked();
|
||||
const bool serviceChecked = ui->cbServiceEnabled->isChecked();
|
||||
const bool logToFile = ui->cbLogToFile->isChecked();
|
||||
|
||||
ui->m_pLineEditScreenName->setEnabled(writable);
|
||||
ui->m_pSpinBoxPort->setEnabled(writable);
|
||||
ui->m_pLineEditInterface->setEnabled(writable);
|
||||
ui->m_pComboLogLevel->setEnabled(writable);
|
||||
ui->m_pCheckBoxLogToFile->setEnabled(writable);
|
||||
ui->m_pCheckBoxAutoHide->setEnabled(writable);
|
||||
ui->m_pCheckBoxAutoUpdate->setEnabled(writable);
|
||||
ui->m_pCheckBoxPreventSleep->setEnabled(writable);
|
||||
ui->m_pLineEditTlsCertPath->setEnabled(writable);
|
||||
ui->m_pComboBoxTlsKeyLength->setEnabled(writable);
|
||||
ui->m_pCheckBoxCloseToTray->setEnabled(writable);
|
||||
ui->sbPort->setEnabled(writable);
|
||||
ui->lineInterface->setEnabled(writable);
|
||||
ui->comboLogLevel->setEnabled(writable);
|
||||
ui->cbLogToFile->setEnabled(writable);
|
||||
ui->cbAutoHide->setEnabled(writable);
|
||||
ui->cbAutoUpdate->setEnabled(writable);
|
||||
ui->cbPreventSleep->setEnabled(writable);
|
||||
ui->lineTlsCertPath->setEnabled(writable);
|
||||
ui->comboTlsKeyLength->setEnabled(writable);
|
||||
ui->cbCloseToTray->setEnabled(writable);
|
||||
|
||||
ui->m_pCheckBoxServiceEnabled->setEnabled(writable && serviceAvailable);
|
||||
ui->m_pLabelElevate->setEnabled(writable && serviceChecked && serviceAvailable);
|
||||
ui->m_pComboElevate->setEnabled(writable && serviceChecked && serviceAvailable);
|
||||
ui->cbServiceEnabled->setEnabled(writable && serviceAvailable);
|
||||
ui->widgetElevate->setEnabled(writable && serviceChecked && serviceAvailable);
|
||||
|
||||
ui->m_pCheckBoxLanguageSync->setEnabled(writable && isClientMode());
|
||||
ui->m_pCheckBoxScrollDirection->setEnabled(writable && isClientMode());
|
||||
ui->cbLanguageSync->setEnabled(writable && isClientMode());
|
||||
ui->cbScrollDirection->setEnabled(writable && isClientMode());
|
||||
|
||||
ui->m_pLabelLogPath->setEnabled(writable && logToFile);
|
||||
ui->m_pLineEditLogFilename->setEnabled(writable && logToFile);
|
||||
ui->m_pButtonBrowseLog->setEnabled(writable && logToFile);
|
||||
ui->widgetLogFilename->setEnabled(writable && logToFile);
|
||||
|
||||
updateTlsControls();
|
||||
}
|
||||
|
||||
@ -1,19 +1,9 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@ -46,16 +36,13 @@ public:
|
||||
signals:
|
||||
void shown();
|
||||
|
||||
private slots:
|
||||
void on_m_pCheckBoxEnableTls_clicked(bool checked);
|
||||
void on_m_pCheckBoxLogToFile_stateChanged(int);
|
||||
void on_m_pButtonBrowseLog_clicked();
|
||||
void on_m_pRadioSystemScope_toggled(bool checked);
|
||||
void on_m_pPushButtonTlsCertPath_clicked();
|
||||
void on_m_pPushButtonTlsRegenCert_clicked();
|
||||
void on_m_pCheckBoxServiceEnabled_toggled(bool checked);
|
||||
|
||||
private:
|
||||
void initConnections();
|
||||
void regenCertificates();
|
||||
void browseCertificatePath();
|
||||
void browseLogPath();
|
||||
void setLogToFile(bool logToFile);
|
||||
void setSystemScope(bool systemScope);
|
||||
void accept() override;
|
||||
void reject() override;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
@ -76,8 +63,6 @@ private:
|
||||
/// @brief Enables controls when they should be.
|
||||
void updateControls();
|
||||
|
||||
validators::ValidationError *m_pScreenNameError;
|
||||
|
||||
/// @brief Stores settings scope at start of settings dialog
|
||||
/// This is necessary to restore state if user changes
|
||||
/// the scope and doesn't save changes
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,23 +1,12 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2012 Symless Ltd.
|
||||
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* 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/>.
|
||||
* SPDX-FileCopyrightText: (C) 2024 Chris Rizzitello <sithord48@gmail.com>
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2024 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "SetupWizard.h"
|
||||
#include "common/constants.h"
|
||||
#include "gui/Logger.h"
|
||||
#include "gui/config/AppConfig.h"
|
||||
@ -27,16 +16,15 @@
|
||||
#include "gui/dotenv.h"
|
||||
#include "gui/messages.h"
|
||||
#include "gui/string_utils.h"
|
||||
|
||||
#ifdef DESKFLOW_GUI_HOOK_HEADER
|
||||
#include DESKFLOW_GUI_HOOK_HEADER
|
||||
#endif
|
||||
#include "gui/style_utils.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QGuiApplication>
|
||||
#include <QLocalSocket>
|
||||
#include <QMessageBox>
|
||||
#include <QObject>
|
||||
#include <QSharedMemory>
|
||||
#include <QtGlobal>
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
@ -90,6 +78,29 @@ int main(int argc, char *argv[])
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// Create a shared memory segment with a unique key
|
||||
// This is to prevent a new instance from running if one is already running
|
||||
QSharedMemory sharedMemory("deskflow-gui");
|
||||
|
||||
// Attempt to attach first and detach in order to clean up stale shm chunks
|
||||
// This can happen if the previous instance was killed or crashed
|
||||
if (sharedMemory.attach())
|
||||
sharedMemory.detach();
|
||||
|
||||
// If we can create 1 byte of SHM we are the only instance
|
||||
if (!sharedMemory.create(1)) {
|
||||
// Ping the running instance to have it show itself
|
||||
QLocalSocket socket;
|
||||
socket.connectToServer("deskflow-gui", QLocalSocket::ReadOnly);
|
||||
if (!socket.waitForConnected()) {
|
||||
// If we can't connect to the other instance tell the user its running.
|
||||
// This should never happen but just incase we should show something
|
||||
QMessageBox::information(nullptr, QObject::tr("Deskflow"), QObject::tr("Deskflow is already running"));
|
||||
}
|
||||
socket.disconnectFromServer();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if !defined(Q_OS_MAC)
|
||||
// causes dark mode to be used on some DE's
|
||||
if (qEnvironmentVariable("XDG_CURRENT_DESKTOP") != QLatin1String("KDE")) {
|
||||
@ -97,6 +108,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
#endif
|
||||
|
||||
// Sets the fallback icon path
|
||||
setIconFallbackPaths();
|
||||
|
||||
qInstallMessageHandler(deskflow::gui::messages::messageHandler);
|
||||
qInfo("%s v%s", kAppName, qPrintable(kVersion));
|
||||
|
||||
@ -133,24 +147,9 @@ int main(int argc, char *argv[])
|
||||
&configScopes, &ConfigScopes::saving, &appConfig, [&appConfig]() { appConfig.commit(); }, Qt::DirectConnection
|
||||
);
|
||||
|
||||
if (appConfig.wizardShouldRun()) {
|
||||
SetupWizard wizard(appConfig);
|
||||
auto result = wizard.exec();
|
||||
if (result != QDialog::Accepted) {
|
||||
qInfo("wizard cancelled, exiting");
|
||||
return 0;
|
||||
}
|
||||
|
||||
configScopes.save();
|
||||
}
|
||||
|
||||
MainWindow mainWindow(configScopes, appConfig);
|
||||
mainWindow.open();
|
||||
|
||||
#ifdef DESKFLOW_GUI_HOOK_START
|
||||
DESKFLOW_GUI_HOOK_START
|
||||
#endif
|
||||
|
||||
return QApplication::exec();
|
||||
}
|
||||
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2021 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 "ClientStateLabel.h"
|
||||
|
||||
namespace deskflow::gui::widgets {
|
||||
|
||||
ClientStateLabel::ClientStateLabel(QWidget *parent) : QLabel(parent)
|
||||
{
|
||||
hide();
|
||||
}
|
||||
|
||||
void ClientStateLabel::updateClientState(const QString &line)
|
||||
{
|
||||
if (line.contains("connected to server")) {
|
||||
show();
|
||||
} else if (line.contains("disconnected from server") || line.contains("process exited")) {
|
||||
hide();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace deskflow::gui::widgets
|
||||
@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2021 Symless Ltd.
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file LICENSE that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
namespace deskflow::gui::widgets {
|
||||
|
||||
class ClientStateLabel : public QLabel
|
||||
{
|
||||
public:
|
||||
explicit ClientStateLabel(QWidget *parent = nullptr);
|
||||
void updateClientState(const QString &line);
|
||||
};
|
||||
|
||||
} // namespace deskflow::gui::widgets
|
||||
101
src/apps/deskflow-gui/widgets/FingerprintPreview.cpp
Normal file
101
src/apps/deskflow-gui/widgets/FingerprintPreview.cpp
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "FingerprintPreview.h"
|
||||
|
||||
#include <QFont>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
|
||||
#include <net/SecureUtils.h>
|
||||
|
||||
FingerprintPreview::FingerprintPreview(QWidget *parent, const QList<deskflow::FingerprintData> &fingerprints)
|
||||
: QFrame(parent)
|
||||
{
|
||||
setFrameShape(QFrame::StyledPanel);
|
||||
setFrameStyle(QFrame::Sunken);
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
|
||||
QString sha1String;
|
||||
QString sha256String;
|
||||
QString sha256Art;
|
||||
|
||||
for (const auto &fingerprint : fingerprints) {
|
||||
if (fingerprint.algorithm == "sha1") {
|
||||
sha1String = QString::fromStdString(deskflow::formatSSLFingerprint(fingerprint.data));
|
||||
}
|
||||
|
||||
if (fingerprint.algorithm == "sha256") {
|
||||
sha256String = QString::fromStdString(deskflow::formatSSLFingerprintColumns(fingerprint.data));
|
||||
sha256Art = QString::fromStdString(deskflow::generateFingerprintArt(fingerprint.data));
|
||||
}
|
||||
}
|
||||
|
||||
auto labelSha1 = new QLabel(QStringLiteral("SHA1:"), this);
|
||||
labelSha1->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
|
||||
auto lblSha1 = new QLabel(sha1String, this);
|
||||
lblSha1->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
lblSha1->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||
|
||||
auto sha1Layout = new QHBoxLayout();
|
||||
sha1Layout->addWidget(labelSha1);
|
||||
sha1Layout->addWidget(lblSha1);
|
||||
|
||||
auto frameSha1 = new QFrame(this);
|
||||
frameSha1->setFrameShape(QFrame::StyledPanel);
|
||||
frameSha1->setFrameStyle(QFrame::Sunken);
|
||||
frameSha1->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
frameSha1->setLayout(sha1Layout);
|
||||
|
||||
auto labelSha256 = new QLabel(QStringLiteral("SHA256:"), this);
|
||||
labelSha256->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
|
||||
auto lblSha256String = new QLabel(sha256String, this);
|
||||
lblSha256String->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
|
||||
lblSha256String->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||
|
||||
auto lblSha256Art = new QLabel(sha256Art, this);
|
||||
lblSha256Art->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
lblSha256Art->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||
|
||||
QFont f = font();
|
||||
f.setFamilies({"Hack", "Liberation Mono", "Monospace", "Andale Mono"});
|
||||
f.setStyleHint(QFont::Monospace);
|
||||
lblSha256Art->setFont(f);
|
||||
|
||||
auto innersha256Layout = new QHBoxLayout();
|
||||
innersha256Layout->setContentsMargins(0, 0, 0, 0);
|
||||
innersha256Layout->addWidget(lblSha256String);
|
||||
innersha256Layout->addWidget(lblSha256Art);
|
||||
|
||||
auto sha256Layout = new QVBoxLayout();
|
||||
sha256Layout->addWidget(labelSha256);
|
||||
sha256Layout->addLayout(innersha256Layout);
|
||||
|
||||
auto frameSha256 = new QFrame(this);
|
||||
frameSha256->setFrameShape(QFrame::StyledPanel);
|
||||
frameSha256->setFrameStyle(QFrame::Sunken);
|
||||
frameSha256->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
frameSha256->setLayout(sha256Layout);
|
||||
|
||||
auto layout = new QVBoxLayout();
|
||||
layout->addWidget(frameSha1);
|
||||
layout->addWidget(frameSha256);
|
||||
|
||||
setLayout(layout);
|
||||
|
||||
if (sha1String.isEmpty()) {
|
||||
frameSha1->setVisible(false);
|
||||
}
|
||||
|
||||
if (sha256String.isEmpty()) {
|
||||
frameSha256->setVisible(false);
|
||||
}
|
||||
|
||||
adjustSize();
|
||||
setFixedSize(size());
|
||||
}
|
||||
18
src/apps/deskflow-gui/widgets/FingerprintPreview.h
Normal file
18
src/apps/deskflow-gui/widgets/FingerprintPreview.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QFrame>
|
||||
#include <net/FingerprintData.h>
|
||||
|
||||
class FingerprintPreview : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FingerprintPreview(QWidget *parent, const QList<deskflow::FingerprintData> &fingerprints = {});
|
||||
~FingerprintPreview() = default;
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user