Tasks/TaskViewer.py

changeset 2099
afde0e9110f7
parent 2000
a81bf687e4ee
child 2197
c4f24f8f34c0
equal deleted inserted replaced
2097:c5809ca16182 2099:afde0e9110f7
135 self.__backMenu.addSeparator() 135 self.__backMenu.addSeparator()
136 self.__backMenu.addAction(self.trUtf8("Resi&ze columns"), self.__resizeColumns) 136 self.__backMenu.addAction(self.trUtf8("Resi&ze columns"), self.__resizeColumns)
137 self.__backMenu.addSeparator() 137 self.__backMenu.addSeparator()
138 self.__backMenu.addAction(self.trUtf8("Configure..."), self.__configure) 138 self.__backMenu.addAction(self.trUtf8("Configure..."), self.__configure)
139 139
140 self.__activating = False
141
140 self.setContextMenuPolicy(Qt.CustomContextMenu) 142 self.setContextMenuPolicy(Qt.CustomContextMenu)
141 self.customContextMenuRequested.connect(self.__showContextMenu) 143 self.customContextMenuRequested.connect(self.__showContextMenu)
142 self.itemActivated.connect(self.__taskItemActivated) 144 self.itemActivated.connect(self.__taskItemActivated)
143 145
144 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) 146 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png"))
178 Private slot to handle the activation of an item. 180 Private slot to handle the activation of an item.
179 181
180 @param itm reference to the activated item (QTreeWidgetItem) 182 @param itm reference to the activated item (QTreeWidgetItem)
181 @param col column the item was activated in (integer) 183 @param col column the item was activated in (integer)
182 """ 184 """
183 fn = itm.getFilename() 185 if not self.__activating:
184 if fn: 186 self.__activating = True
185 self.displayFile.emit(fn, itm.getLineno()) 187 fn = itm.getFilename()
186 else: 188 if fn:
187 self.__editTaskProperties() 189 self.displayFile.emit(fn, itm.getLineno())
190 else:
191 self.__editTaskProperties()
192 self.__activating = False
188 193
189 def __showContextMenu(self, coord): 194 def __showContextMenu(self, coord):
190 """ 195 """
191 Private slot to show the context menu of the list. 196 Private slot to show the context menu of the list.
192 197

eric ide

mercurial