Package mcbase :: Package views :: Package main :: Module main :: Class Main
[hide private]
[frames] | no frames]

Class Main

source code


Main window (screen) for MOCOP.

Instance Methods [hide private]
 
__init__(self, parent)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
initScreenDeferred(self)
Initializes the screen, returns a deferred.
source code
 
periodicTask(self) source code
 
prepareToolBar(self)
Prepares the toolbar on top of screen.
source code
 
prepareMenu(self)
Prepares the menu on top of screen.
source code
 
actionHelp_triggered(self, checked=False)
When the actionHelp menu item is triggered.
source code
 
actionAbout_triggered(self, checked=False)
When the actionAbout menu item is triggered.
source code
 
actionLicense_triggered(self, checked=False)
When the actionLicense menu item is triggered.
source code
 
serverMsgReceived(self, cr)
Called when a message is received from server.
source code
 
serverConnectionLost(self)
Called when the connection to the server is gone.
source code
 
serverConnectionUp(self)
Called when the server connection is back again.
source code
 
msg_gui_refreshTable(self, tableCode)
Refreshes all the tables represented by tableCode.
source code
 
setAvailState(self)
Sets the main window's state as available.
source code
 
setBusyState(self)
Sets the main window's state as busy.
source code
 
setErrState(self)
Sets the main window's state as error.
source code
 
incRemoteCallCount(self)
Increases the number of remote calls by one and sets the main window state accordingly.
source code
 
decRemoteCallCount(self)
Decreases the number of remote calls by one and sets the main window state accordingly.
source code
 
prepareTabWidget(self)
Prepares the main tab widget used in main screen.
source code
 
topLeft_clicked(self) source code
 
topRight_clicked(self) source code
 
_addToStackTop(self, tabPage, pageWidget)
Adds a given wiget to the top of the stack of the given tab page.
source code
 
_removeFromStack(self, pageWidget)
Removes a given screen from its related stacked widget.
source code
 
_createStackedWidget(self, pageWidget)
Creates a stacked widget to be used in a tab page.
source code
 
_updateStackLabels(self, stackedWidget)
Updates the stack labels for a given stacked widget.
source code
 
openInNewTab(self, screenPath, *prm, **kw)
Creates a new tab and changes focus to it.
source code
 
openInCurrentTab(self, screenPath, *prm, **kw)
Loads the given screen in the current tab.
source code
 
closeScreen(self, screenID)
Closes the screen whose ID is given.
source code
 
closeCurrentTab(self)
Closes the current active tab.
source code
 
prepareScreen(self) source code
 
_deferredClose(self)
Deferred close method.
source code
 
closeEvent(self, e)
Method called just before widget close.
source code
 
retranslateUi(self, Main) (Inherited from mcbase.views.main.ui_main.Ui_Main) source code
 
setupUi(self, Main) (Inherited from mcbase.views.main.ui_main.Ui_Main) 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, parent)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

initScreenDeferred(self)

source code 

Initializes the screen, returns a deferred.

Decorators:
  • @defer.inlineCallbacks

serverMsgReceived(self, cr)

source code 

Called when a message is received from server.

Parameters:
  • cr (ClientRequest) - Client request object defining the server message

msg_gui_refreshTable(self, tableCode)

source code 

Refreshes all the tables represented by tableCode. tableCode has the following format: 'Screenname.TableName'

Parameters:
  • tableCode (str) - String defining a specific table
Decorators:
  • @defer.inlineCallbacks

prepareTabWidget(self)

source code 

Prepares the main tab widget used in main screen. Tab widget allows user to create seperate working screens.

_addToStackTop(self, tabPage, pageWidget)

source code 

Adds a given wiget to the top of the stack of the given tab page.

Parameters:
  • tabPage (QWidget) - Tab page widget
  • pageWidget (MCScreen) - Widget to be added to top of stack

_createStackedWidget(self, pageWidget)

source code 

Creates a stacked widget to be used in a tab page. The initial widget that will be in the stacked widget should be passed via pageWidget parameter

Parameters:
  • pageWidget (A class inherited from QWidget) - Initial widget that'll be added to the stacked widget
Returns:
A QWidget instance storing the newly created QStackedWidget instance.

_updateStackLabels(self, stackedWidget)

source code 

Updates the stack labels for a given stacked widget.

Parameters:
  • stackedWidget (QStackedWidget) - Stacked widget whose stack labels will be updated

openInNewTab(self, screenPath, *prm, **kw)

source code 

Creates a new tab and changes focus to it.

Parameters:
  • screenPath (str) - The screen path to be opened in the new tab.
Decorators:
  • @defer.inlineCallbacks

openInCurrentTab(self, screenPath, *prm, **kw)

source code 

Loads the given screen in the current tab. The screen is placed on top of the screen stack.

Parameters:
  • screenPath (str) - The screen path to be opened in the current tab.
Decorators:
  • @defer.inlineCallbacks

closeScreen(self, screenID)

source code 

Closes the screen whose ID is given.

Parameters:
  • screenID (str) - Unique ID of the screen to be closed.

closeCurrentTab(self)

source code 

Closes the current active tab. Calls the mayClose() method of the top level screen of the current tab.

prepareScreen(self)

source code 
Decorators:
  • @defer.inlineCallbacks

_deferredClose(self)

source code 

Deferred close method. Sleeps asynchoronously and then closes the program

Decorators:
  • @defer.inlineCallbacks

closeEvent(self, e)

source code 

Method called just before widget close. Defers the close event just about a second