syncthingtray/tray/application/settings.h

94 lines
1.7 KiB
C
Raw Normal View History

2016-08-25 00:45:32 +02:00
#ifndef SETTINGS_H
#define SETTINGS_H
#include "../../connector/syncthingconnectionsettings.h"
2016-11-02 20:03:38 +01:00
#include <qtutilities/settingsdialog/qtsettings.h>
2016-08-25 00:45:32 +02:00
#include <c++utilities/conversion/types.h>
2016-09-03 20:14:52 +02:00
#include <QString>
#include <QByteArray>
2016-11-02 20:03:38 +01:00
#include <QSize>
#include <QFrame>
#include <QTabWidget>
2016-09-03 20:14:52 +02:00
#include <vector>
2016-08-25 00:45:32 +02:00
namespace Media {
enum class TagUsage;
enum class ElementPosition;
}
namespace Dialogs {
class QtSettings;
}
namespace Settings {
2016-11-02 20:03:38 +01:00
struct Connection
{
Data::SyncthingConnectionSettings primary;
std::vector<Data::SyncthingConnectionSettings> 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;
};
struct Launcher
{
bool enabled = false;
QString syncthingPath =
#ifdef PLATFORM_WINDOWS
QStringLiteral("syncthing.exe");
#else
QStringLiteral("syncthing");
#endif
QString syncthingArgs;
QString syncthingCmd() const;
};
2016-08-25 00:45:32 +02:00
#if defined(SYNCTHINGTRAY_USE_WEBENGINE) || defined(SYNCTHINGTRAY_USE_WEBKIT)
2016-11-02 20:03:38 +01:00
struct WebView
{
bool disabled = false;
double zoomFactor = 1.0;
QByteArray geometry;
bool keepRunning = true;
};
2016-08-25 00:45:32 +02:00
#endif
2016-11-02 20:03:38 +01:00
struct Settings
{
bool firstLaunch = false;
Connection connection;
NotifyOn notifyOn;
Appearance appearance;
Launcher launcher;
#if defined(SYNCTHINGTRAY_USE_WEBENGINE) || defined(SYNCTHINGTRAY_USE_WEBKIT)
WebView webView;
#endif
Dialogs::QtSettings qt;
};
2016-08-25 00:45:32 +02:00
2016-11-02 20:03:38 +01:00
Settings &values();
2016-08-25 00:45:32 +02:00
void restore();
void save();
}
#endif // SETTINGS_H