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 | get_time_date_column_sample () |
class | new (db, shell_player, is_drag_source, is_drag_dest) |
append_column (coltype, always_visible) |
|
append_column_custom (column, title, key, sort_func, *data) |
|
enable_drag_source (targets, n_targets) |
|
get_column (coltype) |
|
get_entry_contained (entry) |
|
get_entry_visible (entry) |
|
get_selected_entries () |
|
get_sorting_order () |
|
get_sorting_type () |
|
have_complete_selection () |
|
have_selection () |
|
insert_column_custom (column, title, key, sort_func, data, position) |
|
resort_model () |
|
scroll_to_entry (entry) |
|
select_all () |
|
select_entry (entry) |
|
select_none () |
|
set_column_editable (column, editable) |
|
set_columns_clickable (clickable) |
|
set_fixed_column_width (column, renderer, strings) |
|
set_model (model) |
|
set_sorting_order (column_name, sort_order) |
|
set_sorting_type (sorttype) |
|
set_state (state) |
|
set_status (status, busy) |
Virtual Methods¶
Inherited: | Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10) |
---|
do_entries_replaced () |
|
do_entry_activated (entry) |
|
do_entry_added (entry) |
|
do_entry_deleted (entry) |
|
do_have_selection_changed (have_selection) |
|
do_selection_changed () |
|
do_show_popup (over_entry) |
Properties¶
Inherited: | Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1) |
---|
Name | Type | Flags | Short Description |
---|---|---|---|
db |
RB.RhythmDB |
r/w/co | RB.RhythmDB database |
is-drag-dest |
bool |
r/w/co | whether or not this is a drag dest |
is-drag-source |
bool |
r/w/co | whether or not this is a drag source |
model |
RB.RhythmDBQueryModel |
r/w | RB.RhythmDBQueryModel |
playing-state |
int |
r/w | playback state for this entry view |
shell-player |
RB.ShellPlayer |
r/w/co | RB.ShellPlayer object |
sort-order |
str |
r/w | sorting order |
visible-columns |
[str ] |
r/w | visible columns |
Child Properties¶
Inherited: | Gtk.Box (5) |
---|
Style Properties¶
Inherited: | Gtk.Widget (17) |
---|
Signals¶
Inherited: | Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) |
---|
Name | Short Description |
---|---|
entries-replaced |
Emitted when the model backing the entry view is replaced. |
entry-activated |
Emitted when an entry in the view is activated (by double clicking or by various key presses) |
entry-added |
Emitted when an entry is added to the view |
entry-deleted |
Emitted when an entry has been removed from the view |
have-selection-changed |
Emitted when the user first selects a row, or when no rows are selected any more. |
selection-changed |
Emitted when the set of selected entries changes |
show-popup |
Emitted when the user performs an action that should result in a popup menu appearing. |
Fields¶
Inherited: | Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) |
---|
Name | Type | Access | Description |
---|---|---|---|
parent | Gtk.Box |
r |
Class Details¶
-
class
RB.
EntryView
(*args, **kwargs)¶ Bases: Gtk.Box
Abstract: No Structure: RB.EntryViewClass
-
classmethod
get_time_date_column_sample
()¶ Returns: sample date string Return type: str
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
instance - shell_player (
GObject.Object
) – theRB.ShellPlayer
instance - is_drag_source (
bool
) – ifTrue
, the view should act as a drag and drop data source - is_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.- db (
-
append_column
(coltype, always_visible)¶ Parameters: - coltype (
RB.EntryViewColumn
) – type of column to append - always_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.- coltype (
-
append_column_custom
(column, title, key, sort_func, *data)¶ Parameters: - column (
Gtk.TreeViewColumn
) – aGtk.TreeViewColumn
to append - title (
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 - data (
object
orNone
) – data to pass to the sort function
Appends a custom column to the entry view.
- column (
-
enable_drag_source
(targets, n_targets)¶ Parameters: - targets (
Gtk.TargetEntry
) – an array ofGtk.TargetEntry
structures defining the drag data targets - n_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.
- targets (
-
get_column
(coltype)¶ Parameters: coltype ( RB.EntryViewColumn
) – type of column to retrieveReturns: a Gtk.TreeViewColumn
instance, orNone
Return type: Gtk.TreeViewColumn
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 checkReturns: True
if the entry is present in the viewReturn type: bool
Determines whether a specified entry is present in the view.
-
get_entry_visible
(entry)¶ Parameters: entry ( RB.RhythmDBEntry
) – aRB.RhythmDBEntry
to checkReturns: True
if the entry is visibleReturn type: bool
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: [ RB.RhythmDBEntry
]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
valueReturn type: (column_name: str
, sort_order:int
)Retrieves the sort settings for the view.
-
get_sorting_type
()¶ Returns: sort order description Return type: str
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
()¶ Returns: True
if all rows in the view are selectedReturn type: bool
Determines whether all entries in the view are selected.
-
have_selection
()¶ Returns: True
if one or more rows are selectedReturn type: bool
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 append - title (
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 - data (
object
orNone
) – data to pass to the sort function - position (
int
) – position at which to insert the column (-1 to insert at the end)
Inserts a custom column at the specified position.
- column (
-
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 toIf 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 selectIf 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 update - editable (
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.- column (
-
set_columns_clickable
(clickable)¶ Parameters: clickable ( bool
) – ifTrue
, sortable columns will be made clickableMakes 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 for - renderer (
Gtk.CellRenderer
) – a temporary cell renderer to use - strings ([
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.
- column (
-
set_model
(model)¶ Parameters: model ( RB.RhythmDBQueryModel
) – the newRB.RhythmDBQueryModel
to use for the viewReplaces the model backing the entry view.
-
set_sorting_order
(column_name, sort_order)¶ Parameters: - column_name (
str
) – name of the column to sort on - sort_order (
int
) – order to sort in, as aGtk.SortType
Sets the sort order for the entry view.
- column_name (
-
set_sorting_type
(sorttype)¶ Parameters: sorttype ( str
) – sort order descriptionChanges 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 stateSets 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)¶ Parameters: 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¶
-
classmethod
Signal Details¶
-
RB.EntryView.signals.
entries_replaced
(entry_view)¶ Signal Name: entries-replaced
Flags: RUN_LAST
Parameters: entry_view ( RB.EntryView
) – The object which received the signalEmitted 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 signal - entry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
that was activated
Emitted when an entry in the view is activated (by double clicking or by various key presses)
- entry_view (
-
RB.EntryView.signals.
entry_added
(entry_view, entry)¶ Signal Name: entry-added
Flags: Parameters: - entry_view (
RB.EntryView
) – The object which received the signal - entry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
that was added
Emitted when an entry is added to the view
- entry_view (
-
RB.EntryView.signals.
entry_deleted
(entry_view, entry)¶ Signal Name: entry-deleted
Flags: Parameters: - entry_view (
RB.EntryView
) – The object which received the signal - entry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
that was removed
Emitted when an entry has been removed from the view
- entry_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 signal - have_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.
- entry_view (
-
RB.EntryView.signals.
selection_changed
(entry_view)¶ Signal Name: selection-changed
Flags: RUN_LAST
Parameters: entry_view ( RB.EntryView
) – The object which received the signalEmitted 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 signal - over_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.- entry_view (
Property Details¶
-
RB.EntryView.props.
db
¶ Name: db
Type: RB.RhythmDB
Default Value: None
Flags: READABLE
,WRITABLE
,CONSTRUCT_ONLY
RB.RhythmDB
instance
-
RB.EntryView.props.
is_drag_dest
¶ Name: is-drag-dest
Type: bool
Default Value: False
Flags: READABLE
,WRITABLE
,CONSTRUCT_ONLY
If
True
, the view acts as a destination for drag and drop operations.
-
RB.EntryView.props.
is_drag_source
¶ Name: is-drag-source
Type: bool
Default Value: False
Flags: READABLE
,WRITABLE
,CONSTRUCT_ONLY
If
True
, the view acts as a data source for drag and drop operations.
-
RB.EntryView.props.
model
¶ Name: model
Type: RB.RhythmDBQueryModel
Default Value: None
Flags: READABLE
,WRITABLE
The
RB.RhythmDBQueryModel
backing the view
-
RB.EntryView.props.
playing_state
¶ Name: playing-state
Type: int
Default Value: 0
Flags: READABLE
,WRITABLE
Determines the icon to show in the ‘playing’ column next to the current playing entry.
-
RB.EntryView.props.
shell_player
¶ Name: shell-player
Type: RB.ShellPlayer
Default Value: None
Flags: READABLE
,WRITABLE
,CONSTRUCT_ONLY
RB.ShellPlayer
instance