2016-08-25 00:45:32 +02:00
|
|
|
#ifndef SETTINGS_DIALOG_H
|
|
|
|
#define SETTINGS_DIALOG_H
|
|
|
|
|
|
|
|
#include <qtutilities/settingsdialog/settingsdialog.h>
|
|
|
|
#include <qtutilities/settingsdialog/optionpage.h>
|
|
|
|
#include <qtutilities/settingsdialog/qtsettings.h>
|
|
|
|
|
|
|
|
#include <QWidget>
|
2016-09-03 19:39:43 +02:00
|
|
|
#include <QProcess>
|
2016-08-25 00:45:32 +02:00
|
|
|
|
|
|
|
namespace Settings {
|
|
|
|
class KnownFieldModel;
|
|
|
|
class TargetLevelModel;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Data {
|
|
|
|
class SyncthingConnection;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace QtGui {
|
|
|
|
|
|
|
|
BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE_CUSTOM_CTOR(ConnectionOptionPage)
|
|
|
|
public:
|
|
|
|
ConnectionOptionPage(Data::SyncthingConnection *connection, QWidget *parentWidget = nullptr);
|
|
|
|
private:
|
|
|
|
DECLARE_SETUP_WIDGETS
|
2016-09-01 16:34:30 +02:00
|
|
|
void insertFromConfigFile();
|
2016-08-25 00:45:32 +02:00
|
|
|
void updateConnectionStatus();
|
|
|
|
void applyAndReconnect();
|
|
|
|
Data::SyncthingConnection *m_connection;
|
|
|
|
END_DECLARE_OPTION_PAGE
|
|
|
|
|
|
|
|
DECLARE_UI_FILE_BASED_OPTION_PAGE(NotificationsOptionPage)
|
|
|
|
|
2016-08-29 20:51:30 +02:00
|
|
|
DECLARE_UI_FILE_BASED_OPTION_PAGE(AppearanceOptionPage)
|
|
|
|
|
2016-09-03 19:39:43 +02:00
|
|
|
DECLARE_UI_FILE_BASED_OPTION_PAGE_CUSTOM_SETUP(AutostartOptionPage)
|
2016-08-25 00:45:32 +02:00
|
|
|
|
2016-09-03 19:39:43 +02:00
|
|
|
BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE(LauncherOptionPage)
|
|
|
|
private:
|
|
|
|
DECLARE_SETUP_WIDGETS
|
|
|
|
void handleSyncthingReadyRead();
|
|
|
|
void handleSyncthingExited(int exitCode, QProcess::ExitStatus exitStatus);
|
|
|
|
void launch();
|
|
|
|
void stop();
|
|
|
|
QList<QMetaObject::Connection> m_connections;
|
|
|
|
bool m_kill;
|
|
|
|
END_DECLARE_OPTION_PAGE
|
|
|
|
|
|
|
|
#ifndef SYNCTHINGTRAY_NO_WEBVIEW
|
2016-08-25 00:45:32 +02:00
|
|
|
DECLARE_UI_FILE_BASED_OPTION_PAGE(WebViewOptionPage)
|
|
|
|
#else
|
|
|
|
DECLARE_OPTION_PAGE(WebViewOptionPage)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class SettingsDialog : public Dialogs::SettingsDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit SettingsDialog(Data::SyncthingConnection *connection, QWidget *parent = nullptr);
|
|
|
|
~SettingsDialog();
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SETTINGS_DIALOG_H
|