Commit Graph

38 Commits

Author SHA1 Message Date
Martchus 4c6315b450 Terminate Syncthing gracefully via REST-API on non-UNIX platforms (2)
A follow up to 0faacaa7c8 to cover the stop button within the launcher
and terminating Syncthing on shutdown/exit. To find the relevant connection
the connection settings are searched for a local URL where the port matches
the port from the Syncthing process log.
2021-07-15 02:38:26 +02:00
Martchus ac033517cc Allow configuring rendering size of status icons
The default of 32 px should be fine in most cases and when the UI is scaled
it is also automatically scaled. However, if one has a tray area or Plasma
panel with extraordinarily big icons like latte-dock it might still be
required to render icons at a higher resolution. This is hard to determine
programmatically so I'm just adding a manual setting.
2021-04-21 18:23:20 +02:00
Martchus 8ec9038b2c Better decouple syncthingwidgets from libsyncthing if libsyncthing is disabled
Before this change syncthingwidgets unconditionally included the header
from libsyncthing so it couldn't be used as stand-alone library if
libsyncthing was disabled.
2021-02-03 00:01:34 +01:00
Martchus 975e86c895 Allow backend libraries to be used from other projects
So far the backend libraries' include paths were relative within this
repository. This means the header files could not be used at their
installed location.

This change replaces them with "<>" includes to fix that problem and adds
a new include directory so building everything at once still works.

With this change it should be easier to actually split some parts into
another repository if this one would become too big.
2021-01-25 19:48:11 +01:00
Martchus 7a5cd3c65f Fix clazy warning about detatching Qt container 2021-01-04 18:52:23 +01:00
Martchus c656f6fba0 Load/save status compution flags from/to settings 2020-12-31 03:08:08 +01:00
Martchus 28a8391f2b Update libsyncthing to v1.5.0, support setting data directory 2020-05-05 19:01:05 +02:00
Martchus a744ea642e Remove hash<QString> implementation from settings.cpp 2020-03-02 16:14:53 +01:00
Martchus 94753de797 Fix start/stop button tooltip for system-wide systemd service 2020-02-02 19:51:16 +01:00
Martchus 0b377c263b Avoid code duplication in settings.cpp 2020-01-23 19:36:20 +01:00
Martchus 677644a17a Apply clang-tidy 2020-01-23 19:35:35 +01:00
Martchus 309ff054a0 Add option to connect automatically on startup 2020-01-23 19:09:51 +01:00
Martchus 287ec5542b Allow setting log level when using libsyncthing 2020-01-20 22:30:42 +01:00
Martchus 32f78b74fd Overhaul systemd integration, support system-wide units
* Lazy initialize systemd interface and don't initialize it
  at all if the unit name is empty
* Allow to supervise/control system-wide units in addition to
  user units (see https://github.com/Martchus/syncthingtray/issues/61)
* Avoid redundant code
2019-12-18 00:18:46 +01:00
Martchus 37893f77cb Fix compilation with Qt >= 5.14.0 2019-10-20 03:37:44 +02:00
Martchus 353f1e2463 Allow to distinguish icon colors within UI and system tray
This is useful because sometimes the background color of the system
tray is dark but the overall system UI still uses a light theme.

For the Plasmoid this should never be the case, though. Hence the
extra settings are not available there.
2019-07-31 20:16:43 +02:00
Martchus 972f7b2776 Stop libsyncthing when stopping the application 2019-07-29 16:00:41 +02:00
Martchus 1bdba31c70 Improve behavior under Wayland
* Add workaround for using QCursor::pos()
* Set window flags and parent of TrayMenu to it is shown
  like a context menu
2019-07-27 15:04:14 +02:00
Martchus fb3c9e9635 Adjust launcher/service apply yet another time
* Only reconnect later if the launcher/service is actually running
* Don't try to reconnect if systemd unit is not available
2019-07-26 16:36:48 +02:00
Martchus 1ce8ec9c5f Consider systemd status only relevant if unit is available
If the unit is not available is is not possible to tell whether the
service is running or not so the systemd status should not be
considered yet. As soon as the status changes Systemd::apply() is
executed again and the status possibly considered.
2019-07-25 18:32:52 +02:00
Martchus 038225936e Base libsyncthing on official library refactoring 2019-07-17 17:53:36 +02:00
Martchus fe332078f1 Improve taking the launcher status into account when connecting
* Take the time the launcher is active into account (in the same
  way as it is done for the systemd service)
* Fix case when systemd service would be relevant but configured
  to consider the launcher status
2019-07-13 17:59:48 +02:00
Martchus c521e2f808 Apply clang-format 2019-07-13 13:21:25 +02:00
Martchus 335913c8ca Fix build without systemd support 2019-07-13 13:21:02 +02:00
Martchus 2112b00347 Allow to show start/stop button for launcher 2019-07-12 20:32:55 +02:00
Martchus 31bb92da89 Show notifications about launcher errors 2019-07-12 20:25:24 +02:00
Martchus 64473df5ba Adapt to changes in c++utilities 2019-06-10 22:48:26 +02:00
Martchus 05da0465a7 Allow customizing status icon colors 2019-05-19 17:57:37 +02:00
Martchus 988765f2ba Show new dev/dir notifications in usual tray icon and Plasmoid 2018-05-01 22:27:03 +02:00
Martchus 0d635e5ad5 Refactor launcher
* Pass program and arguments directly
    * Prevent failure on white space in executable path
    * Use own parser for arguments
* Make libsyncthing accessible from launcher
2018-04-18 23:27:45 +02:00
Martchus 0ceb8d5e79 Add high-level abstraction for launching Syncthing
Add new SyncthingLauncher class which lauches Syncthing
under the hood via external SyncthingProcess or using
libsyncthing.

Note: Launching via libsyncthing is still experimental.
2018-04-11 23:16:00 +02:00
Martchus 6d155d3d63 Make considering launcher for reconnects configurable
Similar to the systemd configuration
2018-04-03 00:11:55 +02:00
Martchus 0c104f60b8 Wait till all processes finished, ask for killing
See https://github.com/Martchus/syncthingtray/issues/15
2018-04-02 23:32:52 +02:00
Martchus 146d4870e4 Refactor preventing unwanted error messages
* See https://github.com/Martchus/syncthingtray/issues/15
* Not tested yet
2018-04-02 20:35:30 +02:00
Martchus d2eb4addd9 Distinguish between local an remote sync in settings 2018-03-31 22:31:28 +02:00
Martchus 69ffaeb1f3 Apply tidy after updating to clang-format 5.0.0
The behavior of clang-format slightly changed in Clang 5.0.0:
http://releases.llvm.org/5.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
2017-09-17 21:48:15 +02:00
Martchus 732a5fdd8d Apply clang-format 2017-05-01 03:34:43 +02:00
Martchus 49ff5a7b65 Move widgets from tray app to separate lib
So settings pages, web view and other widgets
can be used in other components such as the
Dolphin plugin and Plasmoid, too.
2017-04-23 18:31:18 +02:00