--- a/QTfrontend/HWApplication.cpp Sat Jun 14 15:49:44 2014 +0200
+++ b/QTfrontend/HWApplication.cpp Sat Jun 14 23:59:20 2014 +0200
@@ -20,7 +20,6 @@
#include <QFileOpenEvent>
#include <QEvent>
-#include "hwform.h"
#include "MessageDialog.h"
#if !defined(Q_OS_WIN)
--- a/QTfrontend/HWApplication.h Sat Jun 14 15:49:44 2014 +0200
+++ b/QTfrontend/HWApplication.h Sat Jun 14 23:59:20 2014 +0200
@@ -20,6 +20,7 @@
#define HWAPP_H
#include <QApplication>
+#include "hwform.h"
class HWForm;
class QEvent;
--- a/QTfrontend/util/MessageDialog.cpp Sat Jun 14 15:49:44 2014 +0200
+++ b/QTfrontend/util/MessageDialog.cpp Sat Jun 14 23:59:20 2014 +0200
@@ -19,6 +19,8 @@
#include "MessageDialog.h"
#include "HWApplication.h"
+
+
int MessageDialog::ShowFatalMessage(const QString & msg, QWidget * parent)
{
return ShowMessage(QMessageBox::tr("Hedgewars - Error"),
@@ -51,5 +53,20 @@
msgMsg.setIcon(icon);
msgMsg.setWindowModality(Qt::WindowModal);
+ if (!parent)
+ {
+ try
+ {
+ /* workaround to make sure style is correct
+ * I'd rather assign the stylesheet to qApp directly (in main.cpp),
+ * but the current Stylesheet will ruin the look (e.g. map selection) :(
+ */
+ HWApplication * app = dynamic_cast<HWApplication*>(HWApplication::instance());
+ if (app->form)
+ msgMsg.setStyleSheet(app->form->styleSheet());
+ }
+ catch (...) { /* nothing */ }
+ }
+
return msgMsg.exec();
}