Allow to change app. name using CMake cache

This commit is contained in:
fox.cpp 2018-01-17 22:09:12 +03:00 committed by Alex
parent e190620cb8
commit dc231f2e29
21 changed files with 50 additions and 49 deletions

View File

@ -170,6 +170,16 @@ foreach (src ${style_files})
endforeach() endforeach()
##================================================
## Branding
##================================================
set(KEPKA_APPNAME "Kepka"
CACHE STRING "Application name")
configure_file(SourceFiles/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
##================================================ ##================================================
## Telegram app ## Telegram app
##================================================ ##================================================

View File

@ -20,6 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#include "boxes/about_box.h" #include "boxes/about_box.h"
#include "config.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "mainwidget.h" #include "mainwidget.h"
#include "mainwindow.h" #include "mainwindow.h"
@ -39,7 +40,7 @@ AboutBox::AboutBox(QWidget *parent)
void AboutBox::prepare() { void AboutBox::prepare() {
constexpr auto test = std::is_convertible<const char*, QString>::value; constexpr auto test = std::is_convertible<const char*, QString>::value;
setTitle([] { return qsl("Telegram Desktop"); }); setTitle([] { return str_const_toString(AppName); });
addButton(langFactory(lng_close), [this] { closeBox(); }); addButton(langFactory(lng_close), [this] { closeBox(); });

View File

@ -20,6 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#include "boxes/notifications_box.h" #include "boxes/notifications_box.h"
#include "config.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "ui/widgets/buttons.h" #include "ui/widgets/buttons.h"
#include "ui/widgets/discrete_sliders.h" #include "ui/widgets/discrete_sliders.h"
@ -292,7 +293,7 @@ void NotificationsBox::prepareNotificationSampleLarge() {
p.setPen(st::dialogsNameFg); p.setPen(st::dialogsNameFg);
p.setFont(st::msgNameFont); p.setFont(st::msgNameFont);
auto notifyTitle = st::msgNameFont->elided(qsl("Telegram Desktop"), rectForName.width()); auto notifyTitle = st::msgNameFont->elided(str_const_toString(AppName), rectForName.width());
p.drawText(rectForName.left(), rectForName.top() + st::msgNameFont->ascent, notifyTitle); p.drawText(rectForName.left(), rectForName.top() + st::msgNameFont->ascent, notifyTitle);
st::notifyClose.icon.paint(p, w - st::notifyClosePos.x() - st::notifyClose.width + st::notifyClose.iconPosition.x(), st::notifyClosePos.y() + st::notifyClose.iconPosition.y(), w); st::notifyClose.icon.paint(p, w - st::notifyClosePos.x() - st::notifyClose.width + st::notifyClose.iconPosition.x(), st::notifyClosePos.y() + st::notifyClose.iconPosition.y(), w);

View File

@ -106,7 +106,7 @@ void SessionsBox::gotAuthorizations(const MTPaccount_Authorizations &result) {
QString appName, appVer = qs(d.vapp_version), systemVer = qs(d.vsystem_version), deviceModel = qs(d.vdevice_model); QString appName, appVer = qs(d.vapp_version), systemVer = qs(d.vsystem_version), deviceModel = qs(d.vdevice_model);
if (d.vapi_id.v == 2040 || d.vapi_id.v == 17349) { if (d.vapi_id.v == 2040 || d.vapi_id.v == 17349) {
appName = (d.vapi_id.v == 2040) ? qstr("Telegram Desktop") : qstr("Telegram Desktop (GitHub)"); appName = str_const_toString(AppName);
// if (systemVer == qstr("windows")) { // if (systemVer == qstr("windows")) {
// deviceModel = qsl("Windows"); // deviceModel = qsl("Windows");
// } else if (systemVer == qstr("os x")) { // } else if (systemVer == qstr("os x")) {

View File

@ -23,8 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "core/version.h" #include "core/version.h"
#include "settings.h" #include "settings.h"
constexpr str_const AppNameOld = "Telegram Win (Unofficial)"; constexpr str_const AppName = "${KEPKA_APPNAME}";
constexpr str_const AppName = "Telegram Desktop";
constexpr str_const AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"; // used in updater.cpp and Setup.iss for Windows constexpr str_const AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"; // used in updater.cpp and Setup.iss for Windows
constexpr str_const AppFile = "Telegram"; constexpr str_const AppFile = "Telegram";

View File

@ -20,6 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#include "intro/introstart.h" #include "intro/introstart.h"
#include "config.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "application.h" #include "application.h"
#include "intro/introphone.h" #include "intro/introphone.h"
@ -30,7 +31,7 @@ namespace Intro {
StartWidget::StartWidget(QWidget *parent, Widget::Data *data) : Step(parent, data, true) { StartWidget::StartWidget(QWidget *parent, Widget::Data *data) : Step(parent, data, true) {
setMouseTracking(true); setMouseTracking(true);
setTitleText([] { return qsl("Telegram Desktop"); }); setTitleText([] { return str_const_toString(AppName); });
setDescriptionText(langFactory(lng_intro_about)); setDescriptionText(langFactory(lng_intro_about));
show(); show();
} }

View File

@ -376,11 +376,6 @@ namespace Logs {
return; return;
} }
#ifdef Q_OS_WIN
if (cWorkingDir() == psAppDataPath()) { // fix old "Telegram Win (Unofficial)" version
moveOldDataFrom = psAppDataPathOld();
}
#endif
if (!moveOldDataFrom.isEmpty()) { if (!moveOldDataFrom.isEmpty()) {
_moveOldDataFiles(moveOldDataFrom); _moveOldDataFiles(moveOldDataFrom);
} }

View File

@ -18,6 +18,8 @@ to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#include "stdafx.h"
#include "application.h" #include "application.h"
#include "platform/platform_specific.h" #include "platform/platform_specific.h"
#include "storage/localstorage.h" #include "storage/localstorage.h"
@ -27,7 +29,7 @@ int main(int argc, char *argv[]) {
// Retina display support is working fine, others are not. // Retina display support is working fine, others are not.
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true); QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true);
#endif // not defined Q_OS_MAC and QT_VERSION >= 5.6.0 #endif // not defined Q_OS_MAC and QT_VERSION >= 5.6.0
QCoreApplication::setApplicationName(qsl("Kepka")); QCoreApplication::setApplicationName(str_const_toString(AppName));
InitFromCommandLine(argc, argv); InitFromCommandLine(argc, argv);
if (cLaunchMode() == LaunchModeFixPrevious) { if (cLaunchMode() == LaunchModeFixPrevious) {

View File

@ -3709,7 +3709,7 @@ void MainWidget::gotDifference(const MTPupdates_Difference &difference) {
} break; } break;
case mtpc_updates_differenceTooLong: { case mtpc_updates_differenceTooLong: {
auto &d = difference.c_updates_differenceTooLong(); auto &d = difference.c_updates_differenceTooLong();
LOG(("API Error: updates.differenceTooLong is not supported by Telegram Desktop!")); LOG(("API Error: updates.differenceTooLong is not supported by %1!").arg(str_const_toString(AppName)));
} break; } break;
}; };
} }

View File

@ -985,7 +985,7 @@ PreLaunchWindow::PreLaunchWindow(QString title) {
setWindowIcon(icon); setWindowIcon(icon);
setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint); setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
setWindowTitle(title.isEmpty() ? qsl("Telegram") : title); setWindowTitle(title.isEmpty() ? str_const_toString(AppName) : title);
QPalette p(palette()); QPalette p(palette());
p.setColor(QPalette::Background, QColor(255, 255, 255)); p.setColor(QPalette::Background, QColor(255, 255, 255));
@ -1118,7 +1118,7 @@ NotStartedWindow::NotStartedWindow()
: _label(this) : _label(this)
, _log(this) , _log(this)
, _close(this) { , _close(this) {
_label.setText(qsl("Could not start Telegram Desktop!\nYou can see complete log below:")); _label.setText(qsl("Could not start %1!\nYou can see complete log below:").arg(str_const_toString(AppName)));
_log.setPlainText(Logs::full()); _log.setPlainText(Logs::full());
@ -1246,9 +1246,9 @@ LastCrashedWindow::LastCrashedWindow()
connect(&_networkSettings, SIGNAL(clicked()), this, SLOT(onNetworkSettings())); connect(&_networkSettings, SIGNAL(clicked()), this, SLOT(onNetworkSettings()));
if (_sendingState == SendingNoReport) { if (_sendingState == SendingNoReport) {
_label.setText(qsl("Last time Telegram Desktop was not closed properly.")); _label.setText(qsl("Last time %1 was not closed properly.").arg(str_const_toString(AppName)));
} else { } else {
_label.setText(qsl("Last time Telegram Desktop crashed :(")); _label.setText(qsl("Last time %1 crashed :(").arg(str_const_toString(AppName)));
} }
_updating.setText(qsl("Please check if there is a new version available.")); _updating.setText(qsl("Please check if there is a new version available."));
@ -1292,7 +1292,7 @@ void LastCrashedWindow::onViewReport() {
} }
void LastCrashedWindow::onSaveReport() { void LastCrashedWindow::onSaveReport() {
QString to = QFileDialog::getSaveFileName(0, qsl("Telegram Crash Report"), QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + qsl("/report.telegramcrash"), qsl("Telegram crash report (*.telegramcrash)")); QString to = QFileDialog::getSaveFileName(0, qsl("%1 Crash Report").arg(str_const_toString(AppName)), QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + qsl("/report.telegramcrash"), qsl("%1 crash report (*.telegramcrash)").arg(str_const_toString(AppName)));
if (!to.isEmpty()) { if (!to.isEmpty()) {
QFile file(to); QFile file(to);
if (file.open(QIODevice::WriteOnly)) { if (file.open(QIODevice::WriteOnly)) {
@ -1400,12 +1400,12 @@ void LastCrashedWindow::onCheckingFinished() {
LOG(("Crash report check for sending done, result: %1").arg(QString::fromUtf8(result))); LOG(("Crash report check for sending done, result: %1").arg(QString::fromUtf8(result)));
if (result == "Old") { if (result == "Old") {
_pleaseSendReport.setText(qsl("This report is about some old version of Telegram Desktop.")); _pleaseSendReport.setText(qsl("This report is about some old version of %1.").arg(str_const_toString(AppName)));
_sendingState = SendingTooOld; _sendingState = SendingTooOld;
updateControls(); updateControls();
return; return;
} else if (result == "Unofficial") { } else if (result == "Unofficial") {
_pleaseSendReport.setText(qsl("You use some custom version of Telegram Desktop.")); _pleaseSendReport.setText(qsl("You use some custom version of %1.").arg(str_const_toString(AppName)));
_sendingState = SendingUnofficial; _sendingState = SendingUnofficial;
updateControls(); updateControls();
return; return;
@ -1546,7 +1546,7 @@ void LastCrashedWindow::updateControls() {
h += _networkSettings.height() + padding; h += _networkSettings.height() + padding;
QRect scr(QApplication::primaryScreen()->availableGeometry()); QRect scr(QApplication::primaryScreen()->availableGeometry());
QSize s(2 * padding + QFontMetrics(_label.font()).width(qsl("Last time Telegram Desktop was not closed properly.")) + padding + _networkSettings.width(), h); QSize s(2 * padding + QFontMetrics(_label.font()).width(qsl("Last time %1 was not closed properly.").arg(str_const_toString(AppName))) + padding + _networkSettings.width(), h);
if (s == size()) { if (s == size()) {
resizeEvent(0); resizeEvent(0);
} else { } else {

View File

@ -476,7 +476,7 @@ void MainWindow::psCreateTrayIcon() {
QFileInfo iconFile(_trayIconImageFile()); QFileInfo iconFile(_trayIconImageFile());
if (iconFile.exists()) { if (iconFile.exists()) {
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath()); QByteArray path = QFile::encodeName(iconFile.absoluteFilePath());
_trayIndicator = Libs::app_indicator_new("Telegram Desktop", path.constData(), APP_INDICATOR_CATEGORY_APPLICATION_STATUS); _trayIndicator = Libs::app_indicator_new(AppName.c_str(), path.constData(), APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
if (_trayIndicator) { if (_trayIndicator) {
LOG(("Tray Icon: Using appindicator tray icon.")); LOG(("Tray Icon: Using appindicator tray icon."));
} else { } else {
@ -517,8 +517,8 @@ void MainWindow::psCreateTrayIcon() {
Libs::g_signal_connect_helper(_trayIcon, "activate", GCallback(_trayIconActivate), _trayMenu); Libs::g_signal_connect_helper(_trayIcon, "activate", GCallback(_trayIconActivate), _trayMenu);
Libs::g_signal_connect_helper(_trayIcon, "size-changed", GCallback(_trayIconResized), _trayMenu); Libs::g_signal_connect_helper(_trayIcon, "size-changed", GCallback(_trayIconResized), _trayMenu);
Libs::gtk_status_icon_set_title(_trayIcon, "Telegram Desktop"); Libs::gtk_status_icon_set_title(_trayIcon, AppName.c_str());
Libs::gtk_status_icon_set_tooltip_text(_trayIcon, "Telegram Desktop"); Libs::gtk_status_icon_set_tooltip_text(_trayIcon, AppName.c_str());
Libs::gtk_status_icon_set_visible(_trayIcon, true); Libs::gtk_status_icon_set_visible(_trayIcon, true);
} else { } else {
useStatusIcon = false; useStatusIcon = false;

View File

@ -20,6 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#include "platform/linux/notifications_manager_linux.h" #include "platform/linux/notifications_manager_linux.h"
#include "config.h"
#include "window/notifications_utilities.h" #include "window/notifications_utilities.h"
#include "platform/linux/linux_libnotify.h" #include "platform/linux/linux_libnotify.h"
#include "platform/linux/linux_libs.h" #include "platform/linux/linux_libs.h"
@ -242,7 +243,7 @@ QString GetServerName() {
if (!LibNotifyLoaded()) { if (!LibNotifyLoaded()) {
return QString(); return QString();
} }
if (!Libs::notify_is_initted() && !Libs::notify_init("Telegram Desktop")) { if (!Libs::notify_is_initted() && !Libs::notify_init(AppName.c_str())) {
LOG(("LibNotify Error: failed to init!")); LOG(("LibNotify Error: failed to init!"));
return QString(); return QString();
} }

View File

@ -456,13 +456,14 @@ void psRegisterCustomScheme() {
s.setCodec("UTF-8"); s.setCodec("UTF-8");
s << "[Desktop Entry]\n"; s << "[Desktop Entry]\n";
s << "Version=1.0\n"; s << "Version=1.0\n";
s << "Name=Telegram Desktop\n"; s << "Name=" << str_const_toString(AppName) << '\n';
s << "Comment=Official desktop version of Telegram messaging app\n"; s << "Comment=Unofficial desktop version of Telegram messaging app\n";
s << "TryExec=" << EscapeShell(QFile::encodeName(cExeDir() + cExeName())) << "\n"; s << "TryExec=" << EscapeShell(QFile::encodeName(cExeDir() + cExeName())) << "\n";
s << "Exec=" << EscapeShell(QFile::encodeName(cExeDir() + cExeName())) << " -- %u\n"; s << "Exec=" << EscapeShell(QFile::encodeName(cExeDir() + cExeName())) << " -- %u\n";
s << "Icon=telegram\n"; s << "Icon=telegram\n";
s << "Terminal=false\n"; s << "Terminal=false\n";
s << "StartupWMClass=Kepka\n"; s << "StartupWMClass=Kepka\n";
s << "StartupWMClass=" << str_const_toString(AppName) << '\n';
s << "Type=Application\n"; s << "Type=Application\n";
s << "Categories=Network;InstantMessaging;Qt;\n"; s << "Categories=Network;InstantMessaging;Qt;\n";
s << "MimeType=x-scheme-handler/tg;\n"; s << "MimeType=x-scheme-handler/tg;\n";

View File

@ -406,8 +406,8 @@ void MainWindow::psFirstShow() {
} }
void MainWindow::createGlobalMenu() { void MainWindow::createGlobalMenu() {
auto main = psMainMenu.addMenu(qsl("Telegram")); auto main = psMainMenu.addMenu(str_const_toString(AppName));
auto about = main->addAction(lng_mac_menu_about_telegram(lt_telegram, qsl("Telegram"))); auto about = main->addAction(lng_mac_menu_about_telegram(lt_telegram, str_const_toString(AppName)));
connect(about, &QAction::triggered, about, [] { connect(about, &QAction::triggered, about, [] {
if (App::wnd() && App::wnd()->isHidden()) App::wnd()->showFromTray(); if (App::wnd() && App::wnd()->isHidden()) App::wnd()->showFromTray();
Ui::show(Box<AboutBox>()); Ui::show(Box<AboutBox>());

View File

@ -146,7 +146,7 @@ void PreviewWindowTitle(Painter &p, const style::palette &palette, QRect body, i
p.setPen(st::titleFgActive[palette]); p.setPen(st::titleFgActive[palette]);
p.setFont(font); p.setFont(font);
p.drawText(titleRect, qsl("Telegram"), style::al_center); p.drawText(titleRect, str_const_toString(AppName), style::al_center);
auto isGraphite = ([NSColor currentControlTint] == NSGraphiteControlTint); auto isGraphite = ([NSColor currentControlTint] == NSGraphiteControlTint);
auto buttonSkip = 8; auto buttonSkip = 8;

View File

@ -169,7 +169,7 @@ QString psAppDataPath() {
if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) {
QDir appData(QString::fromStdWString(std::wstring(wstrPath))); QDir appData(QString::fromStdWString(std::wstring(wstrPath)));
#ifdef OS_WIN_STORE #ifdef OS_WIN_STORE
return appData.absolutePath() + qsl("/Telegram Desktop UWP/"); return appData.absolutePath() + '/' + str_const_toString(AppName) + qsl(" UWP/"));
#else // OS_WIN_STORE #else // OS_WIN_STORE
return appData.absolutePath() + '/' + str_const_toString(AppName) + '/'; return appData.absolutePath() + '/' + str_const_toString(AppName) + '/';
#endif // OS_WIN_STORE #endif // OS_WIN_STORE
@ -177,16 +177,6 @@ QString psAppDataPath() {
return QString(); return QString();
} }
QString psAppDataPathOld() {
static const int maxFileLen = MAX_PATH * 10;
WCHAR wstrPath[maxFileLen];
if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) {
QDir appData(QString::fromStdWString(std::wstring(wstrPath)));
return appData.absolutePath() + '/' + str_const_toString(AppNameOld) + '/';
}
return QString();
}
QString psDownloadPath() { QString psDownloadPath() {
return QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + '/' + str_const_toString(AppName) + '/'; return QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + '/' + str_const_toString(AppName) + '/';
} }
@ -596,8 +586,8 @@ void RegisterCustomScheme() {
if (!_psOpenRegKey(L"Software\\TelegramDesktop", &rkey)) return; if (!_psOpenRegKey(L"Software\\TelegramDesktop", &rkey)) return;
if (!_psOpenRegKey(L"Software\\TelegramDesktop\\Capabilities", &rkey)) return; if (!_psOpenRegKey(L"Software\\TelegramDesktop\\Capabilities", &rkey)) return;
if (!_psSetKeyValue(rkey, L"ApplicationName", qsl("Telegram Desktop"))) return; if (!_psSetKeyValue(rkey, L"ApplicationName", str_const_toString(AppName))) return;
if (!_psSetKeyValue(rkey, L"ApplicationDescription", qsl("Telegram Desktop"))) return; if (!_psSetKeyValue(rkey, L"ApplicationDescription", str_const_toString(AppName))) return;
if (!_psOpenRegKey(L"Software\\TelegramDesktop\\Capabilities\\UrlAssociations", &rkey)) return; if (!_psOpenRegKey(L"Software\\TelegramDesktop\\Capabilities\\UrlAssociations", &rkey)) return;
if (!_psSetKeyValue(rkey, L"tg", qsl("tdesktop.tg"))) return; if (!_psSetKeyValue(rkey, L"tg", qsl("tdesktop.tg"))) return;

View File

@ -78,7 +78,6 @@ void psClearInitLogs();
void psActivateProcess(quint64 pid = 0); void psActivateProcess(quint64 pid = 0);
QString psLocalServerPrefix(); QString psLocalServerPrefix();
QString psAppDataPath(); QString psAppDataPath();
QString psAppDataPathOld();
QString psDownloadPath(); QString psDownloadPath();
void psAutoStart(bool start, bool silent = false); void psAutoStart(bool start, bool silent = false);
void psSendToMenu(bool send, bool silent = false); void psSendToMenu(bool send, bool silent = false);

View File

@ -61,7 +61,7 @@ MainWindow::MainWindow() : QWidget()
, _positionUpdatedTimer(this) , _positionUpdatedTimer(this)
, _body(this) , _body(this)
, _icon(CreateIcon()) , _icon(CreateIcon())
, _titleText(qsl("Telegram")) { , _titleText(str_const_toString(AppName)) {
subscribe(Theme::Background(), [this](const Theme::BackgroundUpdate &data) { subscribe(Theme::Background(), [this](const Theme::BackgroundUpdate &data) {
if (data.paletteChanged()) { if (data.paletteChanged()) {
if (_title) { if (_title) {
@ -275,7 +275,7 @@ void MainWindow::updateUnreadCounter() {
if (!Global::started() || App::quitting()) return; if (!Global::started() || App::quitting()) return;
auto counter = App::histories().unreadBadge(); auto counter = App::histories().unreadBadge();
_titleText = (counter > 0) ? qsl("Telegram (%1)").arg(counter) : qsl("Telegram"); _titleText = (counter > 0) ? (str_const_toString(AppName) + "(%1)").arg(counter) : str_const_toString(AppName);
unreadCounterChangedHook(); unreadCounterChangedHook();
} }

View File

@ -422,7 +422,7 @@ void Manager::notificationReplied(PeerId peerId, MsgId msgId, const QString &rep
void NativeManager::doShowNotification(HistoryItem *item, int forwardedCount) { void NativeManager::doShowNotification(HistoryItem *item, int forwardedCount) {
auto options = getNotificationOptions(item); auto options = getNotificationOptions(item);
QString title = options.hideNameAndPhoto ? qsl("Telegram Desktop") : item->history()->peer->name; QString title = options.hideNameAndPhoto ? str_const_toString(AppName) : item->history()->peer->name;
QString subtitle = options.hideNameAndPhoto ? QString() : item->notificationHeader(); QString subtitle = options.hideNameAndPhoto ? QString() : item->notificationHeader();
QString text = options.hideMessageText ? lang(lng_notification_preview) : (forwardedCount < 2 ? item->notificationText() : lng_forward_messages(lt_count, forwardedCount)); QString text = options.hideMessageText ? lang(lng_notification_preview) : (forwardedCount < 2 ? item->notificationText() : lng_forward_messages(lt_count, forwardedCount));

View File

@ -20,6 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#include "window/notifications_manager_default.h" #include "window/notifications_manager_default.h"
#include "config.h"
#include "platform/platform_notifications_manager.h" #include "platform/platform_notifications_manager.h"
#include "application.h" #include "application.h"
#include "messenger.h" #include "messenger.h"
@ -695,7 +696,7 @@ void Notification::updateNotifyDisplay() {
_history->peer->dialogName().drawElided(p, rectForName.left(), rectForName.top(), rectForName.width()); _history->peer->dialogName().drawElided(p, rectForName.left(), rectForName.top(), rectForName.width());
} else { } else {
p.setFont(st::msgNameFont); p.setFont(st::msgNameFont);
static QString notifyTitle = st::msgNameFont->elided(qsl("Telegram Desktop"), rectForName.width()); static QString notifyTitle = st::msgNameFont->elided(str_const_toString(AppName), rectForName.width());
p.drawText(rectForName.left(), rectForName.top() + st::msgNameFont->ascent, notifyTitle); p.drawText(rectForName.left(), rectForName.top() + st::msgNameFont->ascent, notifyTitle);
} }
} }

View File

@ -65,7 +65,7 @@ MainMenu::MainMenu(QWidget *parent) : TWidget(parent)
}); });
refreshMenu(); refreshMenu();
_telegram->setRichText(textcmdLink(1, qsl("Telegram Desktop"))); _telegram->setRichText(textcmdLink(1, str_const_toString(AppName)));
_telegram->setLink(1, MakeShared<UrlClickHandler>(qsl("https://desktop.telegram.org"))); _telegram->setLink(1, MakeShared<UrlClickHandler>(qsl("https://desktop.telegram.org")));
_version->setRichText(textcmdLink(1, lng_settings_current_version(lt_version, currentVersionText())) + QChar(' ') + QChar(8211) + QChar(' ') + textcmdLink(2, lang(lng_menu_about))); _version->setRichText(textcmdLink(1, lng_settings_current_version(lt_version, currentVersionText())) + QChar(' ') + QChar(8211) + QChar(' ') + textcmdLink(2, lang(lng_menu_about)));
_version->setLink(1, MakeShared<UrlClickHandler>(qsl("https://desktop.telegram.org/changelog"))); _version->setLink(1, MakeShared<UrlClickHandler>(qsl("https://desktop.telegram.org/changelog")));