2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Remove irrelevant menu items (support).

This commit is contained in:
John Preston
2018-10-05 20:08:29 +03:00
parent 052fabcae3
commit eaa50adf75
2 changed files with 38 additions and 28 deletions

View File

@@ -93,24 +93,30 @@ MainMenu::MainMenu(
void MainMenu::refreshMenu() {
_menu->clearActions();
_menu->addAction(lang(lng_create_group_title), [] {
App::wnd()->onShowNewGroup();
}, &st::mainMenuNewGroup, &st::mainMenuNewGroupOver);
_menu->addAction(lang(lng_create_channel_title), [] {
App::wnd()->onShowNewChannel();
}, &st::mainMenuNewChannel, &st::mainMenuNewChannelOver);
_menu->addAction(lang(lng_menu_contacts), [] {
Ui::show(Box<PeerListBox>(std::make_unique<ContactsBoxController>(), [](not_null<PeerListBox*> box) {
box->addButton(langFactory(lng_close), [box] { box->closeBox(); });
box->addLeftButton(langFactory(lng_profile_add_contact), [] { App::wnd()->onShowAddContact(); });
}));
}, &st::mainMenuContacts, &st::mainMenuContactsOver);
if (Global::PhoneCallsEnabled()) {
_menu->addAction(lang(lng_menu_calls), [] {
Ui::show(Box<PeerListBox>(std::make_unique<Calls::BoxController>(), [](not_null<PeerListBox*> box) {
if (!Auth().supportMode()) {
_menu->addAction(lang(lng_create_group_title), [] {
App::wnd()->onShowNewGroup();
}, &st::mainMenuNewGroup, &st::mainMenuNewGroupOver);
_menu->addAction(lang(lng_create_channel_title), [] {
App::wnd()->onShowNewChannel();
}, &st::mainMenuNewChannel, &st::mainMenuNewChannelOver);
_menu->addAction(lang(lng_menu_contacts), [] {
Ui::show(Box<PeerListBox>(std::make_unique<ContactsBoxController>(), [](not_null<PeerListBox*> box) {
box->addButton(langFactory(lng_close), [box] { box->closeBox(); });
box->addLeftButton(langFactory(lng_profile_add_contact), [] { App::wnd()->onShowAddContact(); });
}));
}, &st::mainMenuCalls, &st::mainMenuCallsOver);
}, &st::mainMenuContacts, &st::mainMenuContactsOver);
if (Global::PhoneCallsEnabled()) {
_menu->addAction(lang(lng_menu_calls), [] {
Ui::show(Box<PeerListBox>(std::make_unique<Calls::BoxController>(), [](not_null<PeerListBox*> box) {
box->addButton(langFactory(lng_close), [box] { box->closeBox(); });
}));
}, &st::mainMenuCalls, &st::mainMenuCallsOver);
}
} else {
_menu->addAction(lang(lng_profile_add_contact), [] {
App::wnd()->onShowAddContact();
}, &st::mainMenuContacts, &st::mainMenuContactsOver);
}
_menu->addAction(lang(lng_menu_settings), [] {
App::wnd()->showSettings();