CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Attributes | Private Attributes
Vispa.Main.TabController.TabController Class Reference
Inheritance diagram for Vispa.Main.TabController.TabController:
Vispa.Plugins.Browser.BrowserTabController.BrowserTabController Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController

Public Member Functions

def __init__
 
def activated
 
def addUndoEvent
 
def allowClose
 
def allowSelectAll
 
def cancel
 
def checkModificationTimestamp
 
def close
 
def copy
 
def cut
 
def dumpUndoEvents
 
def enableUndo
 
def filename
 
def find
 
def getFileBasename
 
def isCopyPasteEnabled
 
def isEditable
 
def isFindEnabled
 
def isModified
 
def open
 
def paste
 
def plugin
 
def readFile
 
def redo
 
def redoEvents
 
def refresh
 
def resetZoomButtonPressedBefore
 
def save
 
def selectAll
 
def setAllowSelectAll
 
def setCopyPasteEnabled
 
def setEditable
 
def setFilename
 
def setFindEnabled
 
def setLastSavedStateEvent
 
def setModified
 
def setTab
 
def setZoom
 
def staticSupportedFileTypes
 
def supportedFileFilters
 
def supportedFileTypes
 
def supportsUndo
 
def tab
 
def undo
 
def undoEvents
 
def updateContent
 
def updateLabel
 
def writeFile
 
def zoom
 
def zoomAll
 
def zoomChanged
 
def zoomDialog
 
def zoomHundred
 
def zoomUser
 

Static Public Attributes

tuple staticSupportedFileTypes = staticmethod(staticSupportedFileTypes)
 
int TAB_LABEL_MAX_LENGTH = 20
 

Private Attributes

 _allowSelectAllFlag
 
 _copyPasteEnabledFlag
 
 _fileModifcationTimestamp
 
 _fileModifiedFlag
 
 _filename
 
 _findEnabledFlag
 
 _isEditableFlag
 
 _plugin
 
 _redoEvents
 
 _showingModifiedMessageFlag
 
 _supportsUndo
 
 _tab
 
 _undoEvents
 
 _userZoomLevel
 
 _zoomButtonPressedBeforeFlag
 

Detailed Description

Base class for all tab controllers.

Tab controllers control the functionality of plugin tabs.

Definition at line 11 of file TabController.py.

Constructor & Destructor Documentation

def Vispa.Main.TabController.TabController.__init__ (   self,
  plugin 
)

Definition at line 19 of file TabController.py.

19 
20  def __init__(self, plugin):
21  QObject.__init__(self)
22  logging.debug(__name__ + ": __init__")
23  self._plugin = plugin
24  self._fileModifiedFlag = False
25  self._isEditableFlag = True
26  self._tab = None
27  self._filename = None
28  self._copyPasteEnabledFlag = False
29  self._allowSelectAllFlag = False
30  self._findEnabledFlag = False
31  self._userZoomLevel = 100
35  self._supportsUndo = False
36  self._undoEvents = []
37  self._redoEvents = []

Member Function Documentation

def Vispa.Main.TabController.TabController.activated (   self)
Called by application when tab is activated in tabWidget.

This function should be overwritten if special treatment on tab selection is required.

Definition at line 365 of file TabController.py.

366  def activated(self):
367  """ Called by application when tab is activated in tabWidget.
368 
369  This function should be overwritten if special treatment on tab selection is required.
370  """
371  pass
def Vispa.Main.TabController.TabController.addUndoEvent (   self,
  undoEvent 
)
Adds event of type UndoEvent to this tab controller's list of undoable events.

Undo can be invoked by calling undo().

Definition at line 542 of file TabController.py.

References Vispa.Main.TabController.TabController._redoEvents, Vispa.Main.TabController.TabController._supportsUndo, Vispa.Main.TabController.TabController._undoEvents, Vispa.Main.TabController.TabController.isModified(), PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), Vispa.Main.Application.Application.plugin(), and Vispa.Main.TabController.TabController.setLastSavedStateEvent().

543  def addUndoEvent(self, undoEvent):
544  """ Adds event of type UndoEvent to this tab controller's list of undoable events.
545 
546  Undo can be invoked by calling undo().
547  """
548  if self._supportsUndo:
549  if not isinstance(undoEvent, UndoEvent):
550  logging.error("%s: Tried to add non-UndoEvent to list of undo events. Aborting..." % self.__class__.__name__)
551  return
552  self._redoEvents = []
553  no_of_events = len(self._undoEvents)
554  # try to combine similar events
555  if no_of_events < 1 or not self._undoEvents[no_of_events -1].combine(undoEvent):
556  self._undoEvents.append(undoEvent)
557  if not self.isModified():
558  self.setLastSavedStateEvent(undoEvent)
559  self.plugin().application().updateMenu()
560  else:
561  logging.warning("%s: Tried to add undo event, however undo functionality is not enabled. Aborting..." % self.__class__.__name__)
562  #self.dumpUndoEvents()
def Vispa.Main.TabController.TabController.allowClose (   self)

Definition at line 271 of file TabController.py.

References Vispa.Main.TabController.TabController.isEditable(), Vispa.Main.TabController.TabController.isModified(), PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), Vispa.Main.Application.Application.plugin(), l1t::WriterProxy.save(), TkHistoMap.save(), l1t::WriterProxyT< Record, Type >.save(), NuclearInteractionSimulator.save(), PiecewiseScalingPolynomial.save(), HBHENegativeEFilter.save(), MaterialEffects.save(), HBHEChannelGroups.save(), MaterialEffectsSimulator.save(), TrackerMap.save(), CommissioningHistograms.save(), OOTPileupCorrData.save(), Vispa.Main.TabController.TabController.save(), svgfig.SVG.save(), and DQMStore.save().

Referenced by Vispa.Main.TabController.TabController.close().

272  def allowClose(self):
273  if self.isEditable() and self.isModified():
274  messageResult = self.plugin().application().showMessageBox("The document has been modified.",
275  "Do you want to save your changes?",
276  QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel,
277  QMessageBox.Save)
278 
279  if messageResult == QMessageBox.Save:
280  if not self.save():
281  return False
282  elif messageResult == QMessageBox.Cancel:
283  return False
284  return True
def Vispa.Main.TabController.TabController.allowSelectAll (   self)
Evaluates the sllowSelectAll flag.

Definition at line 188 of file TabController.py.

References Vispa.Main.TabController.TabController._allowSelectAllFlag.

189  def allowSelectAll(self):
190  """ Evaluates the sllowSelectAll flag.
191  """
192  return self._allowSelectAllFlag
def Vispa.Main.TabController.TabController.cancel (   self)
Cancel all operations in tab.

This function is called when all current operations in tab shall be canceled.

