RB.EntryView¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Box (14), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
|
|
Properties¶
- Inherited:
Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|
||
r/w/co |
whether or not this is a drag dest |
||
r/w/co |
whether or not this is a drag source |
||
r/w |
|||
r/w |
playback state for this entry view |
||
r/w/co |
|
||
r/w |
sorting order |
||
[ |
r/w |
visible columns |
Child Properties¶
- Inherited:
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the model backing the entry view is replaced. |
|
Emitted when an entry in the view is activated (by double clicking or by various key presses) |
|
Emitted when an entry is added to the view |
|
Emitted when an entry has been removed from the view |
|
Emitted when the user first selects a row, or when no rows are selected any more. |
|
Emitted when the set of selected entries changes |
|
Emitted when the user performs an action that should result in a popup menu appearing. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class RB.EntryView(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod get_time_date_column_sample()¶
- Returns:
sample date string
- Return type:
Returns a sample string for use in columns displaying times and dates in ‘friendly’ form (see rb_utf_friendly_time). For use with rb_entry_view_set_fixed_column_width.
- classmethod new(db, shell_player, is_drag_source, is_drag_dest)¶
- Parameters:
db (
RB.RhythmDB
) – theRB.RhythmDB
instanceshell_player (
GObject.Object
) – theRB.ShellPlayer
instanceis_drag_source (
bool
) – ifTrue
, the view should act as a drag and drop data sourceis_drag_dest (
bool
) – ifTrue
, the view should act as a drag and drop destination
- Returns:
the new entry view
- Return type:
Creates a new entry view. If it makes sense to allow the user to drag entries from this entry view to other sources, is_drag_source should be
True
. If it makes sense to allow the user to drag entries from other sources to this view, is_drag_dest should beTrue
. Drag and drop in this sense is used for two purposes: to transfer tracks between the filesystem and removable devices, and to add tracks to playlists.
- append_column(coltype, always_visible)¶
- Parameters:
coltype (
RB.EntryViewColumn
) – type of column to appendalways_visible (
bool
) – ifTrue
, ignore the user’s column visibility settings
Appends a predefined column type to the set of columns already present in the entry view. If always_visible is
True
, the column will ignore the user’s coulmn visibility settings and will always be visible. This should only be used when it is vital for the purpose of the source that the column be visible.
- append_column_custom(column, title, key, sort_func, *data)¶
- Parameters:
column (
Gtk.TreeViewColumn
) – aGtk.TreeViewColumn
to appendtitle (
str
) – title for the column (translated)key (
str
) – sort key for the column (not translated)sort_func (
GLib.CompareDataFunc
) – comparison function to use for sorting on the column
Appends a custom column to the entry view.
- enable_drag_source(targets, n_targets)¶
- Parameters:
targets (
Gtk.TargetEntry
) – an array ofGtk.TargetEntry
structures defining the drag data targetsn_targets (
int
) – the number of entries in the target array
Enables the entry view to act as a data source for drag an drop operations, using a specified set of data targets.
- get_column(coltype)¶
- Parameters:
coltype (
RB.EntryViewColumn
) – type of column to retrieve- Returns:
a
Gtk.TreeViewColumn
instance, orNone
- Return type:
Retrieves a predefined column from the entry view. This can be used to insert additional cell renderers into the column.
- get_entry_contained(entry)¶
- Parameters:
entry (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
to check- Returns:
True
if the entry is present in the view- Return type:
Determines whether a specified entry is present in the view.
- get_entry_visible(entry)¶
- Parameters:
entry (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
to check- Returns:
True
if the entry is visible- Return type:
Determines whether a specified entry is present in the view and is currently visible.
- get_selected_entries()¶
- Returns:
a
GLib.List
of selected entries in the view.- Return type:
Gathers the selected entries from the view.
- get_sorting_order()¶
- Returns:
- column_name:
returns the sort column name
- sort_order:
returns the sort ordering as a
Gtk.SortType
value
- Return type:
Retrieves the sort settings for the view.
- get_sorting_type()¶
- Returns:
sort order description
- Return type:
Constructs a string that describes the sort settings for the entry view. This consists of a column name and an order (‘ascending’ or ‘descending’) separated by a comma.
- have_complete_selection()¶
-
Determines whether all entries in the view are selected.
- have_selection()¶
-
Determines whether there is an active selection in the view.
- insert_column_custom(column, title, key, sort_func, data, position)¶
- Parameters:
column (
Gtk.TreeViewColumn
) – aGtk.TreeViewColumn
to appendtitle (
str
) – title for the column (translated)key (
str
) – sort key for the column (not translated)sort_func (
GLib.CompareDataFunc
) – comparison function to use for sorting on the columnposition (
int
) – position at which to insert the column (-1 to insert at the end)
Inserts a custom column at the specified position.
- resort_model()¶
Resorts the entries in the entry view. Mostly to be used when a new model is associated with the view.
- scroll_to_entry(entry)¶
- Parameters:
entry (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
to scroll to
If the specified entry is present in the view, the view will be scrolled so that the entry is visible.
- select_all()¶
Selects all rows in the view
- select_entry(entry)¶
- Parameters:
entry (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
to select
If the specified entry is present in the view, it is added to the selection.
- select_none()¶
Deselects all rows in the view.
- set_column_editable(column, editable)¶
- Parameters:
column (
RB.EntryViewColumn
) – aRB.EntryViewColumn
to updateeditable (
bool
) –True
to make the column editable,False
otherwise
Enables in-place editing of the values in a column. The underlying
RB.RhythmDBEntry
is updated when editing is complete.
- set_columns_clickable(clickable)¶
-
Makes the headers for sortable columns (those for which a sort function was provided) clickable, so the user can set the sort order.
- set_fixed_column_width(column, renderer, strings)¶
- Parameters:
column (
Gtk.TreeViewColumn
) – the column to set the width forrenderer (
Gtk.CellRenderer
) – a temporary cell renderer to usestrings ([
str
]) – aNone
-terminated array of strings that will be displayed in the column
Helper function for calling rb_set_tree_view_column_fixed_width on a column. This is important for performance reasons, as having the tree view measure the strings in each of 20000 rows is very slow.
- set_model(model)¶
- Parameters:
model (
RB.RhythmDBQueryModel
) – the newRB.RhythmDBQueryModel
to use for the view
Replaces the model backing the entry view.
- set_sorting_order(column_name, sort_order)¶
- Parameters:
column_name (
str
) – name of the column to sort onsort_order (
int
) – order to sort in, as aGtk.SortType
Sets the sort order for the entry view.
- set_sorting_type(sorttype)¶
- Parameters:
sorttype (
str
) – sort order description
Changes the sort order for the entry view. The sort order description must be a column name, followed by a comma, followed by an order description (‘ascending’ or ‘descending’).
- set_state(state)¶
- Parameters:
state (
RB.EntryViewState
) – the new playing entry state
Sets the icon to be drawn in the ‘playing’ column next to the current playing entry.
RB.EntryViewState.PLAYING
andRB.EntryViewState.PAUSED
should be used when the source containing the entry view is playing, andRB.EntryViewState.NOT_PLAYING
otherwise.
- set_status(status, busy)¶
-
Sets the status text to be displayed inside the entry view, and shows the spinner if busy.
- do_entries_replaced() virtual¶
- do_entry_activated(entry) virtual¶
- Parameters:
entry (
RB.RhythmDBEntry
) –
- do_entry_added(entry) virtual¶
- Parameters:
entry (
RB.RhythmDBEntry
) –
- do_entry_deleted(entry) virtual¶
- Parameters:
entry (
RB.RhythmDBEntry
) –
- do_selection_changed() virtual¶
Signal Details¶
- RB.EntryView.signals.entries_replaced(entry_view)¶
- Signal Name:
entries-replaced
- Flags:
- Parameters:
entry_view (
RB.EntryView
) – The object which received the signal
Emitted when the model backing the entry view is replaced.
- RB.EntryView.signals.entry_activated(entry_view, entry)¶
- Signal Name:
entry-activated
- Flags:
- Parameters:
entry_view (
RB.EntryView
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
that was activated
Emitted when an entry in the view is activated (by double clicking or by various key presses)
- RB.EntryView.signals.entry_added(entry_view, entry)¶
- Signal Name:
entry-added
- Flags:
- Parameters:
entry_view (
RB.EntryView
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
that was added
Emitted when an entry is added to the view
- RB.EntryView.signals.entry_deleted(entry_view, entry)¶
- Signal Name:
entry-deleted
- Flags:
- Parameters:
entry_view (
RB.EntryView
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
that was removed
Emitted when an entry has been removed from the view
- RB.EntryView.signals.have_selection_changed(entry_view, have_selection)¶
- Signal Name:
have-selection-changed
- Flags:
- Parameters:
entry_view (
RB.EntryView
) – The object which received the signalhave_selection (
bool
) –True
if one or more rows are selected
Emitted when the user first selects a row, or when no rows are selected any more.
- RB.EntryView.signals.selection_changed(entry_view)¶
- Signal Name:
selection-changed
- Flags:
- Parameters:
entry_view (
RB.EntryView
) – The object which received the signal
Emitted when the set of selected entries changes
- RB.EntryView.signals.show_popup(entry_view, over_entry)¶
- Signal Name:
show-popup
- Flags:
- Parameters:
entry_view (
RB.EntryView
) – The object which received the signalover_entry (
bool
) – ifTrue
, the popup request was made while pointing at an entry in the view
Emitted when the user performs an action that should result in a popup menu appearing. If the action was a mouse button click, over_entry is
False
if the mouse pointer was in the blank space after the last row in the view. If the action was a key press, over_entry isFalse
if no rows in the view are selected.
Property Details¶
- RB.EntryView.props.db¶
- Name:
db
- Type:
- Default Value:
- Flags:
RB.RhythmDB
instance
- RB.EntryView.props.is_drag_dest¶
- Name:
is-drag-dest
- Type:
- Default Value:
- Flags:
If
True
, the view acts as a destination for drag and drop operations.
- RB.EntryView.props.is_drag_source¶
- Name:
is-drag-source
- Type:
- Default Value:
- Flags:
If
True
, the view acts as a data source for drag and drop operations.
- RB.EntryView.props.model¶
- Name:
model
- Type:
- Default Value:
- Flags:
The
RB.RhythmDBQueryModel
backing the view
- RB.EntryView.props.playing_state¶
-
Determines the icon to show in the ‘playing’ column next to the current playing entry.
- RB.EntryView.props.shell_player¶
- Name:
shell-player
- Type:
- Default Value:
- Flags:
RB.ShellPlayer
instance
- RB.EntryView.props.sort_order¶
-
The sort order for the track listing.