# HG changeset patch # User Torsten # Date 1369599381 -7200 # Node ID 5cf19370011dcd7327cdea780548ac711bb45fbc # Parent 553cfdd5d66082209187c4f46d2ef040f7720ee4 add more settings concerning tabs and indentation to the editor settings * settings-dialog.ui: insert input widget for tabs and indentation * settings-dialog.cc(constructor): read state for input widgets from settings, (write_changed_settings): write state of input widgets into settings file * file-editor-tab.cc(notice-settings): load tab width and indentation options from settings diff --git a/libgui/src/m-editor/file-editor-tab.cc b/libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -1142,6 +1142,18 @@ _edit_area->setMarginWidth (2, 0); } + _edit_area->setAutoIndent + (settings->value ("editor/auto_indent",true).toBool ()); + _edit_area->setTabIndents + (settings->value ("editor/tab_indents_line",false).toBool ()); + _edit_area->setBackspaceUnindents + (settings->value ("editor/backspace_unindents_line",false).toBool ()); + _edit_area->setIndentationGuides + (settings->value ("editor/show_indent_guides",false).toBool ()); + + _edit_area->setTabWidth + (settings->value ("editor/tab_width",2).toInt ()); + _long_title = settings->value ("editor/longWindowTitle", false).toBool (); update_window_title (false); diff --git a/libgui/src/settings-dialog.cc b/libgui/src/settings-dialog.cc --- a/libgui/src/settings-dialog.cc +++ b/libgui/src/settings-dialog.cc @@ -110,6 +110,12 @@ ui->editor_checkbox_ac_replace->setChecked (settings->value ("editor/codeCompletion_replace",false).toBool ()); ui->editor_ws_checkbox->setChecked (settings->value ("editor/show_white_space",false).toBool ()); ui->editor_ws_indent_checkbox->setChecked (settings->value ("editor/show_white_space_indent",false).toBool ()); + ui->editor_auto_ind_checkbox->setChecked (settings->value ("editor/auto_indent",true).toBool ()); + ui->editor_tab_ind_checkbox->setChecked (settings->value ("editor/tab_indents_line",false).toBool ()); + ui->editor_bs_unind_checkbox->setChecked (settings->value ("editor/backspace_unindents_line",false).toBool ()); + ui->editor_ind_guides_checkbox->setChecked (settings->value ("editor/show_indent_guides",false).toBool ()); + ui->editor_ind_width_spinbox->setValue (settings->value ("editor/indent_width",2).toInt ()); + ui->editor_tab_width_spinbox->setValue (settings->value ("editor/tab_width",2).toInt ()); ui->editor_longWindowTitle->setChecked (settings->value ("editor/longWindowTitle",false).toBool ()); ui->editor_restoreSession->setChecked (settings->value ("editor/restoreSession",true).toBool ()); ui->terminal_fontName->setCurrentFont (QFont (settings->value ("terminal/fontName","Courier New").toString()) ); @@ -415,6 +421,12 @@ settings->setValue ("editor/codeCompletion_replace", ui->editor_checkbox_ac_replace->isChecked ()); settings->setValue ("editor/show_white_space", ui->editor_ws_checkbox->isChecked ()); settings->setValue ("editor/show_white_space_indent", ui->editor_ws_indent_checkbox->isChecked ()); + settings->setValue ("editor/auto_indent", ui->editor_auto_ind_checkbox->isChecked ()); + settings->setValue ("editor/tab_indents_line", ui->editor_tab_ind_checkbox->isChecked ()); + settings->setValue ("editor/backspace_unindents_line", ui->editor_bs_unind_checkbox->isChecked ()); + settings->setValue ("editor/show_indent_guides", ui->editor_ind_guides_checkbox->isChecked ()); + settings->setValue ("editor/indent_width", ui->editor_ind_width_spinbox->value ()); + settings->setValue ("editor/tab_width", ui->editor_tab_width_spinbox->value ()); settings->setValue ("editor/longWindowTitle", ui->editor_longWindowTitle->isChecked()); settings->setValue ("editor/restoreSession", ui->editor_restoreSession->isChecked ()); settings->setValue ("terminal/fontSize", ui->terminal_fontSize->value()); diff --git a/libgui/src/settings-dialog.ui b/libgui/src/settings-dialog.ui --- a/libgui/src/settings-dialog.ui +++ b/libgui/src/settings-dialog.ui @@ -198,6 +198,13 @@ + + + Show complete path in window title + + + + true @@ -222,7 +229,7 @@ false - But no white spaces used for indentation + Do not show white spaces used for indentation @@ -297,6 +304,98 @@ Qt::Horizontal + + QSizePolicy::Fixed + + + + 80 + 20 + + + + + + + + + + Qt::Horizontal + + + + + + + + + Indent width + + + + + + + Tab indents line + + + + + + + Auto indentation + + + + + + + 1 + + + 32 + + + 2 + + + + + + + Tab width + + + + + + + Show indentation guides + + + + + + + 1 + + + 32 + + + + + + + Backspace unindents line + + + + + + + Qt::Horizontal + 40 @@ -308,16 +407,9 @@ - - - Show complete path in window title - - - - - - - Restore tabs from previous session on startup + + + Qt::Horizontal @@ -472,9 +564,30 @@ + + + + Qt::Horizontal + + + + + + + Restore editor tabs from previous session on startup + + + + + + Qt::Horizontal + + + + Qt::Vertical @@ -714,7 +827,7 @@ - Font Size + Font size @@ -839,25 +952,18 @@ - - - Use proxy server - - - - - - - + + + false - Proxy Type: + Hostname: - + false @@ -874,24 +980,34 @@ - - + + false - Hostname: + Username: + + + + + + + Use proxy server - - + + false + + Proxy Type: + - + false @@ -901,31 +1017,7 @@ - - - - false - - - - - - - false - - - Username: - - - - - - - false - - - - + false @@ -935,7 +1027,28 @@ - + + + + false + + + + + + + false + + + + + + + false + + + + false @@ -947,6 +1060,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + +