971 CreateDialogCodeDialog, |
971 CreateDialogCodeDialog, |
972 ) |
972 ) |
973 |
973 |
974 # change environment |
974 # change environment |
975 sys.path.insert(0, self.project.getProjectPath()) |
975 sys.path.insert(0, self.project.getProjectPath()) |
|
976 # TODO: make this a project properties item |
|
977 sys.path.insert(1, os.path.join(self.project.getProjectPath(), "src")) |
976 cwd = os.getcwd() |
978 cwd = os.getcwd() |
977 os.chdir(os.path.dirname(os.path.abspath(fn))) |
979 os.chdir(os.path.dirname(os.path.abspath(fn))) |
978 try: |
980 try: |
979 dlg = CreateDialogCodeDialog(fn, self.project, self) |
981 dlg = CreateDialogCodeDialog(fn, self.project, self) |
980 if not dlg.initError(): |
982 if not dlg.initError(): |
981 dlg.exec() |
983 dlg.exec() |
982 finally: |
984 finally: |
983 # reset the environment |
985 # reset the environment |
984 os.chdir(cwd) |
986 os.chdir(cwd) |
|
987 del sys.path[1] |
985 del sys.path[0] |
988 del sys.path[0] |
986 |
989 |
987 def __compileForm(self): |
990 def __compileForm(self): |
988 """ |
991 """ |
989 Private method to compile a form to a source file. |
992 Private method to compile a form to a source file. |