Compare commits

...

7 Commits

212 changed files with 754 additions and 629 deletions

27
MSVC.md
View File

@@ -170,7 +170,6 @@ and run
cd qtbase && git apply ../../../tdesktop/Telegram/_qtbase_5_5_1_patch.diff && cd ..
#####Install Windows SDKs
If you didn't install Windows SDKs before, you need to install them now. To install the SDKs just open Telegram solution at **D:\TBuild\tdesktop\Telegram.sln** and on startup Visual Studio 2015 will popup dialog box and ask to download and install extra components (including Windows 7 SDK).
@@ -191,6 +190,32 @@ https://visualstudiogallery.msdn.microsoft.com/c89ff880-8509-47a4-a262-e4fa07168
Download, close all VS2015 instances and install for VS2015
####Google Breakpad
* Install Python 2.7.11 from https://www.python.org/downloads/release/python-2711/ > [**Windows x86 MSI installer**](https://www.python.org/ftp/python/2.7.11/python-2.7.11.msi)
* Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **Start Menu > Programs > Visual Studio 2015** menu folder)
There go to Libraries directory
D:
cd TBuild\Libraries
and run
git clone https://chromium.googlesource.com/breakpad/breakpad
git clone https://chromium.googlesource.com/external/gyp
set PATH=C:\Python27;%PATH%
cd breakpad/src/client/windows
..\..\..\..\gyp\gyp --no-circular-check
#####Building library
* Open in VS2015 **D:\TBuild\Libraries\breakpad\src\client\windows\breakpad_client.sln**
* Change "Treat WChar_t As Built in Type" to "No" in all projects & configurations
* Change "Treat Warnings As Errors" to "No" in all projects & configurations
* Build Debug configuration
* Build Release configuration
###Building Telegram Desktop
* Launch VS2015 for configuring Qt5Package

View File

@@ -142,6 +142,17 @@ In Terminal go to **/home/user/TBuild/Libraries/QtStatic** and there run
building (**make** command) will take really long time.
####Google Breakpad
In Terminal go to **/home/user/TBuild/Libraries** and run
git clone https://chromium.googlesource.com/breakpad/breakpad
git clone https://chromium.googlesource.com/linux-syscall-support breakpad/src/third_party/lss
cd breakpad
./configure
make
sudo make install
###Building Telegram Desktop
* Launch Qt Creator, all projects will be taken from **/home/user/TBuild/tdesktop/Telegram**

View File

