RB.DisplayPageModel¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.TreeModelFilter (11), GObject.Object (37), Gtk.TreeDragSource (3), Gtk.TreeModel (28)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when a drag and drop operation to the display page tree completes. |
|
Emitted when a new page is inserted into the model. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class RB.DisplayPageModel(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
RB.DisplayPageTree
widget is backed by aGtk.TreeStore
containing the sources and a set of attributes used to structure and display them, and aGtk.TreeModelFilter
that hides sources with the visibility property set toFalse
. This class implements the filter model and also creates the actual model.The display page model supports drag and drop in a variety of formats. The simplest of these are text/uri-list and application/x-rhythmbox-entry, which convey URIs and IDs of existing database entries. When dragged to an existing source, these just add the URIs or entries to the target source. When dragged to an empty space in the tree widget, this results in the creation of a static playlist.
text/x-rhythmbox-artist, text/x-rhythmbox-album, and text/x-rhythmbox-genre are used when dragging items from the library browser. When dragged to the display page tree, these result in the creation of a new auto playlist with the dragged items as criteria.
- classmethod new()¶
- Returns:
- Return type:
This constructs both the
Gtk.TreeStore
holding the display page data and the filter model that hides invisible pages.
- add_page(page, parent)¶
- Parameters:
page (
RB.DisplayPage
) – theRB.DisplayPage
to addparent (
RB.DisplayPage
) – the parent under which to add page
Adds a page to the model, either below a specified page (if it’s a source or something else) or at the top level (if it’s a group)
- find_page(page, iter)¶
- Parameters:
page (
RB.DisplayPage
) – theRB.DisplayPage
to finditer (
Gtk.TreeIter
) – returns aGtk.TreeIter
for the page
- Returns:
True
if the page was found- Return type:
Finds a
Gtk.TreeIter
for a specified page in the model. This will only find pages that are currently visible. The returnedGtk.TreeIter
can be used with theRB.DisplayPageModel
.
- find_page_full(page, iter)¶
- Parameters:
page (
RB.DisplayPage
) – theRB.DisplayPage
to finditer (
Gtk.TreeIter
) – returns aGtk.TreeIter
for the page
- Returns:
True
if the page was found- Return type:
Finds a
Gtk.TreeIter
for a specified page in the model. This function searches the full page model, so it will find pages that are not currently visible, and the returned iterator can only be used with the child model (seeGtk.TreeModelFilter.get_model
).
- remove_page(page)¶
- Parameters:
page (
RB.DisplayPage
) – theRB.DisplayPage
to remove
Removes a page from the model.
- set_dnd_targets(treeview)¶
- Parameters:
treeview (
Gtk.TreeView
) – the sourcel istGtk.TreeView
Sets up the drag and drop targets for the display page tree.
- set_playing_source(source)¶
- Parameters:
source (
RB.DisplayPage
) – the new playingRB.Source
(as aRB.DisplayPage
)
Updates the model with the new playing source.
- do_drop_received(target, pos, data) virtual¶
- Parameters:
target (
RB.DisplayPage
) –pos (
Gtk.TreeViewDropPosition
) –data (
Gtk.SelectionData
) –
- do_page_inserted(page, iter) virtual¶
- Parameters:
page (
RB.DisplayPage
) –iter (
Gtk.TreeIter
) –
Signal Details¶
- RB.DisplayPageModel.signals.drop_received(display_page_model, target, pos, data)¶
- Signal Name:
drop-received
- Flags:
- Parameters:
display_page_model (
RB.DisplayPageModel
) – The object which received the signaltarget (
RB.DisplayPage
) – theRB.Source
receiving the droppos (
int
) – the drop position
Emitted when a drag and drop operation to the display page tree completes.
- RB.DisplayPageModel.signals.page_inserted(display_page_model, page, iter)¶
- Signal Name:
page-inserted
- Flags:
- Parameters:
display_page_model (
RB.DisplayPageModel
) – The object which received the signalpage (
RB.DisplayPage
) – theRB.DisplayPage
that was insertediter (
Gtk.TreeIter
) – aGtk.TreeIter
indicating the page position
Emitted when a new page is inserted into the model. Use this instead of
Gtk.TreeModel
::row-inserted
as this doesn’t get complicated by visibility filtering.