RB.EntryView

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Box Gtk.Box RB.EntryView RB.EntryView Gtk.Box->RB.EntryView Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Box Gtk.Orientable->Gtk.Box Gtk.Widget->Gtk.Container

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:
Returns:

the new entry view

Return type:

RB.EntryView

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 be True. 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 append

  • always_visible (bool) – if True, 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:

Appends a custom column to the entry view.

enable_drag_source(targets, n_targets)
Parameters:

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, or None

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) – a RB.RhythmDBEntry to check

Returns:

True if the entry is present in the view

Return type:

bool

Determines whether a specified entry is present in the view.

get_entry_visible(entry)
Parameters:

entry (RB.RhythmDBEntry) – a RB.RhythmDBEntry to check

Returns:

True if the entry is visible

Return 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 value

Return 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 selected

Return type:

bool

Determines whether all entries in the view are selected.

have_selection()
Returns:

True if one or more rows are selected

Return 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) – a Gtk.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 or None) – 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.

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) – a RB.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) – a RB.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:

Enables in-place editing of the values in a column. The underlying RB.RhythmDBEntry is updated when editing is complete.

set_columns_clickable(clickable)
Parameters:

clickable (bool) – if True, sortable columns will be made 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 for

  • renderer (Gtk.CellRenderer) – a temporary cell renderer to use

  • strings ([str]) – a None-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 new RB.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 on

  • sort_order (int) – order to sort in, as a Gtk.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 and RB.EntryViewState.PAUSED should be used when the source containing the entry view is playing, and RB.EntryViewState.NOT_PLAYING otherwise.

set_status(status, busy)
Parameters:
  • status (str) – status text to display, or None

  • busy (bool) – whether the source is 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_have_selection_changed(have_selection) virtual
Parameters:

have_selection (bool) –

do_selection_changed() virtual
do_show_popup(over_entry) virtual
Parameters:

over_entry (bool) –

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 signal

Emitted when the model backing the entry view is replaced.

RB.EntryView.signals.entry_activated(entry_view, entry)
Signal Name:

entry-activated

Flags:

RUN_LAST

Parameters:

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:

RUN_LAST

Parameters:

Emitted when an entry is added to the view

RB.EntryView.signals.entry_deleted(entry_view, entry)
Signal Name:

entry-deleted

Flags:

RUN_LAST

Parameters:

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:

RUN_LAST

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.

RB.EntryView.signals.selection_changed(entry_view)
Signal Name:

selection-changed

Flags:

RUN_LAST

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:

RUN_LAST

Parameters:
  • entry_view (RB.EntryView) – The object which received the signal

  • over_entry (bool) – if True, 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 is False if no rows in the view are selected.

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

RB.EntryView.props.sort_order
Name:

sort-order

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The sort order for the track listing.

RB.EntryView.props.visible_columns
Name:

visible-columns

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

An array containing the names of the visible columns.