changeset 25074:f50fa34827fb stable

use spin boxes for col/row/ width/height in settings for variable editor * settings-dialog.cc (ctor): set values in the spin boxes from settings file; (write_changed_settings): store spin box values to settings file * settings-dialog.ui: replace test labels by spin boxes for column width and row height of variable editor
author Torsten <mttl@mailbox.org>
date Mon, 02 Apr 2018 00:56:36 +0200
parents 08d19ea50742
children 8fb9aeed4549
files libgui/src/settings-dialog.cc libgui/src/settings-dialog.ui
diffstat 2 files changed, 55 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/settings-dialog.cc	Mon Apr 02 00:15:59 2018 +0200
+++ b/libgui/src/settings-dialog.cc	Mon Apr 02 00:56:36 2018 +0200
@@ -568,10 +568,10 @@
   read_terminal_colors (settings);
 
   // variable editor
-  ui->varedit_columnWidth->setText (settings->value ("variable_editor/column_width", "100").toString ());
+  ui->varedit_columnWidth->setValue (settings->value ("variable_editor/column_width", 100).toInt ());
   ui->varedit_autoFitColumnWidth->setChecked (settings->value ("variable_editor/autofit_column_width", false).toBool ());
   ui->varedit_autofitType->setCurrentIndex (settings->value ("autofit_type", 0).toInt ());
-  ui->varedit_rowHeight->setText (settings->value ("variable_editor/row_height", "2").toString ());
+  ui->varedit_rowHeight->setValue (settings->value ("variable_editor/row_height", 10).toInt ());
   ui->varedit_rowAutofit->setChecked (settings->value ("variable_editor/autofit_row_height", true).toBool ());
 
   ui->varedit_font->setCurrentFont (QFont (settings->value ("variable_editor/font_name", settings->value ("terminal/fontName", "Courier New")).toString ()));
@@ -961,8 +961,8 @@
   // Variable editor
   settings->setValue ("variable_editor/autofit_column_width", ui->varedit_autoFitColumnWidth->isChecked ());
   settings->setValue ("variable_editor/autofit_type", ui->varedit_autofitType->currentIndex ());
-  settings->setValue ("variable_editor/column_width", ui->varedit_columnWidth->text ());
-  settings->setValue ("variable_editor/row_height", ui->varedit_rowHeight->text ());
+  settings->setValue ("variable_editor/column_width", ui->varedit_columnWidth->value ());
+  settings->setValue ("variable_editor/row_height", ui->varedit_rowHeight->value ());
   settings->setValue ("variable_editor/autofit_row_height", ui->varedit_rowAutofit->isChecked ());
   settings->setValue ("variable_editor/use_terminal_font", ui->varedit_useTerminalFont->isChecked ());
   settings->setValue ("variable_editor/alternate_rows", ui->varedit_alternate->isChecked ());
--- a/libgui/src/settings-dialog.ui	Mon Apr 02 00:15:59 2018 +0200
+++ b/libgui/src/settings-dialog.ui	Mon Apr 02 00:56:36 2018 +0200
@@ -32,7 +32,7 @@
       </size>
      </property>
      <property name="currentIndex">
-      <number>1</number>
+      <number>8</number>
      </property>
      <widget class="QWidget" name="tab_general">
       <property name="enabled">
@@ -509,7 +509,7 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>642</width>
+            <width>645</width>
             <height>1012</height>
            </rect>
           </property>
@@ -1823,8 +1823,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>481</width>
-            <height>230</height>
+            <width>658</width>
+            <height>573</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_7">
@@ -2104,8 +2104,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>474</width>
-            <height>196</height>
+            <width>658</width>
+            <height>573</height>
            </rect>
           </property>
           <layout class="QGridLayout" name="gridLayout_8">
@@ -2248,8 +2248,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>200</width>
-            <height>77</height>
+            <width>658</width>
+            <height>573</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_19">
@@ -2317,8 +2317,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>364</width>
-            <height>210</height>
+            <width>658</width>
+            <height>573</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_25">
@@ -2516,8 +2516,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>529</width>
-            <height>199</height>
+            <width>658</width>
+            <height>573</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_20">
@@ -2675,8 +2675,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>615</width>
-            <height>169</height>
+            <width>658</width>
+            <height>573</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_vesc_manual">
@@ -2692,6 +2692,26 @@
             <layout class="QVBoxLayout" name="verticalLayout_ve">
              <item>
               <layout class="QGridLayout" name="gridLayout_ve">
+               <item row="0" column="3">
+                <widget class="QLabel" name="label_26">
+                 <property name="text">
+                  <string>Font size</string>
+                 </property>
+                 <property name="alignment">
+                  <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                 </property>
+                </widget>
+               </item>
+               <item row="2" column="2" colspan="2">
+                <widget class="QCheckBox" name="varedit_rowAutofit">
+                 <property name="text">
+                  <string>Plus font height</string>
+                 </property>
+                 <property name="checked">
+                  <bool>true</bool>
+                 </property>
+                </widget>
+               </item>
                <item row="2" column="0">
                 <widget class="QLabel" name="label_27">
                  <property name="text">
@@ -2709,13 +2729,6 @@
                  </property>
                 </widget>
                </item>
-               <item row="1" column="1">
-                <widget class="QLineEdit" name="varedit_columnWidth">
-                 <property name="text">
-                  <string>20</string>
-                 </property>
-                </widget>
-               </item>
                <item row="1" column="0">
                 <widget class="QLabel" name="label_ve_colwidth">
                  <property name="text">
@@ -2743,23 +2756,6 @@
                  </property>
                 </widget>
                </item>
-               <item row="0" column="3">
-                <widget class="QLabel" name="label_26">
-                 <property name="text">
-                  <string>Font size</string>
-                 </property>
-                 <property name="alignment">
-                  <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-                 </property>
-                </widget>
-               </item>
-               <item row="2" column="1">
-                <widget class="QLineEdit" name="varedit_rowHeight">
-                 <property name="text">
-                  <string>2</string>
-                 </property>
-                </widget>
-               </item>
                <item row="0" column="1" colspan="2">
                 <widget class="QFontComboBox" name="varedit_font">
                  <property name="currentFont">
@@ -2776,16 +2772,6 @@
                  </property>
                 </widget>
                </item>
-               <item row="2" column="2" colspan="2">
-                <widget class="QCheckBox" name="varedit_rowAutofit">
-                 <property name="text">
-                  <string>Plus font height</string>
-                 </property>
-                 <property name="checked">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
                <item row="1" column="3" colspan="2">
                 <widget class="QComboBox" name="varedit_autofitType">
                  <property name="enabled">
@@ -2819,6 +2805,23 @@
                  </property>
                 </spacer>
                </item>
+               <item row="2" column="1">
+                <widget class="QSpinBox" name="varedit_rowHeight">
+                 <property name="value">
+                  <number>10</number>
+                 </property>
+                </widget>
+               </item>
+               <item row="1" column="1">
+                <widget class="QSpinBox" name="varedit_columnWidth">
+                 <property name="maximum">
+                  <number>500</number>
+                 </property>
+                 <property name="value">
+                  <number>100</number>
+                 </property>
+                </widget>
+               </item>
               </layout>
              </item>
              <item>