Review Request: configurable default mouse plugins
Chani
chanika at gmail.com
Sat Oct 3 00:54:12 CEST 2009
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/1760/
-----------------------------------------------------------
Review request for Plasma.
Summary
-------
this creates a framework for shells to configure the set of default ContainmentActions plugins for each type of containment (desktop, panel, etc).
I think it could be better... I don't like keeping a bunch of pointers, and I don't like having to create two identical objects for the two panel types. maybe Corona should keep some kind of reference-counted guarded pointer? or I could make them not pointers at all, but that would cause trouble with the dptr... if I did a copy constructor would that solve that?
the patch to kdebase is small so instead of creating a separate review request I'll paste the important bit here:
@@ -51,6 +53,24 @@ void DesktopCorona::init()
Kephal::Screens *screens = Kephal::Screens::self();
connect(screens, SIGNAL(screenAdded(Kephal::Screen *)), SLOT(screenAdded(Kephal::Screen *)));
connect(KWindowSystem::self(), SIGNAL(workAreaChanged()), this, SIGNAL(availableScreenRegionChanged()));
+
+ Plasma::ContainmentActionsPluginsConfig *desktopPlugins = new Plasma::ContainmentActionsPluginsConfig();
+ desktopPlugins->addPlugin("wheel:Vertical;NoModifier", "switchdesktop");
+ //I can never remember the right string for middle button...
+ QGraphicsSceneMouseEvent mid(QEvent::GraphicsSceneMousePress);
+ mid.setButton(Qt::MidButton);
+ desktopPlugins->addPlugin(&mid, "paste");
+ desktopPlugins->addPlugin("RightButton;NoModifier", "contextmenu");
+ Plasma::ContainmentActionsPluginsConfig *panelPlugins = new Plasma::ContainmentActionsPluginsConfig();
+ panelPlugins->addPlugin("RightButton;NoModifier", "contextmenu");
+ //duplicate to avoid double deletion n'stuff
+ //FIXME I'm sure there's a better way
+ Plasma::ContainmentActionsPluginsConfig *panelPlugins2 = new Plasma::ContainmentActionsPluginsConfig();
+ panelPlugins2->addPlugin("RightButton;NoModifier", "contextmenu");
+
+ setContainmentActionsDefaults(Plasma::Containment::DesktopContainment, desktopPlugins);
+ setContainmentActionsDefaults(Plasma::Containment::PanelContainment, panelPlugins);
+ setContainmentActionsDefaults(Plasma::Containment::CustomPanelContainment, panelPlugins2);
}
Diffs
-----
/dev/null PRE-CREATION
/dev/null PRE-CREATION
/dev/null PRE-CREATION
/trunk/KDE/kdelibs/plasma/CMakeLists.txt 1029909
/trunk/KDE/kdelibs/plasma/containment.cpp 1029909
/trunk/KDE/kdelibs/plasma/corona.h 1029909
/trunk/KDE/kdelibs/plasma/corona.cpp 1029909
Diff: http://reviewboard.kde.org/r/1760/diff
Testing
-------
Thanks,
Chani
More information about the Plasma-devel
mailing list