414 self.__backMenu.addSeparator() |
414 self.__backMenu.addSeparator() |
415 self.__backMenu.addAction(self.trUtf8("Help about Templates..."), self.__showHelp) |
415 self.__backMenu.addAction(self.trUtf8("Help about Templates..."), self.__showHelp) |
416 self.__backMenu.addSeparator() |
416 self.__backMenu.addSeparator() |
417 self.__backMenu.addAction(self.trUtf8("Configure..."), self.__configure) |
417 self.__backMenu.addAction(self.trUtf8("Configure..."), self.__configure) |
418 |
418 |
|
419 self.__activating = False |
|
420 |
419 self.setContextMenuPolicy(Qt.CustomContextMenu) |
421 self.setContextMenuPolicy(Qt.CustomContextMenu) |
420 self.customContextMenuRequested.connect(self.__showContextMenu) |
422 self.customContextMenuRequested.connect(self.__showContextMenu) |
421 self.itemActivated.connect(self.__templateItemActivated) |
423 self.itemActivated.connect(self.__templateItemActivated) |
422 |
424 |
423 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) |
425 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) |
433 Private slot to handle the activation of an item. |
435 Private slot to handle the activation of an item. |
434 |
436 |
435 @param itm reference to the activated item (QTreeWidgetItem) |
437 @param itm reference to the activated item (QTreeWidgetItem) |
436 @param col column the item was activated in (integer) |
438 @param col column the item was activated in (integer) |
437 """ |
439 """ |
438 itm = self.currentItem() |
440 if not self.__activating: |
439 if isinstance(itm, TemplateEntry): |
441 self.__activating = True |
440 self.applyTemplate(itm) |
442 itm = self.currentItem() |
|
443 if isinstance(itm, TemplateEntry): |
|
444 self.applyTemplate(itm) |
|
445 self.__activating = False |
441 |
446 |
442 def __showContextMenu(self, coord): |
447 def __showContextMenu(self, coord): |
443 """ |
448 """ |
444 Private slot to show the context menu of the list. |
449 Private slot to show the context menu of the list. |
445 |
450 |