Commit Graph

431 Commits

Author SHA1 Message Date
2c892d583f Fix possibly broken event handling in SyncthingProcess
The lock must not only be tried to be acquired. Otherwise we'd might skip
e.g. the exit handler when one of the other handlers still owns the lock.
2023-01-12 22:57:11 +01:00
bae5779cb3 Fix typo in doc string 2023-01-12 22:53:36 +01:00
a541b9ba35 Fix crash in launcher when executable is empty or not found 2023-01-12 22:53:18 +01:00
268164748f Improve error message when the executable path in the launcher is empty
* Show error "executable path is empty" instead of "Unknown error"
2023-01-12 22:39:47 +01:00
9da5392c35 Fix warnings about unqualified slot arguments 2023-01-09 15:34:51 +01:00
256e90a0cb Avoid warning about unqualified std cast 2022-11-04 16:51:01 +01:00
0ab21657c4 Mock locating config file for wizard tests to be independent of Qt's behavior
Maybe overriding `HOME` is not sufficient for faking a different home dir
to be picked up by `QStandardPaths`. So this change makes
`LIB_SYNCTHING_CONNECTOR_SYNCTHING_CONFIG_DIR` a hard override and uses it
in tests to fake a different path independently from the behavior of
`QStandardPaths`.
2022-11-03 21:35:03 +01:00
2b5c8b6059 Use qEnvironmentVariable via compat header from qtutilities 2022-10-29 21:39:43 +02:00
48d78c1758 Pass context when connecting signals for tests 2022-10-29 20:32:54 +02:00
8e484f246e Allow overriding Syncthing config dir via environment variable 2022-10-23 15:05:47 +02:00
67c4e806bd Fix detection of disabled Syncthing systemd unit in wizard
`isUnitAvailable()` would return false for disabled units (that could be
enabled) so `canEnableOrStart()` must return true even if only
`isDisabled()` returns true.
2022-10-22 21:31:03 +02:00
6594a667af Update translations 2022-10-22 12:40:57 +02:00
77cea5aead Tie suppressing notifications to "reconnect integrations" of launcher/service
So suppressing notifications by either the launcher status or service
status can be enabled/disabled together with the re-connect tweaking. This
makes more sense than having it unconditionally enabled and makes the
presence of the feature (and when it is effective) also more visible to
users.
2022-10-22 12:32:24 +02:00
525b2c2f94 Improve tracking of whether Syncthing has been stopped manually
* Don't consider the proccess manually stopped by default; otherwise that's
  considered to be the case even though the launcher isn't used at all
* Unset the service being manually stopped only when there's an actual
  state transition to running; otherwise we'd immediately unset the flag
  after manually stopping the service
2022-10-22 12:06:18 +02:00
2abb468d93 Fix typo 2022-10-02 20:34:40 +02:00
4f58b2cb7e Fix determining whether GUI address is local
The port must be stripped from the address before passing it to
`isLocal()` which only expects a hostname.
2022-09-25 22:40:37 +02:00
3320f712db Fix condition when making Syncthing URL
TLS is preferred when the address is *not* local.
2022-09-25 22:13:44 +02:00
6e6fbf757b Fix buffering further output in SyncthingProcess without event loop
When the calling code does not return to the event loop (like the CLI test)
we need to run the event loop internally to make sure `bufferOutput()` is
called as of ecd730fd49.
2022-09-18 19:59:46 +02:00
ecd730fd49 Avoid crash when invoking short-lived process via SyncthingProcess
At least when using Qt 6 I could reproduce crashes very often when invoking
`syncthing -version` as part of the wizard's setup detection (inside
a `QIODevice::readAll()` call).

