Fix opening project after adding it

Julien LepillerThu Aug 22 19:41:17+0200 2019

0a7e86d

Fix opening project after adding it

offlate/ui/manager.py

155155
            return
156156
        worker = NewRunnable(self, w.getProjectName(), w.getProjectLang(),
157157
                w.getProjectSystem(), w.getProjectInfo())
158+
        worker.signals.finished.connect(self.openProject)
158159
        self.threadpool.start(worker)
159160
160161
    def settings(self):

178179
        data = item.data(Qt.UserRole)
179180
        name = data['name']
180181
        self.openProject(name)
182+
        return ""
181183
182184
    def openProject(self, name):
183185
        self.editor.show()

205207
                w.getProjectSystem(), w.getProjectInfo())
206208
        self.threadpool.start(worker)
207209
210+
class NewRunnableSignals(QObject):
211+
    finished = pyqtSignal(str)
212+
208213
class NewRunnable(QRunnable):
209214
    def __init__(self, parent, name, lang, system, info):
210215
        super().__init__()

213218
        self.system = system
214219
        self.info = info
215220
        self.parent = parent
221+
        self.signals = NewRunnableSignals()
216222
217223
    def run(self):
218224
        self.parent.manager.createProject(self.name, self.lang, self.system,
219225
                self.info)
220-
        self.parent.openProject(self.name)
226+
        #self.parent.openProject(self.name)
227+
        self.signals.finished.emit(self.name)
221228
        self.parent.filter()
222229
223230
class EditRunnable(QRunnable):