Commit 599e1204 authored by Fabien Parent's avatar Fabien Parent
Browse files

Add gsettings key to configure the textview.

parent cca79592
......@@ -45,6 +45,10 @@ const char *const conf_key_window_height = "window-height";
const char *const conf_key_window_position_x = "window-position-x";
const char *const conf_key_window_position_y = "window-position-y";
const char *const conf_key_window_maximized = "window-maximized";
const char *const conf_key_show_line_numbers = "show-line-numbers";
const char *const conf_key_highlight_current_line = "highlight-current-line";
const char *const conf_key_auto_indentation = "auto-indentation";
const char *const conf_key_draw_spaces = "draw-space";
const char *const ui_mainwindow_filename = REGEXXER_PKGDATADIR G_DIR_SEPARATOR_S
"mainwindow.ui";
......
......@@ -244,6 +244,12 @@ void MainWindow::initialize(const InitState& init)
if (maximized)
window_->maximize();
textview_->set_show_line_numbers(settings->get_boolean(conf_key_show_line_numbers));
textview_->set_highlight_current_line(settings->get_boolean(conf_key_highlight_current_line));
textview_->set_auto_indent(settings->get_boolean(conf_key_auto_indentation));
textview_->set_draw_spaces(static_cast<Gsv::SourceDrawSpacesFlags>
(settings->get_flags(conf_key_draw_spaces)));
std::string folder;
if (!init.folder.empty())
......
<schemalist>
<flags id="draw-space-flags">
<value nick="space" value="1"/>
<value nick="tab" value="2"/>
<value nick="new-line" value="4"/>
<value nick="nbsp" value="8"/>
</flags>
<schema id="org.regexxer" path="/apps/regexxer/">
<key name="files-patterns" type="as">
<default>['*.[ch]','*.{c,cc,cpp,cxx,c++,C,h,hh,hpp,hxx,h++}','*.{ccg,hg}','*.idl','*.{java,jsp}','*.{pl,pm,cgi}','*.py','*.php[0-9]?','*.{html,htm,shtml,js,wml}','*.{xml,xsl,css,dtd,xsd}']</default>
......@@ -71,5 +78,29 @@
<_summary>window maximization</_summary>
<_description>Whether the window is maximized.</_description>
</key>
<key name="show-line-numbers" type="b">
<default>true</default>
<_summary>Show line numbers</_summary>
<_description>Whether to show the line numbers of the text view.</_description>
</key>
<key name="highlight-current-line" type="b">
<default>true</default>
<_summary>Highlight the current line</_summary>
<_description>Whether to highlight the current line of the text view.</_description>
</key>
<key name="auto-indentation" type="b">
<default>true</default>
<_summary>Auto indentation</_summary>
<_description>Whether to enable auto indentation the text view.</_description>
</key>
<key name="draw-space" flags="draw-space-flags">
<default>["space","tab"]</default>
<_summary>Draw spaces</_summary>
<_description>Which type of space to draw in the text view.</_description>
</key>
</schema>
</schemalist>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment