Get panel list and hidding them via C++ module
Sebastian Kügler
sebas at kde.org
Mon Feb 9 12:59:21 UTC 2015
Hi Evgeniy,
On Monday, February 09, 2015 15:43:05 Evgeniy Alekseev wrote:
> Recently I have run into the following problem: how to get panel list (even
> w\o additional filtering) and hidding them from an applet?
>
> With KDE4 I have used the following method:
> 1. From plasmoid I have called containment()->corona() to get pointer to
> corona object.
> 2. Then I have used iteration on containments in the current corona() with
> filter by ContainmentType.
> 3. And set found containments hidding by calling Containment->view()-
> >setVisible(false).
That's a hack, even in a Plasma 4 world. :)
> With Plasma 5 I have found the following problems:
>
> 1. Unfortunately in the default way (i.e. if C++ module inherits from
> Qobject) I didn't find ability to get pointer to current corona. Is it
> possible to get it at the moment?
Not possible, the QtQuick code's access to the C++ bits (Applet, Containment
is now very limited by design).
> 2. Current containments have not view() method and seems have not method to
> set them hidding. Is there such ability in the current version?
No, the separation between model (Plasma::Applet, Plasma::Containment, etc.)
and the views (implemented in QtQuick) is deeper in Plasma 5, that's partly a
conscious design decision, and partly mandated by moving everything to
QtQuick.
> Also I have looked at QML bindings, but didn't find any ability to
> implement such functional too.
That's not possible in Plasma 5, and it's a conscious design decision. Applets
are not supposed to meddle with other applets, they're self-contained
outbound, and managed by the surrounding containment. If applets started
screwing around with each other, the situation would quickly become
unmanageable.
Let's take a step back, though. What do you actually want to achieve? Maybe
there is a way to make that possible within the design of Plasma.
Have you looked at desktop scripting to achieve what you are looking for?
Cheers,
--
sebas
http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9
More information about the Plasma-devel
mailing list