Compare commits
123 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dec5db074c | ||
|
|
d10715a96c | ||
|
|
d7d7e602bc | ||
|
|
96e72af509 | ||
|
|
929d1e2ad9 | ||
|
|
677d94490f | ||
|
|
51edfdd41d | ||
|
|
02657f4c6a | ||
|
|
4ffefe76fc | ||
|
|
1fc405ea52 | ||
|
|
37917db64c | ||
|
|
2a50004add | ||
|
|
20e04d4535 | ||
|
|
fc73ff2ea0 | ||
|
|
3a73ece59d | ||
|
|
21460d59fb | ||
|
|
c964742227 | ||
|
|
efd45bd919 | ||
|
|
8d3aa5c31e | ||
|
|
2364dec9dd | ||
|
|
87fdb5d0f9 | ||
|
|
a96e90003b | ||
|
|
77b35891d4 | ||
|
|
917b1b86ea | ||
|
|
f143cec54e | ||
|
|
9048dd7fc4 | ||
|
|
7170a0e5c0 | ||
|
|
99d0d6defa | ||
|
|
a7a43e4031 | ||
|
|
e91f93bfed | ||
|
|
7b693013aa | ||
|
|
0f414c1d5a | ||
|
|
27de201bda | ||
|
|
03c8de6195 | ||
|
|
7a600e03d0 | ||
|
|
4a60a6e248 | ||
|
|
39d0b7c5cf | ||
|
|
1979f9ea2c | ||
|
|
14e2229503 | ||
|
|
9d0f1c4e43 | ||
|
|
5aecf2d3a3 | ||
|
|
d62d5908d1 | ||
|
|
074b825414 | ||
|
|
ecc6899b42 | ||
|
|
d01ef02c14 | ||
|
|
14d0b36f1b | ||
|
|
fc04717d96 | ||
|
|
7efb5df35c | ||
|
|
47a91e5d5f | ||
|
|
33aa925aa0 | ||
|
|
e145a0ccd0 | ||
|
|
6ab586c33e | ||
|
|
f9a9063e54 | ||
|
|
8b743ae751 | ||
|
|
9e1d5da5a1 | ||
|
|
e97cc9f172 | ||
|
|
3ce8d9f0b7 | ||
|
|
b23ffe6c94 | ||
|
|
276ef42c8f | ||
|
|
79a41d541d | ||
|
|
61e3f9000b | ||
|
|
a4c13e0720 | ||
|
|
a09460dc84 | ||
|
|
4bcfee22ef | ||
|
|
880c2697d1 | ||
|
|
188e1b61c5 | ||
|
|
696c5df092 | ||
|
|
408b38b41f | ||
|
|
4a6b6fad77 | ||
|
|
f7fa13899f | ||
|
|
f370e2b85d | ||
|
|
5d649f750b | ||
|
|
cfcf4d2336 | ||
|
|
922ab40c75 | ||
|
|
2532245413 | ||
|
|
85ca7e0f05 | ||
|
|
28c8d125cf | ||
|
|
799a81966a | ||
|
|
6333bc59b1 | ||
|
|
d953f894a1 | ||
|
|
868b9843b0 | ||
|
|
c89f13bb53 | ||
|
|
722c801f8a | ||
|
|
269e588ad0 | ||
|
|
4ee33d3bd9 | ||
|
|
85285d9862 | ||
|
|
84226635b2 | ||
|
|
8ed0cb7bf1 | ||
|
|
55649ad6c4 | ||
|
|
379c5f75e7 | ||
|
|
a75f57beb8 | ||
|
|
e0ef1d434d | ||
|
|
cdff62547b | ||
|
|
5dc9cdbd3c | ||
|
|
a8fd1c54c0 | ||
|
|
cc45e06ea9 | ||
|
|
898f8e66c1 | ||
|
|
a9a01cf396 | ||
|
|
0685cf34d3 | ||
|
|
4991b6743f | ||
|
|
12ff311114 | ||
|
|
38f606b612 | ||
|
|
b4427a0073 | ||
|
|
f0900bc02e | ||
|
|
5dfd499e07 | ||
|
|
30ae073080 | ||
|
|
3daa74ff27 | ||
|
|
ccba1c8c6f | ||
|
|
8f8a1e0d1f | ||
|
|
ac81f16107 | ||
|
|
ebe9b4f80f | ||
|
|
b35b3bcb87 | ||
|
|
21a7e0243c | ||
|
|
8c668cfa24 | ||
|
|
87d795807d | ||
|
|
6377f59e23 | ||
|
|
c81beeb023 | ||
|
|
f07606a0ce | ||
|
|
e1adf54b36 | ||
|
|
09e2fbaa6b | ||
|
|
3009200b76 | ||
|
|
e0910bfb3e | ||
|
|
d874609816 |
2
MSVC.md
@@ -137,7 +137,7 @@ There go to Qt directory
|
||||
|
||||
and after that run configure
|
||||
|
||||
configure -debug-and-release -opensource -confirm-license -static -opengl desktop -mp -nomake examples -platform win32-msvc2013
|
||||
configure -debug-and-release -opensource -confirm-license -static -I "D:\TBuild\Libraries\OpenSSL-Win32\include" -L "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib" -l Gdi32 -opengl desktop -openssl-linked OPENSSL_LIBS_DEBUG="D:\TBuild\Libraries\OpenSSL-Win32\lib\VC\static\ssleay32MTd.lib D:\TBuild\Libraries\OpenSSL-Win32\lib\VC\static\libeay32MTd.lib" OPENSSL_LIBS_RELEASE="D:\TBuild\Libraries\OpenSSL-Win32\lib\VC\static\ssleay32MT.lib D:\TBuild\Libraries\OpenSSL-Win32\lib\VC\static\libeay32MT.lib" -mp -nomake examples -platform win32-msvc2013
|
||||
|
||||
to configure Qt build. After configuration is complete run
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## [Telegram D](https://tdesktop.com) – Unofficial Telegram Desktop App
|
||||
## [Telegram Desktop](https://tdesktop.com) – Official Telegram Messenger app
|
||||
|
||||
This is complete source code and build instructions for alpha version of unofficial desktop client for [Telegram](https://telegram.org) messenger, based on [Telegram API](https://core.telegram.org/) and [MTProto](https://core.telegram.org/mtproto) secure protocol.
|
||||
This is complete source code and build instructions for alpha version of official desktop client for [Telegram](https://telegram.org) messenger, based on [Telegram API](https://core.telegram.org/) and [MTProto](https://core.telegram.org/mtproto) secure protocol.
|
||||
|
||||
Source code is published under GPL v3, license is available [here](https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE).
|
||||
|
||||
@@ -31,6 +31,7 @@ Source code is published under GPL v3, license is available [here](https://githu
|
||||
* libogg ([BSD license](http://www.xiph.org/downloads/))
|
||||
* Open Sans font ([Apache License](http://www.apache.org/licenses/LICENSE-2.0.html))
|
||||
* DejaVu Sans font ([Free license](http://dejavu-fonts.org/wiki/License))
|
||||
* Nanum Myeongjo font ([SIL Open Font License](http://fonts.gstatic.com/ea/nanummyeongjo/v4/OFL.txt))
|
||||
|
||||
###[Build instructions for Visual Studio 2013](https://github.com/telegramdesktop/tdesktop/blob/master/MSVC.md)
|
||||
|
||||
|
||||
15
Telegram/DeployLinux.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
AppVersion=`./Version.sh | awk -F " " '{print $1}'`
|
||||
AppVersionStr=`./Version.sh | awk -F " " '{print $2}'`
|
||||
|
||||
if [ ! -f "./../Linux/Release/deploy/$AppVersionStr/tlinuxupd$AppVersion" ]; then
|
||||
echo "tlinuxupd$AppVersion not found!";
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "./../Linux/Release/deploy/$AppVersionStr/tsetup.$AppVersionStr.tar.xz" ]; then
|
||||
echo "tsetup.$AppVersionStr.tar.xz not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
scp ./../Linux/Release/deploy/$AppVersionStr/tlinuxupd$AppVersion tmaster:tdesktop/www/tlinux/
|
||||
scp ./../Linux/Release/deploy/$AppVersionStr/tsetup.$AppVersionStr.tar.xz tmaster:tdesktop/www/tlinux/
|
||||
16
Telegram/DeployLinux32.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
AppVersion=`./Version.sh | awk -F " " '{print $1}'`
|
||||
AppVersionStr=`./Version.sh | awk -F " " '{print $2}'`
|
||||
|
||||
if [ ! -f "./../Linux/Release/deploy/$AppVersionStr/tlinux32upd$AppVersion" ]; then
|
||||
echo "tlinux32upd$AppVersion not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "./../Linux/Release/deploy/$AppVersionStr/tsetup32.$AppVersionStr.tar.xz" ]; then
|
||||
echo "tsetup32.$AppVersionStr.zip not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
scp ./../Linux/Release/deploy/$AppVersionStr/tlinux32upd$AppVersion tmaster:tdesktop/www/tlinux32/
|
||||
scp ./../Linux/Release/deploy/$AppVersionStr/tsetup32.$AppVersionStr.tar.xz tmaster:tdesktop/www/tlinux32/
|
||||
|
||||
33
Telegram/DeployMacWin.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
AppVersion=`./Version.sh | awk -F " " '{print $1}'`
|
||||
AppVersionStr=`./Version.sh | awk -F " " '{print $2}'`
|
||||
|
||||
if [ ! -f "./../Mac/Release/deploy/$AppVersionStr/tmacupd$AppVersion" ]; then
|
||||
echo "tmacupd$AppVersion not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "./../Mac/Release/deploy/$AppVersionStr/tsetup.$AppVersionStr.dmg" ]; then
|
||||
echo "tsetup.$AppVersionStr.dmg not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "./../../tother/tsetup/tupdate$AppVersion" ]; then
|
||||
echo "tupdate$AppVersion not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "./../../tother/tsetup/tportable.$AppVersionStr.zip" ]; then
|
||||
echo "tportable.$AppVersionStr.zip not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "./../../tother/tsetup/tsetup.$AppVersionStr.exe" ]; then
|
||||
echo "tsetup.$AppVersionStr.exe not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
scp ./../Mac/Release/deploy/$AppVersionStr/tmacupd$AppVersion tmaster:tdesktop/www/tmac/
|
||||
scp ./../Mac/Release/deploy/$AppVersionStr/tsetup.$AppVersionStr.dmg tmaster:tdesktop/www/tmac/
|
||||
scp ./../../tother/tsetup/tupdate$AppVersion tmaster:tdesktop/www/tsetup/
|
||||
scp ./../../tother/tsetup/tportable.$AppVersionStr.zip tmaster:tdesktop/www/tsetup/
|
||||
scp ./../../tother/tsetup/tsetup.$AppVersionStr.exe tmaster:tdesktop/www/tsetup/
|
||||
21
Telegram/DeployWin.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
AppVersion=`./Version.sh | awk -F " " '{print $1}'`
|
||||
AppVersionStr=`./Version.sh | awk -F " " '{print $2}'`
|
||||
|
||||
if [ ! -f "./../Win32/Deploy/deploy/$AppVersionStr/tupdate$AppVersion" ]; then
|
||||
echo "tupdate$AppVersion not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "./../Win32/Deploy/deploy/$AppVersionStr/tportable.$AppVersionStr.zip" ]; then
|
||||
echo "tportable.$AppVersionStr.zip not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "./../Win32/Deploy/deploy/$AppVersionStr/tsetup.$AppVersionStr.exe" ]; then
|
||||
echo "tsetup.$AppVersionStr.exe not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp -v ./../Win32/Deploy/deploy/$AppVersionStr/tupdate$AppVersion /z/TBuild/tother/tsetup/
|
||||
cp -v ./../Win32/Deploy/deploy/$AppVersionStr/tportable.$AppVersionStr.zip /z/TBuild/tother/tsetup/
|
||||
cp -v ./../Win32/Deploy/deploy/$AppVersionStr/tsetup.$AppVersionStr.exe /z/TBuild/tother/tsetup/
|
||||
@@ -516,7 +516,7 @@
|
||||
6DB9C3763D02B1415CD9D565 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0510;
|
||||
LastUpgradeCheck = 0610;
|
||||
};
|
||||
buildConfigurationList = DAC4C1AA5EDEA1C85E9CA5E6 /* Build configuration list for PBXProject "MetaLang" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -594,11 +594,13 @@
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)Lang$(EFFECTIVE_PLATFORM_NAME)";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1.0;
|
||||
DYLIB_CURRENT_VERSION = 1.0.0;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "";
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
@@ -679,12 +681,14 @@
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)Lang$(EFFECTIVE_PLATFORM_NAME)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1.0;
|
||||
DYLIB_CURRENT_VERSION = 1.0.0;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "";
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
|
||||
@@ -516,7 +516,7 @@
|
||||
6DB9C3763D02B1415CD9D565 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0510;
|
||||
LastUpgradeCheck = 0610;
|
||||
};
|
||||
buildConfigurationList = DAC4C1AA5EDEA1C85E9CA5E6 /* Build configuration list for PBXProject "MetaStyle" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -594,11 +594,13 @@
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)Style$(EFFECTIVE_PLATFORM_NAME)";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1.0;
|
||||
DYLIB_CURRENT_VERSION = 1.0.0;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "";
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
@@ -679,12 +681,14 @@
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)Style$(EFFECTIVE_PLATFORM_NAME)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1.0;
|
||||
DYLIB_CURRENT_VERSION = 1.0.0;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "";
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
|
||||
@@ -483,7 +483,7 @@
|
||||
6DB9C3763D02B1415CD9D565 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0510;
|
||||
LastUpgradeCheck = 0610;
|
||||
};
|
||||
buildConfigurationList = DAC4C1AA5EDEA1C85E9CA5E6 /* Build configuration list for PBXProject "Packer" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -546,10 +546,12 @@
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1.0;
|
||||
DYLIB_CURRENT_VERSION = 1.0.0;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "";
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
@@ -634,11 +636,13 @@
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1.0;
|
||||
DYLIB_CURRENT_VERSION = 1.0.0;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "";
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
AppVersionStr=0.6.2
|
||||
AppVersion=6002
|
||||
AppVersion=`./Version.sh | awk -F " " '{print $1}'`
|
||||
AppVersionStr=`./Version.sh | awk -F " " '{print $2}'`
|
||||
|
||||
if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then
|
||||
echo "Deploy folder for version $AppVersionStr already exists!"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
AppVersionStr=0.6.2
|
||||
AppVersion=6002
|
||||
AppVersion=`./Version.sh | awk -F " " '{print $1}'`
|
||||
AppVersionStr=`./Version.sh | awk -F " " '{print $2}'`
|
||||
|
||||
if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then
|
||||
echo "Deploy folder for version $AppVersionStr already exists!"
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
AppVersionStr=0.6.2
|
||||
AppVersion=6002
|
||||
AppVersion=`./Version.sh | awk -F " " '{print $1}'`
|
||||
AppVersionStr=`./Version.sh | awk -F " " '{print $2}'`
|
||||
|
||||
echo ""
|
||||
echo "Preparing version $AppVersionStr.."
|
||||
echo ""
|
||||
|
||||
if [ -d "./../Mac/Release/deploy/$AppVersionStr" ]; then
|
||||
echo "Deploy folder for version $AppVersionStr already exists!"
|
||||
@@ -16,11 +20,6 @@ if [ ! -d "./../Mac/Release/Telegram.app" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "./../Mac/Release/Telegram.app/Contents/_CodeSignature" ]; then
|
||||
echo "Telegram signature not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "./../Mac/Release/Telegram.app/Contents/Resources/Icon.icns" ]; then
|
||||
echo "Icon.icns not found in Resources!"
|
||||
exit 1
|
||||
@@ -36,25 +35,32 @@ if [ ! -f "./../Mac/Release/Telegram.app/Contents/Frameworks/Updater" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "./../Mac/Release/Telegram.app.dmg" ]; then
|
||||
echo "Telegram.app.dmg not found!"
|
||||
if [ ! -d "./../Mac/Release/Telegram.app/Contents/_CodeSignature" ]; then
|
||||
echo "Telegram signature not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Preparing version $AppVersionStr, executing Packer.."
|
||||
cd ./../Mac/Release
|
||||
temppath=`hdiutil attach -readwrite tsetup.dmg | awk -F "\t" 'END {print $3}'`
|
||||
cp -R ./Telegram.app "$temppath/"
|
||||
bless --folder "$temppath/" --openfolder "$temppath/"
|
||||
hdiutil detach "$temppath"
|
||||
hdiutil convert tsetup.dmg -format UDZO -imagekey zlib-level=9 -ov -o tsetup.$AppVersionStr.dmg
|
||||
cd ./../../Telegram
|
||||
cd ./../Mac/Release && ./Packer.app/Contents/MacOS/Packer -path Telegram.app -version $AppVersion && cd ./../../Telegram
|
||||
echo "Packer done!"
|
||||
|
||||
if [ ! -d "./../Mac/Release/deploy/" ]; then
|
||||
mkdir "./../Mac/Release/deploy"
|
||||
fi
|
||||
|
||||
echo "Copying Telegram.app and tmacupd$AppVersion to deploy/$AppVersionStr..";
|
||||
mkdir "./../Mac/Release/deploy/$AppVersionStr"
|
||||
mkdir "./../Mac/Release/deploy/$AppVersionStr/Telegram"
|
||||
cp -r ./../Mac/Release/Telegram.app ./../Mac/Release/deploy/$AppVersionStr/Telegram/
|
||||
rm ./../Mac/Release/Telegram.app/Contents/MacOS/Telegram
|
||||
rm ./../Mac/Release/Telegram.app/Contents/Frameworks/Updater
|
||||
rm -rf ./../Mac/Release/Telegram.app/Contents/_CodeSignature
|
||||
mv ./../Mac/Release/tmacupd$AppVersion ./../Mac/Release/deploy/$AppVersionStr/
|
||||
mv ./../Mac/Release/Telegram.app.dmg ./../Mac/Release/deploy/$AppVersionStr/tsetup.$AppVersionStr.dmg
|
||||
mv ./../Mac/Release/tsetup.$AppVersionStr.dmg ./../Mac/Release/deploy/$AppVersionStr/tsetup.$AppVersionStr.dmg
|
||||
echo "Version $AppVersionStr prepared!";
|
||||
|
||||
|
||||
@@ -1,3 +1,49 @@
|
||||
@echo OFF
|
||||
|
||||
set "AppVersionStrSmall=0.7.2"
|
||||
set "AppVersionStr=0.7.2"
|
||||
set "AppVersionStrFull=0.7.2.0"
|
||||
|
||||
echo.
|
||||
echo Preparing version %AppVersionStr%..
|
||||
echo.
|
||||
|
||||
set "PATH=%PATH%;C:\Program Files\7-Zip;C:\Program Files (x86)\Inno Setup 5"
|
||||
cd ..\Win32\Deploy
|
||||
Prepare.exe -path Telegram.exe -path Updater.exe
|
||||
|
||||
call ..\..\..\TelegramPrivate\Sign.bat Telegram.exe
|
||||
if %errorlevel% neq 0 goto error1
|
||||
|
||||
call ..\..\..\TelegramPrivate\Sign.bat Updater.exe
|
||||
if %errorlevel% neq 0 goto error1
|
||||
|
||||
iscc /dMyAppVersion=%AppVersionStrSmall% /dMyAppVersionZero=%AppVersionStr% /dMyAppFullVersion=%AppVersionStrFull% ..\..\Telegram\Setup.iss
|
||||
if %errorlevel% neq 0 goto error1
|
||||
|
||||
call ..\..\..\TelegramPrivate\Sign.bat tsetup.%AppVersionStr%.exe
|
||||
if %errorlevel% neq 0 goto error1
|
||||
|
||||
call Prepare.exe -path Telegram.exe -path Updater.exe
|
||||
if %errorlevel% neq 0 goto error1
|
||||
|
||||
cd deploy\%AppVersionStr%
|
||||
mkdir Telegram
|
||||
move Telegram.exe Telegram\
|
||||
7z a -mx9 tportable.%AppVersionStr%.zip Telegram\
|
||||
if %errorlevel% neq 0 goto error2
|
||||
|
||||
echo .
|
||||
echo Version %AppVersionStr% is ready for deploy!
|
||||
echo .
|
||||
|
||||
cd ..\..\..\..\Telegram
|
||||
goto eof
|
||||
|
||||
:error2
|
||||
cd ..\..
|
||||
:error1
|
||||
cd ..\..\Telegram
|
||||
echo ERROR occured!
|
||||
exit /b %errorlevel%
|
||||
|
||||
:eof
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,15 +13,18 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
direction: "LTR";
|
||||
|
||||
lng_maintitle: "Telegram D";
|
||||
lng_maintitle: "Telegram Desktop";
|
||||
|
||||
lng_menu_contacts: "Contacts";
|
||||
lng_menu_settings: "Settings";
|
||||
lng_menu_about: "About";
|
||||
lng_menu_update: "Update";
|
||||
lng_menu_restart: "Restart";
|
||||
lng_menu_back: "Back";
|
||||
|
||||
lng_open_from_tray: "Open Telegram";
|
||||
lng_minimize_to_tray: "Minimize to tray";
|
||||
@@ -53,15 +56,28 @@ lng_weekday5: "Fri";
|
||||
lng_weekday6: "Sat";
|
||||
lng_weekday7: "Sun";
|
||||
|
||||
lng_weekday1_full: "Monday";
|
||||
lng_weekday2_full: "Tuesday";
|
||||
lng_weekday3_full: "Wednesday";
|
||||
lng_weekday4_full: "Thursday";
|
||||
lng_weekday5_full: "Friday";
|
||||
lng_weekday6_full: "Saturday";
|
||||
lng_weekday7_full: "Sunday";
|
||||
|
||||
lng_month_day: "{month} {day}";
|
||||
|
||||
lng_cancel: "Cancel";
|
||||
lng_continue: "Continue";
|
||||
lng_connecting: "Connecting...";
|
||||
lng_reconnecting: "Reconnect in %1 s...";
|
||||
lng_close: "Close";
|
||||
lng_connecting: "Connecting..";
|
||||
lng_reconnecting: "Reconnect in %1 s..";
|
||||
lng_reconnecting_try_now: "Try now";
|
||||
|
||||
lng_status_offline: "offline";
|
||||
lng_status_service_notifications: "service notifications";
|
||||
lng_status_offline: "last seen a long time ago";
|
||||
lng_status_recently: "last seen recently";
|
||||
lng_status_last_week: "last seen within a week";
|
||||
lng_status_last_month: "last seen within a month";
|
||||
lng_status_invisible: "invisible";
|
||||
lng_status_lastseen: "last seen {when}";
|
||||
lng_status_lastseen_now: "just now";
|
||||
@@ -74,6 +90,7 @@ lng_status_lastseen_yesterday: "yesterday at {time}";
|
||||
lng_status_lastseen_date: "{date}";
|
||||
lng_status_lastseen_date_time: "{date} at {time}";
|
||||
lng_status_online: "online";
|
||||
lng_status_connecting: "connecting..";
|
||||
|
||||
lng_chat_no_members: "Group is unaccessible";
|
||||
lng_chat_members: "%1 members";
|
||||
@@ -83,14 +100,12 @@ lng_server_error: "Internal server error.";
|
||||
lng_flood_error: "Too much tries. Please try again later.";
|
||||
lng_deleted: "Unknown";
|
||||
|
||||
lng_intro1: "Welcome to an unofficial [b]desktop[/b] client
|
||||
of [b]Telegram[/b] mobile messenger.";
|
||||
lng_intro2: "Visit [a href=\"https://telegram.org/\"]telegram.org[/a] to learn more.";
|
||||
lng_start_msgs: "Start Messaging";
|
||||
lng_intro: "Welcome to the official [a href=\"https://telegram.org/\"]Telegram[/a] desktop app.
|
||||
It's [b]fast[/b] and [b]secure[/b].";
|
||||
lng_start_msgs: "START MESSAGING";
|
||||
|
||||
lng_intro_back: "Back";
|
||||
lng_intro_next: "Next";
|
||||
lng_intro_finish: "Finish";
|
||||
lng_intro_next: "NEXT";
|
||||
lng_intro_finish: "SIGN UP";
|
||||
|
||||
lng_phone_ph: "Your phone number";
|
||||
lng_phone_title: "Your Phone";
|
||||
@@ -106,10 +121,10 @@ lng_country_none: "Country not found";
|
||||
lng_country_select: "Select Country";
|
||||
|
||||
lng_code_ph: "Your code";
|
||||
lng_code_desc: "We have sent you an SMS with activation
|
||||
lng_code_desc: "We have sent you a message with activation
|
||||
code to your phone. Please enter it below.";
|
||||
lng_code_call: "Telegram will dial your number in %1:%2";
|
||||
lng_code_calling: "Requesting a call from Telegram...";
|
||||
lng_code_calling: "Requesting a call from Telegram..";
|
||||
lng_code_called: "Telegram dialed your number";
|
||||
|
||||
lng_bad_phone: "Invalid phone number. Please try again.";
|
||||
@@ -120,6 +135,8 @@ lng_bad_chat_title: "Please enter new chat title.";
|
||||
lng_bad_photo: "Bad image selected.";
|
||||
|
||||
lng_signup_title: "Information and photo";
|
||||
lng_signup_desc: "Please enter your name and
|
||||
upload a photo.";
|
||||
lng_signup_firstname: "First Name";
|
||||
lng_signup_lastname: "Last Name";
|
||||
|
||||
@@ -128,6 +145,9 @@ lng_dlg_conversations: "Conversations";
|
||||
lng_dlg_messages: "Messages";
|
||||
lng_dlg_new_group_name: "Group name";
|
||||
lng_dlg_create_group: "Create";
|
||||
lng_no_contacts: "You have no contacts";
|
||||
lng_contacts_loading: "Loading..";
|
||||
lng_contacts_not_found: "No contacts found";
|
||||
|
||||
lng_settings_profile: "Profile";
|
||||
lng_settings_edit: "Edit";
|
||||
@@ -136,7 +156,28 @@ lng_settings_cancel: "Cancel";
|
||||
lng_settings_upload: "Set Profile Photo";
|
||||
lng_settings_badsize: "This image has bad size, please try other.";
|
||||
lng_settings_crop_profile: "Select square area for your profile photo";
|
||||
lng_settings_uploading_photo: "Uploading photo...";
|
||||
lng_settings_uploading_photo: "Uploading photo..";
|
||||
|
||||
lng_username_title: "Change username";
|
||||
lng_username_about: "You can choose a username on Telegram.
|
||||
If you do, other people will be able to find
|
||||
you by this username and contact you
|
||||
without knowing your phone number.
|
||||
|
||||
You can use a-z, 0-9 and underscores.
|
||||
Minimum length is 5 characters.";
|
||||
lng_username_invalid: "This name is invalid.";
|
||||
lng_username_occupied: "This name is already occupied.";
|
||||
lng_username_too_short: "This name is too short.";
|
||||
lng_username_bad_symbols: "This name has bad symbols.";
|
||||
lng_username_available: "This name is available.";
|
||||
lng_username_not_found: "User @{user} not found.";
|
||||
|
||||
lng_settings_section_contact_info: "Contact info";
|
||||
lng_settings_phone_number: "Phone number:";
|
||||
lng_settings_username: "Username:";
|
||||
lng_settings_choose_username: "choose username";
|
||||
lng_settings_change_username: "Change";
|
||||
|
||||
lng_settings_section_notify: "Notifications";
|
||||
lng_settings_desktop_notify: "Desktop notifications";
|
||||
@@ -151,9 +192,9 @@ lng_settings_section_general: "General";
|
||||
lng_settings_auto_update: "Update automatically";
|
||||
lng_settings_current_version: "Version {version}";
|
||||
lng_settings_check_now: "Check for updates";
|
||||
lng_settings_update_checking: "Checking for updates...";
|
||||
lng_settings_update_checking: "Checking for updates..";
|
||||
lng_settings_latest_installed: "Latest version is installed";
|
||||
lng_settings_downloading: "Downloading update {ready} / {total} Mb...";
|
||||
lng_settings_downloading: "Downloading update {ready} / {total} Mb..";
|
||||
lng_settings_update_ready: "New version is ready";
|
||||
lng_settings_update_now: "Restart Now";
|
||||
lng_settings_update_fail: "Update check failed :(";
|
||||
@@ -192,10 +233,19 @@ lng_download_path_settings: "Go to Settings";
|
||||
lng_download_finish_failed: "File download could not be finished.
|
||||
|
||||
Would you like to try again?";
|
||||
lng_download_path_clearing: "Clearing...";
|
||||
lng_download_path_clearing: "Clearing..";
|
||||
lng_download_path_cleared: "Cleared!";
|
||||
lng_download_path_clear_failed: "Clear failed :(";
|
||||
|
||||
lng_settings_section_cache: "Local storage";
|
||||
lng_settings_no_images_cached: "No cached images found!";
|
||||
lng_settings_image_cached: "Cached: {count} image, {size}";
|
||||
lng_settings_images_cached: "Cached: {count} images, {size}";
|
||||
lng_local_images_clear: "Clear All";
|
||||
lng_local_images_clearing: "Clearing..";
|
||||
lng_local_images_cleared: "Cleared!";
|
||||
lng_local_images_clear_failed: "Clear failed :(";
|
||||
|
||||
lng_settings_section_advanced: "Advanced";
|
||||
lng_connection_type: "Connection type:";
|
||||
lng_connection_auto_connecting: "Default (connecting..)";
|
||||
@@ -211,15 +261,17 @@ lng_connection_port_ph: "Port";
|
||||
lng_connection_user_ph: "Username";
|
||||
lng_connection_password_ph: "Password";
|
||||
lng_connection_save: "Save";
|
||||
lng_settings_reset: "Reset other sessions";
|
||||
lng_settings_reset_done: "Sessions reset done";
|
||||
lng_settings_reset: "Terminate other sessions";
|
||||
lng_settings_reset_done: "Other sessions terminated";
|
||||
lng_settings_logout: "Log Out";
|
||||
lng_sure_logout: "Are you sure you want to log out?";
|
||||
|
||||
lng_settings_need_restart: "You need to restart for applying
|
||||
some of the new settings. Restart now?";
|
||||
lng_settings_restart_now: "Restart";
|
||||
lng_settings_restart_later: "Later";
|
||||
|
||||
lng_topbar_info: "Info";
|
||||
lng_profile_settings_section: "Settings";
|
||||
lng_profile_participants_section: "Participants";
|
||||
lng_profile_info: "Contact info";
|
||||
@@ -238,7 +290,7 @@ lng_profile_add_participant: "Add Member";
|
||||
lng_profile_delete_and_exit: "Leave";
|
||||
lng_profile_kick: "Kick";
|
||||
lng_profile_sure_kick: "Kick {user} from the group?";
|
||||
lng_profile_loading: "Loading...";
|
||||
lng_profile_loading: "Loading..";
|
||||
lng_profile_shared_media: "Shared media";
|
||||
lng_profile_no_media: "No media in this conversation.";
|
||||
lng_profile_photo: "{count} photo »";
|
||||
@@ -315,7 +367,7 @@ lng_in_dlg_audio: "Audio";
|
||||
lng_in_dlg_document: "Document";
|
||||
|
||||
lng_send_button: "Send";
|
||||
lng_message_ph: "Write a message...";
|
||||
lng_message_ph: "Write a message..";
|
||||
lng_empty_history: "";
|
||||
lng_willbe_history: "Please select chat to start messaging";
|
||||
lng_message_with_from: "[c]{from}:[/c] {message}";
|
||||
@@ -343,7 +395,7 @@ lng_context_copy_email: "Copy email address";
|
||||
lng_context_open_hashtag: "Search by hashtag";
|
||||
lng_context_copy_hashtag: "Copy hashtag";
|
||||
lng_context_open_image: "Open Image";
|
||||
lng_context_save_image: "Save Image As...";
|
||||
lng_context_save_image: "Save Image As..";
|
||||
lng_context_forward_image: "Forward Image";
|
||||
lng_context_delete_image: "Delete Image";
|
||||
lng_context_copy_image: "Copy Image";
|
||||
@@ -352,11 +404,11 @@ lng_context_cancel_download: "Cancel Download";
|
||||
lng_context_show_in_folder: "Show in Folder";
|
||||
lng_context_show_in_finder: "Show in Finder";
|
||||
lng_context_open_video: "Open Video";
|
||||
lng_context_save_video: "Save Video As...";
|
||||
lng_context_save_video: "Save Video As..";
|
||||
lng_context_open_audio: "Open Audio";
|
||||
lng_context_save_audio: "Save Audio As...";
|
||||
lng_context_save_audio: "Save Audio As..";
|
||||
lng_context_open_document: "Open File";
|
||||
lng_context_save_document: "Save File As...";
|
||||
lng_context_save_document: "Save File As..";
|
||||
lng_context_forward_file: "Forward File";
|
||||
lng_context_delete_file: "Delete File";
|
||||
lng_context_close_file: "Close File";
|
||||
@@ -375,7 +427,7 @@ lng_really_send_file: "Do you want to send this file?";
|
||||
lng_really_share_contact: "Do you want to share this contact?";
|
||||
lng_send_image_compressed: "Send compressed image";
|
||||
|
||||
lng_forward_choose: "Choose recipient...";
|
||||
lng_forward_choose: "Choose recipient..";
|
||||
lng_forward_confirm: "Forward to {recipient}?";
|
||||
lng_forward_share_contact: "Share contact to {recipient}?";
|
||||
lng_forward_send_file_confirm: "Send «{name}» to {recipient}?";
|
||||
@@ -420,7 +472,7 @@ lng_selected_delete_confirm: "Delete";
|
||||
lng_emoji_no_recent: "Recent emojis will be here";
|
||||
|
||||
lng_about_version: "Version {version}";
|
||||
lng_about_text: "Unofficial free messaging app based on [a href=\"https://core.telegram.org/mtproto\"]MTProto[/a] and
|
||||
lng_about_text: "Official free messaging app based on [a href=\"https://core.telegram.org/mtproto\"]MTProto[/a] and
|
||||
[a href=\"https://core.telegram.org/api\"]Telegram API[/a] for speed and security
|
||||
|
||||
This software is licensed under [a href=\"https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\"]GNU GPL[/a] version 3,
|
||||
@@ -430,17 +482,30 @@ lng_about_done: "Done";
|
||||
lng_search_no_results: "No messages found";
|
||||
lng_search_one_result: "Found {count} message";
|
||||
lng_search_n_results: "Found {count} messages";
|
||||
lng_search_global_results: "Global search results";
|
||||
|
||||
lng_mediaview_close: "Close";
|
||||
lng_mediaview_save: "Save as";
|
||||
lng_mediaview_save: "Download";
|
||||
lng_mediaview_forward: "Forward";
|
||||
lng_mediaview_delete: "Delete";
|
||||
lng_mediaview_single_photo: "Single Photo";
|
||||
lng_mediaview_group_photo: "Group Photo";
|
||||
lng_mediaview_profile_photo: "Profile Photo";
|
||||
lng_mediaview_n_of_count: "{n} of {count}";
|
||||
lng_mediaview_n_of_count: "Photo {n} of {count}";
|
||||
lng_mediaview_doc_image: "Document";
|
||||
|
||||
lng_mediaview_saved: "Image was saved to your [c]Downloads[/c] folder";
|
||||
|
||||
lng_new_authorization: "{name},
|
||||
We detected a login into your account from a new device on {day}, {date} at {time}
|
||||
|
||||
Device: {device}
|
||||
Location: {location}
|
||||
|
||||
If this wasn't you, you can go to Settings — Terminate other sessions.
|
||||
|
||||
Thanks,
|
||||
The Telegram Team";
|
||||
|
||||
// Mac specific
|
||||
|
||||
lng_mac_choose_app: "Choose Application";
|
||||
@@ -452,5 +517,22 @@ lng_mac_always_open_with: "Always Open With";
|
||||
lng_mac_this_app_can_open: "This application can open \"{file}\".";
|
||||
lng_mac_not_known_app: "It's not known if this application can open \"{file}\".";
|
||||
|
||||
// Keys finished
|
||||
lng_mac_menu_about: "About Telegram";
|
||||
lng_mac_menu_preferences: "Preferences...";
|
||||
lng_mac_menu_file: "File";
|
||||
lng_mac_menu_logout: "Log Out";
|
||||
lng_mac_menu_edit: "Edit";
|
||||
lng_mac_menu_undo: "Undo";
|
||||
lng_mac_menu_redo: "Redo";
|
||||
lng_mac_menu_cut: "Cut";
|
||||
lng_mac_menu_copy: "Copy";
|
||||
lng_mac_menu_paste: "Paste";
|
||||
lng_mac_menu_delete: "Delete";
|
||||
lng_mac_menu_select_all: "Select All";
|
||||
lng_mac_menu_window: "Window";
|
||||
lng_mac_menu_contacts: "Contacts";
|
||||
lng_mac_menu_add_contact: "Add Contact";
|
||||
lng_mac_menu_new_group: "New Group";
|
||||
lng_mac_menu_show: "Show Telegram";
|
||||
|
||||
// Keys finished
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
defaultFontFamily: 'Open Sans';
|
||||
semibold: 'Open Sans Semibold';
|
||||
@@ -29,7 +29,7 @@ emojiPadding: 0px;
|
||||
counterBG: #f23c34;
|
||||
counterMuteBG: #888;
|
||||
counterColor: #fff;
|
||||
counterMacInvColor: #045fd5;
|
||||
counterMacInvColor: #ffffff01;
|
||||
|
||||
lineWidth: 1px;
|
||||
|
||||
@@ -46,7 +46,8 @@ color6: #cd4073; // pink
|
||||
color7: #2996ad; // sea
|
||||
color8: #ce671b; // orange
|
||||
|
||||
wndMinWidth: 640px;
|
||||
wndMinWidth: 380px;
|
||||
wideModeWidth: 640px;
|
||||
wndMinHeight: 480px;
|
||||
wndDefWidth: 800px;
|
||||
wndDefHeight: 600px;
|
||||
@@ -63,7 +64,7 @@ titleHeight: 39px;
|
||||
titleShadowColor: rgba(0, 0, 0, 24);//#ebebeb
|
||||
titleShadow: 1px;
|
||||
titleIconPos: point(7px, 7px);
|
||||
titleIconRect: sprite(160px, 100px, 26px, 26px);
|
||||
titleIconImg: sprite(160px, 100px, 26px, 26px);
|
||||
titleFont: font(17px);
|
||||
titlePos: point(44px, 29px);
|
||||
titleMenuOffset: 36px;
|
||||
@@ -78,34 +79,6 @@ titleTypingColor: #0080c0;
|
||||
statusFont: font(fsize);
|
||||
versionColor: #777;
|
||||
|
||||
sysBtnDelta: 6px;
|
||||
sysUpd: sysButton {
|
||||
size: size(31px, 39px);
|
||||
img: sprite(184px, 1px, 19px, 19px);
|
||||
color: #c4d8e9;
|
||||
overColor: white;
|
||||
duration: 150;
|
||||
}
|
||||
sysMin: sysButton(sysUpd) {
|
||||
img: sprite(207px, 1px, 19px, 19px);
|
||||
}
|
||||
sysMax: sysButton(sysUpd) {
|
||||
img: sprite(230px, 1px, 19px, 19px);
|
||||
}
|
||||
sysRes: sysButton(sysUpd) {
|
||||
img: sprite(253px, 1px, 19px, 19px);
|
||||
}
|
||||
sysCls: sysButton(sysUpd) {
|
||||
img: sprite(276px, 1px, 19px, 19px);
|
||||
}
|
||||
|
||||
btnWhiteHover: #f5f5f5;
|
||||
btnBoxWhiteHover: #fafafa;
|
||||
btnYesColor: #0080c0;
|
||||
btnYesHover: #0073ad;
|
||||
btnNoColor: #8b8b8b;
|
||||
btnNoHover: #777;
|
||||
|
||||
btnDefIconed: iconedButton {
|
||||
color: white;
|
||||
bgColor: white;
|
||||
@@ -122,6 +95,53 @@ btnDefIconed: iconedButton {
|
||||
cursor: cursor(pointer);
|
||||
}
|
||||
|
||||
sysBtnDelta: 6px;
|
||||
sysUpd: sysButton {
|
||||
size: size(31px, 39px);
|
||||
img: sprite(184px, 1px, 19px, 19px);
|
||||
color: #c4d8e9;
|
||||
overColor: white;
|
||||
duration: 150;
|
||||
}
|
||||
updateBlinkDuration: 500;
|
||||
sysMin: sysButton(sysUpd) {
|
||||
img: sprite(207px, 1px, 19px, 19px);
|
||||
}
|
||||
sysMax: sysButton(sysUpd) {
|
||||
img: sprite(230px, 1px, 19px, 19px);
|
||||
}
|
||||
sysRes: sysButton(sysUpd) {
|
||||
img: sprite(253px, 1px, 19px, 19px);
|
||||
}
|
||||
sysCls: sysButton(sysUpd) {
|
||||
img: sprite(276px, 1px, 19px, 19px);
|
||||
}
|
||||
titleBackButton: iconedButton(btnDefIconed) {
|
||||
icon: sprite(133px, 197px, 13px, 20px);
|
||||
iconPos: point(5px, 9px);
|
||||
downIcon: sprite(133px, 197px, 13px, 20px);
|
||||
downIconPos: point(5px, 10px);
|
||||
|
||||
bgColor: #c4d8e9;
|
||||
overBgColor: #fff;
|
||||
|
||||
width: -30px;
|
||||
height: 39px;
|
||||
|
||||
opacity: 1;
|
||||
cursor: cursor(default);
|
||||
|
||||
textPos: point(23px, 10px);
|
||||
downTextPos: point(23px, 11px);
|
||||
}
|
||||
|
||||
btnWhiteHover: #f5f5f5;
|
||||
btnBoxWhiteHover: #fafafa;
|
||||
btnYesColor: #0080c0;
|
||||
btnYesHover: #0073ad;
|
||||
btnNoColor: #8b8b8b;
|
||||
btnNoHover: #777;
|
||||
|
||||
titleTextButton: flatButton {
|
||||
color: #d4e3ef;
|
||||
overColor: #fff;
|
||||
@@ -137,8 +157,8 @@ titleTextButton: flatButton {
|
||||
overTextTop: 10px;
|
||||
downTextTop: 11px;
|
||||
|
||||
font: font(13px);
|
||||
overFont: font(13px);
|
||||
font: font(fsize);
|
||||
overFont: font(fsize);
|
||||
duration: 150;
|
||||
cursor: cursor(default);
|
||||
}
|
||||
@@ -174,6 +194,7 @@ btnDefBack: flatButton(btnDefFlat) {
|
||||
downBgColor: #b9b9b9;
|
||||
}
|
||||
|
||||
linkCropLimit: 360px;
|
||||
linkFont: font(fsize);
|
||||
linkOverFont: font(fsize underline);
|
||||
btnDefLink: linkButton {
|
||||
@@ -244,9 +265,9 @@ inpDefFlat: flatInput {
|
||||
}
|
||||
|
||||
inpDefGray: flatInput(inpDefFlat) {
|
||||
bgColor: #ebebeb;
|
||||
bgColor: #f2f2f2;
|
||||
borderWidth: 2px;
|
||||
borderColor: #ebebeb;
|
||||
borderColor: #f2f2f2;
|
||||
borderActive: #80cff9;
|
||||
borderError: #ed8080;
|
||||
phColor: #808080;
|
||||
@@ -305,20 +326,18 @@ labelDefFlat: flatLabel {
|
||||
align: align(left);
|
||||
}
|
||||
|
||||
introSkip: 20px;
|
||||
introBtnTop: 288px;
|
||||
introSkip: 45px;
|
||||
introFinishSkip: 15px;
|
||||
introHeaderFont: font(28px);
|
||||
introPhotoSize: 98px;
|
||||
introHeaderFont: font(24px);
|
||||
introHeaderSkip: 14px;
|
||||
introFont: font(17px);
|
||||
introVersionFont: introFont;
|
||||
introVersionColor: #9b9b9b;
|
||||
introVersionSkip: 10px;
|
||||
intro2Skip: 60px;
|
||||
intro1Skip: 14px;
|
||||
introIconSkip: 54px;
|
||||
introFont: font(16px);
|
||||
introColor: black;
|
||||
|
||||
introLabel: flatLabel(labelDefFlat) {
|
||||
font: introFont;
|
||||
align: align(center);
|
||||
}
|
||||
|
||||
introPointsTop: -30px; // intro steps bottom points
|
||||
@@ -349,32 +368,29 @@ introHideFunc: transition(easeInCirc);
|
||||
introShowFunc: transition(easeOutCirc);
|
||||
introAlphaHideFunc: transition(easeOutCirc);
|
||||
introAlphaShowFunc: transition(easeInCirc);
|
||||
introTextSize: size(400px, 97px);
|
||||
|
||||
introTitleFont: font(24px);
|
||||
introDescFont: font(18px);
|
||||
introTextTop: 22px;
|
||||
introTextSize: size(400px, 93px);
|
||||
introCallSkip: 15px;
|
||||
|
||||
btnIntroSep: 12px;
|
||||
btnIntroNext: flatButton(btnDefNext, btnDefBig) {
|
||||
width: 144px;
|
||||
}
|
||||
btnIntroBack: flatButton(btnIntroNext, btnDefBack) {
|
||||
}
|
||||
textTop: 16px;
|
||||
overTextTop: 16px;
|
||||
downTextTop: 17px;
|
||||
|
||||
font: font(17px);
|
||||
overFont: font(17px);
|
||||
|
||||
btnIntroStart: flatButton(btnIntroNext) {
|
||||
width: 300px;
|
||||
}
|
||||
btnIntroFinish: flatButton(btnIntroNext) {
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
boxShadow: sprite(240px, 21px, 9px, 9px);
|
||||
|
||||
introCountry: countryInput {
|
||||
width: 300px;
|
||||
height: 41px;
|
||||
top: 24px;
|
||||
bgColor: #ebebeb;
|
||||
top: 33px;
|
||||
bgColor: #f2f2f2;
|
||||
ptrSize: size(15px, 8px);
|
||||
textMrg: margins(16px, 5px, 16px, 15px);
|
||||
font: inpDefFont;
|
||||
@@ -396,13 +412,14 @@ inpIntroCode: flatInput(inpDefGray) {
|
||||
textMrg: margins(12px, 5px, 12px, 6px);
|
||||
width: 106px;
|
||||
height: 41px;
|
||||
align: align(center);
|
||||
|
||||
phPos: point(0px, 0px);
|
||||
phAlign: align(center);
|
||||
phShift: 0px;
|
||||
}
|
||||
inpIntroName: flatInput(inpIntroPhone) {
|
||||
width: 240px;
|
||||
width: 192px;
|
||||
}
|
||||
|
||||
introSelectDelta: 30px;
|
||||
@@ -446,7 +463,7 @@ countryList: countryList {
|
||||
color: #000;
|
||||
codeColor: #aaaaaa;//rgb(20, 136, 210);
|
||||
bgColor: #FFF;
|
||||
bgHovered: #f1f1f1;
|
||||
bgHovered: #f5f5f5;
|
||||
margin: 13px;
|
||||
codeWidth: 60px;
|
||||
|
||||
@@ -464,8 +481,6 @@ countriesBackShowFunc: transition(linear);
|
||||
countriesAlphaHideFunc: transition(easeOutCirc);
|
||||
countriesAlphaShowFunc: transition(easeInCirc);
|
||||
|
||||
introBtnTop: 244px;
|
||||
|
||||
introErrWidth: 450px;
|
||||
introErrDuration: 200;
|
||||
introErrFunc: transition(linear);
|
||||
@@ -477,6 +492,7 @@ introErrFont: font(16px);
|
||||
|
||||
introErrLabel: flatLabel(labelDefFlat) {
|
||||
font: introErrFont;
|
||||
align: align(center);
|
||||
}
|
||||
|
||||
setWidth: 356px;
|
||||
@@ -484,10 +500,9 @@ setTop: 26px;
|
||||
setNameLeft: 3px;
|
||||
setNameTop: 1px;
|
||||
setNameFont: font(22px);
|
||||
setPhoneFont: font(16px);
|
||||
setPhoneColor: #999;
|
||||
setPhoneTop: 39px;
|
||||
setPhoneLeft: 1px;
|
||||
setStatusTop: 39px;
|
||||
setStatusLeft: 1px;
|
||||
setStatusFont: font(16px);
|
||||
setPhotoSize: 120px;
|
||||
setHeaderFont: font(20px);
|
||||
setHeaderColor: black;
|
||||
@@ -506,15 +521,17 @@ setScroll: flatScroll(scrollDef) {
|
||||
topsh: 0px;
|
||||
}
|
||||
setClose: iconedButton(btnDefIconed) {
|
||||
icon: sprite(245px, 221px, 43px, 43px);
|
||||
icon: sprite(245px, 221px, 40px, 40px);
|
||||
iconPos: point(0px, 0px);
|
||||
downIcon: sprite(245px, 221px, 43px, 43px);
|
||||
downIcon: sprite(245px, 221px, 40px, 40px);
|
||||
downIconPos: point(0px, 0px);
|
||||
|
||||
opacity: 0.71;
|
||||
|
||||
width: 43px;
|
||||
height: 43px;
|
||||
}
|
||||
setClosePos: point(18px, 18px);
|
||||
setClosePos: point(32px, 32px);
|
||||
setPhotoImg: sprite(0px, 220px, 120px, 120px);
|
||||
setOverPhotoImg: sprite(122px, 220px, 120px, 120px);
|
||||
setPhotoDuration: 150;
|
||||
@@ -535,6 +552,7 @@ setErrBG: #ffa5a5;
|
||||
setErrColor: #800000;
|
||||
setErrHeight: 30px;
|
||||
setErrFont: font(fsize);
|
||||
setGoodColor: #008000;
|
||||
|
||||
btnSetUpload: flatButton(btnDefNext, btnDefBig) {
|
||||
width: 206px;
|
||||
@@ -598,22 +616,9 @@ dlgPaddingVer: 8px;
|
||||
dlgHeight: 62px;
|
||||
dlgPhotoPadding: 12px;
|
||||
|
||||
dlgState: switcher {
|
||||
border: 2px;
|
||||
borderColor: btnNextBG;
|
||||
|
||||
bgColor: #fff;
|
||||
bgHovered: btnWhiteHover;
|
||||
bgActive: btnNextBG;
|
||||
|
||||
height: 34px;
|
||||
|
||||
font: font(fsize);
|
||||
textColor: btnYesColor;
|
||||
activeColor: #fff;
|
||||
|
||||
duration: 200;
|
||||
}
|
||||
noContactsHeight: 100px;
|
||||
noContactsFont: font(fsize);
|
||||
noContactsColor: #777;
|
||||
|
||||
dlgSep: 8px;
|
||||
|
||||
@@ -690,9 +695,10 @@ dlgActiveDateColor: #d3e2ee;
|
||||
topBarHeight: 54px;
|
||||
topBarBG: white;
|
||||
topBarDuration: 200;
|
||||
topBarForwardPadding: margins(17px, 8px, 40px, 8px);
|
||||
topBarForwardPadding: margins(17px, 8px, 39px, 8px);
|
||||
topBarForwardAlpha: 0.6;
|
||||
topBarForwardImg: sprite(45px, 112px, 9px, 16px);
|
||||
topBarBackwardImg: sprite(35px, 112px, 9px, 16px);
|
||||
topBarBackPadding: margins(15px, 7px, 9px, 7px);
|
||||
topBarBackAlpha: 0.8;
|
||||
topBarBackImg: sprite(65px, 112px, 9px, 16px);
|
||||
@@ -841,6 +847,10 @@ outTextStyle: textStyle(defaultTextStyle) {
|
||||
selectBG: msgOutSelectBG;
|
||||
selectOverlay: msgOutSelectOverlay;
|
||||
}
|
||||
medviewSaveAsTextStyle: textStyle(defaultTextStyle) {
|
||||
lnkColor: #91d9ff;
|
||||
lnkDownColor: #91d9ff;
|
||||
}
|
||||
|
||||
dlgTextStyle: textStyle(defaultTextStyle) {
|
||||
lnkColor: dlgSystemColor;
|
||||
@@ -852,6 +862,12 @@ dlgActiveTextStyle: textStyle(defaultTextStyle) {
|
||||
lnkDownColor: dlgActiveColor;
|
||||
lnkOverFlags: font(fsize);
|
||||
}
|
||||
introLabelTextStyle: textStyle(defaultTextStyle) {
|
||||
lineHeight: 30px;
|
||||
}
|
||||
introErrLabelTextStyle: textStyle(defaultTextStyle) {
|
||||
lineHeight: 27px;
|
||||
}
|
||||
|
||||
mediaMaxWidth: 250px;
|
||||
mediaFont: font(fsize);
|
||||
@@ -873,13 +889,13 @@ mediaInSelectColor: msgInSelectDateColor;
|
||||
mediaOutSelectColor: msgOutSelectDateColor;
|
||||
mediaSaveDelta: 14px; // between bubble and download
|
||||
mediaSaveButton: flatButton(btnDefFlat) {
|
||||
color: btnYesColor;
|
||||
overColor: btnYesHover;
|
||||
downColor: btnYesHover;
|
||||
color: #507da2;
|
||||
overColor: #507da2;
|
||||
downColor: #507da2;
|
||||
|
||||
bgColor: white;
|
||||
overBgColor: btnWhiteHover;
|
||||
downBgColor: btnWhiteHover;
|
||||
overBgColor: #f5f8fa;
|
||||
downBgColor: #f5f8fa;
|
||||
|
||||
width: -28px;
|
||||
height: 34px;
|
||||
@@ -1074,7 +1090,7 @@ profileListPhotoSize: 46px;
|
||||
profileListPadding: size(12px, 6px);
|
||||
profileListNameTop: 8px;
|
||||
profileListStatusBottom: 6px;
|
||||
profileHoverBG: #f1f1f1;
|
||||
profileHoverBG: #f5f5f5;
|
||||
profileActiveBG: #6294b9;
|
||||
profileSubFont: font(fsize);
|
||||
profileCheckRect: sprite(88px, 108px, 24px, 24px);
|
||||
@@ -1223,7 +1239,7 @@ contactsClose: flatButton {
|
||||
overColor: btnYesHover;
|
||||
downColor: btnYesHover;
|
||||
|
||||
bgColor: #fffe;
|
||||
bgColor: white;
|
||||
overBgColor: white;
|
||||
downBgColor: white;
|
||||
|
||||
@@ -1277,6 +1293,9 @@ aboutCloseButton: flatButton(contactsClose) {
|
||||
overTextTop: 15px;
|
||||
downTextTop: 16px;
|
||||
}
|
||||
btnInfoClose: flatButton(aboutCloseButton) {
|
||||
width: confirmWidth;
|
||||
}
|
||||
|
||||
emojiTextFont: font(16px);
|
||||
emojiReplaceWidth: 56px;
|
||||
@@ -1463,53 +1482,120 @@ emojiPanDuration: 200;
|
||||
emojiPanHover: #f0f0f0;
|
||||
emojiPanRound: 2px;
|
||||
|
||||
medviewNavBarWidth: 120px;
|
||||
medviewTopSkip: 66px;
|
||||
medviewBottomSkip: 66px;
|
||||
medviewMainWidth: 600px;
|
||||
medviewControlsBgOpacity: 0.5;
|
||||
medviewLightOpacity: 0.7;
|
||||
medviewDarkOpacity: 0.8;
|
||||
medviewNavBarWidth: 132px;
|
||||
medviewLightNav: 0.5;
|
||||
medviewHeaderFont: font(semibold 18px);
|
||||
medviewDateFont: font(fsize);
|
||||
medviewNameTop: 3px;
|
||||
medviewDateTop: 25px;
|
||||
medviewHeaderColor: #ffffffc0;
|
||||
medviewNameColor: medviewHeaderColor;
|
||||
medviewNameOverColor: #fff;
|
||||
medviewDarkNav: 1;
|
||||
medviewMinWidth: 600;
|
||||
medviewLeft: sprite(0px, 340px, 22px, 40px);
|
||||
medviewRight: sprite(22px, 340px, 22px, 40px);
|
||||
medviewHeaderFont: font(semibold 18px);
|
||||
medviewNameFont: font(16px);
|
||||
medviewDateFont: font(14px);
|
||||
medviewNameTop: 13px;
|
||||
medviewDateTop: 39px;
|
||||
medviewLeft: sprite(340px, 79px, 28px, 48px);
|
||||
medviewRight: sprite(368px, 79px, 28px, 48px);
|
||||
medviewDeltaFromLastAction: 5px;
|
||||
medviewSwipeDistance: 80px;
|
||||
medviewButton: flatButton(btnDefFlat) {
|
||||
color: #ffffff80;
|
||||
overColor: #fff;
|
||||
downColor: #fff;
|
||||
|
||||
medviewSaveMsgCheck: sprite(341px, 174px, 22px, 18px);
|
||||
medviewSaveMsgFont: font(16px);
|
||||
medviewSaveMsgPadding: margins(55px, 19px, 29px, 20px);
|
||||
medviewSaveMsgCheckPos: point(23px, 21px);
|
||||
medviewSaveMsgRadius: 3px;
|
||||
medviewSaveMsgShowing: 200;
|
||||
medviewSaveMsgShown: 2000;
|
||||
medviewSaveMsgHiding: 2500;
|
||||
medviewSaveMsg: #000000b2;
|
||||
|
||||
medviewOverview: iconedButton(btnDefIconed) {
|
||||
bgColor: #0000;
|
||||
overBgColor: #00000055;
|
||||
downBgColor: #00000055;
|
||||
|
||||
width: 100px;
|
||||
height: 46px;
|
||||
|
||||
textTop: 13px;
|
||||
overTextTop: 13px;
|
||||
downTextTop: 14px;
|
||||
|
||||
overBgColor: #00000040;
|
||||
font: font(16px);
|
||||
overFont: font(16px);
|
||||
|
||||
opacity: 0.77;
|
||||
overOpacity: 1;
|
||||
|
||||
icon: sprite(340px, 129px, 19px, 19px);
|
||||
iconPos: point(16px, 14px);
|
||||
downIcon: sprite(340px, 129px, 19px, 19px);
|
||||
downIconPos: point(16px, 14px);
|
||||
|
||||
width: -69px;
|
||||
height: 47px;
|
||||
|
||||
color: white;
|
||||
|
||||
textPos: point(51px, 13px);
|
||||
downTextPos: point(51px, 14px);
|
||||
}
|
||||
medviewForward: iconedButton(medviewOverview) {
|
||||
icon: sprite(357px, 58px, 22px, 17px);
|
||||
iconPos: point(16px, 15px);
|
||||
downIcon: sprite(357px, 58px, 22px, 17px);
|
||||
downIconPos: point(16px, 15px);
|
||||
|
||||
width: -69px;
|
||||
}
|
||||
medviewDelete: iconedButton(medviewForward) {
|
||||
icon: sprite(340px, 58px, 15px, 19px);
|
||||
iconPos: point(16px, 14px);
|
||||
downIcon: sprite(340px, 58px, 15px, 19px);
|
||||
downIconPos: point(16px, 14px);
|
||||
}
|
||||
medviewClose: iconedButton(medviewOverview) {
|
||||
icon: sprite(340px, 0px, 56px, 56px);
|
||||
iconPos: point(0px, 0px);
|
||||
downIcon: sprite(340px, 0px, 56px, 56px);
|
||||
downIconPos: point(0px, 0px);
|
||||
|
||||
opacity: 0.6;
|
||||
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
}
|
||||
medviewBottomBar: 87px;
|
||||
medviewBG: #272727D9;
|
||||
medviewBottomBG: #272727;
|
||||
medviewNavOpacity: 0.6;
|
||||
medviewCloseOpacity: 0.6;
|
||||
medviewNavBGOpacity: 0.4;
|
||||
medviewNavOverOpacity: 1;
|
||||
medviewCloseOverOpacity: 1;
|
||||
medviewNameColor: black;
|
||||
medviewDateColor: #999;
|
||||
medviewSaveAs: iconedButton(medviewOverview) {
|
||||
bgColor: #38abe6;
|
||||
overBgColor: #299fdc;
|
||||
|
||||
opacity: 1;
|
||||
|
||||
icon: sprite(361px, 129px, 12px, 19px);
|
||||
iconPos: point(18px, 15px);
|
||||
downIcon: sprite(361px, 129px, 12px, 19px);
|
||||
downIconPos: point(18px, 15px);
|
||||
|
||||
width: -62px;
|
||||
height: 47px;
|
||||
|
||||
textPos: point(44px, 13px);
|
||||
downTextPos: point(44px, 14px);
|
||||
}
|
||||
medviewSaveAsDisabledOpacity: 0.8;
|
||||
medviewPolaroid: margins(17px, 18px, 17px, 72px);
|
||||
medviewPolaroidMin: size(480px, 360px);
|
||||
medviewDocumentSprite: sprite(341px, 150px, 20px, 22px);
|
||||
medviewDocumentSpritePos: point(16px, 13px);
|
||||
medviewPhotoSprite: sprite(363px, 150px, 23px, 20px);
|
||||
medviewPhotoSpritePos: point(14px, 14px);
|
||||
medviewTransparentBrush: sprite(148px, 197px, 8px, 8px);
|
||||
|
||||
overviewPhotoSkip: 10px;
|
||||
overviewPhotoMinSize: 100px;
|
||||
overviewPhotoCheck: sprite(245px, 308px, 32px, 32px);
|
||||
overviewPhotoChecked: sprite(278px, 308px, 32px, 32px);
|
||||
overviewPhotoSelectOverlay: #0a7bb03f;
|
||||
|
||||
// Mac specific
|
||||
|
||||
macAccessoryHeight: 90;
|
||||
macAccessory: size(450, 90);
|
||||
macEnableFilterAdd: 2;
|
||||
macEnableFilterTop: 5;
|
||||
macSelectorTop: 6;
|
||||
@@ -1555,3 +1641,22 @@ mediaviewLoaderSkip: 9px;
|
||||
|
||||
minPhotoWidth: 90px;
|
||||
minPhotoHeight: 90px;
|
||||
maxMediaSize: 420px;
|
||||
|
||||
usernameFont: font(14px);
|
||||
usernameColor: #777;
|
||||
usernameWidth: 336px;
|
||||
usernameSkip: 32px;
|
||||
usernameInput: flatInput(inpAddContact) {
|
||||
bgColor: transparent;
|
||||
}
|
||||
usernameDone: flatButton(btnSelectDone) {
|
||||
width: 168px;
|
||||
}
|
||||
usernameCancel: flatButton(btnSelectCancel) {
|
||||
width: 167px;
|
||||
}
|
||||
|
||||
youtubeIcon: sprite(336px, 221px, 60px, 60px);
|
||||
vimeoIcon: sprite(336px, 283px, 60px, 60px);
|
||||
locationSize: size(320, 240);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
textStyle {
|
||||
lnkFlags: font;
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
|
||||
#define MyAppShortName "Telegram"
|
||||
#define MyAppName "Telegram Desktop"
|
||||
#define MyAppVersion "0.6.2"
|
||||
#define MyAppVersionZero "0.6.2"
|
||||
#define MyAppFullVersion "0.6.2.0"
|
||||
#define MyAppPublisher "Telegram Messenger LLP"
|
||||
#define MyAppURL "https://tdesktop.com"
|
||||
#define MyAppExeName "Telegram.exe"
|
||||
@@ -28,7 +25,7 @@ DefaultGroupName={#MyAppName}
|
||||
AllowNoIcons=yes
|
||||
OutputDir=.\..\Win32\Deploy
|
||||
OutputBaseFilename=tsetup.{#MyAppVersionZero}
|
||||
SetupIconFile=.\SourceFiles\art\iconround256.ico
|
||||
SetupIconFile=.\SourceFiles\art\icon256.ico
|
||||
UninstallDisplayIcon={app}\Telegram.exe
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
codesign --force --deep --sign "Developer ID Application: John Preston" ./../Mac/Release/Telegram.app
|
||||
@@ -1,4 +0,0 @@
|
||||
cd ..\Win32\Deploy
|
||||
call ..\..\..\TelegramPrivate\Sign.bat Telegram.exe
|
||||
call ..\..\..\TelegramPrivate\Sign.bat Updater.exe
|
||||
cd ..\..\Telegram
|
||||
@@ -1,3 +0,0 @@
|
||||
cd ..\Win32\Deploy
|
||||
call ..\..\..\TelegramPrivate\Sign.bat tsetup.0.6.2.exe
|
||||
cd ..\..\Telegram
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "genemoji.h"
|
||||
|
||||
@@ -52,38 +52,38 @@ struct EmojiReplace {
|
||||
};
|
||||
|
||||
EmojiReplace replaces[] = {
|
||||
{0xD83DDE0A, ":-)"},
|
||||
{0xD83DDE03, ":-D"},
|
||||
{0xD83DDE09, ";-)"},
|
||||
{0xD83DDE06, "xD"},
|
||||
{0xD83DDE1C, ";-P"},
|
||||
{0xD83DDE0B, ":-p"},
|
||||
{0xD83DDE0D, "8-)"},
|
||||
{0xD83DDE0E, "B-)"},
|
||||
{0xD83DDE12, ":-("},
|
||||
{0xD83DDE0F, ":]"},
|
||||
{0xD83DDE14, "3("},
|
||||
{0xD83DDE22, ":'("},
|
||||
{0xD83DDE2D, ":_("},
|
||||
{0xD83DDE29, ":(("},
|
||||
{0xD83DDE28, ":o"},
|
||||
{0xD83DDE10, ":|"},
|
||||
{0xD83DDE0C, "3-)"},
|
||||
{0xD83DDE20, ">("},
|
||||
{0xD83DDE21, ">(("},
|
||||
{0xD83DDE07, "O:)"},
|
||||
{0xD83DDE30, ";o"},
|
||||
{0xD83DDE33, "8|"},
|
||||
{0xD83DDE32, "8o"},
|
||||
{0xD83DDE37, ":X"},
|
||||
{0xD83DDE1A, ":-*"},
|
||||
{0xD83DDE08, "}:)"},
|
||||
{0x2764, "<3"},
|
||||
{0xD83DDC4D, ":like:"},
|
||||
{0xD83DDC4E, ":dislike:"},
|
||||
{0x261D, ":up:"},
|
||||
{0x270C, ":v:"},
|
||||
{0xD83DDC4C, ":ok:"}
|
||||
{0xD83DDE0AU, ":-)"},
|
||||
{0xD83DDE03U, ":-D"},
|
||||
{0xD83DDE09U, ";-)"},
|
||||
{0xD83DDE06U, "xD"},
|
||||
{0xD83DDE1CU, ";-P"},
|
||||
{0xD83DDE0BU, ":-p"},
|
||||
{0xD83DDE0DU, "8-)"},
|
||||
{0xD83DDE0EU, "B-)"},
|
||||
{0xD83DDE12U, ":-("},
|
||||
{0xD83DDE0FU, ":]"},
|
||||
{0xD83DDE14U, "3("},
|
||||
{0xD83DDE22U, ":'("},
|
||||
{0xD83DDE2DU, ":_("},
|
||||
{0xD83DDE29U, ":(("},
|
||||
{0xD83DDE28U, ":o"},
|
||||
{0xD83DDE10U, ":|"},
|
||||
{0xD83DDE0CU, "3-)"},
|
||||
{0xD83DDE20U, ">("},
|
||||
{0xD83DDE21U, ">(("},
|
||||
{0xD83DDE07U, "O:)"},
|
||||
{0xD83DDE30U, ";o"},
|
||||
{0xD83DDE33U, "8|"},
|
||||
{0xD83DDE32U, "8o"},
|
||||
{0xD83DDE37U, ":X"},
|
||||
{0xD83DDE1AU, ":-*"},
|
||||
{0xD83DDE08U, "}:)"},
|
||||
{0x2764U, "<3"},
|
||||
{0xD83DDC4DU, ":like:"},
|
||||
{0xD83DDC4EU, ":dislike:"},
|
||||
{0x261DU, ":up:"},
|
||||
{0x270CU, ":v:"},
|
||||
{0xD83DDC4CU, ":ok:"}
|
||||
};
|
||||
const uint32 replacesCount = sizeof(replaces) / sizeof(EmojiReplace);
|
||||
typedef QMap<QString, uint32> ReplaceMap;
|
||||
@@ -802,8 +802,8 @@ uint64 emojiCategory4[] = {
|
||||
0xD83CDE2FLLU,
|
||||
0xD83CDE33LLU,
|
||||
0xD83CDE35LLU,
|
||||
0xD83CDE32LLU,
|
||||
0xD83CDE34LLU,
|
||||
0xD83CDE32LLU,
|
||||
0xD83CDE50LLU,
|
||||
0xD83CDE39LLU,
|
||||
0xD83CDE3ALLU,
|
||||
@@ -957,6 +957,106 @@ uint64 emojiCategory4[] = {
|
||||
0xD83DDD39LLU,
|
||||
};
|
||||
|
||||
uint64 emojiPostfixed[] = {
|
||||
0x203CLLU,
|
||||
0x2049LLU,
|
||||
0x2139LLU,
|
||||
0x2194LLU,
|
||||
0x2195LLU,
|
||||
0x2196LLU,
|
||||
0x2197LLU,
|
||||
0x2198LLU,
|
||||
0x2199LLU,
|
||||
0x21A9LLU,
|
||||
0x21AALLU,
|
||||
0x231ALLU,
|
||||
0x231BLLU,
|
||||
0x24C2LLU,
|
||||
0x25AALLU,
|
||||
0x25ABLLU,
|
||||
0x25B6LLU,
|
||||
0x25C0LLU,
|
||||
0x25FBLLU,
|
||||
0x25FCLLU,
|
||||
0x25FDLLU,
|
||||
0x25FELLU,
|
||||
0x2600LLU,
|
||||
0x2601LLU,
|
||||
0x260ELLU,
|
||||
0x2611LLU,
|
||||
0x2614LLU,
|
||||
0x2615LLU,
|
||||
0x261DLLU,
|
||||
0x263ALLU,
|
||||
0x2648LLU,
|
||||
0x2649LLU,
|
||||
0x264ALLU,
|
||||
0x264BLLU,
|
||||
0x264CLLU,
|
||||
0x264DLLU,
|
||||
0x264ELLU,
|
||||
0x264FLLU,
|
||||
0x2650LLU,
|
||||
0x2651LLU,
|
||||
0x2652LLU,
|
||||
0x2653LLU,
|
||||
0x2660LLU,
|
||||
0x2663LLU,
|
||||
0x2665LLU,
|
||||
0x2666LLU,
|
||||
0x2668LLU,
|
||||
0x267BLLU,
|
||||
0x267FLLU,
|
||||
0x2693LLU,
|
||||
0x26A0LLU,
|
||||
0x26A1LLU,
|
||||
0x26AALLU,
|
||||
0x26ABLLU,
|
||||
0x26BDLLU,
|
||||
0x26BELLU,
|
||||
0x26C4LLU,
|
||||
0x26C5LLU,
|
||||
0x26D4LLU,
|
||||
0x26EALLU,
|
||||
0x26F2LLU,
|
||||
0x26F3LLU,
|
||||
0x26F5LLU,
|
||||
0x26FALLU,
|
||||
0x26FDLLU,
|
||||
0x2702LLU,
|
||||
0x2708LLU,
|
||||
0x2709LLU,
|
||||
0x270CLLU,
|
||||
0x270FLLU,
|
||||
0x2712LLU,
|
||||
0x2714LLU,
|
||||
0x2716LLU,
|
||||
0x2733LLU,
|
||||
0x2734LLU,
|
||||
0x2744LLU,
|
||||
0x2747LLU,
|
||||
0x2757LLU,
|
||||
0x2764LLU,
|
||||
0x27A1LLU,
|
||||
0x2934LLU,
|
||||
0x2935LLU,
|
||||
0x2B05LLU,
|
||||
0x2B06LLU,
|
||||
0x2B07LLU,
|
||||
0x2B50LLU,
|
||||
0x2B55LLU,
|
||||
0x2B1BLLU,
|
||||
0x2B1CLLU,
|
||||
0x303DLLU,
|
||||
0x3297LLU,
|
||||
0x3299LLU,
|
||||
0xD83CDC04LLU,
|
||||
0xD83CDD7FLLU,
|
||||
0xD83CDE1ALLU,
|
||||
0xD83CDE2FLLU,
|
||||
};
|
||||
QMap<uint64, bool> emojiWithPostfixes;
|
||||
|
||||
uint32 firstCode(uint64 fullCode) {
|
||||
return (fullCode > 0xFFFFFFFFLLU) ? uint32(fullCode >> 32) : (fullCode & 0xFFFFFFFFU);
|
||||
}
|
||||
@@ -990,7 +1090,7 @@ void writeEmojiCategory(QTextStream &tcpp, uint64 *emojiCategory, uint32 size, c
|
||||
|
||||
bool genEmoji(QString emoji_in, const QString &emoji_out, const QString &emoji_png) {
|
||||
int currentRow = 0, currentColumn = 0;
|
||||
uint32 min1 = 0xFFFFFFFF, max1 = 0, min2 = 0xFFFFFFFF, max2 = 0;
|
||||
uint32 min1 = 0xFFFFFFFFU, max1 = 0, min2 = 0xFFFFFFFFU, max2 = 0;
|
||||
|
||||
QImage sprites[5];
|
||||
int emojisInRow[] = { 27, 29, 33, 34, 34 }; // [[7,27],[4,29],[7,33],[3,34],[6,34]]
|
||||
@@ -1109,6 +1209,10 @@ bool genEmoji(QString emoji_in, const QString &emoji_out, const QString &emoji_p
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0, l = sizeof(emojiPostfixed) / sizeof(emojiPostfixed[0]); i < l; ++i) {
|
||||
emojiWithPostfixes.insert(emojiPostfixed[i], true);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
QByteArray cppText;
|
||||
@@ -1121,7 +1225,7 @@ Created from emoji config by \'/MetaEmoji\' project\n\
|
||||
WARNING! All changes made in this file will be lost!\n\
|
||||
\n\
|
||||
This file is part of Telegram Desktop, \n\
|
||||
an unofficial desktop messaging app, see https://telegram.org\n\
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org\n\
|
||||
\n\
|
||||
Telegram Desktop is free software: you can redistribute it and/or modify\n\
|
||||
it under the terms of the GNU General Public License as published by\n\
|
||||
@@ -1134,7 +1238,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
|
||||
GNU General Public License for more details.\n\
|
||||
\n\
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com\n\
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org\n\
|
||||
*/\n";
|
||||
tcpp << "#include \"stdafx.h\"\n#include \"gui/emoji_config.h\"\n\n";
|
||||
|
||||
@@ -1149,7 +1253,8 @@ Copyright (c) 2014 John Preston, https://tdesktop.com\n\
|
||||
tcpp << "\tEmojiData *toFill = emojis = (EmojiData*)emojisData;\n\n";
|
||||
for (EmojisData::const_iterator i = emojisData.cbegin(), e = emojisData.cend(); i != e; ++i) {
|
||||
int len = i->code2 ? 4 : ((i->code >> 16) ? 2 : 1);
|
||||
tcpp << "\tnew (toFill++) EmojiData(" << (i->x * imSize) << ", " << (i->y * imSize) << ", 0x" << QString("%1").arg(i->code, 0, 16).toUpper().toUtf8().constData() << "U, 0x" << QString("%1").arg(i->code2, 0, 16).toUpper().toUtf8().constData() << "U, " << len << ");\n";
|
||||
bool withPostfix = emojiWithPostfixes.constFind(i->code) != emojiWithPostfixes.constEnd();
|
||||
tcpp << "\tnew (toFill++) EmojiData(" << (i->x * imSize) << ", " << (i->y * imSize) << ", 0x" << QString("%1").arg(i->code, 0, 16).toUpper().toUtf8().constData() << "U, 0x" << QString("%1").arg(i->code2, 0, 16).toUpper().toUtf8().constData() << "U, " << len << (withPostfix ? ", 0xFE0F" : "") << ");\n";
|
||||
}
|
||||
tcpp << "}\n\n";
|
||||
}
|
||||
@@ -1248,7 +1353,7 @@ Copyright (c) 2014 John Preston, https://tdesktop.com\n\
|
||||
}
|
||||
tcpp << tab.repeated(1 + chars.size()) << "newEmojiEnd = ch + " << chars.size() << ";\n";
|
||||
tcpp << tab.repeated(1 + chars.size()) << "if (newEmojiEnd == e || emojiEdge(newEmojiEnd) || newEmojiEnd->unicode() == ' ') {\n";
|
||||
tcpp << tab.repeated(1 + chars.size()) << "\temojiCode = " << i.value() << "U;\n";
|
||||
tcpp << tab.repeated(1 + chars.size()) << "\temojiCode = 0x" << QString("%1").arg(i.value(), 0, 16).toUpper().toUtf8().constData() << "U;\n";
|
||||
tcpp << tab.repeated(1 + chars.size()) << "\treturn;\n";
|
||||
tcpp << tab.repeated(1 + chars.size()) << "}\n";
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QVector>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "genlang.h"
|
||||
|
||||
@@ -220,7 +220,7 @@ Created from \'/Resources/lang.txt\' by \'/MetaLang\' project\n\
|
||||
WARNING! All changes made in this file will be lost!\n\
|
||||
\n\
|
||||
This file is part of Telegram Desktop,\n\
|
||||
an unofficial desktop messaging app, see https://telegram.org\n\
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org\n\
|
||||
\n\
|
||||
Telegram Desktop is free software: you can redistribute it and/or modify\n\
|
||||
it under the terms of the GNU General Public License as published by\n\
|
||||
@@ -233,7 +233,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
|
||||
GNU General Public License for more details.\n\
|
||||
\n\
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com\n\
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org\n\
|
||||
*/\n";
|
||||
th << "#pragma once\n\n";
|
||||
th << "enum LangKey {\n";
|
||||
@@ -251,6 +251,10 @@ Copyright (c) 2014 John Preston, https://tdesktop.com\n\
|
||||
th << "\tint32 day = date.dayOfWeek();\n";
|
||||
th << "\treturn (day > 0 && day <= 7) ? lang(LangKey(lng_weekday1 + day - 1)) : qsl(\"{err}\");\n";
|
||||
th << "}\n\n";
|
||||
th << "inline QString langDayOfWeekFull(const QDate &date) {\n";
|
||||
th << "\tint32 day = date.dayOfWeek();\n";
|
||||
th << "\treturn (day > 0 && day <= 7) ? lang(LangKey(lng_weekday1_full + day - 1)) : qsl(\"{err}\");\n";
|
||||
th << "}\n\n";
|
||||
th << "Qt::LayoutDirection langDir();\n\n";
|
||||
th << "class LangLoader {\n";
|
||||
th << "public:\n";
|
||||
@@ -283,7 +287,7 @@ Created from \'/Resources/lang.txt\' by \'/MetaLang\' project\n\
|
||||
WARNING! All changes made in this file will be lost!\n\
|
||||
\n\
|
||||
This file is part of Telegram Desktop,\n\
|
||||
an unofficial desktop messaging app, see https://telegram.org\n\
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org\n\
|
||||
\n\
|
||||
Telegram Desktop is free software: you can redistribute it and/or modify\n\
|
||||
it under the terms of the GNU General Public License as published by\n\
|
||||
@@ -296,7 +300,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
|
||||
GNU General Public License for more details.\n\
|
||||
\n\
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com\n\
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org\n\
|
||||
*/\n";
|
||||
tcpp << "#include \"stdafx.h\"\n#include \"lang.h\"\n\n";
|
||||
tcpp << "namespace {\n";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QVector>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "genstyles.h"
|
||||
|
||||
@@ -361,7 +361,7 @@ Created from \'/Resources/style_classes.txt\' by \'/MetaStyle\' project\n\
|
||||
WARNING! All changes made in this file will be lost!\n\
|
||||
\n\
|
||||
This file is part of Telegram Desktop,\n\
|
||||
an unofficial desktop messaging app, see https://telegram.org\n\
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org\n\
|
||||
\n\
|
||||
Telegram Desktop is free software: you can redistribute it and/or modify\n\
|
||||
it under the terms of the GNU General Public License as published by\n\
|
||||
@@ -374,7 +374,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
|
||||
GNU General Public License for more details.\n\
|
||||
\n\
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com\n\
|
||||
Copyright (c) 2014 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) {
|
||||
@@ -1498,7 +1498,7 @@ Created from \'/Resources/style.txt\' by \'/MetaStyle\' project\n\
|
||||
WARNING! All changes made in this file will be lost!\n\
|
||||
\n\
|
||||
This file is part of Telegram Desktop,\n\
|
||||
an unofficial desktop messaging app, see https://telegram.org\n\
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org\n\
|
||||
\n\
|
||||
Telegram Desktop is free software: you can redistribute it and/or modify\n\
|
||||
it under the terms of the GNU General Public License as published by\n\
|
||||
@@ -1511,7 +1511,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
|
||||
GNU General Public License for more details.\n\
|
||||
\n\
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com\n\
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org\n\
|
||||
*/\n";
|
||||
tout << "#pragma once\n\n#include \"style.h\"\n\nnamespace st {\n";
|
||||
tcpp << "\
|
||||
@@ -1521,7 +1521,7 @@ Created from \'/Resources/style.txt\' by \'/MetaStyle\' project\n\
|
||||
WARNING! All changes made in this file will be lost!\n\
|
||||
\n\
|
||||
This file is part of Telegram Desktop,\n\
|
||||
an unofficial desktop messaging app, see https://telegram.org\n\
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org\n\
|
||||
\n\
|
||||
Telegram Desktop is free software: you can redistribute it and/or modify\n\
|
||||
it under the terms of the GNU General Public License as published by\n\
|
||||
@@ -1534,7 +1534,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
|
||||
GNU General Public License for more details.\n\
|
||||
\n\
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com\n\
|
||||
Copyright (c) 2014 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) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QVector>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "memain.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "mlmain.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "msmain.h"
|
||||
#include <QtCore/QDir>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "packer.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "prepare.h"
|
||||
|
||||
@@ -94,6 +94,5 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
int res = prepare(f, paths);
|
||||
system("PAUSE");
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,13 +13,13 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "updater.h"
|
||||
|
||||
bool _debug = false;
|
||||
|
||||
wstring exeName, exeDir;
|
||||
wstring exeName, exeDir, updateTo;
|
||||
|
||||
bool equal(const wstring &a, const wstring &b) {
|
||||
return !_wcsicmp(a.c_str(), b.c_str());
|
||||
@@ -133,7 +133,7 @@ bool update() {
|
||||
wstring dir = dirs.front();
|
||||
dirs.pop_front();
|
||||
|
||||
wstring toDir = exeDir;
|
||||
wstring toDir = updateTo;
|
||||
if (dir.size() > updDir.size() + 1) {
|
||||
toDir += (dir.substr(updDir.size() + 1) + L"\\");
|
||||
forcedirs.push_back(toDir);
|
||||
@@ -161,7 +161,7 @@ bool update() {
|
||||
}
|
||||
} else {
|
||||
wstring fname = dir + L"\\" + findData.cFileName;
|
||||
wstring tofname = exeDir + fname.substr(updDir.size() + 1);
|
||||
wstring tofname = updateTo + fname.substr(updDir.size() + 1);
|
||||
if (equal(tofname, exeName)) { // bad update - has Updater.exe - delete all dir
|
||||
writeLog(L"Error: bad update, has Updater.exe! '" + tofname + L"' equal '" + exeName + L"'");
|
||||
delFolder();
|
||||
@@ -230,10 +230,9 @@ bool update() {
|
||||
}
|
||||
|
||||
void updateRegistry() {
|
||||
writeLog(L"Updating registry..");
|
||||
|
||||
HANDLE versionFile = CreateFile(L"tdata\\version", GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
HANDLE versionFile = CreateFile((updateTo + L"tdata\\version").c_str(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
if (versionFile != INVALID_HANDLE_VALUE) {
|
||||
writeLog(L"Updating registry..");
|
||||
DWORD versionNum = 0, versionLen = 0, readLen = 0;
|
||||
WCHAR versionStr[32];
|
||||
if (ReadFile(versionFile, &versionNum, sizeof(DWORD), &readLen, NULL) != TRUE || readLen != sizeof(DWORD)) {
|
||||
@@ -284,7 +283,7 @@ void updateRegistry() {
|
||||
wsprintf(dateStr, L"%04d%02d%02d", stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay);
|
||||
RegSetValueEx(rkey, L"InstallDate", 0, REG_SZ, (BYTE*)dateStr, (wcslen(dateStr) + 1) * sizeof(WCHAR));
|
||||
|
||||
WCHAR *appURL = L"https://tdesktop.com";
|
||||
WCHAR *appURL = L"https://desktop.telegram.org";
|
||||
RegSetValueEx(rkey, L"HelpLink", 0, REG_SZ, (BYTE*)appURL, (wcslen(appURL) + 1) * sizeof(WCHAR));
|
||||
RegSetValueEx(rkey, L"URLInfoAbout", 0, REG_SZ, (BYTE*)appURL, (wcslen(appURL) + 1) * sizeof(WCHAR));
|
||||
RegSetValueEx(rkey, L"URLUpdateInfo", 0, REG_SZ, (BYTE*)appURL, (wcslen(appURL) + 1) * sizeof(WCHAR));
|
||||
@@ -296,6 +295,8 @@ void updateRegistry() {
|
||||
RegCloseKey(rkey);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
writeLog(L"Could not open version file to update registry :(");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +314,7 @@ int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParama
|
||||
LPWSTR *args;
|
||||
int argsCount;
|
||||
|
||||
bool needupdate = false, autostart = false, debug = false;
|
||||
bool needupdate = false, autostart = false, debug = false, writeprotected = false;
|
||||
args = CommandLineToArgvW(GetCommandLine(), &argsCount);
|
||||
if (args) {
|
||||
for (int i = 1; i < argsCount; ++i) {
|
||||
@@ -324,10 +325,19 @@ int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParama
|
||||
} else if (equal(args[i], L"-debug")) {
|
||||
debug = _debug = true;
|
||||
openLog();
|
||||
} else if (equal(args[i], L"-writeprotected") && ++i < argsCount) {
|
||||
writeprotected = true;
|
||||
updateTo = args[i];
|
||||
for (int i = 0, l = updateTo.size(); i < l; ++i) {
|
||||
if (updateTo[i] == L'/') {
|
||||
updateTo[i] = L'\\';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (needupdate) writeLog(L"Need to update!");
|
||||
if (autostart) writeLog(L"From autostart!");
|
||||
if (writeprotected) writeLog(L"Write Protected folder!");
|
||||
|
||||
exeName = args[0];
|
||||
writeLog(L"Exe name is: " + exeName);
|
||||
@@ -335,9 +345,20 @@ int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParama
|
||||
if (equal(exeName.substr(exeName.size() - 11), L"Updater.exe")) {
|
||||
exeDir = exeName.substr(0, exeName.size() - 11);
|
||||
writeLog(L"Exe dir is: " + exeDir);
|
||||
if (!writeprotected) {
|
||||
updateTo = exeDir;
|
||||
}
|
||||
writeLog(L"Update to: " + updateTo);
|
||||
if (needupdate && update()) {
|
||||
updateRegistry();
|
||||
}
|
||||
if (writeprotected) { // if we can't clear all tupdates\ready (Updater.exe is there) - clear only version
|
||||
if (DeleteFile(L"tupdates\\ready\\tdata\\version")) {
|
||||
writeLog(L"Version file deleted!");
|
||||
} else {
|
||||
writeLog(L"Error: could not delete version file");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
writeLog(L"Error: bad exe name!");
|
||||
}
|
||||
@@ -349,11 +370,56 @@ int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParama
|
||||
writeLog(L"Error: No command line arguments!");
|
||||
}
|
||||
|
||||
wstring targs = L"-noupdate";
|
||||
wstring targs;
|
||||
if (autostart) targs += L" -autostart";
|
||||
if (debug) targs += L" -debug";
|
||||
|
||||
ShellExecute(0, 0, (exeDir + L"Telegram.exe").c_str(), targs.c_str(), 0, SW_SHOWNORMAL);
|
||||
bool executed = false;
|
||||
if (writeprotected) { // run un-elevated
|
||||
writeLog(L"Trying to run un-elevated by temp.lnk");
|
||||
|
||||
HRESULT hres = CoInitialize(0);
|
||||
if (SUCCEEDED(hres)) {
|
||||
wstring lnk = L"tupdates\\ready\\temp.lnk";
|
||||
IShellLink* psl;
|
||||
HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&psl);
|
||||
if (SUCCEEDED(hres)) {
|
||||
IPersistFile* ppf;
|
||||
|
||||
wstring exe = updateTo + L"Telegram.exe", dir = updateTo;
|
||||
psl->SetArguments((targs.size() ? targs.substr(1) : targs).c_str());
|
||||
psl->SetPath(exe.c_str());
|
||||
psl->SetWorkingDirectory(dir.c_str());
|
||||
psl->SetDescription(L"");
|
||||
|
||||
hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);
|
||||
|
||||
if (SUCCEEDED(hres)) {
|
||||
hres = ppf->Save(lnk.c_str(), TRUE);
|
||||
ppf->Release();
|
||||
|
||||
if (SUCCEEDED(hres)) {
|
||||
writeLog(L"Executing un-elevated through link..");
|
||||
ShellExecute(0, 0, L"explorer.exe", lnk.c_str(), 0, SW_SHOWNORMAL);
|
||||
executed = true;
|
||||
} else {
|
||||
writeLog(L"Error: ppf->Save failed");
|
||||
}
|
||||
} else {
|
||||
writeLog(L"Error: Could not create interface IID_IPersistFile");
|
||||
}
|
||||
psl->Release();
|
||||
} else {
|
||||
writeLog(L"Error: could not create instance of IID_IShellLink");
|
||||
}
|
||||
CoUninitialize();
|
||||
} else {
|
||||
writeLog(L"Error: Could not initialize COM");
|
||||
}
|
||||
}
|
||||
if (!executed) {
|
||||
ShellExecute(0, 0, (updateTo + L"Telegram.exe").c_str(), (L"-noupdate" + targs).c_str(), 0, SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
writeLog(L"Executed Telegram.exe, closing log and quiting..");
|
||||
closeLog();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include <cstdio>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@@ -64,11 +64,17 @@ int main(int argc, const char * argv[]) {
|
||||
if (!path) {
|
||||
return -1;
|
||||
}
|
||||
NSRange range = [path rangeOfString:appName options:NSBackwardsSearch];
|
||||
NSRange range = [path rangeOfString:@".app/" options:NSBackwardsSearch];
|
||||
if (range.location == NSNotFound) {
|
||||
return -1;
|
||||
}
|
||||
appDir = [path substringToIndex:range.location > 0 ? range.location : 0];
|
||||
path = [path substringToIndex:range.location > 0 ? range.location : 0];
|
||||
|
||||
range = [path rangeOfString:@"/" options:NSBackwardsSearch];
|
||||
NSString *appRealName = (range.location == NSNotFound) ? path : [path substringFromIndex:range.location + 1];
|
||||
appRealName = [[NSArray arrayWithObjects:appRealName, @".app", nil] componentsJoinedByString:@""];
|
||||
appDir = (range.location == NSNotFound) ? @"" : [path substringToIndex:range.location + 1];
|
||||
NSString *appDirFull = [appDir stringByAppendingString:appRealName];
|
||||
|
||||
openLog();
|
||||
pid_t procId = 0;
|
||||
@@ -144,11 +150,12 @@ int main(int argc, const char * argv[]) {
|
||||
break;
|
||||
}
|
||||
NSString *pathPart = [srcPath substringFromIndex:r.length];
|
||||
if ([pathPart rangeOfString:appName].location != 0) {
|
||||
r = [pathPart rangeOfString:appName];
|
||||
if (r.location != 0) {
|
||||
writeLog([@"Skipping not app file " stringByAppendingString:srcPath]);
|
||||
continue;
|
||||
}
|
||||
NSString *dstPath = [appDir stringByAppendingString:pathPart];
|
||||
NSString *dstPath = [appDirFull stringByAppendingString:[pathPart substringFromIndex:r.length]];
|
||||
NSError *error;
|
||||
NSNumber *isDirectory = nil;
|
||||
writeLog([[NSArray arrayWithObjects: @"Copying file ", srcPath, @" to ", dstPath, nil] componentsJoinedByString:@""]);
|
||||
@@ -180,7 +187,7 @@ int main(int argc, const char * argv[]) {
|
||||
delFolder();
|
||||
}
|
||||
|
||||
NSString *appPath = [[NSArray arrayWithObjects:appDir, appName, nil] componentsJoinedByString:@""];
|
||||
NSString *appPath = [[NSArray arrayWithObjects:appDir, appRealName, nil] componentsJoinedByString:@""];
|
||||
NSMutableArray *args = [[NSMutableArray alloc] initWithObjects:@"-noupdate", nil];
|
||||
if (toSettings) [args addObject:@"-tosettings"];
|
||||
if (_debug) [args addObject:@"-debug"];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "lang.h"
|
||||
@@ -26,6 +26,8 @@ Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
#include "mainwidget.h"
|
||||
#include <libexif/exif-data.h>
|
||||
|
||||
#include "localstorage.h"
|
||||
|
||||
namespace {
|
||||
bool quiting = false;
|
||||
|
||||
@@ -43,6 +45,9 @@ namespace {
|
||||
typedef QHash<AudioId, AudioData*> AudiosData;
|
||||
AudiosData audiosData;
|
||||
|
||||
typedef QHash<QString, ImageLinkData*> ImageLinksData;
|
||||
ImageLinksData imageLinksData;
|
||||
|
||||
typedef QHash<DocumentId, DocumentData*> DocumentsData;
|
||||
DocumentsData documentsData;
|
||||
|
||||
@@ -111,7 +116,7 @@ namespace App {
|
||||
bool loggedOut() {
|
||||
Window *w(wnd());
|
||||
if (w) {
|
||||
w->tempDirDelete();
|
||||
w->tempDirDelete(Local::ClearManagerAll);
|
||||
w->notifyClearFast();
|
||||
w->setupIntro(true);
|
||||
}
|
||||
@@ -162,6 +167,31 @@ namespace App {
|
||||
return (peer_id & 0x100000000L) ? int32(peer_id & 0xFFFFFFFFL) : 0;
|
||||
}
|
||||
|
||||
int32 onlineForSort(int32 online, int32 now) {
|
||||
if (online <= 0) {
|
||||
switch (online) {
|
||||
case -2: {
|
||||
QDate yesterday(date(now).date());
|
||||
yesterday.addDays(-3);
|
||||
return int32(QDateTime(yesterday).toTime_t());
|
||||
} break;
|
||||
|
||||
case -3: {
|
||||
QDate weekago(date(now).date());
|
||||
weekago.addDays(-7);
|
||||
return int32(QDateTime(weekago).toTime_t());
|
||||
} break;
|
||||
|
||||
case -4: {
|
||||
QDate monthago(date(now).date());
|
||||
monthago.addDays(-30);
|
||||
return int32(QDateTime(monthago).toTime_t());
|
||||
} break;
|
||||
}
|
||||
}
|
||||
return online;
|
||||
}
|
||||
|
||||
int32 onlineWillChangeIn(int32 online, int32 now) {
|
||||
if (online <= 0) return 86400;
|
||||
if (online > now) {
|
||||
@@ -179,9 +209,20 @@ namespace App {
|
||||
return dNow.secsTo(dTomorrow);
|
||||
}
|
||||
|
||||
QString onlineText(int32 online, int32 now, bool precise) {
|
||||
if (!online) return lang(lng_status_offline);
|
||||
if (online < 0) return lang(lng_status_invisible);
|
||||
QString onlineText(UserData *user, int32 now, bool precise) {
|
||||
if (isServiceUser(user->id)) {
|
||||
return lang(lng_status_service_notifications);
|
||||
}
|
||||
int32 online = user->onlineTill;
|
||||
if (online <= 0) {
|
||||
switch (online) {
|
||||
case 0: return lang(lng_status_offline);
|
||||
case -2: return lang(lng_status_recently);
|
||||
case -3: return lang(lng_status_last_week);
|
||||
case -4: return lang(lng_status_last_month);
|
||||
}
|
||||
return lang(lng_status_invisible);
|
||||
}
|
||||
if (online > now) {
|
||||
return lang(lng_status_online);
|
||||
}
|
||||
@@ -224,11 +265,12 @@ namespace App {
|
||||
return lang(lng_status_lastseen).replace(qsl("{when}"), when);
|
||||
}
|
||||
|
||||
void feedUsers(const MTPVector<MTPUser> &users) {
|
||||
UserData *feedUsers(const MTPVector<MTPUser> &users) {
|
||||
UserData *data = 0;
|
||||
const QVector<MTPUser> &v(users.c_vector().v);
|
||||
for (QVector<MTPUser>::const_iterator i = v.cbegin(), e = v.cend(); i != e; ++i) {
|
||||
const MTPuser &user(*i);
|
||||
UserData *data = 0;
|
||||
data = 0;
|
||||
bool wasContact = false;
|
||||
const MTPUserStatus *status = 0;
|
||||
|
||||
@@ -240,7 +282,7 @@ namespace App {
|
||||
data = App::user(peer);
|
||||
data->input = MTP_inputPeerContact(d.vid);
|
||||
data->inputUser = MTP_inputUserContact(d.vid);
|
||||
data->setName(lang(lng_deleted), QString(), QString());
|
||||
data->setName(lang(lng_deleted), QString(), QString(), QString());
|
||||
data->setPhoto(MTP_userProfilePhotoEmpty());
|
||||
data->access = 0;
|
||||
wasContact = (data->contact > 0);
|
||||
@@ -253,7 +295,7 @@ namespace App {
|
||||
data = App::user(peer);
|
||||
data->input = MTP_inputPeerContact(d.vid);
|
||||
data->inputUser = MTP_inputUserContact(d.vid);
|
||||
data->setName(textOneLine(qs(d.vfirst_name)), textOneLine(qs(d.vlast_name)), QString());
|
||||
data->setName(textOneLine(qs(d.vfirst_name)), textOneLine(qs(d.vlast_name)), QString(), textOneLine(qs(d.vusername)));
|
||||
data->setPhoto(MTP_userProfilePhotoEmpty());
|
||||
data->access = 0;
|
||||
wasContact = (data->contact > 0);
|
||||
@@ -266,7 +308,7 @@ namespace App {
|
||||
data = App::user(peer);
|
||||
data->input = MTP_inputPeerSelf();
|
||||
data->inputUser = MTP_inputUserSelf();
|
||||
data->setName(textOneLine(qs(d.vfirst_name)), textOneLine(qs(d.vlast_name)), QString());
|
||||
data->setName(textOneLine(qs(d.vfirst_name)), textOneLine(qs(d.vlast_name)), QString(), textOneLine(qs(d.vusername)));
|
||||
data->setPhoto(d.vphoto);
|
||||
data->setPhone(qs(d.vphone));
|
||||
data->access = 0;
|
||||
@@ -274,7 +316,10 @@ namespace App {
|
||||
data->contact = -1;
|
||||
status = &d.vstatus;
|
||||
|
||||
::self = data;
|
||||
if (::self != data) {
|
||||
::self = data;
|
||||
if (App::wnd()) App::wnd()->updateGlobalMenu();
|
||||
}
|
||||
} break;
|
||||
case mtpc_userContact: {
|
||||
const MTPDuserContact &d(user.c_userContact());
|
||||
@@ -283,7 +328,7 @@ namespace App {
|
||||
data = App::user(peer);
|
||||
data->input = MTP_inputPeerContact(d.vid);
|
||||
data->inputUser = MTP_inputUserContact(d.vid);
|
||||
data->setName(textOneLine(qs(d.vfirst_name)), textOneLine(qs(d.vlast_name)), QString());
|
||||
data->setName(textOneLine(qs(d.vfirst_name)), textOneLine(qs(d.vlast_name)), QString(), textOneLine(qs(d.vusername)));
|
||||
data->setPhoto(d.vphoto);
|
||||
data->setPhone(qs(d.vphone));
|
||||
data->access = d.vaccess_hash.v;
|
||||
@@ -299,7 +344,7 @@ namespace App {
|
||||
data->input = MTP_inputPeerForeign(d.vid, d.vaccess_hash);
|
||||
data->inputUser = MTP_inputUserForeign(d.vid, d.vaccess_hash);
|
||||
data->setPhone(qs(d.vphone));
|
||||
data->setName(textOneLine(qs(d.vfirst_name)), textOneLine(qs(d.vlast_name)), (data->id != 333000 && !data->phone.isEmpty()) ? formatPhone(data->phone) : QString());
|
||||
data->setName(textOneLine(qs(d.vfirst_name)), textOneLine(qs(d.vlast_name)), (!isServiceUser(data->id) && !data->phone.isEmpty()) ? formatPhone(data->phone) : QString(), textOneLine(qs(d.vusername)));
|
||||
data->setPhoto(d.vphoto);
|
||||
data->access = d.vaccess_hash.v;
|
||||
wasContact = (data->contact > 0);
|
||||
@@ -313,7 +358,7 @@ namespace App {
|
||||
data = App::user(peer);
|
||||
data->input = MTP_inputPeerForeign(d.vid, d.vaccess_hash);
|
||||
data->inputUser = MTP_inputUserForeign(d.vid, d.vaccess_hash);
|
||||
data->setName(textOneLine(qs(d.vfirst_name)), textOneLine(qs(d.vlast_name)), QString());
|
||||
data->setName(textOneLine(qs(d.vfirst_name)), textOneLine(qs(d.vlast_name)), QString(), textOneLine(qs(d.vusername)));
|
||||
data->setPhoto(d.vphoto);
|
||||
data->access = d.vaccess_hash.v;
|
||||
wasContact = (data->contact > 0);
|
||||
@@ -326,6 +371,10 @@ namespace App {
|
||||
|
||||
data->loaded = true;
|
||||
if (status) switch (status->type()) {
|
||||
case mtpc_userStatusEmpty: data->onlineTill = 0; break;
|
||||
case mtpc_userStatusRecently: data->onlineTill = -2; break;
|
||||
case mtpc_userStatusLastWeek: data->onlineTill = -3; break;
|
||||
case mtpc_userStatusLastMonth: data->onlineTill = -4; break;
|
||||
case mtpc_userStatusOffline: data->onlineTill = status->c_userStatusOffline().vwas_online.v; break;
|
||||
case mtpc_userStatusOnline: data->onlineTill = status->c_userStatusOnline().vexpires.v; break;
|
||||
}
|
||||
@@ -341,6 +390,8 @@ namespace App {
|
||||
|
||||
if (App::main()) App::main()->peerUpdated(data);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void feedChats(const MTPVector<MTPChat> &chats) {
|
||||
@@ -405,7 +456,7 @@ namespace App {
|
||||
if (!data) continue;
|
||||
|
||||
data->loaded = true;
|
||||
data->updateName(title.trimmed(), QString());
|
||||
data->updateName(title.trimmed(), QString(), QString());
|
||||
|
||||
if (App::main()) App::main()->peerUpdated(data);
|
||||
}
|
||||
@@ -531,7 +582,7 @@ namespace App {
|
||||
const MTPDphotoSize &d(size.c_photoSize());
|
||||
if (d.vlocation.type() == mtpc_fileLocation) {
|
||||
const MTPDfileLocation &l(d.vlocation.c_fileLocation());
|
||||
return ImagePtr(d.vw.v, d.vh.v, l.vdc_id.v, l.vvolume_id.v, l.vlocal_id.v, l.vsecret.v);
|
||||
return ImagePtr(d.vw.v, d.vh.v, l.vdc_id.v, l.vvolume_id.v, l.vlocal_id.v, l.vsecret.v, d.vsize.v);
|
||||
}
|
||||
} break;
|
||||
case mtpc_photoCachedSize: {
|
||||
@@ -561,20 +612,27 @@ namespace App {
|
||||
}
|
||||
|
||||
void feedWereDeleted(const QVector<MTPint> &msgsIds) {
|
||||
bool resized = false;
|
||||
for (QVector<MTPint>::const_iterator i = msgsIds.cbegin(), e = msgsIds.cend(); i != e; ++i) {
|
||||
MsgsData::const_iterator j = msgsData.constFind(i->v);
|
||||
if (j != msgsData.cend()) {
|
||||
History *h = (*j)->history();
|
||||
(*j)->destroy();
|
||||
if (App::main() && h->peer == App::main()->peer()) {
|
||||
resized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (resized) {
|
||||
App::main()->itemResized(0);
|
||||
}
|
||||
}
|
||||
|
||||
void feedUserLinks(const MTPVector<MTPcontacts_Link> &links) {
|
||||
const QVector<MTPcontacts_Link> &v(links.c_vector().v);
|
||||
for (QVector<MTPcontacts_Link>::const_iterator i = v.cbegin(), e = v.cend(); i != e; ++i) {
|
||||
const MTPDcontacts_link &dv(i->c_contacts_link());
|
||||
feedUsers(MTP_vector<MTPUser>(QVector<MTPUser>(1, dv.vuser)));
|
||||
feedUsers(MTP_vector<MTPUser>(1, dv.vuser));
|
||||
MTPint userId(MTP_int(0));
|
||||
switch (dv.vuser.type()) {
|
||||
case mtpc_userEmpty: userId = dv.vuser.c_userEmpty().vid; break;
|
||||
@@ -619,13 +677,13 @@ namespace App {
|
||||
if (user->contact > 0) {
|
||||
if (!wasContact) {
|
||||
App::main()->addNewContact(App::userFromPeer(user->id), false);
|
||||
user->input = MTP_inputPeerContact(userId);
|
||||
user->inputUser = MTP_inputUserContact(userId);
|
||||
if (user->input.type() != mtpc_inputPeerSelf) user->input = MTP_inputPeerContact(userId);
|
||||
if (user->inputUser.type() != mtpc_inputUserSelf) user->inputUser = MTP_inputUserContact(userId);
|
||||
}
|
||||
} else {
|
||||
if (user->access) {
|
||||
user->input = MTP_inputPeerForeign(userId, MTP_long(user->access));
|
||||
user->inputUser = MTP_inputUserForeign(userId, MTP_long(user->access));
|
||||
if (user->input.type() != mtpc_inputPeerSelf) user->input = MTP_inputPeerForeign(userId, MTP_long(user->access));
|
||||
if (user->inputUser.type() != mtpc_inputUserSelf) user->inputUser = MTP_inputUserForeign(userId, MTP_long(user->access));
|
||||
}
|
||||
if (user->contact < 0 && !user->phone.isEmpty() && App::userFromPeer(user->id) != MTP::authedId()) {
|
||||
user->contact = 0;
|
||||
@@ -634,7 +692,7 @@ namespace App {
|
||||
App::main()->removeContact(user);
|
||||
}
|
||||
}
|
||||
user->setName(textOneLine(user->firstName), textOneLine(user->lastName), (user->contact || user->id == 333000 || user->phone.isEmpty()) ? QString() : App::formatPhone(user->phone));
|
||||
user->setName(textOneLine(user->firstName), textOneLine(user->lastName), (user->contact || isServiceUser(user->id) || user->phone.isEmpty()) ? QString() : App::formatPhone(user->phone), textOneLine(user->username));
|
||||
if (App::main()) App::main()->peerUpdated(user);
|
||||
}
|
||||
}
|
||||
@@ -673,8 +731,8 @@ namespace App {
|
||||
switch (i.key()) {
|
||||
case 's': newThumbLevel = 0; newMediumLevel = 5; newFullLevel = 4; break; // box 100x100
|
||||
case 'm': newThumbLevel = 2; newMediumLevel = 0; newFullLevel = 3; break; // box 320x320
|
||||
case 'x': newThumbLevel = 5; newMediumLevel = 3; newFullLevel = 0; break; // box 800x800
|
||||
case 'y': newThumbLevel = 6; newMediumLevel = 6; newFullLevel = 1; break; // box 1280x1280
|
||||
case 'x': newThumbLevel = 5; newMediumLevel = 3; newFullLevel = 1; break; // box 800x800
|
||||
case 'y': newThumbLevel = 6; newMediumLevel = 6; newFullLevel = 0; break; // box 1280x1280
|
||||
case 'w': newThumbLevel = 8; newMediumLevel = 8; newFullLevel = 2; break; // box 2560x2560
|
||||
case 'a': newThumbLevel = 1; newMediumLevel = 4; newFullLevel = 8; break; // crop 160x160
|
||||
case 'b': newThumbLevel = 3; newMediumLevel = 1; newFullLevel = 7; break; // crop 320x320
|
||||
@@ -733,8 +791,8 @@ namespace App {
|
||||
switch (size) {
|
||||
case 's': newThumbLevel = 0; newMediumLevel = 5; newFullLevel = 4; break; // box 100x100
|
||||
case 'm': newThumbLevel = 2; newMediumLevel = 0; newFullLevel = 3; break; // box 320x320
|
||||
case 'x': newThumbLevel = 5; newMediumLevel = 3; newFullLevel = 0; break; // box 800x800
|
||||
case 'y': newThumbLevel = 6; newMediumLevel = 6; newFullLevel = 1; break; // box 1280x1280
|
||||
case 'x': newThumbLevel = 5; newMediumLevel = 3; newFullLevel = 1; break; // box 800x800
|
||||
case 'y': newThumbLevel = 6; newMediumLevel = 6; newFullLevel = 0; break; // box 1280x1280
|
||||
case 'w': newThumbLevel = 8; newMediumLevel = 8; newFullLevel = 2; break; // box 2560x2560
|
||||
case 'a': newThumbLevel = 1; newMediumLevel = 4; newFullLevel = 8; break; // crop 160x160
|
||||
case 'b': newThumbLevel = 3; newMediumLevel = 1; newFullLevel = 7; break; // crop 320x320
|
||||
@@ -848,6 +906,15 @@ namespace App {
|
||||
return ::self;
|
||||
}
|
||||
|
||||
UserData *userByName(const QString &username) {
|
||||
for (PeersData::const_iterator i = peersData.cbegin(), e = peersData.cend(); i != e; ++i) {
|
||||
if (!i.value()->chat && !i.value()->asUser()->username.compare(username.trimmed(), Qt::CaseInsensitive)) {
|
||||
return i.value()->asUser();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
ChatData *chat(const PeerId &peer) {
|
||||
PeerData *d = App::peer(peer);
|
||||
return d->asChat();
|
||||
@@ -911,14 +978,6 @@ namespace App {
|
||||
return result;
|
||||
}
|
||||
|
||||
void forgetPhotos() {
|
||||
lastPhotos.clear();
|
||||
lastPhotosMap.clear();
|
||||
for (PhotosData::const_iterator i = photosData.cbegin(), e = photosData.cend(); i != e; ++i) {
|
||||
i.value()->forget();
|
||||
}
|
||||
}
|
||||
|
||||
VideoData *video(const VideoId &video, VideoData *convert, const uint64 &access, int32 user, int32 date, int32 duration, int32 w, int32 h, const ImagePtr &thumb, int32 dc, int32 size) {
|
||||
if (convert) {
|
||||
if (convert->id != video) {
|
||||
@@ -967,12 +1026,6 @@ namespace App {
|
||||
return result;
|
||||
}
|
||||
|
||||
void forgetVideos() {
|
||||
for (VideosData::const_iterator i = videosData.cbegin(), e = videosData.cend(); i != e; ++i) {
|
||||
i.value()->forget();
|
||||
}
|
||||
}
|
||||
|
||||
AudioData *audio(const AudioId &audio, AudioData *convert, const uint64 &access, int32 user, int32 date, int32 duration, int32 dc, int32 size) {
|
||||
if (convert) {
|
||||
if (convert->id != audio) {
|
||||
@@ -1015,12 +1068,6 @@ namespace App {
|
||||
return result;
|
||||
}
|
||||
|
||||
void forgetAudios() {
|
||||
for (AudiosData::const_iterator i = audiosData.cbegin(), e = audiosData.cend(); i != e; ++i) {
|
||||
i.value()->forget();
|
||||
}
|
||||
}
|
||||
|
||||
DocumentData *document(const DocumentId &document, DocumentData *convert, const uint64 &access, int32 user, int32 date, const QString &name, const QString &mime, const ImagePtr &thumb, int32 dc, int32 size) {
|
||||
if (convert) {
|
||||
if (convert->id != document) {
|
||||
@@ -1041,6 +1088,10 @@ namespace App {
|
||||
convert->dc = dc;
|
||||
convert->size = size;
|
||||
}
|
||||
|
||||
if (convert->location.check()) {
|
||||
Local::writeFileLocation(mediaKey(mtpc_inputDocumentFileLocation, convert->dc, convert->id), convert->location);
|
||||
}
|
||||
}
|
||||
DocumentsData::const_iterator i = documentsData.constFind(document);
|
||||
DocumentData *result;
|
||||
@@ -1067,10 +1118,37 @@ namespace App {
|
||||
return result;
|
||||
}
|
||||
|
||||
void forgetDocuments() {
|
||||
ImageLinkData *imageLink(const QString &imageLink, ImageLinkType type, const QString &url) {
|
||||
ImageLinksData::const_iterator i = imageLinksData.constFind(imageLink);
|
||||
ImageLinkData *result;
|
||||
if (i == imageLinksData.cend()) {
|
||||
result = new ImageLinkData(imageLink);
|
||||
imageLinksData.insert(imageLink, result);
|
||||
result->type = type;
|
||||
} else {
|
||||
result = i.value();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void forgetMedia() {
|
||||
lastPhotos.clear();
|
||||
lastPhotosMap.clear();
|
||||
for (PhotosData::const_iterator i = photosData.cbegin(), e = photosData.cend(); i != e; ++i) {
|
||||
i.value()->forget();
|
||||
}
|
||||
for (VideosData::const_iterator i = videosData.cbegin(), e = videosData.cend(); i != e; ++i) {
|
||||
i.value()->forget();
|
||||
}
|
||||
for (AudiosData::const_iterator i = audiosData.cbegin(), e = audiosData.cend(); i != e; ++i) {
|
||||
i.value()->forget();
|
||||
}
|
||||
for (DocumentsData::const_iterator i = documentsData.cbegin(), e = documentsData.cend(); i != e; ++i) {
|
||||
i.value()->forget();
|
||||
}
|
||||
for (ImageLinksData::const_iterator i = imageLinksData.cbegin(), e = imageLinksData.cend(); i != e; ++i) {
|
||||
i.value()->thumb->forget();
|
||||
}
|
||||
}
|
||||
|
||||
MTPPhoto photoFromUserPhoto(MTPint userId, MTPint date, const MTPUserProfilePhoto &photo) {
|
||||
@@ -1116,6 +1194,17 @@ namespace App {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void itemReplaced(HistoryItem *oldItem, HistoryItem *newItem) {
|
||||
newItem->history()->itemReplaced(oldItem, newItem);
|
||||
if (App::main()) App::main()->itemReplaced(oldItem, newItem);
|
||||
if (App::hoveredItem() == oldItem) App::hoveredItem(newItem);
|
||||
if (App::pressedItem() == oldItem) App::pressedItem(newItem);
|
||||
if (App::hoveredLinkItem() == oldItem) App::hoveredLinkItem(newItem);
|
||||
if (App::pressedLinkItem() == oldItem) App::pressedLinkItem(newItem);
|
||||
if (App::contextItem() == oldItem) App::contextItem(newItem);
|
||||
if (App::mousedItem() == oldItem) App::mousedItem(newItem);
|
||||
}
|
||||
|
||||
HistoryItem *historyRegItem(HistoryItem *item) {
|
||||
MsgsData::const_iterator i = msgsData.constFind(item->id);
|
||||
if (i == msgsData.cend()) {
|
||||
@@ -1124,10 +1213,7 @@ namespace App {
|
||||
return 0;
|
||||
}
|
||||
if (i.value() != item && !i.value()->block() && item->block()) { // replace search item
|
||||
item->history()->itemReplaced(i.value(), item);
|
||||
if (App::main()) {
|
||||
emit App::main()->historyItemReplaced(i.value(), item);
|
||||
}
|
||||
itemReplaced(i.value(), item);
|
||||
delete i.value();
|
||||
msgsData.insert(item->id, item);
|
||||
return 0;
|
||||
@@ -1167,8 +1253,8 @@ namespace App {
|
||||
}
|
||||
}
|
||||
historyItemDetached(item);
|
||||
if (App::main()) {
|
||||
emit App::main()->historyItemDeleted(item);
|
||||
if (App::main() && !App::quiting()) {
|
||||
App::main()->itemRemoved(item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1216,6 +1302,7 @@ namespace App {
|
||||
lastPhotos.clear();
|
||||
lastPhotosMap.clear();
|
||||
::self = 0;
|
||||
if (App::wnd()) App::wnd()->updateGlobalMenu();
|
||||
}
|
||||
/* // don't delete history without deleting its' peerdata
|
||||
void deleteHistory(const PeerId &peer) {
|
||||
@@ -1261,10 +1348,6 @@ namespace App {
|
||||
textlnkOver(TextLinkPtr());
|
||||
textlnkDown(TextLinkPtr());
|
||||
|
||||
if (completely && App::main()) {
|
||||
App::main()->disconnect(SIGNAL(historyItemDeleted(HistoryItem *)));
|
||||
}
|
||||
|
||||
histories().clear();
|
||||
|
||||
if (completely) {
|
||||
@@ -1593,7 +1676,7 @@ namespace App {
|
||||
}
|
||||
QByteArray encrypted(16 + fullSize, Qt::Uninitialized); // 128bit of sha1 - key128, sizeof(data), data
|
||||
hashSha1(toEncrypt.constData(), toEncrypt.size(), encrypted.data());
|
||||
aesEncryptLocal(toEncrypt.constData(), encrypted.data() + 16, fullSize, &MTP::localKey(), encrypted.constData());
|
||||
aesEncryptLocal(toEncrypt.constData(), encrypted.data() + 16, fullSize, &Local::oldKey(), encrypted.constData());
|
||||
|
||||
DEBUG_LOG(("App Info: writing user config file"));
|
||||
QDataStream configStream(&configFile);
|
||||
@@ -1644,7 +1727,7 @@ namespace App {
|
||||
}
|
||||
|
||||
cSetLocalSalt(salt);
|
||||
MTP::createLocalKey(QByteArray(), &salt);
|
||||
Local::createOldKey(&salt);
|
||||
|
||||
if (data.size() <= 16 || (data.size() & 0x0F)) {
|
||||
LOG(("App Error: bad encrypted part size: %1").arg(data.size()));
|
||||
@@ -1653,7 +1736,7 @@ namespace App {
|
||||
uint32 fullDataLen = data.size() - 16;
|
||||
decrypted.resize(fullDataLen);
|
||||
const char *dataKey = data.constData(), *encrypted = data.constData() + 16;
|
||||
aesDecryptLocal(encrypted, decrypted.data(), fullDataLen, &MTP::localKey(), dataKey);
|
||||
aesDecryptLocal(encrypted, decrypted.data(), fullDataLen, &Local::oldKey(), dataKey);
|
||||
uchar sha1Buffer[20];
|
||||
if (memcmp(hashSha1(decrypted.constData(), decrypted.size(), sha1Buffer), dataKey, 16)) {
|
||||
LOG(("App Error: bad decrypt key, data from user-config not decrypted"));
|
||||
@@ -1850,17 +1933,14 @@ namespace App {
|
||||
void checkImageCacheSize() {
|
||||
int64 nowImageCacheSize = imageCacheSize();
|
||||
if (nowImageCacheSize > serviceImageCacheSize + MemoryForImageCache) {
|
||||
App::forgetPhotos();
|
||||
App::forgetVideos();
|
||||
App::forgetAudios();
|
||||
App::forgetDocuments();
|
||||
App::forgetMedia();
|
||||
serviceImageCacheSize = imageCacheSize();
|
||||
}
|
||||
}
|
||||
|
||||
bool isValidPhone(QString phone) {
|
||||
phone = phone.replace(QRegularExpression(qsl("[^\\d]")), QString());
|
||||
return phone.length() >= 8 || phone == qsl("777") || phone == qsl("333") || phone == qsl("42") || phone == qsl("111");
|
||||
return phone.length() >= 8 || phone == qsl("777") || phone == qsl("333") || phone == qsl("111") || (phone.startsWith(qsl("42")) && (phone.length() == 2 || phone.length() == 5 || phone == qsl("4242")));
|
||||
}
|
||||
|
||||
void quit() {
|
||||
@@ -1883,8 +1963,7 @@ namespace App {
|
||||
::quiting = true;
|
||||
}
|
||||
|
||||
|
||||
QImage readImage(QByteArray data, QByteArray *format) {
|
||||
QImage readImage(QByteArray data, QByteArray *format, bool opaque) {
|
||||
QByteArray tmpFormat;
|
||||
QImage result;
|
||||
QBuffer buffer(&data);
|
||||
@@ -1920,7 +1999,7 @@ namespace App {
|
||||
}
|
||||
exif_data_free(exifData);
|
||||
}
|
||||
} else {
|
||||
} else if (opaque) {
|
||||
QImage solid(result.width(), result.height(), QImage::Format_ARGB32_Premultiplied);
|
||||
solid.fill(st::white->c);
|
||||
{
|
||||
@@ -1931,12 +2010,12 @@ namespace App {
|
||||
return result;
|
||||
}
|
||||
|
||||
QImage readImage(const QString &file, QByteArray *format) {
|
||||
QImage readImage(const QString &file, QByteArray *format, bool opaque) {
|
||||
QFile f(file);
|
||||
if (!f.open(QIODevice::ReadOnly)) {
|
||||
return QImage();
|
||||
}
|
||||
return readImage(f.readAll(), format);
|
||||
return readImage(f.readAll(), format, opaque);
|
||||
}
|
||||
|
||||
void regVideoItem(VideoData *data, HistoryItem *item) {
|
||||
@@ -1999,4 +2078,16 @@ namespace App {
|
||||
}
|
||||
}
|
||||
|
||||
void openUserByName(const QString &username) {
|
||||
if (App::main()) {
|
||||
App::main()->openUserByName(username);
|
||||
}
|
||||
}
|
||||
|
||||
void openLocalUrl(const QString &url) {
|
||||
if (App::main()) {
|
||||
App::main()->openLocalUrl(url);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@@ -63,10 +63,11 @@ namespace App {
|
||||
int32 userFromPeer(const PeerId &peer_id);
|
||||
int32 chatFromPeer(const PeerId &peer_id);
|
||||
|
||||
int32 onlineForSort(int32 online, int32 now);
|
||||
int32 onlineWillChangeIn(int32 onlineOnServer, int32 nowOnServer);
|
||||
QString onlineText(int32 onlineOnServer, int32 nowOnServer, bool precise = false);
|
||||
QString onlineText(UserData *user, int32 nowOnServer, bool precise = false);
|
||||
|
||||
void feedUsers(const MTPVector<MTPUser> &users);
|
||||
UserData *feedUsers(const MTPVector<MTPUser> &users); // returnes last user
|
||||
void feedChats(const MTPVector<MTPChat> &chats);
|
||||
void feedParticipants(const MTPChatParticipants &p);
|
||||
void feedParticipantAdd(const MTPDupdateChatParticipantAdd &d);
|
||||
@@ -98,17 +99,16 @@ namespace App {
|
||||
UserData *user(const PeerId &peer);
|
||||
UserData *user(int32 user);
|
||||
UserData *self();
|
||||
UserData *userByName(const QString &username);
|
||||
ChatData *chat(const PeerId &peer);
|
||||
ChatData *chat(int32 chat);
|
||||
QString peerName(const PeerData *peer, bool forDialogs = false);
|
||||
PhotoData *photo(const PhotoId &photo, PhotoData *convert = 0, const uint64 &access = 0, int32 user = 0, int32 date = 0, const ImagePtr &thumb = ImagePtr(), const ImagePtr &medium = ImagePtr(), const ImagePtr &full = ImagePtr());
|
||||
void forgetPhotos();
|
||||
VideoData *video(const VideoId &video, VideoData *convert = 0, const uint64 &access = 0, int32 user = 0, int32 date = 0, int32 duration = 0, int32 w = 0, int32 h = 0, const ImagePtr &thumb = ImagePtr(), int32 dc = 0, int32 size = 0);
|
||||
void forgetVideos();
|
||||
AudioData *audio(const AudioId &audio, AudioData *convert = 0, const uint64 &access = 0, int32 user = 0, int32 date = 0, int32 duration = 0, int32 dc = 0, int32 size = 0);
|
||||
void forgetAudios();
|
||||
DocumentData *document(const DocumentId &document, DocumentData *convert = 0, const uint64 &access = 0, int32 user = 0, int32 date = 0, const QString &name = QString(), const QString &mime = QString(), const ImagePtr &thumb = ImagePtr(), int32 dc = 0, int32 size = 0);
|
||||
void forgetDocuments();
|
||||
ImageLinkData *imageLink(const QString &imageLink, ImageLinkType type = InvalidImageLink, const QString &url = QString());
|
||||
void forgetMedia();
|
||||
|
||||
MTPPhoto photoFromUserPhoto(MTPint userId, MTPint date, const MTPUserProfilePhoto &photo);
|
||||
|
||||
@@ -168,9 +168,8 @@ namespace App {
|
||||
bool quiting();
|
||||
void setQuiting();
|
||||
|
||||
|
||||
QImage readImage(QByteArray data, QByteArray *format = 0);
|
||||
QImage readImage(const QString &file, QByteArray *format = 0);
|
||||
QImage readImage(QByteArray data, QByteArray *format = 0, bool opaque = true);
|
||||
QImage readImage(const QString &file, QByteArray *format = 0, bool opaque = true);
|
||||
|
||||
void regVideoItem(VideoData *data, HistoryItem *item);
|
||||
void unregVideoItem(VideoData *data, HistoryItem *item);
|
||||
@@ -188,5 +187,7 @@ namespace App {
|
||||
void setProxySettings(QTcpSocket &socket);
|
||||
|
||||
void searchByHashtag(const QString &tag);
|
||||
void openUserByName(const QString &username);
|
||||
void openLocalUrl(const QString &url);
|
||||
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "application.h"
|
||||
@@ -28,6 +28,8 @@ Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
#include "boxes/confirmbox.h"
|
||||
#include "langloaderplain.h"
|
||||
|
||||
#include "localstorage.h"
|
||||
|
||||
namespace {
|
||||
Application *mainApp = 0;
|
||||
FileUploader *uploader = 0;
|
||||
@@ -87,6 +89,8 @@ Application::Application(int &argc, char **argv) : PsApplication(argc, argv),
|
||||
serverName(psServerPrefix() + cGUIDStr()), closing(false),
|
||||
updateRequestId(0), updateReply(0), updateThread(0), updateDownloader(0) {
|
||||
|
||||
DEBUG_LOG(("Application Info: creation.."));
|
||||
|
||||
QByteArray d(QDir((cPlatform() == dbipWindows ? cExeDir() : cWorkingDir()).toLower()).absolutePath().toUtf8());
|
||||
char h[33] = { 0 };
|
||||
hashMd5Hex(d.constData(), d.size(), h);
|
||||
@@ -100,7 +104,10 @@ Application::Application(int &argc, char **argv) : PsApplication(argc, argv),
|
||||
|
||||
installEventFilter(new _DebugWaiter(this));
|
||||
|
||||
#if defined Q_OS_LINUX || defined Q_OS_LINUX64
|
||||
QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/DejaVuSans.ttf"));
|
||||
QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/NanumMyeongjo-Regular.ttf"));
|
||||
#endif
|
||||
QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Regular.ttf"));
|
||||
QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Bold.ttf"));
|
||||
QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Semibold.ttf"));
|
||||
@@ -131,15 +138,16 @@ Application::Application(int &argc, char **argv) : PsApplication(argc, argv),
|
||||
}
|
||||
}
|
||||
|
||||
Local::start();
|
||||
style::startManager();
|
||||
anim::startManager();
|
||||
historyInit();
|
||||
|
||||
DEBUG_LOG(("Application Info: inited.."));
|
||||
|
||||
window = new Window();
|
||||
|
||||
psInstallEventFilter();
|
||||
|
||||
updateCheckTimer.setSingleShot(true);
|
||||
psInstallEventFilter();
|
||||
|
||||
connect(&socket, SIGNAL(connected()), this, SLOT(socketConnected()));
|
||||
connect(&socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()));
|
||||
@@ -151,10 +159,13 @@ Application::Application(int &argc, char **argv) : PsApplication(argc, argv),
|
||||
connect(&updateCheckTimer, SIGNAL(timeout()), this, SLOT(startUpdateCheck()));
|
||||
connect(this, SIGNAL(updateFailed()), this, SLOT(onUpdateFailed()));
|
||||
connect(this, SIGNAL(updateReady()), this, SLOT(onUpdateReady()));
|
||||
connect(this, SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState)));
|
||||
connect(&writeUserConfigTimer, SIGNAL(timeout()), this, SLOT(onWriteUserConfig()));
|
||||
writeUserConfigTimer.setSingleShot(true);
|
||||
|
||||
if (cManyInstance()) {
|
||||
connect(&killDownloadSessionsTimer, SIGNAL(timeout()), this, SLOT(killDownloadSessions()));
|
||||
|
||||
if (cManyInstance()) {
|
||||
startApp();
|
||||
} else {
|
||||
DEBUG_LOG(("Application Info: connecting local socket to %1..").arg(serverName));
|
||||
@@ -171,6 +182,7 @@ void Application::onAppUpdate(const MTPhelp_AppUpdate &response) {
|
||||
startUpdateCheck();
|
||||
} else {
|
||||
updateThread = new QThread();
|
||||
connect(updateThread, SIGNAL(finished()), updateThread, SLOT(deleteLater()));
|
||||
updateDownloader = new PsUpdateDownloader(updateThread, response.c_help_appUpdate());
|
||||
updateThread->start();
|
||||
}
|
||||
@@ -193,6 +205,7 @@ void Application::updateGotCurrent() {
|
||||
int32 currentVersion = m.captured(1).toInt();
|
||||
if (currentVersion > AppVersion) {
|
||||
updateThread = new QThread();
|
||||
connect(updateThread, SIGNAL(finished()), updateThread, SLOT(deleteLater()));
|
||||
updateDownloader = new PsUpdateDownloader(updateThread, m.captured(2));
|
||||
updateThread->start();
|
||||
}
|
||||
@@ -239,7 +252,7 @@ void Application::onUpdateFailed() {
|
||||
if (updateDownloader) {
|
||||
updateDownloader->deleteLater();
|
||||
updateDownloader = 0;
|
||||
if (updateThread) updateThread->deleteLater();
|
||||
if (updateThread) updateThread->quit();
|
||||
updateThread = 0;
|
||||
}
|
||||
|
||||
@@ -326,10 +339,54 @@ void Application::writeUserConfigIn(uint64 ms) {
|
||||
}
|
||||
}
|
||||
|
||||
void Application::killDownloadSessionsStart(int32 dc) {
|
||||
if (killDownloadSessionTimes.constFind(dc) == killDownloadSessionTimes.cend()) {
|
||||
killDownloadSessionTimes.insert(dc, getms() + MTPAckSendWaiting + MTPKillFileSessionTimeout);
|
||||
}
|
||||
if (!killDownloadSessionsTimer.isActive()) {
|
||||
killDownloadSessionsTimer.start(MTPAckSendWaiting + MTPKillFileSessionTimeout + 5);
|
||||
}
|
||||
}
|
||||
|
||||
void Application::killDownloadSessionsStop(int32 dc) {
|
||||
killDownloadSessionTimes.remove(dc);
|
||||
if (killDownloadSessionTimes.isEmpty() && killDownloadSessionsTimer.isActive()) {
|
||||
killDownloadSessionsTimer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
void Application::checkLocalTime() {
|
||||
if (App::main()) App::main()->checkLastUpdate(checkms());
|
||||
}
|
||||
|
||||
void Application::onWriteUserConfig() {
|
||||
App::writeUserConfig();
|
||||
}
|
||||
|
||||
void Application::onAppStateChanged(Qt::ApplicationState state) {
|
||||
checkLocalTime();
|
||||
}
|
||||
|
||||
void Application::killDownloadSessions() {
|
||||
uint64 ms = getms(), left = MTPAckSendWaiting + MTPKillFileSessionTimeout;
|
||||
for (QMap<int32, uint64>::iterator i = killDownloadSessionTimes.begin(); i != killDownloadSessionTimes.end(); ) {
|
||||
if (i.value() <= ms) {
|
||||
for (int j = 0; j < MTPDownloadSessionsCount; ++j) {
|
||||
MTP::stopSession(MTP::dld[j] + i.key());
|
||||
}
|
||||
i = killDownloadSessionTimes.erase(i);
|
||||
} else {
|
||||
if (i.value() - ms < left) {
|
||||
left = i.value() - ms;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
if (!killDownloadSessionTimes.isEmpty()) {
|
||||
killDownloadSessionsTimer.start(left);
|
||||
}
|
||||
}
|
||||
|
||||
void Application::photoUpdated(MsgId msgId, const MTPInputFile &file) {
|
||||
if (!App::self()) return;
|
||||
|
||||
@@ -339,7 +396,8 @@ void Application::photoUpdated(MsgId msgId, const MTPInputFile &file) {
|
||||
if (peer == App::self()->id) {
|
||||
MTP::send(MTPphotos_UploadProfilePhoto(file, MTP_string(""), MTP_inputGeoPointEmpty(), MTP_inputPhotoCrop(MTP_double(0), MTP_double(0), MTP_double(100))), rpcDone(&Application::selfPhotoDone), rpcFail(&Application::peerPhotoFail, peer));
|
||||
} else {
|
||||
MTP::send(MTPmessages_EditChatPhoto(MTP_int(peer & 0xFFFFFFFF), MTP_inputChatUploadedPhoto(file, MTP_inputPhotoCrop(MTP_double(0), MTP_double(0), MTP_double(100)))), rpcDone(&Application::chatPhotoDone, peer), rpcFail(&Application::peerPhotoFail, peer));
|
||||
History *hist = App::history(peer);
|
||||
hist->sendRequestId = MTP::send(MTPmessages_EditChatPhoto(MTP_int(peer & 0xFFFFFFFF), MTP_inputChatUploadedPhoto(file, MTP_inputPhotoCrop(MTP_double(0), MTP_double(0), MTP_double(100)))), rpcDone(&Application::chatPhotoDone, peer), rpcFail(&Application::peerPhotoFail, peer), 0, 0, hist->sendRequestId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -406,7 +464,7 @@ void Application::uploadProfilePhoto(const QImage &tosend, const PeerId &peerId)
|
||||
int32 filesize = 0;
|
||||
QByteArray data;
|
||||
|
||||
ReadyLocalMedia ready(ToPreparePhoto, file, filename, filesize, data, id, id, peerId, photo, photoThumbs, MTP_documentEmpty(MTP_long(0)), jpeg);
|
||||
ReadyLocalMedia ready(ToPreparePhoto, file, filename, filesize, data, id, id, peerId, photo, photoThumbs, MTP_documentEmpty(MTP_long(0)), jpeg, false);
|
||||
|
||||
connect(App::uploader(), SIGNAL(photoReady(MsgId, const MTPInputFile &)), App::app(), SLOT(photoUpdated(MsgId, const MTPInputFile &)), Qt::UniqueConnection);
|
||||
|
||||
@@ -424,7 +482,7 @@ void Application::stopUpdate() {
|
||||
if (updateDownloader) {
|
||||
updateDownloader->deleteLater();
|
||||
updateDownloader = 0;
|
||||
if (updateThread) updateThread->deleteLater();
|
||||
if (updateThread) updateThread->quit();
|
||||
updateThread = 0;
|
||||
}
|
||||
}
|
||||
@@ -511,6 +569,9 @@ void Application::socketConnected() {
|
||||
for (QStringList::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) {
|
||||
commands += qsl("SEND:") + _escapeTo7bit(*i) + ';';
|
||||
}
|
||||
if (!cStartUrl().isEmpty()) {
|
||||
commands += qsl("OPEN:") + _escapeTo7bit(cStartUrl()) + ';';
|
||||
}
|
||||
commands += qsl("CMD:show;");
|
||||
DEBUG_LOG(("Application Info: writing commands %1").arg(commands));
|
||||
socket.write(commands.toLocal8Bit());
|
||||
@@ -571,9 +632,14 @@ void Application::socketError(QLocalSocket::LocalSocketError e) {
|
||||
}
|
||||
|
||||
void Application::startApp() {
|
||||
DEBUG_LOG(("Application Info: starting app.."));
|
||||
|
||||
Local::ReadMapState state = Local::readMap(QByteArray());
|
||||
|
||||
DEBUG_LOG(("Application Info: local map read.."));
|
||||
App::readUserConfig();
|
||||
if (!MTP::localKey().created()) {
|
||||
MTP::createLocalKey(QByteArray());
|
||||
if (!Local::oldKey().created()) {
|
||||
Local::createOldKey();
|
||||
cSetNeedConfigResave(true);
|
||||
}
|
||||
if (cNeedConfigResave()) {
|
||||
@@ -581,20 +647,26 @@ void Application::startApp() {
|
||||
App::writeUserConfig();
|
||||
cSetNeedConfigResave(false);
|
||||
}
|
||||
DEBUG_LOG(("Application Info: user config read.."));
|
||||
|
||||
window->createWinId();
|
||||
window->init();
|
||||
|
||||
DEBUG_LOG(("Application Info: window created.."));
|
||||
readSupportTemplates();
|
||||
|
||||
MTP::setLayer(mtpLayerMax);
|
||||
MTP::start();
|
||||
|
||||
MTP::setStateChangedHandler(mtpStateChanged);
|
||||
MTP::setSessionResetHandler(mtpSessionReset);
|
||||
|
||||
DEBUG_LOG(("Application Info: MTP started.."));
|
||||
|
||||
initImageLinkManager();
|
||||
App::initMedia();
|
||||
|
||||
DEBUG_LOG(("Application Info: showing."));
|
||||
|
||||
if (MTP::authedId()) {
|
||||
window->setupMain(false);
|
||||
} else {
|
||||
@@ -608,6 +680,15 @@ void Application::startApp() {
|
||||
}
|
||||
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||
if (Local::oldMapVersion() < AppVersion) {
|
||||
psRegisterCustomScheme();
|
||||
if (Local::oldMapVersion() && Local::oldMapVersion() < FeaturesNotifyVersion) {
|
||||
QString versionFeatures(QString::fromUtf8(FeaturesNotify).arg(QString::fromStdWString(AppVersionStr)));
|
||||
if (!versionFeatures.isEmpty()) {
|
||||
window->serviceNotification(versionFeatures);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Application::socketDisconnected() {
|
||||
@@ -627,6 +708,7 @@ void Application::newInstanceConnected() {
|
||||
}
|
||||
|
||||
void Application::readClients() {
|
||||
QString startUrl;
|
||||
QStringList toSend;
|
||||
for (ClientSockets::iterator i = clients.begin(), e = clients.end(); i != e; ++i) {
|
||||
i->second.append(i->first->readAll());
|
||||
@@ -643,6 +725,10 @@ void Application::readClients() {
|
||||
if (cSendPaths().isEmpty()) {
|
||||
toSend.append(_escapeFrom7bit(cmds.mid(from + 5, to - from - 5)));
|
||||
}
|
||||
} else if (cmd.startsWith(qsl("OPEN:"))) {
|
||||
if (cStartUrl().isEmpty()) {
|
||||
startUrl = _escapeFrom7bit(cmds.mid(from + 5, to - from - 5));
|
||||
}
|
||||
} else {
|
||||
LOG(("Application Error: unknown command %1 passed in local socket").arg(QString(cmd.constData(), cmd.length())));
|
||||
}
|
||||
@@ -663,6 +749,13 @@ void Application::readClients() {
|
||||
App::wnd()->sendPaths();
|
||||
}
|
||||
}
|
||||
if (!startUrl.isEmpty()) {
|
||||
cSetStartUrl(startUrl);
|
||||
}
|
||||
if (!cStartUrl().isEmpty() && App::main() && App::self()) {
|
||||
App::main()->openLocalUrl(cStartUrl());
|
||||
cSetStartUrl(QString());
|
||||
}
|
||||
}
|
||||
|
||||
void Application::removeClients() {
|
||||
@@ -706,18 +799,20 @@ Application::~Application() {
|
||||
socket.close();
|
||||
closeApplication();
|
||||
App::deinitMedia();
|
||||
deinitImageLinkManager();
|
||||
mainApp = 0;
|
||||
delete updateReply;
|
||||
delete ::uploader;
|
||||
updateReply = 0;
|
||||
delete updateDownloader;
|
||||
if (updateDownloader) updateDownloader->deleteLater();
|
||||
updateDownloader = 0;
|
||||
delete updateThread;
|
||||
if (updateThread) updateThread->quit();
|
||||
updateThread = 0;
|
||||
|
||||
delete window;
|
||||
|
||||
style::stopManager();
|
||||
Local::stop();
|
||||
}
|
||||
|
||||
Application *Application::app() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@@ -70,11 +70,18 @@ public:
|
||||
|
||||
void writeUserConfigIn(uint64 ms);
|
||||
|
||||
void killDownloadSessionsStart(int32 dc);
|
||||
void killDownloadSessionsStop(int32 dc);
|
||||
|
||||
void checkLocalTime();
|
||||
|
||||
signals:
|
||||
|
||||
void peerPhotoDone(PeerId peer);
|
||||
void peerPhotoFail(PeerId peer);
|
||||
|
||||
void adjustSingleTimers();
|
||||
|
||||
public slots:
|
||||
|
||||
void startUpdateCheck(bool forceWait = false);
|
||||
@@ -100,10 +107,16 @@ public slots:
|
||||
void onEnableDebugMode();
|
||||
void onWriteUserConfig();
|
||||
|
||||
void killDownloadSessions();
|
||||
void onAppStateChanged(Qt::ApplicationState state);
|
||||
|
||||
private:
|
||||
|
||||
QMap<MsgId, PeerId> photoUpdates;
|
||||
|
||||
QMap<int32, uint64> killDownloadSessionTimes;
|
||||
SingleTimer killDownloadSessionsTimer;
|
||||
|
||||
void startApp();
|
||||
|
||||
typedef QPair<QLocalSocket*, QByteArray> ClientSocket;
|
||||
@@ -123,10 +136,10 @@ private:
|
||||
mtpRequestId updateRequestId;
|
||||
QNetworkAccessManager updateManager;
|
||||
QNetworkReply *updateReply;
|
||||
QTimer updateCheckTimer;
|
||||
SingleTimer updateCheckTimer;
|
||||
QThread *updateThread;
|
||||
PsUpdateDownloader *updateDownloader;
|
||||
|
||||
QTimer writeUserConfigTimer;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
Before Width: | Height: | Size: 528 KiB After Width: | Height: | Size: 528 KiB |
|
Before Width: | Height: | Size: 722 KiB After Width: | Height: | Size: 722 KiB |
|
Before Width: | Height: | Size: 1003 KiB After Width: | Height: | Size: 1003 KiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.3 KiB |
BIN
Telegram/SourceFiles/art/fonts/NanumMyeongjo-Regular.ttf
Normal file
|
Before Width: | Height: | Size: 35 KiB |
BIN
Telegram/SourceFiles/art/icon128.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
Telegram/SourceFiles/art/icon128@2x.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
Telegram/SourceFiles/art/icon16.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Telegram/SourceFiles/art/icon16@2x.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
Telegram/SourceFiles/art/icon256.ico
Normal file
|
After Width: | Height: | Size: 361 KiB |
BIN
Telegram/SourceFiles/art/icon256.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
Telegram/SourceFiles/art/icon256@2x.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
Telegram/SourceFiles/art/icon32.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
Telegram/SourceFiles/art/icon32@2x.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
Telegram/SourceFiles/art/icon48.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
Telegram/SourceFiles/art/icon48@2x.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
Telegram/SourceFiles/art/icon512.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
Telegram/SourceFiles/art/icon512@2x.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
Telegram/SourceFiles/art/icon64.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
Telegram/SourceFiles/art/icon64@2x.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
Telegram/SourceFiles/art/icon_green.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 41 KiB |
BIN
Telegram/SourceFiles/art/iconbig256.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
Telegram/SourceFiles/art/iconbig_green.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 655 B |
|
Before Width: | Height: | Size: 361 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 361 KiB |
|
Before Width: | Height: | Size: 181 KiB |
|
Before Width: | Height: | Size: 192 KiB |
|
Before Width: | Height: | Size: 183 KiB |
BIN
Telegram/SourceFiles/art/osxsetup.tif
Normal file
BIN
Telegram/SourceFiles/art/osxsetup.tiff
Normal file
BIN
Telegram/SourceFiles/art/osxsetup@2x.tif
Normal file
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 98 KiB |
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "audio.h"
|
||||
@@ -348,7 +348,6 @@ void VoiceMessagesFader::onTimer() {
|
||||
VoiceMessages *voice = audioVoice();
|
||||
if (!voice) return;
|
||||
|
||||
uint64 ms = getms();
|
||||
for (int32 i = 0; i < AudioVoiceMsgSimultaneously; ++i) {
|
||||
VoiceMessages::Msg &m(voice->_data[i]);
|
||||
if (m.state == VoiceMessageStopped || m.state == VoiceMessagePaused || !m.source) continue;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "lang.h"
|
||||
@@ -24,7 +24,7 @@ Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
|
||||
AboutBox::AboutBox() :
|
||||
_done(this, lang(lng_about_done), st::aboutCloseButton),
|
||||
_version(this, qsl("[a href=\"https://tdesktop.com/#version_history\"]") + textClean(lang(lng_about_version).replace(qsl("{version}"), QString::fromWCharArray(AppVersionStr))) + qsl("[/a]"), st::aboutVersion, st::defaultTextStyle),
|
||||
_version(this, qsl("[a href=\"https://desktop.telegram.org/#changelog\"]") + textClean(lang(lng_about_version).replace(qsl("{version}"), QString::fromWCharArray(AppVersionStr))) + qsl("[/a]"), st::aboutVersion, st::defaultTextStyle),
|
||||
_text(this, lang(lng_about_text), st::aboutLabel, st::aboutTextStyle),
|
||||
_hiding(false), a_opacity(0, 1) {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "lang.h"
|
||||
@@ -251,15 +251,16 @@ void AddContactBox::onSend() {
|
||||
}
|
||||
|
||||
void AddContactBox::onSaveSelfDone(const MTPUser &user) {
|
||||
App::feedUsers(MTP_vector<MTPUser>(QVector<MTPUser>(1, user)));
|
||||
App::feedUsers(MTP_vector<MTPUser>(1, user));
|
||||
emit closed();
|
||||
}
|
||||
|
||||
bool AddContactBox::onSaveSelfFail(const RPCError &error) {
|
||||
_addRequest = 0;
|
||||
QString err(error.type());
|
||||
QString firstName = textOneLine(_firstInput.text()), lastName = textOneLine(_lastInput.text());
|
||||
if (err == "NAME_NOT_MODIFIED") {
|
||||
App::self()->setName(firstName, lastName, firstName + ' ' + lastName);
|
||||
App::self()->setName(firstName, lastName, QString(), textOneLine(App::self()->username));
|
||||
emit closed();
|
||||
return true;
|
||||
} else if (err == "FIRSTNAME_INVALID") {
|
||||
@@ -276,10 +277,11 @@ bool AddContactBox::onSaveSelfFail(const RPCError &error) {
|
||||
}
|
||||
|
||||
bool AddContactBox::onSaveFail(const RPCError &error) {
|
||||
_addRequest = 0;
|
||||
QString err(error.type());
|
||||
QString firstName = _firstInput.text().trimmed(), lastName = _lastInput.text().trimmed();
|
||||
if (err == "CHAT_TITLE_NOT_MODIFIED") {
|
||||
_peer->updateName(firstName, QString());
|
||||
_peer->updateName(firstName, QString(), QString());
|
||||
emit closed();
|
||||
return true;
|
||||
} else if (err == "NO_CHAT_TITLE") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@@ -58,7 +58,7 @@ private:
|
||||
PeerData *_peer;
|
||||
QString _boxTitle;
|
||||
|
||||
int32 _width, _height, _thumbw, _thumbh;
|
||||
int32 _width, _height;
|
||||
FlatButton _addButton, _retryButton, _cancelButton;
|
||||
FlatInput _firstInput, _lastInput, _phoneInput;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "lang.h"
|
||||
@@ -23,19 +23,26 @@ Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
#include "window.h"
|
||||
|
||||
AddParticipantInner::AddParticipantInner(ChatData *chat) : _chat(chat),
|
||||
_contacts(&App::main()->contactsList()), _sel(0), _filteredSel(-1), _mouseSel(false), _selCount(0) {
|
||||
|
||||
_filter = qsl("a");
|
||||
updateFilter();
|
||||
_contacts(&App::main()->contactsList()),
|
||||
_sel(0),
|
||||
_filteredSel(-1),
|
||||
_mouseSel(false),
|
||||
_selCount(0),
|
||||
_addContactLnk(this, lang(lng_add_contact_button)) {
|
||||
|
||||
connect(&_addContactLnk, SIGNAL(clicked()), App::wnd(), SLOT(onShowAddContact()));
|
||||
|
||||
for (DialogRow *r = _contacts->list.begin; r != _contacts->list.end; r = r->next) {
|
||||
r->attached = 0;
|
||||
}
|
||||
|
||||
connect(App::main(), SIGNAL(dialogRowReplaced(DialogRow *, DialogRow *)), this, SLOT(onDialogRowReplaced(DialogRow *, DialogRow *)));
|
||||
connect(App::main(), SIGNAL(peerUpdated(PeerData*)), this, SLOT(peerUpdated(PeerData *)));
|
||||
connect(App::main(), SIGNAL(peerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &)), this, SLOT(peerUpdated(PeerData *)));
|
||||
connect(App::main(), SIGNAL(peerPhotoChanged(PeerData *)), this, SLOT(peerUpdated(PeerData *)));
|
||||
_filter = qsl("a");
|
||||
updateFilter();
|
||||
|
||||
connect(App::main(), SIGNAL(dialogRowReplaced(DialogRow*,DialogRow*)), this, SLOT(onDialogRowReplaced(DialogRow*,DialogRow*)));
|
||||
connect(App::main(), SIGNAL(peerUpdated(PeerData*)), this, SLOT(peerUpdated(PeerData*)));
|
||||
connect(App::main(), SIGNAL(peerNameChanged(PeerData*,const PeerData::Names&,const PeerData::NameFirstChars&)), this, SLOT(peerUpdated(PeerData*)));
|
||||
connect(App::main(), SIGNAL(peerPhotoChanged(PeerData*)), this, SLOT(peerUpdated(PeerData*)));
|
||||
}
|
||||
|
||||
void AddParticipantInner::peerUpdated(PeerData *peer) {
|
||||
@@ -118,7 +125,7 @@ AddParticipantInner::ContactData *AddParticipantInner::contactData(DialogRow *ro
|
||||
data->inchat = _chat->participants.constFind(user) != _chat->participants.cend();
|
||||
data->check = false;
|
||||
data->name.setText(st::profileListNameFont, user->name, _textNameOptions);
|
||||
data->online = App::onlineText(user->onlineTill, _time);
|
||||
data->online = App::onlineText(user, _time);
|
||||
} else {
|
||||
data = i.value();
|
||||
}
|
||||
@@ -184,11 +191,15 @@ void AddParticipantInner::paintEvent(QPaintEvent *e) {
|
||||
drawFrom = drawFrom->next;
|
||||
}
|
||||
} else {
|
||||
// ..
|
||||
p.setFont(st::noContactsFont->f);
|
||||
p.setPen(st::noContactsColor->p);
|
||||
p.drawText(QRect(0, 0, width(), st::noContactsHeight - (cContactsReceived() ? st::noContactsFont->height : 0)), lang(cContactsReceived() ? lng_no_contacts : lng_contacts_loading), style::al_center);
|
||||
}
|
||||
} else {
|
||||
if (_filtered.isEmpty()) {
|
||||
// ..
|
||||
p.setFont(st::noContactsFont->f);
|
||||
p.setPen(st::noContactsColor->p);
|
||||
p.drawText(QRect(0, 0, width(), st::noContactsHeight), lang(lng_contacts_not_found), style::al_center);
|
||||
} else {
|
||||
int32 from = yFrom / rh;
|
||||
if (from < 0) from = 0;
|
||||
@@ -231,6 +242,7 @@ void AddParticipantInner::mousePressEvent(QMouseEvent *e) {
|
||||
}
|
||||
|
||||
void AddParticipantInner::chooseParticipant() {
|
||||
_time = unixtime();
|
||||
int32 rh = st::profileListPhotoSize + st::profileListPadding.height() * 2, from;
|
||||
if (_filter.isEmpty()) {
|
||||
if (!_sel || contactData(_sel)->inchat) return;
|
||||
@@ -293,6 +305,9 @@ void AddParticipantInner::updateSel() {
|
||||
}
|
||||
|
||||
void AddParticipantInner::updateFilter(QString filter) {
|
||||
filter = textSearchKey(filter);
|
||||
|
||||
_time = unixtime();
|
||||
QStringList f;
|
||||
if (!filter.isEmpty()) {
|
||||
QStringList filterList = filter.split(cWordSplit(), QString::SkipEmptyParts);
|
||||
@@ -310,14 +325,23 @@ void AddParticipantInner::updateFilter(QString filter) {
|
||||
int32 rh = (st::profileListPhotoSize + st::profileListPadding.height() * 2);
|
||||
_filter = filter;
|
||||
if (_filter.isEmpty()) {
|
||||
resize(width(), _contacts->list.count * rh);
|
||||
if (_contacts->list.count) {
|
||||
if (!_addContactLnk.isHidden()) _addContactLnk.hide();
|
||||
resize(width(), _contacts->list.count * rh);
|
||||
_sel = _contacts->list.begin;
|
||||
while (_sel->next->next &&& contactData(_sel)->inchat) {
|
||||
_sel = _sel->next;
|
||||
}
|
||||
} else {
|
||||
resize(width(), st::noContactsHeight);
|
||||
if (cContactsReceived()) {
|
||||
if (_addContactLnk.isHidden()) _addContactLnk.show();
|
||||
} else {
|
||||
if (!_addContactLnk.isHidden()) _addContactLnk.hide();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!_addContactLnk.isHidden()) _addContactLnk.hide();
|
||||
QStringList::const_iterator fb = f.cbegin(), fe = f.cend(), fi;
|
||||
|
||||
_filtered.clear();
|
||||
@@ -363,7 +387,11 @@ void AddParticipantInner::updateFilter(QString filter) {
|
||||
++_filteredSel;
|
||||
}
|
||||
|
||||
resize(width(), _filtered.size() * rh);
|
||||
if (!_filtered.isEmpty()) {
|
||||
resize(width(), _filtered.size() * rh);
|
||||
} else {
|
||||
resize(width(), st::noContactsHeight);
|
||||
}
|
||||
}
|
||||
if (parentWidget()) parentWidget()->update();
|
||||
loadProfilePhotos(0);
|
||||
@@ -404,7 +432,12 @@ AddParticipantInner::~AddParticipantInner() {
|
||||
}
|
||||
}
|
||||
|
||||
void AddParticipantInner::resizeEvent(QResizeEvent *e) {
|
||||
_addContactLnk.move((width() - _addContactLnk.width()) / 2, (st::noContactsHeight + st::noContactsFont->height) / 2);
|
||||
}
|
||||
|
||||
void AddParticipantInner::selectSkip(int32 dir) {
|
||||
_time = unixtime();
|
||||
_mouseSel = false;
|
||||
int32 rh = st::profileListPhotoSize + st::profileListPadding.height() * 2, origDir = dir;
|
||||
if (_filter.isEmpty()) {
|
||||
@@ -517,7 +550,7 @@ AddParticipantBox::AddParticipantBox(ChatData *chat) :
|
||||
connect(&_scroll, SIGNAL(scrolled()), &_inner, SLOT(updateSel()));
|
||||
connect(&_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
|
||||
connect(&_filter, SIGNAL(changed()), this, SLOT(onFilterUpdate()));
|
||||
connect(&_filter, SIGNAL(cancelled()), this, SIGNAL(onClose()));
|
||||
connect(&_filter, SIGNAL(cancelled()), this, SLOT(onClose()));
|
||||
connect(&_inner, SIGNAL(mustScrollTo(int,int)), &_scroll, SLOT(scrollToY(int,int)));
|
||||
connect(&_inner, SIGNAL(selectAllQuery()), &_filter, SLOT(selectAll()));
|
||||
|
||||
@@ -575,6 +608,7 @@ void AddParticipantBox::paintEvent(QPaintEvent *e) {
|
||||
|
||||
// paint shadows
|
||||
p.fillRect(0, st::participantFilter.height, _width, st::scrollDef.topsh, st::scrollDef.shColor->b);
|
||||
p.fillRect(0, size().height() - st::btnSelectCancel.height - st::scrollDef.bottomsh, _width, st::scrollDef.bottomsh, st::scrollDef.shColor->b);
|
||||
|
||||
// paint button sep
|
||||
p.fillRect(st::btnSelectCancel.width, size().height() - st::btnSelectCancel.height, st::lineWidth, st::btnSelectCancel.height, st::btnSelectSep->b);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@@ -31,6 +31,7 @@ public:
|
||||
void leaveEvent(QEvent *e);
|
||||
void mouseMoveEvent(QMouseEvent *e);
|
||||
void mousePressEvent(QMouseEvent *e);
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
|
||||
void paintDialog(QPainter &p, DialogRow *row, bool sel);
|
||||
void updateFilter(QString filter = QString());
|
||||
@@ -87,6 +88,7 @@ private:
|
||||
ContactData *contactData(DialogRow *row);
|
||||
|
||||
QPoint _lastMousePos;
|
||||
LinkButton _addContactLnk;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "lang.h"
|
||||
@@ -22,23 +22,53 @@ Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
#include "mainwidget.h"
|
||||
#include "window.h"
|
||||
|
||||
ConfirmBox::ConfirmBox(QString text, QString doneText, QString cancelText) :
|
||||
_confirm(this, doneText.isEmpty() ? lang(lng_continue) : doneText, st::btnSelectDone),
|
||||
_cancel(this, cancelText.isEmpty() ? lang(lng_cancel) : cancelText, st::btnSelectCancel),
|
||||
_text(100), _hiding(false), a_opacity(0, 1), af_opacity(anim::linear) {
|
||||
TextParseOptions _confirmBoxTextOptions = {
|
||||
TextParseLinks | TextParseMultiline | TextParseRichText, // flags
|
||||
0, // maxw
|
||||
0, // maxh
|
||||
Qt::LayoutDirectionAuto, // dir
|
||||
};
|
||||
|
||||
_text.setText(st::boxFont, text, _textPlainOptions);
|
||||
ConfirmBox::ConfirmBox(const QString &text, const QString &doneText, const QString &cancelText) : _infoMsg(false),
|
||||
_confirm(this, doneText.isEmpty() ? lang(lng_continue) : doneText, st::btnSelectDone),
|
||||
_cancel(this, cancelText.isEmpty() ? lang(lng_cancel) : cancelText, st::btnSelectCancel),
|
||||
_close(this, QString(), st::btnInfoClose),
|
||||
_text(100), _hiding(false), a_opacity(0, 1), af_opacity(anim::linear) {
|
||||
init(text);
|
||||
}
|
||||
|
||||
ConfirmBox::ConfirmBox(const QString &text, bool noDone, const QString &cancelText) : _infoMsg(true),
|
||||
_confirm(this, QString(), st::btnSelectDone),
|
||||
_cancel(this, QString(), st::btnSelectCancel),
|
||||
_close(this, cancelText.isEmpty() ? lang(lng_close) : cancelText, st::btnInfoClose),
|
||||
_text(100), _hiding(false), a_opacity(0, 1), af_opacity(anim::linear) {
|
||||
init(text);
|
||||
}
|
||||
|
||||
void ConfirmBox::init(const QString &text) {
|
||||
_text.setText(st::boxFont, text, (_infoMsg ? _confirmBoxTextOptions : _textPlainOptions));
|
||||
|
||||
_width = st::confirmWidth;
|
||||
_textWidth = _width - st::boxPadding.left() - st::boxPadding.right();
|
||||
_textHeight = _text.countHeight(_textWidth);
|
||||
_height = st::boxPadding.top() + _textHeight + st::boxPadding.bottom() + _confirm.height();
|
||||
_height = st::boxPadding.top() + _textHeight + st::boxPadding.bottom() + (_infoMsg ? _close.height() : _confirm.height());
|
||||
|
||||
_confirm.move(_width - _confirm.width(), st::boxPadding.top() + _textHeight + st::boxPadding.bottom());
|
||||
_cancel.move(0, st::boxPadding.top() + _textHeight + st::boxPadding.bottom());
|
||||
if (_infoMsg) {
|
||||
_confirm.hide();
|
||||
_cancel.hide();
|
||||
_close.move(0, st::boxPadding.top() + _textHeight + st::boxPadding.bottom());
|
||||
|
||||
connect(&_confirm, SIGNAL(clicked()), this, SIGNAL(confirmed()));
|
||||
connect(&_cancel, SIGNAL(clicked()), this, SLOT(onCancel()));
|
||||
connect(&_close, SIGNAL(clicked()), this, SLOT(onCancel()));
|
||||
|
||||
setMouseTracking(_text.hasLinks());
|
||||
} else {
|
||||
_confirm.move(_width - _confirm.width(), st::boxPadding.top() + _textHeight + st::boxPadding.bottom());
|
||||
_cancel.move(0, st::boxPadding.top() + _textHeight + st::boxPadding.bottom());
|
||||
_close.hide();
|
||||
|
||||
connect(&_confirm, SIGNAL(clicked()), this, SIGNAL(confirmed()));
|
||||
connect(&_cancel, SIGNAL(clicked()), this, SLOT(onCancel()));
|
||||
}
|
||||
|
||||
resize(_width, _height);
|
||||
|
||||
@@ -47,14 +77,73 @@ ConfirmBox::ConfirmBox(QString text, QString doneText, QString cancelText) :
|
||||
hideAll();
|
||||
}
|
||||
|
||||
void ConfirmBox::mouseMoveEvent(QMouseEvent *e) {
|
||||
_lastMousePos = e->globalPos();
|
||||
updateHover();
|
||||
}
|
||||
|
||||
void ConfirmBox::mousePressEvent(QMouseEvent *e) {
|
||||
_lastMousePos = e->globalPos();
|
||||
updateHover();
|
||||
if (textlnkOver()) {
|
||||
textlnkDown(textlnkOver());
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void ConfirmBox::mouseReleaseEvent(QMouseEvent *e) {
|
||||
_lastMousePos = e->globalPos();
|
||||
updateHover();
|
||||
if (textlnkOver() && textlnkOver() == textlnkDown()) {
|
||||
App::wnd()->hideLayer();
|
||||
textlnkOver()->onClick(e->button());
|
||||
}
|
||||
textlnkDown(TextLinkPtr());
|
||||
}
|
||||
|
||||
void ConfirmBox::leaveEvent(QEvent *e) {
|
||||
if (_myLink) {
|
||||
if (textlnkOver() == _myLink) {
|
||||
textlnkOver(TextLinkPtr());
|
||||
update();
|
||||
}
|
||||
_myLink = TextLinkPtr();
|
||||
setCursor(style::cur_default);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void ConfirmBox::updateLink() {
|
||||
_lastMousePos = QCursor::pos();
|
||||
updateHover();
|
||||
}
|
||||
|
||||
void ConfirmBox::updateHover() {
|
||||
QPoint m(mapFromGlobal(_lastMousePos));
|
||||
bool wasMy = (_myLink == textlnkOver());
|
||||
_myLink = _text.link(m.x() - st::boxPadding.left(), m.y() - st::boxPadding.top(), _textWidth, (_text.maxWidth() < _width) ? style::al_center : style::al_left);
|
||||
if (_myLink != textlnkOver()) {
|
||||
if (wasMy || _myLink || rect().contains(m)) {
|
||||
textlnkOver(_myLink);
|
||||
}
|
||||
setCursor(_myLink ? style::cur_pointer : style::cur_default);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void ConfirmBox::hideAll() {
|
||||
_confirm.hide();
|
||||
_cancel.hide();
|
||||
_close.hide();
|
||||
}
|
||||
|
||||
void ConfirmBox::showAll() {
|
||||
_confirm.show();
|
||||
_cancel.show();
|
||||
if (_infoMsg) {
|
||||
_close.show();
|
||||
} else {
|
||||
_confirm.show();
|
||||
_cancel.show();
|
||||
}
|
||||
}
|
||||
|
||||
void ConfirmBox::keyPressEvent(QKeyEvent *e) {
|
||||
@@ -78,11 +167,13 @@ void ConfirmBox::paintEvent(QPaintEvent *e) {
|
||||
// fill bg
|
||||
p.fillRect(0, 0, _width, _height, st::boxBG->b);
|
||||
|
||||
// paint shadows
|
||||
p.fillRect(0, _height - st::btnSelectCancel.height - st::scrollDef.bottomsh, _width, st::scrollDef.bottomsh, st::scrollDef.shColor->b);
|
||||
if (!_infoMsg) {
|
||||
// paint shadows
|
||||
p.fillRect(0, _height - st::btnSelectCancel.height - st::scrollDef.bottomsh, _width, st::scrollDef.bottomsh, st::scrollDef.shColor->b);
|
||||
|
||||
// paint button sep
|
||||
p.fillRect(st::btnSelectCancel.width, _height - st::btnSelectCancel.height, st::lineWidth, st::btnSelectCancel.height, st::btnSelectSep->b);
|
||||
// paint button sep
|
||||
p.fillRect(st::btnSelectCancel.width, _height - st::btnSelectCancel.height, st::lineWidth, st::btnSelectCancel.height, st::btnSelectSep->b);
|
||||
}
|
||||
|
||||
// draw box title / text
|
||||
p.setFont(st::boxFont->f);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@@ -24,11 +24,17 @@ class ConfirmBox : public LayeredWidget, public RPCSender {
|
||||
|
||||
public:
|
||||
|
||||
ConfirmBox(QString text, QString doneText = QString(), QString cancelText = QString());
|
||||
ConfirmBox(const QString &text, const QString &doneText = QString(), const QString &cancelText = QString());
|
||||
ConfirmBox(const QString &text, bool noDone, const QString &cancelText = QString());
|
||||
void parentResized();
|
||||
void animStep(float64 ms);
|
||||
void keyPressEvent(QKeyEvent *e);
|
||||
void paintEvent(QPaintEvent *e);
|
||||
void mouseMoveEvent(QMouseEvent *e);
|
||||
void mousePressEvent(QMouseEvent *e);
|
||||
void mouseReleaseEvent(QMouseEvent *e);
|
||||
void leaveEvent(QEvent *e);
|
||||
void updateLink();
|
||||
void startHide();
|
||||
~ConfirmBox();
|
||||
|
||||
@@ -43,11 +49,16 @@ public slots:
|
||||
|
||||
private:
|
||||
|
||||
void init(const QString &text);
|
||||
|
||||
bool _infoMsg;
|
||||
|
||||
void hideAll();
|
||||
void showAll();
|
||||
|
||||
int32 _width, _height;
|
||||
FlatButton _confirm, _cancel;
|
||||
BottomButton _close;
|
||||
Text _text;
|
||||
int32 _textWidth, _textHeight;
|
||||
|
||||
@@ -56,4 +67,9 @@ private:
|
||||
|
||||
anim::fvalue a_opacity;
|
||||
anim::transition af_opacity;
|
||||
|
||||
void updateHover();
|
||||
|
||||
QPoint _lastMousePos;
|
||||
TextLinkPtr _myLink;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "lang.h"
|
||||
@@ -205,6 +205,7 @@ void ConnectionBox::onSave() {
|
||||
}
|
||||
App::writeConfig();
|
||||
MTP::restart();
|
||||
reinitImageLinkManager();
|
||||
emit closed();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "lang.h"
|
||||
@@ -23,14 +23,22 @@ Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
#include "mainwidget.h"
|
||||
#include "window.h"
|
||||
|
||||
ContactsInner::ContactsInner() : _contacts(&App::main()->contactsList()), _sel(0), _filteredSel(-1), _mouseSel(false) {
|
||||
_filter = qsl("a");
|
||||
updateFilter();
|
||||
ContactsInner::ContactsInner() :
|
||||
_contacts(&App::main()->contactsList()),
|
||||
_sel(0),
|
||||
_filteredSel(-1),
|
||||
_mouseSel(false),
|
||||
_addContactLnk(this, lang(lng_add_contact_button)) {
|
||||
|
||||
connect(&_addContactLnk, SIGNAL(clicked()), App::wnd(), SLOT(onShowAddContact()));
|
||||
|
||||
for (DialogRow *r = _contacts->list.begin; r != _contacts->list.end; r = r->next) {
|
||||
r->attached = 0;
|
||||
}
|
||||
|
||||
_filter = qsl("a");
|
||||
updateFilter();
|
||||
|
||||
connect(App::main(), SIGNAL(dialogRowReplaced(DialogRow *, DialogRow *)), this, SLOT(onDialogRowReplaced(DialogRow *, DialogRow *)));
|
||||
connect(App::main(), SIGNAL(peerUpdated(PeerData*)), this, SLOT(peerUpdated(PeerData *)));
|
||||
connect(App::main(), SIGNAL(peerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &)), this, SLOT(peerUpdated(PeerData *)));
|
||||
@@ -98,7 +106,7 @@ ContactsInner::ContactData *ContactsInner::contactData(DialogRow *row) {
|
||||
if (i == _contactsData.cend()) {
|
||||
_contactsData.insert(user, data = new ContactData());
|
||||
data->name.setText(st::profileListNameFont, user->name, _textNameOptions);
|
||||
data->online = App::onlineText(user->onlineTill, _time);
|
||||
data->online = App::onlineText(user, _time);
|
||||
} else {
|
||||
data = i.value();
|
||||
}
|
||||
@@ -153,11 +161,15 @@ void ContactsInner::paintEvent(QPaintEvent *e) {
|
||||
drawFrom = drawFrom->next;
|
||||
}
|
||||
} else {
|
||||
// ..
|
||||
p.setFont(st::noContactsFont->f);
|
||||
p.setPen(st::noContactsColor->p);
|
||||
p.drawText(QRect(0, 0, width(), st::noContactsHeight - (cContactsReceived() ? st::noContactsFont->height : 0)), lang(cContactsReceived() ? lng_no_contacts : lng_contacts_loading), style::al_center);
|
||||
}
|
||||
} else {
|
||||
if (_filtered.isEmpty()) {
|
||||
// ..
|
||||
p.setFont(st::noContactsFont->f);
|
||||
p.setPen(st::noContactsColor->p);
|
||||
p.drawText(QRect(0, 0, width(), st::noContactsHeight), lang(lng_contacts_not_found), style::al_center);
|
||||
} else {
|
||||
int32 from = yFrom / rh;
|
||||
if (from < 0) from = 0;
|
||||
@@ -238,6 +250,8 @@ void ContactsInner::updateSel() {
|
||||
}
|
||||
|
||||
void ContactsInner::updateFilter(QString filter) {
|
||||
filter = textSearchKey(filter);
|
||||
|
||||
QStringList f;
|
||||
if (!filter.isEmpty()) {
|
||||
QStringList filterList = filter.split(cWordSplit(), QString::SkipEmptyParts);
|
||||
@@ -255,11 +269,20 @@ void ContactsInner::updateFilter(QString filter) {
|
||||
int32 rh = (st::profileListPhotoSize + st::profileListPadding.height() * 2);
|
||||
_filter = filter;
|
||||
if (_filter.isEmpty()) {
|
||||
resize(width(), _contacts->list.count * rh + st::contactsClose.height);
|
||||
if (_contacts->list.count) {
|
||||
if (!_addContactLnk.isHidden()) _addContactLnk.hide();
|
||||
resize(width(), _contacts->list.count * rh + st::contactsClose.height);
|
||||
_sel = _contacts->list.begin;
|
||||
} else {
|
||||
resize(width(), st::noContactsHeight);
|
||||
if (cContactsReceived()) {
|
||||
if (_addContactLnk.isHidden()) _addContactLnk.show();
|
||||
} else {
|
||||
if (!_addContactLnk.isHidden()) _addContactLnk.hide();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!_addContactLnk.isHidden()) _addContactLnk.hide();
|
||||
QStringList::const_iterator fb = f.cbegin(), fe = f.cend(), fi;
|
||||
|
||||
_filtered.clear();
|
||||
@@ -302,7 +325,11 @@ void ContactsInner::updateFilter(QString filter) {
|
||||
}
|
||||
_filteredSel = _filtered.isEmpty() ? -1 : 0;
|
||||
|
||||
resize(width(), _filtered.size() * rh + st::contactsClose.height);
|
||||
if (!_filtered.isEmpty()) {
|
||||
resize(width(), _filtered.size() * rh + st::contactsClose.height);
|
||||
} else {
|
||||
resize(width(), st::noContactsHeight);
|
||||
}
|
||||
}
|
||||
if (parentWidget()) parentWidget()->update();
|
||||
loadProfilePhotos(0);
|
||||
@@ -333,7 +360,8 @@ void ContactsInner::onDialogRowReplaced(DialogRow *oldRow, DialogRow *newRow) {
|
||||
}
|
||||
_mouseSel = false;
|
||||
int32 rh = (st::profileListPhotoSize + st::profileListPadding.height() * 2);
|
||||
int32 newh = (_filter.isEmpty() ? _contacts->list.count : _filtered.size()) * rh;
|
||||
int32 cnt = (_filter.isEmpty() ? _contacts->list.count : _filtered.size());
|
||||
int32 newh = cnt ? (cnt * rh + st::contactsClose.height) : st::noContactsHeight;
|
||||
resize(width(), newh);
|
||||
}
|
||||
|
||||
@@ -343,6 +371,10 @@ ContactsInner::~ContactsInner() {
|
||||
}
|
||||
}
|
||||
|
||||
void ContactsInner::resizeEvent(QResizeEvent *e) {
|
||||
_addContactLnk.move((width() - _addContactLnk.width()) / 2, (st::noContactsHeight + st::noContactsFont->height) / 2);
|
||||
}
|
||||
|
||||
void ContactsInner::selectSkip(int32 dir) {
|
||||
_mouseSel = false;
|
||||
int32 rh = st::profileListPhotoSize + st::profileListPadding.height() * 2, origDir = dir;
|
||||
@@ -409,12 +441,12 @@ ContactsBox::ContactsBox() : _scroll(this, st::newGroupScroll), _inner(),
|
||||
_scroll.setWidget(&_inner);
|
||||
_scroll.setFocusPolicy(Qt::NoFocus);
|
||||
|
||||
connect(&_addContact, SIGNAL(clicked()), this, SLOT(onAdd()));
|
||||
connect(&_addContact, SIGNAL(clicked()), App::wnd(), SLOT(onShowAddContact()));
|
||||
connect(&_close, SIGNAL(clicked()), this, SLOT(onClose()));
|
||||
connect(&_scroll, SIGNAL(scrolled()), &_inner, SLOT(updateSel()));
|
||||
connect(&_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
|
||||
connect(&_filter, SIGNAL(changed()), this, SLOT(onFilterUpdate()));
|
||||
connect(&_filter, SIGNAL(cancelled()), this, SIGNAL(onClose()));
|
||||
connect(&_filter, SIGNAL(cancelled()), this, SLOT(onClose()));
|
||||
connect(&_inner, SIGNAL(mustScrollTo(int,int)), &_scroll, SLOT(scrollToY(int,int)));
|
||||
|
||||
showAll();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@@ -31,6 +31,7 @@ public:
|
||||
void leaveEvent(QEvent *e);
|
||||
void mouseMoveEvent(QMouseEvent *e);
|
||||
void mousePressEvent(QMouseEvent *e);
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
|
||||
void paintDialog(QPainter &p, DialogRow *row, bool sel);
|
||||
void updateFilter(QString filter = QString());
|
||||
@@ -77,6 +78,7 @@ private:
|
||||
ContactData *contactData(DialogRow *row);
|
||||
|
||||
QPoint _lastMousePos;
|
||||
LinkButton _addContactLnk;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "lang.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
an unofficial desktop messaging app, see https://telegram.org
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "lang.h"
|
||||
|
||||