main

Main function, to be called to start the GUI interface

class camelot.view.main.Application(application_admin)[source]

The camelot application. This class will take care of the order of initialization of various stuff needed to get the application up and running, each of its methods will be called in subsequent order, overwrite any of them to customize its behaviour.

This class will create the QApplication and call its processEvents method regulary while starting up the application.

create_main_window()[source]
Returns:a QWidget representing the main window, upon its appearance, the splash

screen will be closed

initialization()[source]

Method that is called afther the model has been set up, before the main window is constructed

initialization_exception(exception_info)[source]

This method is called whenever an exception occurs before the event loop has been started, or if the setup of the model thread failed. By default this pops up a dialog.

Parameters:exception_info – a serialized form of the exception
load_translations(application)[source]

Fill the QApplication with the needed translations :param application: the QApplication on which to install the translator

main()[source]

the main function of the application, this will call all other functions before starting the event loop

pre_initialization()[source]

Method that is called before the model thread is started, while the app is still running single threaded.

The default implementation verifies if the database_selection attribute is set to True on the ApplicationAdmin, and if this is the case, present the user with a database selection wizard.

set_application_attributes(application)[source]

Sets the attributes of the QApplication object :param application: the QApplication object

show_splash_message(splash_window, message)[source]
Parameters:message – displays a message on the splash screen, informing

the user of the status of the application

show_splashscreen()[source]
Returns:the splash window
start_event_loop(application)[source]

Starts the application’s main event loop, wait until it is finished, then exit :param application: the QApplication to run

start_model_thread()[source]

Launch the second thread where the model lives

camelot.view.main.main(application_admin)[source]

shortcut main function, call this function to start the GUI interface with minimal hassle and without the need to construct an Application object. If you need to customize the initialization process, construct an Application subclass and use it’s main method.

Parameters:application_admin – object of type ApplicationAdmin (as defined in application_admin.py)

that specifies the look of the GUI interface

Previous topic

import_utils

Next topic

mainwindow

This Page