videodownloader/gui/settings.h

90 lines
2.1 KiB
C
Raw Normal View History

2015-04-22 19:32:04 +02:00
#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H
// is not required here when building with GCC 4.9.1 or Clan 3.5 - MinGW 4.9.1 fails without including UI headers here
2015-12-05 22:56:32 +01:00
#include "ui_targetpage.h"
#include "ui_proxypage.h"
#include "ui_useragentpage.h"
2015-04-22 19:32:04 +02:00
#include <qtutilities/settingsdialog/settingsdialog.h>
#include <qtutilities/settingsdialog/optionpage.h>
2016-04-04 14:51:51 +02:00
QT_FORWARD_DECLARE_CLASS(QByteArray)
QT_FORWARD_DECLARE_CLASS(QLabel)
QT_FORWARD_DECLARE_CLASS(QLineEdit)
QT_FORWARD_DECLARE_CLASS(QCheckBox)
QT_FORWARD_DECLARE_CLASS(QNetworkProxy)
2015-04-22 19:32:04 +02:00
namespace Network {
class Download;
}
namespace QtGui {
2016-04-04 14:51:51 +02:00
BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE(TargetPage)
DECLARE_SETUP_WIDGETS
2015-04-22 19:32:04 +02:00
public:
static QString &targetDirectory();
static bool &overwriteWithoutAsking();
static bool &determineTargetFileWithoutAsking();
private:
void selectTargetDirectory();
2016-04-04 14:51:51 +02:00
END_DECLARE_OPTION_PAGE
2015-04-22 19:32:04 +02:00
2016-04-04 14:51:51 +02:00
BEGIN_DECLARE_OPTION_PAGE(UiPage)
DECLARE_SETUP_WIDGETS
2015-04-22 19:32:04 +02:00
public:
static QByteArray &mainWindowGeometry();
static QByteArray &mainWindowState();
static bool &multiSelection();
private:
QCheckBox *m_multiSelectionCheckBox;
2016-04-04 14:51:51 +02:00
END_DECLARE_OPTION_PAGE
2015-04-22 19:32:04 +02:00
2016-04-04 14:51:51 +02:00
BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE(ProxyPage)
DECLARE_SETUP_WIDGETS
2015-04-22 19:32:04 +02:00
public:
static QNetworkProxy &proxy();
private:
void updateProxy();
2016-04-04 14:51:51 +02:00
END_DECLARE_OPTION_PAGE
2015-04-22 19:32:04 +02:00
2016-04-04 14:51:51 +02:00
BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE(UserAgentPage)
2015-04-22 19:32:04 +02:00
public:
static bool &useCustomUserAgent();
static QString &customUserAgent();
2016-04-04 14:51:51 +02:00
END_DECLARE_OPTION_PAGE
2015-04-22 19:32:04 +02:00
2016-04-04 14:51:51 +02:00
BEGIN_DECLARE_OPTION_PAGE(MiscPage)
DECLARE_SETUP_WIDGETS
2015-04-22 19:32:04 +02:00
public:
static bool &redirectWithoutAsking();
private:
QCheckBox *m_redirectCheckBox;
2016-04-04 14:51:51 +02:00
END_DECLARE_OPTION_PAGE
2015-04-22 19:32:04 +02:00
2016-04-04 14:51:51 +02:00
BEGIN_DECLARE_OPTION_PAGE(StatsPage)
DECLARE_SETUP_WIDGETS
2015-04-22 19:32:04 +02:00
public:
static quint64 &bytesReceived();
private:
QLabel *m_receivedLabel;
2016-04-04 14:51:51 +02:00
END_DECLARE_OPTION_PAGE
2015-04-22 19:32:04 +02:00
class SettingsDialog : public Dialogs::SettingsDialog
{
Q_OBJECT
public:
explicit SettingsDialog(QWidget *parent = nullptr);
~SettingsDialog();
};
extern void restoreSettings();
extern void saveSettings();
extern void applySettingsToDownload(Network::Download *download);
}
#endif // SETTINGSDIALOG_H