Package client :: Module ToolBar :: Class ToolBar
[hide private]
[frames] | no frames]

Class ToolBar

source code


Overview

This class is the Basin Client's ToolBar. It has the ability to add and remove entire packages of actions from it at a time. It also stores these settings into a configuration file, so the same settings are persistent from use to use. Currently, all the packages that exist can be placed into the toolbar. They are as follows:

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QPaintDevice: PaintDeviceMetric

Instance Methods [hide private]
 
__init__(self, parent, bridge)
The initialization of ToolBar requires the parent object to be a QMainWindow, which it will embed itself in, and the bridge argument is the Bridge object which connects all of the interactive objects together.
source code
 
categories(self)
This method is used to get the names of all the categories, along with whether or not they are currently on your ToolBar.
source code
 
actions(self, category)
This method will return the list of actions under a given package taken from the string argument, category.
source code
 
clearSettings(self)
THis method quite simply removes all actions from the toolbar, regardless of anything.
source code
 
loadSettings(self)
When this method is called, the configuration file ~/.basin/client/menubar.conf is loaded and parsed.
source code
 
_parseSetting(self, key, value)
This method is called from loadSettings so that it can parse the ~/.basin/client/menubar.conf configuration file.
source code
 
addFileActions(self)
Adds all of the File actions from the toolbar.
source code
 
remFileActions(self)
Removes all of the File actions from the toolbar.
source code
 
addPlotActions(self)
Adds all of the Plot actions from the toolbar.
source code
 
remPlotActions(self)
Removes all of the Plot actions from the toolbar.
source code
 
addCosmologyActions(self)
Adds all of the Cosmology actions from the toolbar.
source code
 
remCosmologyActions(self)
Removes all of the Cosmology actions from the toolbar.
source code
 
addTransformationActions(self)
Adds all of the Transformation actions from the toolbar.
source code
 
remTransformationActions(self)
Removes all of the Transformation actions from the toolbar.
source code
 
addStellarDynamicsActions(self)
Adds all of the Stellar Dynamics actions from the toolbar.
source code
 
remStellarDynamicsActions(self)
Removes all of the Stellar Dynamics actions from the toolbar.
source code
 
addStatisticsActions(self)
Adds all of the Statistics actions from the toolbar.
source code
 
remStatisticsActions(self)
Removes all of the Statistics actions from the toolbar.
source code
 
addGeneralFunctionsActions(self)
Adds all of the General Functions actions from the toolbar.
source code
 
remGeneralFunctionsActions(self)
Removes all of the General Functions actions from the toolbar.
source code
 
addLinearAlgebraActions(self)
Adds all of the Linear Algebra actions from the toolbar.
source code
 
remLinearAlgebraActions(self)
Removes all of the Linear Algebra actions from the toolbar.
source code
 
addHelpActions(self)
Adds all of the Help actions from the toolbar.
source code
 
remHelpActions(self)
Removes all of the Help actions from the toolbar.
source code

Inherited from PyQt4.QtGui.QToolBar: actionAt, actionEvent, actionGeometry, addAction, addSeparator, addWidget, allowedAreas, changeEvent, childEvent, clear, closeEvent, connectNotify, contextMenuEvent, create, customEvent, destroy, disconnectNotify, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, enabledChange, enterEvent, event, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPreviousChild, fontChange, hideEvent, iconSize, inputMethodEvent, insertSeparator, insertWidget, isAreaAllowed, isMovable, keyPressEvent, keyReleaseEvent, languageChange, leaveEvent, metric, mouseDoubleClickEvent, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, moveEvent, orientation, paintEvent, paletteChange, receivers, resetInputContext, resizeEvent, sender, setAllowedAreas, setIconSize, setMovable, setOrientation, setToolButtonStyle, showEvent, tabletEvent, timerEvent, toggleViewAction, toolButtonStyle, updateMicroFocus, wheelEvent, widgetForAction, windowActivationChange

Inherited from PyQt4.QtGui.QWidget: acceptDrops, activateWindow, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, contentsRect, contextMenuPolicy, cursor, devType, ensurePolished, find, focusPolicy, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabShortcut, handle, hasFocus, hasMouseTracking, height, heightForWidth, hide, inputContext, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isEnabledToTLW, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isTopLevel, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, layout, layoutDirection, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseGrabber, move, nextInFocusChain, normalGeometry, overrideWindowFlags, overrideWindowState, paintEngine, palette, parentWidget, pos, raise_, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, repaint, resize, restoreGeometry, saveGeometry, scroll, setAcceptDrops, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedWidth, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setMask, setMaximumHeight, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setShortcutAutoRepeat, setShortcutEnabled, setShown, setSizeIncrement, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowTitle, show, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, testAttribute, toolTip, topLevelWidget, underMouse, unsetCursor, unsetLayoutDirection, update, updateGeometry, updatesEnabled, visibleRegion, whatsThis, width, winId, window, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, x, x11Info, x11PictureHandle, y

Inherited from PyQt4.QtCore.QObject: blockSignals, children, connect, deleteLater, disconnect, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setProperty, signalsBlocked, startTimer, thread, tr, trUtf8

Inherited from PyQt4.QtGui.QPaintDevice: depth, heightMM, logicalDpiX, logicalDpiY, numColors, paintingActive, physicalDpiX, physicalDpiY, widthMM

