Fix opening project after adding it
offlate/ui/manager.py
155 | 155 | return | |
156 | 156 | worker = NewRunnable(self, w.getProjectName(), w.getProjectLang(), | |
157 | 157 | w.getProjectSystem(), w.getProjectInfo()) | |
158 | + | worker.signals.finished.connect(self.openProject) | |
158 | 159 | self.threadpool.start(worker) | |
159 | 160 | ||
160 | 161 | def settings(self): | |
… | |||
178 | 179 | data = item.data(Qt.UserRole) | |
179 | 180 | name = data['name'] | |
180 | 181 | self.openProject(name) | |
182 | + | return "" | |
181 | 183 | ||
182 | 184 | def openProject(self, name): | |
183 | 185 | self.editor.show() | |
… | |||
205 | 207 | w.getProjectSystem(), w.getProjectInfo()) | |
206 | 208 | self.threadpool.start(worker) | |
207 | 209 | ||
210 | + | class NewRunnableSignals(QObject): | |
211 | + | finished = pyqtSignal(str) | |
212 | + | ||
208 | 213 | class NewRunnable(QRunnable): | |
209 | 214 | def __init__(self, parent, name, lang, system, info): | |
210 | 215 | super().__init__() | |
… | |||
213 | 218 | self.system = system | |
214 | 219 | self.info = info | |
215 | 220 | self.parent = parent | |
221 | + | self.signals = NewRunnableSignals() | |
216 | 222 | ||
217 | 223 | def run(self): | |
218 | 224 | self.parent.manager.createProject(self.name, self.lang, self.system, | |
219 | 225 | self.info) | |
220 | - | self.parent.openProject(self.name) | |
226 | + | #self.parent.openProject(self.name) | |
227 | + | self.signals.finished.emit(self.name) | |
221 | 228 | self.parent.filter() | |
222 | 229 | ||
223 | 230 | class EditRunnable(QRunnable): |