qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
settings.cpp
Go to the documentation of this file.
1 /*
2  Copyright © 2013 by Maxim Biro <nurupo.contributions@gmail.com>
3  Copyright © 2014-2019 by The qTox Project Contributors
4 
5  This file is part of qTox, a Qt-based graphical interface for Tox.
6 
7  qTox is libre software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  qTox is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with qTox. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #include "settings.h"
22 #include "src/core/core.h"
23 #include "src/core/corefile.h"
24 #include "src/nexus.h"
29 #include "src/widget/gui.h"
30 #include "src/widget/style.h"
31 #ifdef QTOX_PLATFORM_EXT
32 #include "src/platform/autorun.h"
33 #endif
34 #include "src/ipc.h"
35 
36 #include "util/compatiblerecursivemutex.h"
37 
38 #include <QApplication>
39 #include <QCryptographicHash>
40 #include <QDebug>
41 #include <QDir>
42 #include <QFile>
43 #include <QFont>
44 #include <QList>
45 #include <QMutexLocker>
46 #include <QNetworkProxy>
47 #include <QStandardPaths>
48 #include <QStyleFactory>
49 #include <QThread>
50 #include <QtCore/QCommandLineParser>
51 
60 const QString Settings::globalSettingsFile = "qtox.ini";
62 CompatibleRecursiveMutex Settings::bigLock;
63 QThread* Settings::settingsThread{nullptr};
64 
66  : loaded(false)
67  , useCustomDhtList{false}
68  , currentProfileId(0)
69 {
70  settingsThread = new QThread();
71  settingsThread->setObjectName("qTox Settings");
72  settingsThread->start(QThread::LowPriority);
73  moveToThread(settingsThread);
74  loadGlobal();
75 }
76 
78 {
79  sync();
80  settingsThread->exit(0);
81  settingsThread->wait();
82  delete settingsThread;
83 }
84 
89 {
90  if (!settings)
91  settings = new Settings();
92 
93  return *settings;
94 }
95 
97 {
98  delete settings;
99  settings = nullptr;
100 }
101 
103 {
104  QMutexLocker locker{&bigLock};
105 
106  if (loaded)
107  return;
108 
110 
111  QDir dir(paths.getSettingsDirPath());
112  QString filePath = dir.filePath(globalSettingsFile);
113 
114  // If no settings file exist -- use the default one
115  if (!QFile(filePath).exists()) {
116  qDebug() << "No settings file found, using defaults";
117  filePath = ":/conf/" + globalSettingsFile;
118  }
119 
120  qDebug() << "Loading settings from " + filePath;
121 
122  QSettings s(filePath, QSettings::IniFormat);
123  s.setIniCodec("UTF-8");
124 
125  s.beginGroup("Login");
126  {
127  autoLogin = s.value("autoLogin", false).toBool();
128  }
129  s.endGroup();
130 
131  s.beginGroup("General");
132  {
133  translation = s.value("translation", "en").toString();
134  showSystemTray = s.value("showSystemTray", true).toBool();
135  autostartInTray = s.value("autostartInTray", false).toBool();
136  closeToTray = s.value("closeToTray", false).toBool();
137  if (currentProfile.isEmpty()) {
138  currentProfile = s.value("currentProfile", "").toString();
140  }
141  autoAwayTime = s.value("autoAwayTime", 10).toInt();
142  checkUpdates = s.value("checkUpdates", true).toBool();
143  // note: notifySound and busySound UI elements are now under UI settings
144  // page, but kept under General in settings file to be backwards compatible
145  notifySound = s.value("notifySound", true).toBool();
146  notifyHide = s.value("notifyHide", false).toBool();
147  busySound = s.value("busySound", false).toBool();
148  autoSaveEnabled = s.value("autoSaveEnabled", false).toBool();
149  globalAutoAcceptDir = s.value("globalAutoAcceptDir",
150  QStandardPaths::locate(QStandardPaths::HomeLocation, QString(),
151  QStandardPaths::LocateDirectory))
152  .toString();
154  static_cast<size_t>(s.value("autoAcceptMaxSize", 20 << 20 /*20 MB*/).toLongLong());
155  stylePreference = static_cast<StyleType>(s.value("stylePreference", 1).toInt());
156  }
157  s.endGroup();
158 
159  s.beginGroup("Advanced");
160  {
161  paths.setPortable(s.value("makeToxPortable", false).toBool());
162  enableIPv6 = s.value("enableIPv6", true).toBool();
163  forceTCP = s.value("forceTCP", false).toBool();
164  enableLanDiscovery = s.value("enableLanDiscovery", true).toBool();
165  }
166  s.endGroup();
167 
168  s.beginGroup("Widgets");
169  {
170  QList<QString> objectNames = s.childKeys();
171  for (const QString& name : objectNames)
172  widgetSettings[name] = s.value(name).toByteArray();
173  }
174  s.endGroup();
175 
176  s.beginGroup("GUI");
177  {
178  showWindow = s.value("showWindow", true).toBool();
179  notify = s.value("notify", true).toBool();
180  desktopNotify = s.value("desktopNotify", true).toBool();
181  groupAlwaysNotify = s.value("groupAlwaysNotify", true).toBool();
182  groupchatPosition = s.value("groupchatPosition", true).toBool();
183  separateWindow = s.value("separateWindow", false).toBool();
184  dontGroupWindows = s.value("dontGroupWindows", false).toBool();
185  showIdenticons = s.value("showIdenticons", true).toBool();
186 
187  const QString DEFAULT_SMILEYS = ":/smileys/emojione/emoticons.xml";
188  smileyPack = s.value("smileyPack", DEFAULT_SMILEYS).toString();
189  if (!QFile::exists(smileyPack)) {
190  smileyPack = DEFAULT_SMILEYS;
191  }
192 
193  emojiFontPointSize = s.value("emojiFontPointSize", 24).toInt();
194  firstColumnHandlePos = s.value("firstColumnHandlePos", 50).toInt();
195  secondColumnHandlePosFromRight = s.value("secondColumnHandlePosFromRight", 50).toInt();
196  timestampFormat = s.value("timestampFormat", "hh:mm:ss").toString();
197  dateFormat = s.value("dateFormat", "yyyy-MM-dd").toString();
198  minimizeOnClose = s.value("minimizeOnClose", false).toBool();
199  minimizeToTray = s.value("minimizeToTray", false).toBool();
200  lightTrayIcon = s.value("lightTrayIcon", false).toBool();
201  useEmoticons = s.value("useEmoticons", true).toBool();
202  statusChangeNotificationEnabled = s.value("statusChangeNotificationEnabled", false).toBool();
203  showGroupJoinLeaveMessages = s.value("showGroupJoinLeaveMessages", false).toBool();
204  spellCheckingEnabled = s.value("spellCheckingEnabled", true).toBool();
205  themeColor = s.value("themeColor", 0).toInt();
206  style = s.value("style", "").toString();
207  if (style == "") // Default to Fusion if available, otherwise no style
208  {
209  if (QStyleFactory::keys().contains("Fusion"))
210  style = "Fusion";
211  else
212  style = "None";
213  }
214  nameColors = s.value("nameColors", false).toBool();
215  }
216  s.endGroup();
217 
218  s.beginGroup("Chat");
219  {
220  chatMessageFont = s.value("chatMessageFont", Style::getFont(Style::Big)).value<QFont>();
221  }
222  s.endGroup();
223 
224  s.beginGroup("State");
225  {
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();
230  dialogSplitterState = s.value("dialogSplitterState", QByteArray()).toByteArray();
231  dialogSettingsGeometry = s.value("dialogSettingsGeometry", QByteArray()).toByteArray();
232  }
233  s.endGroup();
234 
235  s.beginGroup("Audio");
236  {
237  inDev = s.value("inDev", "").toString();
238  audioInDevEnabled = s.value("audioInDevEnabled", true).toBool();
239  outDev = s.value("outDev", "").toString();
240  audioOutDevEnabled = s.value("audioOutDevEnabled", true).toBool();
241  audioInGainDecibel = s.value("inGain", 0).toReal();
242  audioThreshold = s.value("audioThreshold", 0).toReal();
243  outVolume = s.value("outVolume", 100).toInt();
244  enableTestSound = s.value("enableTestSound", true).toBool();
245  audioBitrate = s.value("audioBitrate", 64).toInt();
246  }
247  s.endGroup();
248 
249  s.beginGroup("Video");
250  {
251  videoDev = s.value("videoDev", "").toString();
252  camVideoRes = s.value("camVideoRes", QRect()).toRect();
253  screenRegion = s.value("screenRegion", QRect()).toRect();
254  screenGrabbed = s.value("screenGrabbed", false).toBool();
255  camVideoFPS = static_cast<quint16>(s.value("camVideoFPS", 0).toUInt());
256  }
257  s.endGroup();
258 
259  loaded = true;
260 }
261 
262 void Settings::updateProfileData(Profile* profile, const QCommandLineParser* parser)
263 {
264  QMutexLocker locker{&bigLock};
265 
266  if (profile == nullptr) {
267  qWarning() << QString("Could not load new settings (profile change to nullptr)");
268  return;
269  }
270  setCurrentProfile(profile->getName());
271  saveGlobal();
272  loadPersonal(profile->getName(), profile->getPasskey());
273  if (parser) {
274  applyCommandLineOptions(*parser);
275  }
276 }
277 
284 bool Settings::verifyProxySettings(const QCommandLineParser& parser)
285 {
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(":");
291 
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");
297 
298  // Check for incompatible settings
299  bool activeProxyType = false;
300 
301  if (parser.isSet("P")) {
302  activeProxyType = proxySettingStrings[0] == SOCKS5 || proxySettingStrings[0] == HTTP;
303  }
304 
305  if (parser.isSet("I")) {
306  if (!(IPv6SettingString == ON || IPv6SettingString == OFF)) {
307  qCritical() << "Unable to parse IPv6 setting.";
308  return false;
309  }
310  }
311 
312  if (parser.isSet("U")) {
313  if (!(UDPSettingString == ON || UDPSettingString == OFF)) {
314  qCritical() << "Unable to parse UDP setting.";
315  return false;
316  }
317  }
318 
319  if (parser.isSet("L")) {
320  if (!(LANSettingString == ON || LANSettingString == OFF)) {
321  qCritical() << "Unable to parse LAN setting.";
322  return false;
323  }
324  }
325  if (activeProxyType && UDPSettingString == ON) {
326  qCritical() << "Cannot set UDP on with proxy.";
327  return false;
328  }
329 
330  if (activeProxyType && LANSettingString == ON) {
331  qCritical() << "Cannot use LAN discovery with proxy.";
332  return false;
333  }
334 
335  if (LANSettingString == ON && UDPSettingString == OFF) {
336  qCritical() << "Incompatible UDP/LAN settings.";
337  return false;
338  }
339 
340  if (parser.isSet("P")) {
341  if (proxySettingStrings[0] == NONE) {
342  // slightly lazy check here, accepting 'NONE[:.*]' is fine since no other
343  // arguments will be investigated when proxy settings are applied.
344  return true;
345  }
346  // Since the first argument isn't 'none', verify format of remaining arguments
347  if (proxySettingStrings.size() != 3) {
348  qCritical() << "Invalid number of proxy arguments.";
349  return false;
350  }
351 
352  if (!(proxySettingStrings[0] == SOCKS5 || proxySettingStrings[0] == HTTP)) {
353  qCritical() << "Unable to parse proxy type.";
354  return false;
355  }
356 
357  // TODO(Kriby): Sanity check IPv4/IPv6 addresses/hostnames?
358 
359  int portNumber = proxySettingStrings[2].toInt();
360  if (!(portNumber > 0 && portNumber < 65536)) {
361  qCritical() << "Invalid port number range.";
362  }
363  }
364  return true;
365 }
366 
373 bool Settings::applyCommandLineOptions(const QCommandLineParser& parser)
374 {
375  if (!verifyProxySettings(parser)) {
376  return false;
377  }
378 
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(":");
384 
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");
390 
391 
392  if (parser.isSet("I")) {
393  enableIPv6 = IPv6Setting == ON;
394  qDebug() << QString("Setting IPv6 %1.").arg(IPv6Setting);
395  }
396 
397  if (parser.isSet("P")) {
398  qDebug() << QString("Setting proxy type to %1.").arg(proxySettings[0]);
399 
400  quint16 portNumber = 0;
401  QString address = "";
402 
403  if (proxySettings[0] == NONE) {
405  } else {
406  if (proxySettings[0] == SOCKS5) {
408  } else if (proxySettings[0] == HTTP) {
410  } else {
411  qCritical() << "Failed to set valid proxy type";
412  assert(false); // verifyProxySettings should've made this impossible
413  }
414 
415  forceTCP = true;
416  enableLanDiscovery = false;
417 
418  address = proxySettings[1];
419  portNumber = static_cast<quint16>(proxySettings[2].toInt());
420  }
421 
422 
423  proxyAddr = address;
424  qDebug() << QString("Setting proxy address to %1.").arg(address);
425  proxyPort = portNumber;
426  qDebug() << QString("Setting port number to %1.").arg(portNumber);
427  }
428 
429  if (parser.isSet("U")) {
430  bool shouldForceTCP = UDPSetting == OFF;
431  if (!shouldForceTCP && proxyType != ICoreSettings::ProxyType::ptNone) {
432  qDebug() << "Cannot use UDP with proxy; disable proxy explicitly with '-P none'.";
433  } else {
434  forceTCP = shouldForceTCP;
435  qDebug() << QString("Setting UDP %1.").arg(UDPSetting);
436  }
437 
438  // LANSetting == ON is caught by verifyProxySettings, the OFF check removes needless debug
439  if (shouldForceTCP && !(LANSetting == OFF) && enableLanDiscovery) {
440  qDebug() << "Cannot perform LAN discovery without UDP; disabling LAN discovery.";
441  enableLanDiscovery = false;
442  }
443  }
444 
445  if (parser.isSet("L")) {
446  bool shouldEnableLAN = LANSetting == ON;
447 
448  if (shouldEnableLAN && proxyType != ICoreSettings::ProxyType::ptNone) {
449  qDebug()
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'.";
453  } else {
454  enableLanDiscovery = shouldEnableLAN;
455  qDebug() << QString("Setting LAN Discovery %1.").arg(LANSetting);
456  }
457  }
458  return true;
459 }
460 
461 void Settings::loadPersonal(QString profileName, const ToxEncrypt* passKey)
462 {
463  QMutexLocker locker{&bigLock};
464 
465  QDir dir(paths.getSettingsDirPath());
466  QString filePath = dir.filePath(globalSettingsFile);
467 
468  // load from a profile specific friend data list if possible
469  QString tmp = dir.filePath(profileName + ".ini");
470  if (QFile(tmp).exists()) // otherwise, filePath remains the global file
471  filePath = tmp;
472 
473  qDebug() << "Loading personal settings from" << filePath;
474 
475  SettingsSerializer ps(filePath, passKey);
476  ps.load();
477  friendLst.clear();
478 
479  ps.beginGroup("Privacy");
480  {
481  typingNotification = ps.value("typingNotification", true).toBool();
482  enableLogging = ps.value("enableLogging", true).toBool();
483  blackList = ps.value("blackList").toString().split('\n');
484  }
485  ps.endGroup();
486 
487  ps.beginGroup("Friends");
488  {
489  int size = ps.beginReadArray("Friend");
490  friendLst.reserve(size);
491  for (int i = 0; i < size; i++) {
492  ps.setArrayIndex(i);
493  friendProp fp{ps.value("addr").toString()};
494  fp.alias = ps.value("alias").toString();
495  fp.note = ps.value("note").toString();
496  fp.autoAcceptDir = ps.value("autoAcceptDir").toString();
497 
498  if (fp.autoAcceptDir == "")
499  fp.autoAcceptDir = ps.value("autoAccept").toString();
500 
501  fp.autoAcceptCall =
502  Settings::AutoAcceptCallFlags(QFlag(ps.value("autoAcceptCall", 0).toInt()));
503  fp.autoGroupInvite = ps.value("autoGroupInvite").toBool();
504  fp.circleID = ps.value("circle", -1).toInt();
505 
506  if (getEnableLogging())
507  fp.activity = ps.value("activity", QDateTime()).toDateTime();
508  friendLst.insert(ToxPk(fp.addr).getByteArray(), fp);
509  }
510  ps.endArray();
511  }
512  ps.endGroup();
513 
514  ps.beginGroup("Requests");
515  {
516  int size = ps.beginReadArray("Request");
517  friendRequests.clear();
518  friendRequests.reserve(size);
519  for (int i = 0; i < size; i++) {
520  ps.setArrayIndex(i);
521  Request request;
522  request.address = ps.value("addr").toString();
523  request.message = ps.value("message").toString();
524  request.read = ps.value("read").toBool();
525  friendRequests.push_back(request);
526  }
527  ps.endArray();
528  }
529  ps.endGroup();
530 
531  ps.beginGroup("GUI");
532  {
533  compactLayout = ps.value("compactLayout", true).toBool();
534  sortingMode = static_cast<FriendListSortingMode>(
535  ps.value("friendSortingMethod", static_cast<int>(FriendListSortingMode::Name)).toInt());
536  }
537  ps.endGroup();
538 
539  ps.beginGroup("Proxy");
540  {
541  proxyType = static_cast<ProxyType>(ps.value("proxyType", 0 /* ProxyType::None */).toInt());
543  proxyAddr = ps.value("proxyAddr", proxyAddr).toString();
544  proxyPort = static_cast<quint16>(ps.value("proxyPort", proxyPort).toUInt());
545  }
546  ps.endGroup();
547 
548  ps.beginGroup("Circles");
549  {
550  int size = ps.beginReadArray("Circle");
551  circleLst.clear();
552  circleLst.reserve(size);
553  for (int i = 0; i < size; i++) {
554  ps.setArrayIndex(i);
555  circleProp cp;
556  cp.name = ps.value("name").toString();
557  cp.expanded = ps.value("expanded", true).toBool();
558  circleLst.push_back(cp);
559  }
560  ps.endArray();
561  }
562  ps.endGroup();
563 }
564 
566 {
567  // To stop saving
568  loaded = false;
569 
570  // Remove file with profile settings
571  QDir dir(paths.getSettingsDirPath());
572  Profile* profile = Nexus::getProfile();
573  QString localPath = dir.filePath(profile->getName() + ".ini");
574  QFile local(localPath);
575  if (local.exists())
576  local.remove();
577 }
578 
583 {
584  if (QThread::currentThread() != settingsThread)
585  return (void)QMetaObject::invokeMethod(&getInstance(), "saveGlobal");
586 
587  QMutexLocker locker{&bigLock};
588  if (!loaded)
589  return;
590 
591  QString path = paths.getSettingsDirPath() + globalSettingsFile;
592  qDebug() << "Saving global settings at " + path;
593 
594  QSettings s(path, QSettings::IniFormat);
595  s.setIniCodec("UTF-8");
596 
597  s.clear();
598 
599  s.beginGroup("Login");
600  {
601  s.setValue("autoLogin", autoLogin);
602  }
603  s.endGroup();
604 
605  s.beginGroup("General");
606  {
607  s.setValue("translation", translation);
608  s.setValue("showSystemTray", showSystemTray);
609  s.setValue("autostartInTray", autostartInTray);
610  s.setValue("closeToTray", closeToTray);
611  s.setValue("currentProfile", currentProfile);
612  s.setValue("autoAwayTime", autoAwayTime);
613  s.setValue("checkUpdates", checkUpdates);
614  s.setValue("notifySound", notifySound);
615  s.setValue("notifyHide", notifyHide);
616  s.setValue("busySound", busySound);
617  s.setValue("autoSaveEnabled", autoSaveEnabled);
618  s.setValue("autoAcceptMaxSize", static_cast<qlonglong>(autoAcceptMaxSize));
619  s.setValue("globalAutoAcceptDir", globalAutoAcceptDir);
620  s.setValue("stylePreference", static_cast<int>(stylePreference));
621  }
622  s.endGroup();
623 
624  s.beginGroup("Advanced");
625  {
626  s.setValue("makeToxPortable", paths.isPortable());
627  s.setValue("enableIPv6", enableIPv6);
628  s.setValue("forceTCP", forceTCP);
629  s.setValue("enableLanDiscovery", enableLanDiscovery);
630  s.setValue("dbSyncType", static_cast<int>(dbSyncType));
631  }
632  s.endGroup();
633 
634  s.beginGroup("Widgets");
635  {
636  const QList<QString> widgetNames = widgetSettings.keys();
637  for (const QString& name : widgetNames)
638  s.setValue(name, widgetSettings.value(name));
639  }
640  s.endGroup();
641 
642  s.beginGroup("GUI");
643  {
644  s.setValue("showWindow", showWindow);
645  s.setValue("notify", notify);
646  s.setValue("desktopNotify", desktopNotify);
647  s.setValue("groupAlwaysNotify", groupAlwaysNotify);
648  s.setValue("separateWindow", separateWindow);
649  s.setValue("dontGroupWindows", dontGroupWindows);
650  s.setValue("groupchatPosition", groupchatPosition);
651  s.setValue("showIdenticons", showIdenticons);
652 
653  s.setValue("smileyPack", smileyPack);
654  s.setValue("emojiFontPointSize", emojiFontPointSize);
655  s.setValue("firstColumnHandlePos", firstColumnHandlePos);
656  s.setValue("secondColumnHandlePosFromRight", secondColumnHandlePosFromRight);
657  s.setValue("timestampFormat", timestampFormat);
658  s.setValue("dateFormat", dateFormat);
659  s.setValue("minimizeOnClose", minimizeOnClose);
660  s.setValue("minimizeToTray", minimizeToTray);
661  s.setValue("lightTrayIcon", lightTrayIcon);
662  s.setValue("useEmoticons", useEmoticons);
663  s.setValue("themeColor", themeColor);
664  s.setValue("style", style);
665  s.setValue("nameColors", nameColors);
666  s.setValue("statusChangeNotificationEnabled", statusChangeNotificationEnabled);
667  s.setValue("showGroupJoinLeaveMessages", showGroupJoinLeaveMessages);
668  s.setValue("spellCheckingEnabled", spellCheckingEnabled);
669  }
670  s.endGroup();
671 
672  s.beginGroup("Chat");
673  {
674  s.setValue("chatMessageFont", chatMessageFont);
675  }
676  s.endGroup();
677 
678  s.beginGroup("State");
679  {
680  s.setValue("windowGeometry", windowGeometry);
681  s.setValue("windowState", windowState);
682  s.setValue("splitterState", splitterState);
683  s.setValue("dialogGeometry", dialogGeometry);
684  s.setValue("dialogSplitterState", dialogSplitterState);
685  s.setValue("dialogSettingsGeometry", dialogSettingsGeometry);
686  }
687  s.endGroup();
688 
689  s.beginGroup("Audio");
690  {
691  s.setValue("inDev", inDev);
692  s.setValue("audioInDevEnabled", audioInDevEnabled);
693  s.setValue("outDev", outDev);
694  s.setValue("audioOutDevEnabled", audioOutDevEnabled);
695  s.setValue("inGain", audioInGainDecibel);
696  s.setValue("audioThreshold", audioThreshold);
697  s.setValue("outVolume", outVolume);
698  s.setValue("enableTestSound", enableTestSound);
699  s.setValue("audioBitrate", audioBitrate);
700  }
701  s.endGroup();
702 
703  s.beginGroup("Video");
704  {
705  s.setValue("videoDev", videoDev);
706  s.setValue("camVideoRes", camVideoRes);
707  s.setValue("camVideoFPS", camVideoFPS);
708  s.setValue("screenRegion", screenRegion);
709  s.setValue("screenGrabbed", screenGrabbed);
710  }
711  s.endGroup();
712 }
713 
718 {
720 }
721 
727 {
728  if (!profile) {
729  qDebug() << "Could not save personal settings because there is no active profile";
730  return;
731  }
732  if (QThread::currentThread() != settingsThread)
733  return (void)QMetaObject::invokeMethod(&getInstance(), "savePersonal",
734  Q_ARG(Profile*, profile));
735  savePersonal(profile->getName(), profile->getPasskey());
736 }
737 
738 void Settings::savePersonal(QString profileName, const ToxEncrypt* passkey)
739 {
740  QMutexLocker locker{&bigLock};
741  if (!loaded)
742  return;
743 
744  QString path = paths.getSettingsDirPath() + profileName + ".ini";
745 
746  qDebug() << "Saving personal settings at " << path;
747 
748  SettingsSerializer ps(path, passkey);
749  ps.beginGroup("Friends");
750  {
751  ps.beginWriteArray("Friend", friendLst.size());
752  int index = 0;
753  for (auto& frnd : friendLst) {
754  ps.setArrayIndex(index);
755  ps.setValue("addr", frnd.addr);
756  ps.setValue("alias", frnd.alias);
757  ps.setValue("note", frnd.note);
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);
762 
763  if (getEnableLogging())
764  ps.setValue("activity", frnd.activity);
765 
766  ++index;
767  }
768  ps.endArray();
769  }
770  ps.endGroup();
771 
772  ps.beginGroup("Requests");
773  {
774  ps.beginWriteArray("Request", friendRequests.size());
775  int index = 0;
776  for (auto& request : friendRequests) {
777  ps.setArrayIndex(index);
778  ps.setValue("addr", request.address);
779  ps.setValue("message", request.message);
780  ps.setValue("read", request.read);
781 
782  ++index;
783  }
784  ps.endArray();
785  }
786  ps.endGroup();
787 
788  ps.beginGroup("GUI");
789  {
790  ps.setValue("compactLayout", compactLayout);
791  ps.setValue("friendSortingMethod", static_cast<int>(sortingMode));
792  }
793  ps.endGroup();
794 
795  ps.beginGroup("Proxy");
796  {
797  ps.setValue("proxyType", static_cast<int>(proxyType));
798  ps.setValue("proxyAddr", proxyAddr);
799  ps.setValue("proxyPort", proxyPort);
800  }
801  ps.endGroup();
802 
803  ps.beginGroup("Circles");
804  {
805  ps.beginWriteArray("Circle", circleLst.size());
806  int index = 0;
807  for (auto& circle : circleLst) {
808  ps.setArrayIndex(index);
809  ps.setValue("name", circle.name);
810  ps.setValue("expanded", circle.expanded);
811  ++index;
812  }
813  ps.endArray();
814  }
815  ps.endGroup();
816 
817  ps.beginGroup("Privacy");
818  {
819  ps.setValue("typingNotification", typingNotification);
820  ps.setValue("enableLogging", enableLogging);
821  ps.setValue("blackList", blackList.join('\n'));
822  }
823  ps.endGroup();
824  ps.save();
825 }
826 
827 uint32_t Settings::makeProfileId(const QString& profile)
828 {
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];
832 }
833 
835 {
836  return paths;
837 }
838 
840 {
841  QMutexLocker locker{&bigLock};
842  return enableTestSound;
843 }
844 
845 void Settings::setEnableTestSound(bool newValue)
846 {
847  if (setVal(enableTestSound, newValue)) {
848  emit enableTestSoundChanged(newValue);
849  }
850 }
851 
853 {
854  QMutexLocker locker{&bigLock};
855  return enableIPv6;
856 }
857 
858 void Settings::setEnableIPv6(bool enabled)
859 {
860  if (setVal(enableIPv6, enabled)) {
861  emit enableIPv6Changed(enabled);
862  }
863 }
864 
866 {
867  QMutexLocker locker{&bigLock};
868  return paths.isPortable();
869 }
870 
871 void Settings::setMakeToxPortable(bool newValue)
872 {
873  bool changed = false;
874  {
875  QMutexLocker locker{&bigLock};
876  auto const oldSettingsPath = paths.getSettingsDirPath() + globalSettingsFile;
877  changed = paths.setPortable(newValue);
878  if (changed) {
879  QFile(oldSettingsPath).remove();
880  saveGlobal();
881  emit makeToxPortableChanged(newValue);
882  }
883  }
884 }
885 
887 {
888  QMutexLocker locker{&bigLock};
889 
890 #ifdef QTOX_PLATFORM_EXT
891  return Platform::getAutorun();
892 #else
893  return false;
894 #endif
895 }
896 
897 void Settings::setAutorun(bool newValue)
898 {
899 #ifdef QTOX_PLATFORM_EXT
900  bool autorun = Platform::getAutorun();
901 
902  if (newValue != autorun) {
903  Platform::setAutorun(newValue);
904  emit autorunChanged(autorun);
905  }
906 #else
907  Q_UNUSED(newValue)
908 #endif
909 }
910 
912 {
913  QMutexLocker locker{&bigLock};
914  return autostartInTray;
915 }
916 
917 QString Settings::getStyle() const
918 {
919  QMutexLocker locker{&bigLock};
920  return style;
921 }
922 
923 void Settings::setStyle(const QString& newStyle)
924 {
925  if (setVal(style, newStyle)) {
926  emit styleChanged(style);
927  }
928 }
929 
931 {
932  QMutexLocker locker{&bigLock};
933  return showSystemTray;
934 }
935 
936 void Settings::setShowSystemTray(bool newValue)
937 {
938  if (setVal(showSystemTray, newValue)) {
939  emit showSystemTrayChanged(newValue);
940  }
941 }
942 
943 void Settings::setUseEmoticons(bool newValue)
944 {
945  if (setVal(useEmoticons, newValue)) {
946  emit useEmoticonsChanged(newValue);
947  }
948 }
949 
951 {
952  QMutexLocker locker{&bigLock};
953  return useEmoticons;
954 }
955 
956 void Settings::setAutoSaveEnabled(bool newValue)
957 {
958  if (setVal(autoSaveEnabled, newValue)) {
959  emit autoSaveEnabledChanged(newValue);
960  }
961 }
962 
964 {
965  QMutexLocker locker{&bigLock};
966  return autoSaveEnabled;
967 }
968 
969 void Settings::setAutostartInTray(bool newValue)
970 {
971  if (setVal(autostartInTray, newValue)) {
972  emit autostartInTrayChanged(newValue);
973  }
974 }
975 
977 {
978  QMutexLocker locker{&bigLock};
979  return closeToTray;
980 }
981 
982 void Settings::setCloseToTray(bool newValue)
983 {
984  if (setVal(closeToTray, newValue)) {
985  emit closeToTrayChanged(newValue);
986  }
987 }
988 
990 {
991  QMutexLocker locker{&bigLock};
992  return minimizeToTray;
993 }
994 
995 void Settings::setMinimizeToTray(bool newValue)
996 {
997  if (setVal(minimizeToTray, newValue)) {
998  emit minimizeToTrayChanged(newValue);
999  }
1000 }
1001 
1003 {
1004  QMutexLocker locker{&bigLock};
1005  return lightTrayIcon;
1006 }
1007 
1008 void Settings::setLightTrayIcon(bool newValue)
1009 {
1010  if (setVal(lightTrayIcon, newValue)) {
1011  emit lightTrayIconChanged(newValue);
1012  }
1013 }
1014 
1016 {
1017  QMutexLocker locker{&bigLock};
1019 }
1020 
1022 {
1023  if (setVal(statusChangeNotificationEnabled, newValue)) {
1025  }
1026 }
1027 
1029 {
1030  QMutexLocker locker{&bigLock};
1032 }
1033 
1035 {
1036  if (setVal(showGroupJoinLeaveMessages, newValue)) {
1037  emit showGroupJoinLeaveMessagesChanged(newValue);
1038  }
1039 }
1040 
1042 {
1043  const QMutexLocker locker{&bigLock};
1044  return spellCheckingEnabled;
1045 }
1046 
1048 {
1049  if (setVal(spellCheckingEnabled, newValue)) {
1050  emit spellCheckingEnabledChanged(newValue);
1051  }
1052 }
1053 
1055 {
1056  QMutexLocker locker{&bigLock};
1057  return notifySound;
1058 }
1059 
1060 void Settings::setNotifySound(bool newValue)
1061 {
1062  if (setVal(notifySound, newValue)) {
1063  emit notifySoundChanged(newValue);
1064  }
1065 }
1066 
1068 {
1069  QMutexLocker locker{&bigLock};
1070  return notifyHide;
1071 }
1072 
1073 void Settings::setNotifyHide(bool newValue)
1074 {
1075  if (setVal(notifyHide, newValue)) {
1076  emit notifyHideChanged(newValue);
1077  }
1078 }
1079 
1081 {
1082  QMutexLocker locker{&bigLock};
1083  return busySound;
1084 }
1085 
1086 void Settings::setBusySound(bool newValue)
1087 {
1088  if (setVal(busySound, newValue)) {
1089  emit busySoundChanged(newValue);
1090  }
1091 }
1092 
1094 {
1095  QMutexLocker locker{&bigLock};
1096  return groupAlwaysNotify;
1097 }
1098 
1100 {
1101  if (setVal(groupAlwaysNotify, newValue)) {
1102  emit groupAlwaysNotifyChanged(newValue);
1103  }
1104 }
1105 
1107 {
1108  QMutexLocker locker{&bigLock};
1109  return translation;
1110 }
1111 
1112 void Settings::setTranslation(const QString& newValue)
1113 {
1114  if (setVal(translation, newValue)) {
1115  emit translationChanged(newValue);
1116  }
1117 }
1118 
1120 {
1121  QMutexLocker locker{&bigLock};
1122  return forceTCP;
1123 }
1124 
1125 void Settings::setForceTCP(bool enabled)
1126 {
1127  if (setVal(forceTCP, enabled)) {
1128  emit forceTCPChanged(enabled);
1129  }
1130 }
1131 
1133 {
1134  QMutexLocker locker{&bigLock};
1135  return enableLanDiscovery;
1136 }
1137 
1139 {
1140  if (setVal(enableLanDiscovery, enabled)) {
1141  emit enableLanDiscoveryChanged(enabled);
1142  }
1143 }
1144 
1145 QNetworkProxy Settings::getProxy() const
1146 {
1147  QMutexLocker locker{&bigLock};
1148 
1149  QNetworkProxy proxy;
1150  switch (Settings::getProxyType()) {
1151  case ProxyType::ptNone:
1152  proxy.setType(QNetworkProxy::NoProxy);
1153  break;
1154  case ProxyType::ptSOCKS5:
1155  proxy.setType(QNetworkProxy::Socks5Proxy);
1156  break;
1157  case ProxyType::ptHTTP:
1158  proxy.setType(QNetworkProxy::HttpProxy);
1159  break;
1160  default:
1161  proxy.setType(QNetworkProxy::NoProxy);
1162  qWarning() << "Invalid proxy type, setting to NoProxy";
1163  break;
1164  }
1165 
1166  proxy.setHostName(Settings::getProxyAddr());
1167  proxy.setPort(Settings::getProxyPort());
1168  return proxy;
1169 }
1170 
1172 {
1173  QMutexLocker locker{&bigLock};
1174  return proxyType;
1175 }
1176 
1178 {
1179  if (setVal(proxyType, newValue)) {
1180  emit proxyTypeChanged(newValue);
1181  }
1182 }
1183 
1184 QString Settings::getProxyAddr() const
1185 {
1186  QMutexLocker locker{&bigLock};
1187  return proxyAddr;
1188 }
1189 
1190 void Settings::setProxyAddr(const QString& address)
1191 {
1192  if (setVal(proxyAddr, address)) {
1193  emit proxyAddressChanged(address);
1194  }
1195 }
1196 
1197 quint16 Settings::getProxyPort() const
1198 {
1199  QMutexLocker locker{&bigLock};
1200  return proxyPort;
1201 }
1202 
1203 void Settings::setProxyPort(quint16 port)
1204 {
1205  if (setVal(proxyPort, port)) {
1206  emit proxyPortChanged(port);
1207  }
1208 }
1209 
1211 {
1212  QMutexLocker locker{&bigLock};
1213  return currentProfile;
1214 }
1215 
1217 {
1218  QMutexLocker locker{&bigLock};
1219  return currentProfileId;
1220 }
1221 
1222 void Settings::setCurrentProfile(const QString& profile)
1223 {
1224  bool updated = false;
1225  uint32_t newProfileId = 0;
1226  {
1227  QMutexLocker locker{&bigLock};
1228 
1229  if (profile != currentProfile) {
1230  currentProfile = profile;
1232  newProfileId = currentProfileId;
1233  updated = true;
1234  }
1235  }
1236  if (updated) {
1237  emit currentProfileIdChanged(newProfileId);
1238  }
1239 }
1240 
1242 {
1243  QMutexLocker locker{&bigLock};
1244  return enableLogging;
1245 }
1246 
1247 void Settings::setEnableLogging(bool newValue)
1248 {
1249  if (setVal(enableLogging, newValue)) {
1250  emit enableLoggingChanged(newValue);
1251  }
1252 }
1253 
1255 {
1256  QMutexLocker locker{&bigLock};
1257  return autoAwayTime;
1258 }
1259 
1265 void Settings::setAutoAwayTime(int newValue)
1266 {
1267  if (newValue < 0) {
1268  newValue = 10;
1269  }
1270 
1271  if (setVal(autoAwayTime, newValue)) {
1272  emit autoAwayTimeChanged(newValue);
1273  }
1274 }
1275 
1276 QString Settings::getAutoAcceptDir(const ToxPk& id) const
1277 {
1278  QMutexLocker locker{&bigLock};
1279 
1280  auto it = friendLst.find(id.getByteArray());
1281  if (it != friendLst.end())
1282  return it->autoAcceptDir;
1283 
1284  return QString();
1285 }
1286 
1287 void Settings::setAutoAcceptDir(const ToxPk& id, const QString& dir)
1288 {
1289  bool updated = false;
1290  {
1291  QMutexLocker locker{&bigLock};
1292 
1293  auto& frnd = getOrInsertFriendPropRef(id);
1294 
1295  if (frnd.autoAcceptDir != dir) {
1296  frnd.autoAcceptDir = dir;
1297  updated = true;
1298  }
1299  }
1300  if (updated) {
1301  emit autoAcceptDirChanged(id, dir);
1302  }
1303 }
1304 
1305 Settings::AutoAcceptCallFlags Settings::getAutoAcceptCall(const ToxPk& id) const
1306 {
1307  QMutexLocker locker{&bigLock};
1308 
1309  auto it = friendLst.find(id.getByteArray());
1310  if (it != friendLst.end())
1311  return it->autoAcceptCall;
1312 
1313  return Settings::AutoAcceptCallFlags();
1314 }
1315 
1316 void Settings::setAutoAcceptCall(const ToxPk& id, AutoAcceptCallFlags accept)
1317 {
1318  bool updated = false;
1319  {
1320  QMutexLocker locker{&bigLock};
1321 
1322  auto& frnd = getOrInsertFriendPropRef(id);
1323 
1324  if (frnd.autoAcceptCall != accept) {
1325  frnd.autoAcceptCall = accept;
1326  updated = true;
1327  }
1328  }
1329  if (updated) {
1330  emit autoAcceptCallChanged(id, accept);
1331  }
1332 }
1333 
1335 {
1336  QMutexLocker locker{&bigLock};
1337 
1338  auto it = friendLst.find(id.getByteArray());
1339  if (it != friendLst.end()) {
1340  return it->autoGroupInvite;
1341  }
1342 
1343  return false;
1344 }
1345 
1346 void Settings::setAutoGroupInvite(const ToxPk& id, bool accept)
1347 {
1348  bool updated = false;
1349  {
1350  QMutexLocker locker{&bigLock};
1351 
1352  auto& frnd = getOrInsertFriendPropRef(id);
1353 
1354  if (frnd.autoGroupInvite != accept) {
1355  frnd.autoGroupInvite = accept;
1356  updated = true;
1357  }
1358  }
1359 
1360  if (updated) {
1361  emit autoGroupInviteChanged(id, accept);
1362  }
1363 }
1364 
1365 QString Settings::getContactNote(const ToxPk& id) const
1366 {
1367  QMutexLocker locker{&bigLock};
1368 
1369  auto it = friendLst.find(id.getByteArray());
1370  if (it != friendLst.end())
1371  return it->note;
1372 
1373  return QString();
1374 }
1375 
1376 void Settings::setContactNote(const ToxPk& id, const QString& note)
1377 {
1378  bool updated = false;
1379  {
1380  QMutexLocker locker{&bigLock};
1381 
1382  auto& frnd = getOrInsertFriendPropRef(id);
1383 
1384  if (frnd.note != note) {
1385  frnd.note = note;
1386  updated = true;
1387  }
1388  }
1389  if (updated) {
1390  emit contactNoteChanged(id, note);
1391  }
1392 }
1393 
1395 {
1396  QMutexLocker locker{&bigLock};
1397  return globalAutoAcceptDir;
1398 }
1399 
1400 void Settings::setGlobalAutoAcceptDir(const QString& newValue)
1401 {
1402  if (setVal(globalAutoAcceptDir, newValue)) {
1403  emit globalAutoAcceptDirChanged(newValue);
1404  }
1405 }
1406 
1408 {
1409  QMutexLocker locker{&bigLock};
1410  return autoAcceptMaxSize;
1411 }
1412 
1414 {
1415  if (setVal(autoAcceptMaxSize, size)) {
1416  emit autoAcceptMaxSizeChanged(size);
1417  }
1418 }
1419 
1420 const QFont& Settings::getChatMessageFont() const
1421 {
1422  QMutexLocker locker(&bigLock);
1423  return chatMessageFont;
1424 }
1425 
1426 void Settings::setChatMessageFont(const QFont& font)
1427 {
1428  if (setVal(chatMessageFont, font)) {
1429  emit chatMessageFontChanged(font);
1430  }
1431 }
1432 
1433 void Settings::setWidgetData(const QString& uniqueName, const QByteArray& data)
1434 {
1435  bool updated = false;
1436  {
1437  QMutexLocker locker{&bigLock};
1438 
1439  if (!widgetSettings.contains(uniqueName) || widgetSettings[uniqueName] != data) {
1440  widgetSettings[uniqueName] = data;
1441  updated = true;
1442  }
1443  }
1444  if (updated) {
1445  emit widgetDataChanged(uniqueName);
1446  }
1447 }
1448 
1449 QByteArray Settings::getWidgetData(const QString& uniqueName) const
1450 {
1451  QMutexLocker locker{&bigLock};
1452  return widgetSettings.value(uniqueName);
1453 }
1454 
1456 {
1457  QMutexLocker locker{&bigLock};
1458  return smileyPack;
1459 }
1460 
1461 void Settings::setSmileyPack(const QString& value)
1462 {
1463  if (setVal(smileyPack, value)) {
1464  emit smileyPackChanged(value);
1465  }
1466 }
1467 
1469 {
1470  QMutexLocker locker{&bigLock};
1471  return emojiFontPointSize;
1472 }
1473 
1475 {
1476  if (setVal(emojiFontPointSize, value)) {
1477  emit emojiFontPointSizeChanged(value);
1478  }
1479 }
1480 
1481 const QString& Settings::getTimestampFormat() const
1482 {
1483  QMutexLocker locker{&bigLock};
1484  return timestampFormat;
1485 }
1486 
1487 void Settings::setTimestampFormat(const QString& format)
1488 {
1489  if (setVal(timestampFormat, format)) {
1490  emit timestampFormatChanged(format);
1491  }
1492 }
1493 
1494 const QString& Settings::getDateFormat() const
1495 {
1496  QMutexLocker locker{&bigLock};
1497  return dateFormat;
1498 }
1499 
1500 void Settings::setDateFormat(const QString& format)
1501 {
1502  if (setVal(dateFormat, format)) {
1503  emit dateFormatChanged(format);
1504  }
1505 }
1506 
1508 {
1509  QMutexLocker locker{&bigLock};
1510  return stylePreference;
1511 }
1512 
1514 {
1515  if (setVal(stylePreference, newValue)) {
1516  emit stylePreferenceChanged(newValue);
1517  }
1518 }
1519 
1521 {
1522  QMutexLocker locker{&bigLock};
1523  return windowGeometry;
1524 }
1525 
1526 void Settings::setWindowGeometry(const QByteArray& value)
1527 {
1528  if (setVal(windowGeometry, value)) {
1529  emit windowGeometryChanged(value);
1530  }
1531 }
1532 
1533 QByteArray Settings::getWindowState() const
1534 {
1535  QMutexLocker locker{&bigLock};
1536  return windowState;
1537 }
1538 
1539 void Settings::setWindowState(const QByteArray& value)
1540 {
1541  if (setVal(windowState, value)) {
1542  emit windowStateChanged(value);
1543  }
1544 }
1545 
1547 {
1548  QMutexLocker locker{&bigLock};
1549  return checkUpdates;
1550 }
1551 
1552 void Settings::setCheckUpdates(bool newValue)
1553 {
1554  if (setVal(checkUpdates, newValue)) {
1555  emit checkUpdatesChanged(newValue);
1556  }
1557 }
1558 
1560 {
1561  QMutexLocker locker{&bigLock};
1562  return notify;
1563 }
1564 
1565 void Settings::setNotify(bool newValue)
1566 {
1567  if (setVal(notify, newValue)) {
1568  emit notifyChanged(newValue);
1569  }
1570 }
1571 
1573 {
1574  QMutexLocker locker{&bigLock};
1575  return showWindow;
1576 }
1577 
1578 void Settings::setShowWindow(bool newValue)
1579 {
1580  if (setVal(showWindow, newValue)) {
1581  emit showWindowChanged(newValue);
1582  }
1583 }
1584 
1586 {
1587  QMutexLocker locker{&bigLock};
1588  return desktopNotify;
1589 }
1590 
1591 void Settings::setDesktopNotify(bool enabled)
1592 {
1593  if (setVal(desktopNotify, enabled)) {
1594  emit desktopNotifyChanged(enabled);
1595  }
1596 }
1597 
1598 QByteArray Settings::getSplitterState() const
1599 {
1600  QMutexLocker locker{&bigLock};
1601  return splitterState;
1602 }
1603 
1604 void Settings::setSplitterState(const QByteArray& value)
1605 {
1606  if (setVal(splitterState, value)) {
1607  emit splitterStateChanged(value);
1608  }
1609 }
1610 
1612 {
1613  QMutexLocker locker{&bigLock};
1614  return dialogGeometry;
1615 }
1616 
1617 void Settings::setDialogGeometry(const QByteArray& value)
1618 {
1619  if (setVal(dialogGeometry, value)) {
1620  emit dialogGeometryChanged(value);
1621  }
1622 }
1623 
1625 {
1626  QMutexLocker locker{&bigLock};
1627  return dialogSplitterState;
1628 }
1629 
1630 void Settings::setDialogSplitterState(const QByteArray& value)
1631 {
1632  if (setVal(dialogSplitterState, value)) {
1633  emit dialogSplitterStateChanged(value);
1634  }
1635 }
1636 
1638 {
1639  QMutexLocker locker{&bigLock};
1640  return dialogSettingsGeometry;
1641 }
1642 
1643 void Settings::setDialogSettingsGeometry(const QByteArray& value)
1644 {
1645  if (setVal(dialogSettingsGeometry, value)) {
1646  emit dialogSettingsGeometryChanged(value);
1647  }
1648 }
1649 
1651 {
1652  QMutexLocker locker{&bigLock};
1653  return minimizeOnClose;
1654 }
1655 
1656 void Settings::setMinimizeOnClose(bool newValue)
1657 {
1658  if (setVal(minimizeOnClose, newValue)) {
1659  emit minimizeOnCloseChanged(newValue);
1660  }
1661 }
1662 
1664 {
1665  QMutexLocker locker{&bigLock};
1666  return typingNotification;
1667 }
1668 
1670 {
1671  if (setVal(typingNotification, enabled)) {
1672  emit typingNotificationChanged(enabled);
1673  }
1674 }
1675 
1676 QStringList Settings::getBlackList() const
1677 {
1678  QMutexLocker locker{&bigLock};
1679  return blackList;
1680 }
1681 
1682 void Settings::setBlackList(const QStringList& blist)
1683 {
1684  if (setVal(blackList, blist)) {
1685  emit blackListChanged(blist);
1686  }
1687 }
1688 
1689 QString Settings::getInDev() const
1690 {
1691  QMutexLocker locker{&bigLock};
1692  return inDev;
1693 }
1694 
1695 void Settings::setInDev(const QString& deviceSpecifier)
1696 {
1697  if (setVal(inDev, deviceSpecifier)) {
1698  emit inDevChanged(deviceSpecifier);
1699  }
1700 }
1701 
1703 {
1704  QMutexLocker locker(&bigLock);
1705  return audioInDevEnabled;
1706 }
1707 
1709 {
1710  if (setVal(audioInDevEnabled, enabled)) {
1711  emit audioInDevEnabledChanged(enabled);
1712  }
1713 }
1714 
1716 {
1717  QMutexLocker locker{&bigLock};
1718  return audioInGainDecibel;
1719 }
1720 
1722 {
1723  if (setVal(audioInGainDecibel, dB)) {
1724  emit audioInGainDecibelChanged(audioInGainDecibel);
1725  }
1726 }
1727 
1729 {
1730  QMutexLocker locker{&bigLock};
1731  return audioThreshold;
1732 }
1733 
1734 void Settings::setAudioThreshold(qreal percent)
1735 {
1736  if (setVal(audioThreshold, percent)) {
1737  emit audioThresholdChanged(percent);
1738  }
1739 }
1740 
1741 QString Settings::getVideoDev() const
1742 {
1743  QMutexLocker locker{&bigLock};
1744  return videoDev;
1745 }
1746 
1747 void Settings::setVideoDev(const QString& deviceSpecifier)
1748 {
1749  if (setVal(videoDev, deviceSpecifier)) {
1750  emit videoDevChanged(deviceSpecifier);
1751  }
1752 }
1753 
1754 QString Settings::getOutDev() const
1755 {
1756  QMutexLocker locker{&bigLock};
1757  return outDev;
1758 }
1759 
1760 void Settings::setOutDev(const QString& deviceSpecifier)
1761 {
1762  if (setVal(outDev, deviceSpecifier)) {
1763  emit outDevChanged(deviceSpecifier);
1764  }
1765 }
1766 
1768 {
1769  QMutexLocker locker(&bigLock);
1770  return audioOutDevEnabled;
1771 }
1772 
1774 {
1775  if (setVal(audioOutDevEnabled, enabled)) {
1776  emit audioOutDevEnabledChanged(enabled);
1777  }
1778 }
1779 
1781 {
1782  QMutexLocker locker{&bigLock};
1783  return outVolume;
1784 }
1785 
1786 void Settings::setOutVolume(int volume)
1787 {
1788  if (setVal(outVolume, volume)) {
1789  emit outVolumeChanged(volume);
1790  }
1791 }
1792 
1794 {
1795  const QMutexLocker locker{&bigLock};
1796  return audioBitrate;
1797 }
1798 
1799 void Settings::setAudioBitrate(int bitrate)
1800 {
1801  if (setVal(audioBitrate, bitrate)) {
1802  emit audioBitrateChanged(bitrate);
1803  }
1804 }
1805 
1807 {
1808  QMutexLocker locker(&bigLock);
1809  return screenRegion;
1810 }
1811 
1812 void Settings::setScreenRegion(const QRect& value)
1813 {
1814  if (setVal(screenRegion, value)) {
1815  emit screenRegionChanged(value);
1816  }
1817 }
1818 
1820 {
1821  QMutexLocker locker(&bigLock);
1822  return screenGrabbed;
1823 }
1824 
1826 {
1827  if (setVal(screenGrabbed, value)) {
1828  emit screenGrabbedChanged(value);
1829  }
1830 }
1831 
1833 {
1834  QMutexLocker locker{&bigLock};
1835  return camVideoRes;
1836 }
1837 
1838 void Settings::setCamVideoRes(QRect newValue)
1839 {
1840  if (setVal(camVideoRes, newValue)) {
1841  emit camVideoResChanged(newValue);
1842  }
1843 }
1844 
1846 {
1847  QMutexLocker locker{&bigLock};
1848  return camVideoFPS;
1849 }
1850 
1851 void Settings::setCamVideoFPS(float newValue)
1852 {
1853  if (setVal(camVideoFPS, newValue)) {
1854  emit camVideoFPSChanged(newValue);
1855  }
1856 }
1857 
1858 QString Settings::getFriendAddress(const QString& publicKey) const
1859 {
1860  QMutexLocker locker{&bigLock};
1861  QByteArray key = ToxPk(publicKey).getByteArray();
1862  auto it = friendLst.find(key);
1863  if (it != friendLst.end())
1864  return it->addr;
1865 
1866  return QString();
1867 }
1868 
1869 void Settings::updateFriendAddress(const QString& newAddr)
1870 {
1871  QMutexLocker locker{&bigLock};
1872  auto key = ToxPk(newAddr);
1873  auto& frnd = getOrInsertFriendPropRef(key);
1874  frnd.addr = newAddr;
1875 }
1876 
1877 QString Settings::getFriendAlias(const ToxPk& id) const
1878 {
1879  QMutexLocker locker{&bigLock};
1880  auto it = friendLst.find(id.getByteArray());
1881  if (it != friendLst.end())
1882  return it->alias;
1883 
1884  return QString();
1885 }
1886 
1887 void Settings::setFriendAlias(const ToxPk& id, const QString& alias)
1888 {
1889  QMutexLocker locker{&bigLock};
1890  auto& frnd = getOrInsertFriendPropRef(id);
1891  frnd.alias = alias;
1892 }
1893 
1895 {
1896  QMutexLocker locker{&bigLock};
1897  auto it = friendLst.find(id.getByteArray());
1898  if (it != friendLst.end())
1899  return it->circleID;
1900 
1901  return -1;
1902 }
1903 
1904 void Settings::setFriendCircleID(const ToxPk& id, int circleID)
1905 {
1906  QMutexLocker locker{&bigLock};
1907  auto& frnd = getOrInsertFriendPropRef(id);
1908  frnd.circleID = circleID;
1909 }
1910 
1911 QDateTime Settings::getFriendActivity(const ToxPk& id) const
1912 {
1913  QMutexLocker locker{&bigLock};
1914  auto it = friendLst.find(id.getByteArray());
1915  if (it != friendLst.end())
1916  return it->activity;
1917 
1918  return QDateTime();
1919 }
1920 
1921 void Settings::setFriendActivity(const ToxPk& id, const QDateTime& activity)
1922 {
1923  QMutexLocker locker{&bigLock};
1924  auto& frnd = getOrInsertFriendPropRef(id);
1925  frnd.activity = activity;
1926 }
1927 
1929 {
1930  Q_UNUSED(id)
1931  savePersonal();
1932 }
1933 
1935 {
1936  QMutexLocker locker{&bigLock};
1937  friendLst.remove(id.getByteArray());
1938 }
1939 
1940 bool Settings::getCompactLayout() const
1941 {
1942  QMutexLocker locker{&bigLock};
1943  return compactLayout;
1944 }
1945 
1947 {
1948  if (setVal(compactLayout, value)) {
1949  emit compactLayoutChanged(value);
1950  }
1951 }
1952 
1954 {
1955  QMutexLocker locker{&bigLock};
1956  return sortingMode;
1957 }
1958 
1960 {
1961  if (setVal(sortingMode, mode)) {
1962  emit sortingModeChanged(mode);
1963  }
1964 }
1965 
1967 {
1968  QMutexLocker locker{&bigLock};
1969  return separateWindow;
1970 }
1971 
1973 {
1974  if (setVal(separateWindow, value)) {
1975  emit separateWindowChanged(value);
1976  }
1977 }
1978 
1980 {
1981  QMutexLocker locker{&bigLock};
1982  return dontGroupWindows;
1983 }
1984 
1986 {
1987  if (setVal(dontGroupWindows, value)) {
1988  emit dontGroupWindowsChanged(value);
1989  }
1990 }
1991 
1993 {
1994  QMutexLocker locker{&bigLock};
1995  return groupchatPosition;
1996 }
1997 
1999 {
2000  if (setVal(groupchatPosition, value)) {
2001  emit groupchatPositionChanged(value);
2002  }
2003 }
2004 
2006 {
2007  const QMutexLocker locker{&bigLock};
2008  return showIdenticons;
2009 }
2010 
2012 {
2013  if (setVal(showIdenticons, value)) {
2014  emit showIdenticonsChanged(value);
2015  }
2016 }
2017 
2019 {
2020  QMutexLocker locker{&bigLock};
2021  return circleLst.size();
2022 }
2023 
2024 QString Settings::getCircleName(int id) const
2025 {
2026  QMutexLocker locker{&bigLock};
2027  return circleLst[id].name;
2028 }
2029 
2030 void Settings::setCircleName(int id, const QString& name)
2031 {
2032  QMutexLocker locker{&bigLock};
2033  circleLst[id].name = name;
2034  savePersonal();
2035 }
2036 
2037 int Settings::addCircle(const QString& name)
2038 {
2039  QMutexLocker locker{&bigLock};
2040 
2041  circleProp cp;
2042  cp.expanded = false;
2043 
2044  if (name.isEmpty())
2045  cp.name = tr("Circle #%1").arg(circleLst.count() + 1);
2046  else
2047  cp.name = name;
2048 
2049  circleLst.append(cp);
2050  savePersonal();
2051  return circleLst.count() - 1;
2052 }
2053 
2055 {
2056  QMutexLocker locker{&bigLock};
2057  return circleLst[id].expanded;
2058 }
2059 
2060 void Settings::setCircleExpanded(int id, bool expanded)
2061 {
2062  QMutexLocker locker{&bigLock};
2063  circleLst[id].expanded = expanded;
2064 }
2065 
2066 bool Settings::addFriendRequest(const QString& friendAddress, const QString& message)
2067 {
2068  QMutexLocker locker{&bigLock};
2069 
2070  for (auto queued : friendRequests) {
2071  if (queued.address == friendAddress) {
2072  queued.message = message;
2073  queued.read = false;
2074  return false;
2075  }
2076  }
2077 
2078  Request request;
2079  request.address = friendAddress;
2080  request.message = message;
2081  request.read = false;
2082 
2083  friendRequests.push_back(request);
2084  return true;
2085 }
2086 
2088 {
2089  QMutexLocker locker{&bigLock};
2090  unsigned int unreadFriendRequests = 0;
2091  for (auto request : friendRequests)
2092  if (!request.read)
2093  ++unreadFriendRequests;
2094 
2095  return unreadFriendRequests;
2096 }
2097 
2099 {
2100  QMutexLocker locker{&bigLock};
2101  return friendRequests.at(index);
2102 }
2103 
2105 {
2106  QMutexLocker locker{&bigLock};
2107  return friendRequests.size();
2108 }
2109 
2111 {
2112  QMutexLocker locker{&bigLock};
2113 
2114  for (auto& request : friendRequests)
2115  request.read = true;
2116 }
2117 
2119 {
2120  QMutexLocker locker{&bigLock};
2121  friendRequests.removeAt(index);
2122 }
2123 
2125 {
2126  QMutexLocker locker{&bigLock};
2127  friendRequests[index].read = true;
2128 }
2129 
2131 {
2132  // Replace index with last one and remove last one instead.
2133  // This gives you contiguous ids all the time.
2134  circleLst[id] = circleLst.last();
2135  circleLst.pop_back();
2136  savePersonal();
2137  return circleLst.count();
2138 }
2139 
2141 {
2142  QMutexLocker locker{&bigLock};
2143  return themeColor;
2144 }
2145 
2147 {
2148  if (setVal(themeColor, value)) {
2149  emit themeColorChanged(value);
2150  }
2151 }
2152 
2154 {
2155  QMutexLocker locker{&bigLock};
2156  return autoLogin;
2157 }
2158 
2159 void Settings::setAutoLogin(bool state)
2160 {
2161  if (setVal(autoLogin, state)) {
2162  emit autoLoginChanged(state);
2163  }
2164 }
2165 
2167 {
2168  if (setVal(nameColors, state)) {
2169  emit nameColorsChanged(state);
2170  }
2171 }
2172 
2174 {
2175  return nameColors;
2176 }
2177 
2184 void Settings::createPersonal(const QString& basename) const
2185 {
2186  QMutexLocker locker{&bigLock};
2187 
2188  QString path = paths.getSettingsDirPath() + QDir::separator() + basename + ".ini";
2189  qDebug() << "Creating new profile settings in " << path;
2190 
2191  QSettings ps(path, QSettings::IniFormat);
2192  ps.setIniCodec("UTF-8");
2193  ps.beginGroup("Friends");
2194  ps.beginWriteArray("Friend", 0);
2195  ps.endArray();
2196  ps.endGroup();
2197 
2198  ps.beginGroup("Privacy");
2199  ps.endGroup();
2200 }
2201 
2206 {
2207  QMutexLocker locker{&bigLock};
2208 
2209  QString dir = paths.getSettingsDirPath();
2210  QDir directory(dir);
2211  if (!directory.exists() && !directory.mkpath(directory.absolutePath()))
2212  qCritical() << "Error while creating directory " << dir;
2213 }
2214 
2219 {
2220  if (QThread::currentThread() != settingsThread) {
2221  QMetaObject::invokeMethod(&getInstance(), "sync", Qt::BlockingQueuedConnection);
2222  return;
2223  }
2224 
2225  QMutexLocker locker{&bigLock};
2226  qApp->processEvents();
2227 }
2228 
2230 {
2231  // No mutex lock, this is a private fn that should only be called by other
2232  // public functions that already locked the mutex
2233  auto it = friendLst.find(id.getByteArray());
2234  if (it == friendLst.end()) {
2235  it = friendLst.insert(id.getByteArray(), friendProp{id.toString()});
2236  }
2237 
2238  return *it;
2239 }
2240 
2242 {
2243  // Repair uninitialized enum that was saved to settings due to bug (https://github.com/qTox/qTox/issues/5311)
2244  switch (proxyType) {
2248  return proxyType;
2249  default:
2250  qWarning() << "Repairing invalid ProxyType, UDP will be enabled";
2252  }
2253 }
2254 
2255 template <typename T>
2256 bool Settings::setVal(T& savedVal, T newVal) {
2257  QMutexLocker locker{&bigLock};
2258  if (savedVal != newVal) {
2259  savedVal = newVal;
2260  return true;
2261  }
2262  return false;
2263 }
Settings::showSystemTray
bool showSystemTray
Definition: settings.h:88
Style::getFont
static QFont getFont(Font font)
Definition: style.cpp:214
Settings::lightTrayIcon
bool lightTrayIcon
Definition: settings.h:606
Settings::setTimestampFormat
void setTimestampFormat(const QString &format)
Definition: settings.cpp:1487
Settings::forceTCP
bool forceTCP
Definition: settings.h:618
SettingsSerializer::beginWriteArray
void beginWriteArray(const QString &prefix, int size=-1)
Definition: settingsserializer.cpp:146
Settings::setProxyType
void setProxyType(ICoreSettings::ProxyType type) override
Definition: settings.cpp:1177
Settings::getContactNote
QString getContactNote(const ToxPk &id) const override
Definition: settings.cpp:1365
Settings::emojiFontPointSizeChanged
void emojiFontPointSizeChanged(int size)
Settings::setGlobalAutoAcceptDir
void setGlobalAutoAcceptDir(const QString &dir)
Definition: settings.cpp:1400
Settings::removeFriendSettings
void removeFriendSettings(const ToxPk &id) override
Definition: settings.cpp:1934
profile.h
Settings::sortingModeChanged
void sortingModeChanged(FriendListSortingMode mode)
Settings
Definition: settings.h:51
Paths::getSettingsDirPath
QString getSettingsDirPath() const
Get path to directory, where the settings files are stored.
Definition: paths.cpp:286
Settings::circleLst
QVector< circleProp > circleLst
Definition: settings.h:711
Settings::paths
Paths paths
Definition: settings.h:719
Settings::setEnableTestSound
void setEnableTestSound(bool newValue) override
Definition: settings.cpp:845
Settings::setAutoAcceptDir
void setAutoAcceptDir(const ToxPk &id, const QString &dir) override
Definition: settings.cpp:1287
Settings::saveFriendSettings
void saveFriendSettings(const ToxPk &id) override
Definition: settings.cpp:1928
Settings::setFriendSortingMode
void setFriendSortingMode(FriendListSortingMode mode)
Definition: settings.cpp:1959
Settings::minimizeOnCloseChanged
bool minimizeOnCloseChanged(bool enabled)
style.h
Settings::loadPersonal
void loadPersonal(QString profileName, const ToxEncrypt *passKey)
Definition: settings.cpp:461
Settings::setBusySound
void setBusySound(bool newValue) override
Definition: settings.cpp:1086
Settings::getCheckUpdates
bool getCheckUpdates() const
Definition: settings.cpp:1546
Settings::setSeparateWindow
void setSeparateWindow(bool value)
Definition: settings.cpp:1972
Settings::addCircle
int addCircle(const QString &name=QString())
Definition: settings.cpp:2037
Settings::makeToxPortableChanged
void makeToxPortableChanged(bool enabled)
SettingsSerializer::setArrayIndex
void setArrayIndex(int i)
Definition: settingsserializer.cpp:170
Settings::globalSettingsFile
static const QString globalSettingsFile
Definition: settings.h:717
Settings::notifyChanged
void notifyChanged(bool enabled)
Settings::setAudioInGainDecibel
void setAudioInGainDecibel(qreal dB) override
Definition: settings.cpp:1721
Settings::dateFormatChanged
void dateFormatChanged(const QString &format)
Settings::separateWindowChanged
void separateWindowChanged(bool enabled)
Settings::getAutoLogin
bool getAutoLogin() const
Definition: settings.cpp:2153
Settings::setStylePreference
void setStylePreference(StyleType newValue)
Definition: settings.cpp:1513
Settings::desktopNotifyChanged
void desktopNotifyChanged(bool enabled)
Settings::statusChangeNotificationEnabled
bool statusChangeNotificationEnabled
Definition: settings.h:103
Settings::autoSaveEnabledChanged
void autoSaveEnabledChanged(bool enabled)
Settings::setContactNote
void setContactNote(const ToxPk &id, const QString &note) override
Definition: settings.cpp:1376
Settings::setScreenRegion
void setScreenRegion(const QRect &value) override
Definition: settings.cpp:1812
Settings::getAutostartInTray
bool getAutostartInTray() const
Definition: settings.cpp:911
Settings::getCamVideoFPS
float getCamVideoFPS() const override
Definition: settings.cpp:1845
Settings::compactLayout
bool compactLayout
Definition: settings.h:64
Settings::getCircleCount
int getCircleCount() const
Definition: settings.cpp:2018
Settings::getStyle
QString getStyle() const
Definition: settings.cpp:917
settings.h
Settings::getFriendAlias
QString getFriendAlias(const ToxPk &id) const override
Definition: settings.cpp:1877
ICoreSettings::ProxyType
ProxyType
Definition: icoresettings.h:30
Settings::getEnableLanDiscovery
bool getEnableLanDiscovery() const override
Definition: settings.cpp:1132
Settings::getWindowGeometry
QByteArray getWindowGeometry() const
Definition: settings.cpp:1520
Settings::setProxyPort
void setProxyPort(quint16 port) override
Definition: settings.cpp:1203
Settings::firstColumnHandlePos
int firstColumnHandlePos
Definition: settings.h:656
Settings::windowStateChanged
void windowStateChanged(const QByteArray &state)
Settings::audioInGainDecibel
qreal audioInGainDecibel
Definition: settings.h:117
Settings::groupAlwaysNotify
bool groupAlwaysNotify
Definition: settings.h:615
Settings::proxyType
ICoreSettings::ProxyType proxyType
Definition: settings.h:621
Settings::widgetSettings
QHash< QString, QByteArray > widgetSettings
Assume all widgets have unique names.
Definition: settings.h:632
Settings::camVideoRes
QRect camVideoRes
Definition: settings.h:128
SettingsSerializer::load
void load()
Loads the settings from file.
Definition: settingsserializer.cpp:242
Settings::showWindowChanged
void showWindowChanged(bool enabled)
Settings::audioBitrate
int audioBitrate
Definition: settings.h:124
Settings::closeToTrayChanged
void closeToTrayChanged(bool enabled)
Settings::getMinimizeToTray
bool getMinimizeToTray() const
Definition: settings.cpp:989
Settings::nameColorsChanged
void nameColorsChanged(bool enabled)
Profile
Handles all qTox internal paths.
Definition: profile.h:42
Settings::autoLogin
bool autoLogin
Definition: settings.h:594
Settings::enableIPv6
bool enableIPv6
Definition: settings.h:601
Settings::setAudioBitrate
void setAudioBitrate(int bitrate) override
Definition: settings.cpp:1799
Settings::createSettingsDir
void createSettingsDir()
Creates a path to the settings dir, if it doesn't already exist.
Definition: settings.cpp:2205
Settings::verifyProxySettings
static bool verifyProxySettings(const QCommandLineParser &parser)
Definition: settings.cpp:284
Settings::setShowIdenticons
void setShowIdenticons(bool value)
Definition: settings.cpp:2011
Settings::setCircleExpanded
void setCircleExpanded(int id, bool expanded)
Definition: settings.cpp:2060
Settings::getCurrentProfileId
uint32_t getCurrentProfileId() const
Definition: settings.cpp:1216
Settings::getAutoAwayTime
int getAutoAwayTime() const
Definition: settings.cpp:1254
Settings::setBlackList
void setBlackList(const QStringList &blist) override
Definition: settings.cpp:1682
SettingsSerializer::setValue
void setValue(const QString &key, const QVariant &value)
Definition: settingsserializer.cpp:175
Settings::getChatMessageFont
const QFont & getChatMessageFont() const
Definition: settings.cpp:1420
Paths
Definition: paths.h:28
Settings::windowState
QByteArray windowState
Definition: settings.h:77
Settings::audioInDevEnabled
bool audioInDevEnabled
Definition: settings.h:115
Settings::typingNotification
bool typingNotification
Definition: settings.h:109
Settings::smileyPack
QString smileyPack
Definition: settings.h:70
Settings::getShowWindow
bool getShowWindow() const override
Definition: settings.cpp:1572
Profile::getPasskey
const ToxEncrypt * getPasskey() const
Definition: profile.cpp:922
Settings::removeFriendRequest
void removeFriendRequest(int index)
Definition: settings.cpp:2118
Settings::setChatMessageFont
void setChatMessageFont(const QFont &font)
Definition: settings.cpp:1426
Settings::setMinimizeToTray
void setMinimizeToTray(bool newValue)
Definition: settings.cpp:995
Settings::setCurrentProfile
void setCurrentProfile(const QString &profile)
Definition: settings.cpp:1222
Settings::dialogGeometry
QByteArray dialogGeometry
Definition: settings.h:81
Settings::getFriendAddress
QString getFriendAddress(const QString &publicKey) const
Definition: settings.cpp:1858
Settings::getSmileyPack
QString getSmileyPack() const
Definition: settings.cpp:1455
Settings::autoLoginChanged
void autoLoginChanged(bool enabled)
Settings::getOutDev
QString getOutDev() const override
Definition: settings.cpp:1754
Settings::circleProp::name
QString name
Definition: settings.h:705
Settings::getEmojiFontPointSize
int getEmojiFontPointSize() const
Definition: settings.cpp:1468
Settings::Settings
Settings()
Definition: settings.cpp:65
Settings::getForceTCP
bool getForceTCP() const override
Definition: settings.cpp:1119
Settings::getDialogSplitterState
QByteArray getDialogSplitterState() const
Definition: settings.cpp:1624
Settings::separateWindow
bool separateWindow
Definition: settings.h:69
Settings::getInDev
QString getInDev() const override
Definition: settings.cpp:1689
Settings::Request::message
QString message
Definition: settings.h:165
settingsserializer.h
Settings::setAutoLogin
void setAutoLogin(bool state)
Definition: settings.cpp:2159
Settings::globalAutoAcceptDirChanged
void globalAutoAcceptDirChanged(const QString &path)
Settings::getStatusChangeNotificationEnabled
bool getStatusChangeNotificationEnabled() const
Definition: settings.cpp:1015
Settings::setTypingNotification
void setTypingNotification(bool enabled)
Definition: settings.cpp:1669
Settings::~Settings
~Settings()
Definition: settings.cpp:77
Settings::getDontGroupWindows
bool getDontGroupWindows() const
Definition: settings.cpp:1979
Settings::makeProfileId
static uint32_t makeProfileId(const QString &profile)
Definition: settings.cpp:827
Settings::setAutostartInTray
void setAutostartInTray(bool newValue)
Definition: settings.cpp:969
Settings::setFriendAlias
void setFriendAlias(const ToxPk &id, const QString &alias) override
Definition: settings.cpp:1887
Settings::setMaxAutoAcceptSize
void setMaxAutoAcceptSize(size_t size)
Definition: settings.cpp:1413
Settings::Request::read
bool read
Definition: settings.h:166
Settings::busySoundChanged
void busySoundChanged(bool enabled)
Settings::getEnableTestSound
bool getEnableTestSound() const override
Definition: settings.cpp:839
Settings::setForceTCP
void setForceTCP(bool enabled) override
Definition: settings.cpp:1125
Settings::getNotify
bool getNotify() const override
Definition: settings.cpp:1559
QList< QString >
Settings::showIdenticons
bool showIdenticons
Definition: settings.h:90
Settings::dialogSettingsGeometryChanged
void dialogSettingsGeometryChanged(const QByteArray &rect)
Settings::getSpellCheckingEnabled
bool getSpellCheckingEnabled() const
Definition: settings.cpp:1041
Settings::enableTestSound
bool enableTestSound
Definition: settings.h:678
Settings::getUseEmoticons
bool getUseEmoticons() const
Definition: settings.cpp:950
Settings::setShowGroupJoinLeaveMessages
void setShowGroupJoinLeaveMessages(bool newValue) override
Definition: settings.cpp:1034
Settings::autorunChanged
void autorunChanged(bool enabled)
Settings::enableLoggingChanged
void enableLoggingChanged(bool enabled)
Settings::audioOutDevEnabled
bool audioOutDevEnabled
Definition: settings.h:122
Profile::getName
QString getName() const
Definition: profile.cpp:435
Settings::getAudioInDevEnabled
bool getAudioInDevEnabled() const override
Definition: settings.cpp:1702
Settings::autoAwayTimeChanged
void autoAwayTimeChanged(int minutes)
Settings::useEmoticonsChanged
void useEmoticonsChanged(bool enabled)
Settings::notifyHideChanged
void notifyHideChanged(bool enabled)
Settings::getShowSystemTray
bool getShowSystemTray() const
Definition: settings.cpp:930
Settings::getDateFormat
const QString & getDateFormat() const
Definition: settings.cpp:1494
Paths::setPortable
bool setPortable(bool portable)
Set paths to passed portable or system wide.
Definition: paths.cpp:136
Settings::removeCircle
int removeCircle(int id)
Definition: settings.cpp:2130
Settings::resetToDefault
void resetToDefault()
Definition: settings.cpp:565
Settings::getAutorun
bool getAutorun() const
Definition: settings.cpp:886
Settings::getProxy
QNetworkProxy getProxy() const override
Definition: settings.cpp:1145
Settings::dialogSettingsGeometry
QByteArray dialogSettingsGeometry
Definition: settings.h:85
Nexus::getProfile
static Profile * getProfile()
Get current user profile.
Definition: nexus.cpp:290
Settings::currentProfileIdChanged
void currentProfileIdChanged(quint32 id)
Settings::setAutoGroupInvite
void setAutoGroupInvite(const ToxPk &id, bool accept) override
Definition: settings.cpp:1346
Settings::timestampFormat
QString timestampFormat
Definition: settings.h:100
Settings::createPersonal
void createPersonal(const QString &basename) const
Write a default personal .ini settings file for a profile.
Definition: settings.cpp:2184
Settings::getDialogSettingsGeometry
QByteArray getDialogSettingsGeometry() const
Definition: settings.cpp:1637
Settings::setDontGroupWindows
void setDontGroupWindows(bool value)
Definition: settings.cpp:1985
Settings::secondColumnHandlePosFromRight
int secondColumnHandlePosFromRight
Definition: settings.h:657
Settings::setEnableIPv6
void setEnableIPv6(bool enabled) override
Definition: settings.cpp:858
Settings::globalAutoAcceptDir
QString globalAutoAcceptDir
Definition: settings.h:635
Settings::friendProp
Definition: settings.h:687
Settings::translation
QString translation
Definition: settings.h:602
Settings::getAutoAcceptDir
QString getAutoAcceptDir(const ToxPk &id) const override
Definition: settings.cpp:1276
Settings::loadGlobal
void loadGlobal()
Definition: settings.cpp:102
Settings::getUnreadFriendRequests
unsigned int getUnreadFriendRequests() const
Definition: settings.cpp:2087
Settings::groupchatPosition
bool groupchatPosition
Definition: settings.h:94
Settings::circleProp::expanded
bool expanded
Definition: settings.h:706
Settings::setNotifyHide
void setNotifyHide(bool newValue) override
Definition: settings.cpp:1073
Settings::translationChanged
void translationChanged(const QString &translation)
Settings::StyleType
StyleType
Definition: settings.h:134
Settings::smileyPackChanged
void smileyPackChanged(const QString &name)
Settings::setFriendCircleID
void setFriendCircleID(const ToxPk &id, int circleID) override
Definition: settings.cpp:1904
Settings::autostartInTray
bool autostartInTray
Definition: settings.h:603
Settings::setDialogSettingsGeometry
void setDialogSettingsGeometry(const QByteArray &value)
Definition: settings.cpp:1643
Settings::setAudioThreshold
void setAudioThreshold(qreal percent) override
Definition: settings.cpp:1734
Settings::FriendListSortingMode
FriendListSortingMode
Definition: settings.h:141
Settings::styleChanged
void styleChanged(const QString &style)
Settings::desktopNotify
bool desktopNotify
Definition: settings.h:610
Settings::stylePreference
StyleType stylePreference
Definition: settings.h:98
Settings::getFriendCircleID
int getFriendCircleID(const ToxPk &id) const override
Definition: settings.cpp:1894
Settings::autoSaveEnabled
bool autoSaveEnabled
Definition: settings.h:634
SettingsSerializer::endGroup
void endGroup()
Definition: settingsserializer.cpp:124
Settings::autorun
bool autorun
Definition: settings.h:65
Settings::enableLogging
bool enableLogging
Definition: settings.h:628
Settings::autoAwayTime
int autoAwayTime
Definition: settings.h:630
Settings::getOrInsertFriendPropRef
friendProp & getOrInsertFriendPropRef(const ToxPk &id)
Definition: settings.cpp:2229
Settings::getSplitterState
QByteArray getSplitterState() const
Definition: settings.cpp:1598
Settings::setEnableLogging
void setEnableLogging(bool newValue)
Definition: settings.cpp:1247
Settings::setProxyAddr
void setProxyAddr(const QString &address) override
Definition: settings.cpp:1190
Settings::setWindowGeometry
void setWindowGeometry(const QByteArray &value)
Definition: settings.cpp:1526
Settings::screenGrabbed
bool screenGrabbed
Definition: settings.h:130
SettingsSerializer::beginGroup
void beginGroup(const QString &prefix)
Definition: settingsserializer.cpp:111
Settings::getEnableGroupChatsColor
bool getEnableGroupChatsColor() const
Definition: settings.cpp:2173
Settings::setDialogGeometry
void setDialogGeometry(const QByteArray &value)
Definition: settings.cpp:1617
Settings::checkUpdates
bool checkUpdates
Definition: settings.h:608
Settings::splitterStateChanged
void splitterStateChanged(const QByteArray &state)
Settings::chatMessageFontChanged
void chatMessageFontChanged(const QFont &font)
Settings::showGroupJoinLeaveMessages
bool showGroupJoinLeaveMessages
Definition: settings.h:661
Settings::getAutoAcceptCall
AutoAcceptCallFlags getAutoAcceptCall(const ToxPk &id) const override
Definition: settings.cpp:1305
Settings::setGroupchatPosition
void setGroupchatPosition(bool value)
Definition: settings.cpp:1998
Settings::getGlobalAutoAcceptDir
QString getGlobalAutoAcceptDir() const
Definition: settings.cpp:1394
smileypack.h
Settings::lightTrayIconChanged
void lightTrayIconChanged(bool enabled)
HistMessageContentType::message
@ message
Settings::setEnableGroupChatsColor
void setEnableGroupChatsColor(bool state)
Definition: settings.cpp:2166
Settings::getScreenRegion
QRect getScreenRegion() const override
Definition: settings.cpp:1806
Settings::getDialogGeometry
QByteArray getDialogGeometry() const
Definition: settings.cpp:1611
Settings::getGroupchatPosition
bool getGroupchatPosition() const
Definition: settings.cpp:1992
Settings::getBusySound
bool getBusySound() const override
Definition: settings.cpp:1080
Settings::getSeparateWindow
bool getSeparateWindow() const
Definition: settings.cpp:1966
Settings::setAutorun
void setAutorun(bool newValue)
Definition: settings.cpp:897
ToxPk
This class represents a Tox Public Key, which is a part of Tox ID.
Definition: toxpk.h:26
Settings::setSplitterState
void setSplitterState(const QByteArray &value)
Definition: settings.cpp:1604
Settings::setShowSystemTray
void setShowSystemTray(bool newValue)
Definition: settings.cpp:936
Settings::getShowGroupJoinLeaveMessages
bool getShowGroupJoinLeaveMessages() const override
Definition: settings.cpp:1028
Settings::useEmoticons
bool useEmoticons
Definition: settings.h:607
Settings::getProxyPort
quint16 getProxyPort() const override
Definition: settings.cpp:1197
SettingsSerializer::endArray
void endArray()
Definition: settingsserializer.cpp:165
Settings::proxyAddr
QString proxyAddr
Definition: settings.h:622
Settings::nameColors
bool nameColors
Definition: settings.h:616
Settings::getStylePreference
StyleType getStylePreference() const
Definition: settings.cpp:1507
Settings::windowGeometryChanged
void windowGeometryChanged(const QByteArray &rect)
profilelocker.h
Settings::spellCheckingEnabled
bool spellCheckingEnabled
Definition: settings.h:105
Settings::setEnableLanDiscovery
void setEnableLanDiscovery(bool enabled) override
Definition: settings.cpp:1138
Settings::circleProp
Definition: settings.h:703
Settings::getCircleExpanded
bool getCircleExpanded(int id) const
Definition: settings.cpp:2054
Settings::windowGeometry
QByteArray windowGeometry
Definition: settings.h:76
Settings::dontGroupWindowsChanged
void dontGroupWindowsChanged(bool enabled)
Settings::minimizeToTrayChanged
void minimizeToTrayChanged(bool enabled)
Settings::getCamVideoRes
QRect getCamVideoRes() const override
Definition: settings.cpp:1832
Settings::getPaths
Paths & getPaths()
Definition: settings.cpp:834
Settings::videoDev
QString videoDev
Definition: settings.h:127
Style::Big
@ Big
Definition: style.h:57
ToxEncrypt
Encapsulates the toxencrypsave API. Since key derivation is work intensive and to avoid storing plain...
Definition: toxencrypt.h:29
Settings::setEmojiFontPointSize
void setEmojiFontPointSize(int value)
Definition: settings.cpp:1474
Settings::Request
Definition: settings.h:162
Settings::notifySound
bool notifySound
Definition: settings.h:612
Settings::getMakeToxPortable
bool getMakeToxPortable() const
Definition: settings.cpp:865
Settings::setLightTrayIcon
void setLightTrayIcon(bool newValue)
Definition: settings.cpp:1008
Settings::minimizeOnClose
bool minimizeOnClose
Definition: settings.h:74
Settings::friendRequests
QList< Request > friendRequests
Definition: settings.h:638
Settings::setAudioOutDevEnabled
void setAudioOutDevEnabled(bool enabled) override
Definition: settings.cpp:1773
Settings::settingsThread
static QThread * settingsThread
Definition: settings.h:718
Settings::readFriendRequest
void readFriendRequest(int index)
Definition: settings.cpp:2124
Settings::getFriendActivity
QDateTime getFriendActivity(const ToxPk &id) const override
Definition: settings.cpp:1911
Settings::notify
bool notify
Definition: settings.h:609
Settings::setScreenGrabbed
void setScreenGrabbed(bool value) override
Definition: settings.cpp:1825
Settings::setAutoSaveEnabled
void setAutoSaveEnabled(bool newValue)
Definition: settings.cpp:956
Settings::setFriendActivity
void setFriendActivity(const ToxPk &id, const QDateTime &date) override
Definition: settings.cpp:1921
Settings::audioThreshold
qreal audioThreshold
Definition: settings.h:119
Settings::getAutoGroupInvite
bool getAutoGroupInvite(const ToxPk &id) const override
Definition: settings.cpp:1334
Settings::fixInvalidProxyType
ICoreSettings::ProxyType fixInvalidProxyType(ICoreSettings::ProxyType proxyType)
Definition: settings.cpp:2241
Settings::dateFormat
QString dateFormat
Definition: settings.h:101
Settings::saveGlobal
void saveGlobal()
Asynchronous, saves the global settings.
Definition: settings.cpp:582
Settings::checkUpdatesChanged
void checkUpdatesChanged(bool enabled)
ICoreSettings::ProxyType::ptHTTP
@ ptHTTP
ipc.h
Settings::getWindowState
QByteArray getWindowState() const
Definition: settings.cpp:1533
ICoreSettings::ProxyType::ptNone
@ ptNone
Settings::notifySoundChanged
void notifySoundChanged(bool enabled)
Settings::spellCheckingEnabledChanged
void spellCheckingEnabledChanged(bool enabled)
Settings::setCompactLayout
void setCompactLayout(bool compact)
Definition: settings.cpp:1946
Settings::setCheckUpdates
void setCheckUpdates(bool newValue)
Definition: settings.cpp:1552
Settings::getInstance
static Settings & getInstance()
Returns the singleton instance.
Definition: settings.cpp:88
Settings::friendLst
QHash< QByteArray, friendProp > friendLst
Definition: settings.h:709
Settings::themeColorChanged
void themeColorChanged(int color)
Settings::notifyHide
bool notifyHide
Definition: settings.h:613
Settings::sync
void sync()
Waits for all asynchronous operations to complete.
Definition: settings.cpp:2218
Paths::isPortable
bool isPortable() const
Check if qTox is running in portable mode.
Definition: paths.cpp:149
Settings::setInDev
void setInDev(const QString &deviceSpecifier) override
Definition: settings.cpp:1695
Settings::setThemeColor
void setThemeColor(int value)
Definition: settings.cpp:2146
autorun.h
ICoreSettings::ProxyType::ptSOCKS5
@ ptSOCKS5
Settings::getProxyAddr
QString getProxyAddr() const override
Definition: settings.cpp:1184
Settings::currentProfile
QString currentProfile
Definition: settings.h:625
Settings::setStyle
void setStyle(const QString &newValue)
Definition: settings.cpp:923
Settings::outDev
QString outDev
Definition: settings.h:120
Settings::getNotifySound
bool getNotifySound() const override
Definition: settings.cpp:1054
Settings::updateProfileData
void updateProfileData(Profile *profile, const QCommandLineParser *parser)
Definition: settings.cpp:262
corefile.h
Settings::proxyPort
quint16 proxyPort
Definition: settings.h:623
Settings::stylePreferenceChanged
void stylePreferenceChanged(StyleType type)
Settings::setWidgetData
void setWidgetData(const QString &uniqueName, const QByteArray &data)
Definition: settings.cpp:1433
Settings::setCamVideoRes
void setCamVideoRes(QRect newValue) override
Definition: settings.cpp:1838
Settings::groupchatPositionChanged
void groupchatPositionChanged(bool enabled)
Settings::getScreenGrabbed
bool getScreenGrabbed() const override
Definition: settings.cpp:1819
Settings::getNotifyHide
bool getNotifyHide() const override
Definition: settings.cpp:1067
Settings::getTimestampFormat
const QString & getTimestampFormat() const
Definition: settings.cpp:1481
Settings::getThemeColor
int getThemeColor() const
Definition: settings.cpp:2140
Settings::showSystemTrayChanged
void showSystemTrayChanged(bool enabled)
Settings::getCloseToTray
bool getCloseToTray() const
Definition: settings.cpp:976
Settings::dialogSplitterState
QByteArray dialogSplitterState
Definition: settings.h:83
Settings::widgetDataChanged
void widgetDataChanged(const QString &key)
Settings::setVal
bool setVal(T &savedVal, T newVal)
Definition: settings.cpp:2256
Settings::getGroupAlwaysNotify
bool getGroupAlwaysNotify() const override
Definition: settings.cpp:1093
Settings::getEnableLogging
bool getEnableLogging() const
Definition: settings.cpp:1241
Settings::themeColor
int themeColor
Definition: settings.h:713
Settings::clearUnreadFriendRequests
void clearUnreadFriendRequests()
Definition: settings.cpp:2110
Settings::enableLanDiscovery
bool enableLanDiscovery
Definition: settings.h:619
Settings::getFriendRequestSize
int getFriendRequestSize() const
Definition: settings.cpp:2104
Settings::getCircleName
QString getCircleName(int id) const
Definition: settings.cpp:2024
Settings::getOutVolume
int getOutVolume() const override
Definition: settings.cpp:1780
Settings::typingNotificationChanged
void typingNotificationChanged(bool enabled)
SettingsSerializer
Serializes a QSettings's data in an (optionally) encrypted binary format. SettingsSerializer can dete...
Definition: settingsserializer.h:29
Settings::getEnableIPv6
bool getEnableIPv6() const override
Definition: settings.cpp:852
SettingsSerializer::save
void save()
Saves the current settings back to file.
Definition: settingsserializer.cpp:253
Settings::dontGroupWindows
bool dontGroupWindows
Definition: settings.h:599
Settings::setCloseToTray
void setCloseToTray(bool newValue)
Definition: settings.cpp:982
Settings::getDesktopNotify
bool getDesktopNotify() const override
Definition: settings.cpp:1585
Settings::sortingMode
FriendListSortingMode sortingMode
Definition: settings.h:596
SettingsSerializer::value
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
Definition: settingsserializer.cpp:188
Settings::dialogGeometryChanged
void dialogGeometryChanged(const QByteArray &rect)
Settings::setCircleName
void setCircleName(int id, const QString &name)
Definition: settings.cpp:2030
Settings::autostartInTrayChanged
void autostartInTrayChanged(bool enabled)
Settings::getCurrentProfile
QString getCurrentProfile() const
Definition: settings.cpp:1210
Settings::setVideoDev
void setVideoDev(const QString &deviceSpecifier) override
Definition: settings.cpp:1747
Settings::screenRegion
QRect screenRegion
Definition: settings.h:129
Settings::getTypingNotification
bool getTypingNotification() const
Definition: settings.cpp:1663
core.h
Settings::savePersonal
void savePersonal()
Asynchronous, saves the current profile.
Definition: settings.cpp:717
Settings::getTranslation
QString getTranslation() const
Definition: settings.cpp:1106
Settings::setDateFormat
void setDateFormat(const QString &format)
Definition: settings.cpp:1500
Settings::setDesktopNotify
void setDesktopNotify(bool enabled) override
Definition: settings.cpp:1591
Settings::setNotifySound
void setNotifySound(bool newValue) override
Definition: settings.cpp:1060
Settings::getAudioInGainDecibel
qreal getAudioInGainDecibel() const override
Definition: settings.cpp:1715
Settings::currentProfileId
uint32_t currentProfileId
Definition: settings.h:626
SettingsSerializer::beginReadArray
int beginReadArray(const QString &prefix)
Definition: settingsserializer.cpp:129
Settings::getBlackList
QStringList getBlackList() const override
Definition: settings.cpp:1676
Settings::getFriendSortingMode
FriendListSortingMode getFriendSortingMode() const
Definition: settings.cpp:1953
Settings::getShowIdenticons
bool getShowIdenticons() const
Definition: settings.cpp:2005
Settings::FriendListSortingMode::Name
@ Name
Settings::bigLock
static CompatibleRecursiveMutex bigLock
Definition: settings.h:715
Settings::setShowWindow
void setShowWindow(bool newValue) override
Definition: settings.cpp:1578
Settings::setOutDev
void setOutDev(const QString &deviceSpecifier) override
Definition: settings.cpp:1760
Settings::setUseEmoticons
void setUseEmoticons(bool newValue)
Definition: settings.cpp:943
Settings::groupAlwaysNotifyChanged
void groupAlwaysNotifyChanged(bool enabled)
Settings::dialogSplitterStateChanged
void dialogSplitterStateChanged(const QByteArray &state)
gui.h
Settings::compactLayoutChanged
void compactLayoutChanged(bool enabled)
Settings::chatMessageFont
QFont chatMessageFont
Definition: settings.h:96
Settings::setAudioInDevEnabled
void setAudioInDevEnabled(bool enabled) override
Definition: settings.cpp:1708
Settings::setStatusChangeNotificationEnabled
void setStatusChangeNotificationEnabled(bool newValue)
Definition: settings.cpp:1021
Settings::getWidgetData
QByteArray getWidgetData(const QString &uniqueName) const
Definition: settings.cpp:1449
Settings::setSmileyPack
void setSmileyPack(const QString &value)
Definition: settings.cpp:1461
Settings::camVideoFPS
float camVideoFPS
Definition: settings.h:131
Settings::applyCommandLineOptions
bool applyCommandLineOptions(const QCommandLineParser &parser)
Definition: settings.cpp:373
Settings::dbSyncType
Db::syncType dbSyncType
Definition: settings.h:666
Settings::autoAcceptMaxSize
size_t autoAcceptMaxSize
Definition: settings.h:636
Settings::loaded
bool loaded
Definition: settings.h:588
Settings::setAutoAcceptCall
void setAutoAcceptCall(const ToxPk &id, AutoAcceptCallFlags accept) override
Definition: settings.cpp:1316
Settings::setWindowState
void setWindowState(const QByteArray &value)
Definition: settings.cpp:1539
Settings::autoAcceptMaxSizeChanged
void autoAcceptMaxSizeChanged(size_t size)
Settings::getMinimizeOnClose
bool getMinimizeOnClose() const
Definition: settings.cpp:1650
Settings::setDialogSplitterState
void setDialogSplitterState(const QByteArray &value)
Definition: settings.cpp:1630
Settings::destroyInstance
static void destroyInstance()
Definition: settings.cpp:96
Settings::Request::address
QString address
Definition: settings.h:164
Settings::setMinimizeOnClose
void setMinimizeOnClose(bool newValue)
Definition: settings.cpp:1656
Settings::outVolume
int outVolume
Definition: settings.h:123
Settings::settings
static Settings * settings
Definition: settings.h:716
Settings::setCamVideoFPS
void setCamVideoFPS(float newValue) override
Definition: settings.cpp:1851
Settings::getFriendRequest
Request getFriendRequest(int index) const
Definition: settings.cpp:2098
Settings::setNotify
void setNotify(bool newValue) override
Definition: settings.cpp:1565
Settings::emojiFontPointSize
int emojiFontPointSize
Definition: settings.h:72
Settings::getAutoSaveEnabled
bool getAutoSaveEnabled() const
Definition: settings.cpp:963
Settings::busySound
bool busySound
Definition: settings.h:614
Settings::getProxyType
ICoreSettings::ProxyType getProxyType() const override
Definition: settings.cpp:1171
Settings::getVideoDev
QString getVideoDev() const override
Definition: settings.cpp:1741
Settings::addFriendRequest
bool addFriendRequest(const QString &friendAddress, const QString &message)
Definition: settings.cpp:2066
Settings::setOutVolume
void setOutVolume(int volume) override
Definition: settings.cpp:1786
Settings::statusChangeNotificationEnabledChanged
void statusChangeNotificationEnabledChanged(bool enabled)
Settings::setMakeToxPortable
void setMakeToxPortable(bool newValue)
Definition: settings.cpp:871
Settings::setTranslation
void setTranslation(const QString &newValue)
Definition: settings.cpp:1112
nexus.h
Settings::style
QString style
Definition: settings.h:86
Settings::minimizeToTray
bool minimizeToTray
Definition: settings.h:605
Settings::getMaxAutoAcceptSize
size_t getMaxAutoAcceptSize() const
Definition: settings.cpp:1407
Settings::getAudioThreshold
qreal getAudioThreshold() const override
Definition: settings.cpp:1728
Settings::setSpellCheckingEnabled
void setSpellCheckingEnabled(bool newValue)
Definition: settings.cpp:1047
Settings::splitterState
QByteArray splitterState
Definition: settings.h:79
Settings::showIdenticonsChanged
void showIdenticonsChanged(bool enabled)
Settings::setAutoAwayTime
void setAutoAwayTime(int newValue)
Sets how long the user may stay idle, before online status is set to "away".
Definition: settings.cpp:1265
Settings::getAudioOutDevEnabled
bool getAudioOutDevEnabled() const override
Definition: settings.cpp:1767
Settings::getAudioBitrate
int getAudioBitrate() const override
Definition: settings.cpp:1793
Settings::blackList
QStringList blackList
Definition: settings.h:110
Settings::timestampFormatChanged
void timestampFormatChanged(const QString &format)
Settings::showWindow
bool showWindow
Definition: settings.h:611
Settings::closeToTray
bool closeToTray
Definition: settings.h:604
Settings::updateFriendAddress
void updateFriendAddress(const QString &newAddr)
Definition: settings.cpp:1869
ContactId::getByteArray
QByteArray getByteArray() const
Get a copy of the id.
Definition: contactid.cpp:101
Settings::setGroupAlwaysNotify
void setGroupAlwaysNotify(bool newValue) override
Definition: settings.cpp:1099
Settings::inDev
QString inDev
Definition: settings.h:113
Settings::getLightTrayIcon
bool getLightTrayIcon() const
Definition: settings.cpp:1002