From 25f6bea66e1e08dcf33647b47ad4f7198358741e Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Tue, 19 Oct 2021 01:43:50 +0300 Subject: [PATCH] Moved ConfirmPhoneBox to td_ui. --- Telegram/CMakeLists.txt | 2 -- Telegram/SourceFiles/api/api_confirm_phone.cpp | 6 +++--- Telegram/SourceFiles/core/local_url_handlers.cpp | 1 - Telegram/SourceFiles/{ => ui}/boxes/confirm_phone_box.cpp | 6 +++++- Telegram/SourceFiles/{ => ui}/boxes/confirm_phone_box.h | 4 +++- Telegram/cmake/td_ui.cmake | 2 ++ 6 files changed, 13 insertions(+), 8 deletions(-) rename Telegram/SourceFiles/{ => ui}/boxes/confirm_phone_box.cpp (98%) rename Telegram/SourceFiles/{ => ui}/boxes/confirm_phone_box.h (99%) diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 562641b770..73fe4f64a0 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -193,8 +193,6 @@ PRIVATE boxes/background_preview_box.h boxes/change_phone_box.cpp boxes/change_phone_box.h - boxes/confirm_phone_box.cpp - boxes/confirm_phone_box.h boxes/connection_box.cpp boxes/connection_box.h boxes/create_poll_box.cpp diff --git a/Telegram/SourceFiles/api/api_confirm_phone.cpp b/Telegram/SourceFiles/api/api_confirm_phone.cpp index f7e95bc55e..cfe13eb073 100644 --- a/Telegram/SourceFiles/api/api_confirm_phone.cpp +++ b/Telegram/SourceFiles/api/api_confirm_phone.cpp @@ -8,10 +8,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "api/api_confirm_phone.h" #include "apiwrap.h" -#include "ui/boxes/confirm_box.h" -#include "boxes/confirm_phone_box.h" #include "lang/lang_keys.h" #include "main/main_session.h" +#include "ui/boxes/confirm_box.h" +#include "ui/boxes/confirm_phone_box.h" #include "ui/text/format_values.h" // Ui::FormatPhone #include "window/window_session_controller.h" @@ -56,7 +56,7 @@ void ConfirmPhone::resolve( } return std::nullopt; }(); - auto box = Box( + auto box = Box( phone, sentCodeLength, timeout); diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 18d9008748..c137160e17 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -18,7 +18,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "core/update_checker.h" #include "core/application.h" #include "core/click_handler_types.h" -#include "boxes/confirm_phone_box.h" #include "boxes/background_preview_box.h" #include "ui/boxes/confirm_box.h" #include "boxes/share_box.h" diff --git a/Telegram/SourceFiles/boxes/confirm_phone_box.cpp b/Telegram/SourceFiles/ui/boxes/confirm_phone_box.cpp similarity index 98% rename from Telegram/SourceFiles/boxes/confirm_phone_box.cpp rename to Telegram/SourceFiles/ui/boxes/confirm_phone_box.cpp index cd2327493e..42557f9131 100644 --- a/Telegram/SourceFiles/boxes/confirm_phone_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/confirm_phone_box.cpp @@ -5,7 +5,7 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "boxes/confirm_phone_box.h" +#include "ui/boxes/confirm_phone_box.h" #include "ui/boxes/confirm_box.h" #include "ui/widgets/buttons.h" @@ -16,6 +16,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "styles/style_layers.h" #include "styles/style_boxes.h" +namespace Ui { + ConfirmPhoneBox::ConfirmPhoneBox( QWidget*, const QString &phone, @@ -161,3 +163,5 @@ void ConfirmPhoneBox::showServerError(const QString &text) { QString ConfirmPhoneBox::getPhone() const { return _phone; } + +} // namespace Ui diff --git a/Telegram/SourceFiles/boxes/confirm_phone_box.h b/Telegram/SourceFiles/ui/boxes/confirm_phone_box.h similarity index 99% rename from Telegram/SourceFiles/boxes/confirm_phone_box.h rename to Telegram/SourceFiles/ui/boxes/confirm_phone_box.h index 67ff3b73ac..ce620d86a2 100644 --- a/Telegram/SourceFiles/boxes/confirm_phone_box.h +++ b/Telegram/SourceFiles/ui/boxes/confirm_phone_box.h @@ -11,8 +11,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/sent_code_field.h" namespace Ui { + class FlatLabel; -} // namespace Ui class ConfirmPhoneBox final : public Ui::BoxContent { public: @@ -62,3 +62,5 @@ private: rpl::event_stream<> _resendRequests; }; + +} // namespace Ui diff --git a/Telegram/cmake/td_ui.cmake b/Telegram/cmake/td_ui.cmake index f7dd292f94..1f9eaf7005 100644 --- a/Telegram/cmake/td_ui.cmake +++ b/Telegram/cmake/td_ui.cmake @@ -110,6 +110,8 @@ PRIVATE ui/boxes/choose_date_time.h ui/boxes/confirm_box.cpp ui/boxes/confirm_box.h + ui/boxes/confirm_phone_box.cpp + ui/boxes/confirm_phone_box.h ui/boxes/country_select_box.cpp ui/boxes/country_select_box.h ui/boxes/edit_invite_link.cpp