Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac app does not alert user if EPW is reset on open #659

Open
macumber opened this issue Dec 31, 2023 · 5 comments
Open

Mac app does not alert user if EPW is reset on open #659

macumber opened this issue Dec 31, 2023 · 5 comments

Comments

@macumber
Copy link
Collaborator

Issue overview

Reported by @brgix in detail here #653 (comment)

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
@jmarrec
Copy link
Collaborator

jmarrec commented Jan 8, 2024

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)

@jmarrec
Copy link
Collaborator

jmarrec commented Jan 8, 2024

Seems like the issue is the two QMessageBox atop each other or something. It makes the mainwindow lose the focus I think.

image

If I comment out the lines here:

QMessageBox::warning(mainWindow(), "Missing Weather File",
"Invalid weather file object, weather file object has been reset. Please choose another weather file.");

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

versionUpdateMessageBox(versionTranslator, true, fileName, openstudio::toPath(m_osDocument->modelTempDir()));

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.

// convert absolute weather file paths to relative in the model, also copy the epw file to the temp dir
// remove the weather file object if something goes wrong
bool weatherFileOk = this->fixWeatherFileInTemp(true);
if (!weatherFileOk) {
// weather file in model was reset because the file did not exist or it was not a valid EPW
modified = true;
// connect to slot that would show user error dialog
QTimer::singleShot(0, this, &OSDocument::weatherFileReset);
}

TL;DR: I don't know how to properly fix this one. As a workaround we can hide the dialog box. @macumber Any ideas?

jmarrec added a commit that referenced this issue Jan 8, 2024
@jmarrec
Copy link
Collaborator

jmarrec commented Jan 8, 2024

Bad workaround for now at #663

@macumber
Copy link
Collaborator Author

Downgraded to regular bug since crash is fixed

@macumber
Copy link
Collaborator Author

New scope of this bug would be to re-enable the warning to the user on Mac

@macumber macumber changed the title Mac app locks up when opening file that requires update and weather file reset Mac app does not alert user if EPW is reset on open Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants