34 @signal closeSourceWindow(string) emitted after a file has been removed/deleted |
34 @signal closeSourceWindow(string) emitted after a file has been removed/deleted |
35 from the project |
35 from the project |
36 @signal showMenu(string, QMenu) emitted when a menu is about to be shown. The name |
36 @signal showMenu(string, QMenu) emitted when a menu is about to be shown. The name |
37 of the menu and a reference to the menu are given. |
37 of the menu and a reference to the menu are given. |
38 """ |
38 """ |
|
39 appendStderr = pyqtSignal(str) |
39 sourceFile = pyqtSignal(str) |
40 sourceFile = pyqtSignal(str) |
|
41 closeSourceWindow = pyqtSignal(str) |
|
42 showMenu = pyqtSignal(str, QMenu) |
40 |
43 |
41 RCFilenameFormatPython = "{0}_rc.py" |
44 RCFilenameFormatPython = "{0}_rc.py" |
42 RCFilenameFormatRuby = "{0}_rc.rb" |
45 RCFilenameFormatRuby = "{0}_rc.rb" |
43 |
46 |
44 def __init__(self, project, parent = None): |
47 def __init__(self, project, parent = None): |
287 """ |
290 """ |
288 Private slot called by the menu aboutToShow signal. |
291 Private slot called by the menu aboutToShow signal. |
289 """ |
292 """ |
290 ProjectBaseBrowser._showContextMenu(self, self.menu) |
293 ProjectBaseBrowser._showContextMenu(self, self.menu) |
291 |
294 |
292 self.emit(SIGNAL("showMenu"), "Main", self.menu) |
295 self.showMenu.emit("Main", self.menu) |
293 |
296 |
294 def __showContextMenuMulti(self): |
297 def __showContextMenuMulti(self): |
295 """ |
298 """ |
296 Private slot called by the multiMenu aboutToShow signal. |
299 Private slot called by the multiMenu aboutToShow signal. |
297 """ |
300 """ |
298 ProjectBaseBrowser._showContextMenuMulti(self, self.multiMenu) |
301 ProjectBaseBrowser._showContextMenuMulti(self, self.multiMenu) |
299 |
302 |
300 self.emit(SIGNAL("showMenu"), "MainMulti", self.multiMenu) |
303 self.showMenu.emit("MainMulti", self.multiMenu) |
301 |
304 |
302 def __showContextMenuDir(self): |
305 def __showContextMenuDir(self): |
303 """ |
306 """ |
304 Private slot called by the dirMenu aboutToShow signal. |
307 Private slot called by the dirMenu aboutToShow signal. |
305 """ |
308 """ |
306 ProjectBaseBrowser._showContextMenuDir(self, self.dirMenu) |
309 ProjectBaseBrowser._showContextMenuDir(self, self.dirMenu) |
307 |
310 |
308 self.emit(SIGNAL("showMenu"), "MainDir", self.dirMenu) |
311 self.showMenu.emit("MainDir", self.dirMenu) |
309 |
312 |
310 def __showContextMenuDirMulti(self): |
313 def __showContextMenuDirMulti(self): |
311 """ |
314 """ |
312 Private slot called by the dirMultiMenu aboutToShow signal. |
315 Private slot called by the dirMultiMenu aboutToShow signal. |
313 """ |
316 """ |
314 ProjectBaseBrowser._showContextMenuDirMulti(self, self.dirMultiMenu) |
317 ProjectBaseBrowser._showContextMenuDirMulti(self, self.dirMultiMenu) |
315 |
318 |
316 self.emit(SIGNAL("showMenu"), "MainDirMulti", self.dirMultiMenu) |
319 self.showMenu.emit("MainDirMulti", self.dirMultiMenu) |
317 |
320 |
318 def __showContextMenuBack(self): |
321 def __showContextMenuBack(self): |
319 """ |
322 """ |
320 Private slot called by the backMenu aboutToShow signal. |
323 Private slot called by the backMenu aboutToShow signal. |
321 """ |
324 """ |
322 ProjectBaseBrowser._showContextMenuBack(self, self.backMenu) |
325 ProjectBaseBrowser._showContextMenuBack(self, self.backMenu) |
323 |
326 |
324 self.emit(SIGNAL("showMenu"), "MainBack", self.backMenu) |
327 self.showMenu.emit("MainBack", self.backMenu) |
325 |
328 |
326 def __addResourceFiles(self): |
329 def __addResourceFiles(self): |
327 """ |
330 """ |
328 Private method to add resource files to the project. |
331 Private method to add resource files to the project. |
329 """ |
332 """ |
454 self.trUtf8("Do you really want to delete these resources from the project?"), |
457 self.trUtf8("Do you really want to delete these resources from the project?"), |
455 files) |
458 files) |
456 |
459 |
457 if dlg.exec_() == QDialog.Accepted: |
460 if dlg.exec_() == QDialog.Accepted: |
458 for fn2, fn in zip(fullNames, files): |
461 for fn2, fn in zip(fullNames, files): |
459 self.emit(SIGNAL('closeSourceWindow'), fn2) |
462 self.closeSourceWindow.emit(fn2) |
460 self.project.deleteFile(fn) |
463 self.project.deleteFile(fn) |
461 |
464 |
462 ############################################################################ |
465 ############################################################################ |
463 ## Methods to handle the various compile commands |
466 ## Methods to handle the various compile commands |
464 ############################################################################ |
467 ############################################################################ |
491 while self.compileProc and self.compileProc.canReadLine(): |
494 while self.compileProc and self.compileProc.canReadLine(): |
492 s = self.rccCompiler + ': ' |
495 s = self.rccCompiler + ': ' |
493 error = str(self.compileProc.readLine(), |
496 error = str(self.compileProc.readLine(), |
494 ioEncoding, 'replace') |
497 ioEncoding, 'replace') |
495 s += error |
498 s += error |
496 self.emit(SIGNAL('appendStderr'), s) |
499 self.appendStderr.emit(s) |
497 |
500 |
498 def __compileQRCDone(self, exitCode, exitStatus): |
501 def __compileQRCDone(self, exitCode, exitStatus): |
499 """ |
502 """ |
500 Private slot to handle the finished signal of the compile process. |
503 Private slot to handle the finished signal of the compile process. |
501 |
504 |