2014-05-30 12:53:19 +04:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2014-12-01 13:47:38 +03:00
|
|
|
the official desktop version of Telegram messaging app, see https://telegram.org
|
2014-05-30 12:53:19 +04:00
|
|
|
|
|
|
|
Telegram Desktop is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
It is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
2015-10-03 16:16:42 +03:00
|
|
|
In addition, as a special exception, the copyright holders give permission
|
|
|
|
to link the code of portions of this program with the OpenSSL library.
|
|
|
|
|
2014-05-30 12:53:19 +04:00
|
|
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
2017-01-11 22:31:31 +04:00
|
|
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
2014-05-30 12:53:19 +04:00
|
|
|
*/
|
|
|
|
#include "settings.h"
|
2016-04-27 15:02:17 +03:00
|
|
|
|
2015-12-13 01:29:33 +03:00
|
|
|
bool gRtl = false;
|
2015-10-06 22:49:23 +03:00
|
|
|
Qt::LayoutDirection gLangDir = gRtl ? Qt::RightToLeft : Qt::LeftToRight;
|
2015-04-19 13:29:19 +03:00
|
|
|
|
2016-04-27 15:02:17 +03:00
|
|
|
bool gAlphaVersion = AppAlphaVersion;
|
|
|
|
uint64 gBetaVersion = AppBetaVersion;
|
|
|
|
uint64 gRealBetaVersion = AppBetaVersion;
|
2015-12-03 21:16:34 +03:00
|
|
|
QByteArray gBetaPrivateKey;
|
|
|
|
|
2014-05-30 12:53:19 +04:00
|
|
|
bool gTestMode = false;
|
|
|
|
bool gDebug = false;
|
|
|
|
bool gManyInstance = false;
|
|
|
|
QString gKeyFile;
|
2014-11-27 21:20:48 +03:00
|
|
|
QString gWorkingDir, gExeDir, gExeName;
|
2014-05-30 12:53:19 +04:00
|
|
|
|
2014-07-18 14:37:34 +04:00
|
|
|
QStringList gSendPaths;
|
2014-12-03 16:10:32 +03:00
|
|
|
QString gStartUrl;
|
2014-07-18 14:37:34 +04:00
|
|
|
|
2014-05-30 12:53:19 +04:00
|
|
|
QString gDialogLastPath, gDialogHelperPath; // optimize QFileDialog
|
|
|
|
|
|
|
|
bool gStartMinimized = false;
|
2015-01-27 19:58:58 +03:00
|
|
|
bool gStartInTray = false;
|
2014-05-30 12:53:19 +04:00
|
|
|
bool gAutoStart = false;
|
2014-07-18 14:37:34 +04:00
|
|
|
bool gSendToMenu = false;
|
2017-02-17 23:50:27 +11:00
|
|
|
bool gUseExternalVideoPlayer = false;
|
2014-05-30 12:53:19 +04:00
|
|
|
bool gAutoUpdate = true;
|
|
|
|
TWindowPos gWindowPos;
|
2016-01-11 23:43:29 +08:00
|
|
|
LaunchMode gLaunchMode = LaunchModeNormal;
|
2015-01-15 17:22:15 +03:00
|
|
|
bool gSupportTray = true;
|
2014-05-30 12:53:19 +04:00
|
|
|
bool gSeenTrayTooltip = false;
|
2014-12-20 00:20:30 +03:00
|
|
|
bool gRestartingUpdate = false, gRestarting = false, gRestartingToSettings = false, gWriteProtected = false;
|
2014-05-30 12:53:19 +04:00
|
|
|
int32 gLastUpdateCheck = 0;
|
|
|
|
bool gNoStartUpdate = false;
|
|
|
|
bool gStartToSettings = false;
|
|
|
|
bool gReplaceEmojis = true;
|
|
|
|
|
|
|
|
bool gCtrlEnter = false;
|
2015-02-03 18:02:46 +03:00
|
|
|
|
2014-05-30 12:53:19 +04:00
|
|
|
uint32 gConnectionsInSession = 1;
|
|
|
|
QString gLoggedPhoneNumber;
|
|
|
|
|
|
|
|
QByteArray gLocalSalt;
|
2017-12-12 11:52:53 +04:00
|
|
|
DBIScale gRealScale = dbisAuto;
|
|
|
|
DBIScale gScreenScale = dbisOne;
|
|
|
|
DBIScale gConfigScale = dbisAuto;
|
2014-09-20 14:35:46 -07:00
|
|
|
bool gCompressPastedImage = true;
|
2014-05-30 12:53:19 +04:00
|
|
|
|
2015-02-10 18:55:04 +00:00
|
|
|
QString gTimeFormat = qsl("hh:mm");
|
|
|
|
|
2017-02-15 11:50:11 +03:00
|
|
|
RecentEmojiPack gRecentEmoji;
|
|
|
|
RecentEmojiPreload gRecentEmojiPreload;
|
2015-05-08 15:45:14 +03:00
|
|
|
EmojiColorVariants gEmojiVariants;
|
2014-05-30 12:53:19 +04:00
|
|
|
|
2015-05-19 18:46:45 +03:00
|
|
|
RecentStickerPreload gRecentStickersPreload;
|
2015-01-02 17:55:24 +03:00
|
|
|
RecentStickerPack gRecentStickers;
|
|
|
|
|
2015-03-24 13:00:27 +03:00
|
|
|
RecentHashtagPack gRecentWriteHashtags, gRecentSearchHashtags;
|
|
|
|
|
2016-01-01 22:48:32 +08:00
|
|
|
RecentInlineBots gRecentInlineBots;
|
|
|
|
|
2015-04-02 13:33:19 +03:00
|
|
|
bool gPasswordRecovered = false;
|
2015-04-04 23:01:34 +03:00
|
|
|
int32 gPasscodeBadTries = 0;
|
2016-12-01 22:20:33 +03:00
|
|
|
TimeMs gPasscodeLastTry = 0;
|
2015-04-02 13:33:19 +03:00
|
|
|
|
2014-06-14 23:32:11 +04:00
|
|
|
bool gRetina = false;
|
|
|
|
float64 gRetinaFactor = 1.;
|
2014-06-15 16:31:03 +04:00
|
|
|
int32 gIntRetinaFactor = 1;
|
2014-06-16 13:31:10 +04:00
|
|
|
|
2014-06-14 23:32:11 +04:00
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
DBIPlatform gPlatform = dbipWindows;
|
2017-12-12 11:52:53 +04:00
|
|
|
#elif defined OS_MAC_OLD
|
|
|
|
DBIPlatform gPlatform = dbipMacOld;
|
2014-06-14 23:32:11 +04:00
|
|
|
#elif defined Q_OS_MAC
|
|
|
|
DBIPlatform gPlatform = dbipMac;
|
2014-07-17 13:42:06 +04:00
|
|
|
#elif defined Q_OS_LINUX64
|
|
|
|
DBIPlatform gPlatform = dbipLinux64;
|
2016-02-02 14:48:46 +03:00
|
|
|
#elif defined Q_OS_LINUX32
|
|
|
|
DBIPlatform gPlatform = dbipLinux32;
|
2014-06-14 23:32:11 +04:00
|
|
|
#else
|
|
|
|
#error Unknown platform
|
|
|
|
#endif
|
2016-02-02 14:48:46 +03:00
|
|
|
QString gPlatformString;
|
|
|
|
QUrl gUpdateURL;
|
2015-12-03 21:16:34 +03:00
|
|
|
bool gIsElCapitan = false;
|
2017-12-01 20:55:16 +04:00
|
|
|
bool gIsSnowLeopard = false;
|
2014-06-14 23:32:11 +04:00
|
|
|
|
2015-01-26 16:04:41 +03:00
|
|
|
int gOtherOnline = 0;
|
|
|
|
|
2015-08-07 15:11:50 +03:00
|
|
|
SavedPeers gSavedPeers;
|
|
|
|
SavedPeersByTime gSavedPeersByTime;
|
|
|
|
|
2015-09-08 20:22:29 +03:00
|
|
|
ReportSpamStatuses gReportSpamStatuses;
|
2015-09-07 18:53:46 +03:00
|
|
|
|
2015-12-24 00:19:57 +03:00
|
|
|
int32 gAutoDownloadPhoto = 0; // all auto download
|
|
|
|
int32 gAutoDownloadAudio = 0;
|
|
|
|
int32 gAutoDownloadGif = 0;
|
2015-12-28 00:37:48 +03:00
|
|
|
bool gAutoPlayGif = true;
|