2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 06:07:45 +00:00

New items in settings' three-dots menu

- Show custom settings: opens JSON file in your profile folder.
- Restart Kotatogram: restarts app, can be used to apply changes from JSON.
This commit is contained in:
RadRussianRus 2019-10-06 03:10:40 +03:00
parent b3a89095a3
commit 2602d25fa5
2 changed files with 12 additions and 0 deletions

View File

@ -2245,4 +2245,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"ktg_restricted_send_inline_until" = "The admins of this group restricted you from posting inline content here until {date}, {time}.";
"ktg_restricted_send_polls_until" = "The admins of this group restricted you from posting polls here until {date}, {time}.";
"ktg_settings_show_json_settings" = "Show custom settings";
"ktg_settings_restart" = "Restart Kotatogram";
// Keys finished

View File

@ -23,7 +23,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_session_controller.h"
#include "window/window_controller.h"
#include "lang/lang_keys.h"
#include "core/file_utilities.h"
#include "mainwindow.h"
#include "app.h"
#include "main/main_session.h"
#include "styles/style_boxes.h"
#include "styles/style_settings.h"
@ -183,11 +185,18 @@ void FillMenu(
tr::lng_settings_bg_theme_create(tr::now),
[=] { window->show(Box(Window::Theme::CreateBox, window)); });
} else {
const auto customSettingsFile = cWorkingDir() + "tdata/kotato-settings-custom.json";
if (!controller->session().supportMode()) {
addAction(
tr::lng_settings_information(tr::now),
[=] { showOther(Type::Information); });
}
addAction(
tr::ktg_settings_show_json_settings(tr::now),
[=] { File::ShowInFolder(customSettingsFile); });
addAction(
tr::ktg_settings_restart(tr::now),
[=] { App::restart(); });
addAction(
tr::lng_settings_logout(tr::now),
[=] { window->widget()->onLogout(); });