diff --git a/containmentactions/contextmenu/menu.h b/containmentactions/contextmenu/menu.h --- a/containmentactions/contextmenu/menu.h +++ b/containmentactions/contextmenu/menu.h @@ -45,7 +45,7 @@ void populateLayouts(); void requestConfiguration(); void switchToLayout(QAction *action); - + void setConfigureActionText(); private: QStringList m_layoutsData; diff --git a/containmentactions/contextmenu/menu.cpp b/containmentactions/contextmenu/menu.cpp --- a/containmentactions/contextmenu/menu.cpp +++ b/containmentactions/contextmenu/menu.cpp @@ -65,7 +65,7 @@ qDebug() << "Action Trigerred !!!"; }); - m_addWidgetsAction = new QAction(QIcon::fromTheme("add"), i18n("Add Widgets..."), this); + m_addWidgetsAction = new QAction(QIcon::fromTheme("add"), i18n("&Add Widgets..."), this); m_addWidgetsAction->setStatusTip(i18n("Show Plasma Widget Explorer")); connect(m_addWidgetsAction, &QAction::triggered, [ = ]() { QDBusInterface iface("org.kde.plasmashell", "/PlasmaShell", "", QDBusConnection::sessionBus()); @@ -75,18 +75,23 @@ } }); - m_configureAction = new QAction(QIcon::fromTheme("configure"), i18nc("view settings window", "View Settings..."), this); - m_configureAction->setShortcut(QKeySequence()); + m_configureAction = new QAction(QIcon::fromTheme("configure"), i18nc("view settings window", "View &Settings..."), this); + setConfigureActionText(); connect(m_configureAction, &QAction::triggered, this, &Menu::requestConfiguration); m_switchLayoutsMenu = new QMenu; m_layoutsAction = m_switchLayoutsMenu->menuAction(); - m_layoutsAction->setText(i18n("Layouts")); + m_layoutsAction->setText(i18n("&Layouts")); m_layoutsAction->setIcon(QIcon::fromTheme("user-identity")); m_layoutsAction->setStatusTip(i18n("Switch to another layout")); connect(m_switchLayoutsMenu, &QMenu::aboutToShow, this, &Menu::populateLayouts); connect(m_switchLayoutsMenu, &QMenu::triggered, this, &Menu::switchToLayout); + + connect(this->containment(), &Plasma::Containment::userConfiguringChanged, this, [&](bool configuring){ + m_configureAction->setVisible(!configuring); + if (!configuring) setConfigureActionText(); + }); } @@ -209,6 +214,12 @@ } } +void Menu::setConfigureActionText() +{ + int viewType = this->containment()->config().readEntry("viewType", static_cast(Latte::Types::DockView)); + m_configureAction->setText(i18nc("view settings window", viewType == Latte::Types::DockView ? "Dock &Settings..." : "Panel &Settings...")); +} + K_EXPORT_PLASMA_CONTAINMENTACTIONS_WITH_JSON(lattecontextmenu, Menu, "plasma-containmentactions-lattecontextmenu.json") #include "menu.moc"