Review Request: Initial work on the flexible controller of the Plasma Media Center

Christophe Olinger olingerc at binarylooks.com
Tue Mar 30 14:28:03 CEST 2010


For better evaluation, I have summarized the current procedure

Currently the controller does the follwing:
* on init() it creates and configures all icons and buttons that we
might ever need for all modes
* it waits for a signal from the containment to hide/show buttons and
lay them out. This is the MediaCotrnoller:doLayout function which is
exposed by the libs
* the mode change buttons send signals, but do not initiate the
doLayout function themselves.

The containment does the following:
*It listens for the signals from the mode change buttons of the
controller and upon being signalled does the following:
*It stores the current and previous modes in member variables
*It disconnects signals between the applets that might change in a
different mode
*It reconnects signals according to mode (activating a browser item
does not do the same in every mode,...)
*It tells the controller to change its layout
*It tells the applets to change their options (like showing, hiding,
stopping, slideshow timer)
*It tells the medialayout to change behaviour of the applets, enabling
playlist, enabling autohide)


How do we collect these things in one spot to make it more
maintainable? How do we keep the mediacenter flexible and easily
expandable?

I hope this initiates some brilliant ideas.

BTW PLease hit me over the head if the above sounds completely crazy :-)


Chris


On Tue, Mar 30, 2010 at 11:14 AM, Alessandro Diaferia
<alediaferia at gmail.com> wrote:
>
>
>> On 2010-03-30 07:25:58, Alessandro Diaferia wrote:
>> > I was wondering whether it is the case to group the instructions inside MediaContainment::doLayout inside internal specific QGraphicsWidget or, at least, inside internal functions in order to avoid cluttering of the code. That is, a function to layout properly according to each Mode. Hope I am clear.
>>
>> Christophe Olinger wrote:
>>     Hmmm, the internal specific QGraphicsWidget part I did not get really. Sorry.
>>
>>     I can make functions in the mediacontainment.cpp and call each function depending on the mode from the doLayout function. Is this less cluttering?
>>     Could I somehow have this in a different class. Should we have classes for each mode that are subclasses of medialyout? I dind't go for that because I thought that changing layout of applets and changing their options were different things with the second not fitting in the layout class.
>>
>>     I have the same problem in the controller.cpp with the different modes. Should I have different classes there also?
>
> Well we could have a MusicModeWidget, a PictureModeWidget and a VideoModeWidget and set them on the playback control applet accordingly to the current mode. Or at least have different functions that layout buttons and icons correctly for each mode. Of course i didn't mean subclassing the layout.
>
> Probably also Aaron or Marco can give us their 2 cents on this.
>
>
> - Alessandro
>
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/3396/#review4768
> -----------------------------------------------------------
>
>
> On 2010-03-27 15:48:14, Christophe Olinger wrote:
>>
>> -----------------------------------------------------------
>> This is an automatically generated e-mail. To reply, visit:
>> http://reviewboard.kde.org/r/3396/
>> -----------------------------------------------------------
>>
>> (Updated 2010-03-27 15:48:14)
>>
>>
>> Review request for Plasma.
>>
>>
>> Summary
>> -------
>>
>> This patch extends the controller applet by having 6 different layout modes which are adapted to what the media center is currently used for, i.e. browsing pictures, playing videos, etc. It sends a signal to the containment with the current mode. The containment then relayouts the other applets and configures them for the current Mode. These modes are defined as enum in the libs.
>> *The browser no longer has any controls. Those are now in the controller.
>> *The controller also has a show/hide playlist button and a toggle autohide button for itself.
>> *The different modes do not have sensible functions yet. I also need to work on configuring the applets for each mode, like telling the browser to hide, or the player to show.
>> *The controller is not really beautiful. I want animations for show(hide icons. I want the modeswitch button in a "drawer" perhaps. The toggle buttons need effects.
>>
>>
>> Diffs
>> -----
>>
>>   /trunk/playground/base/plasma/MediaCenterComponents/applets/mediabrowser/abstractmediaitemview.cpp 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/applets/mediabrowser/mediabrowser.h 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/applets/mediabrowser/mediabrowser.cpp 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/applets/mediacontroller/controller.h 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/applets/mediacontroller/controller.cpp 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/containments/mediacontainment/mediacontainment.h 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/containments/mediacontainment/mediacontainment.cpp 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/containments/mediacontainment/medialayout.h 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/containments/mediacontainment/medialayout.cpp 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/libs/mediacenter/browser.cpp 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/libs/mediacenter/mediacenter.h 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/libs/mediacenter/playbackcontrol.h 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/libs/mediacenter/playbackcontrol.cpp 1108007
>>   /trunk/playground/base/plasma/MediaCenterComponents/shells/plasmediacenter/mainwindow.cpp 1108007
>>
>> Diff: http://reviewboard.kde.org/r/3396/diff
>>
>>
>> Testing
>> -------
>>
>> I tested the controller itself. The actual effect on the other applets when changing modes still needs work.
>>
>>
>> Thanks,
>>
>> Christophe
>>
>>
>
>


More information about the Plasma-devel mailing list