Mac app does not alert user if EPW is reset on open
Issue overview
Reported by @brgix in detail here https://github.com/openstudiocoalition/OpenStudioApplication/issues/653#issuecomment-1872964638
Details
Environment
Some additional details about your environment for this issue (if relevant):
- Platform (Operating system, version): Mac M1 13.5
- Version of OpenStudioApplication (if using an intermediate build, include SHA): 1.7.0-rc1
Testing with https://github.com/rd2/tbd/blob/402f9f5acaa95e85bfdae33d28ea115e125db683/spec/files/osms/in/warehouse.osm#L6865-L6877
On Ubuntu, no issue. But I can reproduce the lockup of the App on Mac M1 (regardless of whether I use the classic or the C++ CLI)
Seems like the issue is the two QMessageBox atop each other or something. It makes the mainwindow lose the focus I think.
If I comment out the lines here: https://github.com/openstudiocoalition/OpenStudioApplication/blob/a1f218a2d16bbfad2c00ac11cc1d5e46f212a8e8/src/openstudio_lib/OSDocument.cpp#L356-L357
then it works fine.
If I make it a direct call (not a QTimer::singleShot) it also works, but the second qmessagebox isn't showed. The one triggered from https://github.com/openstudiocoalition/OpenStudioApplication/blob/a1f218a2d16bbfad2c00ac11cc1d5e46f212a8e8/src/openstudio_app/OpenStudioApp.cpp#L375
I've also tried making the QMessageBox::warning point to a nullptr parent but that doesn't work either. Tried with OSAppBase::instance()->mainWidget() too
I've also tried moving the call after the waitDialog is hidden and the state of the MainWindow is restored, but wasVisible is actually false yo begin with anyways.
https://github.com/openstudiocoalition/OpenStudioApplication/blob/a1f218a2d16bbfad2c00ac11cc1d5e46f212a8e8/src/openstudio_lib/OSDocument.cpp#L300-L309
TL;DR: I don't know how to properly fix this one. As a workaround we can hide the dialog box. @macumber Any ideas?
Bad workaround for now at #663
Downgraded to regular bug since crash is fixed
New scope of this bug would be to re-enable the warning to the user on Mac