Fixes for three-dots menu in Settings
* Show "Add account" only on main settings page * Add missing warning about too many accounts
This commit is contained in:
parent
960cb03714
commit
aa8423649f
1 changed files with 18 additions and 5 deletions
|
|
@ -202,11 +202,24 @@ void FillMenu(
|
||||||
tr::lng_settings_bg_theme_create(tr::now),
|
tr::lng_settings_bg_theme_create(tr::now),
|
||||||
[=] { window->show(Box(Window::Theme::CreateBox, window)); });
|
[=] { window->show(Box(Window::Theme::CreateBox, window)); });
|
||||||
} else {
|
} else {
|
||||||
const auto &list = Core::App().domain().accounts();
|
if (type != Type::Kotato) {
|
||||||
if (list.size() < ::Main::Domain::kMaxAccounts) {
|
const auto &list = Core::App().domain().accounts();
|
||||||
addAction(tr::lng_menu_add_account(tr::now), [=] {
|
if (list.size() < ::Main::Domain::kMaxAccountsWarn) {
|
||||||
Core::App().domain().addActivated(MTP::Environment{});
|
addAction(tr::lng_menu_add_account(tr::now), [=] {
|
||||||
});
|
Core::App().domain().addActivated(MTP::Environment{});
|
||||||
|
});
|
||||||
|
} else if (list.size() < ::Main::Domain::kMaxAccounts) {
|
||||||
|
addAction(tr::lng_menu_add_account(tr::now), [=] {
|
||||||
|
Ui::show(
|
||||||
|
Box<ConfirmBox>(
|
||||||
|
tr::ktg_too_many_accounts_warning(tr::now),
|
||||||
|
tr::ktg_account_add_anyway(tr::now),
|
||||||
|
[=] {
|
||||||
|
Core::App().domain().addActivated(MTP::Environment{});
|
||||||
|
}),
|
||||||
|
Ui::LayerOption::KeepOther);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const auto customSettingsFile = cWorkingDir() + "tdata/kotato-settings-custom.json";
|
const auto customSettingsFile = cWorkingDir() + "tdata/kotato-settings-custom.json";
|
||||||
if (type != Type::Kotato && !controller->session().supportMode()) {
|
if (type != Type::Kotato && !controller->session().supportMode()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue