[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 6e42a0fd0e
commit 29153f1324
2 changed files with 13 additions and 0 deletions

View file

@ -28,6 +28,8 @@
"ktg_mac_menu_show": "Show Kotatogram",
"ktg_settings_kotato": "Kotatogram Settings",
"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_sticker_height": "Sticker height: {pixels}px",
"ktg_settings_sticker_scale_both": "Apply to sticker width",

View file

@ -7,11 +7,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "settings/settings_common_session.h"
#include "kotato/kotato_lang.h"
#include "kotato/kotato_settings_menu.h"
#include "api/api_cloud_password.h"
#include "apiwrap.h"
#include "core/application.h"
#include "core/core_cloud_password.h"
#include "core/file_utilities.h"
#include "lang/lang_keys.h"
#include "main/main_domain.h"
#include "main/main_session.h"
@ -64,12 +66,21 @@ void FillMenu(
Core::App().domain().addActivated(MTP::Environment{});
}, &st::menuIconAddAccount);
}
const auto customSettingsFile = cWorkingDir() + "tdata/kotato-settings-custom.json";
if (type != Kotato::Id() && !controller->session().supportMode()) {
addAction(
tr::lng_settings_information(tr::now),
[=] { showOther(Information::Id()); },
&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()) {
addAction({
.text = tr::lng_settings_logout(tr::now),