def __init__(self, project, parent=None):
        """
        Constructor
        
        @param project reference to the project object
        @param parent parent widget of this browser (QWidget)
        """
        ProjectBaseBrowser.__init__(self, project, ProjectBrowserTranslationType, parent)
        self.isTranslationsBrowser = True
        
        self.selectedItemsFilter = \
            [ProjectBrowserFileItem, ProjectBrowserSimpleDirectoryItem]
        
        self.setWindowTitle(self.trUtf8('Translations'))

        self.setWhatsThis(self.trUtf8(
            """<b>Project Translations Browser</b>"""
            """<p>This allows to easily see all translations contained in the current"""
            """ project. Several actions can be executed via the context menu.</p>"""
        ))
        
        self.lreleaseProc = None
        self.lreleaseProcRunning = False
        self.pylupdateProcRunning = False
        self.__tmpProjects = []
        self.__pylupdateProcesses = []
    def __init__(self, project, parent=None):
        """
        Constructor
        
        @param project reference to the project object
        @param parent parent widget of this browser (QWidget)
        """
        ProjectBaseBrowser.__init__(self, project, ProjectBrowserOthersType, parent)
    
        self.selectedItemsFilter = [ProjectBrowserFileItem, ProjectBrowserDirectoryItem]
        self.specialMenuEntries = [1]

        self.setWindowTitle(self.trUtf8('Others'))

        self.setWhatsThis(self.trUtf8(
            """<b>Project Others Browser</b>"""
            """<p>This allows to easily see all other files and directories"""
            """ contained in the current project. Several actions can be"""
            """ executed via the context menu. The entry which is registered"""
            """ in the project is shown in a different colour.</p>"""
        ))
        
        self.connect(project, SIGNAL("prepareRepopulateItem"), 
            self._prepareRepopulateItem)
        self.connect(project, SIGNAL("completeRepopulateItem"),
            self._completeRepopulateItem)
 def __showContextMenuBack(self):
     """
     Private slot called by the backMenu aboutToShow signal.
     """
     ProjectBaseBrowser._showContextMenuBack(self, self.backMenu)
     
     self.emit(SIGNAL("showMenu"), "MainBack", self.backMenu)
 def __showContextMenuMulti(self):
     """
     Private slot called by the multiMenu aboutToShow signal.
     """
     ProjectBaseBrowser._showContextMenuMulti(self, self.multiMenu)
     
     self.emit(SIGNAL("showMenu"), "MainMulti", self.multiMenu)
Beispiel #5
0
    def __init__(self, project, parent=None):
        """
        Constructor
        
        @param project reference to the project object
        @param parent parent widget of this browser (QWidget)
        """
        self.omniidl = unicode(Preferences.getCorba("omniidl"))
        if self.omniidl == "":
            self.omniidl = Utilities.isWindowsPlatform() and "omniidl.exe" or "omniidl"
        if not Utilities.isinpath(self.omniidl):
            self.omniidl = None

        ProjectBaseBrowser.__init__(self, project, ProjectBrowserInterfaceType, parent)

        self.selectedItemsFilter = [ProjectBrowserFileItem, ProjectBrowserSimpleDirectoryItem]

        self.setWindowTitle(self.trUtf8("Interfaces (IDL)"))

        self.setWhatsThis(
            self.trUtf8(
                """<b>Project Interfaces Browser</b>"""
                """<p>This allows to easily see all interfaces (CORBA IDL files)"""
                """ contained in the current project. Several actions can be executed"""
                """ via the context menu.</p>"""
            )
        )

        self.connect(project, SIGNAL("prepareRepopulateItem"), self._prepareRepopulateItem)
        self.connect(project, SIGNAL("completeRepopulateItem"), self._completeRepopulateItem)
