summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.ui2
-rw-r--r--mainApp.py7
2 files changed, 7 insertions, 2 deletions
diff --git a/main.ui b/main.ui
index f707ba8..c41747e 100644
--- a/main.ui
+++ b/main.ui
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
- <string>MainWindow</string>
+ <string>Untitled - Chemical Simulator GUI</string>
</property>
<property name="windowIcon">
<iconset>
diff --git a/mainApp.py b/mainApp.py
index 7350025..65e2ba3 100644
--- a/mainApp.py
+++ b/mainApp.py
@@ -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: