Use the project manager UI logic for creating new projects from the editor.
offlate/ui/editor.py
324 | 324 | self.projectManagerWindow.show() | |
325 | 325 | ||
326 | 326 | def new(self): | |
327 | - | w = NewWindow(self.manager) | |
328 | - | w.exec_() | |
329 | - | if not w.wantNew(): | |
330 | - | return | |
331 | - | self.manager.createProject(w.getProjectName(), w.getProjectLang(), | |
332 | - | w.getProjectSystem(), w.getProjectInfo()) | |
333 | - | self.open(w.getProjectName()) | |
327 | + | self.projectManagerWindow.new() | |
334 | 328 | ||
335 | 329 | def send(self): | |
336 | 330 | self.tabs.currentWidget().send() |
offlate/ui/manager.py
57 | 57 | center = QDesktopWidget().availableGeometry().center() | |
58 | 58 | self.setGeometry(center.x()-400, center.y()-300, 800, 600) | |
59 | 59 | self.setWindowTitle(self.tr('Offlate Project Manager')) | |
60 | - | self.setCentralWidget(ProjectManagerWidget(self)) | |
60 | + | self.projectManagerWidget = ProjectManagerWidget(self) | |
61 | + | self.setCentralWidget(self.projectManagerWidget) | |
62 | + | ||
63 | + | # Can be called from the editor window | |
64 | + | def new(self): | |
65 | + | self.projectManagerWidget.new() | |
61 | 66 | ||
62 | 67 | class ProjectManagerWidget(QWidget): | |
63 | 68 | def __init__(self, parent=None): |