From 45b55d8e2fbffceefc9a1cd50b9bdb3e7ec9da78 Mon Sep 17 00:00:00 2001 From: tassaron Date: Sat, 24 Jun 2017 23:40:32 -0400 Subject: fixed lack of asterisks after openProject, added asterisk to window title --- src/mainwindow.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mainwindow.py') diff --git a/src/mainwindow.py b/src/mainwindow.py index 7a9e397..7fae4ea 100644 --- a/src/mainwindow.py +++ b/src/mainwindow.py @@ -286,6 +286,8 @@ class MainWindow(QtWidgets.QMainWindow): appName += ' - %s' % \ os.path.splitext( os.path.basename(self.currentProject))[0] + if self.autosaveExists(identical=False): + appName += '*' self.window.setWindowTitle(appName) @QtCore.pyqtSlot(int, dict) @@ -490,6 +492,7 @@ class MainWindow(QtWidgets.QMainWindow): self.newTask.emit(self.core.selectedComponents) # self.processTask.emit() self.autosave(force) + self.updateWindowTitle() def showPreviewImage(self, image): self.previewWindow.changePixmap(image) @@ -602,11 +605,11 @@ class MainWindow(QtWidgets.QMainWindow): self.currentProject = None self.settings.setValue("currentProject", None) self.drawPreview(True) - self.updateWindowTitle() def saveCurrentProject(self): if self.currentProject: self.core.createProjectFile(self.currentProject) + self.updateWindowTitle() else: self.openSaveProjectDialog() @@ -638,8 +641,8 @@ class MainWindow(QtWidgets.QMainWindow): self.settings.setValue("projectDir", os.path.dirname(filename)) self.settings.setValue("currentProject", filename) self.currentProject = filename - self.updateWindowTitle() self.core.createProjectFile(filename) + self.updateWindowTitle() def openOpenProjectDialog(self): filename, _ = QtWidgets.QFileDialog.getOpenFileName( @@ -651,7 +654,6 @@ class MainWindow(QtWidgets.QMainWindow): def openProject(self, filepath, prompt=True): if not filepath or not os.path.exists(filepath) \ or not filepath.endswith('.avp'): - self.updateWindowTitle() return self.clear() @@ -660,7 +662,6 @@ class MainWindow(QtWidgets.QMainWindow): self.openSaveChangesDialog('opening another project') self.currentProject = filepath - self.updateWindowTitle() self.settings.setValue("currentProject", filepath) self.settings.setValue("projectDir", os.path.dirname(filepath)) # actually load the project using core method -- cgit v1.2.3