gui

Various ActionStep subclasses that manipulate the GUI of the application.

class camelot.view.action_steps.gui.CloseView(accept=True)[source]

Close the view that triggered the action, if such a view is available.

Parameters:accept – a boolean indicating if the view’s widget should accept the close event. This defaults to True, when this is set to False, the view will trigger it’s corresponding close action instead of accepting the close event. The close action might involve validating if the view can be closed, or requesting confirmation from the user.
class camelot.view.action_steps.gui.MessageBox(text, icon=1, title=_('Message'), standard_buttons=<PyQt4.QtGui.StandardButtons object at 0x111f5ecf8>)[source]

Popup a QtWidgets.QMessageBox and send it result back. The arguments of this action are the same as those of the QtWidgets.QMessageBox constructor.

Parameters:
  • text – the text to be displayed within the message box
  • icon – one of the QtWidgets.QMessageBox.Icon constants
  • title – the window title of the message box
  • standard_buttons – the buttons to be displayed on the message box, out of the QtWidgets.QMessageBox.StandardButton enumeration. by default an Ok and a button Cancel will be shown.

When the Cancel button is pressed, this action step will raise a camelot.core.exception.CancelRequest

../../../_images/import_from_file_confirmation.png
render()[source]

create the message box. this method is used to unit test the action step.

class camelot.view.action_steps.gui.Refresh[source]

Refresh all the open screens on the desktop, this will reload queries from the database

class camelot.view.action_steps.gui.SelectItem(items, value=None)[source]

This action step pops up a single combobox dialog in which the user can select one item from a list of items.

Parameters:
  • items – a list of tuples with values and the visible name of the items from which the user can select, such as `[(1, ‘first’), (2,’second’)]
  • value – the value that should be selected when the dialog pops up
  • autoaccept – if True the dialog closes immediately after the user selected an option. When this is False, the user should press OK first.
class camelot.view.action_steps.gui.SelectSubclass(admin)[source]

Allow the user to select a subclass out of a class hierarchy. If the hierarch has only one class, this step returns immediately.

Parameters:admin – a camelot.admin.object_admin.ObjectAdmin object

yielding this step will return the admin for the subclass selected by the user.

class camelot.view.action_steps.gui.ShowChart(chart)[source]

Show a full screen chart.

Parameters:chart – a camelot.container.chartcontainer.FigureContainer or camelot.container.chartcontainer.AxesContainer
class camelot.view.action_steps.gui.ShowPixmap(pixmap)[source]

Show a full screen pixmap

Parameters:pixmap – a camelot.view.art.Pixmap object
class camelot.view.action_steps.gui.UpdateEditor(attribute, value, propagate=False)[source]

This step should be used in the context of an editor action. It will update an attribute of the editor.

Parameters:
  • attribute – the name of the attribute of the editor to update
  • value – the new value of the attribute
  • propagate – set to True if the editor should notify the underlying model of it’s change, so that the changes can be written to the model