diff options
author | Blaine | 2020-06-09 13:10:59 +0530 |
---|---|---|
committer | Blaine | 2020-06-10 11:29:49 +0530 |
commit | 6da3f0038037ad3553370eb264912bfe380f2089 (patch) | |
tree | 9d5e77f2d5a10845c909dbdd602f4eb2c490e461 /src/main | |
parent | 2cdd1b40a2cf410ea1970afeb692649e7cd07b29 (diff) | |
download | Chemical-PFD-6da3f0038037ad3553370eb264912bfe380f2089.tar.gz Chemical-PFD-6da3f0038037ad3553370eb264912bfe380f2089.tar.bz2 Chemical-PFD-6da3f0038037ad3553370eb264912bfe380f2089.zip |
implement changeable file name
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/python/utils/canvas.py | 1 | ||||
-rw-r--r-- | src/main/python/utils/fileWindow.py | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/main/python/utils/canvas.py b/src/main/python/utils/canvas.py index 2b029e0..d1da9bc 100644 --- a/src/main/python/utils/canvas.py +++ b/src/main/python/utils/canvas.py @@ -154,7 +154,6 @@ class canvas(QWidget): graphic, index = shapeGrips[item['startGripItem']] line.setStartGripItem = graphic.lineGripItems[index] graphic.lineGripItems[index].line = line - print("hello2") if item['endGripItem']: graphic, index = shapeGrips[item['endGripItem']] line.setEndGripItem = graphic.lineGripItems[index] diff --git a/src/main/python/utils/fileWindow.py b/src/main/python/utils/fileWindow.py index 04ed81a..8edd38e 100644 --- a/src/main/python/utils/fileWindow.py +++ b/src/main/python/utils/fileWindow.py @@ -3,7 +3,7 @@ from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import (QFileDialog, QHBoxLayout, QMdiSubWindow, QMenu, QPushButton, QSizePolicy, QSplitter, QWidget, QStyle) - +from os import path from . import dialogs from .graphics import customView from .canvas import canvas @@ -221,6 +221,8 @@ class fileWindow(QMdiSubWindow): # called by dialog.saveEvent, saves the current file name = QFileDialog.getSaveFileName(self, 'Save File', f'New Diagram', 'Process Flow Diagram (*.pfd)') if not name else name if name[0]: + self.setObjectName(path.basename(name[0]).split(".")[0]) + self.setWindowTitle(self.objectName()) with open(name[0],'w') as file: dump(self, file, indent=4, cls=JSON_Typer) return True |