mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-24 17:33:50 +03:00
context:Preferences action in hash
This commit is contained in:
parent
a4cc972a3c
commit
eeafa17f17
@ -70,7 +70,6 @@ Menu::~Menu()
|
|||||||
m_moveToLayoutMenu->deleteLater();
|
m_moveToLayoutMenu->deleteLater();
|
||||||
|
|
||||||
//! actions
|
//! actions
|
||||||
m_preferenceAction->deleteLater();
|
|
||||||
m_printAction->deleteLater();
|
m_printAction->deleteLater();
|
||||||
m_removeAction->deleteLater();
|
m_removeAction->deleteLater();
|
||||||
m_quitApplication->deleteLater();
|
m_quitApplication->deleteLater();
|
||||||
@ -151,9 +150,9 @@ void Menu::makeActions()
|
|||||||
connect(m_moveToLayoutMenu, &QMenu::triggered, this, &Menu::moveToLayout);
|
connect(m_moveToLayoutMenu, &QMenu::triggered, this, &Menu::moveToLayout);
|
||||||
|
|
||||||
//! Configure Latte
|
//! Configure Latte
|
||||||
m_preferenceAction = new QAction(QIcon::fromTheme("configure"), i18nc("global settings window", "&Configure Latte..."), this);
|
m_actions[Latte::Data::ContextMenu::PREFERENCESACTION] = new QAction(QIcon::fromTheme("configure"), i18nc("global settings window", "&Configure Latte..."), this);
|
||||||
this->containment()->actions()->addAction(Latte::Data::ContextMenu::PREFERENCESACTION, m_preferenceAction);
|
this->containment()->actions()->addAction(Latte::Data::ContextMenu::PREFERENCESACTION, m_actions[Latte::Data::ContextMenu::PREFERENCESACTION]);
|
||||||
connect(m_preferenceAction, &QAction::triggered, [=](){
|
connect(m_actions[Latte::Data::ContextMenu::PREFERENCESACTION], &QAction::triggered, [=](){
|
||||||
QDBusInterface iface("org.kde.lattedock", "/Latte", "", QDBusConnection::sessionBus());
|
QDBusInterface iface("org.kde.lattedock", "/Latte", "", QDBusConnection::sessionBus());
|
||||||
|
|
||||||
if (iface.isValid()) {
|
if (iface.isValid()) {
|
||||||
@ -221,7 +220,7 @@ QList<QAction *> Menu::contextualActions()
|
|||||||
actions << m_actions[Latte::Data::ContextMenu::SECTIONACTION];
|
actions << m_actions[Latte::Data::ContextMenu::SECTIONACTION];
|
||||||
//actions << m_printAction;
|
//actions << m_printAction;
|
||||||
actions << m_layoutsAction;
|
actions << m_layoutsAction;
|
||||||
actions << m_preferenceAction;
|
actions << m_actions[Latte::Data::ContextMenu::PREFERENCESACTION];
|
||||||
actions << m_quitApplication;
|
actions << m_quitApplication;
|
||||||
|
|
||||||
actions << m_actions[Latte::Data::ContextMenu::SEPARATOR1ACTION];
|
actions << m_actions[Latte::Data::ContextMenu::SEPARATOR1ACTION];
|
||||||
@ -280,8 +279,6 @@ QAction *Menu::action(const QString &name)
|
|||||||
return m_layoutsAction;
|
return m_layoutsAction;
|
||||||
} else if (name == Latte::Data::ContextMenu::MOVEVIEWACTION) {
|
} else if (name == Latte::Data::ContextMenu::MOVEVIEWACTION) {
|
||||||
return m_moveAction;
|
return m_moveAction;
|
||||||
} else if (name == Latte::Data::ContextMenu::PREFERENCESACTION) {
|
|
||||||
return m_preferenceAction;
|
|
||||||
} else if (name == Latte::Data::ContextMenu::QUITLATTEACTION) {
|
} else if (name == Latte::Data::ContextMenu::QUITLATTEACTION) {
|
||||||
return m_quitApplication;
|
return m_quitApplication;
|
||||||
} else if (name == Latte::Data::ContextMenu::REMOVEVIEWACTION) {
|
} else if (name == Latte::Data::ContextMenu::REMOVEVIEWACTION) {
|
||||||
|
@ -55,7 +55,6 @@ private:
|
|||||||
|
|
||||||
QHash<QString, QAction *> m_actions;
|
QHash<QString, QAction *> m_actions;
|
||||||
|
|
||||||
QAction *m_preferenceAction{nullptr};
|
|
||||||
QAction *m_printAction{nullptr};
|
QAction *m_printAction{nullptr};
|
||||||
QAction *m_removeAction{nullptr};
|
QAction *m_removeAction{nullptr};
|
||||||
QAction *m_quitApplication{nullptr};
|
QAction *m_quitApplication{nullptr};
|
||||||
|
Loading…
Reference in New Issue
Block a user