eric6/Project/ProjectResourcesBrowser.py

changeset 7911
4621c9082a43
parent 7836
2f0d208b8137
child 7923
91e843545d9a
equal deleted inserted replaced
7910:2eeec6bc49e6 7911:4621c9082a43
76 self.dirMenuActions = [] 76 self.dirMenuActions = []
77 self.dirMultiMenuActions = [] 77 self.dirMultiMenuActions = []
78 78
79 self.menu = QMenu(self) 79 self.menu = QMenu(self)
80 if self.project.getProjectType() in [ 80 if self.project.getProjectType() in [
81 "PyQt5", "PyQt5C", "E6Plugin", "PySide2", "PySide2C" 81 "PyQt5", "PyQt5C", "E6Plugin",
82 "PySide2", "PySide2C", "PySide6", "PySide6C"
82 ]: 83 ]:
83 self.menu.addAction( 84 self.menu.addAction(
84 self.tr('Compile resource'), 85 self.tr('Compile resource'),
85 self.__compileResource) 86 self.__compileResource)
86 self.menu.addAction( 87 self.menu.addAction(
118 self.menuActions.append(act) 119 self.menuActions.append(act)
119 act = self.menu.addAction(self.tr('Delete'), self.__deleteFile) 120 act = self.menu.addAction(self.tr('Delete'), self.__deleteFile)
120 self.menuActions.append(act) 121 self.menuActions.append(act)
121 self.menu.addSeparator() 122 self.menu.addSeparator()
122 if self.project.getProjectType() in [ 123 if self.project.getProjectType() in [
123 "PyQt5", "PyQt5C", "E6Plugin", "PySide2", "PySide2C" 124 "PyQt5", "PyQt5C", "E6Plugin",
125 "PySide2", "PySide2C", "PySide6", "PySide6C"
124 ]: 126 ]:
125 self.menu.addAction( 127 self.menu.addAction(
126 self.tr('New resource...'), self.__newResource) 128 self.tr('New resource...'), self.__newResource)
127 else: 129 else:
128 if self.hooks["newResource"] is not None: 130 if self.hooks["newResource"] is not None:
146 self.menu.addSeparator() 148 self.menu.addSeparator()
147 self.menu.addAction(self.tr('Configure...'), self._configure) 149 self.menu.addAction(self.tr('Configure...'), self._configure)
148 150
149 self.backMenu = QMenu(self) 151 self.backMenu = QMenu(self)
150 if self.project.getProjectType() in [ 152 if self.project.getProjectType() in [
151 "PyQt5", "PyQt5C", "E6Plugin", "PySide2", "PySide2C" 153 "PyQt5", "PyQt5C", "E6Plugin",
154 "PySide2", "PySide2C", "PySide6", "PySide6C"
152 ]: 155 ]:
153 self.backMenu.addAction( 156 self.backMenu.addAction(
154 self.tr('Compile all resources'), 157 self.tr('Compile all resources'),
155 self.__compileAllResources) 158 self.__compileAllResources)
156 self.backMenu.addSeparator() 159 self.backMenu.addSeparator()
188 self.backMenu.setEnabled(False) 191 self.backMenu.setEnabled(False)
189 192
190 # create the menu for multiple selected files 193 # create the menu for multiple selected files
191 self.multiMenu = QMenu(self) 194 self.multiMenu = QMenu(self)
192 if self.project.getProjectType() in [ 195 if self.project.getProjectType() in [
193 "PyQt5", "PyQt5C", "E6Plugin", "PySide2", "PySide2C" 196 "PyQt5", "PyQt5C", "E6Plugin",
197 "PySide2", "PySide2C", "PySide6", "PySide6C"
194 ]: 198 ]:
195 act = self.multiMenu.addAction( 199 act = self.multiMenu.addAction(
196 self.tr('Compile resources'), 200 self.tr('Compile resources'),
197 self.__compileSelectedResources) 201 self.__compileSelectedResources)
198 self.multiMenu.addSeparator() 202 self.multiMenu.addSeparator()
224 self.multiMenu.addSeparator() 228 self.multiMenu.addSeparator()
225 self.multiMenu.addAction(self.tr('Configure...'), self._configure) 229 self.multiMenu.addAction(self.tr('Configure...'), self._configure)
226 230
227 self.dirMenu = QMenu(self) 231 self.dirMenu = QMenu(self)
228 if self.project.getProjectType() in [ 232 if self.project.getProjectType() in [
229 "PyQt5", "PyQt5C", "E6Plugin", "PySide2", "PySide2C" 233 "PyQt5", "PyQt5C", "E6Plugin",
234 "PySide2", "PySide2C", "PySide6", "PySide6C"
230 ]: 235 ]:
231 self.dirMenu.addAction( 236 self.dirMenu.addAction(
232 self.tr('Compile all resources'), 237 self.tr('Compile all resources'),
233 self.__compileAllResources) 238 self.__compileAllResources)
234 self.dirMenu.addSeparator() 239 self.dirMenu.addSeparator()
269 self.dirMenu.addSeparator() 274 self.dirMenu.addSeparator()
270 self.dirMenu.addAction(self.tr('Configure...'), self._configure) 275 self.dirMenu.addAction(self.tr('Configure...'), self._configure)
271 276
272 self.dirMultiMenu = QMenu(self) 277 self.dirMultiMenu = QMenu(self)
273 if self.project.getProjectType() in [ 278 if self.project.getProjectType() in [
274 "PyQt5", "PyQt5C", "E6Plugin", "PySide2", "PySide2C" 279 "PyQt5", "PyQt5C", "E6Plugin",
280 "PySide2", "PySide2C", "PySide6", "PySide6C"
275 ]: 281 ]:
276 self.dirMultiMenu.addAction( 282 self.dirMultiMenu.addAction(
277 self.tr('Compile all resources'), 283 self.tr('Compile all resources'),
278 self.__compileAllResources) 284 self.__compileAllResources)
279 self.dirMultiMenu.addSeparator() 285 self.dirMultiMenu.addSeparator()
547 ########################################################################### 553 ###########################################################################
548 554
549 def __readStdout(self): 555 def __readStdout(self):
550 """ 556 """
551 Private slot to handle the readyReadStandardOutput signal of the 557 Private slot to handle the readyReadStandardOutput signal of the
552 pyrcc5/pyside2-rcc process. 558 pyrcc5/pyside2-rcc/pyside6-rcc process.
553 """ 559 """
554 if self.compileProc is None: 560 if self.compileProc is None:
555 return 561 return
556 self.compileProc.setReadChannel(QProcess.StandardOutput) 562 self.compileProc.setReadChannel(QProcess.StandardOutput)
557 563
561 'replace') 567 'replace')
562 568
563 def __readStderr(self): 569 def __readStderr(self):
564 """ 570 """
565 Private slot to handle the readyReadStandardError signal of the 571 Private slot to handle the readyReadStandardError signal of the
566 pyrcc5/pyside2-rcc/ process. 572 pyrcc5/pyside2-rcc/pyside6-rcc process.
567 """ 573 """
568 if self.compileProc is None: 574 if self.compileProc is None:
569 return 575 return
570 576
571 ioEncoding = Preferences.getSystem("IOEncoding") 577 ioEncoding = Preferences.getSystem("IOEncoding")
653 self.rccCompiler = Utilities.generatePyQtToolPath('pyrcc5') 659 self.rccCompiler = Utilities.generatePyQtToolPath('pyrcc5')
654 elif self.project.getProjectType() in ["E6Plugin"]: 660 elif self.project.getProjectType() in ["E6Plugin"]:
655 self.rccCompiler = Utilities.generatePyQtToolPath('pyrcc5') 661 self.rccCompiler = Utilities.generatePyQtToolPath('pyrcc5')
656 elif self.project.getProjectType() in ["PySide2", "PySide2C"]: 662 elif self.project.getProjectType() in ["PySide2", "PySide2C"]:
657 self.rccCompiler = Utilities.generatePySideToolPath( 663 self.rccCompiler = Utilities.generatePySideToolPath(
658 'pyside2-rcc') 664 'pyside2-rcc', variant=2)
665 elif self.project.getProjectType() in ["PySide6", "PySide6C"]:
666 self.rccCompiler = Utilities.generatePySideToolPath(
667 'pyside6-rcc', variant=6)
659 else: 668 else:
660 return None 669 return None
661 defaultParameters = self.project.getDefaultRccCompilerParameters() 670 defaultParameters = self.project.getDefaultRccCompilerParameters()
662 rccParameters = self.project.pdata["RCCPARAMS"] 671 rccParameters = self.project.pdata["RCCPARAMS"]
663 if ( 672 if (

eric ide

mercurial