VCS/StatusMonitorLed.py

changeset 3190
a9a94491c4fd
parent 3160
209a07d7e401
child 3349
2a034a7f1f54
equal deleted inserted replaced
3189:9a21c547de5f 3190:a9a94491c4fd
40 "wait": QColor(Qt.cyan), 40 "wait": QColor(Qt.cyan),
41 "timeout": QColor(Qt.darkRed) 41 "timeout": QColor(Qt.darkRed)
42 } 42 }
43 self.__on = False 43 self.__on = False
44 44
45 self.setWhatsThis(self.trUtf8( 45 self.setWhatsThis(self.tr(
46 """<p>This LED indicates the operating""" 46 """<p>This LED indicates the operating"""
47 """ status of the VCS monitor thread (off = monitoring off,""" 47 """ status of the VCS monitor thread (off = monitoring off,"""
48 """ green = monitoring on and ok, red = monitoring on, but""" 48 """ green = monitoring on and ok, red = monitoring on, but"""
49 """ not ok, yellow = checking VCS status). A status description""" 49 """ not ok, yellow = checking VCS status). A status description"""
50 """ is given in the tooltip.</p>""" 50 """ is given in the tooltip.</p>"""
51 )) 51 ))
52 self.setToolTip( 52 self.setToolTip(
53 self.trUtf8("Repository status checking is switched off") 53 self.tr("Repository status checking is switched off")
54 ) 54 )
55 self.setColor(self.vcsMonitorLedColors["off"]) 55 self.setColor(self.vcsMonitorLedColors["off"])
56 56
57 # define a context menu 57 # define a context menu
58 self.__menu = QMenu(self) 58 self.__menu = QMenu(self)
59 self.__checkAct = self.__menu.addAction( 59 self.__checkAct = self.__menu.addAction(
60 self.trUtf8("Check status"), self.__checkStatus) 60 self.tr("Check status"), self.__checkStatus)
61 self.__intervalAct = self.__menu.addAction( 61 self.__intervalAct = self.__menu.addAction(
62 self.trUtf8("Set interval..."), self.__setInterval) 62 self.tr("Set interval..."), self.__setInterval)
63 self.__menu.addSeparator() 63 self.__menu.addSeparator()
64 self.__onAct = self.__menu.addAction( 64 self.__onAct = self.__menu.addAction(
65 self.trUtf8("Switch on"), self.__switchOn) 65 self.tr("Switch on"), self.__switchOn)
66 self.__offAct = self.__menu.addAction( 66 self.__offAct = self.__menu.addAction(
67 self.trUtf8("Switch off"), self.__switchOff) 67 self.tr("Switch off"), self.__switchOff)
68 self.__checkActions() 68 self.__checkActions()
69 69
70 # connect signals to our slots 70 # connect signals to our slots
71 self.setContextMenuPolicy(Qt.CustomContextMenu) 71 self.setContextMenuPolicy(Qt.CustomContextMenu)
72 self.customContextMenuRequested.connect(self._showContextMenu) 72 self.customContextMenuRequested.connect(self._showContextMenu)
123 """ 123 """
124 Private slot to change the status check interval. 124 Private slot to change the status check interval.
125 """ 125 """
126 interval, ok = QInputDialog.getInt( 126 interval, ok = QInputDialog.getInt(
127 None, 127 None,
128 self.trUtf8("VCS Status Monitor"), 128 self.tr("VCS Status Monitor"),
129 self.trUtf8("Enter monitor interval [s]"), 129 self.tr("Enter monitor interval [s]"),
130 self.project.getStatusMonitorInterval(), 130 self.project.getStatusMonitorInterval(),
131 0, 3600, 1) 131 0, 3600, 1)
132 if ok: 132 if ok:
133 self.project.setStatusMonitorInterval(interval) 133 self.project.setStatusMonitorInterval(interval)
134 134

eric ide

mercurial