utils Package

utils Package

Graphical User Interface: Dialogs, Editors, Search, Slaves, Wizards etc

databaseform Module

class stoqlib.gui.utils.databaseform.DatabaseForm(form_name)[source]

Bases: object

update_widget(widget, field_name=None, other=None)[source]

filters Module

stoqlib.gui.utils.filters.get_filters_for_images()[source]

Return a list with a single gtk.FileFilter for all images

stoqlib.gui.utils.filters.get_filters_for_attachment()[source]

This function creates a list of gtk.FileFilter to be used when choosing a file for attachment. :returns: a list of gtk.FileFilter

help Module

Showing help.

stoqlib.gui.utils.help.show_contents(screen=None)[source]
stoqlib.gui.utils.help.show_section(section, screen=None)[source]

iconutils Module

idle Module

This modules has one function get_idle_seconds() that returns the number of the seconds since the user has used the keyboard or mouse.

class stoqlib.gui.utils.idle.LASTINPUTINFO[source]

Bases: _ctypes.Structure

cbSize

Structure/Union member

dwTime

Structure/Union member

class stoqlib.gui.utils.idle.XScreenSaverInfo[source]

Bases: _ctypes.Structure

eventMask

Structure/Union member

idle

Structure/Union member

kind

Structure/Union member

state

Structure/Union member

til_or_since

Structure/Union member

window

Structure/Union member

class stoqlib.gui.utils.idle.IdleXScreenSaver[source]

Bases: object

get_idle()[source]
class stoqlib.gui.utils.idle.IdleEventHandler[source]

Bases: object

get_idle()[source]
stoqlib.gui.utils.idle.get_idle_seconds()[source]

Returns the number of seconds the current user has been idle.

Returns:idle seconds
Return type:int

introspection Module

stoqlib.gui.utils.introspection.introspect_slaves(window)[source]

Traverses all the children of window and prints out all the kiwi slaves. :param window: a gtk.Window subclass

keybindings Module

class stoqlib.gui.utils.keybindings.KeyBinding(item)[source]

Bases: object

class stoqlib.gui.utils.keybindings.KeyBindingCategory(name, label)[source]

Bases: object

class stoqlib.gui.utils.keybindings.KeyBindingGroup(bindings)[source]

Bases: object

get(name)[source]
stoqlib.gui.utils.keybindings.add_bindings(bindings)[source]
stoqlib.gui.utils.keybindings.load_user_keybindings()[source]
stoqlib.gui.utils.keybindings.set_user_binding(binding, value)[source]
stoqlib.gui.utils.keybindings.remove_user_binding(binding)[source]
stoqlib.gui.utils.keybindings.remove_user_bindings()[source]
stoqlib.gui.utils.keybindings.get_bindings(category=None)[source]
stoqlib.gui.utils.keybindings.get_category_label(name)[source]
stoqlib.gui.utils.keybindings.get_binding_categories()[source]
stoqlib.gui.utils.keybindings.get_accels(prefix='')[source]
stoqlib.gui.utils.keybindings.get_accel(accel_name)[source]

keyboardhandler Module

Global keyboard handling.

This module allows you to install a callback which will be called for all toplevel windows

stoqlib.gui.utils.keyboardhandler.install_global_keyhandler(keyval, callback)[source]

Installs a new key handler. :param keyval: :param callback:

login Module

Login dialog for users authentication

class stoqlib.gui.utils.login.LoginDialog(title=None)[source]

Bases: kiwi.ui.delegates.GladeDelegate, stoqlib.gui.base.dialogs.RunnableView

domain = 'stoq'
toplevel_name = 'LoginDialog'
gladefile = 'LoginDialog'
size = (-1, -1)
setup_widgets()[source]
force_username(username)[source]
on_escape_pressed()[source]
on_delete_event(window, event)[source]
on_ok_button__clicked(button)[source]
on_quit_button__clicked(button)[source]
on_username__activate(entry)[source]
on_password__activate(entry)[source]
set_field_sensitivity(sensitive=True)[source]
run(username=None, password=None, msg=None)[source]
class stoqlib.gui.utils.login.LoginHelper(username=None)[source]
cookie_login()[source]
validate_user()[source]

Checks if an user can log in or not. :returns: a user object

openbrowser Module

stoqlib.gui.utils.openbrowser.open_browser(uri, screen=None)[source]

printing Module

class stoqlib.gui.utils.printing.PrintOperation(report)[source]

Bases: gtk.PrintOperation

set_threaded()[source]
run()[source]
begin_print()[source]

This is called before printing is done. It can be used to fetch print settings that the user selected in the dialog

render()[source]

Renders the actual page. This might run in a separate thread, no glib/gtk+ calls are allowed here, they needs to be done in render_done() which is called when this is finished.

render_done()[source]

Rendering of the printed page is done. This should call self.set_n_pages()

draw_page(cr, page_no)[source]

Draws a page :param cr: a cairo context :param int page_no: the page to draw

done()[source]

Called when rendering and drawing is complete, can be used to free resources created during printing.

class stoqlib.gui.utils.printing.PrintOperationPoppler(report)[source]

Bases: stoqlib.gui.utils.printing.PrintOperation

render()[source]
render_done()[source]
draw_page(cr, page_no)[source]
done()[source]
class stoqlib.gui.utils.printing.PrintOperationWEasyPrint(report)[source]

Bases: stoqlib.gui.utils.printing.PrintOperation

PRINT_CSS_TEMPLATE = '\n @page {\n size: ${ page_width }mm ${ page_height }mm;\n font-family: "${ font_family }";\n }\n\n body {\n font-family: "${ font_family }";\n font-size: ${ font_size }pt;\n }\n '
page_setup_name = 'page_setup.ini'
print_settings_name = 'print_settings.ini'
begin_print()[source]
render()[source]
render_done()[source]
draw_page(cr, page_no)[source]
stoqlib.gui.utils.printing.describe_search_filters_for_reports(filters, **kwargs)[source]
stoqlib.gui.utils.printing.print_report(report_class, *args, **kwargs)[source]
stoqlib.gui.utils.printing.print_labels(label_data, store, purchase=None, receiving=None)[source]