mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Use generic way for FAQ links.
This commit is contained in:
@@ -110,7 +110,7 @@ object_ptr<Ui::RpWidget> CreateIntroSettings(
|
||||
tr::lng_settings_faq(),
|
||||
st::settingsButtonNoIcon
|
||||
)->addClickHandler([] {
|
||||
UrlClickHandler::Open(tr::lng_telegram_features_url(tr::now));
|
||||
OpenFaq(nullptr);
|
||||
});
|
||||
|
||||
return result;
|
||||
|
@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "settings/settings_main.h"
|
||||
|
||||
#include "core/application.h"
|
||||
#include "core/click_handler_types.h"
|
||||
#include "settings/settings_business.h"
|
||||
#include "settings/settings_codes.h"
|
||||
#include "settings/settings_chat.h"
|
||||
@@ -613,7 +614,7 @@ void SetupHelp(
|
||||
st::settingsButton,
|
||||
{ &st::menuIconFaq }
|
||||
)->addClickHandler([=] {
|
||||
controller->session().data().faq().open(controller->uiShow());
|
||||
OpenFaq(controller);
|
||||
});
|
||||
|
||||
AddButtonWithIcon(
|
||||
@@ -659,7 +660,7 @@ void SetupHelp(
|
||||
.text = tr::lng_settings_ask_sure(),
|
||||
.confirmed = sure,
|
||||
.cancelled = [=](Fn<void()> close) {
|
||||
controller->session().data().faq().open(controller->uiShow());
|
||||
OpenFaq(controller);
|
||||
close();
|
||||
},
|
||||
.confirmText = tr::lng_settings_ask_ok(),
|
||||
@@ -740,4 +741,12 @@ void Main::setupContent(not_null<Window::SessionController*> controller) {
|
||||
controller->session().data().cloudThemes().refresh();
|
||||
}
|
||||
|
||||
void OpenFaq(base::weak_ptr<Window::SessionController> weak) {
|
||||
UrlClickHandler::Open(
|
||||
tr::lng_settings_faq_link(tr::now),
|
||||
QVariant::fromValue(ClickHandlerContext{
|
||||
.sessionWindow = weak,
|
||||
}));
|
||||
}
|
||||
|
||||
} // namespace Settings
|
||||
|
@@ -29,6 +29,8 @@ void SetupInterfaceScale(
|
||||
not_null<Ui::VerticalLayout*> container,
|
||||
bool icon = true);
|
||||
|
||||
void OpenFaq(base::weak_ptr<Window::SessionController> weak);
|
||||
|
||||
class Main : public Section<Main> {
|
||||
public:
|
||||
Main(QWidget *parent, not_null<Window::SessionController*> controller);
|
||||
|
Reference in New Issue
Block a user