From 43b1ece19331b529436dea06736674a2a90facb0 Mon Sep 17 00:00:00 2001
From: Oscar Gustafsson <oscar.gustafsson@gmail.com>
Date: Tue, 24 Jan 2023 17:20:21 +0100
Subject: [PATCH] Add default values to callbacks

---
 b_asic/GUI/drag_button.py | 2 +-
 b_asic/GUI/main_window.py | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/b_asic/GUI/drag_button.py b/b_asic/GUI/drag_button.py
index 7b488501..85cfd734 100644
--- a/b_asic/GUI/drag_button.py
+++ b/b_asic/GUI/drag_button.py
@@ -122,7 +122,7 @@ class DragButton(QPushButton):
         self._window.graphic_view.update()
         super().mouseReleaseEvent(event)
 
-    def _flip(self, event):
+    def _flip(self, event=None):
         self._flipped = not self._flipped
         for pb in self.ports:
             if isinstance(pb.port, InputPort):
diff --git a/b_asic/GUI/main_window.py b/b_asic/GUI/main_window.py
index 843a4c93..de1cca36 100644
--- a/b_asic/GUI/main_window.py
+++ b/b_asic/GUI/main_window.py
@@ -216,16 +216,14 @@ class MainWindow(QMainWindow):
 
         self.logger.info(f"Saved SFG to path: {module}.")
 
-    def save_work(self, arg):
-        print("Save: ", arg)
+    def save_work(self, event=None):
         self.sfg_widget = SelectSFGWindow(self)
         self.sfg_widget.show()
 
         # Wait for input to dialog.
         self.sfg_widget.ok.connect(self._save_work)
 
-    def load_work(self, arg):
-        print("Load: ", arg)
+    def load_work(self, event=None):
         module, accepted = QFileDialog().getOpenFileName()
         if not accepted:
             return
-- 
GitLab