I suppose the problem is that the callback `bufferOutput()` is already
invoked  on another thread and emitting the next `readyRead()` signal while
Qt is still handling the previous `readData()` call. Continuing reading
from the pipe only after `readData()` returns should fix it. At least it
does not crash anymore with that change in the wizard's setup detection.
2022-09-17 22:52:26 +02:00
25b9116250 Show only relevant options in wizard and improve UI for displaying details 2022-08-27 23:35:15 +02:00
14c4aa618b Remove redundant META_PUBLIC_QT_MODULES 2022-08-09 11:08:27 +02:00
95ff84afb8 Update translations 2022-08-02 20:17:35 +02:00
788a5b2947 Allow opening dir in file browser if path contains tilde
See https://github.com/Martchus/syncthingtray/issues/148
2022-08-02 20:15:24 +02:00
a7370fd8b8 Update translations 2022-07-26 23:59:42 +02:00
80c608208d Show status text "Connecting to Syncthing ... " when connecting
instead of just "Not connected to Syncthing"
2022-07-26 23:52:26 +02:00
a49da56829 Update translations 2022-07-16 19:37:00 +02:00
97a8dc3f99 Apply clang-format 2022-07-16 12:30:51 +02:00
18d7e51c31 Improve documentation of MiscTests::testService() 2022-07-04 22:28:35 +02:00
0865d11d42 Update translations 2022-07-04 21:55:28 +02:00
81b15b904f Improve systemd integration
* Read properties from unit interface only if it is valid and set a timeout
  to prevent the UI from hanging
* Query the unit file state in case the unit itself cannot be queries so
  the file state of disabled units with no status is shown correctly
* Reload unit status when starting a disabled unit with no status so the
  effect is visible
2022-07-04 21:55:15 +02:00
e7098002c1 Update translations 2022-07-04 19:59:53 +02:00
d735455c2a Add button to reload all unit files 2022-07-04 19:55:58 +02:00
cc31872fc7 Show effect of enabling/disabling systemd unit immediately by reloading manager 2022-07-04 19:32:06 +02:00
0b8d52563b Fix use of bitwise | with boolean 2022-07-04 18:20:54 +02:00
835ba78b85 Make readMockFile() static and MockedReply final 2022-06-07 10:43:48 +02:00
54b9b5e7cd Update translations 2022-06-07 10:42:38 +02:00
4b174eae20 Add option to ignore folder "out-of-sync" errors for overall status
* Add option to ignore unread notifications as well to cover all those
  extra cases
* See https://github.com/Martchus/syncthingtray/issues/141
2022-06-07 10:42:22 +02:00
a299e9246f Add remarks about deprecated events 2022-06-06 11:42:49 +02:00
4d47ceae55 Fix wrong comment 2022-06-06 11:36:37 +02:00
8052d04252 Avoid using deprecated folderID 2022-06-06 11:30:35 +02:00
3b50d78f1e Use resource lock to avoid concurrent execution of tests requiring Syncthing test instance
This is likely the cleaner approach compared to just enforcing a serial run
for the CLI test.
2021-10-13 00:14:35 +02:00
1f74a82ecb Adapt test for loading self-signed certificate 2021-10-12 23:55:17 +02:00
77f0a8d5ae Update translations 2021-10-09 01:15:49 +02:00
c63719e2d1 Check whether loaded certificate is not null 2021-10-09 01:14:54 +02:00
3c6716ebb9 Expect more TLS error types to support Schannel backend
Apparently the Schannel backend also produces
`QSslError::CertificateUntrusted` errors. Also adding
`QSslError::CertificateRejected` to be sure.
2021-10-09 01:14:54 +02:00
ab605049aa Improve TLS error messages
* Add fallback to .toPem() when .toText() is not implemented by the TLS
  plugin
* Add error number (Qt's enum value)
* Remove leftover cerr logging
2021-10-09 01:14:54 +02:00
c3182ff256 Apply cmake-format 2021-10-07 18:28:13 +02:00
8b273b6945 Improve messages for TLS errors
Before one only gets the generic error "TLS handshake failed". Now one gets
more details error messages plus the problematic certificate. This should
be helpful for debugging.
2021-10-07 18:22:41 +02:00
Julianne420
ddefa35daa Add zh_CN translation 2021-10-07 01:20:24 +08:00
8261a161ab Set default re-connect interval back to 30 seconds
See https://github.com/Martchus/syncthingtray/issues/16#issuecomment-932986686
2021-10-03 23:05:49 +02:00