[Improvement] Settings three-dots menu improvements

This commit is contained in:
Eric Kotato 2022-09-10 20:21:52 +03:00 committed by Eric Kotato
parent e4663eb1ad
commit d7af8f8d8b
2 changed files with 13 additions and 0 deletions

View file

@ -28,6 +28,8 @@
"ktg_mac_menu_show": "Show Kotatogram", "ktg_mac_menu_show": "Show Kotatogram",
"ktg_settings_kotato": "Kotatogram Settings", "ktg_settings_kotato": "Kotatogram Settings",
"ktg_user_status_unaccessible": "account inaccessible", "ktg_user_status_unaccessible": "account inaccessible",
"ktg_settings_show_json_settings": "Show settings file",
"ktg_settings_restart": "Restart Kotatogram",
"ktg_settings_chats": "Chats", "ktg_settings_chats": "Chats",
"ktg_settings_sticker_height": "Sticker height: {pixels}px", "ktg_settings_sticker_height": "Sticker height: {pixels}px",
"ktg_settings_sticker_scale_both": "Apply to sticker width", "ktg_settings_sticker_scale_both": "Apply to sticker width",

View file

@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/ */
#include "settings/settings_common.h" #include "settings/settings_common.h"
#include "kotato/kotato_lang.h"
#include "apiwrap.h" #include "apiwrap.h"
#include "api/api_cloud_password.h" #include "api/api_cloud_password.h"
#include "settings/cloud_password/settings_cloud_password_email_confirm.h" #include "settings/cloud_password/settings_cloud_password_email_confirm.h"
@ -36,6 +37,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_session_controller.h" #include "window/window_session_controller.h"
#include "window/window_controller.h" #include "window/window_controller.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "core/file_utilities.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "main/main_session.h" #include "main/main_session.h"
#include "main/main_domain.h" #include "main/main_domain.h"
@ -381,12 +383,21 @@ void FillMenu(
Core::App().domain().addActivated(MTP::Environment{}); Core::App().domain().addActivated(MTP::Environment{});
}, &st::menuIconAddAccount); }, &st::menuIconAddAccount);
} }
const auto customSettingsFile = cWorkingDir() + "tdata/kotato-settings-custom.json";
if (type != Kotato::Id() && !controller->session().supportMode()) { if (type != Kotato::Id() && !controller->session().supportMode()) {
addAction( addAction(
tr::lng_settings_information(tr::now), tr::lng_settings_information(tr::now),
[=] { showOther(Information::Id()); }, [=] { showOther(Information::Id()); },
&st::menuIconInfo); &st::menuIconInfo);
} }
addAction(
ktr("ktg_settings_show_json_settings"),
[=] { File::ShowInFolder(customSettingsFile); },
&st::menuIconSettings);
addAction(
ktr("ktg_settings_restart"),
[] { Core::Restart(); },
&st::menuIconRestore);
if (type != Kotato::Id()) { if (type != Kotato::Id()) {
addAction({ addAction({
.text = tr::lng_settings_logout(tr::now), .text = tr::lng_settings_logout(tr::now),