From 16a32262ac5d57cf5eb9f8410fb6f5a0d26950f4 Mon Sep 17 00:00:00 2001 From: VoxelTek <53562267+VoxelTek@users.noreply.github.com> Date: Thu, 26 Jun 2025 18:52:57 +1000 Subject: [PATCH] Use one QMessageBox for both Win and *nix Create one QMessageBox object to use for both Windows and non-Windows platforms. Additionally, set all relevant text during creation of QMessageBox, and show Warning icon as part of message box. --- CONFIG/MainDlg.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/CONFIG/MainDlg.cpp b/CONFIG/MainDlg.cpp index 9f105f33..0d151639 100644 --- a/CONFIG/MainDlg.cpp +++ b/CONFIG/MainDlg.cpp @@ -163,20 +163,23 @@ void CMainDialog::launch() if (m_modified) { currentConfigApp->WriteRegisterSettings(); } + QDir::setCurrent(QCoreApplication::applicationDirPath()); + + QMessageBox msgBox = QMessageBox( + QMessageBox::Warning, + QString("Error!"), + QString("Unable to locate isle executable!"), + QMessageBox::Close + ); + #ifdef _WIN32 if (!QProcess::startDetached("./isle.exe")) { - QMessageBox msgBox; - msgBox.setText("Unable to locate isle executable!"); - msgBox.setWindowTitle("Error"); msgBox.exec(); } #else if (!QProcess::startDetached("./isle")) { // Check in isle-config directory if (!QProcess::startDetached("isle")) { // Check in $PATH - QMessageBox msgBox; - msgBox.setText("Unable to locate isle executable!"); - msgBox.setWindowTitle("Error"); msgBox.exec(); } }