コード例 #1
0
 def onSwitchPerspective(self, perspective):
     self.stop_logging()
     if perspective == "Remote":
         if hasattr(self, 'hostName') and hasattr(self, 'port'):
             host, port = self.hostName, self.port
         else:
             isValid = False
             dft = "%s:%d" % (socket.gethostname(),
                              logging.handlers.DEFAULT_TCP_LOGGING_PORT)
             while not isValid:
                 txt, res = Qt.QInputDialog.getText(
                     self, "Please input remote logging host and port",
                     "Location (<host>:<port>):", Qt.QLineEdit.Normal, dft)
                 if not res:
                     return
                 try:
                     host, port = str(txt).split(":", 1)
                     port = int(port)
                     isValid = True
                 except:
                     Qt.QMessageBox.information(
                         self, "Invalid name",
                         "Please type a valid <host>:<port>")
         ret = QBaseTableWidget.onSwitchPerspective(self, perspective)
         qmodel = self.getQModel()
         qmodel.connect_logging(host=host, port=port)
     else:
         ret = QBaseTableWidget.onSwitchPerspective(self, perspective)
     return ret
コード例 #2
0
ファイル: qlogtable.py プロジェクト: cmft/taurus
 def onSwitchPerspective(self, perspective):
     self.stop_logging()
     if perspective == "Remote":
         if hasattr(self, 'hostName') and hasattr(self, 'port'):
             host, port = self.hostName, self.port
         else:
             isValid = False
             dft = "%s:%d" % (socket.gethostname(),
                              logging.handlers.DEFAULT_TCP_LOGGING_PORT)
             while not isValid:
                 txt, res = Qt.QInputDialog.getText(self,
                                                    "Please input remote logging host and port",
                                                    "Location (<host>:<port>):", Qt.QLineEdit.Normal, dft)
                 if not res:
                     return
                 try:
                     host, port = str(txt).split(":", 1)
                     port = int(port)
                     isValid = True
                 except:
                     Qt.QMessageBox.information(self, "Invalid name",
                                                "Please type a valid <host>:<port>")
         ret = QBaseTableWidget.onSwitchPerspective(self, perspective)
         qmodel = self.getQModel()
         qmodel.connect_logging(host=host, port=port)
     else:
         ret = QBaseTableWidget.onSwitchPerspective(self, perspective)
     return ret
コード例 #3
0
ファイル: qlogtable.py プロジェクト: tcsgmrt/taurus
 def __init__(self, parent=None, designMode=False,
              with_filter_widget=LoggingToolBar,
              with_selection_widget=True, with_refresh_widget=True,
              perspective=None, proxy=None):
     QBaseTableWidget.__init__(self, parent=parent, designMode=designMode,
                               with_filter_widget=with_filter_widget,
                               with_selection_widget=False, with_refresh_widget=False,
                               perspective=perspective, proxy=proxy)
コード例 #4
0
ファイル: qlogtable.py プロジェクト: cmft/taurus
 def __init__(self, parent=None, designMode=False,
              with_filter_widget=LoggingToolBar,
              with_selection_widget=True, with_refresh_widget=True,
              perspective=None, proxy=None):
     QBaseTableWidget.__init__(self, parent=parent, designMode=designMode,
                               with_filter_widget=with_filter_widget,
                               with_selection_widget=False, with_refresh_widget=False,
                               perspective=perspective, proxy=proxy)
コード例 #5
0
 def onFilterChanged(self, filter):
     if not self.usesProxyQModel():
         return
     proxy_model = self.getQModel()
     level = self.getFilterBar().getLogLevel()
     proxy_model.setFilterLogLevel(level)
     return QBaseTableWidget.onFilterChanged(self, filter)
コード例 #6
0
ファイル: qlogtable.py プロジェクト: cmft/taurus
 def onFilterChanged(self, filter):
     if not self.usesProxyQModel():
         return
     proxy_model = self.getQModel()
     level = self.getFilterBar().getLogLevel()
     proxy_model.setFilterLogLevel(level)
     return QBaseTableWidget.onFilterChanged(self, filter)
コード例 #7
0
 def createViewWidget(self, klass=None):
     if klass is None:
         klass = QLoggingTable
     view = QBaseTableWidget.createViewWidget(self, klass=klass)
     hh = view.horizontalHeader()
     hh.setResizeMode(MSG, Qt.QHeaderView.Stretch)
     view.setShowGrid(False)
     view.sortByColumn(TIME, Qt.Qt.AscendingOrder)
     return view
コード例 #8
0
ファイル: qlogtable.py プロジェクト: cmft/taurus
 def createViewWidget(self, klass=None):
     if klass is None:
         klass = QLoggingTable
     view = QBaseTableWidget.createViewWidget(self, klass=klass)
     hh = view.horizontalHeader()
     hh.setResizeMode(MSG, Qt.QHeaderView.Stretch)
     view.setShowGrid(False)
     view.sortByColumn(TIME, Qt.Qt.AscendingOrder)
     return view
コード例 #9
0
 def destroy(self, destroyWindow=True, destroySubWindows=True):
     self.stop_logging()
     return QBaseTableWidget.destroy(self, destroyWindow, destroySubWindows)
コード例 #10
0
 def createToolArea(self):
     tb = QBaseTableWidget.createToolArea(self)
     filterBar = self.getFilterBar()
     Qt.QObject.connect(filterBar, Qt.SIGNAL("scrollLockToggled(bool)"),
                        self.onScrollLockToggled)
     return tb
コード例 #11
0
ファイル: qlogtable.py プロジェクト: tcsgmrt/taurus
 def createToolArea(self):
     tb = QBaseTableWidget.createToolArea(self)
     filterBar = self.getFilterBar()
     filterBar.scrollLockToggled.connect(self.onScrollLockToggled)
     return tb
コード例 #12
0
ファイル: qlogtable.py プロジェクト: cmft/taurus
 def destroy(self, destroyWindow=True, destroySubWindows=True):
     self.stop_logging()
     return QBaseTableWidget.destroy(self, destroyWindow, destroySubWindows)
コード例 #13
0
ファイル: qlogtable.py プロジェクト: cmft/taurus
 def createToolArea(self):
     tb = QBaseTableWidget.createToolArea(self)
     filterBar = self.getFilterBar()
     filterBar.scrollLockToggled.connect(self.onScrollLockToggled)
     return tb