Definition at line 512 of file TabController.py.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.close(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.first(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.goto(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.last(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.next(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.previous(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.readFile(), Vispa.Views.TreeView.TreeView.updateContent(), Vispa.Views.LineDecayView.LineDecayView.updateContent(), Vispa.Views.TableView.TableView.updateContent(), Vispa.Views.BoxDecayView.BoxDecayView.updateContent(), and Vispa.Views.PropertyView.PropertyView.updateContent().

513  def cancel(self):
514  """ Cancel all operations in tab.
515 
516  This function is called when all current operations in tab shall be canceled.
517  """
518  pass
def Vispa.Main.TabController.TabController.checkModificationTimestamp (   self)
Compares the actual modification timestamp of self.filename() to the modification at opening or last save operation.

This function is called by Application when the tab associated with this controller was activated.
If modification timestamps differ the refresh() method is called.

Definition at line 312 of file TabController.py.

References Vispa.Main.TabController.TabController._fileModifcationTimestamp, Vispa.Main.TabController.TabController._filename, DQMIO2histo.DQMIO._filename, MuonGeometryArrange._filename, TrackerGeometryCompare._filename, Vispa.Main.TabController.TabController._showingModifiedMessageFlag, Vispa.Main.TabController.TabController.isEditable(), cond::IOVProxyData.refresh(), cond::BasePayloadProxy.refresh(), cond::IOVProxy.refresh(), MELaserPrim.refresh(), Vispa.Main.TabController.TabController.refresh(), l1t::WriterProxy.save(), TkHistoMap.save(), l1t::WriterProxyT< Record, Type >.save(), NuclearInteractionSimulator.save(), PiecewiseScalingPolynomial.save(), HBHENegativeEFilter.save(), MaterialEffects.save(), HBHEChannelGroups.save(), MaterialEffectsSimulator.save(), TrackerMap.save(), CommissioningHistograms.save(), OOTPileupCorrData.save(), Vispa.Main.TabController.TabController.save(), svgfig.SVG.save(), DQMStore.save(), and Vispa.Main.TabController.TabController.setModified().

313  def checkModificationTimestamp(self):
314  """ Compares the actual modification timestamp of self.filename() to the modification at opening or last save operation.
315 
316  This function is called by Application when the tab associated with this controller was activated.
317  If modification timestamps differ the refresh() method is called.
318  """
319  if not self._filename or self._fileModifcationTimestamp == 0:
320  return
321 
322  msgBox = None
323  if not os.path.exists(self._filename):
324  logging.debug(self.__class__.__name__ + ": checkModificationTimestamp() - File was removed.")
326  msgBox = QMessageBox()
327  msgBox.setText("The file was removed.")
328  if self.isEditable():
329  msgBox.setInformativeText("Do you want to save the file with your version?")
330  saveButton = msgBox.addButton("Save", QMessageBox.ActionRole)
331  ignoreButton = msgBox.addButton("Ignore", QMessageBox.RejectRole)
332  else:
333  ignoreButton = msgBox.addButton("OK", QMessageBox.RejectRole)
334  reloadButton = None
335 
336  elif self._fileModifcationTimestamp != os.path.getmtime(self._filename):
337  logging.debug(self.__class__.__name__ + ": checkModificationTimestamp() - File was modified.")
338  msgBox = QMessageBox()
339  msgBox.setText("The file has been modified.")
340  if self.isEditable():
341  msgBox.setInformativeText("Do you want to overwrite the file with your version or reload the file?")
342  saveButton = msgBox.addButton("Overwrite", QMessageBox.ActionRole)
343  else:
344  msgBox.setInformativeText("Do you want to reload the file?")
345  reloadButton = msgBox.addButton("Reload", QMessageBox.DestructiveRole)
346  ignoreButton = msgBox.addButton("Ignore", QMessageBox.RejectRole)
347 
348  if msgBox and not self._showingModifiedMessageFlag:
349  self.setModified()
351  msgBox.exec_()
352  self._showingModifiedMessageFlag=False
353 
354  if self.isEditable() and msgBox.clickedButton() == saveButton:
355  self.save()
356  elif msgBox.clickedButton() == reloadButton:
357  self.refresh()
358  self.setModified(False)
359  elif msgBox.clickedButton() == ignoreButton and os.path.exists(self._filename):
360  self._fileModifcationTimestamp = os.path.getmtime(self._filename)
361 
362  else:
363  #logging.debug(self.__class__.__name__ + ": checkModificationTimestamp() - File was not modified.")
364  pass
def Vispa.Main.TabController.TabController.close (   self)
Asks user if he wants to save potentially unsaved data and closes the tab. 

This function usually does not need to be overwritten by a PluginTab.

Definition at line 285 of file TabController.py.

References Vispa.Main.TabController.TabController.allowClose(), Vispa.Main.TabController.TabController.tab(), and RawParticle.tab.

Referenced by lumiQTWidget.ApplicationWindow.fileQuit(), esMonitoring.AsyncLineReaderMixin.handle_close(), esMonitoring.FDJsonServer.handle_close(), Vispa.Gui.BoxContentDialog.BoxContentDialog.keyPressEvent(), and Vispa.Gui.FindDialog.FindDialog.keyPressEvent().

286  def close(self):
287  """ Asks user if he wants to save potentially unsaved data and closes the tab.
288 
289  This function usually does not need to be overwritten by a PluginTab.
290  """
291  allowClose = self.allowClose()
292  if allowClose:
293  if self.tab().tabWidget():
294  self.tab().tabWidget().removeTab(self.tab().tabWidget().indexOf(self.tab()))
295  #if self.tab() in self.tab().mainWindow()._tabWindows:
296  # self.tab().mainWindow()._tabWindows.remove(self.tab())
297  self.tab().close()
298  # no effect?
299  #self._tab.deleteLater()
300  #self._tab = None
301  return allowClose
def Vispa.Main.TabController.TabController.copy (   self)
Handle copy event.

This function is called if the user selects 'Copy' from menu. PluginTabs should override it if needed.
See also setCopyPasteEnabled(), isCopyPasteEnabled().

Definition at line 380 of file TabController.py.

381  def copy(self):
382  """ Handle copy event.
383 
384  This function is called if the user selects 'Copy' from menu. PluginTabs should override it if needed.
385  See also setCopyPasteEnabled(), isCopyPasteEnabled().
386  """
387  raise NotImplementedError
def Vispa.Main.TabController.TabController.cut (   self)
Handle cut event.

This function is called if the user selects 'Cut' from menu. PluginTabs should override it if needed.
See also setCopyPasteEnabled(), isCopyPasteEnabled().

Definition at line 372 of file TabController.py.

373  def cut(self):
374  """ Handle cut event.
375 
376  This function is called if the user selects 'Cut' from menu. PluginTabs should override it if needed.
377  See also setCopyPasteEnabled(), isCopyPasteEnabled().
378  """
379  raise NotImplementedError
def Vispa.Main.TabController.TabController.dumpUndoEvents (   self)

Definition at line 631 of file TabController.py.

References Vispa.Main.TabController.TabController._redoEvents, and Vispa.Main.TabController.TabController._undoEvents.

632  def dumpUndoEvents(self):
633  for event in self._undoEvents:
634  event.dump("undo")
635  for event in self._redoEvents:
636  event.dump("redo")
def Vispa.Main.TabController.TabController.enableUndo (   self,
  enable = True 
)
If enable is True this controller enables its undo function.

For any tab controller that wants to use this feature, it needs to be made sure the corresponding UndoEvents
for actions that should be undoable exists and are added by addUndoEvent().

Definition at line 524 of file TabController.py.

References Vispa.Main.TabController.TabController._supportsUndo.

525  def enableUndo(self, enable=True):
526  """ If enable is True this controller enables its undo function.
527 
528  For any tab controller that wants to use this feature, it needs to be made sure the corresponding UndoEvents
529  for actions that should be undoable exists and are added by addUndoEvent().
530  """
531  self._supportsUndo = enable
def Vispa.Main.TabController.TabController.filename (   self)
Returns filename of this tab.

Definition at line 79 of file TabController.py.

References Vispa.Main.TabController.TabController._filename, DQMIO2histo.DQMIO._filename, MuonGeometryArrange._filename, and TrackerGeometryCompare._filename.

Referenced by cuy.ValElement.__init__(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.properties().

79 
80  def filename(self):
81  """ Returns filename of this tab.
82  """
83  return self._filename
def Vispa.Main.TabController.TabController.find (   self)
Handle find event.

This function is called if the user selects 'Find' from menu. PluginTabs should override it if needed."
See also setFindEnabled(), isFindEnabled().

Definition at line 396 of file TabController.py.

397  def find(self):
398  """ Handle find event.
399 
400  This function is called if the user selects 'Find' from menu. PluginTabs should override it if needed."
401  See also setFindEnabled(), isFindEnabled().
402  """
403  raise NotImplementedError
def Vispa.Main.TabController.TabController.getFileBasename (   self)
Returns the basename of this tab's filename.

Part of filename after last /.

Definition at line 84 of file TabController.py.

References Vispa.Main.TabController.TabController._filename, DQMIO2histo.DQMIO._filename, MuonGeometryArrange._filename, and TrackerGeometryCompare._filename.

84 
85  def getFileBasename(self):
86  """ Returns the basename of this tab's filename.
87 
88  Part of filename after last /.
89  """
90  return os.path.basename(self._filename)
def Vispa.Main.TabController.TabController.isCopyPasteEnabled (   self)
Return True if the copyPasteFlag is set.

See setCopyPasteEnabled(), cut(), copy(), paste().

Definition at line 98 of file TabController.py.

References Vispa.Main.TabController.TabController._copyPasteEnabledFlag.

98 
99  def isCopyPasteEnabled(self):
100  """ Return True if the copyPasteFlag is set.
101 
102  See setCopyPasteEnabled(), cut(), copy(), paste().
103  """
104  return self._copyPasteEnabledFlag
def Vispa.Main.TabController.TabController.isEditable (   self)
Evaluates the file Editable flag.

Definition at line 177 of file TabController.py.

References Vispa.Main.TabController.TabController._isEditableFlag.

Referenced by Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.activated(), Vispa.Main.TabController.TabController.allowClose(), Vispa.Main.TabController.TabController.checkModificationTimestamp(), Vispa.Main.TabController.TabController.setModified(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.switchCenterView().

178  def isEditable(self):
179  """ Evaluates the file Editable flag.
180  """
181  return self._isEditableFlag
def Vispa.Main.TabController.TabController.isFindEnabled (   self)
Returns True if findEnabledFlag is set.

See setFindEnabled(), find().

Definition at line 112 of file TabController.py.

References Vispa.Main.TabController.TabController._findEnabledFlag.

113  def isFindEnabled(self):
114  """Returns True if findEnabledFlag is set.
115 
116  See setFindEnabled(), find().
117  """
118  return self._findEnabledFlag
def Vispa.Main.TabController.TabController.isModified (   self)
Evaluates the file Modified flag. Always returns True if no filename is set.

Definition at line 165 of file TabController.py.

References Vispa.Main.TabController.TabController._fileModifiedFlag.

Referenced by Vispa.Main.TabController.TabController.addUndoEvent(), Vispa.Main.TabController.TabController.allowClose(), and Vispa.Main.TabController.TabController.updateLabel().

166  def isModified(self):
167  """ Evaluates the file Modified flag. Always returns True if no filename is set.
168  """
169  return self._fileModifiedFlag
def Vispa.Main.TabController.TabController.open (   self,
  filename = None,
  update = True 
)
Open given file.

Definition at line 193 of file TabController.py.

References Vispa.Main.TabController.TabController._filename, DQMIO2histo.DQMIO._filename, MuonGeometryArrange._filename, TrackerGeometryCompare._filename, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), Vispa.Main.Application.Application.plugin(), SurveyDataReader.readFile(), SurveyInputTextReader.readFile(), DeviationsFromFileSensor2D.readFile(), edm::IEventProcessor.readFile(), edm::InputSource.readFile(), edm::EventProcessor.readFile(), Vispa.Main.TabController.TabController.readFile(), DQMStore.readFile(), Vispa.Main.TabController.TabController.setFilename(), Vispa.Main.TabController.TabController.updateContent(), and Vispa.Main.TabController.TabController.updateLabel().

Referenced by Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.importConfig().

194  def open(self, filename=None, update=True):
195  """ Open given file.
196  """
197  logging.debug(self.__class__.__name__ + ": open()")
198 
199  statusMessage = self.plugin().application().startWorking("Opening file " + filename)
200 
201  if filename == None:
202  if self._filename:
203  filename = self._filename
204  else:
205  self.plugin().application().stopWorking(statusMessage, "failed")
206  return False
207 
208  if self.readFile(filename):
209  self.setFilename(filename)
210  self.updateLabel()
211  if update:
212  self.updateContent()
213  self.plugin().application().stopWorking(statusMessage)
214  return True
215 
216  self.plugin().application().stopWorking(statusMessage, "failed")
217  return False
def Vispa.Main.TabController.TabController.paste (   self)
Handle paste event.

This function is called if the user selects 'Paste' from menu. PluginTabs should override it if needed."
See also setCopyPasteEnabled(), isCopyPasteEnabled().

Definition at line 388 of file TabController.py.

389  def paste(self):
390  """ Handle paste event.
391 
392  This function is called if the user selects 'Paste' from menu. PluginTabs should override it if needed."
393  See also setCopyPasteEnabled(), isCopyPasteEnabled().
394  """
395  raise NotImplementedError
def Vispa.Main.TabController.TabController.plugin (   self)
Returns the plugin reference, set by setPlugin().

Definition at line 57 of file TabController.py.

References Vispa.Main.TabController.TabController._plugin.

Referenced by Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.activated(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.activated(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.activated(), Vispa.Main.TabController.TabController.addUndoEvent(), Vispa.Main.TabController.TabController.allowClose(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.centerViewMenuButtonClicked(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.centerViewMenuButtonClicked(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.codeSelected(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.currentCenterViewClassId(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.dumpPython(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.enableCenterViewSelectionMenu(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.eventContent(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.exportDot(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.goto(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.history(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.importConfig(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.loadIni(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.loadIni(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.loadIni(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.onSelected(), Vispa.Main.TabController.TabController.open(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.readFile(), Vispa.Main.TabController.TabController.redo(), Vispa.Main.TabController.TabController.refresh(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.removeButtonClicked(), Vispa.Main.TabController.TabController.save(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.save(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.saveIni(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.saveIni(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.saveIni(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.select(), Vispa.Main.TabController.TabController.setAllowSelectAll(), Vispa.Main.TabController.TabController.setEditable(), Vispa.Main.TabController.TabController.setModified(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.startEditMode(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.switchCenterView(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.treeViewMenuButtonClicked(), Vispa.Main.TabController.TabController.undo(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.updateCenterView(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.updateCenterView(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.updateContent(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.updateEventNumberDisplay(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.updateViewMenu(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.updateViewMenu().

57 
58  def plugin(self):
59  """ Returns the plugin reference, set by setPlugin().
60  """
61  return self._plugin
def Vispa.Main.TabController.TabController.readFile (   self,
  filename 
)
This function performs the actual reading of a file. It should be overwritten by any PluginTab which inherits Tab.
If the reading was successful True should be returned.
The file should be read from the file given in the argument filename not to the one in self._filename.

Definition at line 218 of file TabController.py.

Referenced by Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate(), Vispa.Main.TabController.TabController.open(), and Vispa.Main.TabController.TabController.refresh().

219  def readFile(self, filename):
220  """
221  This function performs the actual reading of a file. It should be overwritten by any PluginTab which inherits Tab.
222  If the reading was successful True should be returned.
223  The file should be read from the file given in the argument filename not to the one in self._filename.
224  """
225  raise NotImplementedError
def Vispa.Main.TabController.TabController.redo (   self,
  numberOfEvents = 1 
)

Definition at line 588 of file TabController.py.

References Vispa.Main.TabController.TabController._redoEvents, Vispa.Main.TabController.TabController._supportsUndo, Vispa.Main.TabController.TabController._undoEvents, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), Vispa.Main.Application.Application.plugin(), and Vispa.Main.TabController.TabController.setModified().

589  def redo(self, numberOfEvents=1):
590  if not self._supportsUndo:
591  logging.warning(self.__class__.__name__ + ": Tried to undo action, however undo functionality is not enabled. Aborting...")
592  return
593  logging.debug(self.__class__.__name__ +": redo("+ str(numberOfEvents) +")")
594  #self.dumpUndoEvents()
595 
596  for i in range(0, numberOfEvents):
597  if len(self._redoEvents) > 0:
598  lastEvent = self._redoEvents.pop()
599  lastEvent.redo()
600  self._undoEvents.append(lastEvent)
601 
602  # set modification flag
603  if i == (numberOfEvents -1):
604  undo_events_count = len(self._redoEvents)
605  if undo_events_count > 0:
606  if self._redoEvents[undo_events_count-1].isLastSavedState():
607  self.setModified(False)
608  else:
609  self.setModified()
610  else:
611  # if there are no more redo events
612  # and there is no event with last saved state flag set to True
613  # no action was performed since the last save
614  # and thus modification flag should be False
615  modified = False
616  for event in self._undoEvents + self._redoEvents:
617  if event.isLastSavedState():
618  modified = True
619  break
620  self.setModified(modified)
621  self.plugin().application().updateMenu()
def Vispa.Main.TabController.TabController.redoEvents (   self)
Returns list of all UndoEvents that have already been undone before.

Definition at line 537 of file TabController.py.

References Vispa.Main.TabController.TabController._redoEvents.

538  def redoEvents(self):
539  """ Returns list of all UndoEvents that have already been undone before.
540  """
541  return self._redoEvents
def Vispa.Main.TabController.TabController.refresh (   self)
Reloads file content and refreshes tab.

May be implemented by inheriting controllers.

Definition at line 490 of file TabController.py.

References Vispa.Main.TabController.TabController._fileModifcationTimestamp, Vispa.Main.TabController.TabController._filename, DQMIO2histo.DQMIO._filename, MuonGeometryArrange._filename, TrackerGeometryCompare._filename, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), Vispa.Main.Application.Application.plugin(), SurveyDataReader.readFile(), SurveyInputTextReader.readFile(), DeviationsFromFileSensor2D.readFile(), edm::IEventProcessor.readFile(), edm::InputSource.readFile(), edm::EventProcessor.readFile(), Vispa.Main.TabController.TabController.readFile(), DQMStore.readFile(), and Vispa.Main.TabController.TabController.updateContent().

Referenced by Vispa.Main.TabController.TabController.checkModificationTimestamp().

491  def refresh(self):
492  """ Reloads file content and refreshes tab.
493 
494  May be implemented by inheriting controllers.
495  """
496  statusMessage = self.plugin().application().startWorking("Reopening file")
497  self._fileModifcationTimestamp = os.path.getmtime(self._filename)
498  self.readFile(self._filename)
499  self.updateContent()
500  self.plugin().application().stopWorking(statusMessage)
def Vispa.Main.TabController.TabController.resetZoomButtonPressedBefore (   self)
Sets the zoom button pressed before flag to False.

If the flag is set functions handling the zoom toolbar buttons (zoomHundred(), zoomAll()) wont store the last zoom factor. The flag is set to true by these functions.
By this mechanism the user can click the zoom buttons several times and will still be able to return to his orignal zoom level by zoomUser().
The reset function needs to be called if the user manually sets the zoom level. For instance by connecting this function to the wheelEvent of the workspace scroll area.

Definition at line 433 of file TabController.py.

References Vispa.Main.TabController.TabController._zoomButtonPressedBeforeFlag.

435  """ Sets the zoom button pressed before flag to False.
436 
437  If the flag is set functions handling the zoom toolbar buttons (zoomHundred(), zoomAll()) wont store the last zoom factor. The flag is set to true by these functions.
438  By this mechanism the user can click the zoom buttons several times and will still be able to return to his orignal zoom level by zoomUser().
439  The reset function needs to be called if the user manually sets the zoom level. For instance by connecting this function to the wheelEvent of the workspace scroll area.
440  """
441  self._zoomButtonPressedBeforeFlag = False
def Vispa.Main.TabController.TabController.save (   self,
  filename = "" 
)
Takes care the tab's data will be written to the file given as argument or if this is an empty string to self._filename.

Whenever the content of the tab should be saved, this method should be called. If no filename is specified nor already set set it asks the user to set one. 
Afterwards the writing is initiated by calling writeFile(). 

Definition at line 226 of file TabController.py.

References Vispa.Main.TabController.TabController._filename, DQMIO2histo.DQMIO._filename, MuonGeometryArrange._filename, TrackerGeometryCompare._filename, Vispa.Main.TabController.TabController._redoEvents, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), Vispa.Main.Application.Application.plugin(), Vispa.Main.TabController.TabController.setFilename(), Vispa.Main.TabController.TabController.setLastSavedStateEvent(), Vispa.Main.TabController.TabController.setModified(), Vispa.Main.TabController.TabController.tab(), RawParticle.tab, Vispa.Main.TabController.TabController.updateLabel(), popcon::EcalTPGFineGrainEBIdMapHandler.writeFile(), popcon::EcalTPGLinConstHandler.writeFile(), popcon::EcalTPGLutIdMapHandler.writeFile(), popcon::EcalTPGPhysicsConstHandler.writeFile(), popcon::EcalTPGWeightIdMapHandler.writeFile(), popcon::EcalTPGBadXTHandler.writeFile(), popcon::EcalTPGBadStripHandler.writeFile(), popcon::EcalTPGBadTTHandler.writeFile(), popcon::EcalTPGFineGrainEBGroupHandler.writeFile(), popcon::EcalTPGWeightGroupHandler.writeFile(), popcon::EcalTPGFineGrainTowerEEHandler.writeFile(), popcon::EcalTPGPedestalsHandler.writeFile(), popcon::EcalTPGSlidingWindowHandler.writeFile(), popcon::EcalTPGFineGrainStripEEHandler.writeFile(), popcon::EcalTPGLutGroupHandler.writeFile(), popcon::EcalTPGSpikeThresholdHandler.writeFile(), and Vispa.Main.TabController.TabController.writeFile().

Referenced by Vispa.Main.TabController.TabController.allowClose(), and Vispa.Main.TabController.TabController.checkModificationTimestamp().

227  def save(self, filename=""):
228  """ Takes care the tab's data will be written to the file given as argument or if this is an empty string to self._filename.
229 
230  Whenever the content of the tab should be saved, this method should be called. If no filename is specified nor already set set it asks the user to set one.
231  Afterwards the writing is initiated by calling writeFile().
232  """
233  #logging.debug('Tab: save()')
234 
235  if filename == '':
236  if self._filename:
237  filename = self._filename
238  else:
239  return self.plugin().application().saveFileAsDialog()
240 
241  statusMessage = self.plugin().application().startWorking("Saving file " + filename)
242 
243  good=True
244  message=""
245  try:
246  good=self.writeFile(filename)
247  except Exception,e:
248  good=False
249  message="\n"+str(e)
250  if good:
251  self.setFilename(filename)
252  self.setModified(False)
253  self.updateLabel()
254  self.plugin().application().addRecentFile(filename)
255  self.plugin().application().updateMenuAndWindowTitle()
256 
257  # set last saved state for undo events
258  if len(self._redoEvents) > 0:
259  lastSavedStateEvent = self._redoEvents[len(self._redoEvents) -1]
260  else:
261  lastSavedStateEvent = None
262  self.setLastSavedStateEvent(lastSavedStateEvent)
263 
264  self.plugin().application().stopWorking(statusMessage)
265  return True
266  else:
267  QMessageBox.critical(self.tab().mainWindow(), 'Error while saving data', 'Could not write to file ' + filename +'.'+message)
268  logging.error(self.__class__.__name__ + ": save() : Could not write to file " + filename +'.'+message)
269  self.plugin().application().stopWorking(statusMessage, "failed")
270  return False
def Vispa.Main.TabController.TabController.selectAll (   self)
Handle to perform select all action.

This function is called if the user selects 'Select all' from menu. PluginTabs should override it if needed."
See also setAllowSelectAll(), allowSelectAll().

Definition at line 404 of file TabController.py.

405  def selectAll(self):
406  """ Handle to perform select all action.
407 
408  This function is called if the user selects 'Select all' from menu. PluginTabs should override it if needed."
409  See also setAllowSelectAll(), allowSelectAll().
410  """
411  raise NotImplementedError
def Vispa.Main.TabController.TabController.setAllowSelectAll (   self,
  allowSelectAll 
)
Sets the allowSelectAll flag.

Definition at line 182 of file TabController.py.

References Vispa.Main.TabController.TabController._allowSelectAllFlag, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), and Vispa.Main.Application.Application.plugin().

183  def setAllowSelectAll(self, allowSelectAll):
184  """ Sets the allowSelectAll flag.
185  """
186  self._allowSelectAllFlag = allowSelectAll
187  self.plugin().application().updateMenu()
def Vispa.Main.TabController.TabController.setCopyPasteEnabled (   self,
  enable = True 
)
Sets a flag indicating whether this tab can handle copy and paste events.

See also isCopyPasteEnabled(), cut(), copy(), paste().

Definition at line 91 of file TabController.py.

References Vispa.Main.TabController.TabController._copyPasteEnabledFlag.

91 
92  def setCopyPasteEnabled(self, enable=True):
93  """ Sets a flag indicating whether this tab can handle copy and paste events.
94 
95  See also isCopyPasteEnabled(), cut(), copy(), paste().
96  """
97  self._copyPasteEnabledFlag = enable
def Vispa.Main.TabController.TabController.setEditable (   self,
  editable 
)
Sets the file Editable flag.

Definition at line 170 of file TabController.py.

References Vispa.Main.TabController.TabController._isEditableFlag, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), and Vispa.Main.Application.Application.plugin().

Referenced by Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.__init__(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.startEditMode().

171  def setEditable(self, editable):
172  """ Sets the file Editable flag.
173  """
174  #logging.debug(self.__class__.__name__ +": setEditable(" + str(editable) +")")
175  self._isEditableFlag = editable
176  self.plugin().application().updateMenu()
def Vispa.Main.TabController.TabController.setFilename (   self,
  filename 
)
Sets a filename.

Definition at line 72 of file TabController.py.

References Vispa.Main.TabController.TabController._fileModifcationTimestamp, Vispa.Main.TabController.TabController._filename, DQMIO2histo.DQMIO._filename, MuonGeometryArrange._filename, and TrackerGeometryCompare._filename.

Referenced by Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.importConfig(), Vispa.Main.TabController.TabController.open(), Vispa.Main.TabController.TabController.save(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.startEditMode().

72 
73  def setFilename(self, filename):
74  """ Sets a filename.
75  """
76  self._filename = filename
77  if self._filename and os.path.exists(self._filename):
78  self._fileModifcationTimestamp = os.path.getmtime(self._filename)
def Vispa.Main.TabController.TabController.setFindEnabled (   self,
  enable = True 
)
Sets a flag indicating whether this tab can handle find requests.

See isFindEnabled(), find().

Definition at line 105 of file TabController.py.

References Vispa.Main.TabController.TabController._findEnabledFlag.

106  def setFindEnabled(self, enable=True):
107  """Sets a flag indicating whether this tab can handle find requests.
108 
109  See isFindEnabled(), find().
110  """
111  self._findEnabledFlag = enable
def Vispa.Main.TabController.TabController.setLastSavedStateEvent (   self,
  undoEvent 
)
Sets last saved state flag of given UndoEvent to True and to False for all other events.

Definition at line 622 of file TabController.py.

References Vispa.Main.TabController.TabController._redoEvents, and Vispa.Main.TabController.TabController._undoEvents.

Referenced by Vispa.Main.TabController.TabController.addUndoEvent(), and Vispa.Main.TabController.TabController.save().

623  def setLastSavedStateEvent(self, undoEvent):
624  """ Sets last saved state flag of given UndoEvent to True and to False for all other events.
625  """
626  for current_event in self._undoEvents + self._redoEvents:
627  if current_event == undoEvent:
628  current_event.setLastSavedState(True)
629  else:
630  current_event.setLastSavedState(False)
def Vispa.Main.TabController.TabController.setModified (   self,
  modified = True 
)
Sets the file Modified flag to True or False.

This affects the closing of this tab.
It is only possible to set the modification flag to True if the controller is editable (see isEditable()).

Definition at line 146 of file TabController.py.

References Vispa.Main.TabController.TabController._fileModifiedFlag, Vispa.Main.TabController.TabController.isEditable(), PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), Vispa.Main.Application.Application.plugin(), Vispa.Main.TabController.TabController.tab(), RawParticle.tab, and Vispa.Main.TabController.TabController.updateLabel().

Referenced by Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.applyButtonClicked(), Vispa.Main.TabController.TabController.checkModificationTimestamp(), Vispa.Main.TabController.TabController.redo(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.removeButtonClicked(), Vispa.Main.TabController.TabController.save(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.switchCenterView(), Vispa.Main.TabController.TabController.undo(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.valueChanged().

147  def setModified(self, modified=True):
148  """ Sets the file Modified flag to True or False.
149 
150  This affects the closing of this tab.
151  It is only possible to set the modification flag to True if the controller is editable (see isEditable()).
152  """
153  if modified and not self.isEditable():
154  return
155 
156  previous = self._fileModifiedFlag
157  self._fileModifiedFlag = modified
158 
159  if previous != self._fileModifiedFlag:
160  self.updateLabel()
161  if self.tab().mainWindow():
162  self.plugin().application().updateMenuAndWindowTitle()
163  else:
164  logging.info(self.__class__.__name__ +": setModified() - Cannot tell application the modification state: There is no application associated with the tab.")
def Vispa.Main.TabController.TabController.setTab (   self,
  tab 
)
Sets tab.

Definition at line 62 of file TabController.py.

References Vispa.Main.TabController.TabController._tab.

62 
63  def setTab(self, tab):
64  """ Sets tab.
65  """
66  self._tab = tab
def Vispa.Main.TabController.TabController.setZoom (   self,
  zoom 
)
This function has to be implemented by tab controllers who want to use the zoom toolbar.

The implementation has to forward the zoom value to the Zoomable object for which the toolbar is set up.
See also zoom()

Definition at line 412 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.zoomAll(), Vispa.Main.TabController.TabController.zoomDialog(), Vispa.Main.TabController.TabController.zoomHundred(), and Vispa.Main.TabController.TabController.zoomUser().

413  def setZoom(self, zoom):
414  """ This function has to be implemented by tab controllers who want to use the zoom toolbar.
415 
416  The implementation has to forward the zoom value to the Zoomable object for which the toolbar is set up.
417  See also zoom()
418  """
419  raise NotImplementedError
def Vispa.Main.TabController.TabController.staticSupportedFileTypes ( )
Static function returning all filetypes the tab controller can handle.

Sub classes should reimplement this function. It returns a list with 2-tuples of the following form:
('extension', 'description of file type').

Definition at line 39 of file TabController.py.

39 
41  """ Static function returning all filetypes the tab controller can handle.
42 
43  Sub classes should reimplement this function. It returns a list with 2-tuples of the following form:
44  ('extension', 'description of file type').
45  """
return []
def Vispa.Main.TabController.TabController.supportedFileFilters (   self)

Definition at line 53 of file TabController.py.

References join().

53 
54  def supportedFileFilters(self):
55  supportedFileTypes = self.__class__.staticSupportedFileTypes()
56  return ";;".join([Filetype(t[0], t[1]).fileDialogFilter() for t in supportedFileTypes])
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def Vispa.Main.TabController.TabController.supportedFileTypes (   self)
Returns staticSupportedFileTypes() of the class to which this object belongs.

Definition at line 48 of file TabController.py.

48 
49  def supportedFileTypes(self):
50  """ Returns staticSupportedFileTypes() of the class to which this object belongs.
51  """
52  return self.__class__.staticSupportedFileTypes()
def Vispa.Main.TabController.TabController.supportsUndo (   self)
Returns True if the this tab controller supports undo history.

Definition at line 519 of file TabController.py.

520  def supportsUndo(self):
521  """ Returns True if the this tab controller supports undo history.
522  """
523  return self._supportsUndo
def Vispa.Main.TabController.TabController.tab (   self)
Returns tab.

Definition at line 67 of file TabController.py.

References Vispa.Main.TabController.TabController._tab.

Referenced by Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController._updateCode(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.activated(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.activated(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.applyButtonClicked(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.cancel(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.centerView(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.centerViewMenuButtonClicked(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.centerViewMenuButtonClicked(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.chooseEditor(), Vispa.Main.TabController.TabController.close(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.codeSelected(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.currentCenterViewClassId(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.dumpPython(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.eventContent(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.eventContent(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.expandToDepthDialog(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.exportDot(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.filterDialog(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.find(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.history(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.importButtonClicked(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.importConfig(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.isBusy(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.maximizeEditor(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.minimizeEditor(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.onCenterViewDoubleClicked(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.onSelected(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.onTreeViewSelected(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.openEditor(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.originalEditor(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.readFile(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.refresh(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.removeButtonClicked(), Vispa.Main.TabController.TabController.save(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.save(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.saveImage(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.scriptChanged(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.select(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.selectDataAccessor(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.setDataAccessor(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.setEditable(), Vispa.Main.TabController.TabController.setModified(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.setTab(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.setZoom(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.startEditMode(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.switchCenterView(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.toggleCollapsed(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.toggleUnderscoreProperties(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.treeViewMenuButtonClicked(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.updateCenterView(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.updateCenterView(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.updateCenterView(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.updateConfigHighlight(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.updateContent(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.updateContent(), Vispa.Main.TabController.TabController.updateLabel(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.updateTreeView(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.updateViewMenu(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.updateViewMenu(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.updateViewMenu(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.valueChanged(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.zoom(), Vispa.Main.TabController.TabController.zoomAll(), Vispa.Main.TabController.TabController.zoomChanged(), and Vispa.Main.TabController.TabController.zoomDialog().

67 
68  def tab(self):
69  """ Returns tab.
70  """
71  return self._tab
def Vispa.Main.TabController.TabController.undo (   self,
  numberOfEvents = 1 
)
Invokes undo of last stored UndoEvent (see addUndoEvent()), if undo functionality is enabled.

Definition at line 563 of file TabController.py.

References Vispa.Main.TabController.TabController._supportsUndo, Vispa.Main.TabController.TabController._undoEvents, PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), Vispa.Main.Application.Application.plugin(), and Vispa.Main.TabController.TabController.setModified().

564  def undo(self, numberOfEvents=1):
565  """ Invokes undo of last stored UndoEvent (see addUndoEvent()), if undo functionality is enabled.
566  """
567  if not self._supportsUndo:
568  logging.warning(self.__class__.__name__ + ": Tried to undo action, however undo functionality is not enabled. Aborting...")
569  return
570  logging.debug(self.__class__.__name__ +": undo("+ str(numberOfEvents) +")")
571  #self.dumpUndoEvents()
572 
573  for i in range(0, numberOfEvents):
574  if len(self._undoEvents) > 0:
575  lastEvent = self._undoEvents.pop()
576  lastEvent.undo()
577  self._redoEvents.append(lastEvent)
578 
579  # set modification flag
580  if i == (numberOfEvents -1):
581  if lastEvent.isLastSavedState():
582  self.setModified(False)
583  else:
584  self.setModified()
585  self.plugin().application().updateMenu()
586 
587  #self.dumpUndoEvents()
def Vispa.Main.TabController.TabController.undoEvents (   self)
Returns list of all registered UndoEvents.

Definition at line 532 of file TabController.py.

References Vispa.Main.TabController.TabController._undoEvents.

533  def undoEvents(self):
534  """ Returns list of all registered UndoEvents.
535  """
536  return self._undoEvents
def Vispa.Main.TabController.TabController.updateContent (   self)
Called after file is loaded.

Meant to update to Tab content.

Definition at line 483 of file TabController.py.

Referenced by Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController._updateCode(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.filtered(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate(), Vispa.Main.TabController.TabController.open(), Vispa.Main.TabController.TabController.refresh(), Vispa.Plugins.EdmBrowser.EventContentDialog.EventContentDialog.selectInputFile(), Vispa.Plugins.EdmBrowser.EventContentDialog.EventContentDialog.setConfigDataAccessor(), Vispa.Plugins.EdmBrowser.EventContentDialog.EventContentDialog.setEventContent(), and Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.toggleFilterBranches().

484  def updateContent(self):
485  """ Called after file is loaded.
486 
487  Meant to update to Tab content.
488  """
489  raise NotImplementedError
def Vispa.Main.TabController.TabController.updateLabel (   self,
  prefix = "",
  titletext = "" 
)
Sets the text of the tab to filename if it is set. If
titletext
is not an emty string, it is used instead of the filename.

Otherwise it is set to 'UNTITLED'. It also evaluates the fileModifiedFlag and indicates changes with an *.

Definition at line 119 of file TabController.py.

References Vispa.Main.TabController.TabController._filename, DQMIO2histo.DQMIO._filename, MuonGeometryArrange._filename, TrackerGeometryCompare._filename, Vispa.Main.TabController.TabController.isModified(), Vispa.Main.TabController.TabController.tab(), RawParticle.tab, and Vispa.Main.TabController.TabController.TAB_LABEL_MAX_LENGTH.

Referenced by Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.importConfig(), Vispa.Main.TabController.TabController.open(), Vispa.Main.TabController.TabController.save(), Vispa.Main.TabController.TabController.setModified(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.startEditMode().

120  def updateLabel(self,prefix="",titletext = ""):
121  """ Sets the text of the tab to filename if it is set. If
122  titletext
123  is not an emty string, it is used instead of the filename.
124 
125  Otherwise it is set to 'UNTITLED'. It also evaluates the fileModifiedFlag and indicates changes with an *.
126  """
127  if self._filename:
128  title = os.path.basename(self._filename)
129  if len(os.path.splitext(title)[0]) > self.TAB_LABEL_MAX_LENGTH:
130  ext = os.path.splitext(title)[1].lower().strip(".")
131  title = os.path.splitext(title)[0][0:self.TAB_LABEL_MAX_LENGTH] + "...." + ext
132  elif titletext == "":
133  title = 'UNTITLED'
134  else:
135  title = titletext
136 
137  if self.isModified():
138  title = '*' + title
139 
140  title = prefix+title
141 
142  if self.tab().tabWidget():
143  self.tab().tabWidget().setTabText(self.tab().tabWidget().indexOf(self.tab()), title)
144  else:
145  self.tab().setWindowTitle(title)
def Vispa.Main.TabController.TabController.writeFile (   self,
  filename 
)
This function performs the actual writing / saving of a file. It should be overwritten by any PluginTab which inherits Tab.
If the writing was successful True should be returned.
The file should be written to the file given in the argument filename not to the one in self._filename.
These variables may differ in case the user selects "save as..." and picks a new filename on a file which already has a name set.
If writing was successful the self._filename variable will then be set to the value of filename.

Definition at line 302 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.save().

303  def writeFile(self, filename):
304  """
305  This function performs the actual writing / saving of a file. It should be overwritten by any PluginTab which inherits Tab.
306  If the writing was successful True should be returned.
307  The file should be written to the file given in the argument filename not to the one in self._filename.
308  These variables may differ in case the user selects "save as..." and picks a new filename on a file which already has a name set.
309  If writing was successful the self._filename variable will then be set to the value of filename.
310  """
311  raise NotImplementedError
def Vispa.Main.TabController.TabController.zoom (   self)
This function has to be implemented by tab controllers who want to use the zoom toolbar.

The implementation should return the zoom value of the Zoomable object for which the toolbar is set up.
See also setZoom()

Definition at line 420 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.zoomAll(), Vispa.Main.TabController.TabController.zoomDialog(), and Vispa.Main.TabController.TabController.zoomHundred().

421  def zoom(self):
422  """ This function has to be implemented by tab controllers who want to use the zoom toolbar.
423 
424  The implementation should return the zoom value of the Zoomable object for which the toolbar is set up.
425  See also setZoom()
426  """
427  raise NotImplementedError
def Vispa.Main.TabController.TabController.zoomAll (   self)
Zooms workspace content to fit optimal.

Currently only works if scroll area is used and accessible through self.tab().scrollArea().

Definition at line 457 of file TabController.py.

References Vispa.Main.TabController.TabController._userZoomLevel, Vispa.Main.TabController.TabController._zoomButtonPressedBeforeFlag, Vispa.Gui.Zoomable.Zoomable.setZoom(), Vispa.Gui.ZoomableScrollableWidgetOwner.ZoomableScrollableWidgetOwner.setZoom(), Vispa.Gui.ZoomableWidget.ZoomableWidget.setZoom(), Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea.setZoom(), Vispa.Gui.PortConnection.PointToPointConnection.setZoom(), Vispa.Gui.ConnectableWidget.ConnectableWidget.setZoom(), Vispa.Main.TabController.TabController.setZoom(), Vispa.Gui.VispaWidget.VispaWidget.setZoom(), Vispa.Main.TabController.TabController.tab(), RawParticle.tab, create_public_lumi_plots.width, Vispa.Gui.Zoomable.Zoomable.zoom(), and Vispa.Main.TabController.TabController.zoom().

458  def zoomAll(self):
459  """ Zooms workspace content to fit optimal.
460 
461  Currently only works if scroll area is used and accessible through self.tab().scrollArea().
462  """
463  logging.debug(__name__ + ": zoomAll()")
464  if not self._zoomButtonPressedBeforeFlag:
465  self._userZoomLevel = self.zoom()
466  self._zoomButtonPressedBeforeFlag = True
467 
468  viewportWidth = self.tab().scrollArea().viewport().width()
469  viewportHeight = self.tab().scrollArea().viewport().height()
470 
471  for i in range(0, 2):
472  # do 2 iterations to prevent rounding error --> better fit
473  workspaceChildrenRect = self.tab().scrollArea().widget().childrenRect()
474  widthRatio = self.zoom() * viewportWidth / (workspaceChildrenRect.right())
475  heightRatio = self.zoom() * viewportHeight / (workspaceChildrenRect.bottom())
476 
477  if widthRatio > heightRatio:
478  ratio = heightRatio
479  else:
480  ratio = widthRatio
481 
482  self.setZoom(math.floor(ratio))
def Vispa.Main.TabController.TabController.zoomChanged (   self,
  zoom 
)
Shows zoom value on main window's status bar.

Definition at line 428 of file TabController.py.

References Vispa.Main.TabController.TabController.tab(), and RawParticle.tab.

429  def zoomChanged(self, zoom):
430  """ Shows zoom value on main window's status bar.
431  """
432  self.tab().mainWindow().statusBar().showMessage("Zoom " + str(round(zoom)) + " %")
def Vispa.Main.TabController.TabController.zoomDialog (   self)

Definition at line 501 of file TabController.py.

References Vispa.Main.TabController.TabController._userZoomLevel, Vispa.Gui.Zoomable.Zoomable.setZoom(), Vispa.Gui.ZoomableScrollableWidgetOwner.ZoomableScrollableWidgetOwner.setZoom(), Vispa.Gui.ZoomableWidget.ZoomableWidget.setZoom(), Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea.setZoom(), Vispa.Gui.PortConnection.PointToPointConnection.setZoom(), Vispa.Gui.ConnectableWidget.ConnectableWidget.setZoom(), Vispa.Main.TabController.TabController.setZoom(), Vispa.Gui.VispaWidget.VispaWidget.setZoom(), Vispa.Main.TabController.TabController.tab(), RawParticle.tab, Vispa.Gui.Zoomable.Zoomable.zoom(), and Vispa.Main.TabController.TabController.zoom().

502  def zoomDialog(self):
503  if hasattr(QInputDialog, "getInteger"):
504  # Qt 4.3
505  (zoom, ok) = QInputDialog.getInteger(self.tab(), "Zoom...", "Input zoom factor in percent:", self.zoom(), 0)
506  else:
507  # Qt 4.5
508  (zoom, ok) = QInputDialog.getInt(self.tab(), "Zoom...", "Input zoom factor in percent:", self.zoom(), 0)
509  if ok:
510  self.setZoom(zoom)
511  self._userZoomLevel = zoom
def Vispa.Main.TabController.TabController.zoomHundred (   self)
Sets zoom factor to 100 %.

Definition at line 448 of file TabController.py.

References Vispa.Main.TabController.TabController._userZoomLevel, Vispa.Main.TabController.TabController._zoomButtonPressedBeforeFlag, Vispa.Gui.Zoomable.Zoomable.setZoom(), Vispa.Gui.ZoomableScrollableWidgetOwner.ZoomableScrollableWidgetOwner.setZoom(), Vispa.Gui.ZoomableWidget.ZoomableWidget.setZoom(), Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea.setZoom(), Vispa.Gui.PortConnection.PointToPointConnection.setZoom(), Vispa.Gui.ConnectableWidget.ConnectableWidget.setZoom(), Vispa.Main.TabController.TabController.setZoom(), Vispa.Gui.VispaWidget.VispaWidget.setZoom(), Vispa.Gui.Zoomable.Zoomable.zoom(), and Vispa.Main.TabController.TabController.zoom().

449  def zoomHundred(self):
450  """ Sets zoom factor to 100 %.
451  """
452  logging.debug(__name__ + ": zoomHundred()")
453  if not self._zoomButtonPressedBeforeFlag:
454  self._userZoomLevel = self.zoom()
455  self._zoomButtonPressedBeforeFlag = True
456  self.setZoom(100)
def Vispa.Main.TabController.TabController.zoomUser (   self)
Returns to the manually set zoom factor before zoomHundred() or zoomAll() were called.

Definition at line 442 of file TabController.py.

References Vispa.Main.TabController.TabController._userZoomLevel, Vispa.Gui.Zoomable.Zoomable.setZoom(), Vispa.Gui.ZoomableScrollableWidgetOwner.ZoomableScrollableWidgetOwner.setZoom(), Vispa.Gui.ZoomableWidget.ZoomableWidget.setZoom(), Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea.setZoom(), Vispa.Gui.PortConnection.PointToPointConnection.setZoom(), Vispa.Gui.ConnectableWidget.ConnectableWidget.setZoom(), Vispa.Main.TabController.TabController.setZoom(), and Vispa.Gui.VispaWidget.VispaWidget.setZoom().

443  def zoomUser(self):
444  """ Returns to the manually set zoom factor before zoomHundred() or zoomAll() were called.
445  """
446  logging.debug(__name__ + ": zoomUser()")
447  self.setZoom(self._userZoomLevel)

Member Data Documentation

Vispa.Main.TabController.TabController._allowSelectAllFlag
private

Definition at line 28 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.allowSelectAll(), and Vispa.Main.TabController.TabController.setAllowSelectAll().

Vispa.Main.TabController.TabController._copyPasteEnabledFlag
private

Definition at line 27 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.isCopyPasteEnabled(), and Vispa.Main.TabController.TabController.setCopyPasteEnabled().

Vispa.Main.TabController.TabController._fileModifcationTimestamp
private

Definition at line 32 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.checkModificationTimestamp(), Vispa.Main.TabController.TabController.refresh(), and Vispa.Main.TabController.TabController.setFilename().

Vispa.Main.TabController.TabController._fileModifiedFlag
private

Definition at line 23 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.isModified(), and Vispa.Main.TabController.TabController.setModified().

Vispa.Main.TabController.TabController._filename
private

Definition at line 26 of file TabController.py.

Referenced by Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor._readHeaderInfo(), Vispa.Main.TabController.TabController.checkModificationTimestamp(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.configFile(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.dumpPython(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.eventContent(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.exportDot(), Vispa.Main.TabController.TabController.filename(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.fullFilename(), Vispa.Main.TabController.TabController.getFileBasename(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.importConfig(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.open(), Vispa.Main.TabController.TabController.open(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.open(), Vispa.Main.TabController.TabController.refresh(), Vispa.Main.TabController.TabController.save(), Vispa.Main.TabController.TabController.setFilename(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.startEditMode(), and Vispa.Main.TabController.TabController.updateLabel().

Vispa.Main.TabController.TabController._findEnabledFlag
private

Definition at line 29 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.isFindEnabled(), and Vispa.Main.TabController.TabController.setFindEnabled().

Vispa.Main.TabController.TabController._isEditableFlag
private

Definition at line 24 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.isEditable(), and Vispa.Main.TabController.TabController.setEditable().

Vispa.Main.TabController.TabController._plugin
private

Definition at line 22 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.plugin().

Vispa.Main.TabController.TabController._redoEvents
private

Definition at line 36 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.addUndoEvent(), Vispa.Main.TabController.TabController.dumpUndoEvents(), Vispa.Main.TabController.TabController.redo(), Vispa.Main.TabController.TabController.redoEvents(), Vispa.Main.TabController.TabController.save(), and Vispa.Main.TabController.TabController.setLastSavedStateEvent().

Vispa.Main.TabController.TabController._showingModifiedMessageFlag
private

Definition at line 33 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.checkModificationTimestamp().

Vispa.Main.TabController.TabController._supportsUndo
private

Definition at line 34 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.addUndoEvent(), Vispa.Main.TabController.TabController.enableUndo(), Vispa.Main.TabController.TabController.redo(), Vispa.Main.TabController.TabController.supportsUndo(), and Vispa.Main.TabController.TabController.undo().

Vispa.Main.TabController.TabController._tab
private

Definition at line 25 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.setTab(), and Vispa.Main.TabController.TabController.tab().

Vispa.Main.TabController.TabController._undoEvents
private

Definition at line 35 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.addUndoEvent(), Vispa.Share.UndoEvent.MultiUndoEvent.dump(), Vispa.Main.TabController.TabController.dumpUndoEvents(), Vispa.Share.UndoEvent.MultiUndoEvent.redo(), Vispa.Main.TabController.TabController.redo(), Vispa.Main.TabController.TabController.setLastSavedStateEvent(), Vispa.Share.UndoEvent.MultiUndoEvent.undo(), Vispa.Main.TabController.TabController.undo(), and Vispa.Main.TabController.TabController.undoEvents().

Vispa.Main.TabController.TabController._userZoomLevel
private

Definition at line 30 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.zoomAll(), Vispa.Main.TabController.TabController.zoomDialog(), Vispa.Main.TabController.TabController.zoomHundred(), and Vispa.Main.TabController.TabController.zoomUser().

Vispa.Main.TabController.TabController._zoomButtonPressedBeforeFlag
private

Definition at line 31 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.resetZoomButtonPressedBefore(), Vispa.Main.TabController.TabController.zoomAll(), and Vispa.Main.TabController.TabController.zoomHundred().

tuple Vispa.Main.TabController.TabController.staticSupportedFileTypes = staticmethod(staticSupportedFileTypes)
static

Definition at line 46 of file TabController.py.

int Vispa.Main.TabController.TabController.TAB_LABEL_MAX_LENGTH = 20
static

Definition at line 17 of file TabController.py.

Referenced by Vispa.Main.TabController.TabController.updateLabel().