Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions opencodeblocks/graphics/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,7 @@ def onFileSave(self) -> bool:
if current_window is not None:
if current_window.savepath is None:
return self.onFileSaveAs()
current_window.save()
self.statusbar.showMessage(
f"Successfully saved ipygraph at {current_window.savepath}", 2000
)
self.saveWindow(current_window)
return True

def onFileSaveAs(self) -> bool:
Expand All @@ -344,10 +341,19 @@ def onFileSaveAs(self) -> bool:
if filename == "":
return False
current_window.savepath = filename
self.onFileSave()

# Note : the current_window is the activeMdiChild before the QFileDialog pops up
self.saveWindow(current_window)
return True
return False

def saveWindow(self, window: OCBWidget):
"""Save the given window"""
window.save()
self.statusbar.showMessage(
f"Successfully saved ipygraph at {window.savepath}", 2000
)

@staticmethod
def is_not_editing(current_window: OCBWidget):
"""True if current_window exists and is not in editing mode."""
Expand Down