summaryrefslogtreecommitdiff
path: root/src/main/python/utils/fileWindow.py
diff options
context:
space:
mode:
authorpravindalve2020-06-09 11:37:13 +0530
committerGitHub2020-06-09 11:37:13 +0530
commit181f050b352560fa5dbbbcf4888db2ccd7a37061 (patch)
tree1471d88a2b8496785912a35ea497a0963b896676 /src/main/python/utils/fileWindow.py
parent0cf5626ed61f29249ebc92fcec6dbae5489bac8e (diff)
parent3ea92365befd56852288fdaac5d551c4b96d269a (diff)
downloadChemical-PFD-181f050b352560fa5dbbbcf4888db2ccd7a37061.tar.gz
Chemical-PFD-181f050b352560fa5dbbbcf4888db2ccd7a37061.tar.bz2
Chemical-PFD-181f050b352560fa5dbbbcf4888db2ccd7a37061.zip
Merge pull request #10 from Blakeinstein/master
Implement JSON_Typer, and advance()
Diffstat (limited to 'src/main/python/utils/fileWindow.py')
-rw-r--r--src/main/python/utils/fileWindow.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/python/utils/fileWindow.py b/src/main/python/utils/fileWindow.py
index 6ad4477..04ed81a 100644
--- a/src/main/python/utils/fileWindow.py
+++ b/src/main/python/utils/fileWindow.py
@@ -1,5 +1,3 @@
-import json
-
from PyQt5.QtCore import Qt, pyqtSignal, QPoint
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import (QFileDialog, QHBoxLayout,
@@ -11,6 +9,7 @@ from .graphics import customView
from .canvas import canvas
from .tabs import customTabWidget
from .undo import resizeCommand
+from .app import dump, loads, JSON_Typer
class fileWindow(QMdiSubWindow):
@@ -223,7 +222,7 @@ class fileWindow(QMdiSubWindow):
name = QFileDialog.getSaveFileName(self, 'Save File', f'New Diagram', 'Process Flow Diagram (*.pfd)') if not name else name
if name[0]:
with open(name[0],'w') as file:
- json.dump(self.__getstate__(), file, indent=4)
+ dump(self, file, indent=4, cls=JSON_Typer)
return True
else:
return False