14 """ The EventBrowserTabController supplies functionality for browsing objects in an EventBrowserTab and navigating through events.
17 logging.debug(__name__ +
": __init__")
18 BrowserTabController.__init__(self, plugin)
23 self.connect(self,SIGNAL(
"navigate"),self.
navigate)
28 result=BrowserTabController.close(self)
34 if not isinstance(accessor, EventFileAccessor):
35 raise TypeError(__name__ +
" requires data accessor of type EventFileAccessor.")
36 BrowserTabController.setDataAccessor(self, accessor)
39 """ Show event menu when tab is shown.
41 BrowserTabController.activated(self)
44 self.
plugin().application().showPluginMenu(self.
plugin().navigateMenu())
45 self.
plugin().application().showPluginToolBar(self.
plugin().navigateToolBar())
48 eventNum=self._dataAccessor.eventNumber()
54 """ Reads in the file in a separate thread.
58 while self._thread.isRunning():
59 if not Application.NO_PROCESS_EVENTS:
60 QCoreApplication.instance().processEvents()
61 if self._thread.returnValue():
67 return BrowserTabController.isBusy(self)
or\
68 (self.
_thread and self._thread.isRunning())
80 self.emit(SIGNAL(
"navigate"),to)
86 statusMessage = self.
plugin().application().startWorking(
"Reopening file")
90 statusMessage = self.
plugin().application().startWorking(
"Navigate in file")
98 self.
plugin().application().stopWorking(statusMessage)
101 """ Navigate and to first event.
103 logging.debug(__name__ +
": first")
110 """ Navigate and to previous event.
112 logging.debug(__name__ +
": previous")
119 """ Navigate and to next event.
121 logging.debug(__name__ +
": next")
127 if currentEvent<allEvents:
131 """ Navigate and to last event.
133 logging.debug(__name__ +
": last")
139 if currentEvent<allEvents:
143 """ Ask event number in dialog and navigate and to event.
145 logging.debug(__name__ +
": goto")
146 if self._dataAccessor.numberOfEvents():
147 max = self._dataAccessor.numberOfEvents()
151 ok=(number>=1, number<=max)
153 if hasattr(QInputDialog,
"getInteger"):
155 (number, ok) = QInputDialog.getInteger(self.
plugin().application().mainWindow(),
"Goto...",
"Enter event number:", self._dataAccessor.eventNumber(), 1, max)
158 (number, ok) = QInputDialog.getInt(self.
plugin().application().mainWindow(),
"Goto...",
"Enter event number:", self._dataAccessor.eventNumber(), 1, max)
162 if currentEvent!=number:
166 eventDisplayString = str(self._dataAccessor.eventNumber()) +
"/"
167 if self._dataAccessor.numberOfEvents():
168 eventDisplayString += str(self._dataAccessor.numberOfEvents())
170 eventDisplayString +=
"?"
171 self.
plugin().eventNumberDisplay().setText(eventDisplayString)
_fileModifcationTimestamp
def updateEventNumberDisplay