diff --git a/useractions.h b/useractions.h --- a/useractions.h +++ b/useractions.h @@ -120,10 +120,6 @@ * Adjust the items according to the respective Client. */ void menuAboutToShow(); - /** - * Adjusts the add to tab group menu to the current value of the Client. - */ - void rebuildTabGroupPopup(); /** * Adjusts the switch to tab menu to the current values of the Client. */ @@ -210,10 +206,6 @@ * Oh, and an 'all' option too of course */ void initActivityPopup(); - /** - * Creates the Window Tabbing related menus. - */ - void initTabbingPopups(); /** * Shows a helper Dialog to inform the user how to get back in case he triggered * an action which hides the window decoration (e.g. NoBorder or Fullscreen). @@ -241,10 +233,6 @@ * The activities sub menu. */ QMenu* m_activityMenu; - /** - * Menu to add the group to other group. - */ - QMenu* m_addTabsMenu; /** * Menu to change tab. */ @@ -264,14 +252,6 @@ QAction* m_minimizeOperation; QAction* m_closeOperation; QAction* m_shortcutOperation; - /** - * Remove client from group. - */ - QAction* m_removeFromTabGroup; - /** - * Close all clients in the group. - */ - QAction* m_closeTabGroup; /** * The Client for which the menu is shown. */ diff --git a/useractions.cpp b/useractions.cpp --- a/useractions.cpp +++ b/useractions.cpp @@ -81,7 +81,6 @@ , m_desktopMenu(NULL) , m_screenMenu(NULL) , m_activityMenu(NULL) - , m_addTabsMenu(NULL) , m_switchToTabMenu(NULL) , m_scriptsMenu(NULL) , m_resizeOperation(NULL) @@ -94,8 +93,6 @@ , m_noBorderOperation(NULL) , m_minimizeOperation(NULL) , m_closeOperation(NULL) - , m_removeFromTabGroup(NULL) - , m_closeTabGroup(NULL) { } @@ -376,22 +373,6 @@ m_menu->addSeparator(); - // Actions for window tabbing - if (false) { - m_removeFromTabGroup = m_menu->addAction(i18n("&Untab")); - setShortcut(m_removeFromTabGroup, QStringLiteral("Untab")); - m_removeFromTabGroup->setData(Options::RemoveTabFromGroupOp); - - m_closeTabGroup = m_menu->addAction(i18n("Close Entire &Group")); - m_closeTabGroup->setIcon(QIcon::fromTheme(QStringLiteral("window-close"))); - setShortcut(m_closeTabGroup, QStringLiteral("Close TabGroup")); - m_closeTabGroup->setData(Options::CloseTabGroupOp); - - m_menu->addSeparator(); - } - - m_menu->addSeparator(); - action = m_menu->addMenu(advancedMenu); action->setText(i18n("&More Actions")); @@ -412,7 +393,6 @@ m_screenMenu = NULL; m_activityMenu = NULL; m_switchToTabMenu = NULL; - m_addTabsMenu = NULL; m_scriptsMenu = NULL; } @@ -453,17 +433,9 @@ m_closeOperation->setEnabled(m_client->isCloseable()); m_shortcutOperation->setEnabled(m_client->rules()->checkShortcut(QString()).isNull()); - if (false) { - initTabbingPopups(); - m_addTabsMenu->setPalette(m_client->palette()); - } else { - delete m_addTabsMenu; - m_addTabsMenu = 0; - } - // drop the existing scripts menu delete m_scriptsMenu; - m_scriptsMenu = NULL; + m_scriptsMenu = nullptr; // ask scripts whether they want to add entries for the given Client QList scriptActions = Scripting::self()->actionsForUserActionMenu(m_client.data(), m_scriptsMenu); if (!scriptActions.isEmpty()) { @@ -566,52 +538,6 @@ } } -void UserActionsMenu::rebuildTabGroupPopup() -{ - Q_ASSERT(m_addTabsMenu); - - m_addTabsMenu->clear(); - const auto &clientList = Workspace::self()->allClientList(); - for (auto i = clientList.constBegin(), end = clientList.constEnd(); i != end; ++i) { - if (*i == m_client.data() || (*i)->noBorder()) - continue; - m_addTabsMenu->addAction(shortCaption((*i)->caption()))->setData(QVariant::fromValue(*i)); - } - if (m_addTabsMenu->actions().isEmpty()) - m_addTabsMenu->addAction(i18nc("There's no window available to be attached as tab to this one", "None available"))->setEnabled(false); -} - -void UserActionsMenu::initTabbingPopups() -{ - bool needTabManagers = false; - Q_ASSERT(m_client); - if (!m_client) - return; - if (m_client->tabGroup() && m_client->tabGroup()->count() > 1) { - needTabManagers = true; - if (!m_switchToTabMenu) { - m_switchToTabMenu = new QMenu(i18n("Switch to Tab"), m_menu); - connect(m_switchToTabMenu, &QMenu::triggered, this, &UserActionsMenu::selectPopupClientTab); - connect(m_switchToTabMenu, &QMenu::aboutToShow, this, &UserActionsMenu::rebuildTabListPopup); - m_menu->insertMenu(m_removeFromTabGroup, m_switchToTabMenu); - } - } else { - delete m_switchToTabMenu; - m_switchToTabMenu = 0; - } - - if (!m_addTabsMenu) { - m_addTabsMenu = new QMenu(i18n("&Attach as tab to"), m_menu); - connect(m_addTabsMenu, &QMenu::triggered, this, &UserActionsMenu::entabPopupClient); - connect(m_addTabsMenu, &QMenu::aboutToShow, this, &UserActionsMenu::rebuildTabGroupPopup); - m_menu->insertMenu(m_removeFromTabGroup, m_addTabsMenu); - } - - m_addTabsMenu->menuAction()->setEnabled(!m_client->isFullScreen()); - m_removeFromTabGroup->setVisible(needTabManagers); - m_closeTabGroup->setVisible(needTabManagers); -} - void UserActionsMenu::initDesktopPopup() { if (kwinApp()->operationMode() == Application::OperationModeWaylandOnly ||