Skip to content

Commit 92bc20e

Browse files
committed
Small Bug Fixes from Merge
Bugs: - Save as - RightCheckBoxAction Additional key changes: - Checking for dirty before prompting save
1 parent 9748280 commit 92bc20e

5 files changed

Lines changed: 25 additions & 12 deletions

File tree

src/pymapmanager/interface/mainMenus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def _refreshFileMenu(self):
444444
saveFileAction.setShortcut("Ctrl+S")
445445
# saveFileAction.setEnabled(enableUndo and isDirty)
446446
saveFileAction.setEnabled(enableSave)
447-
saveFileAction.triggered.connect(self.getApp().saveAs)
447+
saveFileAction.triggered.connect(self.getApp().save)
448448
self.fileMenu.addAction(saveFileAction)
449449

450450
# TODO: add export mmap to zip (a bit complicated)

src/pymapmanager/interface/pyMapManagerApp.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,16 @@ def saveAs(self):
618618
if _frontWidget is None:
619619
return
620620
# self._openWidgetList.saveAs(_frontWidget)
621-
_frontWidget.saveAs(_frontWidget)
621+
# _frontWidget.saveAs(_frontWidget)
622+
_frontWidget.saveAs()
623+
624+
def save(self):
625+
""" Save to file
626+
"""
627+
_frontWidget = self.getFrontStackWindow()
628+
if _frontWidget is None:
629+
return
630+
_frontWidget.save()
622631

623632
#abj
624633
def _showAnalysisParameters(self):

src/pymapmanager/interface/stackWidgets/imagePlotWidget2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from .base.annotationPlotWidget2 import pointPlotWidget, linePlotWidget
2626

2727
from pymapmanager._logger import logger
28+
from pymapmanager.interface.stackWidgets.base.rightCheckBoxAction import RightCheckBoxAction
2829

2930
class ImagePlotWidget(mmWidget2):
3031
"""A plot widget (pg.PlotWidget) to plot

src/pymapmanager/interface/stackWidgets/stackWidget.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,18 @@ def closeEvent(self, event):
133133
Parameters
134134
----------
135135
event : PyQt5.QtGui.QCloseEvent
136-
"""
137-
logger.warning('NEED TO CHECK IF spine/segment IS DIRTY AND PROMPT TO SAVE')
138-
136+
"""
139137
# logger.info(self.geometry())
140138
# temp = len(self._openPluginDict)
141139
# logger.info(f"temp {temp}")
142140

141+
# check dirty
142+
if not self.getDirty():
143+
pluginObjList = list(self._openPluginDict.values())
144+
for pluginObj in pluginObjList:
145+
self.closePluginInDict(pluginObj)
146+
return
147+
143148
# check if openPluginDict is not empty
144149
if len(self._openPluginDict) > 0:
145150
# open warning before closing
@@ -154,10 +159,6 @@ def closeEvent(self, event):
154159
msg_box.setIcon(QtWidgets.QMessageBox.Warning) # or QMessageBox.Information, QMessageBox.Critical, etc.
155160

156161
# Set the buttons
157-
158-
# Save Don't Save Cancel
159-
discard = "Don't Save"
160-
161162
msg_box.setStandardButtons(QtWidgets.QMessageBox.Save| QtWidgets.QMessageBox.Discard | QtWidgets.QMessageBox.Cancel)
162163
msg_box.setDefaultButton(QtWidgets.QMessageBox.Cancel) # Set the default button
163164

src/pymapmanager/tests/interface/runInterfaceJohnson.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def run():
5454
logger.error(f"C:\\Users\\johns\\Documents\\GitHub\\MapManagerCore-Data\\data\\202504\\single_timepoint_202504.mmap")
5555

5656
# abb 202504, this is what you were loading
57-
path = 'C:\\Users\\johns\\Documents\\GitHub\\MapManagerCore-Data\\data\\single_timepoint.mmap'
57+
# path = 'C:\\Users\\johns\\Documents\\GitHub\\MapManagerCore-Data\\data\\single_timepoint.mmap'
58+
# path = "C:\\Users\\johns\\Documents\\GitHub\\MapManagerCore-Data\\data\\202504\\single_timepoint_202504.mmap"
59+
path = "C:\\Users\\johns\\Documents\\GitHub\\MapManagerCore-Data\\data\\202504\\jcopy_single_timepoint.mmap"
5860

5961
# path = '/Users/johns/Documents/GitHub/MapManagerCore/data/rr30a_s0u.mmap'
6062

@@ -320,11 +322,11 @@ def testingGetValues():
320322
print("testGetValues: ", test)
321323

322324
if __name__ == '__main__':
323-
# run()
325+
run()
324326
# testingGetValues()
325327

326328
# TODO: fix merging for just tif, only works for zarr
327-
run_tif()
329+
# run_tif()
328330
# run_2_tifs()
329331

330332
# runThenLoad()

0 commit comments

Comments
 (0)