Beispiel #6
0
    def __showContextMenuDir(self):
        """
        Private slot called by the dirMenu aboutToShow signal.
        """
        ProjectBaseBrowser._showContextMenuDir(self, self.dirMenu)

        self.emit(SIGNAL("showMenu"), "MainDir", self.dirMenu)
 def __showContextMenuDir(self):
     """
     Private slot called by the dirMenu aboutToShow signal.
     """
     if self.project.getProjectType() in \
             ["Qt4", "Qt4C", "E4Plugin", "PySide", "PySideC"]:
         if self.pylupdateProcRunning:
             for act in self.tsprocDirMenuActions:
                 act.setEnabled(False)
         if self.lreleaseProcRunning:
             for act in self.qmprocDirMenuActions:
                 act.setEnabled(True)
     self.__addTranslationDirAct.setEnabled(self.project.getTranslationPattern() != "")
     
     ProjectBaseBrowser._showContextMenuDir(self, self.dirMenu)
     
     self.emit(SIGNAL("showMenu"), "MainDir", self.dirMenu)
 def __showContextMenu(self):
     """
     Private slot called by the menu 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.tsMenuActions + self.qmMenuActions:
                 act.setEnabled(False)
         elif tsFiles > 0:
             for act in self.tsMenuActions:
                 act.setEnabled(True)
             for act in self.qmMenuActions:
                 act.setEnabled(False)
         elif qmFiles > 0:
             for act in self.tsMenuActions:
                 act.setEnabled(False)
             for act in self.qmMenuActions:
                 act.setEnabled(True)
         if self.pylupdateProcRunning:
             for act in self.tsprocMenuActions:
                 act.setEnabled(False)
         if self.lreleaseProcRunning:
             for act in self.qmprocMenuActions:
                 act.setEnabled(True)
     self.__addTranslationAct.setEnabled(self.project.getTranslationPattern() != "")
     
     ProjectBaseBrowser._showContextMenu(self, self.menu)
     
     self.emit(SIGNAL("showMenu"), "Main", self.menu)
    def _createPopupMenus(self):
        """
        Protected overloaded method to generate the popup menu.
        """
        ProjectBaseBrowser._createPopupMenus(self)
        
        self.editPixmapAct = \
            self.menu.addAction(self.trUtf8('Open in Icon Editor'), 
            self._editPixmap)
        self.menu.addSeparator()
        self.renameFileAct = self.menu.addAction(self.trUtf8('Rename file'), 
            self._renameFile)
        self.menuActions.append(self.renameFileAct)
        act = self.menu.addAction(self.trUtf8('Remove from project'), self.__removeItem)
        self.menuActions.append(act)
        act = self.menu.addAction(self.trUtf8('Delete'), self.__deleteItem)
        self.menuActions.append(act)
        self.menu.addSeparator()
        self.menu.addAction(self.trUtf8('Add files...'), self.project.addOthersFiles)
        self.menu.addAction(self.trUtf8('Add directory...'), self.project.addOthersDir)
        self.menu.addSeparator()
        self.menu.addAction(self.trUtf8('Refresh'), self.__refreshItem)
        self.menu.addSeparator()
        self.menu.addAction(self.trUtf8('Copy Path to Clipboard'), 
            self._copyToClipboard)
        self.menu.addSeparator()
        self.menu.addAction(self.trUtf8('Expand all directories'), 
            self._expandAllDirs)
        self.menu.addAction(self.trUtf8('Collapse all directories'), 
            self._collapseAllDirs)
        self.menu.addSeparator()
        self.menu.addAction(self.trUtf8('Configure...'), self._configure)

        self.backMenu = QMenu(self)
        self.backMenu.addAction(self.trUtf8('Add files...'), 
            self.project.addOthersFiles)
        self.backMenu.addAction(self.trUtf8('Add directory...'), 
            self.project.addOthersDir)
        self.backMenu.addSeparator()
        self.backMenu.addAction(self.trUtf8('Expand all directories'), 
            self._expandAllDirs)
        self.backMenu.addAction(self.trUtf8('Collapse all directories'), 
            self._collapseAllDirs)
        self.backMenu.addSeparator()
        self.backMenu.addAction(self.trUtf8('Configure...'), self._configure)
        self.backMenu.setEnabled(False)

        self.multiMenu.addSeparator()
        act = self.multiMenu.addAction(self.trUtf8('Remove from project'), 
            self.__removeItem)
        self.multiMenuActions.append(act)
        act = self.multiMenu.addAction(self.trUtf8('Delete'), self.__deleteItem)
        self.multiMenuActions.append(act)
        self.multiMenu.addSeparator()
        self.multiMenu.addAction(self.trUtf8('Expand all directories'), 
            self._expandAllDirs)
        self.multiMenu.addAction(self.trUtf8('Collapse all directories'), 
            self._collapseAllDirs)
        self.multiMenu.addSeparator()
        self.multiMenu.addAction(self.trUtf8('Configure...'), self._configure)
        
        self.connect(self.menu, SIGNAL('aboutToShow()'),
            self.__showContextMenu)
        self.connect(self.multiMenu, SIGNAL('aboutToShow()'),
            self.__showContextMenuMulti)
        self.connect(self.backMenu, SIGNAL('aboutToShow()'),
            self.__showContextMenuBack)
        self.mainMenu = self.menu