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.
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.
Before this change syncthingwidgets unconditionally included the header
from libsyncthing so it couldn't be used as stand-alone library if
libsyncthing was disabled.
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.
* 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
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.
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.
* 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
* Pass program and arguments directly
* Prevent failure on white space in executable path
* Use own parser for arguments
* Make libsyncthing accessible from launcher
Add new SyncthingLauncher class which lauches Syncthing
under the hood via external SyncthingProcess or using
libsyncthing.
Note: Launching via libsyncthing is still experimental.