changeset 19517:5fb4505b84ff gui-release

provide option for using tabs for indentations in the editor * settings-dialog.ui: add new checkbox for using tabs for indentations * settings-dialog.cc (constructor): init new checkbox from the settings file; (write_changed_settings): write state of new checkbox into the settings file * file-editor-tab.cc (notice-settings): read from settings file whether to use tabs for indentations or not
author Torsten <ttl@justmail.de>
date Thu, 06 Nov 2014 18:50:25 +0100
parents 735bc47d18af
children 2b708273548d
files libgui/src/m-editor/file-editor-tab.cc libgui/src/settings-dialog.cc libgui/src/settings-dialog.ui
diffstat 3 files changed, 34 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc
+++ b/libgui/src/m-editor/file-editor-tab.cc
@@ -1881,6 +1881,8 @@
         (settings->value ("editor/backspace_unindents_line",false).toBool ());
   _edit_area->setIndentationGuides
         (settings->value ("editor/show_indent_guides",false).toBool ());
+  _edit_area->setIndentationsUseTabs
+        (settings->value ("editor/indent_uses_tabs",false).toBool ());
 
   _edit_area->setTabWidth
         (settings->value ("editor/tab_width",2).toInt ());
--- a/libgui/src/settings-dialog.cc
+++ b/libgui/src/settings-dialog.cc
@@ -210,6 +210,8 @@
     settings->value ("editor/show_indent_guides",false).toBool ());
   ui->editor_ind_width_spinbox->setValue (
     settings->value ("editor/indent_width", 2).toInt ());
+  ui->editor_ind_uses_tabs_checkbox->setChecked (
+    settings->value ("editor/indent_uses_tabs", false).toBool ());
   ui->editor_tab_width_spinbox->setValue (
     settings->value ("editor/tab_width", 2).toInt ());
   ui->editor_longWindowTitle->setChecked (
@@ -663,6 +665,8 @@
                       ui->editor_ind_guides_checkbox->isChecked ());
   settings->setValue ("editor/indent_width",
                       ui->editor_ind_width_spinbox->value ());
+  settings->setValue ("editor/indent_uses_tabs",
+                      ui->editor_ind_uses_tabs_checkbox->isChecked ());
   settings->setValue ("editor/tab_width",
                       ui->editor_tab_width_spinbox->value ());
   settings->setValue ("editor/longWindowTitle",
--- a/libgui/src/settings-dialog.ui
+++ b/libgui/src/settings-dialog.ui
@@ -52,8 +52,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>560</width>
-            <height>353</height>
+            <width>678</width>
+            <height>378</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_17">
@@ -404,9 +404,9 @@
           <property name="geometry">
            <rect>
             <x>0</x>
-            <y>0</y>
+            <y>-256</y>
             <width>662</width>
-            <height>613</height>
+            <height>634</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_16">
@@ -755,13 +755,6 @@
                  </property>
                 </widget>
                </item>
-               <item row="2" column="4">
-                <widget class="QCheckBox" name="editor_tab_ind_checkbox">
-                 <property name="text">
-                  <string>Tab indents line</string>
-                 </property>
-                </widget>
-               </item>
                <item row="0" column="5">
                 <spacer name="horizontalSpacer_14">
                  <property name="orientation">
@@ -778,6 +771,13 @@
                  </property>
                 </spacer>
                </item>
+               <item row="2" column="4">
+                <widget class="QCheckBox" name="editor_tab_ind_checkbox">
+                 <property name="text">
+                  <string>Tab indents line</string>
+                 </property>
+                </widget>
+               </item>
                <item row="0" column="4">
                 <widget class="QCheckBox" name="editor_auto_ind_checkbox">
                  <property name="text">
@@ -871,6 +871,13 @@
                  </property>
                 </spacer>
                </item>
+               <item row="3" column="4">
+                <widget class="QCheckBox" name="editor_ind_uses_tabs_checkbox">
+                 <property name="text">
+                  <string>Indentation uses tabs</string>
+                 </property>
+                </widget>
+               </item>
               </layout>
              </item>
              <item>
@@ -1280,8 +1287,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>488</width>
-            <height>262</height>
+            <width>678</width>
+            <height>378</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_7">
@@ -1545,8 +1552,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>474</width>
-            <height>318</height>
+            <width>678</width>
+            <height>378</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_18">
@@ -1709,8 +1716,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>203</width>
-            <height>134</height>
+            <width>678</width>
+            <height>378</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_19">
@@ -1784,8 +1791,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>368</width>
-            <height>244</height>
+            <width>678</width>
+            <height>378</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_25">
@@ -2047,8 +2054,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>529</width>
-            <height>204</height>
+            <width>678</width>
+            <height>378</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_20">