Inherited from sip.wrapper: __delattr__, __getattribute__, __new__, __setattr__

Inherited from object: __hash__, __reduce__, __reduce_ex__, __repr__, __str__

Class Variables [hide private]

Inherited from PyQt4.QtGui.QPaintDevice: PdmDepth, PdmDpiX, PdmDpiY, PdmHeight, PdmHeightMM, PdmNumColors, PdmPhysicalDpiX, PdmPhysicalDpiY, PdmWidth, PdmWidthMM

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent, bridge)
(Constructor)

source code 

Overview

The initialization of ToolBar requires the parent object to be a QMainWindow, which it will embed itself in, and the bridge argument is the Bridge object which connects all of the interactive objects together.

For each individual package of actions, this will take a list of references to each action from the bridge._actions object. This makes adding & deleting a group of actions to the toolbar as easy as iterating over a list.

Overrides: object.__init__

categories(self)

source code 

Overview

This method is used to get the names of all the categories, along with whether or not they are currently on your ToolBar. This is useful for reporting to the Preferences modules which ones are currently selected.

Returns:
This method will return a list of 2 element lists. Each inner 2 element list contains a string name, which is the package of actions, and then a boolean which is True if the package is being displayed in the ToolBar, False if not.

actions(self, category)

source code 

Overview

This method will return the list of actions under a given package taken from the string argument, category. This allows you to gather all of the actions in one fell swoop when you simply know the name of a package.

Parameters:
  • category (string) - The name of a package you want to retrieve the actions for.
Overrides: PyQt4.QtGui.QWidget.actions

clearSettings(self)

source code 

Overview

THis method quite simply removes all actions from the toolbar, regardless of anything. This is useful for getting hte toolbar back to a default state, especially to avoid adding a package twice to the ToolBar.

loadSettings(self)

source code 

Overview

When this method is called, the configuration file ~/.basin/client/menubar.conf is loaded and parsed. The configuration file should explicitly set or remove all packages from the toolbar. This will make use of the _parseSetting method which actually handles the adding or removal of the toolbar buttons.

_parseSetting(self, key, value)

source code 

Overview

This method is called from loadSettings so that it can parse the ~/.basin/client/menubar.conf configuration file. The format is quite simple:

PACKAGENAME:True|False

This method will end up calling the methods to add or remove the actions from the toolbar. No harm will come from removing a package from the toolbar that isn't on it currently.

Parameters:
  • key (string) - An all caps representation of a package for Basin. I.e. "FILE", "STELLARDYNAMICS", "HELP"...
  • value (string) - Either "True" for a package that should be drawn to the toolbar, or anything else for false

addFileActions(self)

source code 

Overview

Adds all of the File actions from the toolbar. Actions may be added multiple times, though this would never be useful.

remFileActions(self)

source code 

Overview

Removes all of the File actions from the toolbar. There is no harm in attempting to remove a package not currently on the toolbar.

addPlotActions(self)

source code 

Overview

Adds all of the Plot actions from the toolbar. Actions may be added multiple times, though this would never be useful.

remPlotActions(self)

source code 

Overview

Removes all of the Plot actions from the toolbar. There is no harm in attempting to remove a package not currently on the toolbar.

addCosmologyActions(self)

source code 

Overview

Adds all of the Cosmology actions from the toolbar. Actions may be added multiple times, though this would never be useful.

remCosmologyActions(self)

source code 

Overview

Removes all of the Cosmology actions from the toolbar. There is no harm in attempting to remove a package not currently on the toolbar.

addTransformationActions(self)

source code 

Overview

Adds all of the Transformation actions from the toolbar. Actions may be added multiple times, though this would never be useful.

remTransformationActions(self)

source code 

Overview

Removes all of the Transformation actions from the toolbar. There is no harm in attempting to remove a package not currently on the toolbar.

addStellarDynamicsActions(self)

source code 

Overview

Adds all of the Stellar Dynamics actions from the toolbar. Actions may be added multiple times, though this would never be useful.

remStellarDynamicsActions(self)

source code 

Overview

Removes all of the Stellar Dynamics actions from the toolbar. There is no harm in attempting to remove a package not currently on the toolbar.

addStatisticsActions(self)

source code 

Overview

Adds all of the Statistics actions from the toolbar. Actions may be added multiple times, though this would never be useful.

remStatisticsActions(self)

source code 

Overview

Removes all of the Statistics actions from the toolbar. There is no harm in attempting to remove a package not currently on the toolbar.

addGeneralFunctionsActions(self)

source code 

Overview

Adds all of the General Functions actions from the toolbar. Actions may be added multiple times, though this would never be useful.

remGeneralFunctionsActions(self)

source code 

Overview

Removes all of the General Functions actions from the toolbar. There is no harm in attempting to remove a package not currently on the toolbar.

addLinearAlgebraActions(self)

source code 

Overview

Adds all of the Linear Algebra actions from the toolbar. Actions may be added multiple times, though this would never be useful.

remLinearAlgebraActions(self)

source code 

Overview

Removes all of the Linear Algebra actions from the toolbar. There is no harm in attempting to remove a package not currently on the toolbar.

addHelpActions(self)

source code 

Overview

Adds all of the Help actions from the toolbar. Actions may be added multiple times, though this would never be useful.

remHelpActions(self)

source code 

Overview

Removes all of the Help actions from the toolbar. There is no harm in attempting to remove a package not currently on the toolbar.