Compare commits
962 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0096283779 | |||
| 0751639f93 | |||
| d719df1642 | |||
| 7abaca76af | |||
| 5ee3fc41bd | |||
| cab1eb9cee | |||
| 51db919d8f | |||
| 314899ac7d | |||
| 632c3462ec | |||
| d6f8cdf51d | |||
| 59173d6405 | |||
| d597d023b1 | |||
| 807e60ded2 | |||
| 0b4a2e0e5b | |||
| 9eabbb690c | |||
| 3eb3969a01 | |||
| d2ac36f3ed | |||
| e6a374369b | |||
| 9c56fa5dda | |||
| 6875969255 | |||
| aa1eaf601c | |||
| f77213af04 | |||
| a4f1a382d3 | |||
| 647201cd37 | |||
| e24b1c4b68 | |||
| 475b895755 | |||
| 593e53370a | |||
| be6a4f6b4d | |||
| 929131d10b | |||
| 767919b342 | |||
| 4224215991 | |||
| 45090d6b85 | |||
| 476f3ba243 | |||
| a33574e1bd | |||
| 456afaa13e | |||
| 17f12d8334 | |||
| 723671c2e5 | |||
| 5a90b51e97 | |||
| fe12972e83 | |||
| 9bdb4252e5 | |||
| c73729e72e | |||
| 04805d9a7e | |||
| 293c5e394c | |||
| 3cf0fb89ef | |||
| 52b0c1f061 | |||
| c224cd4661 | |||
| 635962618f | |||
| 0ff72441e6 | |||
| bdffda9a2f | |||
| cac63937ff | |||
| 12fbc2fd57 | |||
| 06324a941a | |||
| 8dd9e17e72 | |||
| a5e5bbc2e4 | |||
| 34f6186941 | |||
| 486b5a491f | |||
| 037fee0e59 | |||
| a9e0c62c24 | |||
| 43a51434ce | |||
| eaa4c71d6e | |||
| 393a006773 | |||
| 332e6c4a4d | |||
| 63e87c16d1 | |||
| 14cb921d4c | |||
| de583145d0 | |||
| 0309d35aef | |||
| c4704649ea | |||
| e4e332c13f | |||
| 33edb6ce01 | |||
| 49173b11b9 | |||
| 81392fe758 | |||
| 3ae2b3a571 | |||
| 2aee6d8812 | |||
| db3b18b36d | |||
| 89c199b630 | |||
| d023c8ef77 | |||
| af383decca | |||
| 8526facbe9 | |||
| 2b3ecd39c6 | |||
| 49589ae4aa | |||
| 8ce6a07d18 | |||
| a8eb772b68 | |||
| 0916009601 | |||
| f5cb636b31 | |||
| 7ced794317 | |||
| 7c279ec72d | |||
| 83a8d1c4ac | |||
| 84a9367124 | |||
| aaeef7905a | |||
| a0d0936433 | |||
| 8f53b88bb6 | |||
| d8b4fab9a3 | |||
| 9d867f6146 | |||
| 632be4b240 | |||
| b8c6d1b58f | |||
| 139dbf61f3 | |||
| e512125595 | |||
| ae37543a37 | |||
| 8a80c52208 | |||
| 38dc845c72 | |||
| b56a282a9c | |||
| d742901775 | |||
| 287d70a138 | |||
| 6c0843d088 | |||
| cbcaafe764 | |||
| 29a86cfbac | |||
| d7506697c8 | |||
| 6c2457d60b | |||
| 30d9034a0f | |||
| a2acfb0678 | |||
| 7fa326234e | |||
| baaa02cda2 | |||
| 231e5c0bc5 | |||
| 78cbe4b775 | |||
| a1a7c8f3ff | |||
| 501726d471 | |||
| b51dec01ad | |||
| 1c907991af | |||
| 0c3c913989 | |||
| 4479b90d37 | |||
| 8a139f0e3d | |||
| 810322623b | |||
| 245f9db5c8 | |||
| 807f32975a | |||
| 5365e34f08 | |||
| 55a7fa3266 | |||
| 118f867fd1 | |||
| 13dc055405 | |||
| 99dae58fd3 | |||
| e9ccd513f7 | |||
| 903401796e | |||
| 97863bda7c | |||
| 0c94adf03c | |||
| d643e4b189 | |||
| c8734755c5 | |||
| edea3b0df1 | |||
| f4264d71a1 | |||
| 6ffd0eb471 | |||
| 7619928d56 | |||
| d70c7fe720 | |||
| b26ca77ff1 | |||
| 68db2c3484 | |||
| 81c19c6ee8 | |||
| 1276a4a29c | |||
| d97f4d87ad | |||
| d5cbd002a9 | |||
| 31a6fd23e7 | |||
| f6c6d4e3a7 | |||
| 5801b92636 | |||
| b427ac91c2 | |||
| e87c596fbe | |||
| 35b4749627 | |||
| 6b2a28600a | |||
| 600378b72d | |||
| 8e24689f72 | |||
| 07f9c4ba47 | |||
| 9d476e143e | |||
| 6bcdd4ebe7 | |||
| 9085468d1c | |||
| 7bace4d36d | |||
| ca0d095283 | |||
| ace5b54912 | |||
| c99767c8b7 | |||
| 297b781578 | |||
| 8c4dc001bf | |||
| 9ca13a65d1 | |||
| 73566c061d | |||
| ed3118b81a | |||
| cc209b9b1f | |||
| ee22c31f32 | |||
| f376b049e4 | |||
| 57e3ff1fab | |||
| c39f69b64d | |||
| 218a506970 | |||
| 57cb7227a4 | |||
| 6aabb1e858 | |||
| 9aec1ad479 | |||
| c8d4a2186a | |||
| f68744a36d | |||
| 183d660186 | |||
| e20ef3ae55 | |||
| 0bfb95996a | |||
| 7d27031723 | |||
| ada495c681 | |||
| e91b9867e0 | |||
| d483dc38bd | |||
| 56dd5492b4 | |||
| 67c7ba6dae | |||
| 1138e3b1fb | |||
| 6523911e4d | |||
| a52552b821 | |||
| bd2188beb1 | |||
| edc0c0d7a0 | |||
| 95586c88fd | |||
| d7174a3a2f | |||
| 2289ed5845 | |||
| 2192636d2b | |||
| 6194868e89 | |||
| 00f53c1aac | |||
| 59df2db7b7 | |||
| 35f0e9e6e4 | |||
| 3b3d9e14fd | |||
| b3f179a08a | |||
| f3fca87e19 | |||
| a3093fa046 | |||
| c00ebbd6c1 | |||
| 09457793b4 | |||
| d436aa3001 | |||
| ec4851d326 | |||
| f338e5e7a8 | |||
| 55b48a5db7 | |||
| 352a871729 | |||
| b103f28202 | |||
| 39b49acb56 | |||
| 5d4fbc8ea6 | |||
| 3dfa3d5069 | |||
| 6d9c66b03f | |||
| 02b2b82c7f | |||
| aac086ad2a | |||
| 0d3f7248ed | |||
| da6e110b69 | |||
| a298cc84ad | |||
| d8348152ec | |||
| 572953d5ba | |||
| a23856ee09 | |||
| 637adc60b2 | |||
| 0ca847334e | |||
| d06d6a5003 | |||
| 6d856b674b | |||
| bcfc121c37 | |||
| b2ec2f1a34 | |||
| df9d5ded1c | |||
| f11dae97d4 | |||
| 3fdc5288eb | |||
| 955f9652fb | |||
| 9dedf25ecc | |||
| ee3dffc4f8 | |||
| 8123166e66 | |||
| 29626d6694 | |||
| 996af86b9b | |||
| 84fbe48d35 | |||
| 11423ef5a1 | |||
| 7cc108d87c | |||
| af70ff98b7 | |||
| b6f7497c44 | |||
| f6602baa36 | |||
| 72091c6ac4 | |||
| fb5f80857b | |||
| 6c7bdf3e07 | |||
| 1df01d3cf1 | |||
| 2bebdbaf4d | |||
| 63d65bb47b | |||
| 60dc4c0cd8 | |||
| 78d1c5222f | |||
| 6e3426855d | |||
| f49f5f790c | |||
| 4eaf6fda62 | |||
| ebc6186fe7 | |||
| 48f824ca31 | |||
| d6ace78a58 | |||
| 41fda741b3 | |||
| 793ea5f81c | |||
| 285abc7bb7 | |||
| d6c9897748 | |||
| ed4ecc2d81 | |||
| 794017402d | |||
| 4034302bfb | |||
| eab87e3869 | |||
| 294348b42b | |||
| 71b6f07220 | |||
| 9addada64c | |||
| b6196f147a | |||
| 2c4a68ebcf | |||
| d8f480b981 | |||
| 80afb92af1 | |||
| f5f3bc0475 | |||
| 17c7b0f8bf | |||
| fcaadc2cd4 | |||
| e3642f0955 | |||
| 07d837a39b | |||
| 1202145bb8 | |||
| abc963f886 | |||
| 4988196c47 | |||
| 8a2b6bd688 | |||
| 901dacf593 | |||
| c62b4ec068 | |||
| c8408c4823 | |||
| 8657532ca2 | |||
| 64b277a5df | |||
| cd7d53d2bd | |||
| d740574bd4 | |||
| 84ae597d69 | |||
| 16ef088c27 | |||
| 7e4b6b82f4 | |||
| daa095461d | |||
| fde880fb6f | |||
| a04568b25f | |||
| 6e6892b6e7 | |||
| 5ad2c9283d | |||
| 487030aade | |||
| 1ace03d4b5 | |||
| 5df333fae9 | |||
| 3b4306183c | |||
| 4203f42363 | |||
| 7e4ac48476 | |||
| 0b05b0e71d | |||
| ebb63d8113 | |||
| c1f1734943 | |||
| 12bcc1a4d6 | |||
| 84283a1b13 | |||
| 0a33e20723 | |||
| d4f916c365 | |||
| 6df96d4a56 | |||
| e617e4b537 | |||
| ca5cc8211b | |||
| f01b592dad | |||
| 46c6275c43 | |||
| b3fb8959a3 | |||
| 8354a81706 | |||
| d9807a2693 | |||
| 1b8067797e | |||
| cf4fe32aab | |||
| 6bbebe75f9 | |||
| 0b9ecbc2f4 | |||
| fc36cf6be8 | |||
| b7b295aeb6 | |||
| 00b5c32fc9 | |||
| 5355e84b63 | |||
| 8fbcf907b2 | |||
| d2bf5e63e4 | |||
| 3ed0915b57 | |||
| 01878b0522 | |||
| af6b42fe9e | |||
| a0051ea0bc | |||
| 40c915f6bd | |||
| 1cee520e2b | |||
| 1dd5654af6 | |||
| 2708fc96fe | |||
| 5cfaa4a4e0 | |||
| a6453a6819 | |||
| f781ac9855 | |||
| d6087cc5bd | |||
| 6e9694b5d8 | |||
| 201df59cb7 | |||
| bcfc77fde6 | |||
| 245a522188 | |||
| fdf1df1a30 | |||
| 84b433853a | |||
| e225a357fd | |||
| 54fac87ed2 | |||
| 56a665cd18 | |||
| cb8c6fe9d9 | |||
| 239a265e18 | |||
| ee53d28af7 | |||
| 91fd139a49 | |||
| 7f1a234d06 | |||
| db20c4b0c7 | |||
| 7bd3fc1eb5 | |||
| 8fde0d764e | |||
| e1eb4ebf98 | |||
| 4b06160f84 | |||
| 2160f7826f | |||
| 7f6a68bb2f | |||
| 95521c53d6 | |||
| 446847f4fb | |||
| 37bc70896b | |||
| f9c8d08ff7 | |||
| 55c611f754 | |||
| 541e30f406 | |||
| 4b24b5b38d | |||
| df8500178b | |||
| 378fdae140 | |||
| 31e95ad2dc | |||
| 8b5a61f07f | |||
| 516f803eb4 | |||
| c1a7b836ce | |||
| 9530b9c6ba | |||
| 9df2a2c28d | |||
| 133545d03f | |||
| 75e852d95f | |||
| 9c44653fff | |||
| 2adee7c460 | |||
| 6f6e9cddb7 | |||
| fdd9b1bb6d | |||
| b2ff6aa938 | |||
| 5e4188b2fe | |||
| a3875bf71c | |||
| f3930d9520 | |||
| f66a50dab7 | |||
| 68ebc88293 | |||
| 83c8d295d4 | |||
| 07219ed431 | |||
| da5f3c0be1 | |||
| a23e35c522 | |||
| eb74d8ca99 | |||
| 65b6fe7ca3 | |||
| 9b6615328b | |||
| 7fb87b32f5 | |||
| 8508805f5d | |||
| 385a610da2 | |||
| e00058a332 | |||
| 45b6ff19e7 | |||
| 1798d7e4e6 | |||
| 854787e6b3 | |||
| 498ffe85c3 | |||
| cd3f9b2e7d | |||
| 42b16efdb9 | |||
| 003f87db9e | |||
| 86dca27e4c | |||
| 26fa6860e4 | |||
| d9798a9b2b | |||
| 70a2554370 | |||
| 13c325eb3f | |||
| a3ad66dfb0 | |||
| c9d1a50bb0 | |||
| cb3e516206 | |||
| de2e3fb9ce | |||
| 3bad718bb7 | |||
| 40c10766f3 | |||
| bf09df835d | |||
| 4a16804d27 | |||
| 5e1aa9eb5d | |||
| 3c86d9dc83 | |||
| 099262d8ce | |||
| d9e6ec4b70 | |||
| d7b20fad5c | |||
| 6e6a88af87 | |||
| ce17167248 | |||
| 656ad6402b | |||
| 329742a411 | |||
| 4df982dd6f | |||
| b1010751ba | |||
| 4238441018 | |||
| a13bd3d0bd | |||
| 516e612282 | |||
| bfd4bbd8f4 | |||
| 1c4ec6ec41 | |||
| 2ef23b8206 | |||
| ecf70f09f3 | |||
| 397c652e1c | |||
| 1666a30b94 | |||
| 827d020d16 | |||
| 0138372871 | |||
| 9e78cb55aa | |||
| 38cc678ad2 | |||
| e624e6f174 | |||
| 96b50b7d1c | |||
| ffbe2cf885 | |||
| b1b8720781 | |||
| 8609cbc20a | |||
| 7fe862b715 | |||
| 377272e917 | |||
| b051c5ae60 | |||
| 38f00da704 | |||
| dcd2c62880 | |||
| b7f29d76c3 | |||
| 55601debe0 | |||
| 6c8eca6c41 | |||
| 6444e2c208 | |||
| b3ce7c41d3 | |||
| 6963c28219 | |||
| 99ed548495 | |||
| d37bda6edb | |||
| 73de5e964e | |||
| 27451d3425 | |||
| 613f3651ea | |||
| 0e3cee6287 | |||
| 6056e5850b | |||
| 1b01a010ed | |||
| 7faf76c7df | |||
| 55f513941b | |||
| 9e74100960 | |||
| 531b988dd1 | |||
| 5647121dd8 | |||
| c1af4c3b71 | |||
| dd895ed99f | |||
| 7771dcd04c | |||
| d537a23fda | |||
| f7b98465fa | |||
| ed1bf01306 | |||
| 80f814a2da | |||
| 5355c9080b | |||
| 16517ca541 | |||
| e8ea9f53ee | |||
| 7da8c54924 | |||
| 3683db0db9 | |||
| cd0aa6496a | |||
| c583252b03 | |||
| 2c433eddd7 | |||
| 5ee39c9b00 | |||
| c1642b8d9d | |||
| f2c16c4432 | |||
| 37b4e4b57f | |||
| b502a6b848 | |||
| fe0ddf85e4 | |||
| 6990477504 | |||
| e05b35dda4 | |||
| f50e4e850b | |||
| 3cd3d7b1ff | |||
| 5a7284fd6a | |||
| 362b2e1477 | |||
| 7bf716b232 | |||
| 554178b658 | |||
| af17b14224 | |||
| 1e9f92c93f | |||
| 8bb325a2d2 | |||
| 8606dc8618 | |||
| 6362948e15 | |||
| 085a70d5a5 | |||
| 93abf4217b | |||
| 88b0a7d2e1 | |||
| 5fa70d0d0a | |||
| d01c07cab8 | |||
| 6834862413 | |||
| 4273fe2318 | |||
| 266a4a5edf | |||
| 5e6381c88a | |||
| 9aa1d6b79d | |||
| d45d6baacb | |||
| a887ac066c | |||
| 787a48424e | |||
| b20d6361d6 | |||
| b833ca7a45 | |||
| 43eab1f04c | |||
| dc9e104f8c | |||
| f456aab196 | |||
| de3b9d8e2e | |||
| b7960eecb4 | |||
| 03f142977f | |||
| 5360fb3c89 | |||
| 4eb7ea3491 | |||
| 5642879a21 | |||
| 737328d7b0 | |||
| bee0f84556 | |||
| 2721de220a | |||
| 4c6195cc5d | |||
| 1e46bd2727 | |||
| 54ecdad101 | |||
| 51a749b109 | |||
| 788f6c3eb2 | |||
| e01c595071 | |||
| bcd90434a2 | |||
| 698fd3f83c | |||
| 2a53d4f187 | |||
| 53487e757b | |||
| ef315183f3 | |||
| 8b1e8dfd9f | |||
| b73aceee7d | |||
| 3b811a1bd0 | |||
| a099276e4e | |||
| 38f8159e9d | |||
| 87fb06781c | |||
| b9017de881 | |||
| 24d1d4e620 | |||
| 3bcc1e11ed | |||
| d26c75a784 | |||
| 5b091dee56 | |||
| 3344644d2e | |||
| 39e7f60c5a | |||
| 57d1e42eca | |||
| cd45164e40 | |||
| 0ed583a7fe | |||
| 751c869435 | |||
| 4cfeadf0be | |||
| 402baf3bde | |||
| d199130b43 | |||
| 758c1044b5 | |||
| 6e8952c8a0 | |||
| bb38ad0766 | |||
| 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 |
22
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
22
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -1,6 +1,6 @@
|
||||
name: Bug report
|
||||
description: If you find a bug in Deskflow, please let us know so we can fix it.
|
||||
labels: ["bug", "triage", "unanswered"]
|
||||
type: "Triage [bug]"
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
@ -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'
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
2
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@ -1,6 +1,6 @@
|
||||
name: Feature request
|
||||
description: Had an idea how to improve Deskflow? Share it with us.
|
||||
labels: ["enhancement", "triage", "unanswered"]
|
||||
type: "Triage [feature]"
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
|
||||
65
.github/actions/install-dependencies/action.yml
vendored
65
.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:
|
||||
@ -23,41 +27,37 @@ runs:
|
||||
|
||||
steps:
|
||||
- name: Install Depends
|
||||
if: ${{ runner.os != 'Windows' }}
|
||||
run: |
|
||||
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||
echo "Window not supported yet"
|
||||
elif [ "$RUNNER_OS" == "macOS" ]; then
|
||||
brew install cmake googletest ninja openssl --quiet
|
||||
if [ "$RUNNER_OS" == "macOS" ]; then
|
||||
brew install googletest openssl --quiet
|
||||
elif [ "$RUNNER_OS" == "Linux" ]; then
|
||||
if [ ${{inputs.like}} == "debian" ]; then
|
||||
apt update -qqq > /dev/null
|
||||
apt install -qqq cmake build-essential ninja-build \
|
||||
xorg-dev libx11-dev libxtst-dev libssl-dev \
|
||||
libglib2.0-dev libgdk-pixbuf-2.0-dev libnotify-dev \
|
||||
libxkbfile-dev qt6-base-dev qt6-tools-dev \
|
||||
libgtk-3-dev libgtest-dev libgmock-dev libpugixml-dev \
|
||||
libei-dev libportal-dev libtomlplusplus-dev libcli11-dev -y >/dev/null
|
||||
libglib2.0-dev libxkbfile-dev qt6-base-dev qt6-tools-dev \
|
||||
libgtk-3-dev libgtest-dev libgmock-dev \
|
||||
libei-dev libportal-dev libtomlplusplus-dev libcli11-dev \
|
||||
help2man -y >/dev/null
|
||||
elif [ ${{inputs.like}} == "fedora" ]; then
|
||||
dnf install -y cmake make ninja-build gcc-c++ \
|
||||
rpm-build openssl-devel glib2-devel \
|
||||
gdk-pixbuf2-devel libXtst-devel libnotify-devel \
|
||||
libxkbfile-devel qt6-qtbase-devel qt6-qttools-devel \
|
||||
gtk3-devel gtest-devel gmock-devel pugixml-devel \
|
||||
libXtst-devel libxkbfile-devel qt6-qtbase-devel qt6-qttools-devel \
|
||||
gtk3-devel gtest-devel gmock-devel \
|
||||
libei-devel libportal-devel tomlplusplus-devel \
|
||||
cli11-devel
|
||||
cli11-devel help2man
|
||||
elif [ ${{inputs.like}} == "suse" ]; then
|
||||
zypper refresh
|
||||
zypper install -y --force-resolution \
|
||||
cmake make ninja gcc-c++ rpm-build libopenssl-devel \
|
||||
glib2-devel gdk-pixbuf-devel libXtst-devel libnotify-devel \
|
||||
libxkbfile-devel qt6-base-devel qt6-tools-devel gtk3-devel \
|
||||
googletest-devel googlemock-devel pugixml-devel libei-devel \
|
||||
libportal-devel tomlplusplus-devel cli11-devel
|
||||
glib2-devel libXtst-devel libxkbfile-devel qt6-base-devel qt6-tools-devel gtk3-devel \
|
||||
googletest-devel googlemock-devel libei-devel \
|
||||
libportal-devel tomlplusplus-devel cli11-devel help2man
|
||||
elif [ ${{ inputs.like }} == "arch" ]; then
|
||||
pacman -Syu --noconfirm base-devel cmake ninja \
|
||||
gcc openssl glib2 gdk-pixbuf2 libxtst libnotify \
|
||||
libxkbfile gtest pugixml libei libportal \
|
||||
qt6-base qt6-tools gtk3 tomlplusplus cli11
|
||||
gcc openssl glib2 libxtst libxkbfile gtest libei libportal \
|
||||
qt6-base qt6-tools qt6-svg gtk3 tomlplusplus cli11 help2man
|
||||
else
|
||||
echo "Unknown like"
|
||||
fi
|
||||
@ -67,30 +67,25 @@ runs:
|
||||
shell: bash
|
||||
|
||||
- name: Install Qt
|
||||
if: ${{runner.os == 'macOS' }}
|
||||
if: ${{runner.os != 'Linux' }}
|
||||
uses: jurplel/install-qt-action@v4
|
||||
env:
|
||||
AQT_CONFIG: ${{ github.workspace }}/.github/actions/install-dependencies/aqt.ini
|
||||
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}}
|
||||
|
||||
# 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
|
||||
# downloads directly from the `ninja-build` GitHub project releases.
|
||||
- name: Install Ninja
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
uses: seanmiddleditch/gha-setup-ninja@master
|
||||
cache-key-prefix: ${{matrix.target.os}}-${{inputs.qt-version}}
|
||||
|
||||
- name: Build and cache vcpkg
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
id: vcpkg
|
||||
uses: johnwason/vcpkg-action@v6
|
||||
uses: sithlord48/vcpkg-action@v7
|
||||
with:
|
||||
manifest-dir: ${{ github.workspace }}
|
||||
pkgs: gtest openssl
|
||||
extra-args: --classic
|
||||
triplet: x64-windows-release
|
||||
token: ${{ github.token }}
|
||||
github-binarycache: true
|
||||
|
||||
- name: Install Wix
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
|
||||
14
.github/actions/install-dependencies/aqt.ini
vendored
Normal file
14
.github/actions/install-dependencies/aqt.ini
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
[aqt]
|
||||
# Using this mirror instead of download.qt.io because of timeouts in CI
|
||||
baseurl: https://qt.mirror.constant.com
|
||||
|
||||
[requests]
|
||||
hash_algorithm: sha1
|
||||
|
||||
[mirrors]
|
||||
trusted_mirrors:
|
||||
https://qt.mirror.constant.com
|
||||
fallbacks:
|
||||
https://qt.mirror.constant.com
|
||||
https://mirrors.ocf.berkeley.edu
|
||||
https://download.qt.io
|
||||
2
.github/actions/lint-check/action.yml
vendored
2
.github/actions/lint-check/action.yml
vendored
@ -5,7 +5,7 @@ runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install Dependencies
|
||||
run: pipx install --global clang_format
|
||||
run: pipx install --global clang-format==20.1.0
|
||||
shell: bash
|
||||
|
||||
- name: Run format command
|
||||
|
||||
20
.github/actions/run-tests/action.yml
vendored
20
.github/actions/run-tests/action.yml
vendored
@ -15,12 +15,12 @@ runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- name: Unit tests
|
||||
- name: Unit Tests
|
||||
id: unittests
|
||||
env:
|
||||
QT_QPA_PLATFORM: offscreen
|
||||
run: |
|
||||
./${{ inputs.bin-dir }}/unittests
|
||||
ctest --test-dir "build/src/unittests" --output-on-failure
|
||||
result=$?
|
||||
|
||||
if [ $result -ne 0 ]; then
|
||||
@ -29,16 +29,16 @@ runs:
|
||||
shell: bash
|
||||
continue-on-error: true
|
||||
|
||||
- name: Integration tests
|
||||
id: integtests
|
||||
- name: Legacy Tests
|
||||
id: legacytests
|
||||
env:
|
||||
QT_QPA_PLATFORM: offscreen
|
||||
run: |
|
||||
./${{ inputs.bin-dir }}/integtests
|
||||
./${{ inputs.bin-dir }}/legacytests
|
||||
result=$?
|
||||
|
||||
if [ $result -ne 0 ]; then
|
||||
echo "Integration tests failed with code: $result" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Legacy tests failed with code: $result" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
shell: bash
|
||||
continue-on-error: true
|
||||
@ -49,11 +49,11 @@ runs:
|
||||
pass="✅ Pass"
|
||||
fail="❌ Fail"
|
||||
unittests_outcome="${{ steps.unittests.outcome }}"
|
||||
integtests_outcome="${{ steps.integtests.outcome }}"
|
||||
legacytests_outcome="${{ steps.legacytests.outcome }}"
|
||||
unittests=$( [ "$unittests_outcome" = "success" ] && echo $pass || echo $fail )
|
||||
integtests=$( [ "$integtests_outcome" = "success" ] && echo $pass || echo $fail )
|
||||
legacytests=$( [ "$legacytests_outcome" = "success" ] && echo $pass || echo $fail )
|
||||
echo "unittests=$unittests" >> $GITHUB_OUTPUT
|
||||
echo "integtests=$integtests" >> $GITHUB_OUTPUT
|
||||
echo "legacytests=$legacytests" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- name: Summary row
|
||||
@ -64,7 +64,7 @@ runs:
|
||||
row=""
|
||||
row+="| ${{ inputs.job }} "
|
||||
row+="| ${{ steps.results.outputs.unittests }} "
|
||||
row+="| ${{ steps.results.outputs.integtests }} |"
|
||||
row+="| ${{ steps.results.outputs.legacytests }} "
|
||||
echo "$row" > $file
|
||||
|
||||
echo "file=$file" > $GITHUB_OUTPUT
|
||||
|
||||
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
|
||||
|
||||
135
.github/workflows/continuous-integration.yml
vendored
135
.github/workflows/continuous-integration.yml
vendored
@ -28,7 +28,7 @@ env:
|
||||
GIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
PACKAGE_PREFIX: "deskflow"
|
||||
PACKAGE_PATH: ./dist
|
||||
CMAKE_CONFIGURE: "cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=ON"
|
||||
CMAKE_CONFIGURE: "cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DSKIP_BUILD_TESTS=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON"
|
||||
|
||||
jobs:
|
||||
# Always run this job, even if not on PR, since other jobs need it.
|
||||
@ -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,21 @@ 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\""
|
||||
config-args: "-DCMAKE_OSX_ARCHITECTURES=\"arm64\" -DCMAKE_OSX_SYSROOT=/Applications/Xcode_15.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
|
||||
qt-install-dir: "/Users/runner"
|
||||
|
||||
- name: "macos-13-x64"
|
||||
runs-on: macos-13
|
||||
timeout: 20
|
||||
config-args: "-DCMAKE_OSX_ARCHITECTURES=\"x86_64\""
|
||||
config-args: "-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" -DCMAKE_OSX_SYSROOT=/Applications/Xcode_15.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
|
||||
qt-install-dir: "/Users/runner"
|
||||
|
||||
- name: "debian-13-x86_64"
|
||||
runs-on: ubuntu-latest
|
||||
@ -141,6 +154,27 @@ 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-42-x86_64"
|
||||
runs-on: ubuntu-latest
|
||||
container: fedora:42
|
||||
like: "fedora"
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "fedora-42-arm64"
|
||||
runs-on: ubuntu-24.04-arm
|
||||
container: fedora:42
|
||||
like: "fedora"
|
||||
timeout: 20
|
||||
config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
|
||||
- name: "fedora-41-x86_64"
|
||||
runs-on: ubuntu-latest
|
||||
container: fedora:41
|
||||
@ -148,6 +182,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 +196,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 +210,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 +224,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 +259,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 +271,8 @@ jobs:
|
||||
id: get-deps
|
||||
uses: ./.github/actions/install-dependencies
|
||||
with:
|
||||
mac-qt-version: 6.7.2
|
||||
qt-version: 6.9.0
|
||||
qt-install-dir: ${{matrix.target.qt-install-dir}}
|
||||
like: ${{ matrix.target.like }}
|
||||
|
||||
- name: Get version
|
||||
@ -258,49 +328,68 @@ 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' }}
|
||||
uses: vmactions/freebsd-vm@v1
|
||||
with:
|
||||
usesh: true
|
||||
run: |
|
||||
./scripts/install_deps.sh
|
||||
pkg install -y cmake ninja gmake gcc12 openssl glib \
|
||||
libX11 libXtst libxkbfile qt6-base qt6-tools gtk3 googletest \
|
||||
tomlplusplus cli11 pkgconf libei libportal
|
||||
${{env.CMAKE_CONFIGURE}} -G Ninja
|
||||
cmake --build build -j16
|
||||
|
||||
# Integration tests are flakey by nature, make them optional.
|
||||
export QT_QPA_PLATFORM=offscreen
|
||||
./build/bin/unittests
|
||||
./build/bin/integtests || true
|
||||
./build/bin/unittests || 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: flatpak/flatpak-github-actions/flatpak-builder@v6
|
||||
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 +399,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 +444,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
|
||||
|
||||
21
.github/workflows/sonarcloud-analysis.yml
vendored
21
.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
|
||||
@ -44,28 +44,27 @@ jobs:
|
||||
-G "Ninja" \
|
||||
-DCMAKE_BUILD_TYPE="Debug" \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-DSKIP_BUILD_TESTS=ON \
|
||||
-DENABLE_COVERAGE=ON
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
build-wrapper-linux-x86-64 --out-dir bw-output cmake --build build -j${CPU_CORE_COUNT}
|
||||
|
||||
- name: Unit tests coverage
|
||||
- name: Test coverage
|
||||
shell: bash
|
||||
env:
|
||||
QT_QPA_PLATFORM: offscreen
|
||||
run: cmake --build build --target coverage-unittests
|
||||
|
||||
- name: Integration tests coverage
|
||||
env:
|
||||
QT_QPA_PLATFORM: offscreen
|
||||
run: cmake --build build --target coverage-integtests
|
||||
run: |
|
||||
tests=(`cmake --build build --target help | grep -o "^coverage-[^:]*"`)
|
||||
for i in "${tests[@]}"; do
|
||||
cmake --build build --target "$i"
|
||||
done
|
||||
|
||||
- name: Get coverage report paths
|
||||
id: coverage-paths
|
||||
run: |
|
||||
unittests=$(find build -name coverage-unittests.xml)
|
||||
integtests=$(find build -name coverage-integtests.xml)
|
||||
paths="${unittests}${integtests:+,$integtests}"
|
||||
paths=$(ls -w 0 -m build/coverage-*.xml | sed 's/ //g')
|
||||
if [ -z "$paths" ]; then
|
||||
echo "Error: No coverage files found"
|
||||
exit 1
|
||||
|
||||
21
.github/workflows/valgrind-analysis.yml
vendored
21
.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
|
||||
@ -31,16 +31,10 @@ jobs:
|
||||
run: cmake --build build -j8
|
||||
|
||||
- name: Valgrind unit tests
|
||||
id: unittests
|
||||
id: legacytests
|
||||
uses: ./.github/actions/run-valgrind
|
||||
with:
|
||||
executable: ./build/bin/unittests
|
||||
|
||||
- name: Valgrind integration tests
|
||||
id: integtests
|
||||
uses: ./.github/actions/run-valgrind
|
||||
with:
|
||||
executable: ./build/bin/integtests
|
||||
executable: ./build/bin/legacytests
|
||||
|
||||
- name: Set job summary
|
||||
run: |
|
||||
@ -48,14 +42,9 @@ jobs:
|
||||
message=$(cat <<EOF
|
||||
## Valgrind summary
|
||||
|
||||
### Unit tests
|
||||
### legacytests Unit tests
|
||||
$backticks
|
||||
${{ steps.unittests.outputs.summary }}
|
||||
$backticks
|
||||
|
||||
### Integration tests
|
||||
$backticks
|
||||
${{ steps.integtests.outputs.summary }}
|
||||
${{ steps.legacytests.outputs.summary }}
|
||||
$backticks
|
||||
EOF
|
||||
)
|
||||
|
||||
149
CMakeLists.txt
149
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_MINOR 22)
|
||||
set(DESKFLOW_VERSION_PATCH 0)
|
||||
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}
|
||||
DESCRIPTION "Mouse and keyboard sharing utility"
|
||||
VERSION "${DESKFLOW_VERSION_MAJOR}.${DESKFLOW_VERSION_MINOR}.${DESKFLOW_VERSION_PATCH}.${DESKFLOW_VERSION_TWEAK}"
|
||||
DESCRIPTION "Keyboard and mouse 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
|
||||
@ -96,6 +95,38 @@ set(REQUIRED_LIBEI_VERSION 1.3)
|
||||
set(REQUIRED_LIBPORTAL_VERSION 0.8)
|
||||
set(REQUIRED_QT_VERSION 6.7.0)
|
||||
|
||||
if (WIN32)
|
||||
# VSCMD_ARG_TGT_ARCH is set on CI
|
||||
if ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "")
|
||||
# NOT on CI
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "[Aa][Rr][Mm]64")
|
||||
set(BUILD_ARCHITECTURE arm64)
|
||||
else()
|
||||
set(BUILD_ARCHITECTURE x64)
|
||||
endif()
|
||||
else()
|
||||
set (BUILD_ARCHITECTURE $ENV{VSCMD_ARG_TGT_ARCH})
|
||||
endif()
|
||||
else()
|
||||
set (BUILD_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
# On Windows, require that the same MSVC runtime is used as on the host.
|
||||
# Mitigates things like access violations caused by accidental ABI-compatibility breakage.
|
||||
set(REQUIRED_MSVC_RUNTIME_MAJOR 14)
|
||||
cmake_host_system_information(
|
||||
RESULT REQUIRED_MSVC_RUNTIME_MINOR
|
||||
QUERY WINDOWS_REGISTRY
|
||||
"HKLM/SOFTWARE/Microsoft/VisualStudio/${REQUIRED_MSVC_RUNTIME_MAJOR}.0/VC/Runtimes/${BUILD_ARCHITECTURE}"
|
||||
VALUE "Minor")
|
||||
if (REQUIRED_MSVC_RUNTIME_MINOR)
|
||||
message(STATUS "MSVC runtime: ${REQUIRED_MSVC_RUNTIME_MAJOR}.${REQUIRED_MSVC_RUNTIME_MINOR}")
|
||||
else()
|
||||
message(FATAL_ERROR "MSVC runtime registry entry not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Control debug item visibility
|
||||
# When not set logging is forced to DEBUG and show code locations
|
||||
# Also exposes a test menu
|
||||
@ -124,18 +155,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)
|
||||
|
||||
13
CONTRIBUTING.md
Normal file
13
CONTRIBUTING.md
Normal file
@ -0,0 +1,13 @@
|
||||
# Contributing to Deskflow
|
||||
|
||||
Thanks for your interest in contributing to Deskflow! We welcome all kinds of contributions — bug reports, feature suggestions, documentation improvements, and code.
|
||||
|
||||
## Read the Full Guidelines
|
||||
|
||||
To keep this repository clean and contribution-friendly, we've outlined our full contributing guidelines on the Deskflow Wiki:
|
||||
|
||||
👉 [How to Contribute to Deskflow](https://github.com/deskflow/deskflow/wiki/Contributing)
|
||||
|
||||
Please take a moment to read through the page before opening an issue or submitting a pull request.
|
||||
|
||||
Thanks again for helping make Deskflow better!
|
||||
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.
|
||||
101
README.md
101
README.md
@ -1,30 +1,26 @@
|
||||

|
||||
|
||||
> [!NOTE]
|
||||
> **Deskflow** is the official upstream project for [Synergy](https://symless.com/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)
|
||||
|
||||
**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,
|
||||
and work seamlessly between them.
|
||||
It's like a software KVM (but without the video).
|
||||
TLS encryption is enabled by default. Wayland is supported. Clipboard sharing is supported.
|
||||
|
||||
[](https://github.com/deskflow/deskflow/releases/latest) [](https://github.com/deskflow/deskflow/releases/continuous) [](https://flathub.org/apps/org.deskflow.deskflow)
|
||||
## Download
|
||||
|
||||
To use Deskflow you can use one of our [packages](https://github.com/deskflow/deskflow/releases), install `deskflow` (if available in your package repository), or [build it](#build-quick-start) yourself from source.
|
||||
[](https://github.com/deskflow/deskflow/releases/latest) [](https://github.com/deskflow/deskflow/releases/continuous) [](https://flathub.org/apps/org.deskflow.deskflow)
|
||||
|
||||
> [!TIP]
|
||||
> For macOS users, the easiest way to install and stay up to date is to use [Homebrew](https://brew.sh) with our [homebrew-tap](https://github.com/deskflow/homebrew-tap).
|
||||
|
||||
To use Deskflow, download one of our [packages](https://github.com/deskflow/deskflow/releases), install `deskflow` (from your package repository), or [build it](https://github.com/deskflow/deskflow/wiki/Building) from source.
|
||||
|
||||
## Stats
|
||||
|
||||
[](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)
|
||||
@ -35,27 +31,15 @@ To use Deskflow you can use one of our [packages](https://github.com/deskflow/de
|
||||
[](https://github.com/deskflow/deskflow/actions/workflows/codeql-analysis.yml)
|
||||
[](https://github.com/deskflow/deskflow/actions/workflows/sonarcloud-analysis.yml)
|
||||
|
||||
## Project Values
|
||||
## Contribute
|
||||
|
||||
- Motivated by the community interests (not business-driven)
|
||||
- Privacy by default (e.g. update check is off by default)
|
||||
- Leading edge releases (we don't focus on supporting older systems)
|
||||
- Decisions are discussed and documented publicly with majority rule
|
||||
- Have fun; we don't need to worry about impressing anyone
|
||||
[](https://github.com/deskflow/deskflow/labels/good%20first%20issue) [](https://github.com/deskflow/deskflow/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22%F0%9F%92%8E%20bounty%22) [](https://github.com/deskflow/deskflow/issues?q=label%3A%22%F0%9F%92%B0%20rewarded%22%20sort%3Aupdated-desc)
|
||||
|
||||
## Ways to get involved
|
||||
There are many ways to contribute to the Deskflow project.
|
||||
|
||||
> [!TIP]
|
||||
> Join us! Real-time discussion on Matrix: [`#deskflow:matrix.org`](https://matrix.to/#/#deskflow:matrix.org)
|
||||
>
|
||||
> Alternatively, we have [other ways](https://github.com/deskflow/deskflow/wiki/Chat-with-us) to communicate.
|
||||
>
|
||||
Here are a few ways to join in with the project and get involved:
|
||||
* Build the latest `master` version (see below) and [report a bug](https://github.com/deskflow/deskflow/issues)
|
||||
* [Submit a PR](https://github.com/deskflow/deskflow/wiki/Contributing) (pull request) with a bug fix or improvement
|
||||
* [Let us know](https://github.com/deskflow/deskflow/issues) if you have an idea for an improvement
|
||||
We're a friendly, active, and welcoming community focused on building a great app.
|
||||
|
||||
## Build Quick Start
|
||||
Read our [Contributing](https://github.com/deskflow/deskflow/wiki/Contributing) page to get started.
|
||||
|
||||
For instructions on building Deskflow, use the wiki page: [Building](https://github.com/deskflow/deskflow/wiki/Building)
|
||||
|
||||
@ -63,12 +47,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.
|
||||
|
||||
> [!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.
|
||||
|
||||
@ -96,47 +85,42 @@ macOS users who download directly from releases may need to run `xattr -c /Appli
|
||||
It is recommend to install Deskflow using [Homebrew](https://brew.sh) from our [homebrew-tap](https://github.com/deskflow/homebrew-tap)
|
||||
|
||||
To add our tap, run:
|
||||
|
||||
```
|
||||
brew tap deskflow/homebrew-tap
|
||||
```
|
||||
|
||||
Then install either:
|
||||
|
||||
- Stable: `brew install deskflow`
|
||||
- Continuous: `brew install deskflow-dev`
|
||||
|
||||
|
||||
|
||||
## Collaborative Projects
|
||||
## Similar Projects
|
||||
|
||||
In the open source developer community, similar projects collaborate for the improvement of all
|
||||
mouse and keyboard sharing tools. We aim for idea sharing and interoperability.
|
||||
|
||||
* [**Lan Mouse**](https://github.com/feschber/lan-mouse) -
|
||||
- [**Lan Mouse**](https://github.com/feschber/lan-mouse) -
|
||||
Rust implementation with the goal of having native front-ends and interoperability with
|
||||
Deskflow/Synergy.
|
||||
* [**Input Leap**](https://github.com/input-leap/input-leap) -
|
||||
- [**Input Leap**](https://github.com/input-leap/input-leap) -
|
||||
Deskflow/Synergy-derivative with the goal of continuing what Barrier started, after Barrier
|
||||
became a dead fork.
|
||||
* [**Synergy**](https://github.com/deskflow/deskflow/wiki/Relationship-with-Synergy) -
|
||||
Downstream commercial fork and Deskflow sponsor, geared toward adapting to customer
|
||||
needs, offering business and enterprise licensing.
|
||||
- [**Synergy**](https://symless.com/synergy) -
|
||||
Downstream commercial fork. Synergy sponsors Deskflow with financial support and contributes code ([learn more](https://github.com/deskflow/deskflow/wiki/Relationship-with-Synergy)).
|
||||
|
||||
## FAQ
|
||||
|
||||
### What is the relationship with Synergy?
|
||||
|
||||
[](https://github.com/deskflow/deskflow/wiki/Relationship-with-Synergy)
|
||||
|
||||
Synergy sponsors the Deskflow project by contributing code and providing financial support while maintaining its customer-oriented code downstream.
|
||||
|
||||
Learn more: [Relationship with Synergy](https://github.com/deskflow/deskflow/wiki/Relationship-with-Synergy)
|
||||
|
||||
### Is Deskflow compatible with Synergy, Input Leap, or Barrier?
|
||||
|
||||
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.
|
||||
- Deskflow will _just work_ with Input Leap and Barrier (server or client).
|
||||
- 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?
|
||||
|
||||
@ -145,25 +129,27 @@ We would love to see compatibility with Lan Mouse. This may be quite an effort a
|
||||
### If I want to solve issues in Deskflow do I need to contribute to a fork?
|
||||
|
||||
We welcome PRs (pull requests) from the community. If you'd like to make a change, please feel
|
||||
free to [start a discussion](https://github.com/deskflow/deskflow/discussions) or
|
||||
free to [start a discussion](https://github.com/deskflow/deskflow/discussions) or
|
||||
[open a PR](https://github.com/deskflow/deskflow/wiki/Contributing).
|
||||
|
||||
### Is clipboard sharing supported?
|
||||
|
||||
Absolutely. The clipboard-sharing feature is a cornerstone feature of the product and we are
|
||||
Absolutely. The clipboard-sharing feature is a cornerstone feature of the product and we are
|
||||
committed to maintaining and improving that feature.
|
||||
|
||||
### Is Wayland for Linux supported?
|
||||
|
||||
Yes! Wayland (the Linux display server protocol aimed to become the successor of the X Window
|
||||
Yes! Wayland (the Linux display server protocol aimed to become the successor of the X Window
|
||||
System) is an important platform for us.
|
||||
The [`libei`](https://gitlab.freedesktop.org/libinput/libei) and
|
||||
[`libportal`](https://github.com/flatpak/libportal) libraries enable
|
||||
The [`libei`](https://gitlab.freedesktop.org/libinput/libei) and
|
||||
[`libportal`](https://github.com/flatpak/libportal) libraries enable
|
||||
Wayland support for Deskflow. We would like to give special thanks to Peter Hutterer,
|
||||
who is the author of `libei`, a major contributor to `libportal`, and the author of the Wayland
|
||||
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.
|
||||
@ -174,9 +160,12 @@ wiki.
|
||||
|
||||

|
||||
|
||||
|
||||
## Deskflow Contributors
|
||||
|
||||
[](https://symless.com/synergy)
|
||||
|
||||
[Synergy](https://symless.com/synergy) sponsors the Deskflow project by contributing code and providing financial support ([learn more](https://github.com/deskflow/deskflow/wiki/Relationship-with-Synergy)).
|
||||
|
||||
Deskflow is made by possible by these contributors.
|
||||
|
||||
<a href = "https://github.com/deskflow/deskflow/graphs/contributors">
|
||||
@ -185,4 +174,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 = "**/*.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/manpage.txt"
|
||||
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/lib/gui/MainWindow.ui"
|
||||
precedence = "override"
|
||||
SPDX-FileCopyrightText = "Deskflow Developers"
|
||||
SPDX-License-Identifier = "GPL-2.0-only WITH LicenseRef-OpenSSL-Exception"
|
||||
|
||||
[[annotations]]
|
||||
path = "src/lib/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,40 +20,33 @@ 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 Xml)
|
||||
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")
|
||||
include(cmake/CodeCoverage.cmake)
|
||||
append_coverage_compiler_flags()
|
||||
set(test_exclude subprojects/* build/* src/test/*)
|
||||
set(test_exclude subprojects/* build/* src/unittests/*)
|
||||
set(test_src ${PROJECT_SOURCE_DIR}/src)
|
||||
|
||||
# Apparently solves the bug in gcov where it returns negative counts and confuses gcovr.
|
||||
@ -74,15 +55,8 @@ macro(configure_libs)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-update=atomic")
|
||||
|
||||
setup_target_for_coverage_gcovr_xml(
|
||||
NAME coverage-integtests
|
||||
EXECUTABLE integtests
|
||||
BASE_DIRECTORY ${test_src}
|
||||
EXCLUDE ${test_exclude}
|
||||
)
|
||||
|
||||
setup_target_for_coverage_gcovr_xml(
|
||||
NAME coverage-unittests
|
||||
EXECUTABLE unittests
|
||||
NAME coverage-legacytests
|
||||
EXECUTABLE legacytests
|
||||
BASE_DIRECTORY ${test_src}
|
||||
EXCLUDE ${test_exclude}
|
||||
)
|
||||
@ -108,30 +82,13 @@ macro(configure_unix_libs)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
check_include_file_cxx(istream HAVE_ISTREAM)
|
||||
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)
|
||||
check_include_files(wchar.h HAVE_WCHAR_H)
|
||||
|
||||
check_function_exists(getpwuid_r HAVE_GETPWUID_R)
|
||||
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 +115,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)
|
||||
@ -190,57 +142,32 @@ macro(configure_unix_libs)
|
||||
configure_xorg_libs()
|
||||
|
||||
include(FindPkgConfig)
|
||||
|
||||
find_package(PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(LIBXKBCOMMON REQUIRED xkbcommon)
|
||||
pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0)
|
||||
pkg_check_modules(GLIB2 REQUIRED glib-2.0)
|
||||
find_library(LIBM m)
|
||||
include_directories(${LIBXKBCOMMON_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS}
|
||||
${LIBM_INCLUDE_DIRS})
|
||||
else()
|
||||
message(WARNING "pkg-config not found, skipping wayland libraries")
|
||||
endif()
|
||||
|
||||
|
||||
find_package(pugixml REQUIRED)
|
||||
|
||||
find_package(PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(lib_glib REQUIRED IMPORTED_TARGET glib-2.0)
|
||||
pkg_search_module(PC_GDKPIXBUF gdk-pixbuf-2.0)
|
||||
|
||||
include_directories(${PC_GDKPIXBUF_INCLUDE_DIRS})
|
||||
|
||||
pkg_check_modules(lib_gdkpixbuf REQUIRED IMPORTED_TARGET gdk-pixbuf-2.0)
|
||||
pkg_check_modules(lib_notify REQUIRED IMPORTED_TARGET libnotify)
|
||||
|
||||
add_definitions(-DHAVE_GDK_PIXBUF=1 -DHAVE_LIBNOTIFY=1)
|
||||
else()
|
||||
message(WARNING "pkg-config not found, skipping libnotify and gdk-pixbuf")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# 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)
|
||||
|
||||
# Unix only: For config.h, save the results based on a template (config.h.in).
|
||||
# Note that this won't work on Windows because filenames are not case sensitive,
|
||||
# and we have header files named "Config.h" (upper case 'C').
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/lib/config.h.in
|
||||
${CMAKE_BINARY_DIR}/src/lib/config.h @ONLY)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/lib/Config.h.in
|
||||
${CMAKE_BINARY_DIR}/src/lib/Config.h @ONLY)
|
||||
|
||||
add_definitions(-DSYSAPI_UNIX=1 -DHAVE_CONFIG_H)
|
||||
|
||||
@ -264,8 +191,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)
|
||||
|
||||
12
cspell.json
12
cspell.json
@ -11,9 +11,10 @@
|
||||
"codesigning",
|
||||
"Compat",
|
||||
"contribs",
|
||||
"daemonized",
|
||||
"Daun",
|
||||
"Devs",
|
||||
"Deskflow",
|
||||
"Devs",
|
||||
"distro",
|
||||
"distros",
|
||||
"dmgbuild",
|
||||
@ -24,6 +25,8 @@
|
||||
"gdrive",
|
||||
"Hadzhylov",
|
||||
"Hetu",
|
||||
"HINSTANCE",
|
||||
"HKLM",
|
||||
"hotspots",
|
||||
"Hutterer",
|
||||
"ifdef",
|
||||
@ -39,6 +42,7 @@
|
||||
"Libera",
|
||||
"libportal",
|
||||
"LLDB",
|
||||
"logonui",
|
||||
"Lysytsia",
|
||||
"macdeployqt",
|
||||
"msvc",
|
||||
@ -48,6 +52,8 @@
|
||||
"Oleksandr",
|
||||
"Olena",
|
||||
"outputdir",
|
||||
"outputter",
|
||||
"outputters",
|
||||
"pacman",
|
||||
"Petroules",
|
||||
"Pixmap",
|
||||
@ -57,8 +63,10 @@
|
||||
"Priddy",
|
||||
"psutil",
|
||||
"pyproject",
|
||||
"qobject",
|
||||
"qputenv",
|
||||
"readf",
|
||||
"Redist",
|
||||
"Regen",
|
||||
"Repology",
|
||||
"Rizzitello",
|
||||
@ -67,9 +75,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,34 +1,41 @@
|
||||
# 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'
|
||||
'openssl'
|
||||
'libx11'
|
||||
'libxi'
|
||||
'libxkbfile'
|
||||
'libxext'
|
||||
'libxtst'
|
||||
'libxinerama'
|
||||
'libxkbcommon-x11'
|
||||
'libnotify'
|
||||
'hicolor-icon-theme'
|
||||
'pugixml'
|
||||
'qt6-base'
|
||||
'qt6-tools'
|
||||
'libei'
|
||||
'libportal'
|
||||
'tomlplusplus'
|
||||
'cli11'
|
||||
gcc-libs
|
||||
glib2
|
||||
glibc
|
||||
hicolor-icon-theme
|
||||
libei
|
||||
libglvnd
|
||||
libice
|
||||
libportal
|
||||
libsm
|
||||
libx11
|
||||
libxext
|
||||
libxi
|
||||
libxinerama
|
||||
libxkbcommon
|
||||
libxkbcommon-x11
|
||||
libxkbfile
|
||||
libxrandr
|
||||
libxtst
|
||||
openssl
|
||||
qt6-base
|
||||
qt6-svg
|
||||
tomlplusplus
|
||||
)
|
||||
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()
|
||||
|
||||
@ -99,9 +100,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
if("${DISTRO_NAME}" STREQUAL "")
|
||||
set(DISTRO_NAME "linux")
|
||||
endif()
|
||||
set(OS_STRING "${DISTRO_NAME}-${CN_STRING}${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set(OS_STRING "${DISTRO_NAME}-${CN_STRING}${BUILD_ARCHITECTURE}")
|
||||
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "|.*BSD")
|
||||
message(STATUS "BSD packaging not yet supported")
|
||||
set(OS_STRING ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
|
||||
set(OS_STRING ${CMAKE_SYSTEM_NAME}-${BUILD_ARCHITECTURE})
|
||||
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"
|
||||
]
|
||||
}
|
||||
41
deploy/linux/flatpak/libportal-qt69.patch
Normal file
41
deploy/linux/flatpak/libportal-qt69.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From 796053d2eebe4532aad6bd3fd80cdf3b197806ec Mon Sep 17 00:00:00 2001
|
||||
From: Jan Grulich <jgrulich@redhat.com>
|
||||
Date: Thu, 27 Mar 2025 09:38:10 +0100
|
||||
Subject: [PATCH] qt6: fix build against Qt 6.9+
|
||||
|
||||
QGenericUnixServices was renamed to QDesktopUnixServices in Qt 6.9.
|
||||
|
||||
Upstream change: https://codereview.qt-project.org/c/qt/qtbase/+/609639
|
||||
---
|
||||
libportal/portal-qt6.cpp | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/libportal/portal-qt6.cpp b/libportal/portal-qt6.cpp
|
||||
index d38a4e30..34f0d72a 100644
|
||||
--- a/libportal/portal-qt6.cpp
|
||||
+++ b/libportal/portal-qt6.cpp
|
||||
@@ -31,8 +31,12 @@
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
#include <qpa/qplatformintegration.h>
|
||||
#include <private/qguiapplication_p.h>
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
|
||||
+#include <private/qdesktopunixservices_p.h>
|
||||
+#else
|
||||
#include <private/qgenericunixservices_p.h>
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
static gboolean
|
||||
_xdp_parent_export_qt (XdpParent *parent,
|
||||
@@ -45,7 +49,11 @@ _xdp_parent_export_qt (XdpParent *parent,
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
|
||||
+ if (const auto services = dynamic_cast<QDesktopUnixServices*>(QGuiApplicationPrivate::platformIntegration()->services()))
|
||||
+#else
|
||||
if (const auto services = dynamic_cast<QGenericUnixServices*>(QGuiApplicationPrivate::platformIntegration()->services()))
|
||||
+#endif
|
||||
{
|
||||
g_autofree char *handle = g_strdup(services->portalWindowIdentifier(w).toUtf8().constData());
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
app-id: org.deskflow.deskflow
|
||||
runtime: org.kde.Platform
|
||||
runtime-version: "6.8"
|
||||
runtime-version: "6.9"
|
||||
sdk: org.kde.Sdk
|
||||
command: deskflow
|
||||
finish-args:
|
||||
@ -23,17 +23,6 @@ cleanup:
|
||||
- /share/gir-1.0
|
||||
- /lib/girepository-1.0
|
||||
modules:
|
||||
- name: python3-attrs
|
||||
buildsystem: simple
|
||||
build-commands:
|
||||
- pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}"
|
||||
--prefix=${FLATPAK_DEST} --no-build-isolation attrs
|
||||
sources:
|
||||
- type: file
|
||||
url: https://files.pythonhosted.org/packages/e0/44/827b2a91a5816512fcaf3cc4ebc465ccd5d598c45cefa6703fcf4a79018f/attrs-23.2.0-py3-none-any.whl
|
||||
sha256: 99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1
|
||||
cleanup:
|
||||
- '*'
|
||||
- name: python3-Jinja2
|
||||
buildsystem: simple
|
||||
build-commands:
|
||||
@ -57,8 +46,8 @@ modules:
|
||||
sources:
|
||||
- type: git
|
||||
url: https://gitlab.freedesktop.org/libinput/libei
|
||||
tag: 1.3.0
|
||||
commit: 997b7c0f37faea4f8bae59613c8f27370925d5b0
|
||||
tag: 1.4.1
|
||||
commit: 9e0413cbc7d3ae6656266890425f152589ddf74d
|
||||
- name: libportal
|
||||
buildsystem: meson
|
||||
config-opts:
|
||||
@ -70,15 +59,10 @@ modules:
|
||||
sources:
|
||||
- type: git
|
||||
url: https://github.com/flatpak/libportal.git
|
||||
tag: 0.8.1
|
||||
commit: 26c15008cbe579f57f89468384f8efc033f25f6f
|
||||
- name: puixml
|
||||
buildsystem: cmake-ninja
|
||||
sources:
|
||||
- type: git
|
||||
url: https://github.com/zeux/pugixml
|
||||
tag: v1.14
|
||||
commit: db78afc2b7d8f043b4bc6b185635d949ea2ed2a8
|
||||
tag: 0.9.1
|
||||
commit: 8f5dc8d192f6e31dafe69e35219e3b707bde71ce
|
||||
- type: patch
|
||||
path: libportal-qt69.patch
|
||||
- name: cli11
|
||||
buildsystem: cmake-ninja
|
||||
config-opts:
|
||||
@ -86,8 +70,8 @@ modules:
|
||||
sources:
|
||||
- type: git
|
||||
url: https://github.com/CLIUtils/CLI11
|
||||
tag: v2.4.2
|
||||
commit: 6c7b07a878ad834957b98d0f9ce1dbe0cb204fc9
|
||||
tag: v2.5.0
|
||||
commit: 4160d259d961cd393fd8d67590a8c7d210207348
|
||||
- name: tomlplusplus
|
||||
buildsystem: cmake-ninja
|
||||
sources:
|
||||
|
||||
@ -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,117 @@
|
||||
</branding>
|
||||
<content_rating type="oars-1.0" />
|
||||
<releases>
|
||||
<release version="1.22.0" date="2025-05-28" urgency="high">
|
||||
<description>
|
||||
<p>This stable release fixes a issues found in the previous version. For the full changelog see the release page.</p>
|
||||
<ul>
|
||||
<li>Remove: Broken drag and drop file transfer support</li>
|
||||
<li>Remove: DESKFLOW_RESET_ALL and --no-reset. reset settings is now done by passing the --reset option instead</li>
|
||||
<li>Continue migration to Qt by using more Qt classes in more places</li>
|
||||
<li>Retire SHA1 generation and use SHA256 always to compare</li>
|
||||
<li>Add missing accelerators for gui controls</li>
|
||||
<li>unittests binary is now legacytests</li>
|
||||
<li>integtests have been remove and replaced with Qt based tests run during build</li>
|
||||
<li>Fix: Potential XDG-Portal release issue</li>
|
||||
<li>Fix: Issue where the first start dialog could hang in the background</li>
|
||||
<li>Fix: Edge cases that could cause incorrect settings causing client / server process to crash</li>
|
||||
<li>Fix: Default server config file is Deskflow-server.conf</li>
|
||||
<li>Backport: Event Types from downstream</li>
|
||||
<li>Backport: Cleaner error handling from downstream</li>
|
||||
<li>Improve Windows Daemon</li>
|
||||
<li>Better detection of arm on windows, in build and installer</li>
|
||||
<li>Chore: Clean up sonar scan code smells</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.22.0</url>
|
||||
</release>/
|
||||
<release version="1.21.2" date="2025-04-07" urgency="high">
|
||||
<description>
|
||||
<p>This stable release fixes a few critical bugs in 1.21.1. For the full changelog see the release page.</p>
|
||||
<ul>
|
||||
<li>Fix: Crash with Qt 6.9</li>
|
||||
<li>Fix: Windows settings in wrong locations</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.21.2</url>
|
||||
</release>
|
||||
<release version="1.21.1" date="2025-03-31" urgency="high">
|
||||
<description>
|
||||
<p>This stable release fixes a few critical bugs in 1.21.0. For the full changelog see the release page.</p>
|
||||
<ul>
|
||||
<li>Fix: Flatpak can't save settings'</li>
|
||||
<li>Fix: Crash on localfingerprint dialog</li>
|
||||
<li>Fix: Check for updates settings reading from wrong value</li>
|
||||
<li>Fix: Windows settings saving blocked for non admin users </li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.21.1</url>
|
||||
</release>
|
||||
<release version="1.21.0" date="2025-03-27" urgency="high">
|
||||
<description>
|
||||
<p>This stable release removes some dependencies, additionally fixes several bugs. For the full changelog see the release page.</p>
|
||||
<ul>
|
||||
<li>Cleanup unused classes</li>
|
||||
<li>New Settings class</li>
|
||||
<li>Remove need for pugixml</li>
|
||||
<li>Remove need for libNotify</li>
|
||||
<li>Remove need for gio</li>
|
||||
<li>Remove need for gitkpixbuf</li>
|
||||
<li>Fix issues with windows installer when msvc is missing</li>
|
||||
</ul>
|
||||
</description>
|
||||
<url>https://github.com/deskflow/deskflow/releases/tag/v1.21.0</url>
|
||||
</release>
|
||||
<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 +167,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 +221,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 +338,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 +388,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})
|
||||
|
||||
set(OS_STRING "macos-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set(CMAKE_INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks")
|
||||
install(CODE "execute_process(COMMAND
|
||||
${DEPLOYQT}
|
||||
\"\${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_PROPER_NAME}.app\"
|
||||
-timestamp -codesign=-
|
||||
)")
|
||||
|
||||
set(OS_STRING "macos-${BUILD_ARCHITECTURE}")
|
||||
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.
6
deploy/windows/cpack-options.cmake.in
Normal file
6
deploy/windows/cpack-options.cmake.in
Normal file
@ -0,0 +1,6 @@
|
||||
#SPDX-FileCopyrightText: 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
#SPDX-License-Identifier: MIT
|
||||
|
||||
if(CPACK_GENERATOR MATCHES 7Z|ZIP)
|
||||
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}-portable)
|
||||
endif()
|
||||
@ -5,21 +5,23 @@
|
||||
# calling CMAKE_CURRENT_LIST_DIR after include would return the wrong scope var
|
||||
set(MY_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
|
||||
include(InstallRequiredSystemLibraries)
|
||||
|
||||
# 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)
|
||||
set(OS_STRING "win-x64")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES ARM64)
|
||||
set(OS_STRING "win-arm64")
|
||||
else()
|
||||
set(OS_STRING "win-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif()
|
||||
configure_file(${MY_DIR}/pre-cpack.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/pre-cpack.cmake @ONLY)
|
||||
set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/pre-cpack.cmake)
|
||||
|
||||
configure_file(${MY_DIR}/cpack-options.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cpack-options.cmake @ONLY)
|
||||
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_CURRENT_BINARY_DIR}/cpack-options.cmake)
|
||||
|
||||
set(OS_STRING "win-${BUILD_ARCHITECTURE}")
|
||||
|
||||
list(APPEND CPACK_GENERATOR "7Z")
|
||||
|
||||
# If Wix4+ is installed make a package
|
||||
find_program(WIX_APP wix)
|
||||
@ -28,14 +30,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 +51,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
|
||||
@ -57,3 +58,18 @@ configure_file(
|
||||
|
||||
# This patch set ups filewall rules, the service and msm module
|
||||
set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_BINARY_DIR}/wix-patch.xml")
|
||||
|
||||
# Creates a DLL that can be used by our MSI for custom actions.
|
||||
configure_file(
|
||||
${MY_DIR}/wix-custom.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wix-custom.h @ONLY
|
||||
)
|
||||
add_library(
|
||||
wix-custom SHARED
|
||||
${MY_DIR}/wix-custom.cpp
|
||||
)
|
||||
target_include_directories(wix-custom PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set_target_properties(wix-custom PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
)
|
||||
target_link_libraries(wix-custom PRIVATE Msi)
|
||||
|
||||
19
deploy/windows/pre-cpack.cmake.in
Normal file
19
deploy/windows/pre-cpack.cmake.in
Normal file
@ -0,0 +1,19 @@
|
||||
# SPDX-FileCopyrightText: 2025 Chris Rizzitello <sithlord48@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if(CPACK_GENERATOR MATCHES 7Z|ZIP)
|
||||
string(REPLACE " " "*" _TEMP_LIST "@CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS@")
|
||||
set(${PORTABLE_LIBS} "")
|
||||
foreach(ITEM ${_TEMP_LIST})
|
||||
string(REPLACE "*" " " _ITEM ${ITEM})
|
||||
file(COPY ${_ITEM} DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY})
|
||||
endforeach()
|
||||
file(WRITE ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/settings/Deskflow.conf " ")
|
||||
file(REMOVE ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/deskflow-daemon.exe)
|
||||
file(WRITE ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/README.txt
|
||||
" Portable Deskflow: @CMAKE_PROJECT_VERSION@
|
||||
|
||||
The portable version must have the settings/Deskflow.conf file to save settings, or it will try to use the system settings location.
|
||||
The portable version does not include the daemon, so the client will not work at UAC prompts or the login screen.
|
||||
")
|
||||
endif()
|
||||
@ -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
|
||||
72
deploy/windows/wix-custom.cpp
Normal file
72
deploy/windows/wix-custom.cpp
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "wix-custom.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
|
||||
// Include after Windows.h
|
||||
#include <MsiQuery.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
||||
namespace {
|
||||
// Warning: DLL will crash with error code 1603 if we exceed this.
|
||||
const auto kLogLineMax = 1024;
|
||||
|
||||
// Prefixes log messages with the app name so they're easier to find/filter.
|
||||
const std::string kLogPrefix = std::string(kAppId) + " installer: ";
|
||||
|
||||
// Note: Resized to log line max when used.
|
||||
static std::string s_logMessageBuffer; // NOSONAR - Must be mutable.
|
||||
} // namespace
|
||||
|
||||
// This log output can be viewed by using the DebugView program.
|
||||
#define MS_LOG_DEBUG(message, ...) \
|
||||
s_logMessageBuffer.resize(kLogLineMax); \
|
||||
sprintf(s_logMessageBuffer.data(), message, __VA_ARGS__); \
|
||||
OutputDebugStringA((kLogPrefix + s_logMessageBuffer + "\n").c_str())
|
||||
|
||||
extern "C" __declspec(dllexport) UINT __stdcall CheckVCRedist(MSIHANDLE hInstall)
|
||||
{
|
||||
const auto kKeyName = TEXT(kRegKey);
|
||||
const auto kValueName = TEXT("Minor");
|
||||
const auto kProperty = "VC_REDIST_VERSION_OK";
|
||||
|
||||
MS_LOG_DEBUG("checking for msvc redist v%d.%d", kWindowsRuntimeMajor, kWindowsRuntimeMinor);
|
||||
|
||||
HKEY hKey;
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, kKeyName, 0, KEY_READ, &hKey) != ERROR_SUCCESS) {
|
||||
MS_LOG_DEBUG("msvc redist registry key not found");
|
||||
return ERROR_FUNCTION_FAILED;
|
||||
}
|
||||
|
||||
MS_LOG_DEBUG("msvc redist registry key found, querying minor version");
|
||||
|
||||
DWORD minorVersion = 0;
|
||||
DWORD size = sizeof(DWORD);
|
||||
RegQueryValueEx(hKey, kValueName, nullptr, nullptr, (LPBYTE)&minorVersion, &size);
|
||||
RegCloseKey(hKey);
|
||||
|
||||
MS_LOG_DEBUG("msvc redist minor version: %lu", minorVersion);
|
||||
|
||||
if (minorVersion < kWindowsRuntimeMinor) {
|
||||
MS_LOG_DEBUG("msvc redist minor version %lu too low, expected >= %d", minorVersion, kWindowsRuntimeMinor);
|
||||
// Returning success allows the installer will show a friendly error message.
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
MS_LOG_DEBUG("msvc redist version ok, setting: %s", kProperty);
|
||||
if (MsiSetProperty(hInstall, kProperty, "ok") != ERROR_SUCCESS) {
|
||||
MS_LOG_DEBUG("failed to set property: %s", kProperty);
|
||||
return ERROR_FUNCTION_FAILED;
|
||||
}
|
||||
|
||||
MS_LOG_DEBUG("msvc redist version check successful");
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
15
deploy/windows/wix-custom.h.in
Normal file
15
deploy/windows/wix-custom.h.in
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2025 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
const auto kAppId = "@CMAKE_PROJECT_NAME@";
|
||||
const auto kRegKey = "SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\@BUILD_ARCHITECTURE@";
|
||||
|
||||
// clang-format off
|
||||
const auto kWindowsRuntimeMajor = @REQUIRED_MSVC_RUNTIME_MAJOR@;
|
||||
const auto kWindowsRuntimeMinor = @REQUIRED_MSVC_RUNTIME_MINOR@;
|
||||
// clang-format on
|
||||
@ -1,26 +1,78 @@
|
||||
<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>
|
||||
<CustomAction Id="Run_Deskflow" ExeCommand="Deskflow" FileRef="CM_FP_deskflow.exe" Return="asyncNoWait"/>
|
||||
<Property Id="VC_REDIST_INSTALLED">
|
||||
<RegistrySearch
|
||||
Id="FindVCRedist"
|
||||
Root="HKLM"
|
||||
Key="SOFTWARE\Microsoft\VisualStudio\@REQUIRED_MSVC_RUNTIME_MAJOR@.0\VC\Runtimes\@BUILD_ARCHITECTURE@"
|
||||
Name="Installed"
|
||||
Type="raw" />
|
||||
</Property>
|
||||
|
||||
<Binary Id="CustomDLL" SourceFile="@CMAKE_CURRENT_BINARY_DIR@/wix-custom.dll" />
|
||||
|
||||
<UI>
|
||||
<Publish Dialog="ExitDialog"
|
||||
Control="Finish"
|
||||
Event="DoAction"
|
||||
Value="RunDeskflow"
|
||||
Condition= "NOT Installed" />
|
||||
</UI>
|
||||
<CustomAction
|
||||
Id="CheckVCRedist"
|
||||
BinaryRef="CustomDLL"
|
||||
DllEntry="CheckVCRedist"
|
||||
Execute="immediate" />
|
||||
|
||||
<CustomAction
|
||||
Id="ShowVCRedistError"
|
||||
Error="Microsoft Visual C++ Redistributable v@REQUIRED_MSVC_RUNTIME_MAJOR@.@REQUIRED_MSVC_RUNTIME_MINOR@ or later is required. Please download and install the latest version and then restart the installation. See our documentation for instructions." />
|
||||
|
||||
<CustomAction
|
||||
Id="RunDeskflow"
|
||||
ExeCommand="[INSTALL_ROOT]deskflow.exe"
|
||||
Directory="INSTALL_ROOT"
|
||||
Execute="immediate"
|
||||
Impersonate="yes"
|
||||
Return="asyncNoWait" />
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action="Run_Deskflow" OnExit="success" Condition="NOT Installed"/>
|
||||
<Custom
|
||||
Action="CheckVCRedist"
|
||||
Before="InstallInitialize"
|
||||
Condition="NOT Installed AND VC_REDIST_INSTALLED" />
|
||||
<Custom
|
||||
Action="ShowVCRedistError"
|
||||
Before="InstallInitialize"
|
||||
Condition="NOT Installed AND (NOT VC_REDIST_INSTALLED OR NOT VC_REDIST_VERSION_OK)" />
|
||||
</InstallExecuteSequence>
|
||||
</CPackWiXFragment>
|
||||
</CPackWiXPatch>
|
||||
|
||||
@ -1,3 +1,36 @@
|
||||
# GUI Config
|
||||
|
||||
Deskflow will automaticlly figure out where to save settings and other files.
|
||||
|
||||
|
||||
## Unix Systems
|
||||
The search order for a setting file is:
|
||||
1. `<XDG_CONFIG_HOME>/Deskflow/Deskflow.conf`
|
||||
1. A user settings file
|
||||
1. A system settings file
|
||||
|
||||
A new settings file will be created in the user path if no settings file is found.
|
||||
The path of the settings file will be used as the base for all other config files.
|
||||
|
||||
### Linux
|
||||
- System: `/etc/Deskflow/Deskflow.conf`
|
||||
- User: `~/.config/Deskflow/Deskflow.conf`
|
||||
|
||||
### macOS
|
||||
- System: `/Library/Deskflow/Deskflow.conf`
|
||||
- User: `~/Library/Deskflow/Deskflow.conf`
|
||||
|
||||
|
||||
## Windows
|
||||
|
||||
The search order for a setting file is:
|
||||
1. `<install-path>/settings/Deskflow.conf`
|
||||
1. Windows Registry `HKCU\Software\Deskflow\Deskflow`
|
||||
|
||||
Windows will save to the install dir if settings are loaded from there. If not, it saves any other config files in: `C:\ProgramData\Deskflow\`
|
||||
|
||||
When using settings from the install dir, the service mode will not be available.
|
||||
|
||||
# Server Config Examples
|
||||
|
||||
The `deskflow-server` command accepts the `-c` or `--config` option, which takes one argument,
|
||||
|
||||
@ -1,12 +1,15 @@
|
||||
sonar.organization=deskflow
|
||||
sonar.projectKey=deskflow_deskflow
|
||||
sonar.sources=src/apps,src/lib
|
||||
sonar.tests=src/test
|
||||
sonar.tests=src/unittests
|
||||
sonar.exclusions=subprojects/**,build/**
|
||||
sonar.coverage.exclusions=subprojects/**,src/test/**,src/apps/deskflow-gui/**,src/apps/res/**
|
||||
sonar.coverage.exclusions=subprojects/**,src/unittests/**,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)
|
||||
@ -22,5 +11,6 @@ add_subdirectory(apps)
|
||||
|
||||
option(BUILD_TESTS "Build tests" ON)
|
||||
if(BUILD_TESTS)
|
||||
add_subdirectory(test)
|
||||
add_subdirectory(unittests)
|
||||
endif()
|
||||
|
||||
|
||||
@ -1,18 +1,31 @@
|
||||
# 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
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
find_program(HELP2MAN help2man)
|
||||
if(NOT HELP2MAN)
|
||||
message(STATUS "Man page tool (help2man) not found, man pages will not be generated")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
function(generate_app_man TARGET)
|
||||
if(HELP2MAN)
|
||||
add_custom_command(
|
||||
TARGET ${target} POST_BUILD
|
||||
COMMAND QT_QPA_PLATFORM=minimal PATH=$<TARGET_FILE_DIR:${target}>:${PATH} ${HELP2MAN}
|
||||
--include ${CMAKE_SOURCE_DIR}/src/apps/res/manpage.txt
|
||||
--no-info
|
||||
${target}
|
||||
-o $<TARGET_FILE_DIR:${target}>/${target}.1
|
||||
)
|
||||
install(
|
||||
FILES $<TARGET_FILE_DIR:${target}>/${target}.1
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
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,21 @@ 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")
|
||||
generate_app_man(${target})
|
||||
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"
|
||||
@ -23,23 +13,20 @@
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
#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.
|
||||
#include <QCoreApplication>
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#if SYSAPI_WIN32
|
||||
// HACK to make sure settings gets the correct qApp path
|
||||
QCoreApplication m(argc, argv);
|
||||
m.deleteLater();
|
||||
|
||||
ArchMiscWindows::guardRuntimeVersion();
|
||||
|
||||
// record window instance for tray icon, etc
|
||||
ArchMiscWindows::setInstanceWin32(GetModuleHandle(NULL));
|
||||
ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr));
|
||||
#endif
|
||||
|
||||
Arch arch;
|
||||
@ -48,6 +35,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,21 @@ 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")
|
||||
generate_app_man(${target})
|
||||
elseif(WIN32)
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME_DEPENDENCY_SET coreDeps
|
||||
|
||||
@ -1,36 +1,29 @@
|
||||
/*
|
||||
* 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"
|
||||
#include <QCoreApplication>
|
||||
#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;
|
||||
}
|
||||
|
||||
@ -47,7 +40,11 @@ bool isClient(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#if SYSAPI_WIN32
|
||||
ArchMiscWindows::setInstanceWin32(GetModuleHandle(NULL));
|
||||
// HACK to make sure settings gets the correct qApp path
|
||||
QCoreApplication m(argc, argv);
|
||||
m.deleteLater();
|
||||
|
||||
ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr));
|
||||
#endif
|
||||
|
||||
Arch arch;
|
||||
@ -57,10 +54,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,150 @@
|
||||
/*
|
||||
* 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/Settings.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 <QCommandLineParser>
|
||||
#include <QCoreApplication>
|
||||
#include <QThread>
|
||||
|
||||
using namespace deskflow::core;
|
||||
|
||||
void handleError(const char *message = "Unrecognized error.");
|
||||
|
||||
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;
|
||||
|
||||
// Daemon deliberately does not have a parent, as it will be moved to a new thread.
|
||||
DaemonApp daemon(events);
|
||||
|
||||
QCoreApplication app(argc, argv);
|
||||
QCoreApplication::setApplicationName(QStringLiteral("%1 Daemon").arg(kAppName));
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
|
||||
const auto foregroundOption = QCommandLineOption({"f", "foreground"}, "Run in the foreground (show console)");
|
||||
parser.addOption(foregroundOption);
|
||||
|
||||
const auto installOption = QCommandLineOption({"i", "install"}, "Install as a Windows service");
|
||||
parser.addOption(installOption);
|
||||
|
||||
const auto uninstallOption = QCommandLineOption({"u", "uninstall"}, "Uninstall the Windows service");
|
||||
parser.addOption(uninstallOption);
|
||||
|
||||
parser.process(app);
|
||||
|
||||
if (parser.isSet(foregroundOption)) {
|
||||
daemon.setForeground();
|
||||
}
|
||||
|
||||
// Depends on whether foreground option was set.
|
||||
daemon.initLogging();
|
||||
|
||||
// Important: Log the app name and version number to the log file daemon app has initialized
|
||||
// logging as it creates the file logger. 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 v%s", QCoreApplication::applicationName().toStdString().c_str(), kDisplayVersion);
|
||||
|
||||
// Default log level to system setting (found in Registry).
|
||||
auto logLevel = Settings::value(Settings::Daemon::LogLevel).toString().toStdString();
|
||||
if (logLevel != "") {
|
||||
CLOG->setFilter(logLevel.c_str());
|
||||
LOG_DEBUG("log level: %s", logLevel.c_str());
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
// Show warning if not running as admin as daemon will behave differently.
|
||||
if (!ArchMiscWindows::isProcessElevated()) {
|
||||
LOG_WARN("not running as admin, some features may not work");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (parser.isSet(installOption)) {
|
||||
daemon.install();
|
||||
return kExitSuccess;
|
||||
} else if (parser.isSet(uninstallOption)) {
|
||||
daemon.uninstall();
|
||||
return kExitSuccess;
|
||||
}
|
||||
|
||||
const auto ipcServer =
|
||||
new ipc::DaemonIpcServer(&app, DaemonApp::logFilename().toStdString().c_str()); // NOSONAR - Qt managed
|
||||
ipcServer->listen();
|
||||
daemon.connectIpcServer(ipcServer);
|
||||
|
||||
QThread daemonThread;
|
||||
QObject::connect(&daemonThread, &QThread::finished, &app, &QCoreApplication::quit);
|
||||
daemon.run(daemonThread);
|
||||
|
||||
const auto exitCode = QCoreApplication::exec();
|
||||
daemonThread.wait();
|
||||
|
||||
LOG_DEBUG("daemon exited, code: %d", exitCode);
|
||||
return exitCode;
|
||||
|
||||
} catch (std::exception &e) {
|
||||
handleError(e.what());
|
||||
return kExitFailed;
|
||||
} catch (...) {
|
||||
handleError();
|
||||
return kExitFailed;
|
||||
}
|
||||
}
|
||||
|
||||
#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,139 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "Action.h"
|
||||
|
||||
#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()]) + "(";
|
||||
|
||||
switch (type()) {
|
||||
case keyDown:
|
||||
case keyUp:
|
||||
case keystroke: {
|
||||
text += keySequence().toString();
|
||||
|
||||
if (!keySequence().isMouseButton()) {
|
||||
const QStringList &screens = typeScreenNames();
|
||||
if (haveScreens() && !screens.isEmpty()) {
|
||||
text += ",";
|
||||
|
||||
for (int i = 0; i < screens.size(); i++) {
|
||||
text += screens[i];
|
||||
if (i != screens.size() - 1)
|
||||
text += ":";
|
||||
}
|
||||
} else
|
||||
text += ",*";
|
||||
}
|
||||
} break;
|
||||
|
||||
case switchToScreen:
|
||||
text += switchScreenName();
|
||||
break;
|
||||
|
||||
case switchInDirection:
|
||||
text += m_SwitchDirectionNames[m_SwitchDirection];
|
||||
break;
|
||||
|
||||
case lockCursorToScreen:
|
||||
text += m_LockCursorModeNames[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());
|
||||
|
||||
typeScreenNames().clear();
|
||||
int numTypeScreens = settings.beginReadArray("typeScreenNames");
|
||||
for (int i = 0; i < numTypeScreens; i++) {
|
||||
settings.setArrayIndex(i);
|
||||
typeScreenNames().append(settings.value("typeScreenName").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());
|
||||
}
|
||||
|
||||
void Action::saveSettings(QSettings &settings) const
|
||||
{
|
||||
keySequence().saveSettings(settings);
|
||||
settings.setValue("type", type());
|
||||
|
||||
settings.beginWriteArray("typeScreenNames");
|
||||
for (int i = 0; i < typeScreenNames().size(); i++) {
|
||||
settings.setArrayIndex(i);
|
||||
settings.setValue("typeScreenName", 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());
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
QTextStream &operator<<(QTextStream &outStream, const Action &action)
|
||||
{
|
||||
if (action.activeOnRelease())
|
||||
outStream << ";";
|
||||
|
||||
outStream << action.text();
|
||||
|
||||
return outStream;
|
||||
}
|
||||
@ -1,170 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "KeySequence.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
class ActionDialog;
|
||||
class QSettings;
|
||||
class QTextStream;
|
||||
|
||||
class Action
|
||||
{
|
||||
friend class ActionDialog;
|
||||
friend QTextStream &operator<<(QTextStream &outStream, const Action &action);
|
||||
|
||||
public:
|
||||
enum ActionType
|
||||
{
|
||||
keyDown,
|
||||
keyUp,
|
||||
keystroke,
|
||||
switchToScreen,
|
||||
switchInDirection,
|
||||
lockCursorToScreen,
|
||||
restartAllConnections,
|
||||
mouseDown,
|
||||
mouseUp,
|
||||
mousebutton,
|
||||
};
|
||||
enum SwitchDirection
|
||||
{
|
||||
switchLeft,
|
||||
switchRight,
|
||||
switchUp,
|
||||
switchDown
|
||||
};
|
||||
enum LockCursorMode
|
||||
{
|
||||
lockCursorToggle,
|
||||
lockCursonOn,
|
||||
lockCursorOff
|
||||
};
|
||||
|
||||
public:
|
||||
Action() = default;
|
||||
|
||||
public:
|
||||
QString text() const;
|
||||
const KeySequence &keySequence() const
|
||||
{
|
||||
return m_KeySequence;
|
||||
}
|
||||
void loadSettings(QSettings &settings);
|
||||
void saveSettings(QSettings &settings) const;
|
||||
int type() const
|
||||
{
|
||||
return m_Type;
|
||||
}
|
||||
const QStringList &typeScreenNames() const
|
||||
{
|
||||
return m_TypeScreenNames;
|
||||
}
|
||||
const QString &switchScreenName() const
|
||||
{
|
||||
return m_SwitchScreenName;
|
||||
}
|
||||
int switchDirection() const
|
||||
{
|
||||
return m_SwitchDirection;
|
||||
}
|
||||
int lockCursorMode() const
|
||||
{
|
||||
return m_LockCursorMode;
|
||||
}
|
||||
bool activeOnRelease() const
|
||||
{
|
||||
return m_ActiveOnRelease;
|
||||
}
|
||||
bool haveScreens() const
|
||||
{
|
||||
return m_HasScreens;
|
||||
}
|
||||
bool restartServer() const
|
||||
{
|
||||
return m_restartServer;
|
||||
}
|
||||
|
||||
bool operator==(const Action &a) const;
|
||||
|
||||
protected:
|
||||
KeySequence &keySequence()
|
||||
{
|
||||
return m_KeySequence;
|
||||
}
|
||||
void setKeySequence(const KeySequence &seq)
|
||||
{
|
||||
m_KeySequence = seq;
|
||||
}
|
||||
void setType(int t)
|
||||
{
|
||||
m_Type = t;
|
||||
}
|
||||
QStringList &typeScreenNames()
|
||||
{
|
||||
return m_TypeScreenNames;
|
||||
}
|
||||
void setSwitchScreenName(const QString &n)
|
||||
{
|
||||
m_SwitchScreenName = n;
|
||||
}
|
||||
void setSwitchDirection(int d)
|
||||
{
|
||||
m_SwitchDirection = d;
|
||||
}
|
||||
void setLockCursorMode(int m)
|
||||
{
|
||||
m_LockCursorMode = m;
|
||||
}
|
||||
void setActiveOnRelease(bool b)
|
||||
{
|
||||
m_ActiveOnRelease = b;
|
||||
}
|
||||
void setHaveScreens(bool b)
|
||||
{
|
||||
m_HasScreens = b;
|
||||
}
|
||||
void setRestartServer(bool b)
|
||||
{
|
||||
m_restartServer = b;
|
||||
}
|
||||
|
||||
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;
|
||||
bool m_restartServer;
|
||||
|
||||
static const char *m_ActionTypeNames[];
|
||||
static const char *m_SwitchDirectionNames[];
|
||||
static const char *m_LockCursorModeNames[];
|
||||
};
|
||||
|
||||
using ActionList = QList<Action>;
|
||||
|
||||
QTextStream &operator<<(QTextStream &outStream, const Action &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,49 @@ 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
|
||||
deskflow-gui.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
${target}
|
||||
${DESKFLOW_GUI_HOOK_LIB}
|
||||
gui
|
||||
common
|
||||
Qt6::Core
|
||||
Qt6::Widgets
|
||||
Qt6::Network)
|
||||
@ -76,35 +71,18 @@ 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()
|
||||
install(TARGETS ${target} DESTINATION bin)
|
||||
generate_app_man(${target})
|
||||
endif()
|
||||
|
||||
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QObject>
|
||||
|
||||
class DataDownloader : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DataDownloader(QObject *parent = 0);
|
||||
virtual ~DataDownloader();
|
||||
|
||||
QByteArray data() const;
|
||||
void cancel();
|
||||
void download(QUrl url);
|
||||
bool isFinished() const
|
||||
{
|
||||
return m_IsFinished;
|
||||
}
|
||||
|
||||
signals:
|
||||
void isComplete();
|
||||
|
||||
private slots:
|
||||
void complete(QNetworkReply *reply);
|
||||
|
||||
private:
|
||||
QNetworkAccessManager m_NetworkManager;
|
||||
QByteArray m_Data;
|
||||
QNetworkReply *m_pReply;
|
||||
bool m_IsFinished;
|
||||
};
|
||||
@ -1,76 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "Hotkey.h"
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
Hotkey::Hotkey() : m_KeySequence(), m_Actions()
|
||||
{
|
||||
}
|
||||
|
||||
QString Hotkey::text() const
|
||||
{
|
||||
QString text = keySequence().toString();
|
||||
|
||||
if (keySequence().isMouseButton())
|
||||
return "mousebutton(" + text + ")";
|
||||
|
||||
return "keystroke(" + text + ")";
|
||||
}
|
||||
|
||||
void Hotkey::loadSettings(QSettings &settings)
|
||||
{
|
||||
keySequence().loadSettings(settings);
|
||||
|
||||
actions().clear();
|
||||
int num = settings.beginReadArray("actions");
|
||||
for (int i = 0; i < num; i++) {
|
||||
settings.setArrayIndex(i);
|
||||
Action a;
|
||||
a.loadSettings(settings);
|
||||
actions().append(a);
|
||||
}
|
||||
|
||||
settings.endArray();
|
||||
}
|
||||
|
||||
void Hotkey::saveSettings(QSettings &settings) const
|
||||
{
|
||||
keySequence().saveSettings(settings);
|
||||
|
||||
settings.beginWriteArray("actions");
|
||||
for (int i = 0; i < actions().size(); i++) {
|
||||
settings.setArrayIndex(i);
|
||||
actions()[i].saveSettings(settings);
|
||||
}
|
||||
settings.endArray();
|
||||
}
|
||||
|
||||
bool Hotkey::operator==(const Hotkey &hk) const
|
||||
{
|
||||
return m_KeySequence == hk.m_KeySequence && m_Actions == hk.m_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;
|
||||
|
||||
return outStream;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,220 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QMutex>
|
||||
#include <QProcess>
|
||||
#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"
|
||||
#include "gui/core/ClientConnection.h"
|
||||
#include "gui/core/CoreProcess.h"
|
||||
#include "gui/core/ServerConnection.h"
|
||||
#include "gui/core/WaylandWarnings.h"
|
||||
#include "gui/tls/TlsUtility.h"
|
||||
|
||||
class QAction;
|
||||
class QMenu;
|
||||
class QLineEdit;
|
||||
class QGroupBox;
|
||||
class QPushButton;
|
||||
class QTextEdit;
|
||||
class QComboBox;
|
||||
class QTabWidget;
|
||||
class QCheckBox;
|
||||
class QRadioButton;
|
||||
class QMessageBox;
|
||||
class QAbstractButton;
|
||||
|
||||
class DeskflowApplication;
|
||||
class SetupWizard;
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
using CoreMode = deskflow::gui::CoreProcess::Mode;
|
||||
using CoreProcess = deskflow::gui::CoreProcess;
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
friend class DeskflowApplication;
|
||||
friend class SetupWizard;
|
||||
friend class SettingsDialog;
|
||||
|
||||
public:
|
||||
enum class LogLevel
|
||||
{
|
||||
Error,
|
||||
Info
|
||||
};
|
||||
|
||||
public:
|
||||
explicit MainWindow(deskflow::gui::ConfigScopes &configScopes, AppConfig &appConfig);
|
||||
~MainWindow() override;
|
||||
|
||||
void setVisible(bool visible) override;
|
||||
CoreMode coreMode() const
|
||||
{
|
||||
return m_CoreProcess.mode();
|
||||
}
|
||||
QString address() const;
|
||||
void open();
|
||||
ServerConfig &serverConfig()
|
||||
{
|
||||
return m_ServerConfig;
|
||||
}
|
||||
void autoAddScreen(const QString name);
|
||||
|
||||
signals:
|
||||
void shown();
|
||||
|
||||
public slots:
|
||||
void onAppAboutToQuit();
|
||||
|
||||
private slots:
|
||||
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 clearSettings();
|
||||
void openAboutDialog();
|
||||
void openHelpUrl() const;
|
||||
void openSettings();
|
||||
void startCore();
|
||||
void stopCore();
|
||||
bool saveConfig();
|
||||
void testFatalError() const;
|
||||
void testCriticalError() const;
|
||||
void resetCore();
|
||||
|
||||
void showMyFingerprint();
|
||||
void setModeServer();
|
||||
void setModeClient();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::MainWindow> ui;
|
||||
|
||||
void updateSize();
|
||||
AppConfig &appConfig()
|
||||
{
|
||||
return m_AppConfig;
|
||||
}
|
||||
AppConfig const &appConfig() const
|
||||
{
|
||||
return m_AppConfig;
|
||||
}
|
||||
void createMenuBar();
|
||||
void createStatusBar();
|
||||
void createTrayIcon();
|
||||
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);
|
||||
void enableClient(bool enable);
|
||||
void checkConnected(const QString &line);
|
||||
void checkFingerprint(const QString &line);
|
||||
QString getTimeStamp() const;
|
||||
void showEvent(QShowEvent *) override;
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
void secureSocket(bool secureSocket);
|
||||
void windowStateChanged();
|
||||
void connectSlots();
|
||||
void updateWindowTitle();
|
||||
void handleLogLine(const QString &line);
|
||||
void updateLocalFingerprint();
|
||||
void updateScreenName();
|
||||
void saveSettings();
|
||||
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();
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
QSize m_expandedSize = QSize();
|
||||
|
||||
// Window Actions
|
||||
QAction *m_actionAbout = nullptr;
|
||||
QAction *m_actionClearSettings = nullptr;
|
||||
QAction *m_actionHelp = nullptr;
|
||||
QAction *m_actionMinimize = nullptr;
|
||||
QAction *m_actionQuit = nullptr;
|
||||
QAction *m_actionRestore = nullptr;
|
||||
QAction *m_actionSave = nullptr;
|
||||
QAction *m_actionSettings = nullptr;
|
||||
QAction *m_actionStartCore = nullptr;
|
||||
QAction *m_actionStopCore = nullptr;
|
||||
QAction *m_actionTestCriticalError = nullptr;
|
||||
QAction *m_actionTestFatalError = nullptr;
|
||||
};
|
||||
@ -1,658 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>883</width>
|
||||
<height>690</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Deskflow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="m_pWidgetTopLevel">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="m_layoutName">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SizeConstraint::SetMinAndMaxSize</enum>
|
||||
</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>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelIpAddresses">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The highlighted IP is the one we think you should use. The server listens on all IPs, so the other IPs may work as well.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">This computer's IP addresses:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="m_pWidgetModes" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<property name="spacing">
|
||||
<number>20</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="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>
|
||||
<item>
|
||||
<widget class="QFrame" name="frameLog">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<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>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::ArrowType::RightArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblLog">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Log</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="textLog">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier</family>
|
||||
<kerning>true</kerning>
|
||||
</font>
|
||||
</property>
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QPlainTextEdit::LineWrapMode::NoWrap</enum>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="maximumBlockCount">
|
||||
<number>10000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</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>
|
||||
<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>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
enum qProcessorArch
|
||||
{
|
||||
kProcessorArchWin32,
|
||||
kProcessorArchWin64,
|
||||
kProcessorArchMac32,
|
||||
kProcessorArchMac64,
|
||||
kProcessorArchLinux32,
|
||||
kProcessorArchLinux64,
|
||||
kProcessorArchUnknown
|
||||
};
|
||||
@ -1,76 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "QUtility.h"
|
||||
|
||||
#include "ProcessorArch.h"
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
#include <QFile>
|
||||
#include <QProcess>
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
void setIndexFromItemData(QComboBox *comboBox, const QVariant &itemData)
|
||||
{
|
||||
for (int i = 0; i < comboBox->count(); ++i) {
|
||||
if (comboBox->itemData(i) == itemData) {
|
||||
comboBox->setCurrentIndex(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString hash(const QString &string)
|
||||
{
|
||||
QByteArray data = string.toUtf8();
|
||||
QByteArray hash = QCryptographicHash::hash(data, QCryptographicHash::Md5);
|
||||
return hash.toHex();
|
||||
}
|
||||
|
||||
qProcessorArch getProcessorArch()
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
SYSTEM_INFO systemInfo;
|
||||
GetNativeSystemInfo(&systemInfo);
|
||||
|
||||
switch (systemInfo.wProcessorArchitecture) {
|
||||
case PROCESSOR_ARCHITECTURE_INTEL:
|
||||
return kProcessorArchWin32;
|
||||
case PROCESSOR_ARCHITECTURE_IA64:
|
||||
return kProcessorArchWin64;
|
||||
case PROCESSOR_ARCHITECTURE_AMD64:
|
||||
return kProcessorArchWin64;
|
||||
default:
|
||||
return kProcessorArchUnknown;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
#ifdef __i386__
|
||||
return kProcessorArchLinux32;
|
||||
#else
|
||||
return kProcessorArchLinux64;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return kProcessorArchUnknown;
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ProcessorArch.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QCryptographicHash>
|
||||
#include <QNetworkInterface>
|
||||
#include <QVariant>
|
||||
|
||||
void setIndexFromItemData(QComboBox *comboBox, const QVariant &itemData);
|
||||
QString hash(const QString &string);
|
||||
qProcessorArch getProcessorArch();
|
||||
@ -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,58 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "gui/proxy/QNetworkAccessManagerProxy.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <memory>
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class VersionCheckerTests;
|
||||
|
||||
class VersionChecker : public QObject
|
||||
{
|
||||
using QNetworkAccessManagerProxy = deskflow::gui::proxy::QNetworkAccessManagerProxy;
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
friend class VersionCheckerTests;
|
||||
|
||||
public:
|
||||
explicit VersionChecker(std::shared_ptr<QNetworkAccessManagerProxy> network = nullptr);
|
||||
void checkLatest() const;
|
||||
public slots:
|
||||
void replyFinished(QNetworkReply *reply);
|
||||
signals:
|
||||
void updateFound(const QString &version);
|
||||
|
||||
private:
|
||||
static int compareVersions(const QString &left, const QString &right);
|
||||
|
||||
/**
|
||||
* \brief Converts a string stage to a integer value
|
||||
* \param stage The string containing the stage version
|
||||
* \return An integer representation of the stage, the higher the number the
|
||||
* more recent the version
|
||||
*/
|
||||
static int getStageVersion(QString stage);
|
||||
|
||||
std::shared_ptr<QNetworkAccessManagerProxy> m_network;
|
||||
};
|
||||
166
src/apps/deskflow-gui/deskflow-gui.cpp
Normal file
166
src/apps/deskflow-gui/deskflow-gui.cpp
Normal file
@ -0,0 +1,166 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* 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 "common/Constants.h"
|
||||
#include "common/UrlConstants.h"
|
||||
#include "gui/Diagnostic.h"
|
||||
#include "gui/DotEnv.h"
|
||||
#include "gui/Logger.h"
|
||||
#include "gui/MainWindow.h"
|
||||
#include "gui/Messages.h"
|
||||
#include "gui/StyleUtils.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QGuiApplication>
|
||||
#include <QLocalSocket>
|
||||
#include <QMessageBox>
|
||||
#include <QSharedMemory>
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <cstdlib>
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
|
||||
#include <QLoggingCategory>
|
||||
#endif
|
||||
|
||||
using namespace deskflow::gui;
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
bool checkMacAssistiveDevices();
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
|
||||
// Fixes Fedora bug where qDebug() messages aren't printed.
|
||||
QLoggingCategory::setFilterRules(QStringLiteral("*.debug=true\nqt.*=false"));
|
||||
#endif
|
||||
|
||||
QCoreApplication::setApplicationName(kAppName);
|
||||
QCoreApplication::setOrganizationName(kAppName);
|
||||
QCoreApplication::setApplicationVersion(kVersion);
|
||||
QCoreApplication::setOrganizationDomain(kOrgDomain); // used in prefix, can't be a url
|
||||
QGuiApplication::setDesktopFileName(QStringLiteral("org.deskflow.deskflow"));
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// Add Command Line Options
|
||||
auto helpOption = QCommandLineOption("help", "Display Help on the command line");
|
||||
auto versionOption = QCommandLineOption("version", "Display version information");
|
||||
auto resetOption = QCommandLineOption("reset", "Reset all settings");
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
|
||||
parser.addOption(helpOption);
|
||||
parser.addOption(versionOption);
|
||||
parser.addOption(resetOption);
|
||||
parser.parse(QCoreApplication::arguments());
|
||||
|
||||
const auto header = QStringLiteral("%1: %2\n").arg(kAppName, kDisplayVersion);
|
||||
if (parser.isSet(helpOption) || !parser.unknownOptionNames().isEmpty() || !parser.errorText().isEmpty()) {
|
||||
QTextStream(stdout) << header << QStringLiteral(" %1\n\n").arg(kAppDescription)
|
||||
<< parser.helpText().replace(QApplication::applicationFilePath(), kAppId);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (parser.isSet(versionOption)) {
|
||||
QTextStream(stdout) << header << kCopyright << Qt::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 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")) {
|
||||
QApplication::setStyle("fusion");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Sets the fallback icon path
|
||||
setIconFallbackPaths();
|
||||
|
||||
qInstallMessageHandler(deskflow::gui::messages::messageHandler);
|
||||
qInfo("%s v%s", kAppName, qPrintable(kVersion));
|
||||
|
||||
dotenv();
|
||||
Logger::instance().loadEnvVars();
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
|
||||
if (app.applicationDirPath().startsWith("/Volumes/")) {
|
||||
QString msgBody = QStringLiteral(
|
||||
"Please drag %1 to the Applications folder, "
|
||||
"and open it from there."
|
||||
);
|
||||
QMessageBox::information(nullptr, kAppName, msgBody.arg(kAppName));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!checkMacAssistiveDevices()) {
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
// --no-reset
|
||||
if (parser.isSet(resetOption)) {
|
||||
diagnostic::clearSettings(false);
|
||||
}
|
||||
|
||||
MainWindow mainWindow;
|
||||
mainWindow.open();
|
||||
|
||||
return QApplication::exec();
|
||||
}
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
bool checkMacAssistiveDevices()
|
||||
{
|
||||
// new in mavericks, applications are trusted individually
|
||||
// with use of the accessibility api. this call will show a
|
||||
// prompt which can show the security/privacy/accessibility
|
||||
// tab, with a list of allowed applications. deskflow should
|
||||
// show up there automatically, but will be unchecked.
|
||||
|
||||
if (AXIsProcessTrusted()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const void *keys[] = {kAXTrustedCheckOptionPrompt};
|
||||
const void *trueValue[] = {kCFBooleanTrue};
|
||||
CFDictionaryRef options = CFDictionaryCreate(nullptr, keys, trueValue, 1, nullptr, nullptr);
|
||||
|
||||
bool result = AXIsProcessTrustedWithOptions(options);
|
||||
CFRelease(options);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
@ -1 +0,0 @@
|
||||
IDI_ICON1 ICON DISCARDABLE "../res/deskflow.ico"
|
||||
@ -1,88 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "AboutDialog.h"
|
||||
|
||||
#include "common/constants.h"
|
||||
#include "gui/style_utils.h"
|
||||
|
||||
#include <QClipboard>
|
||||
#include <QDateTime>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QStyle>
|
||||
|
||||
AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
setWindowTitle(tr("About Deskflow"));
|
||||
|
||||
auto copyIcon = QIcon::fromTheme(
|
||||
QIcon::ThemeIcon::EditCopy, deskflow::gui::isDarkMode() ? QIcon(s_darkCopy) : QIcon(s_lightCopy)
|
||||
);
|
||||
|
||||
auto btnCopyVersion = new QPushButton(copyIcon, QString(), this);
|
||||
btnCopyVersion->setFlat(true);
|
||||
connect(btnCopyVersion, &QPushButton::clicked, this, [] { QGuiApplication::clipboard()->setText(kVersion); });
|
||||
|
||||
// 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));
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
auto lblLogo = new QLabel(this);
|
||||
lblLogo->setPixmap(deskflow::gui::isDarkMode() ? s_darkLogo : s_lightLogo);
|
||||
|
||||
auto lblCopyright = new QLabel(kCopyright, this);
|
||||
|
||||
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);
|
||||
adjustSize();
|
||||
setFixedSize(size());
|
||||
}
|
||||
@ -1,124 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "ActionDialog.h"
|
||||
#include "ui_ActionDialog.h"
|
||||
|
||||
#include "Action.h"
|
||||
#include "Hotkey.h"
|
||||
#include "KeySequence.h"
|
||||
#include "ServerConfig.h"
|
||||
|
||||
#include <QButtonGroup>
|
||||
|
||||
ActionDialog::ActionDialog(QWidget *parent, 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))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
// 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
|
||||
};
|
||||
|
||||
for (unsigned int i = 0; i < sizeof(typeButtons) / sizeof(typeButtons[0]); i++)
|
||||
m_pButtonGroupType->addButton(typeButtons[i], i);
|
||||
|
||||
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());
|
||||
|
||||
if (m_Action.activeOnRelease())
|
||||
ui->m_pRadioHotkeyReleased->setChecked(true);
|
||||
else
|
||||
ui->m_pRadioHotkeyPressed->setChecked(true);
|
||||
|
||||
ui->m_pGroupBoxScreens->setChecked(m_Action.haveScreens());
|
||||
|
||||
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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ActionDialog::accept()
|
||||
{
|
||||
if (!sequenceWidget()->valid() && m_pButtonGroupType->checkedId() >= 0 && m_pButtonGroupType->checkedId() < 3)
|
||||
return;
|
||||
|
||||
m_Action.setKeySequence(sequenceWidget()->keySequence());
|
||||
m_Action.setType(m_pButtonGroupType->checkedId());
|
||||
m_Action.setHaveScreens(ui->m_pGroupBoxScreens->isChecked());
|
||||
|
||||
m_Action.typeScreenNames().clear();
|
||||
|
||||
const auto &selection = ui->m_pListScreens->selectedItems();
|
||||
for (const QListWidgetItem *pItem : selection)
|
||||
m_Action.typeScreenNames().append(pItem->text());
|
||||
|
||||
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());
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void ActionDialog::on_m_pKeySequenceWidgetHotkey_keySequenceChanged()
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
const KeySequenceWidget *ActionDialog::sequenceWidget() const
|
||||
{
|
||||
return ui->m_pKeySequenceWidgetHotkey;
|
||||
}
|
||||
|
||||
ActionDialog::~ActionDialog() = default;
|
||||
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class Hotkey;
|
||||
class Action;
|
||||
class QRadioButton;
|
||||
class QButtonGroup;
|
||||
class ServerConfig;
|
||||
class KeySequenceWidget;
|
||||
|
||||
namespace Ui {
|
||||
class ActionDialog;
|
||||
}
|
||||
|
||||
class ActionDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ActionDialog(QWidget *parent, 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;
|
||||
|
||||
QButtonGroup *m_pButtonGroupType;
|
||||
};
|
||||
@ -1,634 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ActionDialog</class>
|
||||
<widget class="QDialog" name="ActionDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>375</width>
|
||||
<height>528</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Configure Action</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<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">
|
||||
<property name="text">
|
||||
<string>Press a hotkey</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioRelease">
|
||||
<property name="text">
|
||||
<string>Release a hotkey</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioPressAndRelease">
|
||||
<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>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupBoxScreens">
|
||||
<property name="title">
|
||||
<string>only on these screens</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</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>
|
||||
</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>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<kerning>false</kerning>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>This action is performed when</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout">
|
||||
<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>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>KeySequenceWidget</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>widgets/KeySequenceWidget.h</header>
|
||||
</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>
|
||||
</ui>
|
||||
@ -1,58 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "Hotkey.h"
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class KeySequenceWidget;
|
||||
|
||||
namespace Ui {
|
||||
class HotkeyDialog;
|
||||
}
|
||||
|
||||
class HotkeyDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HotkeyDialog(QWidget *parent, Hotkey &hotkey);
|
||||
~HotkeyDialog() override;
|
||||
|
||||
public:
|
||||
const Hotkey &hotkey() const
|
||||
{
|
||||
return m_Hotkey;
|
||||
}
|
||||
|
||||
protected slots:
|
||||
void accept() override;
|
||||
|
||||
protected:
|
||||
const KeySequenceWidget *sequenceWidget() const;
|
||||
|
||||
Hotkey &hotkey()
|
||||
{
|
||||
return m_Hotkey;
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::HotkeyDialog> ui;
|
||||
Hotkey &m_Hotkey;
|
||||
};
|
||||
@ -1,154 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "ScreenSettingsDialog.h"
|
||||
#include "ui_ScreenSettingsDialog.h"
|
||||
|
||||
#include "gui/config/Screen.h"
|
||||
#include "gui/styles.h"
|
||||
#include "gui/validators/AliasValidator.h"
|
||||
#include "gui/validators/ScreenNameValidator.h"
|
||||
#include "gui/validators/ValidationError.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
using namespace deskflow::gui;
|
||||
using enum ScreenConfig::Modifier;
|
||||
using enum ScreenConfig::SwitchCorner;
|
||||
using enum ScreenConfig::Fix;
|
||||
|
||||
ScreenSettingsDialog::~ScreenSettingsDialog() = default;
|
||||
|
||||
ScreenSettingsDialog::ScreenSettingsDialog(QWidget *parent, Screen *pScreen, const ScreenList *pScreens)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
ui_{std::make_unique<Ui::ScreenSettingsDialog>()},
|
||||
m_pScreen(pScreen)
|
||||
{
|
||||
|
||||
ui_->setupUi(this);
|
||||
|
||||
ui_->m_pLabelAliasError->setStyleSheet(kStyleErrorActiveLabel);
|
||||
ui_->m_pLabelNameError->setStyleSheet(kStyleErrorActiveLabel);
|
||||
|
||||
ui_->m_pLineEditName->setText(m_pScreen->name());
|
||||
ui_->m_pLineEditName->setValidator(new validators::ScreenNameValidator(
|
||||
ui_->m_pLineEditName, new validators::ValidationError(this, ui_->m_pLabelNameError), pScreens
|
||||
));
|
||||
ui_->m_pLineEditName->selectAll();
|
||||
|
||||
ui_->m_pLineEditAlias->setValidator(new validators::AliasValidator(
|
||||
ui_->m_pLineEditAlias, new validators::ValidationError(this, ui_->m_pLabelAliasError)
|
||||
));
|
||||
|
||||
for (int i = 0; i < m_pScreen->aliases().count(); i++)
|
||||
new QListWidgetItem(m_pScreen->aliases()[i], ui_->m_pListAliases);
|
||||
|
||||
ui_->m_pComboBoxShift->setCurrentIndex(m_pScreen->modifier(static_cast<int>(Shift)));
|
||||
ui_->m_pComboBoxCtrl->setCurrentIndex(m_pScreen->modifier(static_cast<int>(Ctrl)));
|
||||
ui_->m_pComboBoxAlt->setCurrentIndex(m_pScreen->modifier(static_cast<int>(Alt)));
|
||||
ui_->m_pComboBoxMeta->setCurrentIndex(m_pScreen->modifier(static_cast<int>(Meta)));
|
||||
ui_->m_pComboBoxSuper->setCurrentIndex(m_pScreen->modifier(static_cast<int>(Super)));
|
||||
|
||||
ui_->m_pCheckBoxCornerTopLeft->setChecked(m_pScreen->switchCorner(static_cast<int>(TopLeft)));
|
||||
ui_->m_pCheckBoxCornerTopRight->setChecked(m_pScreen->switchCorner(static_cast<int>(TopRight)));
|
||||
ui_->m_pCheckBoxCornerBottomLeft->setChecked(m_pScreen->switchCorner(static_cast<int>(BottomLeft)));
|
||||
ui_->m_pCheckBoxCornerBottomRight->setChecked(m_pScreen->switchCorner(static_cast<int>(BottomRight)));
|
||||
ui_->m_pSpinBoxSwitchCornerSize->setValue(m_pScreen->switchCornerSize());
|
||||
|
||||
ui_->m_pCheckBoxCapsLock->setChecked(m_pScreen->fix(CapsLock));
|
||||
ui_->m_pCheckBoxNumLock->setChecked(m_pScreen->fix(NumLock));
|
||||
ui_->m_pCheckBoxScrollLock->setChecked(m_pScreen->fix(ScrollLock));
|
||||
ui_->m_pCheckBoxXTest->setChecked(m_pScreen->fix(XTest));
|
||||
}
|
||||
|
||||
void ScreenSettingsDialog::accept()
|
||||
{
|
||||
if (ui_->m_pLineEditName->text().isEmpty()) {
|
||||
QMessageBox::warning(
|
||||
this, tr("Screen name is empty"),
|
||||
tr("The screen name cannot be empty. "
|
||||
"Please either fill in a name or cancel the dialog.")
|
||||
);
|
||||
return;
|
||||
} else if (!ui_->m_pLabelNameError->text().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_pScreen->init();
|
||||
|
||||
m_pScreen->setName(ui_->m_pLineEditName->text());
|
||||
|
||||
for (int i = 0; i < ui_->m_pListAliases->count(); i++) {
|
||||
QString alias(ui_->m_pListAliases->item(i)->text());
|
||||
if (alias == ui_->m_pLineEditName->text()) {
|
||||
QMessageBox::warning(
|
||||
this, tr("Screen name matches alias"),
|
||||
tr("The screen name cannot be the same as an alias. "
|
||||
"Please either remove the alias or change the screen name.")
|
||||
);
|
||||
return;
|
||||
}
|
||||
m_pScreen->addAlias(alias);
|
||||
}
|
||||
|
||||
m_pScreen->setModifier(static_cast<int>(Shift), ui_->m_pComboBoxShift->currentIndex());
|
||||
m_pScreen->setModifier(static_cast<int>(Ctrl), ui_->m_pComboBoxCtrl->currentIndex());
|
||||
m_pScreen->setModifier(static_cast<int>(Alt), ui_->m_pComboBoxAlt->currentIndex());
|
||||
m_pScreen->setModifier(static_cast<int>(Meta), ui_->m_pComboBoxMeta->currentIndex());
|
||||
m_pScreen->setModifier(static_cast<int>(Super), ui_->m_pComboBoxSuper->currentIndex());
|
||||
|
||||
m_pScreen->setSwitchCorner(static_cast<int>(TopLeft), ui_->m_pCheckBoxCornerTopLeft->isChecked());
|
||||
m_pScreen->setSwitchCorner(static_cast<int>(TopRight), ui_->m_pCheckBoxCornerTopRight->isChecked());
|
||||
m_pScreen->setSwitchCorner(static_cast<int>(BottomLeft), ui_->m_pCheckBoxCornerBottomLeft->isChecked());
|
||||
m_pScreen->setSwitchCorner(static_cast<int>(BottomRight), ui_->m_pCheckBoxCornerBottomRight->isChecked());
|
||||
m_pScreen->setSwitchCornerSize(ui_->m_pSpinBoxSwitchCornerSize->value());
|
||||
|
||||
m_pScreen->setFix(static_cast<int>(CapsLock), ui_->m_pCheckBoxCapsLock->isChecked());
|
||||
m_pScreen->setFix(static_cast<int>(NumLock), ui_->m_pCheckBoxNumLock->isChecked());
|
||||
m_pScreen->setFix(static_cast<int>(ScrollLock), ui_->m_pCheckBoxScrollLock->isChecked());
|
||||
m_pScreen->setFix(static_cast<int>(XTest), ui_->m_pCheckBoxXTest->isChecked());
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void ScreenSettingsDialog::on_m_pButtonAddAlias_clicked()
|
||||
{
|
||||
if (!ui_->m_pLineEditAlias->text().isEmpty() &&
|
||||
ui_->m_pListAliases->findItems(ui_->m_pLineEditAlias->text(), Qt::MatchFixedString).isEmpty()) {
|
||||
new QListWidgetItem(ui_->m_pLineEditAlias->text(), ui_->m_pListAliases);
|
||||
ui_->m_pLineEditAlias->clear();
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenSettingsDialog::on_m_pLineEditAlias_textChanged(const QString &text)
|
||||
{
|
||||
ui_->m_pButtonAddAlias->setEnabled(!text.isEmpty() && ui_->m_pLabelAliasError->text().isEmpty());
|
||||
}
|
||||
|
||||
void ScreenSettingsDialog::on_m_pButtonRemoveAlias_clicked()
|
||||
{
|
||||
QList<QListWidgetItem *> items = ui_->m_pListAliases->selectedItems();
|
||||
|
||||
for (int i = 0; i < items.count(); i++)
|
||||
delete items[i];
|
||||
}
|
||||
|
||||
void ScreenSettingsDialog::on_m_pListAliases_itemSelectionChanged()
|
||||
{
|
||||
ui_->m_pButtonRemoveAlias->setEnabled(!ui_->m_pListAliases->selectedItems().isEmpty());
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class QWidget;
|
||||
class QString;
|
||||
|
||||
class Screen;
|
||||
class ScreenList;
|
||||
|
||||
namespace Ui {
|
||||
class ScreenSettingsDialog;
|
||||
}
|
||||
|
||||
class ScreenSettingsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ScreenSettingsDialog(QWidget *parent, Screen *pScreen = nullptr, const ScreenList *pScreens = nullptr);
|
||||
~ScreenSettingsDialog() override;
|
||||
|
||||
public slots:
|
||||
void accept() override;
|
||||
|
||||
private slots:
|
||||
void on_m_pButtonAddAlias_clicked();
|
||||
void on_m_pButtonRemoveAlias_clicked();
|
||||
void on_m_pLineEditAlias_textChanged(const QString &text);
|
||||
void on_m_pListAliases_itemSelectionChanged();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::ScreenSettingsDialog> ui_;
|
||||
Screen *m_pScreen;
|
||||
};
|
||||
@ -1,489 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "ServerConfigDialog.h"
|
||||
#include "ui_ServerConfigDialog.h"
|
||||
|
||||
#include "common/constants.h"
|
||||
#include "dialogs/ActionDialog.h"
|
||||
#include "dialogs/HotkeyDialog.h"
|
||||
#include "dialogs/ScreenSettingsDialog.h"
|
||||
|
||||
#include "ServerConfig.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
using enum ScreenConfig::SwitchCorner;
|
||||
using ServerProtocol = synergy::gui::ServerProtocol;
|
||||
|
||||
ServerConfigDialog::ServerConfigDialog(QWidget *parent, ServerConfig &config, AppConfig &appConfig)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
ui{std::make_unique<Ui::ServerConfigDialog>()},
|
||||
m_OriginalServerConfig(config),
|
||||
m_OriginalServerConfigIsExternal(config.useExternalConfig()),
|
||||
m_OriginalServerConfigUsesExternalFile(config.configFile()),
|
||||
m_ServerConfig(config),
|
||||
m_ScreenSetupModel(serverConfig().screens(), serverConfig().numColumns(), serverConfig().numRows()),
|
||||
m_Message(""),
|
||||
m_appConfig(appConfig)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
const auto folderIcon =
|
||||
QIcon::fromTheme(QIcon::ThemeIcon::DocumentOpen, QIcon(QStringLiteral(":/icons/64x64/folder.png")));
|
||||
ui->m_pButtonBrowseConfigFile->setIcon(folderIcon);
|
||||
|
||||
// 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->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->m_pCheckBoxRelativeMouseMoves->setChecked(serverConfig().relativeMouseMoves());
|
||||
ui->m_pCheckBoxWin32KeepForeground->setChecked(serverConfig().win32KeepForeground());
|
||||
|
||||
ui->m_pCheckBoxSwitchDelay->setChecked(serverConfig().hasSwitchDelay());
|
||||
ui->m_pSpinBoxSwitchDelay->setValue(serverConfig().switchDelay());
|
||||
|
||||
ui->m_pCheckBoxSwitchDoubleTap->setChecked(serverConfig().hasSwitchDoubleTap());
|
||||
ui->m_pSpinBoxSwitchDoubleTap->setValue(serverConfig().switchDoubleTap());
|
||||
|
||||
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->m_pCheckBoxEnableClipboard->setChecked(serverConfig().clipboardSharing());
|
||||
int clipboardSharingSizeM = static_cast<int>(serverConfig().clipboardSharingSize() / 1024);
|
||||
ui->m_pSpinBoxClipboardSizeLimit->setValue(clipboardSharingSizeM);
|
||||
ui->m_pSpinBoxClipboardSizeLimit->setEnabled(serverConfig().clipboardSharing());
|
||||
|
||||
for (const Hotkey &hotkey : std::as_const(serverConfig().hotkeys()))
|
||||
ui->m_pListHotkeys->addItem(hotkey.text());
|
||||
|
||||
ui->m_pScreenSetupView->setModel(&m_ScreenSetupModel);
|
||||
|
||||
auto &screens = serverConfig().screens();
|
||||
auto server = std::find_if(screens.begin(), screens.end(), [this](const Screen &screen) {
|
||||
return (screen.name() == serverConfig().getServerName());
|
||||
});
|
||||
|
||||
if (server == screens.end()) {
|
||||
Screen serverScreen(serverConfig().getServerName());
|
||||
serverScreen.markAsServer();
|
||||
model().screen(serverConfig().numColumns() / 2, serverConfig().numRows() / 2) = serverScreen;
|
||||
} else {
|
||||
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;
|
||||
|
||||
bool ServerConfigDialog::addClient(const QString &clientName)
|
||||
{
|
||||
return addComputer(clientName, true);
|
||||
}
|
||||
|
||||
void ServerConfigDialog::accept()
|
||||
{
|
||||
if (ui->m_pCheckBoxUseExternalConfig->isChecked() && !QFile::exists(ui->m_pEditConfigFile->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()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// now that the dialog has been accepted, copy the new server config to the
|
||||
// original one, which is a reference to the one in MainWindow.
|
||||
setOriginalServerConfig(serverConfig());
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::reject()
|
||||
{
|
||||
serverConfig().setUseExternalConfig(m_OriginalServerConfigIsExternal);
|
||||
serverConfig().setConfigFile(m_OriginalServerConfigUsesExternalFile);
|
||||
|
||||
QDialog::reject();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonNewHotkey_clicked()
|
||||
{
|
||||
Hotkey hotkey;
|
||||
HotkeyDialog dlg(this, hotkey);
|
||||
if (dlg.exec() == QDialog::Accepted) {
|
||||
serverConfig().hotkeys().append(hotkey);
|
||||
ui->m_pListHotkeys->addItem(hotkey.text());
|
||||
onChange();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonEditHotkey_clicked()
|
||||
{
|
||||
int idx = ui->m_pListHotkeys->currentRow();
|
||||
Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
|
||||
Hotkey &hotkey = serverConfig().hotkeys()[idx];
|
||||
HotkeyDialog dlg(this, hotkey);
|
||||
if (dlg.exec() == QDialog::Accepted) {
|
||||
ui->m_pListHotkeys->currentItem()->setText(hotkey.text());
|
||||
onChange();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonRemoveHotkey_clicked()
|
||||
{
|
||||
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);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pListHotkeys_itemSelectionChanged()
|
||||
{
|
||||
bool itemsSelected = !ui->m_pListHotkeys->selectedItems().isEmpty();
|
||||
ui->m_pButtonEditHotkey->setEnabled(itemsSelected);
|
||||
ui->m_pButtonRemoveHotkey->setEnabled(itemsSelected);
|
||||
ui->m_pButtonNewAction->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];
|
||||
for (const Action &action : hotkey.actions())
|
||||
ui->m_pListActions->addItem(action.text());
|
||||
}
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonNewAction_clicked()
|
||||
{
|
||||
int idx = ui->m_pListHotkeys->currentRow();
|
||||
Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
|
||||
Hotkey &hotkey = serverConfig().hotkeys()[idx];
|
||||
|
||||
Action action;
|
||||
ActionDialog dlg(this, serverConfig(), hotkey, action);
|
||||
if (dlg.exec() == QDialog::Accepted) {
|
||||
hotkey.actions().append(action);
|
||||
ui->m_pListActions->addItem(action.text());
|
||||
onChange();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonEditAction_clicked()
|
||||
{
|
||||
int idxHotkey = ui->m_pListHotkeys->currentRow();
|
||||
Q_ASSERT(idxHotkey >= 0 && idxHotkey < serverConfig().hotkeys().size());
|
||||
Hotkey &hotkey = serverConfig().hotkeys()[idxHotkey];
|
||||
|
||||
int idxAction = ui->m_pListActions->currentRow();
|
||||
Q_ASSERT(idxAction >= 0 && idxAction < hotkey.actions().size());
|
||||
Action &action = hotkey.actions()[idxAction];
|
||||
|
||||
ActionDialog dlg(this, serverConfig(), hotkey, action);
|
||||
if (dlg.exec() == QDialog::Accepted) {
|
||||
ui->m_pListActions->currentItem()->setText(action.text());
|
||||
onChange();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonRemoveAction_clicked()
|
||||
{
|
||||
int idxHotkey = ui->m_pListHotkeys->currentRow();
|
||||
Q_ASSERT(idxHotkey >= 0 && idxHotkey < serverConfig().hotkeys().size());
|
||||
Hotkey &hotkey = serverConfig().hotkeys()[idxHotkey];
|
||||
|
||||
int idxAction = ui->m_pListActions->currentRow();
|
||||
Q_ASSERT(idxAction >= 0 && idxAction < hotkey.actions().size());
|
||||
|
||||
hotkey.actions().removeAt(idxAction);
|
||||
delete ui->m_pListActions->currentItem();
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pCheckBoxEnableClipboard_stateChanged(int const state)
|
||||
{
|
||||
ui->m_pSpinBoxClipboardSizeLimit->setEnabled(state == Qt::Checked);
|
||||
if ((state == Qt::Checked) && (!ui->m_pSpinBoxClipboardSizeLimit->value())) {
|
||||
int size = static_cast<int>((serverConfig().defaultClipboardSharingSize() + 512) / 1024);
|
||||
ui->m_pSpinBoxClipboardSizeLimit->setValue(size ? size : 1);
|
||||
}
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pListActions_itemSelectionChanged()
|
||||
{
|
||||
ui->m_pButtonEditAction->setEnabled(!ui->m_pListActions->selectedItems().isEmpty());
|
||||
ui->m_pButtonRemoveAction->setEnabled(!ui->m_pListActions->selectedItems().isEmpty());
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pButtonAddComputer_clicked()
|
||||
{
|
||||
addComputer("", false);
|
||||
}
|
||||
|
||||
void ServerConfigDialog::onScreenRemoved()
|
||||
{
|
||||
ui->m_pButtonAddComputer->setEnabled(true);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::on_m_pCheckBoxUseExternalConfig_toggled(bool checked)
|
||||
{
|
||||
ui->m_pLabelConfigFile->setEnabled(checked);
|
||||
ui->m_pEditConfigFile->setEnabled(checked);
|
||||
ui->m_pButtonBrowseConfigFile->setEnabled(checked);
|
||||
|
||||
ui->m_pTabWidget->setTabEnabled(0, !checked);
|
||||
ui->m_pTabWidget->setTabEnabled(1, !checked);
|
||||
ui->m_pTabWidget->setTabEnabled(2, !checked);
|
||||
}
|
||||
|
||||
bool ServerConfigDialog::on_m_pButtonBrowseConfigFile_clicked()
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
static const auto configExt = QStringLiteral("sgc");
|
||||
#else
|
||||
static const auto configExt = QStringLiteral("conf");
|
||||
#endif
|
||||
static const auto deskflowConfigFilter = QStringLiteral("%1 Configurations (*.%2);;All files (*.*)");
|
||||
|
||||
QString fileName =
|
||||
QFileDialog::getOpenFileName(this, "Browse for a config file", "", deskflowConfigFilter.arg(kAppName, configExt));
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->m_pEditConfigFile->setText(fileName);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ServerConfigDialog::addComputer(const QString &clientName, bool doSilent)
|
||||
{
|
||||
bool isAccepted = false;
|
||||
Screen newScreen(clientName);
|
||||
|
||||
ScreenSettingsDialog dlg(this, &newScreen, &model().m_Screens);
|
||||
if (doSilent || dlg.exec() == QDialog::Accepted) {
|
||||
model().addScreen(newScreen);
|
||||
isAccepted = true;
|
||||
}
|
||||
|
||||
ui->m_pButtonAddComputer->setEnabled(!model().isFull());
|
||||
return isAccepted;
|
||||
}
|
||||
|
||||
void ServerConfigDialog::onChange()
|
||||
{
|
||||
bool isAppConfigDataEqual = m_OriginalServerConfigIsExternal == serverConfig().useExternalConfig() &&
|
||||
m_OriginalServerConfigUsesExternalFile == serverConfig().configFile();
|
||||
ui->m_pButtonBox->button(QDialogButtonBox::Ok)
|
||||
->setEnabled(!isAppConfigDataEqual || !(m_OriginalServerConfig == m_ServerConfig));
|
||||
}
|
||||
@ -1,95 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ScreenSetupModel.h"
|
||||
#include "ServerConfig.h"
|
||||
#include "gui/config/AppConfig.h"
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class ServerConfigDialog;
|
||||
}
|
||||
|
||||
class ServerConfigDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ServerConfigDialog(QWidget *parent, ServerConfig &config, AppConfig &appConfig);
|
||||
~ServerConfigDialog();
|
||||
bool addClient(const QString &clientName);
|
||||
|
||||
public slots:
|
||||
void accept() override;
|
||||
void reject() override;
|
||||
void message(const QString &message)
|
||||
{
|
||||
m_Message = message;
|
||||
}
|
||||
|
||||
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:
|
||||
bool addComputer(const QString &clientName, bool doSilent);
|
||||
ServerConfig &serverConfig()
|
||||
{
|
||||
return m_ServerConfig;
|
||||
}
|
||||
void setOriginalServerConfig(const ServerConfig &s)
|
||||
{
|
||||
m_OriginalServerConfig = s;
|
||||
}
|
||||
ScreenSetupModel &model()
|
||||
{
|
||||
return m_ScreenSetupModel;
|
||||
}
|
||||
AppConfig &appConfig()
|
||||
{
|
||||
return m_appConfig;
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::ServerConfigDialog> ui;
|
||||
ServerConfig &m_OriginalServerConfig;
|
||||
ServerConfig m_ServerConfig;
|
||||
bool m_OriginalServerConfigIsExternal;
|
||||
QString m_OriginalServerConfigUsesExternalFile;
|
||||
ScreenSetupModel m_ScreenSetupModel;
|
||||
QString m_Message;
|
||||
AppConfig &m_appConfig;
|
||||
|
||||
private slots:
|
||||
void onChange();
|
||||
};
|
||||
@ -1,344 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "SettingsDialog.h"
|
||||
#include "ui_SettingsDialog.h"
|
||||
|
||||
#include "gui/core/CoreProcess.h"
|
||||
#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>
|
||||
#include <QMessageBox>
|
||||
|
||||
using namespace deskflow::gui;
|
||||
|
||||
SettingsDialog::SettingsDialog(
|
||||
QWidget *parent, AppConfig &appConfig, const IServerConfig &serverConfig, const CoreProcess &coreProcess
|
||||
)
|
||||
: QDialog(parent),
|
||||
ui{std::make_unique<Ui::SettingsDialog>()},
|
||||
m_appConfig(appConfig),
|
||||
m_serverConfig(serverConfig),
|
||||
m_coreProcess(coreProcess),
|
||||
m_tlsUtility(appConfig)
|
||||
{
|
||||
|
||||
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);
|
||||
|
||||
// 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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
//
|
||||
// Auto-connect slots
|
||||
//
|
||||
|
||||
void SettingsDialog::on_m_pCheckBoxLogToFile_stateChanged(int i)
|
||||
{
|
||||
bool checked = i == 2;
|
||||
|
||||
ui->m_pLabelLogPath->setEnabled(checked);
|
||||
ui->m_pLineEditLogFilename->setEnabled(checked);
|
||||
ui->m_pButtonBrowseLog->setEnabled(checked);
|
||||
}
|
||||
|
||||
void SettingsDialog::on_m_pButtonBrowseLog_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getSaveFileName(
|
||||
this, tr("Save log file to..."), ui->m_pLineEditLogFilename->text(), "Logs (*.log *.txt)"
|
||||
);
|
||||
|
||||
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();
|
||||
|
||||
if (isVisible() && !m_appConfig.isActiveScopeWritable()) {
|
||||
showReadOnlyMessage();
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::on_m_pPushButtonTlsCertPath_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getSaveFileName(
|
||||
this, tr("Select a TLS certificate to use..."), ui->m_pLineEditTlsCertPath->text(), "Cert (*.pem)", nullptr,
|
||||
QFileDialog::DontConfirmOverwrite
|
||||
);
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->m_pLineEditTlsCertPath->setText(fileName);
|
||||
|
||||
if (QFile(fileName).exists()) {
|
||||
updateKeyLengthOnFile(fileName);
|
||||
} else {
|
||||
qDebug("no tls certificate file at: %s", qUtf8Printable(fileName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::on_m_pPushButtonTlsRegenCert_clicked()
|
||||
{
|
||||
if (m_tlsUtility.generateCertificate()) {
|
||||
QMessageBox::information(this, tr("TLS Certificate Regenerated"), tr("TLS certificate regenerated successfully."));
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::on_m_pCheckBoxServiceEnabled_toggled(bool)
|
||||
{
|
||||
updateControls();
|
||||
}
|
||||
|
||||
//
|
||||
// End of auto-connect slots
|
||||
//
|
||||
|
||||
void SettingsDialog::showEvent(QShowEvent *event)
|
||||
{
|
||||
QDialog::showEvent(event);
|
||||
Q_EMIT shown();
|
||||
}
|
||||
|
||||
void SettingsDialog::showReadOnlyMessage()
|
||||
{
|
||||
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());
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void SettingsDialog::reject()
|
||||
{
|
||||
// restore original system scope value on reject.
|
||||
if (m_appConfig.isActiveScopeSystem() != m_wasOriginallySystemScope) {
|
||||
m_appConfig.setLoadFromSystemScope(m_wasOriginallySystemScope);
|
||||
}
|
||||
|
||||
QDialog::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()));
|
||||
|
||||
if (m_appConfig.enableUpdateCheck().has_value()) {
|
||||
ui->m_pCheckBoxAutoUpdate->setChecked(m_appConfig.enableUpdateCheck().value());
|
||||
} else {
|
||||
ui->m_pCheckBoxAutoUpdate->setChecked(false);
|
||||
}
|
||||
|
||||
if (m_appConfig.isActiveScopeSystem()) {
|
||||
ui->m_pRadioSystemScope->setChecked(true);
|
||||
} else {
|
||||
ui->m_pRadioUserScope->setChecked(true);
|
||||
}
|
||||
|
||||
ui->m_pInvertConnection->setChecked(m_appConfig.invertConnection());
|
||||
|
||||
updateTlsControls();
|
||||
}
|
||||
|
||||
void SettingsDialog::updateTlsControls()
|
||||
{
|
||||
|
||||
if (QFile(m_appConfig.tlsCertPath()).exists()) {
|
||||
updateKeyLengthOnFile(m_appConfig.tlsCertPath());
|
||||
} else {
|
||||
const auto keyLengthText = QString::number(m_appConfig.tlsKeyLength());
|
||||
ui->m_pComboBoxTlsKeyLength->setCurrentIndex(ui->m_pComboBoxTlsKeyLength->findText(keyLengthText));
|
||||
}
|
||||
|
||||
const auto tlsEnabled = m_tlsUtility.isEnabled();
|
||||
const auto writable = m_appConfig.isActiveScopeWritable();
|
||||
|
||||
ui->m_pCheckBoxEnableTls->setEnabled(writable);
|
||||
ui->m_pCheckBoxEnableTls->setChecked(writable && tlsEnabled);
|
||||
ui->m_pLineEditTlsCertPath->setText(m_appConfig.tlsCertPath());
|
||||
}
|
||||
|
||||
void SettingsDialog::updateTlsControlsEnabled()
|
||||
{
|
||||
const auto writable = m_appConfig.isActiveScopeWritable();
|
||||
const auto clientMode = m_appConfig.clientGroupChecked();
|
||||
const auto tlsChecked = ui->m_pCheckBoxEnableTls->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);
|
||||
}
|
||||
|
||||
bool SettingsDialog::isClientMode() const
|
||||
{
|
||||
return m_coreProcess.mode() == deskflow::gui::CoreProcess::Mode::Client;
|
||||
}
|
||||
|
||||
void SettingsDialog::updateKeyLengthOnFile(const QString &path)
|
||||
{
|
||||
TlsCertificate ssl;
|
||||
if (!QFile(path).exists()) {
|
||||
qFatal("tls certificate file not found: %s", qUtf8Printable(path));
|
||||
}
|
||||
|
||||
auto length = ssl.getCertKeyLength(path);
|
||||
auto index = ui->m_pComboBoxTlsKeyLength->findText(QString::number(length));
|
||||
ui->m_pComboBoxTlsKeyLength->setCurrentIndex(index);
|
||||
m_appConfig.setTlsKeyLength(length);
|
||||
}
|
||||
|
||||
void SettingsDialog::updateControls()
|
||||
{
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
const auto serviceAvailable = true;
|
||||
#else
|
||||
// service not supported on unix yet, so always disable.
|
||||
const auto serviceAvailable = false;
|
||||
ui->m_pGroupService->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();
|
||||
|
||||
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->m_pCheckBoxServiceEnabled->setEnabled(writable && serviceAvailable);
|
||||
ui->m_pLabelElevate->setEnabled(writable && serviceChecked && serviceAvailable);
|
||||
ui->m_pComboElevate->setEnabled(writable && serviceChecked && serviceAvailable);
|
||||
|
||||
ui->m_pCheckBoxLanguageSync->setEnabled(writable && isClientMode());
|
||||
ui->m_pCheckBoxScrollDirection->setEnabled(writable && isClientMode());
|
||||
|
||||
ui->m_pLabelLogPath->setEnabled(writable && logToFile);
|
||||
ui->m_pLineEditLogFilename->setEnabled(writable && logToFile);
|
||||
ui->m_pButtonBrowseLog->setEnabled(writable && logToFile);
|
||||
|
||||
updateTlsControls();
|
||||
}
|
||||
|
||||
SettingsDialog::~SettingsDialog() = default;
|
||||
@ -1,91 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <QDialog>
|
||||
|
||||
#include "gui/config/AppConfig.h"
|
||||
#include "gui/config/IServerConfig.h"
|
||||
#include "gui/core/CoreProcess.h"
|
||||
#include "gui/tls/TlsUtility.h"
|
||||
#include "gui/validators/ValidationError.h"
|
||||
|
||||
namespace Ui {
|
||||
class SettingsDialog;
|
||||
}
|
||||
|
||||
class SettingsDialog : public QDialog
|
||||
{
|
||||
using IServerConfig = deskflow::gui::IServerConfig;
|
||||
using CoreProcess = deskflow::gui::CoreProcess;
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
void extracted();
|
||||
SettingsDialog(
|
||||
QWidget *parent, AppConfig &appConfig, const IServerConfig &serverConfig, const CoreProcess &coreProcess
|
||||
);
|
||||
~SettingsDialog() override;
|
||||
|
||||
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 accept() override;
|
||||
void reject() override;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
bool isClientMode() const;
|
||||
void updateTlsControls();
|
||||
void updateTlsControlsEnabled();
|
||||
void showReadOnlyMessage();
|
||||
|
||||
/// @brief Load all settings.
|
||||
void loadFromConfig();
|
||||
|
||||
/// @brief Enables or disables the TLS regenerate button.
|
||||
void updateTlsRegenerateButton();
|
||||
|
||||
/// @brief Updates the key length value based on the loaded file.
|
||||
void updateKeyLengthOnFile(const QString &path);
|
||||
|
||||
/// @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
|
||||
bool m_wasOriginallySystemScope = false;
|
||||
|
||||
std::unique_ptr<Ui::SettingsDialog> ui;
|
||||
AppConfig &m_appConfig;
|
||||
const IServerConfig &m_serverConfig;
|
||||
const CoreProcess &m_coreProcess;
|
||||
deskflow::gui::TlsUtility m_tlsUtility;
|
||||
};
|
||||
@ -1,799 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SettingsDialog</class>
|
||||
<widget class="QDialog" name="SettingsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>550</width>
|
||||
<height>625</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Preferences</string>
|
||||
</property>
|
||||
<property name="modal">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<property name="spacing">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="m_pTabWidget">
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::TabPosition::North</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="m_pTabRegular">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>&Regular</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupBasics">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Basics</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelComputerName">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Computer name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Maximum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_pLineEditScreenName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_pCheckBoxPreventSleep">
|
||||
<property name="text">
|
||||
<string>Prevent this computer from going to sleep</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_pCheckBoxLanguageSync">
|
||||
<property name="text">
|
||||
<string>Use server's keyboard language on this computer (client mode)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_pCheckBoxScrollDirection">
|
||||
<property name="text">
|
||||
<string>Invert scroll direction on this computer (client mode)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupApp">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>App</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_pCheckBoxAutoUpdate">
|
||||
<property name="text">
|
||||
<string>Check for updates on startup </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_pCheckBoxCloseToTray">
|
||||
<property name="text">
|
||||
<string>Leave app running in notification area when the window is closed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_pCheckBoxAutoHide">
|
||||
<property name="text">
|
||||
<string>Hide the window when the app starts</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupSecurity">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Security</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_pCheckBoxEnableTls">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable TLS encryption</string>
|
||||
</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>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelTlsKeyLength">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Key length</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="m_pComboBoxTlsKeyLength">
|
||||
<property name="currentText">
|
||||
<string>1024</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1024</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2048</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>4096</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelTlsCert">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Certificate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_pLineEditTlsCertPath">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="m_pPushButtonTlsCertPath">
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<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="m_pPushButtonTlsRegenCert">
|
||||
<property name="text">
|
||||
<string>Regenerate certificate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="m_pTabAdvanced">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>&Advanced</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<property name="spacing">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupNetworking">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Networking</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabel_20">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="m_pSpinBoxPort">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>65535</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>24800</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabel_21">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Network IP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_pLineEditInterface">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_pInvertConnection">
|
||||
<property name="text">
|
||||
<string>Invert server/client TCP connection</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupLogs">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Logs</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="topMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>7</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<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 row="0" column="0">
|
||||
<widget class="QCheckBox" name="m_pCheckBoxLogToFile">
|
||||
<property name="text">
|
||||
<string>Log to file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QComboBox" name="m_pComboLogLevel">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Info</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Debug</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Debug1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Debug2</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="m_pLabel_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Level</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelLogPath">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Log path</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_pLineEditLogFilename">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="m_pButtonBrowseLog">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupService">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Service</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<item>
|
||||
<widget class="QLabel" name="m_pLabelElevate">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Launch with elevated privileges</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="m_pComboElevate">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Specify when the Windows background service should run the server or client
|
||||
process at an elevated privilege level.</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>
|
||||
<p>You may want to alter whether or not the privilege level of the server or client
|
||||
process is automatically changed depending on your use case. In some cases it can help
|
||||
to diagnose or solve some problems related to elevated processes in Windows.</p>
|
||||
<ul>
|
||||
<li>Automatic: Elevate when the window session changes to secure mode</li>
|
||||
<li>Always elevate: Always run in elevated mode (could be unsafe)</li>
|
||||
<li>Never elevate: Turn off compatability with login screen and UAC</li>
|
||||
</ul>
|
||||
</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Automatic (as needed)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Always elevate</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Never elevate</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="m_pCheckBoxServiceEnabled">
|
||||
<property name="toolTip">
|
||||
<string>Whether to launch the server or client process through the Windows background
|
||||
service or direct from the GUI.</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>
|
||||
<p>The background service is only available on Windows.</p>
|
||||
<p>The Windows background service is used to:</p>
|
||||
<ul>
|
||||
<li>Start the server or client automatically when the computer starts.</li>
|
||||
<li>Run the server or client in an elevated mode (e.g. on login screen, UAC dialogs, etc).</li>
|
||||
</ul>
|
||||
</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use background service (daemon)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_pGroupScope">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Use settings profile from</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioUserScope">
|
||||
<property name="text">
|
||||
<string>Current user</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_pRadioSystemScope">
|
||||
<property name="text">
|
||||
<string>All users</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="m_pButtonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Save</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>m_pLineEditScreenName</tabstop>
|
||||
<tabstop>m_pSpinBoxPort</tabstop>
|
||||
<tabstop>m_pLineEditInterface</tabstop>
|
||||
<tabstop>m_pCheckBoxEnableTls</tabstop>
|
||||
<tabstop>m_pComboBoxTlsKeyLength</tabstop>
|
||||
<tabstop>m_pLineEditTlsCertPath</tabstop>
|
||||
<tabstop>m_pPushButtonTlsCertPath</tabstop>
|
||||
<tabstop>m_pPushButtonTlsRegenCert</tabstop>
|
||||
<tabstop>m_pCheckBoxLogToFile</tabstop>
|
||||
<tabstop>m_pComboLogLevel</tabstop>
|
||||
<tabstop>m_pLineEditLogFilename</tabstop>
|
||||
<tabstop>m_pButtonBrowseLog</tabstop>
|
||||
<tabstop>m_pRadioUserScope</tabstop>
|
||||
<tabstop>m_pRadioSystemScope</tabstop>
|
||||
<tabstop>m_pComboElevate</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>m_pButtonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>SettingsDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>266</x>
|
||||
<y>340</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_pButtonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>SettingsDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>334</x>
|
||||
<y>340</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@ -1,194 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "SetupWizard.h"
|
||||
#include "common/constants.h"
|
||||
#include "gui/Logger.h"
|
||||
#include "gui/config/AppConfig.h"
|
||||
#include "gui/config/ConfigScopes.h"
|
||||
#include "gui/constants.h"
|
||||
#include "gui/diagnostic.h"
|
||||
#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 <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QGuiApplication>
|
||||
#include <QMessageBox>
|
||||
#include <QObject>
|
||||
#include <QtGlobal>
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <cstdlib>
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
|
||||
#include <QLoggingCategory>
|
||||
#endif
|
||||
|
||||
using namespace deskflow::gui;
|
||||
|
||||
class QThreadImpl : public QThread
|
||||
{
|
||||
public:
|
||||
static void msleep(unsigned long msecs)
|
||||
{
|
||||
QThread::msleep(msecs);
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
bool checkMacAssistiveDevices();
|
||||
#endif
|
||||
|
||||
bool hasArg(const QString &arg, const QStringList &args)
|
||||
{
|
||||
return std::ranges::any_of(args, [&arg](const QString &a) { return a == arg; });
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
|
||||
// Fixes Fedora bug where qDebug() messages aren't printed.
|
||||
QLoggingCategory::setFilterRules(QStringLiteral("*.debug=true\nqt.*=false"));
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
/* Workaround for QTBUG-40332 - "High ping when QNetworkAccessManager is
|
||||
* instantiated" */
|
||||
::setenv("QT_BEARER_POLL_TIMEOUT", "-1", 1);
|
||||
#endif
|
||||
|
||||
QCoreApplication::setApplicationName(kAppName);
|
||||
QCoreApplication::setOrganizationName(kAppName);
|
||||
QGuiApplication::setDesktopFileName(QStringLiteral("org.deskflow.deskflow"));
|
||||
|
||||
// used as a prefix for settings paths, and must not be a url.
|
||||
QCoreApplication::setOrganizationDomain(kOrgDomain);
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
#if !defined(Q_OS_MAC)
|
||||
// causes dark mode to be used on some DE's
|
||||
if (qEnvironmentVariable("XDG_CURRENT_DESKTOP") != QLatin1String("KDE")) {
|
||||
QApplication::setStyle("fusion");
|
||||
}
|
||||
#endif
|
||||
|
||||
qInstallMessageHandler(deskflow::gui::messages::messageHandler);
|
||||
qInfo("%s v%s", kAppName, qPrintable(kVersion));
|
||||
|
||||
dotenv();
|
||||
Logger::instance().loadEnvVars();
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
|
||||
if (app.applicationDirPath().startsWith("/Volumes/")) {
|
||||
QString msgBody = QStringLiteral("Please drag %1 to the Applications folder, "
|
||||
"and open it from there.");
|
||||
QMessageBox::information(NULL, kAppName, msgBody.arg(kAppName));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!checkMacAssistiveDevices()) {
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
ConfigScopes configScopes;
|
||||
|
||||
// --no-reset
|
||||
QStringList arguments = QCoreApplication::arguments();
|
||||
const auto noReset = hasArg("--no-reset", arguments);
|
||||
const auto resetEnvVar = strToTrue(qEnvironmentVariable("DESKFLOW_RESET_ALL"));
|
||||
if (resetEnvVar && !noReset) {
|
||||
diagnostic::clearSettings(configScopes, false);
|
||||
}
|
||||
|
||||
AppConfig appConfig(configScopes);
|
||||
|
||||
QObject::connect(
|
||||
&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();
|
||||
}
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
bool checkMacAssistiveDevices()
|
||||
{
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 // mavericks
|
||||
|
||||
// new in mavericks, applications are trusted individually
|
||||
// with use of the accessibility api. this call will show a
|
||||
// prompt which can show the security/privacy/accessibility
|
||||
// tab, with a list of allowed applications. deskflow should
|
||||
// show up there automatically, but will be unchecked.
|
||||
|
||||
if (AXIsProcessTrusted()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const void *keys[] = {kAXTrustedCheckOptionPrompt};
|
||||
const void *trueValue[] = {kCFBooleanTrue};
|
||||
CFDictionaryRef options = CFDictionaryCreate(NULL, keys, trueValue, 1, NULL, NULL);
|
||||
|
||||
bool result = AXIsProcessTrustedWithOptions(options);
|
||||
CFRelease(options);
|
||||
return result;
|
||||
|
||||
#else
|
||||
|
||||
// now deprecated in mavericks.
|
||||
bool result = AXAPIEnabled();
|
||||
if (!result) {
|
||||
QString msgBody = QString("Please enable access to assistive devices "
|
||||
"System Preferences -> Security & Privacy -> "
|
||||
"Privacy -> Accessibility, then re-open %1.");
|
||||
QMessageBox::information(NULL, kAppName, msgBody.arg(kAppName));
|
||||
}
|
||||
return result;
|
||||
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@ -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
|
||||
@ -1,56 +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 "ServerStateLabel.h"
|
||||
|
||||
#include "gui/core/ServerMessage.h"
|
||||
|
||||
using namespace deskflow::gui;
|
||||
|
||||
namespace deskflow::gui::widgets {
|
||||
|
||||
ServerStateLabel::ServerStateLabel(QWidget *parent) : QLabel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void ServerStateLabel::updateServerState(const QString &line)
|
||||
{
|
||||
ServerMessage message(line);
|
||||
|
||||
if (message.isExitMessage()) {
|
||||
m_clients.clear();
|
||||
} else if (message.isConnectedMessage()) {
|
||||
m_clients.append(message.getClientName());
|
||||
} else if (message.isDisconnectedMessage()) {
|
||||
m_clients.removeAll(message.getClientName());
|
||||
}
|
||||
|
||||
if (m_clients.isEmpty()) {
|
||||
setText(tr("No clients connected"));
|
||||
} else {
|
||||
// unfortunately, we can't rely on the clients list because we don't always
|
||||
// catch the connect/disconnect messages. so clients tend to get stuck in
|
||||
// the list even though they're offline.
|
||||
// in order to properly show a list of clients, we would need the core to
|
||||
// print a list of connected clients on every connect/disconnect event,
|
||||
// which could be a bit noisy in the logs (perhaps an ipc message would be
|
||||
// needed).
|
||||
setText(tr("Client(s) are connected"));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace deskflow::gui::widgets
|
||||
@ -1,37 +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>
|
||||
#include <QStringList>
|
||||
|
||||
namespace deskflow::gui::widgets {
|
||||
|
||||
class ServerStateLabel : public QLabel
|
||||
{
|
||||
public:
|
||||
explicit ServerStateLabel(QWidget *parent = nullptr);
|
||||
void updateServerState(const QString &line);
|
||||
|
||||
private:
|
||||
QStringList m_clients;
|
||||
|
||||
void updateState();
|
||||
};
|
||||
|
||||
} // namespace deskflow::gui::widgets
|
||||
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "TrashScreenWidget.h"
|
||||
|
||||
#include <QDragEnterEvent>
|
||||
#include <QDropEvent>
|
||||
#include <QMimeData>
|
||||
|
||||
#include "ScreenSetupModel.h"
|
||||
|
||||
void TrashScreenWidget::dragEnterEvent(QDragEnterEvent *event)
|
||||
{
|
||||
if (event->mimeData()->hasFormat(ScreenSetupModel::mimeType())) {
|
||||
event->setDropAction(Qt::MoveAction);
|
||||
event->accept();
|
||||
} else
|
||||
event->ignore();
|
||||
}
|
||||
|
||||
void TrashScreenWidget::dropEvent(QDropEvent *event)
|
||||
{
|
||||
if (event->mimeData()->hasFormat(ScreenSetupModel::mimeType())) {
|
||||
event->acceptProposedAction();
|
||||
Q_EMIT screenRemoved();
|
||||
} else {
|
||||
event->ignore();
|
||||
}
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
class QWidget;
|
||||
class QDragEnterEvent;
|
||||
class QDropEvent;
|
||||
|
||||
class TrashScreenWidget : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TrashScreenWidget(QWidget *parent) : QLabel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
void dropEvent(QDropEvent *event);
|
||||
|
||||
signals:
|
||||
void screenRemoved();
|
||||
};
|
||||
1
src/apps/deskflow-server/.gitignore
vendored
1
src/apps/deskflow-server/.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-server)
|
||||
set(target ${CMAKE_PROJECT_NAME}-server)
|
||||
|
||||
if(WIN32)
|
||||
# Generate rc file
|
||||
set(EXE_DESCRIPTION "${CMAKE_PROJECT_PROPER_NAME} server 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-server.exe.manifest
|
||||
deskflow-server.rc
|
||||
MSWindowsServerTaskBarReceiver.cpp
|
||||
MSWindowsServerTaskBarReceiver.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
|
||||
OSXServerTaskBarReceiver.cpp
|
||||
OSXServerTaskBarReceiver.h
|
||||
)
|
||||
elseif(UNIX)
|
||||
set(PLATFORM_SOURCES
|
||||
XWindowsServerTaskBarReceiver.cpp
|
||||
XWindowsServerTaskBarReceiver.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}.rc
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable(${target} ${PLATFORM_SOURCES} deskflow-server.cpp)
|
||||
add_executable(${target} ${PLATFORM_SOURCES} ${target}.cpp)
|
||||
|
||||
target_link_libraries(
|
||||
${target}
|
||||
@ -52,17 +32,21 @@ 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")
|
||||
generate_app_man(${target})
|
||||
elseif(WIN32)
|
||||
install(
|
||||
TARGETS ${target}
|
||||
RUNTIME_DEPENDENCY_SET serverDeps
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user