minimalcontextmenu was meant to be used for the screensavers, see kde-workspace:27d19ac6d96aff1993fae951f9f996ad1cb6f31e for reference, since we don't have screensavers in Plasma 5, this is not useful now. BUG: 343599 FIXED-IN: 5.3wilder-5.14
parent
53b0397992
commit
4f198425da
5 changed files with 0 additions and 201 deletions
@ -1,17 +0,0 @@ |
||||
project(plasma-containmentactions-minimalcontextmenu) |
||||
|
||||
set(contextmenu_SRCS |
||||
menu.cpp |
||||
) |
||||
|
||||
add_library(plasma_containmentactions_minimalcontextmenu MODULE ${contextmenu_SRCS}) |
||||
|
||||
kcoreaddons_desktop_to_json(plasma_containmentactions_minimalcontextmenu plasma-containmentactions-minimalcontextmenu.desktop) |
||||
|
||||
target_link_libraries(plasma_containmentactions_minimalcontextmenu |
||||
KF5::Plasma |
||||
KF5::KIOCore |
||||
KF5::XmlGui) |
||||
|
||||
install(TARGETS plasma_containmentactions_minimalcontextmenu DESTINATION ${PLUGIN_INSTALL_DIR}) |
||||
install(FILES plasma-containmentactions-minimalcontextmenu.desktop DESTINATION ${SERVICES_INSTALL_DIR}) |
||||
@ -1,63 +0,0 @@ |
||||
/*
|
||||
* Copyright 2009 by Chani Armitage <chani@kde.org> |
||||
* |
||||
* This program is free software; you can redistribute it and/or modify |
||||
* it under the terms of the GNU Library General Public License as |
||||
* published by the Free Software Foundation; either version 2, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details |
||||
* |
||||
* You should have received a copy of the GNU Library General Public |
||||
* License along with this program; if not, write to the |
||||
* Free Software Foundation, Inc., |
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
*/ |
||||
|
||||
#include "menu.h" |
||||
|
||||
#include <QAction> |
||||
#include <QGraphicsSceneMouseEvent> |
||||
#include <QGraphicsSceneWheelEvent> |
||||
|
||||
#include <QDebug> |
||||
#include <QMenu> |
||||
|
||||
#include <KActionCollection> |
||||
#include <Plasma/Containment> |
||||
#include <Plasma/Corona> |
||||
|
||||
ContextMenu::ContextMenu(QObject *parent, const QVariantList &args) |
||||
: Plasma::ContainmentActions(parent, args) |
||||
{ |
||||
m_separator = new QAction(this); |
||||
m_separator->setSeparator(true); |
||||
} |
||||
|
||||
ContextMenu::~ContextMenu() |
||||
{ |
||||
} |
||||
|
||||
QList<QAction*> ContextMenu::contextualActions() |
||||
{ |
||||
Plasma::Containment *c = containment(); |
||||
Q_ASSERT(c); |
||||
QList<QAction*> actions; |
||||
actions << c->contextualActions(); |
||||
actions << c->actions()->action("configure"); |
||||
|
||||
if (!c->wallpaper().isEmpty()) { |
||||
QObject *wallpaperGraphicsObject = c->property("wallpaperGraphicsObject").value<QObject *>(); |
||||
if (wallpaperGraphicsObject) { |
||||
actions << wallpaperGraphicsObject->property("contextualActions").value<QList<QAction *> >(); |
||||
} |
||||
} |
||||
return actions; |
||||
} |
||||
|
||||
K_EXPORT_PLASMA_CONTAINMENTACTIONS_WITH_JSON(minimalcontextmenu, ContextMenu, "plasma-containmentactions-minimalcontextmenu.json") |
||||
|
||||
#include "menu.moc" |
||||
@ -1,40 +0,0 @@ |
||||
/*
|
||||
* Copyright 2009 by Chani Armitage <chani@kde.org> |
||||
* |
||||
* This program is free software; you can redistribute it and/or modify |
||||
* it under the terms of the GNU Library General Public License as |
||||
* published by the Free Software Foundation; either version 2, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details |
||||
* |
||||
* You should have received a copy of the GNU Library General Public |
||||
* License along with this program; if not, write to the |
||||
* Free Software Foundation, Inc., |
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
*/ |
||||
|
||||
#ifndef CONTEXTMENU_HEADER |
||||
#define CONTEXTMENU_HEADER |
||||
|
||||
#include <QButtonGroup> |
||||
#include <plasma/containmentactions.h> |
||||
|
||||
class ContextMenu : public Plasma::ContainmentActions |
||||
{ |
||||
Q_OBJECT |
||||
public: |
||||
ContextMenu(QObject* parent, const QVariantList& args); |
||||
~ContextMenu(); |
||||
|
||||
QList<QAction*> contextualActions(); |
||||
|
||||
private: |
||||
QAction *m_separator; |
||||
|
||||
}; |
||||
|
||||
#endif |
||||
Loading…
Reference in new issue