Skip to content

Commit

Permalink
many small fixes: multi windows users running, touchscreen fix, esc f…
Browse files Browse the repository at this point in the history
…or photo hide, etc + send to menu integration on windows + hide text in notifies
  • Loading branch information
john-preston committed Jul 18, 2014
1 parent dd4b0f0 commit 070ea58
Show file tree
Hide file tree
Showing 52 changed files with 561 additions and 209 deletions.
4 changes: 2 additions & 2 deletions MSVC.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ or download in ZIP and extract to **D:\TBuild\**, rename **tdesktop-master** to

###Prepare libraries

####OpenSSL 1.0.1g
####OpenSSL 1.0.1h

https://www.openssl.org/related/binaries.html > **OpenSSL for Windows** > Download [**Win32 OpenSSL v1.0.1g** (16 Mb)](http://slproweb.com/download/Win32OpenSSL-1_0_1g.exe)
https://www.openssl.org/related/binaries.html > **OpenSSL for Windows** > Download [**Win32 OpenSSL v1.0.1h** (16 Mb)](http://slproweb.com/download/Win32OpenSSL-1_0_1h.exe)

Install to **D:\TBuild\Libraries\OpenSSL-Win32**, while installing **Copy OpenSSL DLLs to** choose **The OpenSSL binaries (/bin) directory**

Expand Down
11 changes: 2 additions & 9 deletions QTCREATOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ In Terminal go to **/home/user/TBuild/Libraries/QtStatic** and there run

building (**make** command) will take really long time.

#####Building pulseaudio plugin

In Terminal go to **/home/user/TBuild/Libraries/QtStatic/qtmultimedia/src/plugins/pulseaudio** and run

qmake pulseaudio.pro
make

###Building Telegram Desktop

