2fd960e

Use the project manager UI logic for creating new projects from the editor.

offlate/ui/editor.py

324324
        self.projectManagerWindow.show()
325325
326326
    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()
334328
335329
    def send(self):
336330
        self.tabs.currentWidget().send()

offlate/ui/manager.py

5757
        center = QDesktopWidget().availableGeometry().center()
5858
        self.setGeometry(center.x()-400, center.y()-300, 800, 600)
5959
        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()
6166
6267
class ProjectManagerWidget(QWidget):
6368
    def __init__(self, parent=None):