From 5bcba600e63e5c759b6bfcbce25390ba4f5e0cdd Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 20 Dec 2014 00:20:30 +0300 Subject: [PATCH] basic languages support and italian language added --- .gitignore | 1 + Telegram/Resources/lang.strings | 12 ++- Telegram/Resources/style.txt | 10 ++ Telegram/SourceFiles/_other/genlang.cpp | 60 ++++++++++-- Telegram/SourceFiles/app.cpp | 9 ++ Telegram/SourceFiles/application.cpp | 36 +++++-- Telegram/SourceFiles/application.h | 1 + Telegram/SourceFiles/intro/intro.cpp | 15 +++ Telegram/SourceFiles/intro/intro.h | 4 + Telegram/SourceFiles/intro/introsteps.cpp | 30 +++++- Telegram/SourceFiles/intro/introsteps.h | 2 + Telegram/SourceFiles/lang.h | 18 ++++ Telegram/SourceFiles/langloaderplain.cpp | 112 ++++++++++++++++++---- Telegram/SourceFiles/langloaderplain.h | 30 +++++- Telegram/SourceFiles/pspecific_mac.cpp | 2 +- Telegram/SourceFiles/pspecific_wnd.cpp | 3 +- Telegram/SourceFiles/settings.cpp | 7 +- Telegram/SourceFiles/settings.h | 3 +- Telegram/SourceFiles/settingswidget.cpp | 19 +++- Telegram/SourceFiles/settingswidget.h | 4 + Telegram/SourceFiles/sysbuttons.cpp | 1 + Telegram/SourceFiles/telegram.qrc | 3 + Telegram/SourceFiles/types.h | 1 + Telegram/SourceFiles/window.cpp | 2 +- Telegram/Telegram.vcxproj | 30 ++++++ Telegram/Telegram.vcxproj.filters | 32 +++++-- 26 files changed, 394 insertions(+), 53 deletions(-) diff --git a/.gitignore b/.gitignore index 397d85746b..b1c55d7e03 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ ipch/ /Telegram/tdumps/ .DS_Store +._* .qmake.stash /Mac/ /Telegram/*.xcodeproj/xcuserdata/ diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index c8ba0eb4fd..a2cec8054e 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -15,7 +15,8 @@ GNU General Public License for more details. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014 John Preston, https://desktop.telegram.org */ -"lng_maintitle" = "Telegram Desktop"; +"lng_language_name" = "English"; +"lng_switch_to_this" = "Switch to English"; "lng_menu_contacts" = "Contacts"; "lng_menu_settings" = "Settings"; @@ -123,6 +124,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_signup_title" = "Information and photo"; "lng_signup_desc" = "Please enter your name and\nupload a photo."; + "lng_signup_firstname" = "First Name"; "lng_signup_lastname" = "Last Name"; @@ -165,10 +167,12 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_settings_show_preview" = "Show message preview"; "lng_settings_sound_notify" = "Play sound"; -"lng_notification_title" = "Telegram Desktop"; "lng_notification_preview" = "You have a new message"; "lng_settings_section_general" = "General"; +"lng_settings_change_lang" = "Change Language"; +"lng_languages" = "Languages"; +"lng_sure_save_language" = "Telegram will restart\nin order to change language"; "lng_settings_auto_update" = "Update automatically"; "lng_settings_current_version" = "Version {version}"; "lng_settings_check_now" = "Check for updates"; @@ -196,7 +200,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_settings_cats_and_dogs" = "Allow cats and dogs"; "lng_download_path_dont_ask" = "Don't ask download path for each file"; -"lng_download_path_label" = "Download path: "; +"lng_download_path_label" = "Download path:"; "lng_download_path_temp" = "temp folder"; "lng_download_path_default" = "default folder"; "lng_download_path_clear" = "Clear All"; @@ -237,6 +241,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_connection_password_ph" = "Password"; "lng_connection_save" = "Save"; "lng_settings_reset" = "Terminate other sessions"; +"lng_settings_reset_sure" = "Are you sure you want to terminate all other sessions?"; +"lng_settings_reset_button" = "Terminate"; "lng_settings_reset_done" = "Other sessions terminated"; "lng_settings_logout" = "Log Out"; "lng_sure_logout" = "Are you sure you want to log out?"; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 9e6d40cf71..e44f58f023 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1660,3 +1660,13 @@ usernameCancel: flatButton(btnSelectCancel) { youtubeIcon: sprite(336px, 221px, 60px, 60px); vimeoIcon: sprite(336px, 283px, 60px, 60px); locationSize: size(320, 240); + +langsWidth: 220px; +langsPadding: margins(10px, 10px, 10px, 10px); +langPadding: margins(10px, 10px, 10px, 10px); +langButton: flatCheckbox(rbDefFlat) { + width: 200px; +} +langsCloseButton: flatButton(aboutCloseButton) { + width: langsWidth; +} diff --git a/Telegram/SourceFiles/_other/genlang.cpp b/Telegram/SourceFiles/_other/genlang.cpp index 64323e39aa..608c69b254 100644 --- a/Telegram/SourceFiles/_other/genlang.cpp +++ b/Telegram/SourceFiles/_other/genlang.cpp @@ -338,17 +338,57 @@ bool genLang(const QString &lang_in, const QString &lang_out) { QString lang_cpp = lang_out + ".cpp", lang_h = lang_out + ".h"; QFile f(lang_in); if (!f.open(QIODevice::ReadOnly)) { - cout << "Could not open styles input file '" << lang_in.toUtf8().constData() << "'!\n"; + cout << "Could not open lang input file '" << lang_in.toUtf8().constData() << "'!\n"; QCoreApplication::exit(1); return false; } + QByteArray checkCodec = f.read(3); + if (checkCodec.size() < 3) { + cout << "Bad lang input file '" << lang_in.toUtf8().constData() << "'!\n"; + QCoreApplication::exit(1); + return false; + } + f.seek(0); - QByteArray blob = f.readAll(); - const char *text = blob.constData(), *end = blob.constData() + blob.size(); - f.close(); + QByteArray data; + int skip = 0; + if ((checkCodec.at(0) == '\xFF' && checkCodec.at(1) == '\xFE') || (checkCodec.at(0) == '\xFE' && checkCodec.at(1) == '\xFF') || (checkCodec.at(1) == 0)) { + QTextStream stream(&f); + stream.setCodec("UTF-16"); + QString string = stream.readAll(); + if (stream.status() != QTextStream::Ok) { + cout << "Could not read valid UTF-16 file '" << lang_in.toUtf8().constData() << "'!\n"; + QCoreApplication::exit(1); + return false; + } + f.close(); + + data = string.toUtf8(); + } else if (checkCodec.at(0) == 0) { + QByteArray tmp = "\xFE\xFF" + f.readAll(); // add fake UTF-16 BOM + f.close(); + + QTextStream stream(&tmp); + stream.setCodec("UTF-16"); + QString string = stream.readAll(); + if (stream.status() != QTextStream::Ok) { + cout << "Could not read valid UTF-16 file '" << lang_in.toUtf8().constData() << "'!\n"; + QCoreApplication::exit(1); + return false; + } + + data = string.toUtf8(); + } else { + data = f.readAll(); + if (checkCodec.at(0) == '\xEF' && checkCodec.at(1) == '\xBB' && checkCodec.at(2) == '\xBF') { + skip = 3; // skip UTF-8 BOM + } + } + + const char *text = data.constData() + skip, *end = text + data.size() - skip; try { - while (text != end) { + while (text < end) { readKeyValue(text, end); } @@ -409,6 +449,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org\n\ th << "};\n\n"; th << "LangString lang(LangKey key);\n\n"; + th << "LangString langOriginal(LangKey key);\n\n"; for (int i = 0, l = keysOrder.size(); i < l; ++i) { QVector &tagsList(keysTags[keysOrder[i]]); @@ -468,7 +509,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org\n\ } tcpp << "\t};\n\n"; - tcpp << "\tLangString _langValues[lngkeys_cnt];\n\n"; + tcpp << "\tLangString _langValues[lngkeys_cnt], _langValuesOriginal[lngkeys_cnt];\n\n"; tcpp << "\tvoid set(LangKey key, const QString &val) {\n"; tcpp << "\t\t_langValues[key] = val;\n"; tcpp << "\t}\n\n"; @@ -512,6 +553,10 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org\n\ tcpp << "\treturn (key < 0 || key > lngkeys_cnt) ? QString() : _langValues[key];\n"; tcpp << "}\n\n"; + tcpp << "LangString langOriginal(LangKey key) {\n"; + tcpp << "\treturn (key < 0 || key > lngkeys_cnt || _langValuesOriginal[key] == qsl(\"{}\")) ? QString() : (_langValuesOriginal[key].isEmpty() ? _langValues[key] : _langValuesOriginal[key]);\n"; + tcpp << "}\n\n"; + tcpp << "const char *langKeyName(LangKey key) {\n"; tcpp << "\treturn (key < 0 || key > lngkeys_cnt) ? \"\" : _langKeyNames[key];\n"; tcpp << "}\n\n"; @@ -674,6 +719,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org\n\ tcpp << "bool LangLoader::feedKeyValue(LangKey key, const QString &value) {\n"; tcpp << "\tif (key < lngkeys_cnt) {\n"; tcpp << "\t\t_found[key] = 1;\n"; + tcpp << "\t\tif (_langValuesOriginal[key].isEmpty()) {\n"; + tcpp << "\t\t\t_langValuesOriginal[key] = _langValues[key].isEmpty() ? qsl(\"{}\") : _langValues[key];\n"; + tcpp << "\t\t}\n"; tcpp << "\t\t_langValues[key] = value;\n"; tcpp << "\t\treturn true;\n"; tcpp << "\t}\n"; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 9c12cc531a..d83fef64be 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1452,6 +1452,7 @@ namespace App { configStream << quint32(dbiAutoUpdate) << qint32(cAutoUpdate()); configStream << quint32(dbiLastUpdateCheck) << qint32(cLastUpdateCheck()); configStream << quint32(dbiScale) << qint32(cConfigScale()); + configStream << quint32(dbiLang) << qint32(cLang()); configStream << quint32(dbiConnectionType) << qint32(cConnectionType()); if (cConnectionType() == dbictHttpProxy || cConnectionType() == dbictTcpProxy) { @@ -1596,6 +1597,14 @@ namespace App { cSetRealScale(s); } break; + case dbiLang: { + qint32 v; + configStream >> v; + if (v == langTestlang || (v >= 0 && v < langCount)) { + cSetLang(v); + } + } break; + case dbiWindowPosition: { TWindowPos pos; configStream >> pos.x >> pos.y >> pos.w >> pos.h >> pos.moncrc >> pos.maximized; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 811b2910c2..aab004fb68 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -129,11 +129,25 @@ Application::Application(int &argc, char **argv) : PsApplication(argc, argv), cSetIntRetinaFactor(int32(cRetinaFactor())); } - if (!cLangFile().isEmpty() && QFileInfo(cLangFile()).exists()) { - LangLoaderPlain loader(cLangFile()); - cSetLangErrors(loader.errors()); - if (!cLangErrors().isEmpty()) { - LOG(("Lang load errors: %1").arg(cLangErrors())); + if (cLang() < langTestlang) { + cSetLang(languageId()); + } + if (cLang() == langTestlang) { + if (QFileInfo(TestLangFile).exists()) { + LangLoaderPlain loader(TestLangFile); + cSetLangErrors(loader.errors()); + if (!cLangErrors().isEmpty()) { + LOG(("Lang load errors: %1").arg(cLangErrors())); + } else if (!loader.warnings().isEmpty()) { + LOG(("Lang load warnings: %1").arg(loader.warnings())); + } + } else { + cSetLang(langEnglish); + } + } else if (cLang() > langEnglish && cLang() < langCount) { + LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[cLang()] + qsl(".strings")); + if (!loader.errors().isEmpty()) { + LOG(("Lang load errors: %1").arg(loader.errors())); } else if (!loader.warnings().isEmpty()) { LOG(("Lang load warnings: %1").arg(loader.warnings())); } @@ -692,7 +706,7 @@ void Application::startApp() { } if (!cLangErrors().isEmpty()) { - window->showLayer(new ConfirmBox("Lang failed: " + cLangFile() + "\n\nError: " + cLangErrors(), true, lang(lng_close))); + window->showLayer(new ConfirmBox("Lang failed: " + QLatin1String(TestLangFile) + "\n\nError: " + cLangErrors(), true, lang(lng_close))); } } @@ -838,6 +852,16 @@ QString Application::language() { return lng; } +int32 Application::languageId() { + QByteArray l = language().toLatin1(); + for (int32 i = 0; i < langCount; ++i) { + if (l == LanguageCodes[i]) { + return i; + } + } + return langEnglish; +} + MainWidget *Application::main() { return mainApp ? mainApp->window->mainWidget() : 0; } diff --git a/Telegram/SourceFiles/application.h b/Telegram/SourceFiles/application.h index be8d2ffd0f..5f06ad116c 100644 --- a/Telegram/SourceFiles/application.h +++ b/Telegram/SourceFiles/application.h @@ -38,6 +38,7 @@ public: static Application *app(); static Window *wnd(); static QString language(); + static int32 languageId(); static MainWidget *main(); void onAppUpdate(const MTPhelp_AppUpdate &response); diff --git a/Telegram/SourceFiles/intro/intro.cpp b/Telegram/SourceFiles/intro/intro.cpp index a83b6f784c..d4cb35db5c 100644 --- a/Telegram/SourceFiles/intro/intro.cpp +++ b/Telegram/SourceFiles/intro/intro.cpp @@ -19,6 +19,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org #include "lang.h" #include "style.h" +#include "app.h" + #include "intro/intro.h" #include "intro/introsteps.h" #include "intro/introphone.h" @@ -45,6 +47,7 @@ namespace { } IntroWidget::IntroWidget(Window *window) : QWidget(window), +_langChangeTo(0), cacheForHideInd(0), cacheForShowInd(0), wnd(window), @@ -80,6 +83,18 @@ _backFrom(0), _backTo(0) { _back.move(st::setClosePos.x(), st::setClosePos.y()); } +void IntroWidget::langChangeTo(int32 langId) { + _langChangeTo = langId; +} + +void IntroWidget::onChangeLang() { + cSetLang(_langChangeTo); + App::writeConfig(); + cSetRestarting(true); + cSetRestartingToSettings(false); + App::quit(); +} + void IntroWidget::onParentResize(const QSize &newSize) { resize(newSize); } diff --git a/Telegram/SourceFiles/intro/intro.h b/Telegram/SourceFiles/intro/intro.h index 8096b0f602..99914fd3f0 100644 --- a/Telegram/SourceFiles/intro/intro.h +++ b/Telegram/SourceFiles/intro/intro.h @@ -60,6 +60,7 @@ public: void finish(const MTPUser &user, const QImage &photo = QImage()); void rpcInvalidate(); + void langChangeTo(int32 langId); ~IntroWidget(); @@ -69,6 +70,7 @@ public slots: void onIntroBack(); void onDoneStateChanged(int oldState, ButtonStateChangeSource source); void onParentResize(const QSize &newSize); + void onChangeLang(); signals: @@ -81,6 +83,8 @@ private: void prepareMove(); bool createNext(); + int32 _langChangeTo; + QPixmap cacheForHide, cacheForShow; int cacheForHideInd, cacheForShowInd; anim::ivalue xCoordHide, xCoordShow; diff --git a/Telegram/SourceFiles/intro/introsteps.cpp b/Telegram/SourceFiles/intro/introsteps.cpp index 47400f3211..1870806816 100644 --- a/Telegram/SourceFiles/intro/introsteps.cpp +++ b/Telegram/SourceFiles/intro/introsteps.cpp @@ -24,17 +24,40 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org #include "intro/introsteps.h" #include "intro/intro.h" +#include "langloaderplain.h" + IntroSteps::IntroSteps(IntroWidget *parent) : IntroStage(parent), _intro(this, lang(lng_intro), st::introLabel, st::introLabelTextStyle), -_next(this, lang(lng_start_msgs), st::btnIntroNext) { +_next(this, lang(lng_start_msgs), st::btnIntroNext), +_changeLang(this, QString()) { - _headerWidth = st::introHeaderFont->m.width(lang(lng_maintitle)); + _changeLang.hide(); + if (cLang() == langEnglish) { + int32 l = App::app()->languageId(); + if (l != langEnglish) { + LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[l] + qsl(".strings"), LangLoaderRequest(lng_switch_to_this)); + QString text = loader.found().value(lng_switch_to_this); + if (!text.isEmpty()) { + _changeLang.setText(text); + parent->langChangeTo(l); + _changeLang.show(); + } + } + } else { + _changeLang.setText(langOriginal(lng_switch_to_this)); + parent->langChangeTo(langEnglish); + _changeLang.show(); + } + + _headerWidth = st::introHeaderFont->m.width(qsl("Telegram Desktop")); setGeometry(parent->innerRect()); connect(&_next, SIGNAL(stateChanged(int, ButtonStateChangeSource)), parent, SLOT(onDoneStateChanged(int, ButtonStateChangeSource))); connect(&_next, SIGNAL(clicked()), parent, SLOT(onIntroNext())); + connect(&_changeLang, SIGNAL(clicked()), parent, SLOT(onChangeLang())); + setMouseTracking(true); } @@ -49,7 +72,7 @@ void IntroSteps::paintEvent(QPaintEvent *e) { p.setFont(st::introHeaderFont->f); p.setPen(st::introColor->p); - p.drawText((width() - _headerWidth) / 2, hy, lang(lng_maintitle)); + p.drawText((width() - _headerWidth) / 2, hy, qsl("Telegram Desktop")); p.drawPixmap(QPoint((width() - st::aboutIcon.pxWidth()) / 2, hy - st::introIconSkip - st::aboutIcon.pxHeight()), App::sprite(), st::aboutIcon); } @@ -58,6 +81,7 @@ void IntroSteps::resizeEvent(QResizeEvent *e) { if (e->oldSize().width() != width()) { _next.move((width() - _next.width()) / 2, st::introBtnTop); _intro.move((width() - _intro.width()) / 2, _next.y() - _intro.height() - st::introSkip); + _changeLang.move((width() - _changeLang.width()) / 2, _next.y() + _next.height() + _changeLang.height()); } } diff --git a/Telegram/SourceFiles/intro/introsteps.h b/Telegram/SourceFiles/intro/introsteps.h index 144282e182..0ec8706ba8 100644 --- a/Telegram/SourceFiles/intro/introsteps.h +++ b/Telegram/SourceFiles/intro/introsteps.h @@ -38,6 +38,8 @@ private: FlatLabel _intro; + LinkButton _changeLang; + FlatButton _next; int32 _headerWidth; }; diff --git a/Telegram/SourceFiles/lang.h b/Telegram/SourceFiles/lang.h index 28e77a9de5..6917034162 100644 --- a/Telegram/SourceFiles/lang.h +++ b/Telegram/SourceFiles/lang.h @@ -17,6 +17,24 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org */ #pragma once +enum Languages { + langTestlang = -1, + + langEnglish = 0, + langItalian, +// langSpanish, + + langCount +}; + +static const char *LanguageCodes[] = { + "en", + "it", +// "es", +}; + +static const char *TestLangFile = "testlang.strings"; + class LangString : public QString { public: LangString() { diff --git a/Telegram/SourceFiles/langloaderplain.cpp b/Telegram/SourceFiles/langloaderplain.cpp index 43af461d89..d31eb20782 100644 --- a/Telegram/SourceFiles/langloaderplain.cpp +++ b/Telegram/SourceFiles/langloaderplain.cpp @@ -66,7 +66,7 @@ namespace { bool LangLoaderPlain::readKeyValue(const char *&from, const char *end) { if (!skipJunk(from, end)) return false; - if (*from != '"') throw Exception(QString("Expected quote after key name!")); + if (*from != '"') throw Exception(QString("Expected quote before key name!")); ++from; const char *nameStart = from; while (from < end && ((*from >= 'a' && *from <= 'z') || (*from >= 'A' && *from <= 'Z') || *from == '_' || (*from >= '0' && *from <= '9'))) { @@ -85,7 +85,15 @@ bool LangLoaderPlain::readKeyValue(const char *&from, const char *end) { if (*from != '"') throw Exception(QString("Expected string after '=' in key '%1'!").arg(QLatin1String(varName))); LangKey varKey = keyIndex(varName); - if (varKey == lngkeys_cnt) throw Exception(QString("Unknown key '%1'!").arg(QLatin1String(varName))); + bool feedingValue = request.isEmpty(); + if (feedingValue) { + if (varKey == lngkeys_cnt) { + warning(QString("Unknown key '%1'!").arg(QLatin1String(varName))); + } + } else if (!request.contains(varKey)) { + varKey = lngkeys_cnt; + } + bool readingValue = (varKey != lngkeys_cnt); QByteArray varValue; QMap tagsUsed; @@ -97,14 +105,16 @@ bool LangLoaderPlain::readKeyValue(const char *&from, const char *end) { if (*from == '\\') { if (from + 1 >= end) throw Exception(QString("Unexpected end of file in key '%1'!").arg(QLatin1String(varName))); if (*(from + 1) == '"' || *(from + 1) == '\\' || *(from + 1) == '{') { - if (from > start) varValue.append(start, from - start); + if (readingValue && from > start) varValue.append(start, from - start); start = ++from; } else if (*(from + 1) == 'n') { - if (from > start) varValue.append(start, int(from - start)); - varValue.append('\n'); + if (readingValue) { + if (from > start) varValue.append(start, int(from - start)); + varValue.append('\n'); + } start = (++from) + 1; } - } else if (*from == '{') { + } else if (readingValue && *from == '{') { if (from > start) varValue.append(start, int(from - start)); const char *tagStart = ++from; @@ -117,9 +127,17 @@ bool LangLoaderPlain::readKeyValue(const char *&from, const char *end) { if (from == end || (*from != '}' && *from != ':')) throw Exception(QString("Expected '}' or ':' after tag name in key '%1'!").arg(QLatin1String(varName))); ushort index = tagIndex(tagName); - if (index == lngtags_cnt) throw Exception(QString("Tag '%1' not found in key '%2'!").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); + if (index == lngtags_cnt) { + readingValue = false; + warning(QString("Tag '%1' not found in key '%2', not using value.").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); + continue; + } - if (!tagReplaced(varKey, index)) throw Exception(QString("Unexpected tag '%1' in key '%2'!").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); + if (!tagReplaced(varKey, index)) { + readingValue = false; + warning(QString("Unexpected tag '%1' in key '%2', not using value.").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); + continue; + } if (tagsUsed.contains(index)) throw Exception(QString("Tag '%1' double used in key '%2'!").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); tagsUsed.insert(index, true); @@ -138,7 +156,14 @@ bool LangLoaderPlain::readKeyValue(const char *&from, const char *end) { if (*from == '|') { if (from > start) subvarValue.append(start, int(from - start)); if (countedIndex >= lngtags_max_counted_values) throw Exception(QString("Too many values inside counted tag '%1' in '%2' key!").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); - if (!feedKeyValue(subkeyIndex(varKey, index, countedIndex++), QString::fromUtf8(subvarValue))) throw Exception(QString("Tag '%1' is not counted in key '%2'!").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); + if (feedingValue) { + LangKey subkey = subkeyIndex(varKey, index, countedIndex++); + if (subkey == lngkeys_cnt) { + readingValue = false; + warning(QString("Unexpected counted tag '%1' in key '%2', not using value.").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); + break; + } else if (!feedKeyValue(subkey, QString::fromUtf8(subvarValue))) throw Exception(QString("Tag '%1' is not counted in key '%2'!").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); + } subvarValue = QByteArray(); foundtag = false; start = from + 1; @@ -169,31 +194,46 @@ bool LangLoaderPlain::readKeyValue(const char *&from, const char *end) { } ++from; } + if (!readingValue) continue; if (from >= end) throw Exception(QString("Unexpected end of file inside counted tag '%1' in '%2' key!").arg(QString::fromUtf8(tagName)).arg(QString::fromUtf8(varName))); if (*from == '"') throw Exception(QString("Unexpected end of string inside counted tag '%1' in '%2' key!").arg(QString::fromUtf8(tagName)).arg(QString::fromUtf8(varName))); if (from > start) subvarValue.append(start, int(from - start)); if (countedIndex >= lngtags_max_counted_values) throw Exception(QString("Too many values inside counted tag '%1' in '%2' key!").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); - if (!feedKeyValue(subkeyIndex(varKey, index, countedIndex++), QString::fromUtf8(subvarValue))) throw Exception(QString("Tag '%1' is not counted in key '%2'!").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); + + if (feedingValue) { + LangKey subkey = subkeyIndex(varKey, index, countedIndex++); + if (subkey == lngkeys_cnt) { + readingValue = false; + warning(QString("Unexpected counted tag '%1' in key '%2', not using value.").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); + break; + } else if (!feedKeyValue(subkey, QString::fromUtf8(subvarValue))) throw Exception(QString("Tag '%1' is not counted in key '%2'!").arg(QLatin1String(tagName)).arg(QLatin1String(varName))); + } } start = from + 1; } ++from; } if (from >= end) throw Exception(QString("Unexpected end of file in key '%1'!").arg(QLatin1String(varName))); - if (from > start) varValue.append(start, from - start); + if (readingValue && from > start) varValue.append(start, from - start); if (!skipJunk(++from, end)) throw Exception(QString("Unexpected end of file in key '%1'!").arg(QLatin1String(varName))); if (*from != ';') throw Exception(QString("';' expected after \"value\" in key '%1'!").arg(QLatin1String(varName))); skipJunk(++from, end); - if (!feedKeyValue(varKey, QString::fromUtf8(varValue))) throw Exception(QString("Could not write value in key '%1'!").arg(QLatin1String(varName))); + if (readingValue) { + if (feedingValue) { + if (!feedKeyValue(varKey, QString::fromUtf8(varValue))) throw Exception(QString("Could not write value in key '%1'!").arg(QLatin1String(varName))); + } else { + result.insert(varKey, QString::fromUtf8(varValue)); + } + } return true; } -LangLoaderPlain::LangLoaderPlain(const QString &file) { +LangLoaderPlain::LangLoaderPlain(const QString &file, const LangLoaderRequest &request) : file(file), request(request) { QFile f(file); if (!f.open(QIODevice::ReadOnly)) { error(qsl("Could not open input file!")); @@ -203,13 +243,51 @@ LangLoaderPlain::LangLoaderPlain(const QString &file) { error(qsl("Too big file: %1").arg(f.size())); return; } - QByteArray data = f.readAll(); - f.close(); + QByteArray checkCodec = f.read(3); + if (checkCodec.size() < 3) { + error(qsl("Bad lang input file: %1").arg(file)); + return; + } + f.seek(0); + QByteArray data; + int skip = 0; + if ((checkCodec.at(0) == '\xFF' && checkCodec.at(1) == '\xFE') || (checkCodec.at(0) == '\xFE' && checkCodec.at(1) == '\xFF') || (checkCodec.at(1) == 0)) { + QTextStream stream(&f); + stream.setCodec("UTF-16"); + + QString string = stream.readAll(); + if (stream.status() != QTextStream::Ok) { + error(qsl("Could not read valid UTF-16 file: % 1").arg(file)); + return; + } + f.close(); + + data = string.toUtf8(); + } else if (checkCodec.at(0) == 0) { + QByteArray tmp = "\xFE\xFF" + f.readAll(); // add fake UTF-16 BOM + f.close(); + + QTextStream stream(&tmp); + stream.setCodec("UTF-16"); + QString string = stream.readAll(); + if (stream.status() != QTextStream::Ok) { + error(qsl("Could not read valid UTF-16 file: % 1").arg(file)); + return; + } + + data = string.toUtf8(); + } else { + data = f.readAll(); + if (checkCodec.at(0) == '\xEF' && checkCodec.at(1) == '\xBB' && checkCodec.at(2) == '\xBF') { + skip = 3; // skip UTF-8 BOM + } + } + + const char *text = data.constData() + skip, *end = text + data.size() - skip; try { - const char *from = data.constData(), *end = data.constData() + data.size(); while (true) { - if (!readKeyValue(from, end)) { + if (!readKeyValue(text, end)) { break; } } diff --git a/Telegram/SourceFiles/langloaderplain.h b/Telegram/SourceFiles/langloaderplain.h index b5b1b7e2ba..f072ba436e 100644 --- a/Telegram/SourceFiles/langloaderplain.h +++ b/Telegram/SourceFiles/langloaderplain.h @@ -19,13 +19,41 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org #include "lang.h" +class LangLoaderRequest : public QMap { +public: + LangLoaderRequest() { + } + LangLoaderRequest(LangKey key1) { + insert(key1, true); + } + LangLoaderRequest(LangKey key1, LangKey key2) { + insert(key1, true); + insert(key2, true); + } + LangLoaderRequest(LangKey key1, LangKey key2, LangKey key3) { + insert(key1, true); + insert(key2, true); + insert(key3, true); + } +}; + +typedef QMap LangLoaderResult; class LangLoaderPlain : public LangLoader { public: - LangLoaderPlain(const QString &file); + LangLoaderPlain(const QString &file, const LangLoaderRequest &request = LangLoaderRequest()); + + LangLoaderResult found() const { + return result; + } protected: + QString file; + LangLoaderRequest request; + bool readKeyValue(const char *&from, const char *end); + LangLoaderResult result; + }; diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index 0c7e8e30a8..3daffd037c 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -518,7 +518,7 @@ void PsMainWindow::psNotifyShown(NotifyWindow *w) { } void PsMainWindow::psPlatformNotify(HistoryItem *item) { - QString title = (cNotifyView() <= dbinvShowName) ? item->history()->peer->name : lang(lng_notification_title); + QString title = (cNotifyView() <= dbinvShowName) ? item->history()->peer->name : qsl("Telegram Desktop"); QString subtitle = (cNotifyView() <= dbinvShowName) ? item->notificationHeader() : QString(); QString msg = (cNotifyView() <= dbinvShowPreview) ? item->notificationText() : lang(lng_notification_preview); _private.showNotify(item->history()->peer->id, title, subtitle, msg, (cNotifyView() <= dbinvShowPreview)); diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index da85996bc8..7b0447beee 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2259,7 +2259,8 @@ void psExecUpdater() { } void psExecTelegram() { - QString targs = qsl("-noupdate -tosettings"); + QString targs = qsl("-noupdate"); + if (cRestartingToSettings()) targs += qsl(" -tosettings"); if (cFromAutoStart()) targs += qsl(" -autostart"); if (cDebug()) targs += qsl(" -debug"); if (cDataFile() != (cTestMode() ? qsl("data_test") : qsl("data"))) targs += qsl(" -key \"") + cDataFile() + '"'; diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index f68457ccc9..400b3d6a45 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -18,6 +18,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org #include "stdafx.h" #include "pspecific.h" #include "settings.h" +#include "lang.h" bool gTestMode = false; bool gDebug = false; @@ -45,7 +46,7 @@ DBIWorkMode gWorkMode = dbiwmWindowAndTray; DBIConnectionType gConnectionType = dbictAuto; ConnectionProxy gConnectionProxy; bool gSeenTrayTooltip = false; -bool gRestartingUpdate = false, gRestarting = false, gWriteProtected = false; +bool gRestartingUpdate = false, gRestarting = false, gRestartingToSettings = false, gWriteProtected = false; int32 gLastUpdateCheck = 0; bool gNoStartUpdate = false; bool gStartToSettings = false; @@ -71,7 +72,7 @@ DBIEmojiTab gEmojiTab = dbietRecent; RecentEmojiPack gRecentEmojis; RecentEmojiPreload gRecentEmojisPreload; -QString gLangFile = qsl("testlang.strings"); +int32 gLang = -2; // auto bool gRetina = false; float64 gRetinaFactor = 1.; @@ -127,8 +128,6 @@ void settingsParseArgs(int argc, char *argv[]) { gNoStartUpdate = true; } else if (string("-tosettings") == argv[i]) { gStartToSettings = true; - } else if (string("-lang") == argv[i] && i + 1 < argc) { - gLangFile = QString(argv[++i]); } else if (string("-sendpath") == argv[i] && i + 1 < argc) { for (++i; i < argc; ++i) { gSendPaths.push_back(QString::fromLocal8Bit(argv[i])); diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index af49720ff4..b8a3d61d3b 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -91,6 +91,7 @@ DeclareSetting(ConnectionProxy, ConnectionProxy); DeclareSetting(bool, SeenTrayTooltip); DeclareSetting(bool, RestartingUpdate); DeclareSetting(bool, Restarting); +DeclareSetting(bool, RestartingToSettings); DeclareSetting(bool, WriteProtected); DeclareSetting(int32, LastUpdateCheck); DeclareSetting(bool, NoStartUpdate); @@ -144,7 +145,7 @@ DeclareSetting(RecentEmojiPreload, RecentEmojisPreload); const RecentEmojiPack &cGetRecentEmojis(); -DeclareReadSetting(QString, LangFile); +DeclareSetting(int32, Lang); DeclareSetting(QStringList, SendPaths); DeclareSetting(QString, StartUrl); diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index 530f8f7cf6..27a84a7c77 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -29,6 +29,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org #include "boxes/confirmbox.h" #include "boxes/downloadpathbox.h" #include "boxes/usernamebox.h" +#include "boxes/languagebox.h" #include "gui/filedialog.h" #include "localstorage.h" @@ -121,6 +122,7 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : QWidget(parent), _soundNotify(this, lang(lng_settings_sound_notify), cSoundNotify()), // general + _changeLanguage(this, qsl("Change Language")), _autoUpdate(this, lang(lng_settings_auto_update), cAutoUpdate()), _checkNow(this, lang(lng_settings_check_now)), _restartNow(this, lang(lng_settings_update_now)), @@ -147,7 +149,7 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : QWidget(parent), _ctrlEnterSend(this, qsl("send_key"), 1, lang((cPlatform() == dbipMac) ? lng_settings_send_cmdenter : lng_settings_send_ctrlenter), cCtrlEnter()), _dontAskDownloadPath(this, lang(lng_download_path_dont_ask), !cAskDownloadPath()), - _downloadPathWidth(st::linkFont->m.width(lang(lng_download_path_label))), + _downloadPathWidth(st::linkFont->m.width(lang(lng_download_path_label)) + st::linkFont->spacew), _downloadPathEdit(this, cDownloadPath().isEmpty() ? lang(lng_download_path_default) : ((cDownloadPath() == qsl("tmp")) ? lang(lng_download_path_temp) : st::linkFont->m.elidedText(QDir::toNativeSeparators(cDownloadPath()), Qt::ElideRight, st::setWidth - st::setVersionLeft - _downloadPathWidth))), _downloadPathClear(this, lang(lng_download_path_clear)), _tempDirClearingWidth(st::linkFont->m.width(lang(lng_download_path_clearing))), @@ -198,6 +200,7 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : QWidget(parent), connect(&_soundNotify, SIGNAL(changed()), this, SLOT(onSoundNotify())); // general + connect(&_changeLanguage, SIGNAL(clicked()), this, SLOT(onChangeLanguage())); connect(&_autoUpdate, SIGNAL(changed()), this, SLOT(onAutoUpdate())); connect(&_checkNow, SIGNAL(clicked()), this, SLOT(onCheckNow())); connect(&_restartNow, SIGNAL(clicked()), this, SLOT(onRestartNow())); @@ -543,6 +546,7 @@ void SettingsInner::resizeEvent(QResizeEvent *e) { // general top += st::setHeaderSkip; + _changeLanguage.move(_left + st::setWidth - _changeLanguage.width(), top - st::setHeaderSkip + st::setHeaderTop + st::setHeaderFont->ascent - st::linkFont->ascent); _autoUpdate.move(_left, top); _checkNow.move(_left + st::setWidth - _checkNow.width(), top + st::cbDefFlat.textTop); top += _autoUpdate.height(); _restartNow.move(_left + st::setWidth - _restartNow.width(), top + st::setVersionTop); @@ -746,6 +750,7 @@ void SettingsInner::showAll() { } // general + _changeLanguage.show(); _autoUpdate.show(); setUpdatingState(_updatingState, true); if (cPlatform() == dbipWindows) { @@ -879,6 +884,13 @@ void SettingsInner::onUpdatePhoto() { } void SettingsInner::onResetSessions() { + ConfirmBox *box = new ConfirmBox(lang(lng_settings_reset_sure), lang(lng_settings_reset_button)); + connect(box, SIGNAL(confirmed()), this, SLOT(onResetSessionsSure())); + App::wnd()->showLayer(box); +} + +void SettingsInner::onResetSessionsSure() { + App::wnd()->layerHidden(); MTP::send(MTPauth_ResetAuthorizations(), rpcDone(&SettingsInner::doneResetSessions)); } @@ -890,6 +902,10 @@ void SettingsInner::doneResetSessions(const MTPBool &res) { } } +void SettingsInner::onChangeLanguage() { + App::wnd()->showLayer(new LanguageBox()); +} + void SettingsInner::onAutoUpdate() { cSetAutoUpdate(!cAutoUpdate()); App::writeConfig(); @@ -922,6 +938,7 @@ void SettingsInner::onRestartNow() { cSetRestartingUpdate(true); } else { cSetRestarting(true); + cSetRestartingToSettings(true); } App::quit(); } diff --git a/Telegram/SourceFiles/settingswidget.h b/Telegram/SourceFiles/settingswidget.h index bd5d5a3ee6..741a998a51 100644 --- a/Telegram/SourceFiles/settingswidget.h +++ b/Telegram/SourceFiles/settingswidget.h @@ -136,11 +136,14 @@ public slots: void onUpdateFailed(); void onResetSessions(); + void onResetSessionsSure(); void onPhotoUpdateDone(PeerId peer); void onPhotoUpdateFail(PeerId peer); void onPhotoUpdateStart(); + void onChangeLanguage(); + private: void doneResetSessions(const MTPBool &res); @@ -174,6 +177,7 @@ private: FlatCheckbox _desktopNotify, _senderName, _messagePreview, _soundNotify; // general + LinkButton _changeLanguage; FlatCheckbox _autoUpdate; LinkButton _checkNow, _restartNow; FlatCheckbox _workmodeTray, _workmodeWindow; diff --git a/Telegram/SourceFiles/sysbuttons.cpp b/Telegram/SourceFiles/sysbuttons.cpp index 03539f219b..3570178c88 100644 --- a/Telegram/SourceFiles/sysbuttons.cpp +++ b/Telegram/SourceFiles/sysbuttons.cpp @@ -141,6 +141,7 @@ void UpdateBtn::onClick() { cSetRestartingUpdate(true); } else { cSetRestarting(true); + cSetRestartingToSettings(false); } App::quit(); } diff --git a/Telegram/SourceFiles/telegram.qrc b/Telegram/SourceFiles/telegram.qrc index 32ef8d682e..75e15e7f7b 100644 --- a/Telegram/SourceFiles/telegram.qrc +++ b/Telegram/SourceFiles/telegram.qrc @@ -41,4 +41,7 @@ etc/qt_win.conf + + langs/lang_it.strings + diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index e543f82bc3..f80001b3bf 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -254,6 +254,7 @@ enum DataBlockId { dbiNotifyView = 28, dbiSendToMenu = 29, dbiCompressPastedImage = 30, + dbiLang = 31, dbiEncryptedWithSalt = 333, dbiEncrypted = 444, diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 08a8d54c56..599167e2f9 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -204,7 +204,7 @@ void NotifyWindow::updateNotifyDisplay() { history->nameText.drawElided(p, rectForName.left(), rectForName.top(), rectForName.width()); } else { p.setFont(st::msgNameFont->f); - static QString notifyTitle = st::msgNameFont->m.elidedText(lang(lng_notification_title), Qt::ElideRight, rectForName.width()); + static QString notifyTitle = st::msgNameFont->m.elidedText(qsl("Telegram Desktop"), Qt::ElideRight, rectForName.width()); p.drawText(rectForName.left(), rectForName.top() + st::msgNameFont->ascent, notifyTitle); } } diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index a85200b849..7ea4cff942 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -262,6 +262,10 @@ true true + + true + true + true true @@ -482,6 +486,10 @@ true true + + true + true + true true @@ -711,6 +719,10 @@ true true + + true + true + true true @@ -827,6 +839,7 @@ + @@ -1137,6 +1150,20 @@ .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/boxes/usernamebox.h" -DAL_LIBTYPE_STATIC -DUNICODE -D_WITH_DEBUG -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\OpenSSL-Win32\include" "-I.\..\..\Libraries\libogg-1.3.2\include" "-I.\..\..\Libraries\opus\include" "-I.\..\..\Libraries\opusfile\include" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.3.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.3.1\QtGui" + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing languagebox.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/boxes/languagebox.h" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\OpenSSL-Win32\include" "-I.\..\..\Libraries\libogg-1.3.2\include" "-I.\..\..\Libraries\opus\include" "-I.\..\..\Libraries\opusfile\include" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.3.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.3.1\QtGui" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing languagebox.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/boxes/languagebox.h" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\OpenSSL-Win32\include" "-I.\..\..\Libraries\libogg-1.3.2\include" "-I.\..\..\Libraries\opus\include" "-I.\..\..\Libraries\opusfile\include" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.3.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.3.1\QtGui" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing languagebox.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/boxes/languagebox.h" -DAL_LIBTYPE_STATIC -DUNICODE -D_WITH_DEBUG -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\OpenSSL-Win32\include" "-I.\..\..\Libraries\libogg-1.3.2\include" "-I.\..\..\Libraries\opus\include" "-I.\..\..\Libraries\opusfile\include" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.3.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.3.1\QtGui" + Moc%27ing animation.h... @@ -1749,6 +1776,9 @@ + + + diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters index 129edc3505..cd432a29b8 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -19,11 +19,6 @@ {93203856-b459-49ec-8097-689d0feda013} - - {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} - qrc;* - false - {d01d021a-d92f-4ac3-9155-6d297fffe596} @@ -42,6 +37,9 @@ cpp;moc False + + {67311646-a8af-4626-976d-0a5733bf90e8} + @@ -767,6 +765,18 @@ Source Files + + boxes + + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + @@ -873,9 +883,6 @@ gui - - Resource Files - @@ -1026,6 +1033,10 @@ Source Files + + + boxes + @@ -1033,4 +1044,9 @@ + + + langs + + \ No newline at end of file