Mercurial > octave
comparison libgui/src/settings-dialog.ui @ 28132:4cfe24f56336
add editor prefs for forcing coding standards (bug #57860, bug #57861)
* gui-preferences-ed.h: add new editor preferences for removing trailing
spaces and forcing a newline at end of the file when saving the file.
* file-editor-tab.cc (eol_string): new method for determining the
current end of line string;
(do_save_file): depending on the user preferences, rmove trailing
spaces and/or add a newline at the end before saving the file
* file-editor-tab.h: new private method eol_string
* settings-dialog.cc (settings_dialog): initialize new check boxes for
handling trailing spaces and newline at end of file with prefs from
the settings file;
(write_changed_settings): write checked states of new check boxes
into the settings file
* settings-dialog.ui: new check boxes for handling trailing spaces and
newline at end of file
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Sat, 22 Feb 2020 17:03:01 +0100 |
parents | 33674123f33a |
children | ed8d11b1027d |
comparison
equal
deleted
inserted
replaced
28130:712cd23aaa4f | 28132:4cfe24f56336 |
---|---|
30 <width>0</width> | 30 <width>0</width> |
31 <height>0</height> | 31 <height>0</height> |
32 </size> | 32 </size> |
33 </property> | 33 </property> |
34 <property name="currentIndex"> | 34 <property name="currentIndex"> |
35 <number>5</number> | 35 <number>2</number> |
36 </property> | 36 </property> |
37 <widget class="QWidget" name="tab_general"> | 37 <widget class="QWidget" name="tab_general"> |
38 <property name="enabled"> | 38 <property name="enabled"> |
39 <bool>true</bool> | 39 <bool>true</bool> |
40 </property> | 40 </property> |
839 </property> | 839 </property> |
840 <widget class="QWidget" name="scrollAreaWidgetContents"> | 840 <widget class="QWidget" name="scrollAreaWidgetContents"> |
841 <property name="geometry"> | 841 <property name="geometry"> |
842 <rect> | 842 <rect> |
843 <x>0</x> | 843 <x>0</x> |
844 <y>0</y> | 844 <y>-898</y> |
845 <width>1021</width> | 845 <width>1021</width> |
846 <height>1467</height> | 846 <height>1529</height> |
847 </rect> | 847 </rect> |
848 </property> | 848 </property> |
849 <layout class="QVBoxLayout" name="verticalLayout_16"> | 849 <layout class="QVBoxLayout" name="verticalLayout_16"> |
850 <item> | 850 <item> |
851 <widget class="QGroupBox" name="groupBox_5"> | 851 <widget class="QGroupBox" name="groupBox_5"> |
2051 <property name="text"> | 2051 <property name="text"> |
2052 <string>Create nonexistent files without prompting</string> | 2052 <string>Create nonexistent files without prompting</string> |
2053 </property> | 2053 </property> |
2054 </widget> | 2054 </widget> |
2055 </item> | 2055 </item> |
2056 <item row="8" column="0"> | 2056 <item row="10" column="0"> |
2057 <layout class="QHBoxLayout" name="horizontalLayout_2"> | 2057 <layout class="QHBoxLayout" name="horizontalLayout_2"> |
2058 <property name="topMargin"> | 2058 <property name="topMargin"> |
2059 <number>0</number> | 2059 <number>0</number> |
2060 </property> | 2060 </property> |
2061 <item> | 2061 <item> |
2109 </property> | 2109 </property> |
2110 </spacer> | 2110 </spacer> |
2111 </item> | 2111 </item> |
2112 </layout> | 2112 </layout> |
2113 </item> | 2113 </item> |
2114 <item row="10" column="0"> | 2114 <item row="12" column="0"> |
2115 <layout class="QHBoxLayout" name="horizontalLayout_16"> | 2115 <layout class="QHBoxLayout" name="horizontalLayout_16"> |
2116 <item> | 2116 <item> |
2117 <widget class="QLabel" name="label_16"> | 2117 <widget class="QLabel" name="label_16"> |
2118 <property name="text"> | 2118 <property name="text"> |
2119 <string>Text encoding used for loading and saving</string> | 2119 <string>Text encoding used for loading and saving</string> |
2136 </property> | 2136 </property> |
2137 </spacer> | 2137 </spacer> |
2138 </item> | 2138 </item> |
2139 </layout> | 2139 </layout> |
2140 </item> | 2140 </item> |
2141 <item row="7" column="0"> | 2141 <item row="9" column="0"> |
2142 <widget class="QCheckBox" name="editor_hiding_closes_files"> | 2142 <widget class="QCheckBox" name="editor_hiding_closes_files"> |
2143 <property name="text"> | 2143 <property name="text"> |
2144 <string>Close all files when the editor widget is closed/hidden</string> | 2144 <string>Close all files when the editor widget is closed/hidden</string> |
2145 </property> | |
2146 <property name="checked"> | |
2147 <bool>true</bool> | |
2148 </property> | |
2149 </widget> | |
2150 </item> | |
2151 <item row="5" column="0"> | |
2152 <widget class="QCheckBox" name="editor_force_newline"> | |
2153 <property name="text"> | |
2154 <string>Force newline at end when saving file</string> | |
2155 </property> | |
2156 <property name="checked"> | |
2157 <bool>true</bool> | |
2158 </property> | |
2159 </widget> | |
2160 </item> | |
2161 <item row="6" column="0"> | |
2162 <widget class="QCheckBox" name="editor_remove_trailing_spaces"> | |
2163 <property name="text"> | |
2164 <string>Remove trailing spaces when saving file</string> | |
2145 </property> | 2165 </property> |
2146 <property name="checked"> | 2166 <property name="checked"> |
2147 <bool>true</bool> | 2167 <bool>true</bool> |
2148 </property> | 2168 </property> |
2149 </widget> | 2169 </widget> |