def __showContextMenuMulti(self): """ Private slot called by the multiMenu aboutToShow signal. """ ProjectBaseBrowser._showContextMenuMulti(self, self.multiMenu) self.emit(SIGNAL("showMenu"), "MainMulti", self.multiMenu)
def __showContextMenuMulti(self): """ Private slot called by the multiMenu aboutToShow signal. """ if self.project.getProjectType() in \ ["Qt4", "Qt4C", "E4Plugin", "PySide", "PySideC"]: tsFiles = 0 qmFiles = 0 itmList = self.getSelectedItems() for itm in itmList[:]: if itm.fileName().endswith('.ts'): tsFiles += 1 elif itm.fileName().endswith('.qm'): qmFiles += 1 if (tsFiles > 0 and qmFiles > 0) or \ (tsFiles == 0 and qmFiles == 0): for act in self.tsMultiMenuActions + self.qmMultiMenuActions: act.setEnabled(False) elif tsFiles > 0: for act in self.tsMultiMenuActions: act.setEnabled(True) for act in self.qmMultiMenuActions: act.setEnabled(False) elif qmFiles > 0: for act in self.tsMultiMenuActions: act.setEnabled(False) for act in self.qmMultiMenuActions: act.setEnabled(True) if self.pylupdateProcRunning: for act in self.tsprocMultiMenuActions: act.setEnabled(False) if self.lreleaseProcRunning: for act in self.qmprocMultiMenuActions: act.setEnabled(True) ProjectBaseBrowser._showContextMenuMulti(self, self.multiMenu) self.emit(SIGNAL("showMenu"), "MainMulti", self.multiMenu)