fix for issue #269
authorsheepluva
Sun, 11 Sep 2011 15:18:46 +0200
changeset 5849 b84b41aba275
parent 5848 103e3a80daa6
child 5850 f07e2a5e6ad0
fix for issue #269
QTfrontend/hwform.cpp
QTfrontend/hwform.h
QTfrontend/main.cpp
QTfrontend/pagedrawmap.cpp
--- a/QTfrontend/hwform.cpp	Sun Sep 11 08:54:21 2011 -0400
+++ b/QTfrontend/hwform.cpp	Sun Sep 11 15:18:46 2011 +0200
@@ -93,7 +93,7 @@
 bool frontendEffects = true;
 QString playerHash;
 
-HWForm::HWForm(QWidget *parent)
+HWForm::HWForm(QWidget *parent, QString styleSheet)
   : QMainWindow(parent), pnetserver(0), pRegisterServer(0), editedTeam(0), hwnet(0)
 {
 #ifdef USE_XFIRE
@@ -104,6 +104,7 @@
     frontendEffects = gameSettings->value("frontend/effects", true).toBool();
     playerHash = QString(QCryptographicHash::hash(gameSettings->value("net/nick","").toString().toLatin1(), QCryptographicHash::Md5).toHex());
 
+    this->setStyleSheet(styleSheet);
     ui.setupUi(this);
     setMinimumSize(760, 580);
     //setFocusPolicy(Qt::StrongFocus);
--- a/QTfrontend/hwform.h	Sun Sep 11 08:54:21 2011 -0400
+++ b/QTfrontend/hwform.h	Sun Sep 11 15:18:46 2011 +0200
@@ -52,7 +52,7 @@
     Q_OBJECT
 
 public:
-    HWForm(QWidget *parent = 0);
+    HWForm(QWidget *parent = 0, QString styleSheet = "");
     Ui_HWForm ui;
     SDLInteraction sdli;
     GameUIConfig * config;
--- a/QTfrontend/main.cpp	Sun Sep 11 08:54:21 2011 -0400
+++ b/QTfrontend/main.cpp	Sun Sep 11 15:18:46 2011 +0200
@@ -96,8 +96,8 @@
 
     Q_INIT_RESOURCE(hedgewars);
 
-    qApp->setStyleSheet
-        (QString(
+    QString styleSheetFromHell =
+        QString(
             "HWForm,QDialog{"
                 "background-image: url(\":/res/Background.png\");"
                 "background-position: bottom center;"
@@ -315,8 +315,7 @@
                 "background-color: #ffcc00;"
                 "width: 8px;"
             "}"
-            )
-        );
+            );
 
     bindir->cd("bin"); // workaround over NSIS installer
 
@@ -484,7 +483,7 @@
     CocoaInitializer initializer;
 #endif
 
-    app.form = new HWForm();
+    app.form = new HWForm(NULL,styleSheetFromHell);
 
     app.form->show();
     return app.exec();
--- a/QTfrontend/pagedrawmap.cpp	Sun Sep 11 08:54:21 2011 -0400
+++ b/QTfrontend/pagedrawmap.cpp	Sun Sep 11 15:18:46 2011 +0200
@@ -45,7 +45,7 @@
 
 void PageDrawMap::load()
 {
-    QString fileName = QFileDialog::getOpenFileName(this, tr("Load drawn map"), ".", tr("Drawn Maps (*.hwmap);;All files (*.*)"));
+    QString fileName = QFileDialog::getOpenFileName(NULL, tr("Load drawn map"), ".", tr("Drawn Maps (*.hwmap);;All files (*.*)"));
 
     if(!fileName.isEmpty())
         drawMapWidget->load(fileName);
@@ -53,7 +53,7 @@
 
 void PageDrawMap::save()
 {
-    QString fileName = QFileDialog::getSaveFileName(this, tr("Save drawn map"), ".", tr("Drawn Maps (*.hwmap);;All files (*.*)"));
+    QString fileName = QFileDialog::getSaveFileName(NULL, tr("Save drawn map"), ".", tr("Drawn Maps (*.hwmap);;All files (*.*)"));
 
     if(!fileName.isEmpty())
         drawMapWidget->save(fileName);