Using DBusMenu in KStatusNotifierItem

Matthieu Gallien matthieu_gallien at yahoo.fr
Thu Mar 25 23:49:03 CET 2010


Hello Plasma devs,

I talked with Aurélien about this.

Le Mardi 8 Décembre 2009 22:14:06, Marco Martin a écrit :
> On Monday 07 December 2009, Aurélien Gâteau wrote:
> > Hi,
> > 
> > I have been talking with Marco and Aaron recently on a new way to define
> > context menus for KStatusNotifierItem.
> > 
> > Right now what is done is that when the user right click on a
> > KStatusNotifierItem in the systemtray Plasma applet, a DBus signal is
> > sent from the applet to the application, asking it to show its menu at
> > the appropriate position.
> > 
> > The idea behind DBusMenu is that the application passes its menu
> > definition to the systemtray applet through DBus. It is then up to the
> > applet to show the menu and notify the application when the user
> > triggers an action.
> > 
> > The advantage of this method is that you can have Plasma-themed menus,
> > whether the application is a KDE or GNOME app (my colleagues are working
> > on the GNOME side of the project).
> > 
> > Work on this has begun. Since it's not the right time for this in trunk,
> > I created kdelibs and kdebase branches, which you can find in KDE svn
> > 
> >  there:
> > branches/work/~agateau/dbusmenu/kdelibs
> > branches/work/~agateau/dbusmenu/kdebase
> > 
> > It is starting to work: the applet is able to show the menu application
> > in an ugly treeview.
> > 
> > Next step is now to implement proper Plasma-like rendering of the menu
> > and I would like to have your opinion on this: what would be the best
> > way to implement menus in Plasma?
> > 
> > So far applets I know which present menu-like ui are the Kickoff, Device
> > Notifier and Quick Access applets. Should I base my widget on code from
> > any of these applets? Would you prefer a brand new implementation?
> 
> all of them are quite custom...
> 
> IconWidget can already be syncronized with qactions, probably items should
> be those, in a vertical layout and in a Dialog
> it looks a bit more complex for submenus, it will take quite a bit of code
> but should still be quite simple
> 
> > Aurélien
> > _______________________________________________
> > Plasma-devel mailing list
> > Plasma-devel at kde.org
> > https://mail.kde.org/mailman/listinfo/plasma-devel


I would like to integrate this with the systray applet. My idea is to add the 
code Aurélien wrote to the StatusNotifierItem dataengine.
Aurélien would like to keep things simple. So I could just takes his code and 
put it in the service associated to the context menu.
My long term desire would be to integrate this somehow with the tasks applet. 
I would love to have merged context menu for entries like amarok main window.

Should I start by just allowing to trigger the dbus provided menu through the 
service (this solution should be simple) ?

Should I provide through the data engine, the description of the menu and a 
service to trigger the actions  (this solution would be more complicated) ?

The second solution would allow for merging the entries into another existing 
menu.

I cannot promise any time budget as it is depending on uncertain things in my 
real life. Aurélien already promised any help he can provide. He also asks me 
to consider the real utility (or use case) of my complex solution.

At least, I am studying the code of dbusmenu-qt in the branch of Aurélien.

I would like to get further input from Plasma devs. Including that I should 
work on something else ;)

Best regards

-- 
Matthieu Gallien


More information about the Plasma-devel mailing list