Инструменты пользователя

Инструменты сайта


products:pyrog:api:latest:types:helper

Текст документации сгенерирован автоматически из исходного кода.
Если обнаружили ошибку, отправьте об этом сообщение на 📧почту.

Helper

Inherits: QObject

This class provides utilitarian functions and signals from Manager application.

Attributes:

  • plugin_language_changing: Signal[str] — This signal is sent when the user changes the current language of the plugin. The Manager application sends this signal when initializing the plugin if the selected language differs from the original one.
  • plugin_deactivating: Signal — This signal is sent when the user deactivates the plugin; it is needed to notify the plugin that it is necessary to prepare for shutdown.
  • app_closing: Signal — This signal is sent when the user closes the Manager application; it is needed to notify the plugin that it is necessary to prepare for shutdown.
  • settings_editing_starting: Signal — This signal is sent when the user starts editing settings, before editing becomes available. It is necessary to notify the plugin that the values of settings can be changed at any time, and it should make the necessary preparations.
  • settings_editing_finished: Signal[bool] — This signal is sent when the user has finished editing settings.
    • True — the user has chosen save settings option
    • False — the user has chosen cancellation of saving settings values.

Constructor:

def Helper.__init__(parent = None)

Parameters:

  • parent — (without description)

Methods


delete

def delete()

Delete instance of Helper class from list of instances.

Attention: this method is only for Manager using.


save_settings_parameters

def save_settings_parameters()

Saves settings parameters in database

Saves parameters of properties of PropertyContainer that method Plugin.settings() returns

Raises:

  • RuntimeError — the plugin has no settings.

save_settings_values

def save_settings_values()

Saves settings values in database

Saves values of properties of PropertyContainer that method Plugin.settings() returns

Raises:

  • RuntimeError — the plugin has no settings.

plugin_dir_abspath

def plugin_dir_abspath() -> str

Returns absolute plugin directory path

Returns:

  • str — absolute plugin directory path

plugin_localstorage_dir_abspath

def plugin_localstorage_dir_abspath() -> str

Returns absolute path to plugin local storage directory located in «manager/data/plugins_ls»

Returns:

  • str — absolute path to plugin local storage directory

set_menu

def set_menu(menu: Optional[QMenu] = None, position: Literal['top_bar', 'tab_whole', 'tab_before', 'tab_after'] = 'top_bar')

Sets menu object in specified position of Manager

Notes: Set None object to delete menu.

Parameters:

  • menu: Optional[QMenu] — QMenu object
  • position: Literal['top_bar', 'tab_whole', 'tab_before', 'tab_after'] — position of the menu
    • «top_bar» — set menu in top bar of Manager
    • «tab_whole» — overrides builtin context menu of plugin's tab of Manager ('tab_before' and 'tab_after' are ignoring)
    • «tab_before» — sets menu before builtin context menu
    • «tab_after» — sets menu after builtin context menu

Raises:

  • TypeError — if [position] is not a string or [menu] is not a QMenu or None.
  • ValueError — if [position] has wrong literal.

get_menu

def get_menu(position: Literal['top_bar', 'tab_whole', 'tab_before', 'tab_after']) -> Optional[QMenu]

Returns menu object in specified position

Parameters:

  • position: Literal['top_bar', 'tab_whole', 'tab_before', 'tab_after'] — position of the menu
    • «top_bar» — menu in top bar of Manager
    • «tab_whole» — overridden builtin context menu of plugin's tab of Manager
    • «tab_before» — menu before builtin context menu
    • «tab_after» — menu after builtin context menu

Returns:

  • QMenu — menu object
  • None — if menu is not set

Raises:

  • TypeError — if [position] is not a string.
  • ValueError — if [position] has wrong literal.

products/pyrog/api/latest/types/helper.txt · Последнее изменение: 127.0.0.1