2
0
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:
John Preston
2024-04-04 21:08:56 +04:00
parent ea178862d8
commit 23883ed4a1
8 changed files with 15 additions and 91 deletions

View File

@@ -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