2014-06-25 04:11:11 +08:00
|
|
|
/*
|
|
|
|
Copyright (C) 2013 by Maxim Biro <nurupo.contributions@gmail.com>
|
2015-06-06 09:40:08 +08:00
|
|
|
Copyright © 2014-2015 by The qTox Project
|
2014-10-08 22:17:05 +08:00
|
|
|
|
2015-06-06 09:40:08 +08:00
|
|
|
This file is part of qTox, a Qt-based graphical interface for Tox.
|
2014-10-08 22:17:05 +08:00
|
|
|
|
2014-06-25 04:11:11 +08:00
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
2015-06-06 09:40:08 +08:00
|
|
|
|
|
|
|
qTox is distributed in the hope that it will be useful,
|
2014-06-25 04:11:11 +08:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2015-06-06 09:40:08 +08:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2014-10-08 22:17:05 +08:00
|
|
|
|
2015-06-06 09:40:08 +08:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with qTox. If not, see <http://www.gnu.org/licenses/>.
|
2014-06-25 04:11:11 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SETTINGS_HPP
|
|
|
|
#define SETTINGS_HPP
|
|
|
|
|
|
|
|
#include <QHash>
|
2014-09-11 21:44:34 +08:00
|
|
|
#include <QObject>
|
2014-09-24 22:51:16 +08:00
|
|
|
#include <QPixmap>
|
2015-06-05 22:27:15 +08:00
|
|
|
#include <QMutex>
|
2015-06-12 03:27:54 +08:00
|
|
|
#include <QDate>
|
2016-01-19 07:19:07 +08:00
|
|
|
#include <QNetworkProxy>
|
2015-06-05 22:24:47 +08:00
|
|
|
#include "src/core/corestructs.h"
|
2014-06-25 04:11:11 +08:00
|
|
|
|
2015-05-18 04:55:50 +08:00
|
|
|
class ToxId;
|
2015-06-06 21:54:58 +08:00
|
|
|
class Profile;
|
2014-11-12 20:56:24 +08:00
|
|
|
namespace Db { enum class syncType; }
|
2014-11-08 00:02:10 +08:00
|
|
|
|
2014-12-28 20:32:25 +08:00
|
|
|
enum ProxyType {ptNone, ptSOCKS5, ptHTTP};
|
|
|
|
|
2016-01-31 13:43:58 +08:00
|
|
|
enum MarkdownType {NONE, WITH_CHARS, WITHOUT_CHARS};
|
|
|
|
|
2014-06-25 04:11:11 +08:00
|
|
|
class Settings : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static Settings& getInstance();
|
2015-06-06 00:01:50 +08:00
|
|
|
static void destroyInstance();
|
2015-06-05 22:24:47 +08:00
|
|
|
QString getSettingsDirPath(); ///< The returned path ends with a directory separator
|
2016-02-28 22:16:19 +08:00
|
|
|
QString getAppDataDirPath(); ///< The returned path ends with a directory separator
|
|
|
|
QString getAppCacheDirPath(); ///< The returned path ends with a directory separator
|
2015-06-04 05:20:47 +08:00
|
|
|
|
2015-06-05 22:24:47 +08:00
|
|
|
void createSettingsDir(); ///< Creates a path to the settings dir, if it doesn't already exist
|
2016-01-17 03:08:43 +08:00
|
|
|
void createPersonal(QString basename); ///< Write a default personal .ini settings file for a profile
|
2014-06-25 04:11:11 +08:00
|
|
|
|
2015-06-06 21:54:58 +08:00
|
|
|
void savePersonal(); ///< Asynchronous, saves the current profile
|
|
|
|
void savePersonal(Profile *profile); ///< Asynchronous
|
|
|
|
|
|
|
|
void loadGlobal();
|
2016-01-21 10:00:46 +08:00
|
|
|
void loadPersonal();
|
|
|
|
void loadPersonal(Profile *profile);
|
2015-06-06 21:54:58 +08:00
|
|
|
|
2015-06-06 00:01:50 +08:00
|
|
|
public slots:
|
2015-06-06 21:54:58 +08:00
|
|
|
void saveGlobal(); ///< Asynchronous
|
2015-06-06 00:01:50 +08:00
|
|
|
void sync(); ///< Waits for all asynchronous operations to complete
|
2014-06-25 04:11:11 +08:00
|
|
|
|
2015-06-05 22:24:47 +08:00
|
|
|
signals:
|
|
|
|
void dhtServerListChanged();
|
|
|
|
void smileyPackChanged();
|
|
|
|
void emojiFontChanged();
|
2014-06-25 04:11:11 +08:00
|
|
|
|
2015-06-05 22:24:47 +08:00
|
|
|
public:
|
|
|
|
// Getter/setters
|
2014-06-25 04:11:11 +08:00
|
|
|
const QList<DhtServer>& getDhtServerList() const;
|
|
|
|
void setDhtServerList(const QList<DhtServer>& newDhtServerList);
|
|
|
|
|
2014-07-02 06:47:06 +08:00
|
|
|
bool getEnableIPv6() const;
|
|
|
|
void setEnableIPv6(bool newValue);
|
|
|
|
|
2014-07-13 04:58:58 +08:00
|
|
|
bool getMakeToxPortable() const;
|
|
|
|
void setMakeToxPortable(bool newValue);
|
|
|
|
|
2014-12-17 21:44:23 +08:00
|
|
|
bool getAutorun() const;
|
|
|
|
void setAutorun(bool newValue);
|
|
|
|
|
2014-10-08 22:17:05 +08:00
|
|
|
bool getAutostartInTray() const;
|
|
|
|
void setAutostartInTray(bool newValue);
|
2015-03-26 00:45:28 +08:00
|
|
|
|
2014-10-20 03:47:06 +08:00
|
|
|
bool getCloseToTray() const;
|
|
|
|
void setCloseToTray(bool newValue);
|
2015-03-26 00:45:28 +08:00
|
|
|
|
2014-10-20 19:50:12 +08:00
|
|
|
bool getMinimizeToTray() const;
|
|
|
|
void setMinimizeToTray(bool newValue);
|
2014-12-12 03:34:12 +08:00
|
|
|
|
|
|
|
bool getLightTrayIcon() const;
|
|
|
|
void setLightTrayIcon(bool newValue);
|
2015-03-26 00:45:28 +08:00
|
|
|
|
2014-10-09 06:31:20 +08:00
|
|
|
QString getStyle() const;
|
|
|
|
void setStyle(const QString& newValue);
|
2014-11-14 04:33:11 +08:00
|
|
|
|
|
|
|
bool getShowSystemTray() const;
|
|
|
|
void setShowSystemTray(const bool& newValue);
|
2015-03-26 00:45:28 +08:00
|
|
|
|
2014-11-05 23:20:32 +08:00
|
|
|
bool getUseEmoticons() const;
|
|
|
|
void setUseEmoticons(bool newValue);
|
2014-10-08 22:17:05 +08:00
|
|
|
|
2014-07-17 06:43:30 +08:00
|
|
|
QString getCurrentProfile() const;
|
2015-02-20 20:26:41 +08:00
|
|
|
uint32_t getCurrentProfileId() const;
|
2014-07-17 06:43:30 +08:00
|
|
|
void setCurrentProfile(QString profile);
|
|
|
|
|
2014-10-18 07:06:30 +08:00
|
|
|
QString getTranslation() const;
|
|
|
|
void setTranslation(QString newValue);
|
2015-03-26 00:45:28 +08:00
|
|
|
|
2016-01-24 05:50:57 +08:00
|
|
|
// Toxme
|
|
|
|
void deleteToxme();
|
|
|
|
void setToxme(QString name, QString server, QString bio, bool priv, QString pass = "");
|
|
|
|
QString getToxmeInfo() const;
|
|
|
|
void setToxmeInfo(QString info);
|
|
|
|
|
|
|
|
QString getToxmeBio() const;
|
|
|
|
void setToxmeBio(QString bio);
|
|
|
|
|
|
|
|
bool getToxmePriv() const;
|
|
|
|
void setToxmePriv(bool priv);
|
|
|
|
|
|
|
|
QString getToxmePass() const;
|
|
|
|
void setToxmePass(QString pass);
|
|
|
|
|
2014-11-05 23:20:32 +08:00
|
|
|
void setAutoSaveEnabled(bool newValue);
|
|
|
|
bool getAutoSaveEnabled() const;
|
2014-07-05 01:22:43 +08:00
|
|
|
|
2014-10-06 04:49:44 +08:00
|
|
|
bool getForceTCP() const;
|
|
|
|
void setForceTCP(bool newValue);
|
2014-10-08 22:17:05 +08:00
|
|
|
|
2016-01-19 07:19:07 +08:00
|
|
|
QNetworkProxy getProxy() const;
|
|
|
|
|
2014-10-06 04:49:44 +08:00
|
|
|
QString getProxyAddr() const;
|
|
|
|
void setProxyAddr(const QString& newValue);
|
|
|
|
|
2014-12-28 20:32:25 +08:00
|
|
|
ProxyType getProxyType() const;
|
|
|
|
void setProxyType(int newValue);
|
2014-10-07 10:09:15 +08:00
|
|
|
|
2014-10-06 04:49:44 +08:00
|
|
|
int getProxyPort() const;
|
|
|
|
void setProxyPort(int newValue);
|
|
|
|
|
2014-06-25 04:11:11 +08:00
|
|
|
bool getEnableLogging() const;
|
|
|
|
void setEnableLogging(bool newValue);
|
|
|
|
|
2014-11-12 20:56:24 +08:00
|
|
|
Db::syncType getDbSyncType() const;
|
|
|
|
void setDbSyncType(int newValue);
|
|
|
|
|
2014-10-16 17:47:58 +08:00
|
|
|
int getAutoAwayTime() const;
|
|
|
|
void setAutoAwayTime(int newValue);
|
|
|
|
|
2014-11-10 07:31:29 +08:00
|
|
|
bool getCheckUpdates() const;
|
|
|
|
void setCheckUpdates(bool newValue);
|
|
|
|
|
2015-01-21 19:10:41 +08:00
|
|
|
bool getShowWindow() const;
|
|
|
|
void setShowWindow(bool newValue);
|
|
|
|
|
2014-11-10 08:23:41 +08:00
|
|
|
bool getShowInFront() const;
|
|
|
|
void setShowInFront(bool newValue);
|
|
|
|
|
2015-03-22 08:57:28 +08:00
|
|
|
bool getNotifySound() const;
|
|
|
|
void setNotifySound(bool newValue);
|
|
|
|
|
2015-01-21 19:10:41 +08:00
|
|
|
bool getGroupAlwaysNotify() const;
|
|
|
|
void setGroupAlwaysNotify(bool newValue);
|
|
|
|
|
2014-10-29 04:21:37 +08:00
|
|
|
QString getInDev() const;
|
|
|
|
void setInDev(const QString& deviceSpecifier);
|
|
|
|
|
|
|
|
QString getOutDev() const;
|
|
|
|
void setOutDev(const QString& deviceSpecifier);
|
|
|
|
|
2015-10-18 16:15:02 +08:00
|
|
|
int getInVolume() const;
|
|
|
|
void setInVolume(int volume);
|
|
|
|
|
|
|
|
int getOutVolume() const;
|
|
|
|
void setOutVolume(int volume);
|
|
|
|
|
2014-12-14 16:50:18 +08:00
|
|
|
bool getFilterAudio() const;
|
|
|
|
void setFilterAudio(bool newValue);
|
|
|
|
|
2015-05-14 10:46:28 +08:00
|
|
|
QString getVideoDev() const;
|
|
|
|
void setVideoDev(const QString& deviceSpecifier);
|
|
|
|
|
2015-01-24 09:03:26 +08:00
|
|
|
QSize getCamVideoRes() const;
|
|
|
|
void setCamVideoRes(QSize newValue);
|
|
|
|
|
2015-08-19 05:44:34 +08:00
|
|
|
unsigned short getCamVideoFPS() const;
|
|
|
|
void setCamVideoFPS(unsigned short newValue);
|
|
|
|
|
2014-06-25 04:11:11 +08:00
|
|
|
bool isAnimationEnabled() const;
|
|
|
|
void setAnimationEnabled(bool newValue);
|
|
|
|
|
2014-07-25 20:52:14 +08:00
|
|
|
QString getSmileyPack() const;
|
|
|
|
void setSmileyPack(const QString &value);
|
2014-06-25 04:11:11 +08:00
|
|
|
|
2014-11-16 04:30:20 +08:00
|
|
|
int getThemeColor() const;
|
|
|
|
void setThemeColor(const int& value);
|
|
|
|
|
2016-01-31 13:43:58 +08:00
|
|
|
MarkdownType getMarkdownPreference() const;
|
|
|
|
void setMarkdownPreference(MarkdownType newValue);
|
2016-01-23 16:06:17 +08:00
|
|
|
|
2014-06-25 04:11:11 +08:00
|
|
|
bool isCurstomEmojiFont() const;
|
|
|
|
void setCurstomEmojiFont(bool value);
|
|
|
|
|
|
|
|
int getEmojiFontPointSize() const;
|
|
|
|
void setEmojiFontPointSize(int value);
|
|
|
|
|
2015-11-10 04:54:28 +08:00
|
|
|
QString getContactNote(const ToxId& id) const;
|
|
|
|
void setContactNote(const ToxId& id, const QString& note);
|
|
|
|
|
2015-05-18 04:55:50 +08:00
|
|
|
QString getAutoAcceptDir(const ToxId& id) const;
|
2015-11-10 04:54:28 +08:00
|
|
|
void setAutoAcceptDir(const ToxId& id, const QString& dir);
|
2014-10-18 11:02:13 +08:00
|
|
|
|
2014-10-20 12:25:52 +08:00
|
|
|
QString getGlobalAutoAcceptDir() const;
|
|
|
|
void setGlobalAutoAcceptDir(const QString& dir);
|
|
|
|
|
2014-06-25 04:11:11 +08:00
|
|
|
// ChatView
|
|
|
|
int getFirstColumnHandlePos() const;
|
|
|
|
void setFirstColumnHandlePos(const int pos);
|
|
|
|
|
|
|
|
int getSecondColumnHandlePosFromRight() const;
|
|
|
|
void setSecondColumnHandlePosFromRight(const int pos);
|
|
|
|
|
2015-03-26 00:45:28 +08:00
|
|
|
const QString& getTimestampFormat() const;
|
|
|
|
void setTimestampFormat(const QString& format);
|
|
|
|
|
|
|
|
const QString& getDateFormat() const;
|
|
|
|
void setDateFormat(const QString& format);
|
2014-06-25 04:11:11 +08:00
|
|
|
|
|
|
|
bool isMinimizeOnCloseEnabled() const;
|
|
|
|
void setMinimizeOnClose(bool newValue);
|
|
|
|
|
2014-10-11 07:18:32 +08:00
|
|
|
bool getStatusChangeNotificationEnabled() const;
|
|
|
|
void setStatusChangeNotificationEnabled(bool newValue);
|
2014-06-25 04:11:11 +08:00
|
|
|
|
|
|
|
// Privacy
|
|
|
|
bool isTypingNotificationEnabled() const;
|
|
|
|
void setTypingNotification(bool enabled);
|
|
|
|
|
2014-10-11 07:18:32 +08:00
|
|
|
// State
|
2014-08-11 16:00:08 +08:00
|
|
|
QByteArray getWindowGeometry() const;
|
|
|
|
void setWindowGeometry(const QByteArray &value);
|
|
|
|
|
|
|
|
QByteArray getWindowState() const;
|
|
|
|
void setWindowState(const QByteArray &value);
|
|
|
|
|
2014-08-11 20:07:27 +08:00
|
|
|
QByteArray getSplitterState() const;
|
|
|
|
void setSplitterState(const QByteArray &value);
|
|
|
|
|
2015-06-19 22:58:48 +08:00
|
|
|
QByteArray getDialogGeometry() const;
|
|
|
|
void setDialogGeometry(const QByteArray& value);
|
|
|
|
|
|
|
|
QByteArray getDialogSplitterState() const;
|
|
|
|
void setDialogSplitterState(const QByteArray &value);
|
|
|
|
|
2015-07-03 01:16:11 +08:00
|
|
|
QByteArray getDialogSettingsGeometry() const;
|
|
|
|
void setDialogSettingsGeometry(const QByteArray& value);
|
|
|
|
|
2014-11-08 00:02:10 +08:00
|
|
|
QString getFriendAdress(const QString &publicKey) const;
|
|
|
|
void updateFriendAdress(const QString &newAddr);
|
|
|
|
|
2015-05-18 04:55:50 +08:00
|
|
|
QString getFriendAlias(const ToxId &id) const;
|
|
|
|
void setFriendAlias(const ToxId &id, const QString &alias);
|
2014-11-08 00:02:10 +08:00
|
|
|
|
2015-06-06 03:34:32 +08:00
|
|
|
int getFriendCircleID(const ToxId &id) const;
|
|
|
|
void setFriendCircleID(const ToxId &id, int circleID);
|
2015-05-31 03:10:43 +08:00
|
|
|
|
2015-06-12 03:27:54 +08:00
|
|
|
QDate getFriendActivity(const ToxId &id) const;
|
|
|
|
void setFriendActivity(const ToxId &id, const QDate &date);
|
|
|
|
|
2015-05-18 04:55:50 +08:00
|
|
|
void removeFriendSettings(const ToxId &id);
|
2014-11-12 00:52:19 +08:00
|
|
|
|
2014-11-10 21:06:35 +08:00
|
|
|
bool getFauxOfflineMessaging() const;
|
|
|
|
void setFauxOfflineMessaging(bool value);
|
|
|
|
|
2014-12-11 20:02:45 +08:00
|
|
|
bool getCompactLayout() const;
|
|
|
|
void setCompactLayout(bool compact);
|
|
|
|
|
2015-06-17 02:25:19 +08:00
|
|
|
bool getSeparateWindow() const;
|
|
|
|
void setSeparateWindow(bool value);
|
|
|
|
|
2015-06-19 22:58:48 +08:00
|
|
|
bool getDontGroupWindows() const;
|
|
|
|
void setDontGroupWindows(bool value);
|
|
|
|
|
2015-03-12 08:41:18 +08:00
|
|
|
bool getGroupchatPosition() const;
|
|
|
|
void setGroupchatPosition(bool value);
|
|
|
|
|
2015-06-05 21:24:02 +08:00
|
|
|
bool getAutoLogin() const;
|
|
|
|
void setAutoLogin(bool state);
|
|
|
|
|
2015-05-31 03:10:43 +08:00
|
|
|
int getCircleCount() const;
|
2015-06-07 11:20:06 +08:00
|
|
|
int addCircle(const QString &name = QString());
|
2015-06-06 03:34:32 +08:00
|
|
|
int removeCircle(int id);
|
|
|
|
QString getCircleName(int id) const;
|
|
|
|
void setCircleName(int id, const QString &name);
|
|
|
|
bool getCircleExpanded(int id) const;
|
|
|
|
void setCircleExpanded(int id, bool expanded);
|
2015-05-31 03:10:43 +08:00
|
|
|
|
2016-02-25 23:46:40 +08:00
|
|
|
bool addFriendRequest(const QString &friendAddress, const QString &message);
|
2016-02-21 05:32:57 +08:00
|
|
|
unsigned int getUnreadFriendRequests() const;
|
|
|
|
QPair<QString, QString> getFriendRequest(int index) const;
|
|
|
|
int getFriendRequestSize() const;
|
|
|
|
void clearUnreadFriendRequests();
|
|
|
|
void removeFriendRequest(int index);
|
|
|
|
|
2015-06-05 22:24:47 +08:00
|
|
|
// Assume all widgets have unique names
|
|
|
|
// Don't use it to save every single thing you want to save, use it
|
|
|
|
// for some general purpose widgets, such as MainWindows or Splitters,
|
|
|
|
// which have widget->saveX() and widget->loadX() methods.
|
|
|
|
QByteArray getWidgetData(const QString& uniqueName) const;
|
|
|
|
void setWidgetData(const QString& uniqueName, const QByteArray& data);
|
2014-06-25 04:11:11 +08:00
|
|
|
|
2015-06-05 22:24:47 +08:00
|
|
|
// Wrappers around getWidgetData() and setWidgetData()
|
|
|
|
// Assume widget has a unique objectName set
|
|
|
|
template <class T>
|
|
|
|
void restoreGeometryState(T* widget) const
|
|
|
|
{
|
|
|
|
widget->restoreGeometry(getWidgetData(widget->objectName() + "Geometry"));
|
|
|
|
widget->restoreState(getWidgetData(widget->objectName() + "State"));
|
|
|
|
}
|
|
|
|
template <class T>
|
|
|
|
void saveGeometryState(const T* widget)
|
|
|
|
{
|
|
|
|
setWidgetData(widget->objectName() + "Geometry", widget->saveGeometry());
|
|
|
|
setWidgetData(widget->objectName() + "State", widget->saveState());
|
|
|
|
}
|
2014-12-03 08:26:17 +08:00
|
|
|
|
2015-12-22 20:48:52 +08:00
|
|
|
static uint32_t makeProfileId(const QString& profile);
|
|
|
|
|
2015-06-05 22:24:47 +08:00
|
|
|
private:
|
2014-09-01 04:26:45 +08:00
|
|
|
Settings();
|
2015-06-06 00:01:50 +08:00
|
|
|
~Settings();
|
2014-09-01 04:26:45 +08:00
|
|
|
Settings(Settings &settings) = delete;
|
|
|
|
Settings& operator=(const Settings&) = delete;
|
2015-06-06 21:54:58 +08:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void savePersonal(QString profileName, QString password);
|
2014-06-25 04:11:11 +08:00
|
|
|
|
2015-06-05 22:24:47 +08:00
|
|
|
private:
|
2014-06-25 04:11:11 +08:00
|
|
|
bool loaded;
|
|
|
|
|
2014-09-05 05:13:59 +08:00
|
|
|
bool useCustomDhtList;
|
2014-06-25 04:11:11 +08:00
|
|
|
QList<DhtServer> dhtServerList;
|
|
|
|
int dhtServerId;
|
|
|
|
bool dontShowDhtDialog;
|
|
|
|
|
2015-06-05 21:24:02 +08:00
|
|
|
bool autoLogin;
|
2014-11-10 21:06:35 +08:00
|
|
|
bool fauxOfflineMessaging;
|
2014-12-11 20:02:45 +08:00
|
|
|
bool compactLayout;
|
2015-03-12 08:41:18 +08:00
|
|
|
bool groupchatPosition;
|
2015-06-17 02:25:19 +08:00
|
|
|
bool separateWindow;
|
2015-06-19 22:58:48 +08:00
|
|
|
bool dontGroupWindows;
|
2014-07-02 06:47:06 +08:00
|
|
|
bool enableIPv6;
|
2014-10-18 07:06:30 +08:00
|
|
|
QString translation;
|
2015-06-05 22:24:47 +08:00
|
|
|
bool makeToxPortable;
|
2014-10-08 22:17:05 +08:00
|
|
|
bool autostartInTray;
|
2014-10-20 03:47:06 +08:00
|
|
|
bool closeToTray;
|
2014-10-20 19:50:12 +08:00
|
|
|
bool minimizeToTray;
|
2014-12-12 03:34:12 +08:00
|
|
|
bool lightTrayIcon;
|
2014-11-05 23:20:32 +08:00
|
|
|
bool useEmoticons;
|
2014-11-10 07:31:29 +08:00
|
|
|
bool checkUpdates;
|
2015-01-21 19:10:41 +08:00
|
|
|
bool showWindow;
|
2014-11-10 08:23:41 +08:00
|
|
|
bool showInFront;
|
2015-03-22 08:57:28 +08:00
|
|
|
bool notifySound;
|
2015-01-21 19:10:41 +08:00
|
|
|
bool groupAlwaysNotify;
|
2014-10-08 22:17:05 +08:00
|
|
|
|
2014-10-06 04:49:44 +08:00
|
|
|
bool forceTCP;
|
2014-10-07 10:09:15 +08:00
|
|
|
|
2014-12-28 20:32:25 +08:00
|
|
|
ProxyType proxyType;
|
2014-10-06 04:49:44 +08:00
|
|
|
QString proxyAddr;
|
|
|
|
int proxyPort;
|
2014-07-02 06:47:06 +08:00
|
|
|
|
2014-07-17 06:43:30 +08:00
|
|
|
QString currentProfile;
|
2015-02-20 20:26:41 +08:00
|
|
|
uint32_t currentProfileId;
|
2014-07-02 06:47:06 +08:00
|
|
|
|
2016-01-24 05:50:57 +08:00
|
|
|
// Toxme Info
|
|
|
|
QString toxmeInfo; // name@server
|
|
|
|
QString toxmeBio;
|
|
|
|
bool toxmePriv;
|
|
|
|
QString toxmePass;
|
|
|
|
|
2014-06-25 04:11:11 +08:00
|
|
|
bool enableLogging;
|
|
|
|
|
2014-10-16 17:47:58 +08:00
|
|
|
int autoAwayTime;
|
|
|
|
|
2014-06-25 04:11:11 +08:00
|
|
|
QHash<QString, QByteArray> widgetSettings;
|
2014-10-18 11:02:13 +08:00
|
|
|
QHash<QString, QString> autoAccept;
|
2015-03-26 00:45:28 +08:00
|
|
|
bool autoSaveEnabled;
|
2014-10-20 12:25:52 +08:00
|
|
|
QString globalAutoAcceptDir;
|
2014-06-25 04:11:11 +08:00
|
|
|
|
2016-02-21 05:32:57 +08:00
|
|
|
QList<QPair<QString, QString>> friendRequests;
|
|
|
|
unsigned int unreadFriendRequests;
|
|
|
|
|
2014-06-25 04:11:11 +08:00
|
|
|
// GUI
|
2014-07-25 20:52:14 +08:00
|
|
|
QString smileyPack;
|
2015-06-20 19:50:20 +08:00
|
|
|
int emojiFontPointSize;
|
2014-06-25 04:11:11 +08:00
|
|
|
bool minimizeOnClose;
|
2014-08-11 16:00:08 +08:00
|
|
|
QByteArray windowGeometry;
|
|
|
|
QByteArray windowState;
|
2014-08-11 20:07:27 +08:00
|
|
|
QByteArray splitterState;
|
2015-06-19 22:58:48 +08:00
|
|
|
QByteArray dialogGeometry;
|
|
|
|
QByteArray dialogSplitterState;
|
2015-07-03 01:16:11 +08:00
|
|
|
QByteArray dialogSettingsGeometry;
|
2014-10-09 06:31:20 +08:00
|
|
|
QString style;
|
2014-11-14 04:33:11 +08:00
|
|
|
bool showSystemTray;
|
|
|
|
|
2014-06-25 04:11:11 +08:00
|
|
|
// ChatView
|
2016-01-31 13:43:58 +08:00
|
|
|
MarkdownType markdownPreference;
|
2014-06-25 04:11:11 +08:00
|
|
|
int firstColumnHandlePos;
|
|
|
|
int secondColumnHandlePosFromRight;
|
|
|
|
QString timestampFormat;
|
2015-03-15 04:15:56 +08:00
|
|
|
QString dateFormat;
|
2014-10-11 07:18:32 +08:00
|
|
|
bool statusChangeNotificationEnabled;
|
2014-06-25 04:11:11 +08:00
|
|
|
|
|
|
|
// Privacy
|
|
|
|
bool typingNotification;
|
2014-11-12 20:56:24 +08:00
|
|
|
Db::syncType dbSyncType;
|
2014-06-25 04:11:11 +08:00
|
|
|
|
2014-10-29 04:21:37 +08:00
|
|
|
// Audio
|
|
|
|
QString inDev;
|
|
|
|
QString outDev;
|
2015-10-18 16:15:02 +08:00
|
|
|
int inVolume;
|
|
|
|
int outVolume;
|
2014-12-14 16:50:18 +08:00
|
|
|
bool filterAudio;
|
2014-10-29 04:21:37 +08:00
|
|
|
|
2015-01-24 09:03:26 +08:00
|
|
|
// Video
|
2015-05-14 10:46:28 +08:00
|
|
|
QString videoDev;
|
2015-01-24 09:03:26 +08:00
|
|
|
QSize camVideoRes;
|
2015-08-19 05:44:34 +08:00
|
|
|
unsigned short camVideoFPS;
|
2015-01-24 09:03:26 +08:00
|
|
|
|
2014-11-08 00:02:10 +08:00
|
|
|
struct friendProp
|
|
|
|
{
|
|
|
|
QString alias;
|
|
|
|
QString addr;
|
2014-11-17 18:10:38 +08:00
|
|
|
QString autoAcceptDir;
|
2015-11-10 04:54:28 +08:00
|
|
|
QString note;
|
2015-06-06 03:34:32 +08:00
|
|
|
int circleID = -1;
|
2015-06-12 03:27:54 +08:00
|
|
|
QDate activity = QDate();
|
2014-11-08 00:02:10 +08:00
|
|
|
};
|
|
|
|
|
2015-06-04 04:18:40 +08:00
|
|
|
struct circleProp
|
|
|
|
{
|
|
|
|
QString name;
|
|
|
|
bool expanded;
|
|
|
|
};
|
|
|
|
|
2014-11-08 00:02:10 +08:00
|
|
|
QHash<QString, friendProp> friendLst;
|
|
|
|
|
2015-06-04 04:18:40 +08:00
|
|
|
QVector<circleProp> circleLst;
|
2015-05-31 03:10:43 +08:00
|
|
|
|
2014-11-16 04:30:20 +08:00
|
|
|
int themeColor;
|
2014-11-10 21:06:35 +08:00
|
|
|
|
2015-06-05 22:27:15 +08:00
|
|
|
static QMutex bigLock;
|
2015-06-05 22:24:47 +08:00
|
|
|
static Settings* settings;
|
|
|
|
static const QString globalSettingsFile;
|
2015-06-06 00:01:50 +08:00
|
|
|
static QThread* settingsThread;
|
2014-06-25 04:11:11 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SETTINGS_HPP
|