microscope-cockpit / cockpit

Cockpit is a microscope graphical user interface. It is a flexible and easy to extend platform aimed at life scientists using bespoke microscopes.
https://microscope-cockpit.org
GNU General Public License v3.0
35 stars 26 forks source link

Stage home dialog should update on ok press. #860

Closed iandobbie closed 12 months ago

iandobbie commented 1 year ago

When you need to home the stage you get a modal dialog that asks if the system can home the stage. If you click ok, the system starts the home command and the dialog stays fixed until the home operation returns which might take some time. We should instead close the modal dialog and put up another system message to say the stage is homing.

iandobbie commented 1 year ago

Unfortunately, the modal dialog is hard coded to return the ok state (ie if ok is clicked or not) and then appears to be removed when it goes out of scope after the home move is committed.

So we need to change the dialog in some way, the 3 obvious solutons are 1) add a new parameter that changes the text if you press ok so that a message along the line of "please wait homing stage" is displayed. 2) Change the function calls to return the dialog and do the display in the calling function instead, so we can remove it and show a new dialog instead. 3) Add a new dialog that effectively has the functionality of 1 or 2, or hard code it in the stage home function rather than using the helper function.

Option 2 will require changes in all the calling functions which seem like extra work for not much benefit. Option 3 will add an additional function which isnt that different to the existing functionality.

I guess that points to option 1 as the only sensible approach.

iandobbie commented 12 months ago

Seems the behavior is fundamentally different on the PC versus the Mac, no idea about Linux.

On Mac clicking the ok button starts the homing process but leaves the modal dialog up until the home opperation is complete and the dialog object goes out of scope.

On the PC clicking ok closes the modal dialog and then starts the home process. Not sure why ther is difrerenmt behavior or what we can do about it.

iandobbie commented 12 months ago

This is behavior has me completely flumoxed. On Windows the modal dialog disappears as soon as you press the OK button. On the macos the dialog stays stuck on the screen during the entire home operation of the stage. I have already spent too much time on this trivial UI issue so I am closing this as works, but is strange!