Skip to content

Commit

Permalink
RMG: expand details by default in message boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Feb 1, 2025
1 parent c7dd5a6 commit 85b4daa
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Source/RMG/UserInterface/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,20 @@ void MainWindow::showErrorMessage(QString text, QString details, bool force)
msgBox->setText(text);
msgBox->setDetailedText(details);
msgBox->addButton(QMessageBox::Ok);

// expand details by default
if (!details.isEmpty())
{
for (const auto& button : msgBox->buttons())
{
if (msgBox->buttonRole(button) == QMessageBox::ActionRole)
{
button->click();
break;
}
}
}

msgBox->show();

this->ui_MessageBoxList.append(msgBox);
Expand Down
14 changes: 14 additions & 0 deletions Source/RMG/Utilities/QtMessageBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ void QtMessageBox::Error(QWidget* parent, QString text, QString details)
msgBox.setText(text);
msgBox.setDetailedText(details);
msgBox.addButton(QMessageBox::Ok);

// expand details by default
if (!details.isEmpty())
{
for (const auto& button : msgBox.buttons())
{
if (msgBox.buttonRole(button) == QMessageBox::ActionRole)
{
button->click();
break;
}
}
}

msgBox.exec();
}

0 comments on commit 85b4daa

Please sign in to comment.