Devhelp.Settings

g Devhelp.Settings Devhelp.Settings GObject.Object GObject.Object GObject.Object->Devhelp.Settings

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_default ()

bind_all ()

bind_fonts ()

bind_group_books_by_language ()

freeze_books_disabled_changed ()

get_fixed_font ()

get_group_books_by_language ()

get_selected_fonts ()

get_use_system_fonts ()

get_variable_font ()

is_book_enabled (book)

set_book_enabled (book, enabled)

set_fixed_font (fixed_font)

set_group_books_by_language (group_books_by_language)

set_use_system_fonts (use_system_fonts)

set_variable_font (variable_font)

thaw_books_disabled_changed ()

Virtual Methods

Inherited:

GObject.Object (7)

do_books_disabled_changed ()

do_fonts_changed ()

Properties

Name

Type

Flags

Short Description

fixed-font

str

r/w/c

group-books-by-language

bool

r/w/c

use-system-fonts

bool

r/w/c

variable-font

str

r/w/c

Signals

Inherited:

GObject.Object (1)

Name

Short Description

books-disabled-changed

The ::books-disabled-changed signal is emitted when the “books-disabled” Gio.Settings key changes.

fonts-changed

The ::fonts-changed signal is emitted when the return values of Devhelp.Settings.get_selected_fonts() have potentially changed.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Devhelp.Settings(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Devhelp.SettingsClass

classmethod get_default()
Returns:

the default Devhelp.Settings object.

Return type:

Devhelp.Settings

Gets the default Devhelp.Settings object. It has the default Gio.Settings paths (see Devhelp.SettingsBuilder) and Devhelp.Settings.bind_all() has been called.

New in version 3.30.

bind_all()

Binds all the Devhelp.Settings properties to their corresponding Gio.Settings keys.

New in version 3.30.

bind_fonts()

Binds the Devhelp.Settings :use-system-fonts, Devhelp.Settings :variable-font and Devhelp.Settings :fixed-font properties to their corresponding Gio.Settings keys.

New in version 3.30.

bind_group_books_by_language()

Binds the Devhelp.Settings :group-books-by-language property to the corresponding Gio.Settings key.

New in version 3.30.

freeze_books_disabled_changed()

Tells self to not emit the Devhelp.Settings ::books-disabled-changed signal until Devhelp.Settings.thaw_books_disabled_changed() is called.

A bit like GObject.Object.freeze_notify(), except that there is no freeze count.

This function is useful if you call Devhelp.Settings.set_book_enabled() several times in a row.

New in version 3.30.

get_fixed_font()
Returns:

the value of the Devhelp.Settings :fixed-font property.

Return type:

str

Warning: you probably want to use the Devhelp.Settings.get_selected_fonts() function instead, to take into account the Devhelp.Settings :use-system-fonts property.

New in version 3.30.

get_group_books_by_language()
Returns:

the value of the Devhelp.Settings :group-books-by-language property.

Return type:

bool

New in version 3.30.

get_selected_fonts()
Returns:

variable_font:

location to store the font name for text with variable width. Free with GLib.free().

fixed_font:

location to store the font name for text with fixed width. Free with GLib.free().

Return type:

(variable_font: str, fixed_font: str)

If Devhelp.Settings :use-system-fonts is True, returns the system fonts. Otherwise returns the values of the Devhelp.Settings :variable-font and Devhelp.Settings :fixed-font properties.

New in version 3.30.

get_use_system_fonts()
Returns:

the value of the Devhelp.Settings :use-system-fonts property.

Return type:

bool

New in version 3.30.

get_variable_font()
Returns:

the value of the Devhelp.Settings :variable-font property.

Return type:

str

Warning: you probably want to use the Devhelp.Settings.get_selected_fonts() function instead, to take into account the Devhelp.Settings :use-system-fonts property.

New in version 3.30.

is_book_enabled(book)
Parameters:

book (Devhelp.Book) – a Devhelp.Book.

Returns:

whether book is enabled.

Return type:

bool

Returns whether book is enabled according to the “books-disabled” Gio.Settings key. If the book ID is present in “books-disabled”, this function returns False, otherwise True is returned.

New in version 3.30.

set_book_enabled(book, enabled)
Parameters:

Modifies the “books-disabled” Gio.Settings key. It adds or removes the book ID from “books-disabled”.

New in version 3.30.

set_fixed_font(fixed_font)
Parameters:

fixed_font (str) – the new value.

Sets the Devhelp.Settings :fixed-font property.

New in version 3.30.

set_group_books_by_language(group_books_by_language)
Parameters:

group_books_by_language (bool) – the new value.

Sets the Devhelp.Settings :group-books-by-language property.

New in version 3.30.

set_use_system_fonts(use_system_fonts)
Parameters:

use_system_fonts (bool) – the new value.

Sets the Devhelp.Settings :use-system-fonts property.

New in version 3.30.

set_variable_font(variable_font)
Parameters:

variable_font (str) – the new value.

Sets the Devhelp.Settings :variable-font property.

New in version 3.30.

thaw_books_disabled_changed()

Stops the effect of Devhelp.Settings.freeze_books_disabled_changed(), and emits the Devhelp.Settings ::books-disabled-changed signal.

A bit like GObject.Object.thaw_notify(), except that there is no freeze count.

New in version 3.30.

do_books_disabled_changed() virtual
do_fonts_changed() virtual

Signal Details

Devhelp.Settings.signals.books_disabled_changed(settings)
Signal Name:

books-disabled-changed

Flags:

RUN_FIRST

Parameters:

settings (Devhelp.Settings) – The object which received the signal

The ::books-disabled-changed signal is emitted when the “books-disabled” Gio.Settings key changes.

New in version 3.30.

Devhelp.Settings.signals.fonts_changed(settings)
Signal Name:

fonts-changed

Flags:

RUN_FIRST

Parameters:

settings (Devhelp.Settings) – The object which received the signal

The ::fonts-changed signal is emitted when the return values of Devhelp.Settings.get_selected_fonts() have potentially changed.

New in version 3.30.

Property Details

Devhelp.Settings.props.fixed_font
Name:

fixed-font

Type:

str

Default Value:

'Monospace 12'

Flags:

READABLE, WRITABLE, CONSTRUCT

Font for text with fixed width, such as code examples.

This property is independent of Devhelp.Settings :use-system-fonts.

New in version 3.30.

Devhelp.Settings.props.group_books_by_language
Name:

group-books-by-language

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether books should be grouped by programming language in the UI.

New in version 3.30.

Devhelp.Settings.props.use_system_fonts
Name:

use-system-fonts

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether to use the system default fonts.

New in version 3.30.

Devhelp.Settings.props.variable_font
Name:

variable-font

Type:

str

Default Value:

'Sans 12'

Flags:

READABLE, WRITABLE, CONSTRUCT

Font for text with variable width.

This property is independent of Devhelp.Settings :use-system-fonts.

New in version 3.30.