Στις 15/01/2013 02:01 μμ, ο/η Aaron J. Seigo έγραψε:
On Tuesday, January 15, 2013 10:51:55 Michail Vourlakos wrote:
Hello, I am trying to access containment() and corona() from
a clean qml plasmoid.
what are you needing access to these for?

i ask because the goal for QML plasmoids is that they should never need this
(simplifies a large number of things, from security to presentation
flexibility). if we are missing some API that is needed, then we can look at
filling that gap.

For the workflow plasmoid I have implemented some features by using the above classes which
are available through the PopUpApplet class.
I will make a list of the features in order to see if there is a different way of implementing them
of if there is a chance to add some API.

1) Find the single image wallpaper for every activity. (For all the running and stopped activities I can find it through the config files but when you create a new activity there is a time gap for storing the configuration to the relevant files. The solution for me for these activities was to iterate the containments from corona
and find the wallpaper configuration)
------------------

2) Showing widgets for specific activity. I used the containment() found through corona():

    Plasma::Containment *currentContainment = getContainment(actId);
    if(currentContainment && currentContainment->view()){
currentContainment->view()->metaObject()->invokeMethod(currentContainment->view(),
"showWidgetExplorer");
    }
------------------------

3) Unlocking the widgets before showing the widgets explorer:
   I used the QActions from corona in order to achieve this
-----------------------

4) effectiveWId for the plasmoid. In order to enable window previews in the plasmoid I used Plasma::WindowEffects::showWindowThumbnails which needs a WId. There are two circumstances a)if the plasmoid is in the Dashboard then the Dashboard WId changes every time the user shows Dashboard: I am catching the activeWindowChanged signal from KWindowSystem in order to check if the
         effectiveWId has changed for the Applet.
b)when the plasmoid is in the panel the PopUps WId is found through KWindowSystem::windows()
         it is the last one in the list when the popup is first shown
-------------------------

5) I will open a new thread for this:
I think it would be good to add to plasma-desktop some qdbus functions for activityTemplates support. I dont think that there is a way for a plasmoid to know which activity templates are installed in plasma-desktop and also add an activity for a specific plugin. I think that all this could be exposed through qdbus without issues.




_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to