Finalize rename / move.

This commit is contained in:
John Preston 2017-04-13 11:27:10 +03:00
parent f643446d1b
commit 110e7c8074
132 changed files with 151 additions and 177 deletions

View File

@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "data/data_drafts.h"
#include "observer_peer.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "application.h"
#include "mainwindow.h"
#include "messenger.h"

View File

@ -29,7 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_chat_helpers.h"
#include "styles/style_history.h"
#include "styles/style_boxes.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "data/data_abstract_structure.h"
#include "history/history_service_layout.h"
#include "history/history_location_manager.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/about_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "autoupdater.h"

View File

@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_boxes.h"
#include "storage/localstorage.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "ui/effects/widget_fade_wrap.h"
#include "ui/widgets/buttons.h"
#include "ui/widgets/scroll_area.h"

View File

@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_boxes.h"
#include "styles/style_dialogs.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "messenger.h"
#include "boxes/contacts_box.h"
#include "boxes/confirm_box.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/autolock_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "storage/localstorage.h"
#include "mainwindow.h"
#include "ui/widgets/checkbox.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/background_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "window/themes/window_theme.h"

View File

@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/buttons.h"
#include "styles/style_boxes.h"
#include "styles/style_dialogs.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "ui/effects/ripple_animation.h"
namespace {

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/change_phone_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "styles/style_boxes.h"
#include "ui/widgets/labels.h"
#include "ui/widgets/input_fields.h"

View File

@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "boxes/confirm_box.h"
#include "styles/style_boxes.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "apiwrap.h"

View File

@ -26,7 +26,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/input_fields.h"
#include "ui/widgets/labels.h"
#include "mainwidget.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace {

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/connection_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "storage/localstorage.h"
#include "mainwidget.h"
#include "mainwindow.h"

View File

@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_dialogs.h"
#include "styles/style_history.h"
#include "styles/style_profile.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "boxes/add_contact_box.h"
#include "mainwidget.h"
#include "mainwindow.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/download_path_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "storage/localstorage.h"
#include "core/file_utilities.h"
#include "ui/widgets/checkbox.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/edit_color_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "styles/style_boxes.h"
#include "ui/widgets/shadow.h"
#include "styles/style_mediaview.h"

View File

@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/effects/widget_slide_wrap.h"
#include "boxes/peer_list_box.h"
#include "apiwrap.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace {

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/emoji_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "mainwindow.h"

View File

@ -20,14 +20,14 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/language_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "ui/widgets/checkbox.h"
#include "ui/widgets/buttons.h"
#include "storage/localstorage.h"
#include "boxes/confirm_box.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "langloaderplain.h"
#include "lang/lang_file_parser.h"
#include "styles/style_boxes.h"
void LanguageBox::prepare() {
@ -48,7 +48,7 @@ void LanguageBox::prepare() {
for (auto i = 0; i != languageCount; ++i) {
LangLoaderResult result;
if (i) {
LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[i].c_str() + qsl(".strings"), langLoaderRequest(lng_language_name));
LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[i].c_str() + qsl(".strings"), { lng_language_name });
result = loader.found();
} else {
result.insert(lng_language_name, langOriginal(lng_language_name));
@ -66,7 +66,7 @@ void LanguageBox::prepare() {
void LanguageBox::mousePressEvent(QMouseEvent *e) {
if ((e->modifiers() & Qt::CTRL) && (e->modifiers() & Qt::ALT) && (e->modifiers() & Qt::SHIFT)) {
for (int32 i = 1; i < languageCount; ++i) {
LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[i].c_str() + qsl(".strings"), langLoaderRequest(lngkeys_cnt));
LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[i].c_str() + qsl(".strings"), { lngkeys_cnt });
if (!loader.errors().isEmpty()) {
Ui::show(Box<InformBox>(qsl("Lang \"") + LanguageCodes[i].c_str() + qsl("\" error :(\n\nError: ") + loader.errors()));
return;
@ -90,10 +90,10 @@ void LanguageBox::languageChanged(int languageId) {
LangLoaderResult result;
if (languageId > 0) {
LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[languageId].c_str() + qsl(".strings"), langLoaderRequest(lng_sure_save_language, lng_cancel, lng_box_ok));
LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[languageId].c_str() + qsl(".strings"), { lng_sure_save_language, lng_cancel, lng_box_ok });
result = loader.found();
} else if (languageId == languageTest) {
LangLoaderPlain loader(cLangFile(), langLoaderRequest(lng_sure_save_language, lng_cancel, lng_box_ok));
LangLoaderPlain loader(cLangFile(), { lng_sure_save_language, lng_cancel, lng_box_ok });
result = loader.found();
}
auto text = result.value(lng_sure_save_language, langOriginal(lng_sure_save_language)),

View File

@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_boxes.h"
#include "ui/widgets/buttons.h"
#include "storage/localstorage.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "auth_session.h"

View File

@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_boxes.h"
#include "styles/style_dialogs.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "boxes/contacts_box.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/notifications_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "ui/widgets/buttons.h"
#include "ui/widgets/discrete_sliders.h"
#include "styles/style_boxes.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/passcode_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "boxes/confirm_box.h"
#include "mainwindow.h"
#include "storage/localstorage.h"

View File

@ -32,7 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/multi_select.h"
#include "ui/widgets/labels.h"
#include "ui/effects/widget_slide_wrap.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "ui/effects/round_checkbox.h"
#include "boxes/contacts_box.h"
#include "window/themes/window_theme.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/photo_crop_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "messenger.h"
#include "mainwidget.h"
#include "storage/file_upload.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/rate_call_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "styles/style_boxes.h"
#include "styles/style_calls.h"
#include "boxes/confirm_box.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/report_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "styles/style_boxes.h"
#include "styles/style_profile.h"
#include "boxes/confirm_box.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/self_destruction_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "ui/widgets/checkbox.h"
#include "ui/widgets/labels.h"
#include "styles/style_boxes.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/send_files_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "storage/localstorage.h"
#include "mainwidget.h"
#include "history/history_media_types.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/sessions_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "storage/localstorage.h"
#include "mainwidget.h"
#include "mainwindow.h"

View File

@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_boxes.h"
#include "styles/style_history.h"
#include "observer_peer.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "mainwidget.h"
#include "base/qthelp_url.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/sticker_set_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "chat_helpers/stickers.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "stickers_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "chat_helpers/stickers.h"
#include "boxes/confirm_box.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "boxes/username_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "application.h"
#include "mainwidget.h"
#include "mainwindow.h"

View File

@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_calls.h"
#include "styles/style_boxes.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "observer_peer.h"
#include "ui/effects/ripple_animation.h"
#include "calls/calls_instance.h"

View File

@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "auth_session.h"
#include "mainwidget.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "boxes/confirm_box.h"
#include "boxes/rate_call_box.h"
#include "calls/calls_instance.h"

View File

@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "messenger.h"
#include "auth_session.h"
#include "apiwrap.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "boxes/confirm_box.h"
#include "calls/calls_call.h"
#include "calls/calls_panel.h"

View File

@ -30,7 +30,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/effects/widget_fade_wrap.h"
#include "messenger.h"
#include "mainwindow.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "auth_session.h"
#include "apiwrap.h"
#include "observer_peer.h"

View File

@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_calls.h"
#include "ui/widgets/buttons.h"
#include "ui/widgets/labels.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "calls/calls_call.h"
#include "calls/calls_instance.h"
#include "styles/style_boxes.h"

View File

@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/buttons.h"
#include "styles/style_chat_helpers.h"
#include "ui/widgets/shadow.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace ChatHelpers {
namespace {

View File

@ -28,7 +28,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "inline_bots/inline_bot_result.h"
#include "chat_helpers/stickers.h"
#include "storage/localstorage.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "window/window_controller.h"

View File

@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "boxes/stickers_box.h"
#include "boxes/confirm_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "apiwrap.h"
#include "storage/localstorage.h"
#include "mainwidget.h"

View File

@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "inline_bots/inline_bot_result.h"
#include "chat_helpers/stickers.h"
#include "storage/localstorage.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "dialogs/dialogs_layout.h"
#include "boxes/sticker_set_box.h"

View File

@ -30,7 +30,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/discrete_sliders.h"
#include "ui/widgets/scroll_area.h"
#include "storage/localstorage.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwindow.h"
namespace ChatHelpers {

View File

@ -181,7 +181,7 @@ inline LangString " << entry.key << "(" << params.join(QString(", ")) << ") {\n\
bool Generator::writeSource() {
source_ = std::make_unique<common::CppFile>(basePath_ + ".cpp", project_);
source_->include("lang.h").pushNamespace().stream() << "\
source_->include("lang/lang_keys.h").pushNamespace().stream() << "\
const char *_langKeyNames[lngkeys_cnt] = {\n\
\n";
for (auto &entry : langpack_.entries) {

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "core/click_handler_types.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "platform/platform_specific.h"
#include "boxes/confirm_box.h"
#include "base/qthelp_regex.h"

View File

@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "dialogs/dialogs_list.h"
#include "styles/style_dialogs.h"
#include "storage/localstorage.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace Dialogs {
namespace Layout {

View File

@ -28,7 +28,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/buttons.h"
#include "ui/widgets/popup_menu.h"
#include "data/data_drafts.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "application.h"
#include "mainwindow.h"
#include "dialogswidget.h"

View File

@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "messenger.h"
#include "boxes/confirm_box.h"
#include "layerwidget.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "base/observer.h"
#include "base/task_queue.h"

View File

@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "dialogs/dialogs_indexed_list.h"
#include "styles/style_dialogs.h"
#include "data/data_drafts.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "apiwrap.h"
#include "mainwidget.h"
#include "mainwindow.h"

View File

@ -29,7 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "dialogs/dialogs_layout.h"
#include "historywidget.h"
#include "storage/localstorage.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "apiwrap.h"
#include "mainwidget.h"

View File

@ -32,7 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "mainwidget.h"
#include "auth_session.h"
#include "apiwrap.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace {

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "history/history_item.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "history/history_service_layout.h"
#include "media/media_clip_reader.h"

View File

@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "history/history_location_manager.h"
#include "mainwidget.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "platform/platform_specific.h"
namespace {

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "history/history_media_types.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "storage/localstorage.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "history/history_message.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "apiwrap.h"

View File

@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "data/data_abstract_structure.h"
#include "styles/style_history.h"
#include "mainwidget.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace HistoryLayout {
namespace {

View File

@ -50,7 +50,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "chat_helpers/tabbed_selector.h"
#include "chat_helpers/bot_keyboard.h"
#include "chat_helpers/message_field.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "application.h"
#include "mainwidget.h"
#include "mainwindow.h"

View File

@ -31,7 +31,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "history/history_location_manager.h"
#include "storage/localstorage.h"
#include "auth_session.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace InlineBots {
namespace Layout {

View File

@ -29,7 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "inline_bots/inline_bot_layout_item.h"
#include "dialogs/dialogs_layout.h"
#include "storage/localstorage.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "apiwrap.h"
#include "mainwidget.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "intro/introcode.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "application.h"
#include "intro/introsignup.h"
#include "intro/intropwdcheck.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "intro/introphone.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "application.h"
#include "intro/introcode.h"
#include "styles/style_intro.h"

View File

@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_boxes.h"
#include "core/file_utilities.h"
#include "boxes/confirm_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "application.h"
#include "intro/introsignup.h"
#include "ui/widgets/buttons.h"

View File

@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "core/file_utilities.h"
#include "boxes/photo_crop_box.h"
#include "boxes/confirm_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "application.h"
#include "ui/widgets/buttons.h"
#include "ui/widgets/input_fields.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "intro/introstart.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "application.h"
#include "intro/introphone.h"
#include "ui/widgets/buttons.h"

View File

@ -20,9 +20,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "intro/introwidget.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "storage/localstorage.h"
#include "langloaderplain.h"
#include "lang/lang_file_parser.h"
#include "intro/introstart.h"
#include "intro/introphone.h"
#include "intro/introcode.h"
@ -64,7 +64,7 @@ Widget::Widget(QWidget *parent) : TWidget(parent)
if (cLang() == languageDefault) {
auto systemLangId = Sandbox::LangSystem();
if (systemLangId != languageDefault) {
LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[systemLangId].c_str() + qsl(".strings"), langLoaderRequest(lng_switch_to_this));
LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[systemLangId].c_str() + qsl(".strings"), { lng_switch_to_this });
QString text = loader.found().value(lng_switch_to_this);
if (!text.isEmpty()) {
_changeLanguage.create(this, object_ptr<Ui::LinkButton>(this, text), st::introCoverDuration);

View File

@ -18,7 +18,7 @@ to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "langloaderplain.h"
#include "lang/lang_file_parser.h"
#include "base/parse_helper.h"
@ -45,12 +45,12 @@ bool LangLoaderPlain::readKeyValue(const char *&from, const char *end) {
if (*from != '"') throw Exception(QString("Expected string after '=' in key '%1'!").arg(varName));
LangKey varKey = keyIndex(varName);
bool feedingValue = request.isEmpty();
bool feedingValue = request.empty();
if (feedingValue) {
if (varKey == lngkeys_cnt) {
warning(QString("Unknown key '%1'!").arg(varName));
}
} else if (!readingAll && !request.contains(varKey)) {
} else if (!readingAll && request.find(varKey) == request.end()) {
varKey = lngkeys_cnt;
}
bool readingValue = (varKey != lngkeys_cnt);
@ -206,7 +206,7 @@ bool LangLoaderPlain::readKeyValue(const char *&from, const char *end) {
return true;
}
LangLoaderPlain::LangLoaderPlain(const QString &file, const LangLoaderRequest &request) : file(file), request(request), readingAll(request.contains(lngkeys_cnt)) {
LangLoaderPlain::LangLoaderPlain(const QString &file, const std::set<LangKey> &request) : file(file), request(request), readingAll(request.find(lngkeys_cnt) != request.end()) {
QFile f(file);
if (!f.open(QIODevice::ReadOnly)) {
error(qsl("Could not open input file!"));

View File

@ -20,38 +20,12 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#pragma once
#include "lang.h"
using LangLoaderRequest = OrderedSet<LangKey>;
template <typename ...Args>
struct LangLoaderRequestHelper;
template <>
struct LangLoaderRequestHelper<> {
static inline void fill(LangLoaderRequest &result) {
}
};
template <typename Arg, typename ...Args>
struct LangLoaderRequestHelper<Arg, Args...> {
static inline void fill(LangLoaderRequest &result, Arg arg, Args ...args) {
result.insert(arg);
LangLoaderRequestHelper<Args...>::fill(result, args...);
}
};
template <typename ...Args>
inline LangLoaderRequest langLoaderRequest(Args ...args) {
LangLoaderRequest result;
LangLoaderRequestHelper<Args...>::fill(result, args...);
return result;
}
#include "lang/lang_keys.h"
using LangLoaderResult = QMap<LangKey, LangString>;
class LangLoaderPlain : public LangLoader {
public:
LangLoaderPlain(const QString &file, const LangLoaderRequest &request = LangLoaderRequest());
LangLoaderPlain(const QString &file, const std::set<LangKey> &request = std::set<LangKey>());
LangLoaderResult found() const {
return result;
@ -59,7 +33,7 @@ public:
protected:
QString file;
LangLoaderRequest request;
std::set<LangKey> request;
bool readKeyValue(const char *&from, const char *end);

View File

@ -18,9 +18,9 @@ to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "lang.h"
#include "lang/lang_keys.h"
#include "langloaderplain.h"
#include "lang/lang_file_parser.h"
LangString LangString::tag(ushort tag, const QString &replacement) {
for (const QChar *s = constData(), *ch = s, *e = ch + size(); ch != e;) {
@ -96,7 +96,7 @@ QString langNewVersionText() {
QString langNewVersionTextForLang(int langId) {
LangLoaderResult result;
if (langId) {
LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[langId].c_str() + qsl(".strings"), langLoaderRequest(lng_language_name, NEW_VER_KEY));
LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[langId].c_str() + qsl(".strings"), { lng_language_name, NEW_VER_KEY });
result = loader.found();
} else {
result.insert(lng_language_name, langOriginal(lng_language_name));

View File

@ -18,7 +18,7 @@ to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "lang.h"
#include "lang/lang_keys.h"
#include "media/media_clip_reader.h"
#include "boxes/abstract_box.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "layout.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "application.h"
#include "storage/file_upload.h"

View File

@ -37,7 +37,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "historywidget.h"
#include "history/history_service_layout.h"
#include "overviewwidget.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "boxes/add_contact_box.h"
#include "storage/file_upload.h"
#include "messenger.h"

View File

@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/popup_menu.h"
#include "ui/widgets/buttons.h"
#include "base/zlib_help.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "shortcuts.h"
#include "messenger.h"
#include "application.h"

View File

@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/shadow.h"
#include "ui/widgets/buttons.h"
#include "ui/effects/ripple_animation.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "media/media_audio.h"
#include "media/view/media_clip_playback.h"
#include "media/player/media_player_button.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "mediaview.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "application.h"

View File

@ -29,7 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "auth_session.h"
#include "apiwrap.h"
#include "calls/calls_instance.h"
#include "langloaderplain.h"
#include "lang/lang_file_parser.h"
#include "observer_peer.h"
#include "storage/file_upload.h"
#include "mainwidget.h"

View File

@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include <openssl/md5.h>
#include <openssl/rand.h>
#include "zlib.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "base/openssl_help.h"
#include "mtproto/rsa_public_key.h"

View File

@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "zlib.h"
#include "lang.h"
#include "lang/lang_keys.h"
QString mtpWrapNumber(float64 number) {
return QString::number(number);

View File

@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "core/file_utilities.h"
#include "boxes/add_contact_box.h"
#include "boxes/confirm_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "application.h"
#include "storage/file_upload.h"

View File

@ -32,7 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/input_fields.h"
#include "window/top_bar_widget.h"
#include "window/themes/window_theme.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "mainwidget.h"
#include "overviewwidget.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "passcodewidget.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "storage/localstorage.h"
#include "mainwindow.h"
#include "messenger.h"

View File

@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "mainwindow.h"
#include "messenger.h"
#include "application.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "storage/localstorage.h"
namespace Platform {

View File

@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "window/notifications_utilities.h"
#include "platform/linux/linux_libnotify.h"
#include "platform/linux/linux_libs.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "base/task_queue.h"
namespace Platform {

View File

@ -18,7 +18,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "platform/linux/specific_linux.h"
#include "platform/linux/linux_libs.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "application.h"
#include "mainwidget.h"
#include "mainwindow.h"

View File

@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#pragma once
#include "lang.h"
#include "lang/lang_keys.h"
#include <Cocoa/Cocoa.h>

View File

@ -28,7 +28,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "platform/platform_notifications_manager.h"
#include "boxes/contacts_box.h"
#include "boxes/about_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "platform/mac/mac_utilities.h"
#include <Cocoa/Cocoa.h>

View File

@ -17,7 +17,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "platform/mac/specific_mac.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "application.h"
#include "mainwidget.h"
#include "historywidget.h"

View File

@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "media/media_audio.h"
#include "platform/mac/mac_utilities.h"
#include "styles/style_window.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "base/timer.h"
#include <Cocoa/Cocoa.h>

View File

@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "mainwindow.h"
#include "storage/localstorage.h"
#include "platform/win/windows_dlls.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include <Shlwapi.h>
#include <Windowsx.h>

View File

@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "mainwindow.h"
#include "messenger.h"
#include "application.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "storage/localstorage.h"
#include "ui/widgets/popup_menu.h"
#include "window/themes/window_theme.h"

View File

@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "platform/win/windows_app_user_model_id.h"
#include "platform/win/windows_dlls.h"
#include "platform/win/windows_event_filter.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "mainwidget.h"
#include "history/history_location_manager.h"

View File

@ -29,7 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "observer_peer.h"
#include "apiwrap.h"
#include "auth_session.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace Profile {

View File

@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/buttons.h"
#include "boxes/members_box.h"
#include "observer_peer.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace Profile {

View File

@ -28,7 +28,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "apiwrap.h"
#include "observer_peer.h"
#include "auth_session.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace Profile {

View File

@ -28,7 +28,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "mainwidget.h"
#include "observer_peer.h"
#include "apiwrap.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "messenger.h"
namespace Profile {

View File

@ -26,7 +26,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "boxes/confirm_box.h"
#include "observer_peer.h"
#include "mainwindow.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace Profile {

View File

@ -30,7 +30,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "auth_session.h"
#include "mainwidget.h"
#include "apiwrap.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwindow.h" // tmp

View File

@ -26,7 +26,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "observer_peer.h"
#include "ui/widgets/buttons.h"
#include "mainwidget.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace Profile {
namespace {

View File

@ -32,7 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "mainwidget.h"
#include "observer_peer.h"
#include "apiwrap.h"
#include "lang.h"
#include "lang/lang_keys.h"
namespace Profile {
namespace CommonGroups {

View File

@ -31,7 +31,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "boxes/confirm_box.h"
#include "boxes/contacts_box.h"
#include "boxes/photo_crop_box.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "apiwrap.h"
#include "mainwidget.h"
#include "mainwindow.h"

View File

@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_profile.h"
#include "styles/style_window.h"
#include "ui/widgets/buttons.h"
#include "lang.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "boxes/add_contact_box.h"
#include "boxes/confirm_box.h"

Some files were not shown because too many files have changed in this diff Show More