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:
@@ -602,21 +602,25 @@ void MainWindow::createGlobalMenu() {
|
||||
psSelectAll = edit->addAction(lang(lng_mac_menu_select_all), this, SLOT(psMacSelectAll()), QKeySequence::SelectAll);
|
||||
|
||||
QMenu *window = psMainMenu.addMenu(lang(lng_mac_menu_window));
|
||||
psContacts = window->addAction(lang(lng_mac_menu_contacts));
|
||||
connect(psContacts, &QAction::triggered, psContacts, [] {
|
||||
if (App::wnd() && App::wnd()->isHidden()) App::wnd()->showFromTray();
|
||||
if (!Auth().supportMode()) {
|
||||
psContacts = window->addAction(lang(lng_mac_menu_contacts));
|
||||
connect(psContacts, &QAction::triggered, psContacts, [] {
|
||||
if (App::wnd() && App::wnd()->isHidden()) App::wnd()->showFromTray();
|
||||
|
||||
if (!AuthSession::Exists()) return;
|
||||
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(); });
|
||||
}));
|
||||
});
|
||||
if (!AuthSession::Exists()) return;
|
||||
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(); });
|
||||
}));
|
||||
});
|
||||
}
|
||||
psAddContact = window->addAction(lang(lng_mac_menu_add_contact), App::wnd(), SLOT(onShowAddContact()));
|
||||
window->addSeparator();
|
||||
psNewGroup = window->addAction(lang(lng_mac_menu_new_group), App::wnd(), SLOT(onShowNewGroup()));
|
||||
psNewChannel = window->addAction(lang(lng_mac_menu_new_channel), App::wnd(), SLOT(onShowNewChannel()));
|
||||
window->addSeparator();
|
||||
if (!Auth().supportMode()) {
|
||||
psNewGroup = window->addAction(lang(lng_mac_menu_new_group), App::wnd(), SLOT(onShowNewGroup()));
|
||||
psNewChannel = window->addAction(lang(lng_mac_menu_new_channel), App::wnd(), SLOT(onShowNewChannel()));
|
||||
window->addSeparator();
|
||||
}
|
||||
psShowTelegram = window->addAction(lang(lng_mac_menu_show), App::wnd(), SLOT(showFromTray()));
|
||||
|
||||
updateGlobalMenu();
|
||||
|
Reference in New Issue
Block a user