Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- GnomeDesktop.desktop_thumbnail_is_valid(pixbuf, uri, mtime)¶
- Parameters:
pixbuf (
GdkPixbuf.Pixbuf
) – an loaded thumbnailGdkPixbuf.Pixbuf
uri (
str
) – a urimtime (
int
) – the mtime
- Returns:
True
if the thumbnail has the right uri and mtime- Return type:
Returns whether the thumbnail has the correct uri and mtime embedded in the png options. This function is threadsafe and does no blocking I/O.
New in version 2.2.
- GnomeDesktop.desktop_thumbnail_path_for_uri(uri, size)¶
- Parameters:
uri (
str
) – an urisize (
GnomeDesktop.DesktopThumbnailSize
) – a thumbnail size
- Returns:
an absolute filename
- Return type:
Returns the filename that a thumbnail of size size for uri would have. This function is threadsafe and does no blocking I/O.
New in version 2.2.
- GnomeDesktop.get_all_locales()¶
- Returns:
a newly allocated
None
-terminated string array containing the all locales. Free withGLib.strfreev
().- Return type:
[
str
]
Gets all locales.
New in version 3.8.
- GnomeDesktop.get_country_from_code(code, translation)¶
- Parameters:
- Returns:
the country name. Caller takes ownership.
- Return type:
Gets the country name for code. If translation is provided the returned string is translated accordingly.
New in version 3.8.
- GnomeDesktop.get_country_from_locale(locale, translation)¶
- Parameters:
- Returns:
the country description. Caller takes ownership.
- Return type:
Gets the country description for locale. If translation is provided the returned string is translated accordingly.
New in version 3.8.
- GnomeDesktop.get_input_source_from_locale(locale)¶
- Parameters:
locale (
str
) – a locale string- Returns:
True
if a input source exists orFalse
otherwise.- type:
location to store the input source type
- id:
location to store the input source identifier
- Return type:
Gets the default input source’s type and identifier for a given locale.
New in version 3.8.
- GnomeDesktop.get_language_from_code(code, translation)¶
- Parameters:
- Returns:
the language name. Caller takes ownership.
- Return type:
Gets the language name for code. If translation is provided the returned string is translated accordingly.
New in version 3.8.
- GnomeDesktop.get_language_from_locale(locale, translation)¶
- Parameters:
- Returns:
the language description. Caller takes ownership.
- Return type:
Gets the language description for locale. If translation is provided the returned string is translated accordingly.
New in version 3.8.
- GnomeDesktop.get_platform_version()¶
- Returns:
an integer with the major version of GNOME.
- Return type:
Returns an integer with the major version of GNOME. Useful for dynamic languages like Javascript or Python (static languages like C should use
GnomeDesktop.DESKTOP_PLATFORM_VERSION
). If this function doesn’t exist, it can be presumed that the GNOME platform version is 42 or previous.New in version 43.0.
- GnomeDesktop.get_translated_modifier(modifier, translation)¶
- Parameters:
- Returns:
the translated modifier string. Caller takes ownership.
- Return type:
Gets a translation of the raw modifier string. If translation is provided the returned string is translated accordingly.
New in version 3.34.
- GnomeDesktop.language_has_translations(code)¶
- Parameters:
code (
str
) – an ISO 639 code string- Returns:
True
if there are translations for language code.- Return type:
Returns
True
if there are translations for language code.New in version 3.8.
- GnomeDesktop.normalize_locale(locale)¶
- Parameters:
locale (
str
) – a locale string- Returns:
normalized locale string. Caller takes ownership.
- Return type:
Gets the normalized locale string in the form [language’_country [.codeset]’[modifier]] for name.
New in version 3.8.
- GnomeDesktop.parse_locale(locale)¶
- Parameters:
locale (
str
) – a locale string- Returns:
True
if parsing was successful.- Return type:
(
bool
, language_codep:str
, country_codep:str
orNone
, codesetp:str
orNone
, modifierp:str
orNone
)
Extracts the various components of a locale string in XPG format. ([language’_country [.codeset]’[modifier]]). See http://en.wikipedia.org/wiki/Locale.
New in version 3.8.
- GnomeDesktop.rr_error_quark()¶
- Returns:
a #GQuark used to identify errors coming from the GnomeRR API.
- Return type:
Returns the #GQuark that will be used for
GLib.Error
values returned by the GnomeRR API.
- GnomeDesktop.start_systemd_scope(name, pid, description, connection, cancellable, callback, *user_data)¶
- Parameters:
name (
str
) – Name for the applicationpid (
int
) – The PID of the applicationdescription (
str
orNone
) – A description to use for the unit, orNone
connection (
Gio.DBusConnection
orNone
) – AnGio.DBusConnection
to the session bus, orNone
cancellable (
Gio.Cancellable
orNone
) –Gio.Cancellable
to usecallback (
Gio.AsyncReadyCallback
orNone
) – Callback to call when the operation is done
If the current process is running inside a user systemd instance, then move the launched PID into a transient scope. The given name will be used to create a unit name. It should be the application ID or the executable in all other cases. If a desktop-id is passed then the .desktop suffix will be stripped.
It is advisable to use this function every time where the started application can be considered reasonably independent of the launching application. Placing it in a scope creates proper separation between the programs rather than being considered a single entity by systemd.
It is always safe to call this function. Note that a successful return code does not imply that a unit has been created. It solely means that no error condition was hit sending the request.
If connection is
None
then g_dbus_get() will be called internally.Note that most callers will not need to handle errors. As such, it is normal to pass a
None
callback.
- GnomeDesktop.start_systemd_scope_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – AGio.AsyncResult
- Raises:
- Returns:
- Return type:
Finish an asynchronous operation to create a transient scope that was started with
GnomeDesktop.start_systemd_scope
().Note that a successful return code does not imply that a unit has been created. It solely means that no error condition was hit sending the request.