Fix game window width/height setting being broken when using Arabic locale
authorWuzzy <Wuzzy2@mail.ru>
Thu, 01 Nov 2018 20:29:42 +0100
changeset 14068 b8df809c62bf
parent 14067 2b461e323de8
child 14069 12bfae554de5
Fix game window width/height setting being broken when using Arabic locale Qt displays numbers differently in Arabic. The spinbox window height/width used getText instead of value to get the value, which was wrong because this gets the user-facing string (in arabic) instead of the number to use internally.
ChangeLog.txt
QTfrontend/gameuiconfig.cpp
--- a/ChangeLog.txt	Thu Nov 01 21:39:45 2018 +0300
+++ b/ChangeLog.txt	Thu Nov 01 20:29:42 2018 +0100
@@ -85,6 +85,7 @@
  * No longer save default weapon schemes into file
  * Pseudo player names in chat (like “[server]”) are no longer clickable
  * Lobby/room: No longer allow opening context menu if no player selected
+ * Fix game window width/height setting being broken when using Arabic locale
 
 Server:
  + Add “/help” chat command for command help
--- a/QTfrontend/gameuiconfig.cpp	Thu Nov 01 21:39:45 2018 +0300
+++ b/QTfrontend/gameuiconfig.cpp	Thu Nov 01 20:29:42 2018 +0100
@@ -240,8 +240,8 @@
 void GameUIConfig::SaveOptions()
 {
     setValue("video/fullscreenResolution", Form->ui.pageOptions->CBResolution->currentText());
-    setValue("video/windowedWidth", Form->ui.pageOptions->windowWidthEdit->text());
-    setValue("video/windowedHeight", Form->ui.pageOptions->windowHeightEdit->text());
+    setValue("video/windowedWidth", Form->ui.pageOptions->windowWidthEdit->value());
+    setValue("video/windowedHeight", Form->ui.pageOptions->windowHeightEdit->value());
     setValue("video/fullscreen", vid_Fullscreen());
 
     setValue("video/quality", Form->ui.pageOptions->SLQuality->value());
@@ -363,8 +363,8 @@
         full.setWidth(wh[0].toInt());
         full.setHeight(wh[1].toInt());
     }
-    windowed.setWidth(Form->ui.pageOptions->windowWidthEdit->text().toInt());
-    windowed.setHeight(Form->ui.pageOptions->windowHeightEdit->text().toInt());
+    windowed.setWidth(Form->ui.pageOptions->windowWidthEdit->value());
+    windowed.setHeight(Form->ui.pageOptions->windowHeightEdit->value());
     return std::make_pair(full, windowed);
 }