Project/ProjectInterfacesBrowser.py

branch
corba_options
changeset 6439
86dd19e45d95
parent 6048
82ad8ec9548c
child 6442
9d42b6c08a27
equal deleted inserted replaced
6438:bb9ebc8b4ea6 6439:86dd19e45d95
98 self.sourceMenu.addAction( 98 self.sourceMenu.addAction(
99 self.tr('Compile interface'), self.__compileInterface) 99 self.tr('Compile interface'), self.__compileInterface)
100 self.sourceMenu.addAction( 100 self.sourceMenu.addAction(
101 self.tr('Compile all interfaces'), 101 self.tr('Compile all interfaces'),
102 self.__compileAllInterfaces) 102 self.__compileAllInterfaces)
103 self.sourceMenu.addSeparator()
104 self.sourceMenu.addAction(
105 self.tr('Configure IDL compiler'),
106 self.__configureIdlCompiler)
107 self.sourceMenu.addSeparator()
103 self.sourceMenu.addAction(self.tr('Open'), self._openItem) 108 self.sourceMenu.addAction(self.tr('Open'), self._openItem)
104 self.sourceMenu.addSeparator() 109 self.sourceMenu.addSeparator()
105 act = self.sourceMenu.addAction( 110 act = self.sourceMenu.addAction(
106 self.tr('Rename file'), self._renameFile) 111 self.tr('Rename file'), self._renameFile)
107 self.menuActions.append(act) 112 self.menuActions.append(act)
135 self.menu.addAction( 140 self.menu.addAction(
136 self.tr('Compile interface'), self.__compileInterface) 141 self.tr('Compile interface'), self.__compileInterface)
137 self.menu.addAction( 142 self.menu.addAction(
138 self.tr('Compile all interfaces'), 143 self.tr('Compile all interfaces'),
139 self.__compileAllInterfaces) 144 self.__compileAllInterfaces)
145 self.menu.addSeparator()
146 self.menu.addAction(
147 self.tr('Configure IDL compiler'),
148 self.__configureIdlCompiler)
149 self.menu.addSeparator()
140 self.menu.addAction(self.tr('Open'), self._openItem) 150 self.menu.addAction(self.tr('Open'), self._openItem)
141 self.menu.addSeparator() 151 self.menu.addSeparator()
142 self.menu.addAction( 152 self.menu.addAction(
143 self.tr('Add interfaces...'), self.__addInterfaceFiles) 153 self.tr('Add interfaces...'), self.__addInterfaceFiles)
144 self.menu.addAction( 154 self.menu.addAction(
158 if self.omniidl is not None: 168 if self.omniidl is not None:
159 self.backMenu.addAction( 169 self.backMenu.addAction(
160 self.tr('Compile all interfaces'), 170 self.tr('Compile all interfaces'),
161 self.__compileAllInterfaces) 171 self.__compileAllInterfaces)
162 self.backMenu.addSeparator() 172 self.backMenu.addSeparator()
173 self.backMenu.addAction(
174 self.tr('Configure IDL compiler'),
175 self.__configureIdlCompiler)
176 self.backMenu.addSeparator()
163 self.backMenu.addAction( 177 self.backMenu.addAction(
164 self.tr('Add interfaces...'), self.project.addIdlFiles) 178 self.tr('Add interfaces...'), self.project.addIdlFiles)
165 self.backMenu.addAction( 179 self.backMenu.addAction(
166 self.tr('Add interfaces directory...'), self.project.addIdlDir) 180 self.tr('Add interfaces directory...'), self.project.addIdlDir)
167 self.backMenu.addSeparator() 181 self.backMenu.addSeparator()
179 self.multiMenu = QMenu(self) 193 self.multiMenu = QMenu(self)
180 if self.omniidl is not None: 194 if self.omniidl is not None:
181 self.multiMenu.addAction( 195 self.multiMenu.addAction(
182 self.tr('Compile interfaces'), 196 self.tr('Compile interfaces'),
183 self.__compileSelectedInterfaces) 197 self.__compileSelectedInterfaces)
198 self.multiMenu.addSeparator()
199 self.multiMenu.addAction(
200 self.tr('Configure IDL compiler'),
201 self.__configureIdlCompiler)
202 self.multiMenu.addSeparator()
184 self.multiMenu.addAction(self.tr('Open'), self._openItem) 203 self.multiMenu.addAction(self.tr('Open'), self._openItem)
185 self.multiMenu.addSeparator() 204 self.multiMenu.addSeparator()
186 act = self.multiMenu.addAction( 205 act = self.multiMenu.addAction(
187 self.tr('Remove from project'), self._removeFile) 206 self.tr('Remove from project'), self._removeFile)
188 self.multiMenuActions.append(act) 207 self.multiMenuActions.append(act)
202 self.dirMenu = QMenu(self) 221 self.dirMenu = QMenu(self)
203 if self.omniidl is not None: 222 if self.omniidl is not None:
204 self.dirMenu.addAction( 223 self.dirMenu.addAction(
205 self.tr('Compile all interfaces'), 224 self.tr('Compile all interfaces'),
206 self.__compileAllInterfaces) 225 self.__compileAllInterfaces)
226 self.dirMenu.addSeparator()
227 self.dirMenu.addAction(
228 self.tr('Configure IDL compiler'),
229 self.__configureIdlCompiler)
207 self.dirMenu.addSeparator() 230 self.dirMenu.addSeparator()
208 act = self.dirMenu.addAction( 231 act = self.dirMenu.addAction(
209 self.tr('Remove from project'), self._removeFile) 232 self.tr('Remove from project'), self._removeFile)
210 self.dirMenuActions.append(act) 233 self.dirMenuActions.append(act)
211 act = self.dirMenu.addAction( 234 act = self.dirMenu.addAction(
233 self.dirMultiMenu = QMenu(self) 256 self.dirMultiMenu = QMenu(self)
234 if self.omniidl is not None: 257 if self.omniidl is not None:
235 self.dirMultiMenu.addAction( 258 self.dirMultiMenu.addAction(
236 self.tr('Compile all interfaces'), 259 self.tr('Compile all interfaces'),
237 self.__compileAllInterfaces) 260 self.__compileAllInterfaces)
261 self.dirMultiMenu.addSeparator()
262 self.dirMultiMenu.addAction(
263 self.tr('Configure IDL compiler'),
264 self.__configureIdlCompiler)
238 self.dirMultiMenu.addSeparator() 265 self.dirMultiMenu.addSeparator()
239 self.dirMultiMenu.addAction( 266 self.dirMultiMenu.addAction(
240 self.tr('Add interfaces...'), self.project.addIdlFiles) 267 self.tr('Add interfaces...'), self.project.addIdlFiles)
241 self.dirMultiMenu.addAction( 268 self.dirMultiMenu.addAction(
242 self.tr('Add interfaces directory...'), self.project.addIdlDir) 269 self.tr('Add interfaces directory...'), self.project.addIdlDir)
523 @param fn filename of the .idl file to be compiled (string) 550 @param fn filename of the .idl file to be compiled (string)
524 @param noDialog flag indicating silent operations (boolean) 551 @param noDialog flag indicating silent operations (boolean)
525 @param progress reference to the progress dialog (E5ProgressDialog) 552 @param progress reference to the progress dialog (E5ProgressDialog)
526 @return reference to the compile process (QProcess) 553 @return reference to the compile process (QProcess)
527 """ 554 """
555 params = self.project.pdata["IDLPARAMS"]
556
528 self.compileProc = QProcess() 557 self.compileProc = QProcess()
529 args = [] 558 args = []
530 559
531 args.append("-bpython") 560 args.append("-bpython")
532 args.append("-I.") 561 args.append("-I.")
562 for directory in params["IncludeDirs"]:
563 args.append("-I{0}".format(directory))
564 for name in params["DefinedNames"]:
565 args.append("-D{0}".format(name))
566 for name in params["UndefinedNames"]:
567 args.append("-U{0}".format(name))
533 568
534 fn = os.path.join(self.project.ppath, fn) 569 fn = os.path.join(self.project.ppath, fn)
535 self.idlFile = fn 570 self.idlFile = fn
536 args.append("-C{0}".format(os.path.dirname(fn))) 571 args.append("-C{0}".format(os.path.dirname(fn)))
537 args.append(fn) 572 args.append(fn)
638 def __configureCorba(self): 673 def __configureCorba(self):
639 """ 674 """
640 Private method to open the configuration dialog. 675 Private method to open the configuration dialog.
641 """ 676 """
642 e5App().getObject("UserInterface").showPreferences("corbaPage") 677 e5App().getObject("UserInterface").showPreferences("corbaPage")
678
679 def __configureIdlCompiler(self):
680 """
681 Private method to show a dialog to configure some options for the
682 IDL compiler.
683 """
684 params = self.project.pdata["IDLPARAMS"]
685
686 # TODO: remove this test code once done
687 print("__configureIdlCompiler")
688 return
689
690 # TODO: implement IDL compiler options dialog
691 from .IdlCompilerOptionsDialog import IdlCompilerOptionsDialog
692 dlg = IdlCompilerOptionsDialog(
693 params["IncludeDirs"][:], params["DefinedNames"][:],
694 params["UndefinedNames"][:])
695 if dlg.exec_() == QDialog.Accepted:
696 include, defined, undefined = dlg.getData()
697 if include != params["IncludeDirs"]:
698 params["IncludeDirs"] = include[:]
699 self.project.setDirty(True)
700 if defined != params["DefinedNames"]:
701 params["DefinedNames"] = defined[:]
702 self.project.setDirty(True)
703 if undefined != params["UndefinedNames"]:
704 params["UndefinedNames"] = undefined[:]
705 self.project.setDirty(True)

eric ide

mercurial