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.
This commit is contained in:
VoxelTek 2025-06-26 18:52:57 +10:00
parent 57c269e6de
commit 16a32262ac

View File

@ -163,20 +163,23 @@ void CMainDialog::launch()
if (m_modified) { if (m_modified) {
currentConfigApp->WriteRegisterSettings(); currentConfigApp->WriteRegisterSettings();
} }
QDir::setCurrent(QCoreApplication::applicationDirPath()); QDir::setCurrent(QCoreApplication::applicationDirPath());
QMessageBox msgBox = QMessageBox(
QMessageBox::Warning,
QString("Error!"),
QString("Unable to locate isle executable!"),
QMessageBox::Close
);
#ifdef _WIN32 #ifdef _WIN32
if (!QProcess::startDetached("./isle.exe")) { if (!QProcess::startDetached("./isle.exe")) {
QMessageBox msgBox;
msgBox.setText("Unable to locate isle executable!");
msgBox.setWindowTitle("Error");
msgBox.exec(); msgBox.exec();
} }
#else #else
if (!QProcess::startDetached("./isle")) { // Check in isle-config directory if (!QProcess::startDetached("./isle")) { // Check in isle-config directory
if (!QProcess::startDetached("isle")) { // Check in $PATH if (!QProcess::startDetached("isle")) { // Check in $PATH
QMessageBox msgBox;
msgBox.setText("Unable to locate isle executable!");
msgBox.setWindowTitle("Error");
msgBox.exec(); msgBox.exec();
} }
} }