Version 0.10.12.alpha: major notifications update.

This commit is contained in:
John Preston 2016-10-07 16:24:19 +03:00
parent 15ee4b40dc
commit 4369c23314
9 changed files with 54 additions and 28 deletions

View File

@ -254,6 +254,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
"lng_notification_preview" = "You have a new message";
"lng_notification_reply" = "Reply";
"lng_notification_hide_all" = "Hide all";
"lng_notification_sample" = "This is a sample notification";
"lng_settings_section_general" = "General";
"lng_settings_change_lang" = "Change language";

View File

@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,10,11,0
PRODUCTVERSION 0,10,11,0
FILEVERSION 0,10,12,0
PRODUCTVERSION 0,10,12,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -51,10 +51,10 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileVersion", "0.10.11.0"
VALUE "FileVersion", "0.10.12.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2016"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "0.10.11.0"
VALUE "ProductVersion", "0.10.12.0"
END
END
BLOCK "VarFileInfo"

View File

@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,10,11,0
PRODUCTVERSION 0,10,11,0
FILEVERSION 0,10,12,0
PRODUCTVERSION 0,10,12,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -43,10 +43,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Updater"
VALUE "FileVersion", "0.10.11.0"
VALUE "FileVersion", "0.10.12.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2016"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "0.10.11.0"
VALUE "ProductVersion", "0.10.12.0"
END
END
BLOCK "VarFileInfo"

View File

@ -1085,8 +1085,8 @@ void AppClass::checkMapVersion() {
if (Local::oldMapVersion() < AppVersion) {
if (Local::oldMapVersion()) {
QString versionFeatures;
if ((cAlphaVersion() || cBetaVersion()) && Local::oldMapVersion() < 10003) {
versionFeatures = QString::fromUtf8("\xe2\x80\x94 New cute design for the Settings page");
if ((cAlphaVersion() || cBetaVersion()) && Local::oldMapVersion() < 10012) {
versionFeatures = QString::fromUtf8("Windows and Linux:\n\xe2\x80\x94 Quick reply from notifications\n\xe2\x80\x94 Hide all notifications button added\n\xe2\x80\x94 Change notifications location and maximum count\n\nLinux:\n\xe2\x80\x94 You can enable native notifications in Settings");
} else if (!(cAlphaVersion() || cBetaVersion()) && Local::oldMapVersion() < 10005) {
versionFeatures = langNewVersionText();
} else {

View File

@ -84,14 +84,27 @@ private:
_owner->removeSample(this);
}
hide();
deleteLater();
destroyDelayed();
}
}
void destroyDelayed() {
if (_deleted) return;
_deleted = true;
// Ubuntu has a lag if deleteLater() called immediately.
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
QTimer::singleShot(1000, [this] { delete this; });
#else // Q_OS_LINUX32 || Q_OS_LINUX64
deleteLater();
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
}
NotificationsBox *_owner;
QPixmap _cache;
FloatAnimation _opacity;
bool _hiding = false;
bool _deleted = false;
};

View File

@ -24,7 +24,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#define BETA_VERSION_MACRO (0ULL)
constexpr int AppVersion = 10011;
constexpr str_const AppVersionStr = "0.10.11";
constexpr bool AppAlphaVersion = false;
constexpr int AppVersion = 10012;
constexpr str_const AppVersionStr = "0.10.12";
constexpr bool AppAlphaVersion = true;
constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO;

View File

@ -296,9 +296,12 @@ void Manager::doClearAllFast() {
_queuedNotifications.clear();
auto notifications = createAndSwap(_notifications);
for_const (auto notification, notifications) {
notification->deleteLater();
delete notification;
}
if (_hideAll) {
auto hideAll = createAndSwap(_hideAll);
delete hideAll;
}
showNextFromQueue();
}
void Manager::doClearFromHistory(History *history) {
@ -347,21 +350,33 @@ Widget::Widget(QPoint startPosition, int shift, Direction shiftDirection) : TWid
, _a_shift(animation(this, &Widget::step_shift)) {
setWindowOpacity(0.);
setAttribute(Qt::WA_OpaquePaintEvent);
setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::BypassWindowManagerHint | Qt::NoDropShadowWindowHint);
setAttribute(Qt::WA_OpaquePaintEvent);
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
_a_opacity.start();
}
void Widget::destroyDelayed() {
hide();
if (_deleted) return;
_deleted = true;
// Ubuntu has a lag if deleteLater() called immediately.
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
QTimer::singleShot(1000, [this] { delete this; });
#else // Q_OS_LINUX32 || Q_OS_LINUX64
deleteLater();
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
}
void Widget::step_opacity(float64 ms, bool timer) {
float64 dt = ms / float64(_opacityDuration);
if (dt >= 1) {
a_opacity.finish();
_a_opacity.stop();
if (_hiding) {
deleteLater();
destroyDelayed();
}
} else {
a_opacity.update(dt, a_func);
@ -500,11 +515,6 @@ Notification::Notification(History *history, PeerData *peer, PeerData *author, H
prepareActionsCache();
setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::BypassWindowManagerHint | Qt::NoDropShadowWindowHint);
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_TranslucentBackground, true);
show();
}

View File

@ -148,12 +148,14 @@ protected:
virtual void updateGeometry(int x, int y, int width, int height);
private:
void destroyDelayed();
void moveByShift();
void hideAnimated(float64 duration, anim::transition func);
void step_opacity(float64 ms, bool timer);
void step_shift(float64 ms, bool timer);
bool _hiding = false;
bool _deleted = false;
float64 _opacityDuration;
anim::fvalue a_opacity;
anim::transition a_func;

View File

@ -1,6 +1,6 @@
AppVersion 10011
AppVersion 10012
AppVersionStrMajor 0.10
AppVersionStrSmall 0.10.11
AppVersionStr 0.10.11
AlphaChannel 0
AppVersionStrSmall 0.10.12
AppVersionStr 0.10.12
AlphaChannel 1
BetaVersion 0