RFC: plasma2 and configuration
Marco Martin
notmart at gmail.com
Tue Feb 26 21:40:11 UTC 2013
On Tuesday 26 February 2013, Aaron J. Seigo wrote:
> On Tuesday, February 26, 2013 17:54:18 Marco Martin wrote:
> > * everything regarding configuration uis goes away from libplasma
>
> define "everything". there are four aspects to configuration:
>
> 0. the actions that trigger showing configu UI
> 1. notifying the component (e.g. plasmoid) that configuration has completed
> 2. creating and showing the actual window the config appears in
> 3. the control UI inside the window (Ok/Cancel, etc)
>
> where these should be implemented is critical as it will allow (or deny)
> new device adaptations, future flexibility with script engines, etc. iow,
> if we do not get this right, the work we're doing now will fail to meet
> the goals that got us started on this approach.
>
> one thing we need to avoid is reimplementing libplasma in the QML script
> engine. this will make any future scriptengine work far, far more work and
> will essentially make it impossible to support things like HTML5
> applications.
>
> the division of labor might look like:
>
> 0. libplasma
> 1. the scriptengine (though this depends on 3, so probably via libplasma)
> 2. the shell. (otherwise it will become QML dependent. and how does HTML5
> work then?)
> 3. libplasma? it needs to be consistent between script engines, but
> possibly vary between shells.
>
> > * the plasmoid may offer in their config directory a list of desktop
> > files, one per category, that would tell the name of the category, icon,
> > kconfiggroup and qml file to load
>
> how about a model driven mechanism instead? each configurable plasmoid
> could contain a QML component that provides a model in which each entry is
> a configuration page. translation would be handled in the normal fashion;
> support for kcm pages would be easy enough; would only require reading in
> one file and it could use laoders extensively to keep performance up.
in master now this is kindof implemented, looks like this
http://wstaw.org/m/2013/02/26/plasma-desktopzd2899.png
(well, will have to look better, but as Emmet Brown would say "You'll have to
forgive the crudeness of this model, I didn't have time to paint it or build
it to scale." ;)
the "general" icon alongside the ok/apply/cancel buttons are provided by the
corona's qml, the "text config value" textbox is a page provided by the
plasmoid.
config.qml looks like this:
QtObject {
property list<QtObject> modules: [
QtObject {
property string name: "General"
property string icon: "plasma"
property Component component: Component {
Item {
.....
}
}
},
QtObject {
property string name: "Page2"
property string icon: "buh"
property Component component: Component {
Item {
.....
}
}
}
]
}
it still looks a bit clunky, and perhaps a bit error prone as well, but
something more refined can come from that...
--
Marco Martin
More information about the Plasma-devel
mailing list