Garcon.MenuItem

g GObject.GInterface GObject.GInterface Garcon.MenuElement Garcon.MenuElement GObject.GInterface->Garcon.MenuElement GObject.Object GObject.Object Garcon.MenuItem Garcon.MenuItem GObject.Object->Garcon.MenuItem Garcon.MenuElement->Garcon.MenuItem

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Garcon.MenuElement (7)

Structs:

GObject.ObjectClass (5)

class

new (file)

class

new_for_path (filename)

class

new_for_uri (uri)

decrement_allocated ()

get_action (action_name)

get_actions ()

get_allocated ()

get_categories ()

get_command ()

get_comment ()

get_desktop_id ()

get_file ()

get_generic_name ()

get_hidden ()

get_icon_name ()

get_keywords ()

get_name ()

get_no_display ()

get_path ()

get_prefers_non_default_gpu ()

get_show_in_environment ()

get_try_exec ()

get_uri ()

has_action (action_name)

has_category (category)

has_keyword (keyword)

increment_allocated ()

only_show_in_environment ()

ref ()

reload (affects_the_outside)

reload_from_file (file, affects_the_outside)

requires_terminal ()

set_action (action_name, action)

set_categories (categories)

set_command (command)

set_comment (comment)

set_desktop_id (desktop_id)

set_generic_name (generic_name)

set_hidden (hidden)

set_icon_name (icon_name)

set_keywords (keywords)

set_name (name)

set_no_display (no_display)

set_path (path)

set_prefers_non_default_gpu (prefers_non_default_gpu)

set_requires_terminal (requires_terminal)

set_supports_startup_notification (supports_startup_notification)

set_try_exec (try_exec)

supports_startup_notification ()

unref ()

Virtual Methods

Inherited:

GObject.Object (7), Garcon.MenuElement (7)

do_changed ()

Properties

Name

Type

Flags

Short Description

command

str

r/w

Application command

comment

str

r/w

Comment/description for the application

desktop-id

str

r/w

Desktop-File Id of the application

file

Gio.File

r/w/co

file

generic-name

str

r/w

Generic name of the application

hidden

bool

r/w

Whether the application has been deleted

icon-name

str

r/w

Name of the application icon

name

str

r/w

Name of the application

no-display

bool

r/w

Visibility state of the menu item

path

str

r/w

Working directory path

prefers-non-default-gpu

bool

r/w

Whether the application prefers to be run on a discrete GPU

requires-terminal

bool

r/w

Whether this application requires a terminal

supports-startup-notification

bool

r/w

Startup notification support

try-exec

str

r/w

Command to check if application is installed

Signals

Inherited:

GObject.Object (1)

Name

Short Description

changed

Emitted when Garcon.MenuItem has been reloaded.

Fields

Inherited:

GObject.Object (1)

Class Details

class Garcon.MenuItem(**kwargs)
Bases:

GObject.Object, Garcon.MenuElement

Abstract:

No

Structure:

Garcon.MenuItemClass

classmethod new(file)
Parameters:

file (Gio.File) – a Gio.File

Return type:

Garcon.MenuItem

Returns (transfer full): a new Garcon.MenuItem

classmethod new_for_path(filename)
Parameters:

filename (str) – name of a file

Returns:

a new Garcon.MenuItem

Return type:

Garcon.MenuItem

classmethod new_for_uri(uri)
Parameters:

uri (str) – a given URI

Returns:

a new Garcon.MenuItem

Return type:

Garcon.MenuItem

decrement_allocated()
get_action(action_name)
Parameters:

action_name (str) –

Returns:

a Garcon.MenuItemAction

Return type:

Garcon.MenuItemAction or None

get_actions()
Return type:

[Garcon.MenuItemAction]

get_allocated()
Return type:

int

get_categories()
Return type:

[str]

Returns list of categories

get_command()
Return type:

str

get_comment()
Return type:

str

get_desktop_id()
Return type:

str

get_file()
Returns:

a Gio.File.

Return type:

Gio.File

Get the Gio.File for self. The returned object should be unreffed with GObject.Object.unref() when no longer needed.

get_generic_name()
Return type:

str

get_hidden()
Return type:

bool

get_icon_name()
Return type:

str

get_keywords()
Return type:

[str]