@@ -11,10 +11,8 @@ Replace () {
}
Replace '\-llzma' '\/usr\/lib\/i386\-linux\-gnu\/liblzma\.a'
Replace '\-lz' '\/usr\/lib\/i386\-linux\-gnu\/libz\.a'
Replace '\-lssl' '\/usr\/lib\/i386\-linux\-gnu\/libssl\.a'
Replace '\-lcrypto' '\/usr\/lib\/i386\-linux\-gnu\/libcrypto\.a'
Replace '\-lexif' '\/usr\/lib\/i386\-linux\-gnu\/libexif\.a'
Replace '\-lgobject\-2\.0' '\/usr\/lib\/i386\-linux\-gnu\/libgobject\-2\.0\.a \/usr\/lib\/i386\-linux\-gnu\/libffi\.a'
Replace '\-lXi' '\/usr\/lib\/i386\-linux\-gnu\/libXi\.a'
Replace '\-lSM' '\/usr\/lib\/i386\-linux\-gnu\/libSM\.a'

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
"lng_language_name" = "English";
"lng_switch_to_this" = "Switch to English";

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
defaultFontFamily: 'Open Sans';
semibold: 'Open Sans Semibold';
@@ -51,7 +51,10 @@ color7: #2996ad; // sea
color8: #ce671b; // orange
wndMinWidth: 380px;
wideModeWidth: 640px;
adaptiveNormalWidth: 640px;
adaptiveWideWidth: 1120px;
wndMinHeight: 480px;
wndDefWidth: 800px;
wndDefHeight: 600px;
@@ -1282,9 +1285,6 @@ msgFileBlue: sprite(60px, 425px, 20px, 20px);
msgFileOverDuration: 200;
msgFileRadialLine: 3px;
msgFileExtPadding: 8px;
msgFileExtTop: 30px;
msgVideoSize: size(320px, 240px);
sendPadding: 9px;
@@ -2197,6 +2197,9 @@ overviewFileStatusTop: 27px;
overviewFileDateTop: 49px;
overviewFileChecked: #2fa9e2;
overviewFileCheck: #00000066;
overviewFileExtPadding: 5px;
overviewFileExtTop: 24px;
overviewFileExtFont: font(18px semibold);
// Mac specific

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
textStyle {
linkFlags: font;

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "genemoji.h"
@@ -1942,7 +1942,7 @@ In addition, as a special exception, the copyright holders give permission\n\
to link the code of portions of this program with the OpenSSL library.\n\
\n\
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\
*/\n";
tcpp << "#include \"stdafx.h\"\n#include \"gui/emoji_config.h\"\n\n";

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include <QtCore/QMap>
#include <QtCore/QVector>

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "genlang.h"
@@ -412,7 +412,7 @@ In addition, as a special exception, the copyright holders give permission\n\
to link the code of portions of this program with the OpenSSL library.\n\
\n\
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\
*/\n";
th << "#pragma once\n\n";
@@ -496,7 +496,7 @@ In addition, as a special exception, the copyright holders give permission\n\
to link the code of portions of this program with the OpenSSL library.\n\
\n\
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\
*/\n";
tcpp << "#include \"stdafx.h\"\n#include \"lang.h\"\n\n";
tcpp << "namespace {\n";

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include <QtCore/QMap>
#include <QtCore/QVector>

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "genstyles.h"
@@ -381,7 +381,7 @@ In addition, as a special exception, the copyright holders give permission\n\
to link the code of portions of this program with the OpenSSL library.\n\
\n\
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\
*/\n";
tout << "#pragma once\n\n#include \"style.h\"\n\nnamespace style {\n";
for (int i = 0, l = byIndex.size(); i < l; ++i) {
@@ -1542,7 +1542,7 @@ In addition, as a special exception, the copyright holders give permission\n\
to link the code of portions of this program with the OpenSSL library.\n\
\n\
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\
*/\n";
tout << "#pragma once\n\n#include \"style.h\"\n\nnamespace st {\n";
tcpp << "\
@@ -1568,7 +1568,7 @@ In addition, as a special exception, the copyright holders give permission\n\
to link the code of portions of this program with the OpenSSL library.\n\
\n\
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\
*/\n";
tcpp << "#include \"stdafx.h\"\n#include \"style_auto.h\"\n\nnamespace {\n";
for (int i = 0, l = scalars.size(); i < l; ++i) {
@@ -1945,7 +1945,7 @@ In addition, as a special exception, the copyright holders give permission\n\
to link the code of portions of this program with the OpenSSL library.\n\
\n\
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\
*/\n";
tnum << "#include \"stdafx.h\"\n#include \"numbers.h\"\n\n";
tnum << "QVector<int> phoneNumberParse(const QString &number) {\n";

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include <QtCore/QMap>
#include <QtCore/QVector>

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "memain.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include <QtCore/QTimer>

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "mlmain.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include <QtCore/QTimer>

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "msmain.h"
#include <QtCore/QDir>

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include <QtCore/QTimer>

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "packer.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "updater.h"
@@ -328,8 +328,6 @@ void updateRegistry() {
}
}
#include <ShlObj.h>
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdParamarg, int cmdShow) {
openLog();

View File

@@ -16,13 +16,19 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <windows.h>
#include <string>
#pragma warning(push)
#pragma warning(disable:4091)
#include <DbgHelp.h>
#include <ShlObj.h>
#pragma warning(pop)
#include <Shellapi.h>
#include <Shlwapi.h>

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include <cstdio>
#include <sys/stat.h>

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#import <Cocoa/Cocoa.h>

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "style.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"
@@ -2612,10 +2612,10 @@ namespace App {
QNetworkProxy getHttpProxySettings() {
const ConnectionProxy *proxy = 0;
if (Sandbox::started()) {
if (Global::started()) {
proxy = (cConnectionType() == dbictHttpProxy) ? (&cConnectionProxy()) : 0;
} else {
proxy = Global::PreLaunchProxy().host.isEmpty() ? 0 : (&Global::PreLaunchProxy());
proxy = Sandbox::PreLaunchProxy().host.isEmpty() ? 0 : (&Sandbox::PreLaunchProxy());
}
if (proxy) {
return QNetworkProxy(QNetworkProxy::HttpProxy, proxy->host, proxy->port, proxy->user, proxy->password);

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "application.h"
@@ -75,6 +75,9 @@ namespace {
if (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray) {
App::wnd()->minimizeToTray();
return true;
} else {
App::wnd()->close();
return true;
}
}
}
@@ -178,7 +181,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
Application::~Application() {
App::setQuiting();
Global::finish();
Sandbox::finish();
delete AppObject;
@@ -277,7 +280,7 @@ void Application::singleInstanceChecked() {
Logs::multipleInstances();
}
Global::start();
Sandbox::start();
if (!Logs::started() || (!cManyInstance() && !Logs::instanceChecked())) {
new NotStartedWindow();
@@ -286,17 +289,17 @@ void Application::singleInstanceChecked() {
if (status == SignalHandlers::CantOpen) {
new NotStartedWindow();
} else if (status == SignalHandlers::LastCrashed) {
if (Global::LastCrashDump().isEmpty()) { // don't handle bad closing for now
if (Sandbox::LastCrashDump().isEmpty()) { // don't handle bad closing for now
if (SignalHandlers::restart() == SignalHandlers::CantOpen) {
new NotStartedWindow();
} else {
Sandboxer::startSandbox();
Sandbox::launch();
}
} else {
new LastCrashedWindow();
}
} else {
Sandboxer::startSandbox();
Sandbox::launch();
}
}
}
@@ -328,7 +331,7 @@ void Application::readClients() {
for (int32 to = cmds.indexOf(QChar(';'), from); to >= from; to = (from < l) ? cmds.indexOf(QChar(';'), from) : -1) {
QStringRef cmd(&cmds, from, to - from);
if (cmd.startsWith(qsl("CMD:"))) {
Sandboxer::execExternal(cmds.mid(from + 4, to - from - 4));
Sandbox::execExternal(cmds.mid(from + 4, to - from - 4));
QByteArray response(qsl("RES:%1;").arg(QCoreApplication::applicationPid()).toLatin1());
i->first->write(response.data(), response.size());
} else if (cmd.startsWith(qsl("SEND:"))) {
@@ -546,7 +549,7 @@ inline Application *application() {
return qobject_cast<Application*>(QApplication::instance());
}
namespace Sandboxer {
namespace Sandbox {
QRect availableGeometry() {
if (Application *a = application()) {
@@ -665,7 +668,7 @@ namespace Sandboxer {
}
}
void startSandbox() {
void launch() {
t_assert(application() != 0);
float64 dpi = Application::primaryScreen()->logicalDotsPerInch();
@@ -699,7 +702,7 @@ AppClass::AppClass() : QObject()
Fonts::start();
ThirdParty::start();
Sandbox::start();
Global::start();
Local::start();
if (Local::oldSettingsVersion() < AppVersion) {
psNewVersion();
@@ -719,7 +722,7 @@ AppClass::AppClass() : QObject()
}
if (cLang() < languageTest) {
cSetLang(Global::LangSystem());
cSetLang(Sandbox::LangSystem());
}
if (cLang() == languageTest) {
if (QFileInfo(cLangFile()).exists()) {
@@ -752,7 +755,7 @@ AppClass::AppClass() : QObject()
application()->installNativeEventFilter(psNativeEventFilter());
Sandboxer::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState)));
Sandbox::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState)));
connect(&_mtpUnpauseTimer, SIGNAL(timeout()), this, SLOT(doMtpUnpause()));
@@ -1048,8 +1051,12 @@ void AppClass::checkMapVersion() {
if (Local::oldMapVersion() < AppVersion) {
if (Local::oldMapVersion()) {
QString versionFeatures;
if (cDevVersion() && Local::oldMapVersion() < 9019) {
versionFeatures = QString::fromUtf8("\xe2\x80\x94 Choose an emoticon and see the suggested stickers\n\xe2\x80\x94 Bug fixes in minor improvements");// .replace('@', qsl("@") + QChar(0x200D));
if (cDevVersion() && Local::oldMapVersion() < 9020) {
if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) {
versionFeatures = QString::fromUtf8("\xe2\x80\x94 Testing new crash reporting system\n\xe2\x80\x94 Conversation history is centered in wide windows\n\xe2\x80\x94 New cute link and timestamp tooltips design\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D));
} else {
versionFeatures = QString::fromUtf8("\xe2\x80\x94 Testing new crash reporting system\n\xe2\x80\x94 Conversation history is centered in wide windows\n\xe2\x80\x94 New cute link and timestamp tooltips design\n\xe2\x80\x94 Ctrl+W or Ctrl+F4 closes Telegram window\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D));
}
} else if (Local::oldMapVersion() < 9016) {
versionFeatures = lng_new_version_text(lt_gifs_link, qsl("https://telegram.org/blog/gif-revolution"), lt_bots_link, qsl("https://telegram.org/blog/inline-bots")).trimmed();
} else {
@@ -1087,7 +1094,7 @@ AppClass::~AppClass() {
style::stopManager();
Local::finish();
Sandbox::finish();
Global::finish();
ThirdParty::finish();
}

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
@@ -105,7 +105,7 @@ private:
#endif
};
namespace Sandboxer {
namespace Sandbox {
QRect availableGeometry();
QRect screenGeometry(const QPoint &p);
@@ -135,7 +135,7 @@ namespace Sandboxer {
void connect(const char *signal, QObject *object, const char *method);
void startSandbox();
void launch();
}

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "audio.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
@@ -127,7 +127,7 @@ void UpdateChecker::partMetaGot() {
full = m.captured(1).toInt();
}
Sandboxer::updateProgress(already, full);
Sandbox::updateProgress(already, full);
}
}
}
@@ -180,7 +180,7 @@ void UpdateChecker::partFinished(qint64 got, qint64 total) {
outputFile.close();
unpackUpdate();
} else {
Sandboxer::updateProgress(already, full);
Sandbox::updateProgress(already, full);
}
}
@@ -199,12 +199,12 @@ void UpdateChecker::partFailed(QNetworkReply::NetworkError e) {
}
}
LOG(("Update Error: failed to download part starting from %1, error %2").arg(already).arg(e));
Sandboxer::updateFailed();
Sandbox::updateFailed();
}
void UpdateChecker::fatalFail() {
clearAll();
Sandboxer::updateFailed();
Sandbox::updateFailed();
}
void UpdateChecker::clearAll() {
@@ -466,7 +466,7 @@ void UpdateChecker::unpackUpdate() {
}
outputFile.remove();
Sandboxer::updateReady();
Sandbox::updateReady();
}
UpdateChecker::~UpdateChecker() {

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "style.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "style.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,14 +16,14 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
static const int32 AppVersion = 9019;
static const wchar_t *AppVersionStr = L"0.9.19";
static const int32 AppVersion = 9020;
static const wchar_t *AppVersionStr = L"0.9.20";
static const bool DevVersion = true;
#define BETA_VERSION (9019002ULL) // just comment this line to build public version
//#define BETA_VERSION (9019002ULL) // just comment this line to build public version
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
static const wchar_t *AppName = L"Telegram Desktop";

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "style.h"
@@ -2268,7 +2268,7 @@ void DialogsWidget::dragEnterEvent(QDragEnterEvent *e) {
_dragForward = e->mimeData()->hasFormat(qsl("application/x-td-forward-selected"));
if (!_dragForward) _dragForward = e->mimeData()->hasFormat(qsl("application/x-td-forward-pressed-link"));
if (!_dragForward) _dragForward = e->mimeData()->hasFormat(qsl("application/x-td-forward-pressed"));
if (_dragForward && !cWideMode()) _dragForward = false;
if (_dragForward && Adaptive::OneColumn()) _dragForward = false;
if (_dragForward) {
e->setDropAction(Qt::CopyAction);
e->accept();
@@ -2540,7 +2540,7 @@ bool DialogsWidget::onCancelSearch() {
_searchRequest = 0;
}
if (_searchInPeer && !clearing) {
if (!cWideMode()) {
if (Adaptive::OneColumn()) {
Ui::showPeerHistory(_searchInPeer, ShowAtUnreadMsgId);
}
_searchInPeer = _searchInMigrated = 0;
@@ -2560,7 +2560,7 @@ void DialogsWidget::onCancelSearchInPeer() {
_searchRequest = 0;
}
if (_searchInPeer) {
if (!cWideMode() && !App::main()->selectingPeer()) {
if (Adaptive::OneColumn() && !App::main()->selectingPeer()) {
Ui::showPeerHistory(_searchInPeer, ShowAtUnreadMsgId);
}
_searchInPeer = _searchInMigrated = 0;
@@ -2570,7 +2570,7 @@ void DialogsWidget::onCancelSearchInPeer() {
_filter.clear();
_filter.updatePlaceholder();
onFilterUpdate();
if (cWideMode() && !App::main()->selectingPeer()) {
if (!Adaptive::OneColumn() && !App::main()->selectingPeer()) {
emit cancelled();
}
}

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
@@ -4013,9 +4013,9 @@ void MentionsInner::paintEvent(QPaintEvent *e) {
}
}
}
p.fillRect(cWideMode() ? st::lineWidth : 0, _parent->innerBottom() - st::lineWidth, width() - (cWideMode() ? st::lineWidth : 0), st::lineWidth, st::shadowColor->b);
p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, _parent->innerBottom() - st::lineWidth, width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowColor->b);
}
p.fillRect(cWideMode() ? st::lineWidth : 0, _parent->innerTop(), width() - (cWideMode() ? st::lineWidth : 0), st::lineWidth, st::shadowColor->b);
p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, _parent->innerTop(), width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowColor->b);
}
void MentionsInner::resizeEvent(QResizeEvent *e) {

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
@@ -176,16 +176,31 @@ namespace Notify {
}
struct GlobalDataStruct {
#define DefineReadOnlyVar(Namespace, Type, Name) const Type &Name() { \
t_assert_full(Namespace##Data != 0, #Namespace "Data is null in " #Namespace "::" #Name, __FILE__, __LINE__); \
return Namespace##Data->Name; \
}
#define DefineRefVar(Namespace, Type, Name) DefineReadOnlyVar(Namespace, Type, Name) \
Type &Ref##Name() { \
t_assert_full(Namespace##Data != 0, #Namespace "Data is null in Global::Ref" #Name, __FILE__, __LINE__); \
return Namespace##Data->Name; \
}
#define DefineVar(Namespace, Type, Name) DefineRefVar(Namespace, Type, Name) \
void Set##Name(const Type &Name) { \
t_assert_full(Namespace##Data != 0, #Namespace "Data is null in Global::Set" #Name, __FILE__, __LINE__); \
Namespace##Data->Name = Name; \
}
struct SandboxDataStruct {
QString LangSystemISO;
int32 LangSystem = languageDefault;
QByteArray LastCrashDump;
ConnectionProxy PreLaunchProxy;
};
GlobalDataStruct *GlobalData = 0;
SandboxDataStruct *SandboxData = 0;
namespace Global {
namespace Sandbox {
bool CheckBetaVersionDir() {
QFile beta(cExeDir() + qsl("TelegramBeta_data/tdata/beta"));
@@ -248,14 +263,14 @@ namespace Global {
}
void start() {
GlobalData = new GlobalDataStruct();
SandboxData = new SandboxDataStruct();
GlobalData->LangSystemISO = psCurrentLanguage();
if (GlobalData->LangSystemISO.isEmpty()) GlobalData->LangSystemISO = qstr("en");
SandboxData->LangSystemISO = psCurrentLanguage();
if (SandboxData->LangSystemISO.isEmpty()) SandboxData->LangSystemISO = qstr("en");
QByteArray l = LangSystemISO().toLatin1();
for (int32 i = 0; i < languageCount; ++i) {
if (l.at(0) == LanguageCodes[i][0] && l.at(1) == LanguageCodes[i][1]) {
GlobalData->LangSystem = i;
SandboxData->LangSystem = i;
break;
}
}
@@ -263,69 +278,42 @@ namespace Global {
srand((int32)time(NULL));
}
void finish() {
delete GlobalData;
GlobalData = 0;
}
#define DefineGlobalReadOnly(Type, Name) const Type &Name() { \
t_assert_full(GlobalData != 0, "_data is null in Global::" #Name, __FILE__, __LINE__); \
return GlobalData->Name; \
}
#define DefineGlobal(Type, Name) DefineGlobalReadOnly(Type, Name) \
void Set##Name(const Type &Name) { \
t_assert_full(GlobalData != 0, "_data is null in Global::Set" #Name, __FILE__, __LINE__); \
GlobalData->Name = Name; \
} \
Type &Ref##Name() { \
t_assert_full(GlobalData != 0, "_data is null in Global::Ref" #Name, __FILE__, __LINE__); \
return GlobalData->Name; \
}
DefineGlobalReadOnly(QString, LangSystemISO);
DefineGlobalReadOnly(int32, LangSystem);
DefineGlobal(QByteArray, LastCrashDump);
DefineGlobal(ConnectionProxy, PreLaunchProxy);
}
struct SandboxDataStruct {
uint64 LaunchId = 0;
};
SandboxDataStruct *SandboxData = 0;
namespace Sandbox {
bool started() {
return SandboxData != 0;
}
void start() {
SandboxData = new SandboxDataStruct();
memset_rand(&SandboxData->LaunchId, sizeof(SandboxData->LaunchId));
}
void finish() {
delete SandboxData;
SandboxData = 0;
}
#define DefineSandboxReadOnly(Type, Name) const Type &Name() { \
t_assert_full(SandboxData != 0, "_data is null in Global::" #Name, __FILE__, __LINE__); \
return SandboxData->Name; \
}
#define DefineSandboxRef(Type, Name) DefineSandboxReadOnly(Type, Name) \
Type &Ref##Name() { \
t_assert_full(SandboxData != 0, "_data is null in Global::Ref" #Name, __FILE__, __LINE__); \
return SandboxData->Name; \
}
#define DefineSandbox(Type, Name) DefineSandboxRef(Type, Name) \
void Set##Name(const Type &Name) { \
t_assert_full(SandboxData != 0, "_data is null in Global::Set" #Name, __FILE__, __LINE__); \
SandboxData->Name = Name; \
DefineReadOnlyVar(Sandbox, QString, LangSystemISO);
DefineReadOnlyVar(Sandbox, int32, LangSystem);
DefineVar(Sandbox, QByteArray, LastCrashDump);
DefineVar(Sandbox, ConnectionProxy, PreLaunchProxy);
}
DefineSandboxReadOnly(uint64, LaunchId);
struct GlobalDataStruct {
uint64 LaunchId = 0;
Adaptive::Layout AdaptiveLayout = Adaptive::NormalLayout;
};
GlobalDataStruct *GlobalData = 0;
namespace Global {
bool started() {
return GlobalData != 0;
}
void start() {
GlobalData = new GlobalDataStruct();
memset_rand(&GlobalData->LaunchId, sizeof(GlobalData->LaunchId));
}
void finish() {
delete GlobalData;
GlobalData = 0;
}
DefineReadOnlyVar(Global, uint64, LaunchId);
DefineVar(Global, Adaptive::Layout, AdaptiveLayout);
};

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
@@ -96,7 +96,13 @@ namespace Notify {
};
namespace Global {
#define DeclareReadOnlyVar(Type, Name) const Type &Name();
#define DeclareRefVar(Type, Name) DeclareReadOnlyVar(Type, Name) \
Type &Ref##Name();
#define DeclareVar(Type, Name) DeclareRefVar(Type, Name) \
void Set##Name(const Type &Name);
namespace Sandbox {
bool CheckBetaVersionDir();
void WorkingDirReady();
@@ -104,30 +110,40 @@ namespace Global {
void start();
void finish();
#define DeclareGlobalReadOnly(Type, Name) const Type &Name();
#define DeclareGlobal(Type, Name) DeclareGlobalReadOnly(Type, Name) \
void Set##Name(const Type &Name); \
Type &Ref##Name();
DeclareGlobalReadOnly(QString, LangSystemISO);
DeclareGlobalReadOnly(int32, LangSystem);
DeclareGlobal(QByteArray, LastCrashDump);
DeclareGlobal(ConnectionProxy, PreLaunchProxy);
DeclareReadOnlyVar(QString, LangSystemISO);
DeclareReadOnlyVar(int32, LangSystem);
DeclareVar(QByteArray, LastCrashDump);
DeclareVar(ConnectionProxy, PreLaunchProxy);
}
namespace Sandbox {
namespace Adaptive {
enum Layout {
OneColumnLayout,
NormalLayout,
WideLayout,
};
};
namespace Global {
bool started();
void start();
void finish();
#define DeclareSandboxReadOnly(Type, Name) const Type &Name();
#define DeclareSandboxRef(Type, Name) DeclareSandboxReadOnly(Type, Name) \
Type &Ref##Name();
#define DeclareSandbox(Type, Name) DeclareSandboxRef(Type, Name) \
void Set##Name(const Type &Name);
DeclareSandboxReadOnly(uint64, LaunchId);
DeclareReadOnlyVar(uint64, LaunchId);
DeclareVar(Adaptive::Layout, AdaptiveLayout);
};
namespace Adaptive {
inline bool OneColumn() {
return Global::AdaptiveLayout() == OneColumnLayout;
}
inline bool Normal() {
return Global::AdaptiveLayout() == NormalLayout;
}
inline bool Wide() {
return Global::AdaptiveLayout() == WideLayout;
}
}

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "fileuploader.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "button.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "style.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -20,7 +20,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "gui/emoji_config.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "gui/filedialog.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "gui/flatbutton.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "style.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "style.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "style.h"

View File

@@ -16,7 +16,7 @@ In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once

Some files were not shown because too many files have changed in this diff Show More