BaseMainWindow

Author:Neil Wallace (neil@openmolar.com)
Release:2.0.906~hg207

The BaseMainWindow class provides a re-implementation of QtGui.QMainWindow, but which handles state saving accross sesions etc.

Inherited by PostgresMainWindow

methods and attributes

class lib_openmolar.common.qt4.widgets.main_window.BaseMainWindow(parent=None)[source]

Bases: PyQt4.QtGui.QMainWindow, lib_openmolar.common.qt4.widgets.advisor_notification.Advisor

This class is a MainWindow, with menu, toolbar and statusbar. Some of the layout signals/slots already connected. Provides about, about QT and license dialogs.

__init__(parent=None)[source]
action_about = None

a pointer to the about qaction

action_about_qt = None

a pointer to the about qt qaction

action_fullscreen = None

a pointer to the fullscreen mode qaction

action_help = None

a pointer to the help qaction

action_license = None

a pointer to the license qaction

action_preferences = None

a pointer to the preferences qAction

action_quit = None

a pointer to the quit qaction

action_show_statusbar = None

a pointer to the show statusbar qaction

addToolBar(*args)[source]
closeEvent(event=None)[source]

re-implement the close event of QtGui.QMainWindow, and check the user really meant to do this.

connect_default_signals()[source]

this function connects the triggered signals from the default menu it should not need to be called, as it is called during the __init__()

excepthook(exc_type, exc_val, tracebackobj)[source]

PyQt4 prints unhandled exceptions to stdout and carries on regardless I don’t want this to happen. so sys.excepthook is passed to this

fullscreen()[source]
get_confirm(message, accept='ok', reject='cancel', default='accept')[source]

a convenience function to raise a dialog for confirmation of an action

help_toolbar = None
insertMenu_(menu)[source]

a convenience function that slots new actions in just before the “help” menu item on the menubar

insertToolBar(*args)[source]
insertToolBarWidget(action, sep=False)[source]

a convenience function that slots new widgets in just before the “help” menu item on the main Toolbar. accepts either a QAction, or a widget. If option 2nd argument (sep) is True, a separator is also added.

loadSettings()[source]

load settings from QtCore.QSettings.

log = <logging.RootLogger object at 0x2921510>
main_toolbar = None

a pointer to the main toolbar

menu_edit = None

a pointer to the Edit menu

menu_file = None

a pointer to the File menu

menu_help = None

a pointer to the Help menu

menu_view = None

a pointer to the View menu of menubar

menubar = None

a pointer to the DockableMenuBar

reimplement_needed(func_name)[source]
resizeEvent(event)[source]

this function is overwritten so that the advisor popup can be put in the correct place

saveSettings()[source]

save settings from QtCore.QSettings

setBriefMessageLocation()[source]

make the Advisor sub class aware of the windows geometry. set it top right, and right_to_left

show_about()[source]
show_help()[source]
show_license()[source]

attempts to read and show the license text from file COPYRIGHT.txt in the apps directory on failure, gives a simple message box with link.

show_preferences_dialog()[source]
show_statusbar()[source]
show_toolbar()[source]
status_label = None

a pointer to the label in the statusbar

statusbar = None

a pointer to the QtGui.QStatusBar

toolbar_list[source]

yield all toolbars of the application

Table Of Contents

Previous topic

BaseDialog

Next topic

CSV_Writer