Part of elisa.plugins.poblesec.base.hierarchy View In Hierarchy
Known subclasses: elisa.plugins.daap.controller.AlbumsDaapController, elisa.plugins.daap.controller.ArtistsDaapController, elisa.plugins.daap.controller.TracksDaapController, elisa.plugins.database.music_controller.DecadesDbController, elisa.plugins.database.music_controller.GenericAlbumsDbController, elisa.plugins.database.music_controller.GenericArtistsController, elisa.plugins.database.music_controller.GenericTracksDbController, elisa.plugins.database.music_controller.GenresDbController, elisa.plugins.database.photo_controller.GenericPhotoAlbumsController, elisa.plugins.database.photo_controller.GenericPhotosController, elisa.plugins.database.photo_controller.PhotosTimesController, elisa.plugins.database.video_controller.UnclassifiedVideosController, elisa.plugins.database.video_controller.VideoController, elisa.plugins.database.video_controller.VideosTimesController, elisa.plugins.dvd.dvdcontroller.DvdHierarchyController, elisa.plugins.flickr.controller.FlickrAccountController, elisa.plugins.flickr.controller.FlickrController, elisa.plugins.ipod.controller.AlbumsIpodController, elisa.plugins.ipod.controller.ArtistsIpodController, elisa.plugins.ipod.controller.TracksIpodController, elisa.plugins.poblesec.filesystem.FilesystemController, elisa.plugins.poblesec.network.NetworkShareBrowser, elisa.plugins.poblesec.plugins.FindNewPluginsController, elisa.plugins.poblesec.plugins.PluginActionsController, elisa.plugins.poblesec.plugins.PluginLibraryController, elisa.plugins.poblesec.plugins.PluginUpdatesController, elisa.plugins.poblesec.section.SectionMenuHierarchy, elisa.plugins.rss.controller.RssReaderController, elisa.plugins.shoutcast.controller.GenericShoutcastController, elisa.plugins.youtube.controller.YoutubeController
Generic controller that should be used as a base class for all custom controllers that define a browsable hierarchy.
The model of the controller is usually populated in its initialize method, while the behaviour when an item of the list representing a given level of the hierarchy is clicked is defined by the node_clicked method.
Every deferred call done in the context of this controller should be registered in the internal dictionary of deferreds so as to keep track of them and allow their cancellation if needed (e.g. when cleaning the controller). Each value of this internal dictionary is a list, meaning that several deferred calls can be associated to one key.
>>> self.register_deferred(key, deferred)
To cancel all the deferred calls associated to a given key, do:
>>> self.cancel_deferreds(key)
Instance Variables | deferreds | a dictionary of currently pending deferred calls
(type: dict of list of
{elisa.core.utils.cancellable_defer.CancellableDeferred}
) |
actions | a list of contextual actions for this controller.
(type: elisa.core.utils.notifying_list.List
of elisa.plugins.poblesec.actions.Action
) |
Line # | Kind | Name | Docs |
---|---|---|---|
55 | Method | initialize | Initialize the component. |
68 | Method | node_clicked | Callback invoked when an item of the list representing a given level of |
80 | Method | register_deferred | Register a deferred call to be associated to a given key. |
86 | Method | cancel_deferreds | Cancel all the currently pending deferred calls associated to one given |
103 | Method | cancel_all_deferreds | Cancel all the currently pending deferred calls. |
114 | Method | clean | Clean the component. |
Inherited from Component:
Line # | Kind | Name | Docs |
---|---|---|---|
85 | Class | PathDescriptor | Undocumented |
97 | Class Method | create | Create and initialize the component. |
Inherited from Loggable (via Component):
Line # | Kind | Name | Docs |
---|---|---|---|
81 | Method | __init__ | Undocumented |
This method is called by Component.create
to finish the
initialization of a component.
Returns | a deferred called when a component is fully initialized
(type: twisted.internet.defer.Deferred
) |
Parameters | widget | the selected list item widget in the view
(type: elisa.plugins.pigment.widgets.widget.Widget
) |
item | the selected list item in the controller's model
(type: elisa.core.components.model.Model
) |
Parameters | key | the key in the internal deferreds dictionary (type: any immutable type ) |
This method is called when a component is not needed anymore to clean its state.
Returns | a deferred called when the component has finished cleaning its state
(type: twisted.internet.defer.Deferred
) |