class documentation

class Assistant(Dialog): (source)

Known subclasses: zim.gui.exportdialog.ExportDialog

View In Hierarchy

Dialog with multi-page input, sometimes also revert to as a "wizard". Similar to Gtk.Assistent separate implementation to allow more flexibility in the dialog layout.

Each "page" in the assistant is a step in the work flow. Pages should inherit from AssistantPage. Pages share the 'uistate' dict with assistant object, and can also use this to communicate state to another page. So each step can change its look based on state set in the previous step. (This is sometimes called a "Whiteboard" design pattern: each page can access the same "whiteboard" that is the uistate dict.)

Sub-classes of this dialog can freely manipulate the flow of pages e.g. by overloading the previous_page() and next_page() methods.

Method __init__ Constructor
Method append_page Append a page @param page: an AssistantPage object
Method assert_response_ok No summary
Method do_response Undocumented
Method get_page Get the current page @returns: a AssistantPage object
Method get_pages Get all pages @returns: a list of AssistantPage objects
Method next_page Go forward to the next page
Method previous_page Go back to the previous page
Method run Wrapper for Gtk.Dialog.run(), also calls show_all() @returns: self.result
Method set_page Set the current page, based on sequence number @param i: the index of the page to be shown
Instance Variable back_button Undocumented
Instance Variable forw_button Undocumented
Instance Variable ok_button Undocumented
Instance Variable uistate Undocumented
Method _update_valid Undocumented
Instance Variable _no_ok_action Undocumented
Instance Variable _page Undocumented
Instance Variable _pages Undocumented
Instance Variable _uistate Undocumented

Inherited from Dialog:

Class Method unique No summary
Method add_extra_button No summary
Method add_form Convenience method to construct a form with input widgets and add them to the dialog. See InputForm.add_inputs() for details.
Method add_help_text Adds a label with an info icon in front of it. Intended for informational text in dialogs. @param text: help text
Method add_text Adds a label to the dialog Also see add_help_text() for another style option. @param text: dialog text
Method do_response_cancel Handler called when the user clicks the "Cancel" button.
Method do_response_ok Handler called when the user clicks the "OK" button (or an equivalent button)
Method get_input Method used in test suite to get "interactive" inputs
Method get_input_enabled Undocumented
Method on_destroy Undocumented
Method present Undocumented
Method response_ok Trigger the response signal with response type 'OK'.
Method save_uistate Method when the dialog is about to exit or hide and wants to save the uistate. Sub-classes implementing this method should use it to set additional state parameter in self.uistate.
Method set_help Set the name of the manual page with help for this dialog. Setting this will add a "help" button to the dialog. @param pagename: the manual page name
Method set_input No summary
Method show Undocumented
Method show_all Undocumented
Method show_help Show a help page @param page: the manual page, if None the page as set with set_help() is used
Instance Variable destroyed when True the dialog is already destroyed
Instance Variable form InputForm added by add_form()
Instance Variable help_page Undocumented
Instance Variable result result to be returned by run()
Instance Variable vbox Gtk.VBox for main widgets of the dialog

Inherited from ConnectorMixin (via Dialog):

Method connectto Connect to signals of another object E.g.:
Method connectto_all Convenience method to combine multiple calls to connectto().
Method disconnect_all Disconnect all signals that have been connected with connectto and friends. Typically called when you want to destroy this object.
Method disconnect_from Disc all signals that have been connected with connectto and friends to a specific object.
Method _disconnect_from Undocumented
Instance Variable _connected_signals Undocumented
def __init__(self, parent, title, **options): (source)
Constructor
Parameters
parenteither a parent window or dialog or None
titledialog title
**optionsother dialog options, see Dialog.__init__()
def append_page(self, page): (source)
Append a page
Parameters
pagean AssistantPage object
def assert_response_ok(self): (source)
Like response_ok(), but raise an error when do_response_ok returns False. Also it explicitly does not handle errors in do_response_ok. Intended for use by the test suite.
Returns
self.result
Raises
AssertionErrorif do_response_ok returns False
def do_response(self, id): (source)

Undocumented

def get_page(self): (source)
Get the current page
Returns
a AssistantPage object
def get_pages(self): (source)
Get all pages
Returns
a list of AssistantPage objects
def next_page(self): (source)
Go forward to the next page
def previous_page(self): (source)
Go back to the previous page
def run(self): (source)
Wrapper for Gtk.Dialog.run(), also calls show_all()
Returns
self.result
def set_page(self, i): (source)
Set the current page, based on sequence number
Parameters
ithe index of the page to be shown
back_button = (source)

Undocumented

forw_button = (source)

Undocumented

ok_button = (source)

Undocumented

uistate = (source)

Undocumented

def _update_valid(self, *a): (source)

Undocumented

_no_ok_action: bool = (source)

Undocumented

_page = (source)

Undocumented

_pages: list = (source)

Undocumented

_uistate = (source)

Undocumented