get_name()
Return type:

str

get_no_display()
Return type:

bool

get_path()
Return type:

str

get_prefers_non_default_gpu()
Return type:

bool

get_show_in_environment()
Return type:

bool

get_try_exec()
Return type:

str

get_uri()
Return type:

str

has_action(action_name)
Parameters:

action_name (str) –

Return type:

bool

has_category(category)
Parameters:

category (str) –

Return type:

bool

has_keyword(keyword)
Parameters:

keyword (str) –

Return type:

bool

increment_allocated()
only_show_in_environment()
Return type:

bool

ref()
reload(affects_the_outside)
Parameters:

affects_the_outside (bool) –

Raises:

GLib.Error

Return type:

bool

reload_from_file(file, affects_the_outside)
Parameters:
Raises:

GLib.Error

Return type:

bool

requires_terminal()
Return type:

bool

set_action(action_name, action)
Parameters:
set_categories(categories)
Parameters:

categories ([str]) – list of categories

set_command(command)
Parameters:

command (str) –

set_comment(comment)
Parameters:

comment (str) –

set_desktop_id(desktop_id)
Parameters:

desktop_id (str) –

set_generic_name(generic_name)
Parameters:

generic_name (str) –

set_hidden(hidden)
Parameters:

hidden (bool) –

set_icon_name(icon_name)
Parameters:

icon_name (str) –

set_keywords(keywords)
Parameters:

keywords ([str]) – list of keywords

set_name(name)
Parameters:

name (str) –

set_no_display(no_display)
Parameters:

no_display (bool) –

set_path(path)
Parameters:

path (str) –

set_prefers_non_default_gpu(prefers_non_default_gpu)
Parameters:

prefers_non_default_gpu (bool) –

set_requires_terminal(requires_terminal)
Parameters:

requires_terminal (bool) –

set_supports_startup_notification(supports_startup_notification)
Parameters:

supports_startup_notification (bool) –

set_try_exec(try_exec)
Parameters:

try_exec (str) –

supports_startup_notification()
Return type:

bool

unref()
do_changed() virtual

Signal Details

Garcon.MenuItem.signals.changed(menu_item)
Signal Name:

changed

Flags:

RUN_FIRST

Parameters:

menu_item (Garcon.MenuItem) – The object which received the signal

Emitted when Garcon.MenuItem has been reloaded.

Property Details

Garcon.MenuItem.props.command
Name:

command

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Command to be executed when the menu item is clicked.

Garcon.MenuItem.props.comment
Name:

comment

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Comment/description for the application. To be displayed e.g. in tooltips of GtkMenuItems.

Garcon.MenuItem.props.desktop_id
Name:

desktop-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The desktop-file id of this application.

Garcon.MenuItem.props.file
Name:

file

Type:

Gio.File

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Gio.File from which the Garcon.MenuItem was loaded.

Garcon.MenuItem.props.generic_name
Name:

generic-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

GenericName of the application (will be displayed in menus etc.).

Garcon.MenuItem.props.hidden
Name:

hidden

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

It means the user deleted (at his level) something that was present (at an upper level, e.g. in the system dirs). It’s strictly equivalent to the .desktop file not existing at all, as far as that user is concerned.

Garcon.MenuItem.props.icon_name
Name:

icon-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Name of the icon to be displayed for this menu item.

Garcon.MenuItem.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Name of the application (will be displayed in menus etc.).

Garcon.MenuItem.props.no_display
Name:

no-display

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether this menu item is hidden in menus.

Garcon.MenuItem.props.path
Name:

path

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Working directory the application should be started in.

Garcon.MenuItem.props.prefers_non_default_gpu
Name:

prefers-non-default-gpu

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If true, the application prefers to be run on a more powerful discrete GPU if available.

Garcon.MenuItem.props.requires_terminal
Name:

requires-terminal

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether this application requires a terinal to be started in.

Garcon.MenuItem.props.supports_startup_notification
Name:

supports-startup-notification

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Startup notification support

Garcon.MenuItem.props.try_exec
Name:

try-exec

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Path to an executable file on disk used to determine if the program is actually installed. If the path is not an absolute path, the file is looked up in the $PATH environment variable. If the file is not present or if it is not executable, the entry may be ignored (not be used in menus, for example).