The ApplicationAdmin class defines how the application should look like, it also ties Python classes to their associated camelot.admin.object_admin.ObjectAdmin class or subclass. It’s behaviour can be steered by overwriting its static attributes or it’s methods :
The name of the application, as it will appear in the title of the main window.
The url of the web site where the user can find more information on the application.
Points to either a local html file or a web site that contains the documentation of the application.
The name of the author of the application
The domain name of the author of the application, eg ‘mydomain.com’, this domain will be used to store settings of the application.
A string with the version of the application
The wizard that should be used to create new database profiles. Defaults to camelot.view.database_selection.ProfileWizard
if this is set to True, present the user with a database selection wizard prior to starting the application. Defaults to False.
When the same action is returned in the get_toolbar_actions() and get_main_menu() method, it should be exactly the same object, to avoid shortcut confusion and reduce the number of status updates.
Create the main window that will be shown when the application starts up. By default, returns an instance of
Returns: | a PyQt4.QtGui.QWidget |
---|
alias of ProfileWizard
Returns: | a list of camelot.admin.action.base.Action objects |
---|
that should be displayed on the desktop of the user.
Get the ApplicationAdmin class of this application, this method is here for compatibility with the ObjectAdmin
Returns: | this object itself |
---|
Get the default camelot.admin.object_admin.ObjectAdmin class for a specific entity, return None, if not known. The ObjectAdmin should either be registered through the register() method or be defined as an inner class with name Admin of the entity.
Parameters: | entity – a class |
---|
deprecated : use get_related_admin instead
Specify the action buttons that should appear on each form in the application. The camelot.admin.object_admin.ObjectAdmin.get_form_actions() method will call this method and prepend the result to the actions of that specific form.
Returns: | a list of camelot.admin.action.base.Action objects |
---|
Parameters: | toolbar_area – an instance of Qt.ToolBarArea indicating where the toolbar actions will be positioned |
---|---|
Returns: | a list of camelot.admin.action.base.Action objects that should be displayed on the toolbar of a form view. return None if no toolbar should be created. |
Returns: | a list of camelot.admin.action.base.Action objects |
---|
that can only be triggered using shortcuts and are not visibile in the UI.
Returns: | the camelot.view.art.Icon that should be used for the application |
---|
Returns: | a list of camelot.admin.menu.Menu objects, or None if |
---|
there should be no main menu
Returns an instance of camelot.core.memento.SqlMemento that can be used to store changes made to objects. Overwrite this method to make it return None if no changes should be stored to the database, or to return another instance if the changes should be stored elsewhere.
Returns: | None or an camelot.core.memento.SqlMemento instance |
---|
Returns: | the name of the application, by default this is the class |
---|
attribute name
Returns: | a string with the domain name of the organization that wrote the |
---|
application. By default returns the ApplicationAdmin.domain attribute.
Returns: | a string with the name of the organization that wrote the |
---|
application. By default returns the ApplicationAdmin.author attribute.
Get the default camelot.admin.object_admin.ObjectAdmin class for a specific class, return None, if not known. The ObjectAdmin should either be registered through the register() method or be defined as an inner class with name Admin of the entity.
Parameters: | entity – a class |
---|
Specify the toolbar actions that should appear by default on every OneToMany editor in the application.
Parameters: |
|
---|---|
Returns: | a list of camelot.admin.action.base.Action objects |
A list of camelot.admin.section.Section objects, these are the sections to be displayed in the left panel.
A QtCore.QSettings object in which Camelot related settings can be stored. This object is intended for Camelot internal use. If an application specific settings object is needed, simply construct one.
Returns: | a QtCore.QSettings object |
---|
Returns: | a string with the content of a qt stylesheet to be used for |
---|
this application as a string or None if no stylesheet needed.
Camelot comes with a couple of default stylesheets :
- stylesheet/office2007_blue.qss
- stylesheet/office2007_black.qss
- stylesheet/office2007_silver.qss
Have a look at the default implementation to use another stylesheet.
Parameters: | toolbar_area – an instance of Qt.ToolBarArea indicating where the toolbar actions will be positioned |
---|---|
Returns: | a list of camelot.admin.action.base.Action objects that should be displayed on the toolbar of the application. return None if no toolbar should be created. |
Reimplement this method to add application specific translations to your application. The default method returns a list with the default Qt and the default Camelot translator for the current system locale. Call QLocale.setDefault() before this method is called if you want to load different translations then the system default.
Returns: | a list of QtCore.QTranslator objects that should be used to translate the application |
---|
Returns: | string representing version of the application, by default this |
---|
is the class attribute verion
Associate a certain ObjectAdmin class with another class. This ObjectAdmin will be used as default to render object the specified type.
Parameters: |
|
---|