* Launch Qt Creator, all projects will be taken from **/home/user/TBuild/tdesktop/Telegram**
Expand All @@ -70,6 +63,6 @@ In Terminal go to **/home/user/TBuild/Libraries/QtStatic/qtmultimedia/src/plugin
* Open MetaStyle.pro, configure project with paths **/home/user/TBuild/tdesktop/Linux/DebugIntermediateStyle** and **/home/user/TBuild/tdesktop/Linux/ReleaseIntermediateStyle** and build for Debug
* Open MetaEmoji.pro, configure project with paths **/home/user/TBuild/tdesktop/Linux/DebugIntermediateEmoji** and **/home/user/TBuild/tdesktop/Linux/ReleaseIntermediateEmoji** and build for Debug
* Open MetaLang.pro, configure project with paths **/home/user/TBuild/tdesktop/Linux/DebugIntermediateLang** and **/home/user/TBuild/tdesktop/Linux/ReleaseIntermediateLang** and build for Debug
* Open Telegram.pro, configure project with paths **/home/user/TBuild/tdesktop/Linux/DebugIntermediate** and **/home/user/TBuild/tdesktop/Linux/ReleaseIntermediate** and build for Debug
* Open Telegram.pro, configure project with paths **/home/user/TBuild/tdesktop/Linux/DebugIntermediate** and **/home/user/TBuild/tdesktop/Linux/ReleaseIntermediate** and build for Debug, if GeneratedFiles are not found click **Run qmake** from **Build** menu and try again
* Open Updater.pro, configure project with paths **/home/user/TBuild/tdesktop/Linux/DebugIntermediateUpdater** and **/home/user/TBuild/tdesktop/Linux/ReleaseIntermediateUpdater** and build for Debug
* Release Telegram build will require removing **CUSTOM_API_ID** definition in Telegram.pro project and may require changing paths in **/home/user/TBuild/tdesktop/Telegram/FixMake.sh** or **/home/user/TBuild/tdesktop/Telegram/FixMake32.sh** for static library linking fix
* Release Telegram build will require removing **CUSTOM_API_ID** definition in Telegram.pro project and may require changing paths in **/home/user/TBuild/tdesktop/Telegram/FixMake.sh** or **/home/user/TBuild/tdesktop/Telegram/FixMake32.sh** for static library linking fix, static linking applies only on second Release build (first uses old Makefile)
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ Source code is published under GPL v3, license is available [here](https://githu

###Supported systems

Only Windows and OS X systems are supported at this moment, Linux builds are on their way.

* Windows XP
* Windows Vista
* Windows 7
* Windows 8 (**not** RT)
* Windows 8.1 (**not** RT)
* OS X 10.7
* OS X 10.8
* OS X 10.9
* OS X 10.7-10.8 (not tested)
* Ubuntu 12.04
* Ubuntu 13.04
* Ubuntu 14.04
* Fedora (not tested)

###Third-party

Expand All @@ -34,7 +33,7 @@ Only Windows and OS X systems are supported at this moment, Linux builds are on

###[Build instructions for XCode 5.1.1](https://github.com/telegramdesktop/tdesktop/blob/master/XCODE.md)

###[Build instructions for Qt Creator 2.7 Ubuntu](https://github.com/telegramdesktop/tdesktop/blob/master/QTCREATOR.md)
###[Build instructions for Qt Creator 3.1.2 Ubuntu](https://github.com/telegramdesktop/tdesktop/blob/master/QTCREATOR.md)

##Projects in Telegram solution

Expand Down
8 changes: 4 additions & 4 deletions Telegram/FixMake32.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
sed -i 's/\-lxcb\-render\-util/\/usr\/lib\/libxcb\-render\-util\.a/g' Makefile
sed -i 's/\-lxcb\-render\-util/\/usr\/lib\/i386\-linux\-gnu\/libxcb\-render\-util\.a/g' Makefile
sed -i 's/\-lxcb\-render/\/usr\/lib\/i386\-linux\-gnu\/libxcb\-render\.a/g' Makefile
sed -i 's/\-lxcb\-sync/\/usr\/lib\/i386\-linux\-gnu\/libxcb\-sync\.a/g' Makefile
sed -i 's/\-lxcb\-keysyms/\/usr\/lib\/libxcb\-keysyms\.a/g' Makefile
sed -i 's/\-lxcb\-icccm/\/usr\/lib\/libxcb\-icccm\.a/g' Makefile
sed -i 's/\-lxcb\-keysyms/\/usr\/lib\/i386\-linux\-gnu\/libxcb\-keysyms\.a/g' Makefile
sed -i 's/\-lxcb\-icccm/\/usr\/lib\/i386\-linux\-gnu\/libxcb\-icccm\.a/g' Makefile
sed -i 's/\-lxcb\-xfixes/\/usr\/lib\/i386\-linux\-gnu\/libxcb\-xfixes\.a/g' Makefile
sed -i 's/\-lxcb\-shm/\/usr\/lib\/i386\-linux\-gnu\/libxcb\-shm\.a/g' Makefile
sed -i 's/\-lxcb\-randr/\/usr\/lib\/i386\-linux\-gnu\/libxcb\-randr\.a/g' Makefile
sed -i 's/\-lxcb\-shape/\/usr\/lib\/i386\-linux\-gnu\/libxcb\-shape\.a/g' Makefile
sed -i 's/\-lxcb\-image/\/usr\/lib\/libxcb\-image\.a \/usr\/lib\/i386\-linux\-gnu\/libxcb\-util\.a/g' Makefile
sed -i 's/\-lxcb\-image/\/usr\/lib\/i386\-linux\-gnu\/libxcb\-image\.a \/usr\/lib\/i386\-linux\-gnu\/libxcb\-util\.a/g' Makefile
sed -i 's/\-llzma/\/usr\/lib\/i386\-linux\-gnu\/liblzma\.a/g' Makefile
sed -i 's/\-lz/\/usr\/lib\/i386\-linux\-gnu\/libz\.a/g' Makefile
sed -i 's/\-lssl/\/usr\/lib\/i386\-linux\-gnu\/libssl\.a/g' Makefile
Expand Down
4 changes: 2 additions & 2 deletions Telegram/PrepareLinux.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AppVersionStr=0.5.8
AppVersion=5008
AppVersionStr=0.5.9
AppVersion=5009

if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
Expand Down
4 changes: 2 additions & 2 deletions Telegram/PrepareLinux32.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AppVersionStr=0.5.8
AppVersion=5008
AppVersionStr=0.5.9
AppVersion=5009

if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
Expand Down
6 changes: 3 additions & 3 deletions Telegram/PrepareMac.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AppVersionStr=0.5.8
AppVersion=5008
AppVersionStr=0.5.9
AppVersion=5009

if [ -d "./../Mac/Release/deploy/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
Expand Down Expand Up @@ -27,7 +27,7 @@ if [ ! -f "./../Mac/Release/Telegram.app/Contents/MacOS/Telegram" ]; then
fi

if [ ! -f "./../Mac/Release/Telegram.app/Contents/Frameworks/Updater" ]; then
echo "Icon.icns not found in Resources!"
echo "Updater not found in Frameworks!"
exit 1
fi

Expand Down
12 changes: 11 additions & 1 deletion Telegram/Resources/lang.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ lng_status_lastseen_hours: "%1 hours ago";
lng_status_lastseen_today: "today at {time}";
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_chat_no_members: "Group is unaccessible";
Expand Down Expand Up @@ -138,7 +139,12 @@ lng_settings_uploading_photo: "Uploading photo...";

lng_settings_section_notify: "Notifications";
lng_settings_desktop_notify: "Desktop notifications";
lng_settings_sound_notify: "Sound";
lng_settings_show_name: "Show sender's name";
lng_settings_show_preview: "Show message preview";
lng_settings_sound_notify: "Sound notification";

lng_notification_title: "Telegram Desktop";
lng_notification_preview: "You have a new message";

lng_settings_section_general: "General";
lng_settings_auto_update: "Update automatically";
Expand All @@ -154,6 +160,7 @@ lng_settings_workmode_tray: "Show tray icon";
lng_settings_workmode_window: "Show taskbar icon";
lng_settings_auto_start: "Launch Telegram when system starts";
lng_settings_start_min: "Launch minimized";
lng_settings_add_sendto: "Place Telegram in «Send to» menu";
lng_settings_scale_label: "Interface scale";
lng_settings_scale_auto: "Auto ({cur})";

Expand Down Expand Up @@ -338,7 +345,10 @@ lng_really_send_image: "Do you want to send this image?";
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}?";
lng_forward_send_files_confirm: "Send selected files to {recipient}?";
lng_forward: "Forward";
lng_forward_send: "Send";

lng_contact_phone: "Phone number";
lng_enter_contact_data: "New Contact";
Expand Down
24 changes: 14 additions & 10 deletions Telegram/Resources/style.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,20 @@ cbDefFlat: flatCheckbox {

disabledCursor: cursor(default);

imageRect: sprite(144px, 68px, 22px, 22px);
chkImageRect: sprite(119px, 68px, 22px, 22px);
overImageRect: sprite(144px, 68px, 22px, 22px);
chkOverImageRect: sprite(119px, 68px, 22px, 22px);
disImageRect: sprite(193px, 68px, 22px, 22px);
chkDisImageRect: sprite(193px, 68px, 22px, 22px);
imageRect: sprite(140px, 68px, 22px, 22px);
chkImageRect: sprite(115px, 68px, 22px, 22px);
overImageRect: sprite(140px, 68px, 22px, 22px);
chkOverImageRect: sprite(115px, 68px, 22px, 22px);
disImageRect: sprite(140px, 43px, 22px, 22px);
chkDisImageRect: sprite(115px, 43px, 22px, 22px);

imagePos: point(0px, 0px);
}

rbDefFlat: flatCheckbox(cbDefFlat) {
chkImageRect: sprite(169px, 68px, 22px, 22px);
chkOverImageRect: sprite(169px, 68px, 22px, 22px);
chkImageRect: sprite(165px, 68px, 22px, 22px);
chkOverImageRect: sprite(165px, 68px, 22px, 22px);
chkDisImageRect: sprite(165px, 43px, 22px, 22px);
}

inpDefFont: font(17px);
Expand Down Expand Up @@ -1243,8 +1244,11 @@ aboutHeight: 441px;
aboutHeaderFont: font(24px semibold);
aboutSubheaderFont: font(24px);
aboutHeaderTop: 139px;
aboutVersionFont: font(16px);
aboutVersionColor: #999;
aboutVersion: flatLabel(labelDefFlat) {
font: font(16px);
width: aboutWidth;
align: align(center);
}
aboutVersionTop: 178px;
aboutTextFont: font(15px);
aboutTextTop: 221px;
Expand Down
6 changes: 3 additions & 3 deletions Telegram/Setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#define MyAppShortName "Telegram"
#define MyAppName "Telegram Win (Unofficial)"
#define MyAppVersion "0.5.8"
#define MyAppVersionZero "0.5.8"
#define MyAppFullVersion "0.5.8.0"
#define MyAppVersion "0.5.9"
#define MyAppVersionZero "0.5.9"
#define MyAppFullVersion "0.5.9.0"
#define MyAppPublisher "Telegram (Unofficial)"
#define MyAppURL "https://tdesktop.com"
#define MyAppExeName "Telegram.exe"
Expand Down
22 changes: 0 additions & 22 deletions Telegram/SourceFiles/_other/Lang.plist

This file was deleted.

1 change: 1 addition & 0 deletions Telegram/SourceFiles/_other/packer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ int main(int argc, char *argv[])
QString outName(QString("tlinux32upd%1").arg(version));
#elif defined Q_OS_LINUX64
QString outName(QString("tlinuxupd%1").arg(version));
#else
#error Unknown platform!
#endif
QFile out(outName);
Expand Down
39 changes: 34 additions & 5 deletions Telegram/SourceFiles/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,25 @@ namespace App {
return dNow.secsTo(dTomorrow);
}

QString onlineText(int32 online, int32 now) {
QString onlineText(int32 online, int32 now, bool precise) {
if (!online) return lang(lng_status_offline);
if (online < 0) return lang(lng_status_invisible);
if (online > now) {
return lang(lng_status_online);
}
int32 minutes = (now - online) / 60;
QString when;
if (precise) {
QDateTime dOnline(date(online)), dNow(date(now));
if (dOnline.date() == dNow.date()) {
when = lang(lng_status_lastseen_today).replace(qsl("{time}"), dOnline.time().toString(qsl("hh:mm")));
} else if (dOnline.date().addDays(1) == dNow.date()) {
when = lang(lng_status_lastseen_yesterday).replace(qsl("{time}"), dOnline.time().toString(qsl("hh:mm")));
} else {
when = lang(lng_status_lastseen_date_time).replace(qsl("{date}"), dOnline.date().toString(qsl("dd.MM.yy"))).replace(qsl("{time}"), dOnline.time().toString(qsl("hh:mm")));
}
return lang(lng_status_lastseen).replace(qsl("{when}"), when);
}
int32 minutes = (now - online) / 60;
if (!minutes) {
when = lang(lng_status_lastseen_now);
} else if (minutes == 1) {
Expand All @@ -211,9 +222,6 @@ namespace App {
}
}
}
if (when.isEmpty()) {
int a = 0;
}
return lang(lng_status_lastseen).replace(qsl("{when}"), when);
}

Expand Down Expand Up @@ -1137,6 +1145,9 @@ namespace App {
if (::mousedItem == item) {
mousedItem(0);
}
if (App::wnd()) {
App::wnd()->notifyItemRemoved(item);
}
}

void historyUnregItem(HistoryItem *item) {
Expand Down Expand Up @@ -1360,6 +1371,7 @@ namespace App {

configStream << quint32(dbiAutoStart) << qint32(cAutoStart());
configStream << quint32(dbiStartMinimized) << qint32(cStartMinimized());
configStream << quint32(dbiSendToMenu) << qint32(cSendToMenu());
configStream << quint32(dbiWorkMode) << qint32(cWorkMode());
configStream << quint32(dbiSeenTrayTooltip) << qint32(cSeenTrayTooltip());
configStream << quint32(dbiAutoUpdate) << qint32(cAutoUpdate());
Expand Down Expand Up @@ -1421,6 +1433,12 @@ namespace App {
cSetStartMinimized(v == 1);
} break;

case dbiSendToMenu: {
qint32 v;
configStream >> v;
cSetSendToMenu(v == 1);
} break;

case dbiSoundNotify: {
if (configVersion < 3008) {
qint32 v;
Expand Down Expand Up @@ -1542,6 +1560,7 @@ namespace App {
stream << quint32(dbiDefaultAttach) << qint32(cDefaultAttach());
stream << quint32(dbiSoundNotify) << qint32(cSoundNotify());
stream << quint32(dbiDesktopNotify) << qint32(cDesktopNotify());
stream << quint32(dbiNotifyView) << qint32(cNotifyView());
stream << quint32(dbiAskDownloadPath) << qint32(cAskDownloadPath());
stream << quint32(dbiDownloadPath) << (cAskDownloadPath() ? QString() : cDownloadPath());
stream << quint32(dbiEmojiTab) << qint32(cEmojiTab());
Expand Down Expand Up @@ -1704,6 +1723,16 @@ namespace App {
cSetDesktopNotify(v == 1);
} break;

case dbiNotifyView: {
qint32 v;
stream >> v;
switch (v) {
case dbinvShowNothing: cSetNotifyView(dbinvShowNothing); break;
case dbinvShowName: cSetNotifyView(dbinvShowName); break;
default: cSetNotifyView(dbinvShowPreview); break;
}
}

case dbiAskDownloadPath: {
qint32 v;
stream >> v;
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace App {
int32 chatFromPeer(const PeerId &peer_id);

int32 onlineWillChangeIn(int32 onlineOnServer, int32 nowOnServer);
QString onlineText(int32 onlineOnServer, int32 nowOnServer);
QString onlineText(int32 onlineOnServer, int32 nowOnServer, bool precise = false);

void feedUsers(const MTPVector<MTPUser> &users);
void feedChats(const MTPVector<MTPChat> &chats);
Expand Down
Loading

0 comments on commit 070ea58

Please sign in to comment.