130 self.sourceMenu.addAction( |
128 self.sourceMenu.addAction( |
131 self.tr('Collapse all directories'), self._collapseAllDirs) |
129 self.tr('Collapse all directories'), self._collapseAllDirs) |
132 self.sourceMenu.addSeparator() |
130 self.sourceMenu.addSeparator() |
133 self.sourceMenu.addAction(self.tr('Configure...'), self._configure) |
131 self.sourceMenu.addAction(self.tr('Configure...'), self._configure) |
134 self.sourceMenu.addAction( |
132 self.sourceMenu.addAction( |
135 self.tr('Configure CORBA...'), self.__configureCorba) |
133 self.tr('Configure Protobuf...'), self.__configureProtobuf) |
136 |
134 |
137 self.menu = QMenu(self) |
135 self.menu = QMenu(self) |
138 if self.omniidl is not None: |
136 if self.__protoc is not None: |
139 self.menu.addAction( |
137 self.menu.addAction( |
140 self.tr('Compile interface'), self.__compileInterface) |
138 self.tr('Compile protocol'), self.__compileProtocol) |
141 self.menu.addAction( |
139 self.menu.addAction( |
142 self.tr('Compile all interfaces'), |
140 self.tr('Compile all protocols'), |
143 self.__compileAllInterfaces) |
141 self.__compileAllProtocols) |
144 self.menu.addAction(self.tr('Open'), self._openItem) |
142 self.menu.addAction(self.tr('Open'), self._openItem) |
145 self.menu.addSeparator() |
143 self.menu.addSeparator() |
146 self.menu.addAction( |
144 self.menu.addAction( |
147 self.tr('Add interfaces...'), self.__addInterfaceFiles) |
145 self.tr('Add protocols...'), self.__addProtocolFiles) |
148 self.menu.addAction( |
146 self.menu.addAction( |
149 self.tr('Add interfaces directory...'), |
147 self.tr('Add protocols directory...'), |
150 self.__addInterfacesDirectory) |
148 self.__addProtocolsDirectory) |
151 self.menu.addSeparator() |
149 self.menu.addSeparator() |
152 self.menu.addAction( |
150 self.menu.addAction( |
153 self.tr('Expand all directories'), self._expandAllDirs) |
151 self.tr('Expand all directories'), self._expandAllDirs) |
154 self.menu.addAction( |
152 self.menu.addAction( |
155 self.tr('Collapse all directories'), self._collapseAllDirs) |
153 self.tr('Collapse all directories'), self._collapseAllDirs) |
156 self.menu.addSeparator() |
154 self.menu.addSeparator() |
157 self.menu.addAction(self.tr('Configure...'), self._configure) |
155 self.menu.addAction(self.tr('Configure...'), self._configure) |
158 self.menu.addAction( |
156 self.menu.addAction( |
159 self.tr('Configure CORBA...'), self.__configureCorba) |
157 self.tr('Configure Protobuf...'), self.__configureProtobuf) |
160 |
158 |
161 self.backMenu = QMenu(self) |
159 self.backMenu = QMenu(self) |
162 if self.omniidl is not None: |
160 if self.__protoc is not None: |
163 self.backMenu.addAction( |
161 self.backMenu.addAction( |
164 self.tr('Compile all interfaces'), |
162 self.tr('Compile all protocols'), |
165 self.__compileAllInterfaces) |
163 self.__compileAllProtocols) |
166 self.backMenu.addSeparator() |
164 self.backMenu.addSeparator() |
167 self.backMenu.addAction( |
165 self.backMenu.addAction( |
168 self.tr('Add interfaces...'), self.project.addIdlFiles) |
166 self.tr('Add protocols...'), self.project.addProtoFiles) |
169 self.backMenu.addAction( |
167 self.backMenu.addAction( |
170 self.tr('Add interfaces directory...'), self.project.addIdlDir) |
168 self.tr('Add protocols directory...'), self.project.addProtoDir) |
171 self.backMenu.addSeparator() |
169 self.backMenu.addSeparator() |
172 self.backMenu.addAction( |
170 self.backMenu.addAction( |
173 self.tr('Expand all directories'), self._expandAllDirs) |
171 self.tr('Expand all directories'), self._expandAllDirs) |
174 self.backMenu.addAction( |
172 self.backMenu.addAction( |
175 self.tr('Collapse all directories'), self._collapseAllDirs) |
173 self.tr('Collapse all directories'), self._collapseAllDirs) |
176 self.backMenu.addSeparator() |
174 self.backMenu.addSeparator() |
177 self.backMenu.addAction(self.tr('Configure...'), self._configure) |
175 self.backMenu.addAction(self.tr('Configure...'), self._configure) |
178 self.backMenu.addAction( |
176 self.backMenu.addAction( |
179 self.tr('Configure CORBA...'), self.__configureCorba) |
177 self.tr('Configure Protobuf...'), self.__configureProtobuf) |
180 self.backMenu.setEnabled(False) |
178 self.backMenu.setEnabled(False) |
181 |
179 |
182 # create the menu for multiple selected files |
180 # create the menu for multiple selected files |
183 self.multiMenu = QMenu(self) |
181 self.multiMenu = QMenu(self) |
184 if self.omniidl is not None: |
182 if self.__protoc is not None: |
185 self.multiMenu.addAction( |
183 self.multiMenu.addAction( |
186 self.tr('Compile interfaces'), |
184 self.tr('Compile protocols'), |
187 self.__compileSelectedInterfaces) |
185 self.__compileSelectedProtocols) |
188 self.multiMenu.addAction(self.tr('Open'), self._openItem) |
186 self.multiMenu.addAction(self.tr('Open'), self._openItem) |
189 self.multiMenu.addSeparator() |
187 self.multiMenu.addSeparator() |
190 act = self.multiMenu.addAction( |
188 act = self.multiMenu.addAction( |
191 self.tr('Remove from project'), self._removeFile) |
189 self.tr('Remove from project'), self._removeFile) |
192 self.multiMenuActions.append(act) |
190 self.multiMenuActions.append(act) |
199 self.multiMenu.addAction( |
197 self.multiMenu.addAction( |
200 self.tr('Collapse all directories'), self._collapseAllDirs) |
198 self.tr('Collapse all directories'), self._collapseAllDirs) |
201 self.multiMenu.addSeparator() |
199 self.multiMenu.addSeparator() |
202 self.multiMenu.addAction(self.tr('Configure...'), self._configure) |
200 self.multiMenu.addAction(self.tr('Configure...'), self._configure) |
203 self.multiMenu.addAction( |
201 self.multiMenu.addAction( |
204 self.tr('Configure CORBA...'), self.__configureCorba) |
202 self.tr('Configure Protobuf...'), self.__configureProtobuf) |
205 |
203 |
206 self.dirMenu = QMenu(self) |
204 self.dirMenu = QMenu(self) |
207 if self.omniidl is not None: |
205 if self.__protoc is not None: |
208 self.dirMenu.addAction( |
206 self.dirMenu.addAction( |
209 self.tr('Compile all interfaces'), |
207 self.tr('Compile all protocols'), |
210 self.__compileAllInterfaces) |
208 self.__compileAllProtocols) |
211 self.dirMenu.addSeparator() |
209 self.dirMenu.addSeparator() |
212 act = self.dirMenu.addAction( |
210 act = self.dirMenu.addAction( |
213 self.tr('Remove from project'), self._removeFile) |
211 self.tr('Remove from project'), self._removeFile) |
214 self.dirMenuActions.append(act) |
212 self.dirMenuActions.append(act) |
215 act = self.dirMenu.addAction( |
213 act = self.dirMenu.addAction( |
216 self.tr('Delete'), self._deleteDirectory) |
214 self.tr('Delete'), self._deleteDirectory) |
217 self.dirMenuActions.append(act) |
215 self.dirMenuActions.append(act) |
218 self.dirMenu.addSeparator() |
216 self.dirMenu.addSeparator() |
219 self.dirMenu.addAction( |
217 self.dirMenu.addAction( |
220 self.tr('Add interfaces...'), self.__addInterfaceFiles) |
218 self.tr('Add protocols...'), self.__addProtocolFiles) |
221 self.dirMenu.addAction( |
219 self.dirMenu.addAction( |
222 self.tr('Add interfaces directory...'), |
220 self.tr('Add protocols directory...'), |
223 self.__addInterfacesDirectory) |
221 self.__addProtocolsDirectory) |
224 self.dirMenu.addSeparator() |
222 self.dirMenu.addSeparator() |
225 self.dirMenu.addAction( |
223 self.dirMenu.addAction( |
226 self.tr('Copy Path to Clipboard'), self._copyToClipboard) |
224 self.tr('Copy Path to Clipboard'), self._copyToClipboard) |
227 self.dirMenu.addSeparator() |
225 self.dirMenu.addSeparator() |
228 self.dirMenu.addAction( |
226 self.dirMenu.addAction( |
230 self.dirMenu.addAction( |
228 self.dirMenu.addAction( |
231 self.tr('Collapse all directories'), self._collapseAllDirs) |
229 self.tr('Collapse all directories'), self._collapseAllDirs) |
232 self.dirMenu.addSeparator() |
230 self.dirMenu.addSeparator() |
233 self.dirMenu.addAction(self.tr('Configure...'), self._configure) |
231 self.dirMenu.addAction(self.tr('Configure...'), self._configure) |
234 self.dirMenu.addAction( |
232 self.dirMenu.addAction( |
235 self.tr('Configure CORBA...'), self.__configureCorba) |
233 self.tr('Configure Protobuf...'), self.__configureProtobuf) |
236 |
234 |
237 self.dirMultiMenu = QMenu(self) |
235 self.dirMultiMenu = QMenu(self) |
238 if self.omniidl is not None: |
236 if self.__protoc is not None: |
239 self.dirMultiMenu.addAction( |
237 self.dirMultiMenu.addAction( |
240 self.tr('Compile all interfaces'), |
238 self.tr('Compile all protocols'), |
241 self.__compileAllInterfaces) |
239 self.__compileAllProtocols) |
242 self.dirMultiMenu.addSeparator() |
240 self.dirMultiMenu.addSeparator() |
243 self.dirMultiMenu.addAction( |
241 self.dirMultiMenu.addAction( |
244 self.tr('Add interfaces...'), self.project.addIdlFiles) |
242 self.tr('Add protocols...'), self.project.addProtoFiles) |
245 self.dirMultiMenu.addAction( |
243 self.dirMultiMenu.addAction( |
246 self.tr('Add interfaces directory...'), self.project.addIdlDir) |
244 self.tr('Add protocols directory...'), self.project.addProtoDir) |
247 self.dirMultiMenu.addSeparator() |
245 self.dirMultiMenu.addSeparator() |
248 self.dirMultiMenu.addAction( |
246 self.dirMultiMenu.addAction( |
249 self.tr('Expand all directories'), self._expandAllDirs) |
247 self.tr('Expand all directories'), self._expandAllDirs) |
250 self.dirMultiMenu.addAction( |
248 self.dirMultiMenu.addAction( |
251 self.tr('Collapse all directories'), self._collapseAllDirs) |
249 self.tr('Collapse all directories'), self._collapseAllDirs) |
252 self.dirMultiMenu.addSeparator() |
250 self.dirMultiMenu.addSeparator() |
253 self.dirMultiMenu.addAction( |
251 self.dirMultiMenu.addAction( |
254 self.tr('Configure...'), self._configure) |
252 self.tr('Configure...'), self._configure) |
255 self.dirMultiMenu.addAction(self.tr('Configure CORBA...'), |
253 self.dirMultiMenu.addAction(self.tr('Configure Protobuf...'), |
256 self.__configureCorba) |
254 self.__configureProtobuf) |
257 |
255 |
258 self.sourceMenu.aboutToShow.connect(self.__showContextMenu) |
256 self.sourceMenu.aboutToShow.connect(self.__showContextMenu) |
259 self.multiMenu.aboutToShow.connect(self.__showContextMenuMulti) |
257 self.multiMenu.aboutToShow.connect(self.__showContextMenuMulti) |
260 self.dirMenu.aboutToShow.connect(self.__showContextMenuDir) |
258 self.dirMenu.aboutToShow.connect(self.__showContextMenuDir) |
261 self.dirMultiMenu.aboutToShow.connect(self.__showContextMenuDirMulti) |
259 self.dirMultiMenu.aboutToShow.connect(self.__showContextMenuDirMulti) |
440 ########################################################################### |
438 ########################################################################### |
441 |
439 |
442 def __readStdout(self): |
440 def __readStdout(self): |
443 """ |
441 """ |
444 Private slot to handle the readyReadStandardOutput signal of the |
442 Private slot to handle the readyReadStandardOutput signal of the |
445 omniidl process. |
443 protoc process. |
446 """ |
444 """ |
447 if self.compileProc is None: |
445 if self.compileProc is None: |
448 return |
446 return |
449 |
447 |
450 ioEncoding = Preferences.getSystem("IOEncoding") |
448 ioEncoding = Preferences.getSystem("IOEncoding") |
451 |
449 |
452 self.compileProc.setReadChannel(QProcess.StandardOutput) |
450 self.compileProc.setReadChannel(QProcess.StandardOutput) |
453 while self.compileProc and self.compileProc.canReadLine(): |
451 while self.compileProc and self.compileProc.canReadLine(): |
454 s = 'omniidl: ' |
452 s = 'protoc: ' |
455 output = str(self.compileProc.readLine(), ioEncoding, 'replace') |
453 output = str(self.compileProc.readLine(), ioEncoding, 'replace') |
456 s += output |
454 s += output |
457 self.appendStdout.emit(s) |
455 self.appendStdout.emit(s) |
458 |
456 |
459 def __readStderr(self): |
457 def __readStderr(self): |
460 """ |
458 """ |
461 Private slot to handle the readyReadStandardError signal of the |
459 Private slot to handle the readyReadStandardError signal of the |
462 omniidl process. |
460 protoc process. |
463 """ |
461 """ |
464 if self.compileProc is None: |
462 if self.compileProc is None: |
465 return |
463 return |
466 |
464 |
467 ioEncoding = Preferences.getSystem("IOEncoding") |
465 ioEncoding = Preferences.getSystem("IOEncoding") |
468 |
466 |
469 self.compileProc.setReadChannel(QProcess.StandardError) |
467 self.compileProc.setReadChannel(QProcess.StandardError) |
470 while self.compileProc and self.compileProc.canReadLine(): |
468 while self.compileProc and self.compileProc.canReadLine(): |
471 s = 'omniidl: ' |
469 s = 'protoc: ' |
472 error = str(self.compileProc.readLine(), ioEncoding, 'replace') |
470 error = str(self.compileProc.readLine(), ioEncoding, 'replace') |
473 s += error |
471 s += error |
474 self.appendStderr.emit(s) |
472 self.appendStderr.emit(s) |
475 |
473 |
476 def __compileIDLDone(self, exitCode, exitStatus): |
474 def __compileProtocolDone(self, exitCode, exitStatus): |
477 """ |
475 """ |
478 Private slot to handle the finished signal of the omniidl process. |
476 Private slot to handle the finished signal of the protoc process. |
479 |
477 |
480 @param exitCode exit code of the process (integer) |
478 @param exitCode exit code of the process (integer) |
481 @param exitStatus exit status of the process (QProcess.ExitStatus) |
479 @param exitStatus exit status of the process (QProcess.ExitStatus) |
482 """ |
480 """ |
483 self.compileRunning = False |
481 self.__compileRunning = False |
484 ui = e5App().getObject("UserInterface") |
482 ui = e5App().getObject("UserInterface") |
485 if exitStatus == QProcess.NormalExit and exitCode == 0: |
483 if exitStatus == QProcess.NormalExit and exitCode == 0: |
486 path = os.path.dirname(self.idlFile) |
484 path = os.path.dirname(self.__protoFile) |
487 poaList = glob.glob(os.path.join(path, "*__POA")) |
485 fileList = glob.glob(os.path.join(path, "*_pb2.py")) |
488 npoaList = [f.replace("__POA", "") for f in poaList] |
|
489 fileList = glob.glob(os.path.join(path, "*_idl.py")) |
|
490 for directory in poaList + npoaList: |
|
491 fileList += Utilities.direntries(directory, True, "*.py") |
|
492 for file in fileList: |
486 for file in fileList: |
493 self.project.appendFile(file) |
487 self.project.appendFile(file) |
494 if not self.noDialog and not ui.notificationsEnabled(): |
488 if not self.noDialog and not ui.notificationsEnabled(): |
495 E5MessageBox.information( |
489 E5MessageBox.information( |
496 self, |
490 self, |
497 self.tr("Interface Compilation"), |
491 self.tr("Protocol Compilation"), |
498 self.tr( |
492 self.tr( |
499 "The compilation of the interface file was" |
493 "The compilation of the protocol file was" |
500 " successful.")) |
494 " successful.")) |
501 else: |
495 else: |
502 ui.showNotification( |
496 ui.showNotification( |
503 UI.PixmapCache.getPixmap("corba48.png"), |
497 UI.PixmapCache.getPixmap("protobuf48.png"), |
504 self.tr("Interface Compilation"), |
498 self.tr("Protocol Compilation"), |
505 self.tr( |
499 self.tr( |
506 "The compilation of the interface file was" |
500 "The compilation of the protocol file was" |
507 " successful.")) |
501 " successful.")) |
508 else: |
502 else: |
509 if not self.noDialog: |
503 if not self.noDialog: |
510 E5MessageBox.information( |
504 E5MessageBox.information( |
511 self, |
505 self, |
512 self.tr("Interface Compilation"), |
506 self.tr("Protocol Compilation"), |
513 self.tr( |
507 self.tr( |
514 "The compilation of the interface file failed.")) |
508 "The compilation of the protocol file failed.")) |
515 else: |
509 else: |
516 ui.showNotification( |
510 ui.showNotification( |
517 UI.PixmapCache.getPixmap("corba48.png"), |
511 UI.PixmapCache.getPixmap("protobuf48.png"), |
518 self.tr("Interface Compilation"), |
512 self.tr("Protocol Compilation"), |
519 self.tr( |
513 self.tr( |
520 "The compilation of the interface file failed.")) |
514 "The compilation of the protocol file failed.")) |
521 self.compileProc = None |
515 self.compileProc = None |
522 |
516 |
523 def __compileIDL(self, fn, noDialog=False, progress=None): |
517 def __compileProto(self, fn, noDialog=False, progress=None): |
524 """ |
518 """ |
525 Private method to compile a .idl file to python. |
519 Private method to compile a .proto file to Python. |
526 |
520 |
527 @param fn filename of the .idl file to be compiled (string) |
521 @param fn filename of the .proto file to be compiled (string) |
528 @param noDialog flag indicating silent operations (boolean) |
522 @param noDialog flag indicating silent operations (boolean) |
529 @param progress reference to the progress dialog (E5ProgressDialog) |
523 @param progress reference to the progress dialog (E5ProgressDialog) |
530 @return reference to the compile process (QProcess) |
524 @return reference to the compile process (QProcess) |
531 """ |
525 """ |
532 self.compileProc = QProcess() |
526 self.compileProc = QProcess() |
533 args = [] |
527 args = [] |
534 |
528 |
535 args.append("-bpython") |
|
536 args.append("-I.") |
|
537 |
|
538 fn = os.path.join(self.project.ppath, fn) |
529 fn = os.path.join(self.project.ppath, fn) |
539 self.idlFile = fn |
530 self.__protoFile = fn |
540 args.append("-C{0}".format(os.path.dirname(fn))) |
531 |
|
532 srcPath = os.path.dirname(fn) |
|
533 args.append("--proto_path={0}".format(srcPath)) |
|
534 args.append("--python_out={0}".format(srcPath)) |
541 args.append(fn) |
535 args.append(fn) |
542 |
536 |
543 self.compileProc.finished.connect(self.__compileIDLDone) |
537 self.compileProc.finished.connect(self.__compileProtocolDone) |
544 self.compileProc.readyReadStandardOutput.connect(self.__readStdout) |
538 self.compileProc.readyReadStandardOutput.connect(self.__readStdout) |
545 self.compileProc.readyReadStandardError.connect(self.__readStderr) |
539 self.compileProc.readyReadStandardError.connect(self.__readStderr) |
546 |
540 |
547 self.noDialog = noDialog |
541 self.noDialog = noDialog |
548 self.compileProc.start(self.omniidl, args) |
542 self.compileProc.start(self.__protoc, args) |
549 procStarted = self.compileProc.waitForStarted(5000) |
543 procStarted = self.compileProc.waitForStarted(5000) |
550 if procStarted: |
544 if procStarted: |
551 self.compileRunning = True |
545 self.__compileRunning = True |
552 return self.compileProc |
546 return self.compileProc |
553 else: |
547 else: |
554 self.compileRunning = False |
548 self.__compileRunning = False |
555 if progress is not None: |
549 if progress is not None: |
556 progress.cancel() |
550 progress.cancel() |
557 E5MessageBox.critical( |
551 E5MessageBox.critical( |
558 self, |
552 self, |
559 self.tr('Process Generation Error'), |
553 self.tr('Process Generation Error'), |
560 self.tr( |
554 self.tr( |
561 '<p>Could not start {0}.<br>' |
555 '<p>Could not start {0}.<br>' |
562 'Ensure that it is in the search path.</p>' |
556 'Ensure that it is in the search path.</p>' |
563 ).format(self.omniidl)) |
557 ).format(self.__protoc)) |
564 return None |
558 return None |
565 |
559 |
566 def __compileInterface(self): |
560 def __compileProtocol(self): |
567 """ |
561 """ |
568 Private method to compile an interface to python. |
562 Private method to compile a protocol to Python. |
569 """ |
563 """ |
570 if self.omniidl is not None: |
564 if self.__protoc is not None: |
571 itm = self.model().item(self.currentIndex()) |
565 itm = self.model().item(self.currentIndex()) |
572 fn2 = itm.fileName() |
566 fn2 = itm.fileName() |
573 fn = self.project.getRelativePath(fn2) |
567 fn = self.project.getRelativePath(fn2) |
574 self.__compileIDL(fn) |
568 self.__compileProto(fn) |
575 |
569 |
576 def __compileAllInterfaces(self): |
570 def __compileAllProtocols(self): |
577 """ |
571 """ |
578 Private method to compile all interfaces to python. |
572 Private method to compile all protocols to Python. |
579 """ |
573 """ |
580 if self.omniidl is not None: |
574 if self.__protoc is not None: |
581 numIDLs = len(self.project.pdata["INTERFACES"]) |
575 numProtos = len(self.project.pdata["PROTOCOLS"]) |
582 progress = E5ProgressDialog( |
576 progress = E5ProgressDialog( |
583 self.tr("Compiling interfaces..."), |
577 self.tr("Compiling Protocols..."), |
584 self.tr("Abort"), 0, numIDLs, |
578 self.tr("Abort"), 0, numProtos, |
585 self.tr("%v/%m Interfaces"), self) |
579 self.tr("%v/%m Protocols"), self) |
586 progress.setModal(True) |
580 progress.setModal(True) |
587 progress.setMinimumDuration(0) |
581 progress.setMinimumDuration(0) |
588 progress.setWindowTitle(self.tr("Interfaces")) |
582 progress.setWindowTitle(self.tr("Protocols")) |
589 i = 0 |
583 i = 0 |
590 |
584 |
591 for fn in self.project.pdata["INTERFACES"]: |
585 for fn in self.project.pdata["PROTOCOLS"]: |
592 progress.setValue(i) |
586 progress.setValue(i) |
593 if progress.wasCanceled(): |
587 if progress.wasCanceled(): |
594 break |
588 break |
595 proc = self.__compileIDL(fn, True, progress) |
589 proc = self.__compileProto(fn, True, progress) |
596 if proc is not None: |
590 if proc is not None: |
597 while proc.state() == QProcess.Running: |
591 while proc.state() == QProcess.Running: |
598 QApplication.processEvents() |
592 QApplication.processEvents() |
599 QThread.msleep(300) |
593 QThread.msleep(300) |
600 QApplication.processEvents() |
594 QApplication.processEvents() |
601 else: |
595 else: |
602 break |
596 break |
603 i += 1 |
597 i += 1 |
604 |
598 |
605 progress.setValue(numIDLs) |
599 progress.setValue(numProtos) |
606 |
600 |
607 def __compileSelectedInterfaces(self): |
601 def __compileSelectedProtocols(self): |
608 """ |
602 """ |
609 Private method to compile selected interfaces to python. |
603 Private method to compile selected protocols to Python. |
610 """ |
604 """ |
611 if self.omniidl is not None: |
605 if self.__protoc is not None: |
612 items = self.getSelectedItems() |
606 items = self.getSelectedItems() |
613 |
607 |
614 files = [self.project.getRelativePath(itm.fileName()) |
608 files = [self.project.getRelativePath(itm.fileName()) |
615 for itm in items] |
609 for itm in items] |
616 numIDLs = len(files) |
610 numProtos = len(files) |
617 progress = E5ProgressDialog( |
611 progress = E5ProgressDialog( |
618 self.tr("Compiling interfaces..."), |
612 self.tr("Compiling Protocols..."), |
619 self.tr("Abort"), 0, numIDLs, |
613 self.tr("Abort"), 0, numProtos, |
620 self.tr("%v/%m Interfaces"), self) |
614 self.tr("%v/%m Protocols"), self) |
621 progress.setModal(True) |
615 progress.setModal(True) |
622 progress.setMinimumDuration(0) |
616 progress.setMinimumDuration(0) |
623 progress.setWindowTitle(self.tr("Interfaces")) |
617 progress.setWindowTitle(self.tr("Protocols")) |
624 i = 0 |
618 i = 0 |
625 |
619 |
626 for fn in files: |
620 for fn in files: |
627 progress.setValue(i) |
621 progress.setValue(i) |
628 if progress.wasCanceled(): |
622 if progress.wasCanceled(): |
629 break |
623 break |
630 proc = self.__compileIDL(fn, True, progress) |
624 proc = self.__compileProto(fn, True, progress) |
631 if proc is not None: |
625 if proc is not None: |
632 while proc.state() == QProcess.Running: |
626 while proc.state() == QProcess.Running: |
633 QApplication.processEvents() |
627 QApplication.processEvents() |
634 QThread.msleep(300) |
628 QThread.msleep(300) |
635 QApplication.processEvents() |
629 QApplication.processEvents() |
636 else: |
630 else: |
637 break |
631 break |
638 i += 1 |
632 i += 1 |
639 |
633 |
640 progress.setValue(numIDLs) |
634 progress.setValue(numProtos) |
641 |
635 |
642 def __configureCorba(self): |
636 def __configureProtobuf(self): |
643 """ |
637 """ |
644 Private method to open the configuration dialog. |
638 Private method to open the configuration dialog. |
645 """ |
639 """ |
646 e5App().getObject("UserInterface").showPreferences("corbaPage") |
640 e5App().getObject("UserInterface").showPreferences("protobufPage") |