Package mcbase :: Package widgets :: Module mcscreen :: Class MCScreen
[hide private]
[frames] | no frames]

Class MCScreen

source code


Base screen class, includes common methods used by all screens.

Instance Methods [hide private]
 
__init__(self)
Initializes the mcwindow widget
source code
 
setScreenIcon(self, iconPath)
Sets the icon of the tab widget that includes this screen.
source code
 
setMode(self, mode)
Sets the screen mode
source code
 
mode(self)
Returns the screen mode
source code
 
screenID(self)
Returns the unique id of this screen.
source code
 
findScreen(self, rootObj, screenID)
Find and return reference for a screen represented by screen ID screenID.
source code
 
getScreenClass(self, screenPath)
Gets the class for a given screen defined by screenPath.
source code
 
setScreenDisabled(self)
Disables screen visual updates.
source code
 
setScreenEnabled(self)
Enables screen visual updates.
source code
 
setScreenBusy(self, remoteCallActive=True)
Sets the screen as busy, screen is disabled after this call
source code
 
setScreenAvailable(self)
Sets the screen as available, screen is enabled after this call
source code
 
execute(self, taskPath, *prm, **kw)
Executes the given remote code on the server.
source code
 
getRemoteCode(self, codePath)
Gets mobile code from the remote server according to the given codePath
source code
 
sendMsg(self, taskPath, *prm, **kw)
Sends the given message to other clients under this user's domain.
source code
 
autoPrepareFields(self, *classes)
Automatically prepares the screen fields according to given class(es).
source code
 
autoFillFields(self, instance)
Automatically fills the screen fields according to given instance.
source code
 
createModelObject(self, klass)
Automatically creates an object of class class and assigns attributes using on screen information.
source code
 
updateModelObject(self, obj)
Automatically updates an object obj and assigns attributes using on screen information.
source code
 
openInCurrentTab(self, *args, **kw) source code
 
openNewTab(self, *args, **kw) source code
 
closeScreen(self, result=None)
Instructs the main window to close this screen.
source code
 
errorDialog(self, caption=tr('Error'), shortMsg='', longMsg='') source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Initializes the mcwindow widget

Overrides: object.__init__

findScreen(self, rootObj, screenID)

source code 

Find and return reference for a screen represented by screen ID screenID. Search will be made starting from rootObj.

Parameters:
  • rootObj (QWidget) - Root of search
  • screenID (str) - Unique id of screen
Returns:
Screen having screen id of screenID, None if not found

getScreenClass(self, screenPath)

source code 

Gets the class for a given screen defined by screenPath.

Parameters:
  • screenPath (str) - Path defining the screen
Returns:
A class object for the screen

setScreenBusy(self, remoteCallActive=True)

source code 

Sets the screen as busy, screen is disabled after this call

Parameters:
  • changeIcon (bool) - If True, the default, sets a busy icon in the related tab for this screen.
Decorators:
  • @defer.inlineCallbacks

setScreenAvailable(self)

source code 

Sets the screen as available, screen is enabled after this call

Decorators:
  • @defer.inlineCallbacks

execute(self, taskPath, *prm, **kw)

source code 

Executes the given remote code on the server. Returns the result of the call.

Parameters:
  • taskPath (string) - Remote code location in distribution hierarchy, i.e. "mcbase.controllers.perform.SampleClass:run"
  • args - Remote call parameters
  • kw - Remote call keyword parameters
Returns:
Result of the remote execution
Decorators:
  • @defer.inlineCallbacks

getRemoteCode(self, codePath)

source code 

Gets mobile code from the remote server according to the given codePath

Parameters:
  • codePath (string) - String representing the code path to be transferred
Decorators:
  • @defer.inlineCallbacks

sendMsg(self, taskPath, *prm, **kw)

source code 

Sends the given message to other clients under this user's domain. Executes the given remote code on the server. Returns the result of the call.

Parameters:
  • taskPath (string) - Message identifier, should be similar to 'a.b.c'
  • args - Message parameters
  • kw - Message keyword parameters
Decorators:
  • @defer.inlineCallbacks

autoPrepareFields(self, *classes)

source code 

Automatically prepares the screen fields according to given class(es). Class <-> Field matching is done by looking at field's object names.

Parameters:
  • classes - Arbitrary number of classes whose metadata will be used to prepare the screen fields.

autoFillFields(self, instance)

source code 

Automatically fills the screen fields according to given instance. Instance <-> Field matching is done by looking at field's object names.

Parameters:
  • instance - Instance whose metadata will be used to fill the related fields on the screen.

createModelObject(self, klass)

source code 

Automatically creates an object of class class and assigns attributes using on screen information. Widget object names are used to discover class name and attributes.

Parameters:
  • klass - Class whose metadata will be used to create a model object.
Returns:
Newly created object

updateModelObject(self, obj)

source code 

Automatically updates an object obj and assigns attributes using on screen information. Widget object names are used to discover class name and attributes.

Parameters:
  • obj - Object which will be updated using on screen information
Returns:
Updated object

closeScreen(self, result=None)

source code 

Instructs the main window to close this screen. Any result is passed to main window.

Decorators:
  • @defer.inlineCallbacks