Accessing dataengine from different plasmoid
Weng Xuetian
wengxt at gmail.com
Wed Feb 22 12:19:49 UTC 2012
在 2012年2月22日 星期三 12:59:58,Simone Gaiarin 写道:
> I'm writing a plasmoid to control redshift.
> Redshift is a program that change the colour temperature of the monitor.
>
> Here you can find the current plasmoid I wrote:
> http://kde-apps.org/content/show.php/Redshift+plasmoid?content=148737
>
> The current plasmoid span a redshift process from inside of it, so if
> I create two plasmoids they span two different process that create
> problems each other.
>
> What I want is create a plasmoid that can control this process through
> a dataengine, in such a way there is only one process running,
> controlled by multiple plasmoids.
>
> When the user click on the plasmoid it should be able to start and
> pause the process. So I need to create a service that perform the
> start/stop operations on the process.
>
> If the configuration is changed the process needs to be restarted.
> So I have to think about the correct way to connect the config changed
> event to the restart operation.
>
> I hope I've been clear enough.
So, what I think about this like this:
1. Create a dataengine, with only once source. (For your case)
2. Abstract all your need to interact with the process as dataengine service.
Dataengine code will be the only code that interactive with the process
directly.
3. Talk with the dataengine with the ServiceJob
4. If some data need to be updated, store the data into data engine.
You could take a look at now-playing, i
https://projects.kde.org/projects/kde/kde-
workspace/repository/revisions/master/show/plasma/generic/dataengines/nowplaying
And see how the ServiceJob works.(for nowplaying case, play, pause, stop the
player).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20120222/357349fa/attachment.sig>
More information about the Plasma-devel
mailing list