mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Redesign main core classes.
This commit is contained in:
@@ -43,6 +43,8 @@
|
||||
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
#include "core/types.h"
|
||||
|
||||
enum scheduler_days
|
||||
{
|
||||
EVERY_DAY,
|
||||
@@ -57,12 +59,6 @@ enum scheduler_days
|
||||
SUN
|
||||
};
|
||||
|
||||
enum maxRatioAction
|
||||
{
|
||||
PAUSE_ACTION,
|
||||
REMOVE_ACTION
|
||||
};
|
||||
|
||||
namespace Proxy
|
||||
{
|
||||
enum ProxyType
|
||||
@@ -101,7 +97,9 @@ class Preferences: public QObject
|
||||
Q_DISABLE_COPY(Preferences)
|
||||
|
||||
private:
|
||||
explicit Preferences();
|
||||
Preferences();
|
||||
~Preferences();
|
||||
|
||||
static Preferences* m_instance;
|
||||
QHash<QString, QVariant> m_data;
|
||||
int m_randomPort;
|
||||
@@ -111,16 +109,16 @@ private:
|
||||
const QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const;
|
||||
void setValue(const QString &key, const QVariant &value);
|
||||
|
||||
private slots:
|
||||
bool save();
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
|
||||
public slots:
|
||||
void save();
|
||||
|
||||
public:
|
||||
static void initInstance();
|
||||
static void freeInstance();
|
||||
static Preferences* instance();
|
||||
static void drop();
|
||||
~Preferences();
|
||||
|
||||
// General options
|
||||
QString getLocale() const;
|
||||
@@ -276,8 +274,8 @@ public:
|
||||
void setEncryptionSetting(int val);
|
||||
qreal getGlobalMaxRatio() const;
|
||||
void setGlobalMaxRatio(qreal ratio);
|
||||
int getMaxRatioAction() const;
|
||||
void setMaxRatioAction(int act);
|
||||
MaxRatioAction getMaxRatioAction() const;
|
||||
void setMaxRatioAction(MaxRatioAction act);
|
||||
|
||||
// IP Filter
|
||||
bool isFilteringEnabled() const;
|
||||
@@ -536,6 +534,8 @@ public slots:
|
||||
void setStatusFilterState(bool checked);
|
||||
void setLabelFilterState(bool checked);
|
||||
void setTrackerFilterState(bool checked);
|
||||
|
||||
void apply();
|
||||
};
|
||||
|
||||
#endif // PREFERENCES_H
|
||||
|
||||
Reference in New Issue
Block a user