diff options
author | brenda-br | 2023-02-14 15:23:02 +0530 |
---|---|---|
committer | brenda-br | 2023-02-14 15:23:02 +0530 |
commit | 4c11732b66b321ee645997355a6e15387e441ab9 (patch) | |
tree | 0a5877bf7364fa92bfa3752b1ddfdd45a5f2b78d | |
parent | e2b179ce145fc0882de06ea8cfe041f6162d4b11 (diff) | |
download | Chemical-Simulator-GUI-4c11732b66b321ee645997355a6e15387e441ab9.tar.gz Chemical-Simulator-GUI-4c11732b66b321ee645997355a6e15387e441ab9.tar.bz2 Chemical-Simulator-GUI-4c11732b66b321ee645997355a6e15387e441ab9.zip |
Fix #55 File Name Displayed in Title Bar
-rw-r--r-- | main.ui | 2 | ||||
-rw-r--r-- | mainApp.py | 7 |
2 files changed, 7 insertions, 2 deletions
@@ -11,7 +11,7 @@ </rect> </property> <property name="windowTitle"> - <string>MainWindow</string> + <string>Untitled - Chemical Simulator GUI</string> </property> <property name="windowIcon"> <iconset> @@ -314,13 +314,15 @@ class MainApp(QMainWindow,ui): data.append(self.container.result) file_format = 'sim' - initial_path = QDir.currentPath() + 'untitled.' + file_format + initial_path = QDir.currentPath() + ' untitled.' + file_format file_name, _ = QFileDialog.getSaveFileName(self, "Save As", initial_path, "%s Files (*.%s);; All Files (*)" % (file_format.upper(), file_format)) try: with open(file_name, 'wb') as f: pickle.dump(data, f, pickle.HIGHEST_PROTOCOL) + fileName = file_name.split('/')[-1].split('.')[0] + self.setWindowTitle(fileName+' - Chemical Simularot GUI') except Exception as e: pass @@ -336,6 +338,9 @@ class MainApp(QMainWindow,ui): initial_path, "%s Files (*.%s);; All Files (*)" % (file_format.upper(), file_format)) if file_name: + fileName = file_name.split('/')[-1].split('.')[0] + self.setWindowTitle(fileName+' - Chemical Simularot GUI') + self.undo_redo_helper() with open(file_name, 'rb') as f: |