application_admin — Camelot documentation

### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- admin »

# application_admin

class `camelot.admin.application_admin.` `ApplicationAdmin`

  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 :

  `name`

    The name of the application, as it will appear in the title of the main window.

  `application_url`

    The url of the web site where the user can find more information on the application.

  `help_url`

    Points to either a local html file or a web site that contains the documentation of the application.

  `author`

    The name of the author of the application

  `domain`

    The domain name of the author of the application, eg ‘mydomain.com’, this domain will be used to store settings of the application.

  `version`

    A string with the version of the application

  `backup_mechanism`

    A subclass of `camelot.core.backup.BackupMechanism` that enables the application to perform backups an restores.

  `database_profile_wizard`

    The wizard that should be used to create new database profiles. Defaults to `camelot.view.database_selection.ProfileWizard`

  `database_selection`

    if this is set to True, present the user with a database selection wizard prior to starting the application. Defaults to `False`.

  `backup_mechanism`

    alias of `BackupMechanism`

  `create_main_window`()

    Create the main window that will be shown when the application starts up. By default, returns an instance of

    > `camelot.view.mainwindow.MainWindow`

    Returns: | a `PyQt4.QtGui.QWidget`

  `database_profile_wizard`

    alias of `ProfileWizard`

  `dump_state`()

    Dump the state of the application to the output, this method is triggered by pressing `Ctrl-Alt-D` in the GUI

  `get_about`()

    Returns: | the content of the About dialog, a string with html

    syntax

  `get_actions`()

    Returns: | a list of `camelot.admin.application_action.ApplicationAction` objects

    that should be added to the menu and the icon bar for this application

  `get_affiliated_url`()

    Returns: | a `PyQt4.QtCore.QUrl` pointing to an affiliated webpage

    When this method returns a QUrl, an additional item will be available in the ‘Help’ menu, when clicked the system browser will be opened an pointing to this url.

    This can be used to connect the user to a website that is used a lot in the organization, but hard to remember.

  `get_default_field_attributes`(type_, field)

    Returns the default field attributes

  `get_entity_admin`(entity)

    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

  `get_help_url`()

    Returns: | a `PyQt4.QtCore.QUrl` pointing to the index page for help

  `get_icon`()

    Returns: | the `camelot.view.art.Icon` that should be used for the application

  `get_name`()

    Returns: | the name of the application, by default this is the class

    attribute name

  `get_related_admin`(cls)

    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`

  `get_remote_support_url`()

    Returns: | a `PyQt4.QtCore.QUrl` pointing to a page to get remote support

    When this method returns a QUrl, an additional item will be available in the ‘Help’ menu, when clicked the system browser will be opened an pointing to this url.

    This can be used to connect the user to services like logmein.com, an online ticketing system or others.

  `get_sections`(*args, **kwargs)

    A list of `camelot.admin.section.Section` objects, these are the sections to be displayed in the left panel.

  `get_splashscreen`()

    Returns: | a `PyQt4.QtGui.QPixmap` to be used as splash screen

  `get_stylesheet`()

    Returns: | a string with the 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.

  `get_translator`()

    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

  `get_version`()

    Returns: | string representing version of the application, by default this

    is the class attribute verion

  `get_versions`()

    Returns: | html which displays the versions of used libs for development

  `get_whats_new`()

    Returns: | a widget that has a show() method

  `read_null`()

    Create a segmentation fault by reading null, this is to test the faulthandling functions. this method is triggered by pressing `Ctrl-Alt-0` in the GUI

  `register`(entity, admin_class)

    Associate a certain ObjectAdmin class with another class. This ObjectAdmin will be used as default to render object the specified type.

    Parameters: | entity – `class` admin_class – a subclass of `camelot.admin.object_admin.ObjectAdmin` or `camelot.admin.entity_admin.EntityAdmin`

  `show_versions`()

    Pops up a messagebox showing the version of certain libraries used. This is for debugging purposes.

### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- admin »

Comments
blog comments powered by Disqus