qTox
Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
|
Go to the documentation of this file.
31 #ifdef QTOX_PLATFORM_EXT
36 #include "util/compatiblerecursivemutex.h"
38 #include <QApplication>
39 #include <QCryptographicHash>
45 #include <QMutexLocker>
46 #include <QNetworkProxy>
47 #include <QStandardPaths>
48 #include <QStyleFactory>
50 #include <QtCore/QCommandLineParser>
67 , useCustomDhtList{
false}
70 settingsThread =
new QThread();
71 settingsThread->setObjectName(
"qTox Settings");
72 settingsThread->start(QThread::LowPriority);
73 moveToThread(settingsThread);
115 if (!QFile(filePath).exists()) {
116 qDebug() <<
"No settings file found, using defaults";
120 qDebug() <<
"Loading settings from " + filePath;
122 QSettings s(filePath, QSettings::IniFormat);
123 s.setIniCodec(
"UTF-8");
125 s.beginGroup(
"Login");
127 autoLogin = s.value(
"autoLogin",
false).toBool();
131 s.beginGroup(
"General");
133 translation = s.value(
"translation",
"en").toString();
136 closeToTray = s.value(
"closeToTray",
false).toBool();
145 notifySound = s.value(
"notifySound",
true).toBool();
146 notifyHide = s.value(
"notifyHide",
false).toBool();
147 busySound = s.value(
"busySound",
false).toBool();
150 QStandardPaths::locate(QStandardPaths::HomeLocation, QString(),
151 QStandardPaths::LocateDirectory))
154 static_cast<size_t>(s.value(
"autoAcceptMaxSize", 20 << 20 ).toLongLong());
159 s.beginGroup(
"Advanced");
162 enableIPv6 = s.value(
"enableIPv6",
true).toBool();
163 forceTCP = s.value(
"forceTCP",
false).toBool();
168 s.beginGroup(
"Widgets");
171 for (
const QString& name : objectNames)
178 showWindow = s.value(
"showWindow",
true).toBool();
179 notify = s.value(
"notify",
true).toBool();
187 const QString DEFAULT_SMILEYS =
":/smileys/emojione/emoticons.xml";
188 smileyPack = s.value(
"smileyPack", DEFAULT_SMILEYS).toString();
197 dateFormat = s.value(
"dateFormat",
"yyyy-MM-dd").toString();
205 themeColor = s.value(
"themeColor", 0).toInt();
206 style = s.value(
"style",
"").toString();
209 if (QStyleFactory::keys().contains(
"Fusion"))
214 nameColors = s.value(
"nameColors",
false).toBool();
218 s.beginGroup(
"Chat");
224 s.beginGroup(
"State");
226 windowGeometry = s.value(
"windowGeometry", QByteArray()).toByteArray();
227 windowState = s.value(
"windowState", QByteArray()).toByteArray();
228 splitterState = s.value(
"splitterState", QByteArray()).toByteArray();
229 dialogGeometry = s.value(
"dialogGeometry", QByteArray()).toByteArray();
235 s.beginGroup(
"Audio");
237 inDev = s.value(
"inDev",
"").toString();
239 outDev = s.value(
"outDev",
"").toString();
243 outVolume = s.value(
"outVolume", 100).toInt();
249 s.beginGroup(
"Video");
251 videoDev = s.value(
"videoDev",
"").toString();
252 camVideoRes = s.value(
"camVideoRes", QRect()).toRect();
253 screenRegion = s.value(
"screenRegion", QRect()).toRect();
255 camVideoFPS =
static_cast<quint16
>(s.value(
"camVideoFPS", 0).toUInt());
266 if (profile ==
nullptr) {
267 qWarning() << QString(
"Could not load new settings (profile change to nullptr)");
286 QString IPv6SettingString = parser.value(
"I").toLower();
287 QString LANSettingString = parser.value(
"L").toLower();
288 QString UDPSettingString = parser.value(
"U").toLower();
289 QString proxySettingString = parser.value(
"proxy").toLower();
290 QStringList proxySettingStrings = proxySettingString.split(
":");
292 const QString SOCKS5 = QStringLiteral(
"socks5");
293 const QString HTTP = QStringLiteral(
"http");
294 const QString NONE = QStringLiteral(
"none");
295 const QString ON = QStringLiteral(
"on");
296 const QString OFF = QStringLiteral(
"off");
299 bool activeProxyType =
false;
301 if (parser.isSet(
"P")) {
302 activeProxyType = proxySettingStrings[0] == SOCKS5 || proxySettingStrings[0] == HTTP;
305 if (parser.isSet(
"I")) {
306 if (!(IPv6SettingString == ON || IPv6SettingString == OFF)) {
307 qCritical() <<
"Unable to parse IPv6 setting.";
312 if (parser.isSet(
"U")) {
313 if (!(UDPSettingString == ON || UDPSettingString == OFF)) {
314 qCritical() <<
"Unable to parse UDP setting.";
319 if (parser.isSet(
"L")) {
320 if (!(LANSettingString == ON || LANSettingString == OFF)) {
321 qCritical() <<
"Unable to parse LAN setting.";
325 if (activeProxyType && UDPSettingString == ON) {
326 qCritical() <<
"Cannot set UDP on with proxy.";
330 if (activeProxyType && LANSettingString == ON) {
331 qCritical() <<
"Cannot use LAN discovery with proxy.";
335 if (LANSettingString == ON && UDPSettingString == OFF) {
336 qCritical() <<
"Incompatible UDP/LAN settings.";
340 if (parser.isSet(
"P")) {
341 if (proxySettingStrings[0] == NONE) {
347 if (proxySettingStrings.size() != 3) {
348 qCritical() <<
"Invalid number of proxy arguments.";
352 if (!(proxySettingStrings[0] == SOCKS5 || proxySettingStrings[0] == HTTP)) {
353 qCritical() <<
"Unable to parse proxy type.";
359 int portNumber = proxySettingStrings[2].toInt();
360 if (!(portNumber > 0 && portNumber < 65536)) {
361 qCritical() <<
"Invalid port number range.";
379 QString IPv6Setting = parser.value(
"I").toUpper();
380 QString LANSetting = parser.value(
"L").toUpper();
381 QString UDPSetting = parser.value(
"U").toUpper();
382 QString proxySettingString = parser.value(
"proxy").toUpper();
383 QStringList proxySettings = proxySettingString.split(
":");
385 const QString SOCKS5 = QStringLiteral(
"SOCKS5");
386 const QString HTTP = QStringLiteral(
"HTTP");
387 const QString NONE = QStringLiteral(
"NONE");
388 const QString ON = QStringLiteral(
"ON");
389 const QString OFF = QStringLiteral(
"OFF");
392 if (parser.isSet(
"I")) {
394 qDebug() << QString(
"Setting IPv6 %1.").arg(IPv6Setting);
397 if (parser.isSet(
"P")) {
398 qDebug() << QString(
"Setting proxy type to %1.").arg(proxySettings[0]);
400 quint16 portNumber = 0;
401 QString address =
"";
403 if (proxySettings[0] == NONE) {
406 if (proxySettings[0] == SOCKS5) {
408 }
else if (proxySettings[0] == HTTP) {
411 qCritical() <<
"Failed to set valid proxy type";
418 address = proxySettings[1];
419 portNumber =
static_cast<quint16
>(proxySettings[2].toInt());
424 qDebug() << QString(
"Setting proxy address to %1.").arg(address);
426 qDebug() << QString(
"Setting port number to %1.").arg(portNumber);
429 if (parser.isSet(
"U")) {
430 bool shouldForceTCP = UDPSetting == OFF;
432 qDebug() <<
"Cannot use UDP with proxy; disable proxy explicitly with '-P none'.";
435 qDebug() << QString(
"Setting UDP %1.").arg(UDPSetting);
440 qDebug() <<
"Cannot perform LAN discovery without UDP; disabling LAN discovery.";
445 if (parser.isSet(
"L")) {
446 bool shouldEnableLAN = LANSetting == ON;
450 <<
"Cannot use LAN discovery with proxy; disable proxy explicitly with '-P none'.";
451 }
else if (shouldEnableLAN &&
forceTCP) {
452 qDebug() <<
"Cannot use LAN discovery without UDP; enable UDP explicitly with '-U on'.";
455 qDebug() << QString(
"Setting LAN Discovery %1.").arg(LANSetting);
469 QString tmp = dir.filePath(profileName +
".ini");
470 if (QFile(tmp).exists())
473 qDebug() <<
"Loading personal settings from" << filePath;
491 for (
int i = 0; i < size; i++) {
494 fp.alias = ps.
value(
"alias").toString();
495 fp.note = ps.
value(
"note").toString();
496 fp.autoAcceptDir = ps.
value(
"autoAcceptDir").toString();
498 if (fp.autoAcceptDir ==
"")
499 fp.autoAcceptDir = ps.
value(
"autoAccept").toString();
502 Settings::AutoAcceptCallFlags(QFlag(ps.
value(
"autoAcceptCall", 0).toInt()));
503 fp.autoGroupInvite = ps.
value(
"autoGroupInvite").toBool();
504 fp.circleID = ps.
value(
"circle", -1).toInt();
507 fp.activity = ps.
value(
"activity", QDateTime()).toDateTime();
519 for (
int i = 0; i < size; i++) {
524 request.
read = ps.
value(
"read").toBool();
553 for (
int i = 0; i < size; i++) {
573 QString localPath = dir.filePath(profile->
getName() +
".ini");
574 QFile local(localPath);
585 return (
void)QMetaObject::invokeMethod(&
getInstance(),
"saveGlobal");
592 qDebug() <<
"Saving global settings at " + path;
594 QSettings s(path, QSettings::IniFormat);
595 s.setIniCodec(
"UTF-8");
599 s.beginGroup(
"Login");
605 s.beginGroup(
"General");
624 s.beginGroup(
"Advanced");
630 s.setValue(
"dbSyncType",
static_cast<int>(
dbSyncType));
634 s.beginGroup(
"Widgets");
637 for (
const QString& name : widgetNames)
645 s.setValue(
"notify",
notify);
664 s.setValue(
"style",
style);
672 s.beginGroup(
"Chat");
678 s.beginGroup(
"State");
689 s.beginGroup(
"Audio");
691 s.setValue(
"inDev",
inDev);
693 s.setValue(
"outDev",
outDev);
703 s.beginGroup(
"Video");
729 qDebug() <<
"Could not save personal settings because there is no active profile";
733 return (
void)QMetaObject::invokeMethod(&
getInstance(),
"savePersonal",
746 qDebug() <<
"Saving personal settings at " << path;
758 ps.
setValue(
"autoAcceptDir", frnd.autoAcceptDir);
759 ps.
setValue(
"autoAcceptCall",
static_cast<int>(frnd.autoAcceptCall));
760 ps.
setValue(
"autoGroupInvite", frnd.autoGroupInvite);
761 ps.
setValue(
"circle", frnd.circleID);
764 ps.
setValue(
"activity", frnd.activity);
778 ps.
setValue(
"addr", request.address);
779 ps.
setValue(
"message", request.message);
810 ps.
setValue(
"expanded", circle.expanded);
829 QByteArray data = QCryptographicHash::hash(profile.toUtf8(), QCryptographicHash::Md5);
830 const uint32_t* dwords =
reinterpret_cast<const uint32_t*
>(data.constData());
831 return dwords[0] ^ dwords[1] ^ dwords[2] ^ dwords[3];
848 emit enableTestSoundChanged(newValue);
861 emit enableIPv6Changed(enabled);
873 bool changed =
false;
879 QFile(oldSettingsPath).remove();
890 #ifdef QTOX_PLATFORM_EXT
891 return Platform::getAutorun();
899 #ifdef QTOX_PLATFORM_EXT
900 bool autorun = Platform::getAutorun();
903 Platform::setAutorun(newValue);
1004 QMutexLocker locker{&
bigLock};
1017 QMutexLocker locker{&
bigLock};
1030 QMutexLocker locker{&
bigLock};
1037 emit showGroupJoinLeaveMessagesChanged(newValue);
1043 const QMutexLocker locker{&
bigLock};
1056 QMutexLocker locker{&
bigLock};
1069 QMutexLocker locker{&
bigLock};
1082 QMutexLocker locker{&
bigLock};
1095 QMutexLocker locker{&
bigLock};
1108 QMutexLocker locker{&
bigLock};
1121 QMutexLocker locker{&
bigLock};
1128 emit forceTCPChanged(enabled);
1134 QMutexLocker locker{&
bigLock};
1141 emit enableLanDiscoveryChanged(enabled);
1147 QMutexLocker locker{&
bigLock};
1149 QNetworkProxy proxy;
1152 proxy.setType(QNetworkProxy::NoProxy);
1155 proxy.setType(QNetworkProxy::Socks5Proxy);
1158 proxy.setType(QNetworkProxy::HttpProxy);
1161 proxy.setType(QNetworkProxy::NoProxy);
1162 qWarning() <<
"Invalid proxy type, setting to NoProxy";
1173 QMutexLocker locker{&
bigLock};
1180 emit proxyTypeChanged(newValue);
1186 QMutexLocker locker{&
bigLock};
1193 emit proxyAddressChanged(address);
1199 QMutexLocker locker{&
bigLock};
1206 emit proxyPortChanged(port);
1212 QMutexLocker locker{&
bigLock};
1218 QMutexLocker locker{&
bigLock};
1224 bool updated =
false;
1225 uint32_t newProfileId = 0;
1227 QMutexLocker locker{&
bigLock};
1243 QMutexLocker locker{&
bigLock};
1256 QMutexLocker locker{&
bigLock};
1278 QMutexLocker locker{&
bigLock};
1280 auto it =
friendLst.find(
id.getByteArray());
1282 return it->autoAcceptDir;
1289 bool updated =
false;
1291 QMutexLocker locker{&
bigLock};
1295 if (frnd.autoAcceptDir != dir) {
1296 frnd.autoAcceptDir = dir;
1301 emit autoAcceptDirChanged(
id, dir);
1307 QMutexLocker locker{&
bigLock};
1309 auto it =
friendLst.find(
id.getByteArray());
1311 return it->autoAcceptCall;
1313 return Settings::AutoAcceptCallFlags();
1318 bool updated =
false;
1320 QMutexLocker locker{&
bigLock};
1324 if (frnd.autoAcceptCall != accept) {
1325 frnd.autoAcceptCall = accept;
1330 emit autoAcceptCallChanged(
id, accept);
1336 QMutexLocker locker{&
bigLock};
1338 auto it =
friendLst.find(
id.getByteArray());
1340 return it->autoGroupInvite;
1348 bool updated =
false;
1350 QMutexLocker locker{&
bigLock};
1354 if (frnd.autoGroupInvite != accept) {
1355 frnd.autoGroupInvite = accept;
1361 emit autoGroupInviteChanged(
id, accept);
1367 QMutexLocker locker{&
bigLock};
1369 auto it =
friendLst.find(
id.getByteArray());
1378 bool updated =
false;
1380 QMutexLocker locker{&
bigLock};
1384 if (frnd.note != note) {
1390 emit contactNoteChanged(
id, note);
1396 QMutexLocker locker{&
bigLock};
1409 QMutexLocker locker{&
bigLock};
1422 QMutexLocker locker(&
bigLock);
1435 bool updated =
false;
1437 QMutexLocker locker{&
bigLock};
1451 QMutexLocker locker{&
bigLock};
1457 QMutexLocker locker{&
bigLock};
1470 QMutexLocker locker{&
bigLock};
1483 QMutexLocker locker{&
bigLock};
1496 QMutexLocker locker{&
bigLock};
1509 QMutexLocker locker{&
bigLock};
1522 QMutexLocker locker{&
bigLock};
1535 QMutexLocker locker{&
bigLock};
1548 QMutexLocker locker{&
bigLock};
1561 QMutexLocker locker{&
bigLock};
1574 QMutexLocker locker{&
bigLock};
1587 QMutexLocker locker{&
bigLock};
1600 QMutexLocker locker{&
bigLock};
1613 QMutexLocker locker{&
bigLock};
1626 QMutexLocker locker{&
bigLock};
1639 QMutexLocker locker{&
bigLock};
1652 QMutexLocker locker{&
bigLock};
1665 QMutexLocker locker{&
bigLock};
1678 QMutexLocker locker{&
bigLock};
1685 emit blackListChanged(blist);
1691 QMutexLocker locker{&
bigLock};
1698 emit inDevChanged(deviceSpecifier);
1704 QMutexLocker locker(&
bigLock);
1711 emit audioInDevEnabledChanged(enabled);
1717 QMutexLocker locker{&
bigLock};
1730 QMutexLocker locker{&
bigLock};
1737 emit audioThresholdChanged(percent);
1743 QMutexLocker locker{&
bigLock};
1750 emit videoDevChanged(deviceSpecifier);
1756 QMutexLocker locker{&
bigLock};
1763 emit outDevChanged(deviceSpecifier);
1769 QMutexLocker locker(&
bigLock);
1776 emit audioOutDevEnabledChanged(enabled);
1782 QMutexLocker locker{&
bigLock};
1789 emit outVolumeChanged(volume);
1795 const QMutexLocker locker{&
bigLock};
1802 emit audioBitrateChanged(bitrate);
1808 QMutexLocker locker(&
bigLock);
1815 emit screenRegionChanged(value);
1821 QMutexLocker locker(&
bigLock);
1828 emit screenGrabbedChanged(value);
1834 QMutexLocker locker{&
bigLock};
1841 emit camVideoResChanged(newValue);
1847 QMutexLocker locker{&
bigLock};
1854 emit camVideoFPSChanged(newValue);
1860 QMutexLocker locker{&
bigLock};
1871 QMutexLocker locker{&
bigLock};
1872 auto key =
ToxPk(newAddr);
1874 frnd.addr = newAddr;
1879 QMutexLocker locker{&
bigLock};
1880 auto it =
friendLst.find(
id.getByteArray());
1889 QMutexLocker locker{&
bigLock};
1896 QMutexLocker locker{&
bigLock};
1897 auto it =
friendLst.find(
id.getByteArray());
1899 return it->circleID;
1906 QMutexLocker locker{&
bigLock};
1908 frnd.circleID = circleID;
1913 QMutexLocker locker{&
bigLock};
1914 auto it =
friendLst.find(
id.getByteArray());
1916 return it->activity;
1923 QMutexLocker locker{&
bigLock};
1925 frnd.activity = activity;
1936 QMutexLocker locker{&
bigLock};
1940 bool Settings::getCompactLayout()
const
1942 QMutexLocker locker{&
bigLock};
1955 QMutexLocker locker{&
bigLock};
1968 QMutexLocker locker{&
bigLock};
1981 QMutexLocker locker{&
bigLock};
1994 QMutexLocker locker{&
bigLock};
2007 const QMutexLocker locker{&
bigLock};
2020 QMutexLocker locker{&
bigLock};
2026 QMutexLocker locker{&
bigLock};
2032 QMutexLocker locker{&
bigLock};
2039 QMutexLocker locker{&
bigLock};
2056 QMutexLocker locker{&
bigLock};
2062 QMutexLocker locker{&
bigLock};
2068 QMutexLocker locker{&
bigLock};
2071 if (queued.address == friendAddress) {
2073 queued.read =
false;
2079 request.
address = friendAddress;
2081 request.
read =
false;
2089 QMutexLocker locker{&
bigLock};
2090 unsigned int unreadFriendRequests = 0;
2093 ++unreadFriendRequests;
2095 return unreadFriendRequests;
2100 QMutexLocker locker{&
bigLock};
2106 QMutexLocker locker{&
bigLock};
2112 QMutexLocker locker{&
bigLock};
2115 request.read =
true;
2120 QMutexLocker locker{&
bigLock};
2126 QMutexLocker locker{&
bigLock};
2142 QMutexLocker locker{&
bigLock};
2155 QMutexLocker locker{&
bigLock};
2186 QMutexLocker locker{&
bigLock};
2189 qDebug() <<
"Creating new profile settings in " << path;
2191 QSettings ps(path, QSettings::IniFormat);
2192 ps.setIniCodec(
"UTF-8");
2193 ps.beginGroup(
"Friends");
2194 ps.beginWriteArray(
"Friend", 0);
2198 ps.beginGroup(
"Privacy");
2207 QMutexLocker locker{&
bigLock};
2210 QDir directory(dir);
2211 if (!directory.exists() && !directory.mkpath(directory.absolutePath()))
2212 qCritical() <<
"Error while creating directory " << dir;
2221 QMetaObject::invokeMethod(&
getInstance(),
"sync", Qt::BlockingQueuedConnection);
2225 QMutexLocker locker{&
bigLock};
2226 qApp->processEvents();
2233 auto it =
friendLst.find(
id.getByteArray());
2250 qWarning() <<
"Repairing invalid ProxyType, UDP will be enabled";
2255 template <
typename T>
2257 QMutexLocker locker{&
bigLock};
2258 if (savedVal != newVal) {
static QFont getFont(Font font)
void setTimestampFormat(const QString &format)
void beginWriteArray(const QString &prefix, int size=-1)
void setProxyType(ICoreSettings::ProxyType type) override
QString getContactNote(const ToxPk &id) const override
void emojiFontPointSizeChanged(int size)
void setGlobalAutoAcceptDir(const QString &dir)
void removeFriendSettings(const ToxPk &id) override
void sortingModeChanged(FriendListSortingMode mode)
QString getSettingsDirPath() const
Get path to directory, where the settings files are stored.
QVector< circleProp > circleLst
void setEnableTestSound(bool newValue) override
void setAutoAcceptDir(const ToxPk &id, const QString &dir) override
void saveFriendSettings(const ToxPk &id) override
void setFriendSortingMode(FriendListSortingMode mode)
bool minimizeOnCloseChanged(bool enabled)
void loadPersonal(QString profileName, const ToxEncrypt *passKey)
void setBusySound(bool newValue) override
bool getCheckUpdates() const
void setSeparateWindow(bool value)
int addCircle(const QString &name=QString())
void makeToxPortableChanged(bool enabled)
void setArrayIndex(int i)
static const QString globalSettingsFile
void notifyChanged(bool enabled)
void setAudioInGainDecibel(qreal dB) override
void dateFormatChanged(const QString &format)
void separateWindowChanged(bool enabled)
bool getAutoLogin() const
void setStylePreference(StyleType newValue)
void desktopNotifyChanged(bool enabled)
bool statusChangeNotificationEnabled
void autoSaveEnabledChanged(bool enabled)
void setContactNote(const ToxPk &id, const QString ¬e) override
void setScreenRegion(const QRect &value) override
bool getAutostartInTray() const
float getCamVideoFPS() const override
int getCircleCount() const
QString getFriendAlias(const ToxPk &id) const override
bool getEnableLanDiscovery() const override
QByteArray getWindowGeometry() const
void setProxyPort(quint16 port) override
void windowStateChanged(const QByteArray &state)
ICoreSettings::ProxyType proxyType
QHash< QString, QByteArray > widgetSettings
Assume all widgets have unique names.
void load()
Loads the settings from file.
void showWindowChanged(bool enabled)
void closeToTrayChanged(bool enabled)
bool getMinimizeToTray() const
void nameColorsChanged(bool enabled)
Handles all qTox internal paths.
void setAudioBitrate(int bitrate) override
void createSettingsDir()
Creates a path to the settings dir, if it doesn't already exist.
static bool verifyProxySettings(const QCommandLineParser &parser)
void setShowIdenticons(bool value)
void setCircleExpanded(int id, bool expanded)
uint32_t getCurrentProfileId() const
int getAutoAwayTime() const
void setBlackList(const QStringList &blist) override
void setValue(const QString &key, const QVariant &value)
const QFont & getChatMessageFont() const
bool getShowWindow() const override
const ToxEncrypt * getPasskey() const
void removeFriendRequest(int index)
void setChatMessageFont(const QFont &font)
void setMinimizeToTray(bool newValue)
void setCurrentProfile(const QString &profile)
QByteArray dialogGeometry
QString getFriendAddress(const QString &publicKey) const
QString getSmileyPack() const
void autoLoginChanged(bool enabled)
QString getOutDev() const override
int getEmojiFontPointSize() const
bool getForceTCP() const override
QByteArray getDialogSplitterState() const
QString getInDev() const override
void setAutoLogin(bool state)
void globalAutoAcceptDirChanged(const QString &path)
bool getStatusChangeNotificationEnabled() const
void setTypingNotification(bool enabled)
bool getDontGroupWindows() const
static uint32_t makeProfileId(const QString &profile)
void setAutostartInTray(bool newValue)
void setFriendAlias(const ToxPk &id, const QString &alias) override
void setMaxAutoAcceptSize(size_t size)
void busySoundChanged(bool enabled)
bool getEnableTestSound() const override
void setForceTCP(bool enabled) override
bool getNotify() const override
void dialogSettingsGeometryChanged(const QByteArray &rect)
bool getSpellCheckingEnabled() const
bool getUseEmoticons() const
void setShowGroupJoinLeaveMessages(bool newValue) override
void autorunChanged(bool enabled)
void enableLoggingChanged(bool enabled)
bool getAudioInDevEnabled() const override
void autoAwayTimeChanged(int minutes)
void useEmoticonsChanged(bool enabled)
void notifyHideChanged(bool enabled)
bool getShowSystemTray() const
const QString & getDateFormat() const
bool setPortable(bool portable)
Set paths to passed portable or system wide.
QNetworkProxy getProxy() const override
QByteArray dialogSettingsGeometry
static Profile * getProfile()
Get current user profile.
void currentProfileIdChanged(quint32 id)
void setAutoGroupInvite(const ToxPk &id, bool accept) override
void createPersonal(const QString &basename) const
Write a default personal .ini settings file for a profile.
QByteArray getDialogSettingsGeometry() const
void setDontGroupWindows(bool value)
int secondColumnHandlePosFromRight
void setEnableIPv6(bool enabled) override
QString globalAutoAcceptDir
QString getAutoAcceptDir(const ToxPk &id) const override
unsigned int getUnreadFriendRequests() const
void setNotifyHide(bool newValue) override
void translationChanged(const QString &translation)
void smileyPackChanged(const QString &name)
void setFriendCircleID(const ToxPk &id, int circleID) override
void setDialogSettingsGeometry(const QByteArray &value)
void setAudioThreshold(qreal percent) override
void styleChanged(const QString &style)
StyleType stylePreference
int getFriendCircleID(const ToxPk &id) const override
friendProp & getOrInsertFriendPropRef(const ToxPk &id)
QByteArray getSplitterState() const
void setEnableLogging(bool newValue)
void setProxyAddr(const QString &address) override
void setWindowGeometry(const QByteArray &value)
void beginGroup(const QString &prefix)
bool getEnableGroupChatsColor() const
void setDialogGeometry(const QByteArray &value)
void splitterStateChanged(const QByteArray &state)
void chatMessageFontChanged(const QFont &font)
bool showGroupJoinLeaveMessages
AutoAcceptCallFlags getAutoAcceptCall(const ToxPk &id) const override
void setGroupchatPosition(bool value)
QString getGlobalAutoAcceptDir() const
void lightTrayIconChanged(bool enabled)
void setEnableGroupChatsColor(bool state)
QRect getScreenRegion() const override
QByteArray getDialogGeometry() const
bool getGroupchatPosition() const
bool getBusySound() const override
bool getSeparateWindow() const
void setAutorun(bool newValue)
This class represents a Tox Public Key, which is a part of Tox ID.
void setSplitterState(const QByteArray &value)
void setShowSystemTray(bool newValue)
bool getShowGroupJoinLeaveMessages() const override
quint16 getProxyPort() const override
StyleType getStylePreference() const
void windowGeometryChanged(const QByteArray &rect)
bool spellCheckingEnabled
void setEnableLanDiscovery(bool enabled) override
bool getCircleExpanded(int id) const
QByteArray windowGeometry
void dontGroupWindowsChanged(bool enabled)
void minimizeToTrayChanged(bool enabled)
QRect getCamVideoRes() const override
Encapsulates the toxencrypsave API. Since key derivation is work intensive and to avoid storing plain...
void setEmojiFontPointSize(int value)
bool getMakeToxPortable() const
void setLightTrayIcon(bool newValue)
QList< Request > friendRequests
void setAudioOutDevEnabled(bool enabled) override
static QThread * settingsThread
void readFriendRequest(int index)
QDateTime getFriendActivity(const ToxPk &id) const override
void setScreenGrabbed(bool value) override
void setAutoSaveEnabled(bool newValue)
void setFriendActivity(const ToxPk &id, const QDateTime &date) override
bool getAutoGroupInvite(const ToxPk &id) const override
ICoreSettings::ProxyType fixInvalidProxyType(ICoreSettings::ProxyType proxyType)
void saveGlobal()
Asynchronous, saves the global settings.
void checkUpdatesChanged(bool enabled)
QByteArray getWindowState() const
void notifySoundChanged(bool enabled)
void spellCheckingEnabledChanged(bool enabled)
void setCompactLayout(bool compact)
void setCheckUpdates(bool newValue)
static Settings & getInstance()
Returns the singleton instance.
QHash< QByteArray, friendProp > friendLst
void themeColorChanged(int color)
void sync()
Waits for all asynchronous operations to complete.
bool isPortable() const
Check if qTox is running in portable mode.
void setInDev(const QString &deviceSpecifier) override
void setThemeColor(int value)
QString getProxyAddr() const override
void setStyle(const QString &newValue)
bool getNotifySound() const override
void updateProfileData(Profile *profile, const QCommandLineParser *parser)
void stylePreferenceChanged(StyleType type)
void setWidgetData(const QString &uniqueName, const QByteArray &data)
void setCamVideoRes(QRect newValue) override
void groupchatPositionChanged(bool enabled)
bool getScreenGrabbed() const override
bool getNotifyHide() const override
const QString & getTimestampFormat() const
int getThemeColor() const
void showSystemTrayChanged(bool enabled)
bool getCloseToTray() const
QByteArray dialogSplitterState
void widgetDataChanged(const QString &key)
bool setVal(T &savedVal, T newVal)
bool getGroupAlwaysNotify() const override
bool getEnableLogging() const
void clearUnreadFriendRequests()
int getFriendRequestSize() const
QString getCircleName(int id) const
int getOutVolume() const override
void typingNotificationChanged(bool enabled)
Serializes a QSettings's data in an (optionally) encrypted binary format. SettingsSerializer can dete...
bool getEnableIPv6() const override
void save()
Saves the current settings back to file.
void setCloseToTray(bool newValue)
bool getDesktopNotify() const override
FriendListSortingMode sortingMode
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
void dialogGeometryChanged(const QByteArray &rect)
void setCircleName(int id, const QString &name)
void autostartInTrayChanged(bool enabled)
QString getCurrentProfile() const
void setVideoDev(const QString &deviceSpecifier) override
bool getTypingNotification() const
void savePersonal()
Asynchronous, saves the current profile.
QString getTranslation() const
void setDateFormat(const QString &format)
void setDesktopNotify(bool enabled) override
void setNotifySound(bool newValue) override
qreal getAudioInGainDecibel() const override
uint32_t currentProfileId
int beginReadArray(const QString &prefix)
QStringList getBlackList() const override
FriendListSortingMode getFriendSortingMode() const
bool getShowIdenticons() const
static CompatibleRecursiveMutex bigLock
void setShowWindow(bool newValue) override
void setOutDev(const QString &deviceSpecifier) override
void setUseEmoticons(bool newValue)
void groupAlwaysNotifyChanged(bool enabled)
void dialogSplitterStateChanged(const QByteArray &state)
void compactLayoutChanged(bool enabled)
void setAudioInDevEnabled(bool enabled) override
void setStatusChangeNotificationEnabled(bool newValue)
QByteArray getWidgetData(const QString &uniqueName) const
void setSmileyPack(const QString &value)
bool applyCommandLineOptions(const QCommandLineParser &parser)
void setAutoAcceptCall(const ToxPk &id, AutoAcceptCallFlags accept) override
void setWindowState(const QByteArray &value)
void autoAcceptMaxSizeChanged(size_t size)
bool getMinimizeOnClose() const
void setDialogSplitterState(const QByteArray &value)
static void destroyInstance()
void setMinimizeOnClose(bool newValue)
static Settings * settings
void setCamVideoFPS(float newValue) override
Request getFriendRequest(int index) const
void setNotify(bool newValue) override
bool getAutoSaveEnabled() const
ICoreSettings::ProxyType getProxyType() const override
QString getVideoDev() const override
bool addFriendRequest(const QString &friendAddress, const QString &message)
void setOutVolume(int volume) override
void statusChangeNotificationEnabledChanged(bool enabled)
void setMakeToxPortable(bool newValue)
void setTranslation(const QString &newValue)
size_t getMaxAutoAcceptSize() const
qreal getAudioThreshold() const override
void setSpellCheckingEnabled(bool newValue)
void showIdenticonsChanged(bool enabled)
void setAutoAwayTime(int newValue)
Sets how long the user may stay idle, before online status is set to "away".
bool getAudioOutDevEnabled() const override
int getAudioBitrate() const override
void timestampFormatChanged(const QString &format)
void updateFriendAddress(const QString &newAddr)
void setGroupAlwaysNotify(bool newValue) override
bool getLightTrayIcon() const