#ifndef SETTINGS_H #define SETTINGS_H #include "../../connector/syncthingconnectionsettings.h" #include #include #include #include #include #include #include #include #include namespace Media { enum class TagUsage; enum class ElementPosition; } namespace Dialogs { class QtSettings; } namespace Data { class SyncthingProcess; } namespace Settings { struct Connection { Data::SyncthingConnectionSettings primary; std::vector secondary; }; struct NotifyOn { bool disconnect = true; bool internalErrors = true; bool syncComplete = true; bool syncthingErrors = true; }; struct Appearance { bool showTraffic = true; QSize trayMenuSize = QSize(450, 400); int frameStyle = QFrame::StyledPanel | QFrame::Sunken; int tabPosition = QTabWidget::South; bool brightTextColors = false; }; struct ToolParameter { QString path; QString args; bool autostart = false; }; struct Launcher { bool enabled = false; QString syncthingPath = #ifdef PLATFORM_WINDOWS QStringLiteral("syncthing.exe"); #else QStringLiteral("syncthing"); #endif QString syncthingArgs; QHash tools; QString syncthingCmd() const; QString toolCmd(const QString &tool) const; static Data::SyncthingProcess &toolProcess(const QString &tool); void autostart() const; static void terminate(); }; #ifdef LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD struct Systemd { QString syncthingUnit = QStringLiteral("syncthing.service"); bool showButton = false; bool considerForReconnect = false; }; #endif #if defined(SYNCTHINGTRAY_USE_WEBENGINE) || defined(SYNCTHINGTRAY_USE_WEBKIT) struct WebView { bool disabled = false; double zoomFactor = 1.0; QByteArray geometry; bool keepRunning = true; }; #endif struct Settings { bool firstLaunch = false; Connection connection; NotifyOn notifyOn; #ifdef QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS bool dbusNotifications = false; #endif unsigned int ignoreInavailabilityAfterStart = 15; Appearance appearance; Launcher launcher; #ifdef LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD Systemd systemd; #endif #if defined(SYNCTHINGTRAY_USE_WEBENGINE) || defined(SYNCTHINGTRAY_USE_WEBKIT) WebView webView; #endif Dialogs::QtSettings qt; }; Settings &values(); void restore(); void save(); } #endif // SETTINGS_H