Uranium
Application Framework
UM.Application.Application Class Reference

Central object responsible for running the main event loop and creating other central objects. More...

Inheritance diagram for UM.Application.Application:
UM.Qt.QtApplication.QtApplication

Public Member Functions

None __init__ (self, str name, str version, str api_version, str app_display_name="", str build_type="", bool is_debug_mode=False, **kwargs)
 Init method. More...
 
"Version" getAPIVersion (self)
 
None addCommandLineOptions (self)
 
None parseCliOptions (self)
 
None initialize (self)
 
None startSplashWindowPhase (self)
 
None startPostSplashWindowPhase (self)
 
bool hasJustUpdatedFromOldVersion (self)
 
def run (self)
 Run the main event loop. More...
 
def getContainerRegistry (self)
 
str getApplicationLockFilename (self)
 Get the lock filename.
 
None setGlobalContainerStack (self, "ContainerStack" stack)
 
Optional["ContainerStack"] getGlobalContainerStack (self)
 
None hideMessage (self, Message message)
 
None showMessage (self, Message message)
 
None showToastMessage (self, str title, str message)
 
str getVersion (self)
 Get the version of the application.
 
str getBuildType (self)
 Get the build type of the application.
 
bool getIsDebugMode (self)
 
bool getIsHeadLess (self)
 
bool getUseExternalBackend (self)
 
None hideMessageById (self, int message_id)
 Hide message by ID (as provided by built-in id function)
 
List[MessagegetVisibleMessages (self)
 Get list of all visible messages.
 
str getApplicationName (self)
 Get name of the application. More...
 
str getApplicationDisplayName (self)
 
Preferences getPreferences (self)
 Get the preferences. More...
 
None savePreferences (self)
 
str getApplicationLanguage (self)
 Get the currently used IETF language tag. More...
 
List[str] getRequiredPlugins (self)
 Application has a list of plugins that it must have. More...
 
None setRequiredPlugins (self, List[str] plugin_names)
 Set the plugins that the application must have in order to function. More...
 
None setBackend (self, "Backend" backend)
 Set the backend of the application (the program that does the heavy lifting).
 
"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...
 
OperationStack getOperationStack (self)
 
OutputDeviceManager getOutputDeviceManager (self)
 
Renderer getRenderer (self)
 Return an application-specific Renderer object. More...
 
None functionEvent (self, CallFunctionEvent event)
 Post a function event onto the event loop. More...
 
None callLater (self, Callable[..., Any] func, *args, **kwargs)
 Call a function the next time the event loop runs. More...
 
threading.Thread getMainThread (self)
 Get the application's main thread.
 
None addExtension (self, "Extension" extension)
 
List["Extension"] getExtensions (self)
 
"Application" getInstance (cls, *args, **kwargs)
 

Static Public Member Functions

str getInstallPrefix ()
 

Public Attributes

 default_theme
 
 change_log_url
 

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()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

None UM.Application.Application.__init__ (   self,
str  name,
str  version,
str  api_version,
str   app_display_name = "",
str   build_type = "",
bool   is_debug_mode = False,
**  kwargs 
)

Init method.

Parameters
namestring The name of the application.
versionstring Version, formatted as major.minor.rev
build_typeAdditional version info on the type of build this is, such as "master".
is_debug_modeWhether to run in debug mode.

Member Function Documentation

◆ callLater()

None UM.Application.Application.callLater (   self,
Callable[..., Any]  func,
args,
**  kwargs 
)

Call a function the next time the event loop runs.

You can't get the result of this function directly. It won't block.

Parameters
functionThe function to call.
argsThe positional arguments to pass to the function.
kwargsThe keyword arguments to pass to the function.

◆ functionEvent()

None UM.Application.Application.functionEvent (   self,
CallFunctionEvent  event 
)

Post a function event onto the event loop.

This takes a CallFunctionEvent object and puts it into the actual event loop.

Exceptions
NotImplementedError

◆ getApplicationLanguage()

str UM.Application.Application.getApplicationLanguage (   self)

Get the currently used IETF language tag.

The returned tag is during runtime used to translate strings.

Returns
Language tag.

◆ getApplicationName()

str UM.Application.Application.getApplicationName (   self)

Get name of the application.

Returns
app_name string

◆ getBackend()

"Backend" UM.Application.Application.getBackend (   self)

Get the backend of the application (the program that does the heavy lifting).

Returns
Backend Backend

Reimplemented in UM.Qt.QtApplication.QtApplication.

◆ getController()

Controller UM.Application.Application.getController (   self)

Get the Controller of this application.

Returns
Controller Controller

◆ getPluginRegistry()

PluginRegistry UM.Application.Application.getPluginRegistry (   self)

Get the PluginRegistry of this application.

Returns
PluginRegistry PluginRegistry

◆ getPreferences()

Preferences UM.Application.Application.getPreferences (   self)

Get the preferences.

Returns
preferences Preferences

◆ getRenderer()

Renderer UM.Application.Application.getRenderer (   self)

Return an application-specific Renderer object.

Exceptions
NotImplementedError

Reimplemented in UM.Qt.QtApplication.QtApplication.

◆ getRequiredPlugins()

List[str] 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.

◆ run()

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.

Exceptions
NotImplementedError

Reimplemented in UM.Qt.QtApplication.QtApplication.

◆ setRequiredPlugins()

None UM.Application.Application.setRequiredPlugins (   self,
List[str]  plugin_names 
)

Set the plugins that the application must have in order to function.

Parameters
plugin_nameslist List of strings with the names of the required plugins

The documentation for this class was generated from the following file: