fix for issue 599: "Change graphics size settings to use qspinbox"? somebody ask unC0Rr if that's what he wanted :p 0.9.19
authorsheepluva
Wed, 17 Apr 2013 14:57:56 +0200
branch0.9.19
changeset 8902 a94c074fd483
parent 8900 b77fd3c2eec5
child 8904 6ea838b8dcd5
fix for issue #599: "Change graphics size settings to use qspinbox"? somebody ask unC0Rr if that's what he wanted :p
QTfrontend/game.cpp
QTfrontend/gameuiconfig.cpp
QTfrontend/ui/page/pageoptions.cpp
QTfrontend/ui/page/pageoptions.h
--- a/QTfrontend/game.cpp	Tue Apr 16 19:53:52 2013 +0200
+++ b/QTfrontend/game.cpp	Wed Apr 17 14:57:56 2013 +0200
@@ -306,8 +306,8 @@
             int size = msg.size();
             QString newResolution = QString().append(msg.mid(2)).left(size - 4);
             QStringList wh = newResolution.split('x');
-            config->Form->ui.pageOptions->windowWidthEdit->setText(wh[0]);
-            config->Form->ui.pageOptions->windowHeightEdit->setText(wh[1]);
+            config->Form->ui.pageOptions->windowWidthEdit->setValue(wh[0].toInt());
+            config->Form->ui.pageOptions->windowHeightEdit->setValue(wh[1].toInt());
             break;
         }
         default:
--- a/QTfrontend/gameuiconfig.cpp	Tue Apr 16 19:53:52 2013 +0200
+++ b/QTfrontend/gameuiconfig.cpp	Wed Apr 17 14:57:56 2013 +0200
@@ -94,8 +94,8 @@
     // If left blank reset the resolution to the default
     wWidth = (wWidth == "" ? widthStr : wWidth);
     wHeight = (wHeight == "" ? heightStr : wHeight);
-    Form->ui.pageOptions->windowWidthEdit->setText(wWidth);
-    Form->ui.pageOptions->windowHeightEdit->setText(wHeight);
+    Form->ui.pageOptions->windowWidthEdit->setValue(wWidth.toInt());
+    Form->ui.pageOptions->windowHeightEdit->setValue(wHeight.toInt());
 
     Form->ui.pageOptions->CBResolution->setCurrentIndex((t < 0) ? 1 : t);
     Form->ui.pageOptions->CBFullscreen->setChecked(value("video/fullscreen", false).toBool());
--- a/QTfrontend/ui/page/pageoptions.cpp	Tue Apr 16 19:53:52 2013 +0200
+++ b/QTfrontend/ui/page/pageoptions.cpp	Wed Apr 17 14:57:56 2013 +0200
@@ -275,11 +275,13 @@
             winLabelX->setFixedWidth(40);
             winLabelX->setAlignment(Qt::AlignCenter);
 
-            windowWidthEdit = new QLineEdit(groupGame);
-            windowWidthEdit->setValidator(new QIntValidator(this));
+            // TODO: less random max. also:
+            // make some min/max-consts, shared with engine?
+            windowWidthEdit = new QSpinBox(groupGame);
+            windowWidthEdit->setRange(640, 102400);
             windowWidthEdit->setFixedSize(55, CBResolution->height());
-            windowHeightEdit = new QLineEdit(groupGame);
-            windowHeightEdit->setValidator(new QIntValidator(this));
+            windowHeightEdit = new QSpinBox(groupGame);
+            windowHeightEdit->setRange(480, 102400);
             windowHeightEdit->setFixedSize(55, CBResolution->height());
 
             winResLayout->addWidget(windowWidthEdit, 0);
--- a/QTfrontend/ui/page/pageoptions.h	Tue Apr 16 19:53:52 2013 +0200
+++ b/QTfrontend/ui/page/pageoptions.h	Wed Apr 17 14:57:56 2013 +0200
@@ -77,8 +77,8 @@
         QComboBox *CBTeamName;
         IconedGroupBox *AGGroupBox;
         QComboBox *CBResolution;
-        QLineEdit *windowWidthEdit;
-        QLineEdit *windowHeightEdit;
+        QSpinBox *windowWidthEdit;
+        QSpinBox *windowHeightEdit;
         QComboBox *CBStereoMode;
         QCheckBox *CBFrontendSound;
         QCheckBox *CBFrontendMusic;