Uranium
Application Framework
|
Central object responsible for running the main event loop and creating other central objects. More...
Public Member Functions | |
def | __init__ (self, str name, str version, str build_type="", is_debug_mode=False, parser=None, parsed_command_line={}, **kwargs) |
Init method. More... | |
def | getContainerRegistry (self) |
def | setGlobalContainerStack (self, "ContainerStack" stack) |
Optional["ContainerStack"] | getGlobalContainerStack (self) |
def | hideMessage (self, message) |
def | showMessage (self, message) |
def | isExitAllowed (self) |
def | showToastMessage (self, str title, str message) |
str | getVersion (self) |
Get the version of the application. More... | |
def | getStaticVersion (cls) |
str | getBuildType (self) |
Get the buildtype of the application. More... | |
bool | getIsDebugMode (self) |
def | hideMessageById (self, message_id) |
Hide message by ID (as provided by built-in id function) More... | |
def | getVisibleMessages (self) |
Get list of all visible messages. More... | |
def | getCommandLineOption (self, name, default=None) |
str | getApplicationName (self) |
Get name of the application. More... | |
def | getApplicationLanguage (self) |
Get the currently used IETF language tag. More... | |
def | getRequiredPlugins (self) |
Application has a list of plugins that it must have. More... | |
def | setRequiredPlugins (self, List[str] plugin_names) |
Set the plugins that the application must have in order to function. More... | |
def | setBackend (self, "Backend" backend) |
Set the backend of the application (the program that does the heavy lifting). More... | |
"Backend" | getBackend (self) |
Get the backend of the application (the program that does the heavy lifting). More... | |
PluginRegistry | getPluginRegistry (self) |
Get the PluginRegistry of this application. More... | |
Controller | getController (self) |
Get the Controller of this application. More... | |
MeshFileHandler | getMeshFileHandler (self) |
Get the MeshFileHandler of this application. More... | |
WorkspaceFileHandler | getWorkspaceFileHandler (self) |
OperationStack | getOperationStack (self) |
OutputDeviceManager | getOutputDeviceManager (self) |
def | preRun (self) |
Includes eg. More... | |
def | run (self) |
Run the main event loop. More... | |
def | getRenderer (self) |
Return an application-specific Renderer object. More... | |
def | functionEvent (self, event) |
Post a function event onto the event loop. More... | |
def | callLater (self, Callable[[Any], Any] func, *args, **kwargs) |
Call a function the next time the event loop runs. More... | |
def | getMainThread (self) |
Get the application"s main thread. | |
"Application" | getInstance (cls, **kwargs) |
Return the singleton instance of the application object. | |
def | getCommandlineParser (self, with_help=False) |
def | parseCommandLine (self) |
def | addCommandLineOptions (cls, parser, parsed_command_line={}) |
Can be overridden to add additional command line options to the parser. More... | |
def | addExtension (self, "Extension" extension) |
List["Extension"] | getExtensions (self) |
Static Public Member Functions | |
def | getInstallPrefix () |
Public Attributes | |
default_theme | |
Static Public Attributes | |
applicationShuttingDown = Signal() | |
Emitted when the application window was closed and we need to shut down the application. | |
showMessageSignal = Signal() | |
hideMessageSignal = Signal() | |
globalContainerStackChanged = Signal() | |
workspaceLoaded = Signal() | |
visibleMessageAdded = Signal() | |
visibleMessageRemoved = Signal() | |
Central object responsible for running the main event loop and creating other central objects.
The Application object is a central object for accessing other important objects. It is also responsible for starting the main event loop. It is passed on to plugins so it can be easily used to access objects required for those plugins.
def UM.Application.Application.__init__ | ( | self, | |
str | name, | ||
str | version, | ||
str | build_type = "" , |
||
is_debug_mode = False , |
|||
parser = None , |
|||
parsed_command_line = {} , |
|||
** | kwargs | ||
) |
Init method.
name | string The name of the application. |
version | string Version, formatted as major.minor.rev |
def UM.Application.Application.addCommandLineOptions | ( | cls, | |
parser, | |||
parsed_command_line = {} |
|||
) |
Can be overridden to add additional command line options to the parser.
parser | argparse.ArgumentParser The parser that will parse the command line. |
Reimplemented in UM.Qt.QtApplication.QtApplication.
def UM.Application.Application.callLater | ( | self, | |
Callable[[Any], Any] | func, | ||
* | args, | ||
** | kwargs | ||
) |
Call a function the next time the event loop runs.
function | The function to call. |
args | The positional arguments to pass to the function. |
kwargs | The keyword arguments to pass to the function. |
def UM.Application.Application.functionEvent | ( | self, | |
event | |||
) |
Post a function event onto the event loop.
This takes a CallFunctionEvent object and puts it into the actual event loop.
NotImplementedError |
Reimplemented in UM.Qt.QtApplication.QtApplication.
def UM.Application.Application.getApplicationLanguage | ( | self | ) |
Get the currently used IETF language tag.
The returned tag is during runtime used to translate strings.
str UM.Application.Application.getApplicationName | ( | self | ) |
Get name of the application.
"Backend" UM.Application.Application.getBackend | ( | self | ) |
Get the backend of the application (the program that does the heavy lifting).
Reimplemented in UM.Qt.QtApplication.QtApplication.
str UM.Application.Application.getBuildType | ( | self | ) |
Get the buildtype of the application.
Controller UM.Application.Application.getController | ( | self | ) |
Get the Controller of this application.
MeshFileHandler UM.Application.Application.getMeshFileHandler | ( | self | ) |
Get the MeshFileHandler of this application.
PluginRegistry UM.Application.Application.getPluginRegistry | ( | self | ) |
Get the PluginRegistry of this application.
def UM.Application.Application.getRenderer | ( | self | ) |
Return an application-specific Renderer object.
NotImplementedError |
Reimplemented in UM.Qt.QtApplication.QtApplication.
def UM.Application.Application.getRequiredPlugins | ( | self | ) |
Application has a list of plugins that it must have.
If it does not have these, it cannot function. These plugins can not be disabled in any way.
str UM.Application.Application.getVersion | ( | self | ) |
Get the version of the application.
def UM.Application.Application.getVisibleMessages | ( | self | ) |
Get list of all visible messages.
def UM.Application.Application.hideMessageById | ( | self, | |
message_id | |||
) |
Hide message by ID (as provided by built-in id function)
message_id | long |
def UM.Application.Application.preRun | ( | self | ) |
Includes eg.
last checks before entering the main event loop.
def UM.Application.Application.run | ( | self | ) |
Run the main event loop.
This method should be re-implemented by subclasses to start the main event loop.
NotImplementedError |
Reimplemented in UM.Qt.QtApplication.QtApplication.
def UM.Application.Application.setBackend | ( | self, | |
"Backend" | backend | ||
) |
Set the backend of the application (the program that does the heavy lifting).
backend | Backend |
def UM.Application.Application.setRequiredPlugins | ( | self, | |
List[str] | plugin_names | ||
) |
Set the plugins that the application must have in order to function.
plugin_names | list List of strings with the names of the required plugins |