base Package¶
base Package¶
columns Module¶
Special columns definition for kiwi lists
dialogs Module¶
Basic dialogs definition
-
class
stoqlib.gui.base.dialogs.RunnableView[source]¶ A mixin class for any View or GladeDelegate that offers run/close
-
retval= None¶
-
-
class
stoqlib.gui.base.dialogs.BasicDialog(main_label_text=None, title=' ', header_text='', size=None, hide_footer=False, delete_handler=None, help_section=None)[source]¶ Bases:
kiwi.ui.delegates.GladeDelegate,stoqlib.gui.base.dialogs.RunnableViewAbstract class that offers a Dialog with two buttons. It should be subclassed and customized.
-
domain= 'stoq'¶
-
help_section= None¶
-
set_confirm_widget(widget)[source]¶ Enables widget as a confirm widget, the dialog will be closed as confirmed if the widget is activated. :param widget: a widget
-
action_area¶
-
set_message(message, message_type=None)[source]¶ Sets a message for this editor :param message: message to add or None to remove previous message :param message_type: type of message to add
-
-
stoqlib.gui.base.dialogs.get_dialog(parent, dialog, *args, **kwargs)[source]¶ Returns a dialog.
Parameters: - parent – the window which is opening the dialog
- dialog – the dialog class or instance
- args – custom positional arguments
- kwargs – custom keyword arguments
-
stoqlib.gui.base.dialogs.has_modal_window()[source]¶ Verifies if any of the currently open windows are modal.
Returns: Trueif there are any modal windows open, otherwiseFalse
-
stoqlib.gui.base.dialogs.run_dialog(dialog, parent=None, *args, **kwargs)[source]¶ Runs a dialog and return the return value of it. If dialog is a class it will be instantiated before running the dialog.
Parameters: - dialog – the dialog class
- parent – parent of the dialog
- args – custom positional arguments
- kwargs – custom keyword arguments
gtkadds Module¶
Some extra methods to deal with gtk/kiwi widgets
Sets an image above the text :param button: :param stock_id: :param text:
lists Module¶
List management for common dialogs.
-
class
stoqlib.gui.base.lists.ModelListSlave(parent=None, store=None, orientation=None, reuse_store=False)[source]¶ Bases:
kiwi.ui.listdialog.ListSlave-
model_type= None¶
-
editor_class= None¶
-
columns= None¶
-
run_dialog(dialog_class, *args, **kwargs)[source]¶ A special variant of run_dialog which deletes objects when a store is reused, it’s safe to use when it’s disabled, so always use this in your run_editor hook
-
-
class
stoqlib.gui.base.lists.ModelListDialog(store=None, reuse_store=False)[source]¶ Bases:
stoqlib.gui.base.dialogs.BasicDialogA dialog which displays all items in a table and allows you to add and remove items from it
Variables: -
list_slave_class= None¶
-
columns= None¶
-
size= None¶
-
title= None¶
-
-
class
stoqlib.gui.base.lists.AdditionListSlave(store, columns=None, editor_class=None, klist_objects=None, visual_mode=False, restore_name=None, tree=False)[source]¶ Bases:
stoqlib.gui.search.searchslave.SearchSlaveA slave that offers a simple list and its management.
This slave also has the option to display a small message right next to the buttons
-
domain= 'stoq'¶
-
toplevel_name= 'AdditionListSlave'¶
-
gladefile= 'AdditionListSlave'¶
-
widgets= ('add_button', 'delete_button', 'klist', 'list_vbox', 'edit_button')¶
-
run_editor(model)[source]¶ This can be overriden to provide a custom run_dialog line, or a conversion function for the model
-
delete_model(model)[source]¶ Deletes a model, can be overridden in subclass :param model: model to delete
Add an extra button on the this slave
The extra button will be appended at the end of the button box, the one containing the add/edit/delete buttons
Parameters: - label – label of the button, can be
Noneif stock is passed - stock – stock label of the button, can be
Noneif label is passed - returns – the button added
Return type: gtk.Button
- label – label of the button, can be
-
set_message(message, details_callback=None)[source]¶ Display a simple message on a label, next to the add, edit, delete buttons :param message: a message with properly escaped markup
-
messagebar Module¶
slaves Module¶
Basic slave definitions
wizards Module¶
Base classes for wizards
-
class
stoqlib.gui.base.wizards.WizardStep(previous=None, header=None)[source]¶ This class must be inherited by the steps
-
class
stoqlib.gui.base.wizards.PluggableWizard(title, first_step, size=None, edit_mode=False)[source]¶ Bases:
kiwi.ui.delegates.GladeDelegateWizard controller and view class
-
domain= 'stoq'¶
-
gladefile= 'PluggableWizard'¶
-
-
class
stoqlib.gui.base.wizards.BaseWizardStep(store, wizard, previous=None)[source]¶ Bases:
stoqlib.gui.base.wizards.WizardStep,kiwi.ui.delegates.GladeSlaveDelegateA wizard step base class definition
-
domain= 'stoq'¶
-
gladefile= None¶
-
-
class
stoqlib.gui.base.wizards.WizardEditorStep(store, wizard, model=None, previous=None)[source]¶ Bases:
stoqlib.gui.editors.baseeditor.BaseEditorSlave,stoqlib.gui.base.wizards.WizardStepA wizard step base class definition used when we have a model to be edited or created
-
class
stoqlib.gui.base.wizards.BaseWizard(store, first_step, model=None, title=None, size=None, edit_mode=False)[source]¶ Bases:
stoqlib.gui.base.wizards.PluggableWizard,stoqlib.gui.base.dialogs.RunnableViewA wizard base class definition
-
help_section= None¶
-
need_cancel_confirmation= False¶ if we need to ask the user if he really wants to cancel the dialog if there are any changes done that would be lost otherwise
-
size= ()¶
-
title= None¶
-
has_changes()[source]¶ Check if there are changes on this wizard
By default we will check if there’re any pending changes on
storeand that information will be used byneed_cancel_confirmation
-