14 from PyQt4.QtCore import * |
14 from PyQt4.QtCore import * |
15 from PyQt4.QtGui import * |
15 from PyQt4.QtGui import * |
16 |
16 |
17 from E4Gui.E4Application import e4App |
17 from E4Gui.E4Application import e4App |
18 |
18 |
19 from ProjectBrowserModel import ProjectBrowserFileItem, \ |
19 from .ProjectBrowserModel import ProjectBrowserFileItem, \ |
20 ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem, \ |
20 ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem, \ |
21 ProjectBrowserInterfaceType |
21 ProjectBrowserInterfaceType |
22 from ProjectBaseBrowser import ProjectBaseBrowser |
22 from .ProjectBaseBrowser import ProjectBaseBrowser |
23 |
23 |
24 from UI.BrowserModel import BrowserFileItem, BrowserClassItem, BrowserMethodItem, \ |
24 from UI.BrowserModel import BrowserFileItem, BrowserClassItem, BrowserMethodItem, \ |
25 BrowserClassAttributeItem |
25 BrowserClassAttributeItem |
26 from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog |
26 from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog |
27 import UI.PixmapCache |
27 import UI.PixmapCache |
249 categories = self.getSelectedItemsCountCategorized(\ |
249 categories = self.getSelectedItemsCountCategorized(\ |
250 [ProjectBrowserFileItem, BrowserClassItem, |
250 [ProjectBrowserFileItem, BrowserClassItem, |
251 BrowserMethodItem, ProjectBrowserSimpleDirectoryItem]) |
251 BrowserMethodItem, ProjectBrowserSimpleDirectoryItem]) |
252 cnt = categories["sum"] |
252 cnt = categories["sum"] |
253 |
253 |
254 bfcnt = categories[unicode(ProjectBrowserFileItem)] |
254 bfcnt = categories[str(ProjectBrowserFileItem)] |
255 cmcnt = categories[unicode(BrowserClassItem)] + \ |
255 cmcnt = categories[str(BrowserClassItem)] + \ |
256 categories[unicode(BrowserMethodItem)] |
256 categories[str(BrowserMethodItem)] |
257 sdcnt = categories[unicode(ProjectBrowserSimpleDirectoryItem)] |
257 sdcnt = categories[str(ProjectBrowserSimpleDirectoryItem)] |
258 if cnt > 1 and cnt == bfcnt: |
258 if cnt > 1 and cnt == bfcnt: |
259 self.multiMenu.popup(self.mapToGlobal(coord)) |
259 self.multiMenu.popup(self.mapToGlobal(coord)) |
260 elif cnt > 1 and cnt == sdcnt: |
260 elif cnt > 1 and cnt == sdcnt: |
261 self.dirMultiMenu.popup(self.mapToGlobal(coord)) |
261 self.dirMultiMenu.popup(self.mapToGlobal(coord)) |
262 else: |
262 else: |
407 Private slot to handle the readyReadStandardOutput signal of the omniidl process. |
407 Private slot to handle the readyReadStandardOutput signal of the omniidl process. |
408 """ |
408 """ |
409 if self.compileProc is None: |
409 if self.compileProc is None: |
410 return |
410 return |
411 |
411 |
412 ioEncoding = str(Preferences.getSystem("IOEncoding")) |
412 ioEncoding = Preferences.getSystem("IOEncoding") |
413 |
413 |
414 self.compileProc.setReadChannel(QProcess.StandardOutput) |
414 self.compileProc.setReadChannel(QProcess.StandardOutput) |
415 while self.compileProc and self.compileProc.canReadLine(): |
415 while self.compileProc and self.compileProc.canReadLine(): |
416 s = 'omniidl: ' |
416 s = 'omniidl: ' |
417 output = unicode(self.compileProc.readLine(), |
417 output = str(self.compileProc.readLine(), ioEncoding, 'replace') |
418 ioEncoding, 'replace') |
|
419 s += output |
418 s += output |
420 self.emit(SIGNAL('appendStdout'), s) |
419 self.emit(SIGNAL('appendStdout'), s) |
421 |
420 |
422 def __readStderr(self): |
421 def __readStderr(self): |
423 """ |
422 """ |
424 Private slot to handle the readyReadStandardError signal of the omniidl process. |
423 Private slot to handle the readyReadStandardError signal of the omniidl process. |
425 """ |
424 """ |
426 if self.compileProc is None: |
425 if self.compileProc is None: |
427 return |
426 return |
428 |
427 |
429 ioEncoding = str(Preferences.getSystem("IOEncoding")) |
428 ioEncoding = Preferences.getSystem("IOEncoding") |
430 |
429 |
431 self.compileProc.setReadChannel(QProcess.StandardError) |
430 self.compileProc.setReadChannel(QProcess.StandardError) |
432 while self.compileProc and self.compileProc.canReadLine(): |
431 while self.compileProc and self.compileProc.canReadLine(): |
433 s = 'omniidl: ' |
432 s = 'omniidl: ' |
434 error = unicode(self.compileProc.readLine(), |
433 error = str(self.compileProc.readLine(), ioEncoding, 'replace') |
435 ioEncoding, 'replace') |
|
436 s += error |
434 s += error |
437 self.emit(SIGNAL('appendStderr'), s) |
435 self.emit(SIGNAL('appendStderr'), s) |
438 |
436 |
439 def __compileIDLDone(self, exitCode, exitStatus): |
437 def __compileIDLDone(self, exitCode, exitStatus): |
440 """ |
438 """ |