Dazzle.ShortcutManager

g Dazzle.ShortcutManager Dazzle.ShortcutManager GObject.GInterface GObject.GInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable Gio.ListModel Gio.ListModel GObject.GInterface->Gio.ListModel GObject.Object GObject.Object GObject.Object->Dazzle.ShortcutManager Gio.Initable->Dazzle.ShortcutManager Gio.ListModel->Dazzle.ShortcutManager

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.Initable (2), Gio.ListModel (4)

Structs:

GObject.ObjectClass (5)

class

get_default ()

add_action (detailed_action_name, section, group, title, subtitle)

add_command (command, section, group, title, subtitle)

add_shortcut_entries (shortcuts, translation_domain)

add_shortcuts_to_window (window)

append_search_path (directory)

get_theme ()

get_theme_by_name (theme_name)

get_theme_name ()

get_user_dir ()

handle_event (event, toplevel)

prepend_search_path (directory)

queue_reload ()

reload (cancellable)

remove_search_path (directory)

set_theme (theme)

set_theme_name (theme_name)

set_user_dir (user_dir)

Virtual Methods

Inherited:

GObject.Object (7), Gio.Initable (1), Gio.ListModel (3)

Properties

Name

Type

Flags

Short Description

theme

Dazzle.ShortcutTheme

r/w/en

The current key theme.

theme-name

str

r/w/en

The name of the current theme

user-dir

str

r/w/en

The directory for saved user modifications

Signals

Inherited:

GObject.Object (1), Gio.ListModel (1)

Name

Short Description

changed

Fields

Inherited:

GObject.Object (1), Gio.ListModel (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Dazzle.ShortcutManager(**kwargs)
Bases:

GObject.Object, Gio.Initable, Gio.ListModel

Abstract:

No

Structure:

Dazzle.ShortcutManagerClass

classmethod get_default()
Returns:

An Dazzle.ShortcutManager.

Return type:

Dazzle.ShortcutManager

Gets the singleton Dazzle.ShortcutManager for the process.

add_action(detailed_action_name, section, group, title, subtitle)
Parameters:
  • detailed_action_name (str) –

  • section (str) –

  • group (str) –

  • title (str) –

  • subtitle (str) –

add_command(command, section, group, title, subtitle)
Parameters:
  • command (str) –

  • section (str) –

  • group (str) –

  • title (str) –

  • subtitle (str) –

add_shortcut_entries(shortcuts, translation_domain)
Parameters:
  • shortcuts ([Dazzle.ShortcutEntry]) – shortcuts to add

  • translation_domain (str or None) – the gettext domain to use for translations

This method will add shortcuts to the Dazzle.ShortcutManager.

This provides a simple way for widgets to add their shortcuts to the manager so that they may be overriden by themes or the end user.

add_shortcuts_to_window(window)
Parameters:

window (Dazzle.ShortcutsWindow) – A Dazzle.ShortcutsWindow

Adds shortcuts registered with the Dazzle.ShortcutManager to the Dazzle.ShortcutsWindow.

append_search_path(directory)
Parameters:

directory (str) –

get_theme()
Returns:

An Dazzle.ShortcutTheme.

Return type:

Dazzle.ShortcutTheme

Gets the “theme” property.

get_theme_by_name(theme_name)
Parameters:

theme_name (str or None) – the name of a theme or None of the internal theme

Returns:

A Dazzle.ShortcutTheme or None.

Return type:

Dazzle.ShortcutTheme or None

Locates a theme by the name of the theme.

If theme_name is None, then the internal theme is used. You probably dont need to use that as it is used by various controllers to hook up their default actions.

get_theme_name()
Return type:

str

get_user_dir()
Return type:

str

handle_event(event, toplevel)
Parameters:
Returns:

True if the event was handled.

Return type:

bool

This function will try to dispatch event to the proper widget and Dazzle.ShortcutContext. If the event is handled, then True is returned.

You should call this from Gtk.Widget ::key-press-event handler in your Gtk.Window toplevel.

prepend_search_path(directory)
Parameters:

directory (str) –

queue_reload()
reload(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) –

remove_search_path(directory)
Parameters:

directory (str) –

set_theme(theme)
Parameters:

theme (Dazzle.ShortcutTheme) – An Dazzle.ShortcutTheme

Sets the theme for the shortcut manager.

set_theme_name(theme_name)
Parameters:

theme_name (str) –

set_user_dir(user_dir)
Parameters:

user_dir (str) –

Signal Details

Dazzle.ShortcutManager.signals.changed(shortcut_manager)
Signal Name:

changed

Flags:

RUN_LAST

Parameters:

shortcut_manager (Dazzle.ShortcutManager) – The object which received the signal

Property Details

Dazzle.ShortcutManager.props.theme
Name:

theme

Type:

Dazzle.ShortcutTheme

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The current key theme.

Dazzle.ShortcutManager.props.theme_name
Name:

theme-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The name of the current theme

Dazzle.ShortcutManager.props.user_dir
Name:

user-dir

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The directory for saved user modifications