GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
settings-dialog.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2011-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 // Programming Note: this file has many lines longer than 80 characters
27 // due to long function, variable, and property names. Please don't
28 // break those lines as it tends to make this code even harder to read.
29 
30 #if defined (HAVE_CONFIG_H)
31 # include "config.h"
32 #endif
33 
34 #include <QButtonGroup>
35 #include <QDir>
36 #include <QFileDialog>
37 #include <QFileInfo>
38 #include <QHash>
39 #include <QMessageBox>
40 #include <QScrollBar>
41 #include <QStyleFactory>
42 #include <QTextCodec>
43 #include <QVector>
44 
45 #if defined (HAVE_QSCINTILLA)
46 # include "octave-qscintilla.h"
47 # include "octave-txt-lexer.h"
48 # include <QScrollArea>
49 
50 # if defined (HAVE_QSCI_QSCILEXEROCTAVE_H)
51 # define HAVE_LEXER_OCTAVE 1
52 # include <Qsci/qscilexeroctave.h>
53 # elif defined (HAVE_QSCI_QSCILEXERMATLAB_H)
54 # define HAVE_LEXER_MATLAB 1
55 # include <Qsci/qscilexermatlab.h>
56 # endif
57 
58 # include <Qsci/qscilexercpp.h>
59 # include <Qsci/qscilexerjava.h>
60 # include <Qsci/qscilexerbash.h>
61 # include <Qsci/qscilexerperl.h>
62 # include <Qsci/qscilexerbatch.h>
63 # include <Qsci/qscilexerdiff.h>
64 #endif
65 
66 #include "gui-preferences-all.h"
67 #include "octave-qobject.h"
68 #include "octave-qtutils.h"
69 #include "settings-dialog.h"
70 #include "variable-editor.h"
71 #include "workspace-model.h"
72 
74 
76  const QString& desired_tab)
77 : QDialog (p), Ui::settings_dialog (), m_octave_qobj (oct_qobj)
78 {
79  setupUi (this);
80 
81  resource_manager& rmgr = m_octave_qobj.get_resource_manager ();
83 
84  if (! settings)
85  {
86  QMessageBox msgBox
87  (QMessageBox::Warning, tr ("Octave Preferences"),
88  tr ("Unable to save preferences. Missing preferences file or unknown directory."));
89 
90  msgBox.exec ();
91 
92  return;
93  }
94 
95  // look for available language files and the actual settings
96  QString qm_dir_name = rmgr.get_gui_translation_dir ();
97  QDir qm_dir (qm_dir_name);
98  QFileInfoList qm_files = qm_dir.entryInfoList (QStringList ("*.qm"),
99  QDir::Files | QDir::Readable, QDir::Name);
100 
101  for (int i = 0; i < qm_files.length (); i++) // insert available languages
102  comboBox_language->addItem (qm_files.at (i).baseName ());
103  // System at beginning
104  comboBox_language->insertItem (0, tr ("System setting"));
105  comboBox_language->insertSeparator (1); // separator after System
106  QString language = settings->value (global_language.key,
107  global_language.def).toString ();
108  if (language == global_language.def.toString ())
109  language = tr ("System setting");
110  int selected = comboBox_language->findText (language);
111  if (selected >= 0)
112  comboBox_language->setCurrentIndex (selected);
113  else
114  comboBox_language->setCurrentIndex (0); // System is default
115 
116  // Global style
117  QStringList styles = QStyleFactory::keys();
118  styles.append (global_extra_styles);
119  combo_styles->addItems (styles);
120  combo_styles->insertItem (0, global_style.def.toString ());
121  combo_styles->insertSeparator (1);
122  QString current_style = settings->value (global_style).toString ();
123  if (current_style == global_style.def.toString ())
124  current_style = global_style.def.toString ();
125  selected = combo_styles->findText (current_style);
126  if (selected >= 0)
127  combo_styles->setCurrentIndex (selected);
128  else
129  combo_styles->setCurrentIndex (0);
130 
131  // icon size and theme
132  QButtonGroup *icon_size_group = new QButtonGroup (this);
133  icon_size_group->addButton (icon_size_small);
134  icon_size_group->addButton (icon_size_normal);
135  icon_size_group->addButton (icon_size_large);
136  int icon_size = settings->value (global_icon_size).toInt ();
137  icon_size_normal->setChecked (true); // the default
138  icon_size_small->setChecked (icon_size < 0);
139  icon_size_large->setChecked (icon_size > 0);
140  combo_box_icon_theme->addItems (global_all_icon_theme_names);
141  int theme = settings->value (global_icon_theme_index.key).toInt ();
142  combo_box_icon_theme->setCurrentIndex (theme);
143 
144  // which icon has to be selected
145  QButtonGroup *icon_group = new QButtonGroup (this);
146  icon_group->addButton (general_icon_octave);
147  icon_group->addButton (general_icon_graphic);
148  icon_group->addButton (general_icon_letter);
149  QString widget_icon_set =
150  settings->value (dw_icon_set).toString ();
151  general_icon_octave->setChecked (true); // the default (if invalid set)
152  general_icon_octave->setChecked (widget_icon_set == "NONE");
153  general_icon_graphic->setChecked (widget_icon_set == "GRAPHIC");
154  general_icon_letter->setChecked (widget_icon_set == "LETTER");
155 
156  // custom title bar of dock widget
157  QColor bg_color = settings->value (dw_title_bg_color).value<QColor> ();
158  m_widget_title_bg_color = new color_picker (bg_color);
159  m_widget_title_bg_color->setEnabled (false);
160  layout_widget_bgtitle->addWidget (m_widget_title_bg_color, 0);
161 
162  connect (cb_widget_custom_style, &QCheckBox::toggled,
163  m_widget_title_bg_color, &color_picker::setEnabled);
164 
165  QColor bg_color_active = settings->value (dw_title_bg_color_active).value<QColor> ();
166  m_widget_title_bg_color_active = new color_picker (bg_color_active);
167  m_widget_title_bg_color_active->setEnabled (false);
168  layout_widget_bgtitle_active->addWidget (m_widget_title_bg_color_active, 0);
169 
170  connect (cb_widget_custom_style, &QCheckBox::toggled,
171  m_widget_title_bg_color_active, &color_picker::setEnabled);
172 
173  QColor fg_color = settings->value (dw_title_fg_color).value<QColor> ();
174  m_widget_title_fg_color = new color_picker (fg_color);
175  m_widget_title_fg_color->setEnabled (false);
176  layout_widget_fgtitle->addWidget (m_widget_title_fg_color, 0);
177 
178  connect (cb_widget_custom_style, &QCheckBox::toggled,
179  m_widget_title_fg_color, &color_picker::setEnabled);
180 
181  QColor fg_color_active = settings->value (dw_title_fg_color_active).value<QColor> ();
182  m_widget_title_fg_color_active = new color_picker (fg_color_active);
183  m_widget_title_fg_color_active->setEnabled (false);
184  layout_widget_fgtitle_active->addWidget (m_widget_title_fg_color_active, 0);
185 
186  connect (cb_widget_custom_style, &QCheckBox::toggled,
187  m_widget_title_fg_color_active, &color_picker::setEnabled);
188 
189  sb_3d_title->setValue (settings->value (dw_title_3d.key,
190  dw_title_3d.def).toInt ());
191  cb_widget_custom_style->setChecked (settings->value (dw_title_custom_style).toBool ());
192 
193  // Native file dialogs.
194  // FIXME: This preference can be deprecated / removed if all display
195  // managers, especially KDE, run those dialogs without hangs or
196  // delays from the start (bug #54607).
197  cb_use_native_file_dialogs->setChecked (settings->value (global_use_native_dialogs).toBool ());
198 
199  // Cursor blinking: consider old terminal related setting if not yet set
200  // FIXME: This pref. can be deprecated / removed if Qt adds support for
201  // getting the cursor blink preferences from all OS environments
202  if (settings->contains (global_cursor_blinking.key))
203  {
204  // Preference exists, read its value
205  cb_cursor_blinking->setChecked (settings->value
207  }
208  else
209  {
210  // Pref. does not exist, so take old terminal related pref.
211  cb_cursor_blinking->setChecked (settings->value
213  }
214 
215  // focus follows mouse
216  cb_focus_follows_mouse->setChecked (
217  settings->value (dw_focus_follows_mouse).toBool ());
218 
219  // prompt on exit
220  cb_prompt_to_exit->setChecked (
222 
223  // Main status bar
224  cb_status_bar->setChecked (
225  settings->value (global_status_bar.key, global_status_bar.def).toBool ());
226 
227  // Octave startup
228  cb_restore_octave_dir->setChecked (
230  le_octave_dir->setText (settings->value (global_ov_startup_dir.key,
231  global_ov_startup_dir.def).toString ());
232 
233  connect (pb_octave_dir, &QPushButton::pressed,
235 
236  //
237  // editor
238  //
239  useCustomFileEditor->setChecked (
241  customFileEditor->setText (
243  editor_showLineNumbers->setChecked (settings->value (ed_show_line_numbers).toBool ());
244  editor_linenr_size->setValue (settings->value (ed_line_numbers_size).toInt ());
245 
246  rmgr.combo_encoding (editor_combo_encoding);
247 
248  editor_highlightCurrentLine->setChecked (settings->value (ed_highlight_current_line).toBool ());
249  editor_long_line_marker->setChecked (settings->value (ed_long_line_marker).toBool ());
250  bool long_line =
251  settings->value (ed_long_line_marker_line).toBool ();
252  editor_long_line_marker_line->setChecked (long_line);
253  bool long_back =
254  settings->value (ed_long_line_marker_background).toBool ();
255  editor_long_line_marker_background->setChecked (long_back);
256  if (! (long_line || long_back))
257  editor_long_line_marker_line->setChecked (true);
258  editor_long_line_column->setValue (settings->value (ed_long_line_column).toInt ());
259  editor_break_checkbox->setChecked (settings->value (ed_break_lines).toBool ());
260  editor_break_comments_checkbox->setChecked (settings->value (ed_break_lines_comments).toBool ());
261  editor_wrap_checkbox->setChecked (settings->value (ed_wrap_lines).toBool ());
262  cb_edit_status_bar->setChecked (settings->value (ed_show_edit_status_bar).toBool ());
263  cb_edit_tool_bar->setChecked (settings->value (ed_show_toolbar).toBool ());
264  cb_code_folding->setChecked (settings->value (ed_code_folding).toBool ());
265  editor_highlight_all_occurrences->setChecked (settings->value (ed_highlight_all_occurrences).toBool ());
266 
267  editor_auto_endif->setCurrentIndex (settings->value (ed_auto_endif).toInt () );
268  editor_codeCompletion->setChecked (settings->value (ed_code_completion).toBool ());
269  editor_spinbox_ac_threshold->setValue (settings->value (ed_code_completion_threshold).toInt ());
270  editor_checkbox_ac_keywords->setChecked (settings->value (ed_code_completion_keywords).toBool ());
271  editor_checkbox_ac_builtins->setEnabled (editor_checkbox_ac_keywords->isChecked ());
272  editor_checkbox_ac_functions->setEnabled (editor_checkbox_ac_keywords->isChecked ());
273  editor_checkbox_ac_builtins->setChecked (settings->value (ed_code_completion_octave_builtins).toBool ());
274  editor_checkbox_ac_functions->setChecked (settings->value (ed_code_completion_octave_functions).toBool ());
275  editor_checkbox_ac_document->setChecked (settings->value (ed_code_completion_document).toBool ());
276  editor_checkbox_ac_case->setChecked (settings->value (ed_code_completion_case).toBool ());
277  editor_checkbox_ac_replace->setChecked (settings->value (ed_code_completion_replace).toBool ());
278  editor_ws_checkbox->setChecked (settings->value (ed_show_white_space).toBool ());
279  editor_ws_indent_checkbox->setChecked (settings->value (ed_show_white_space_indent).toBool ());
280  cb_show_eol->setChecked (settings->value (ed_show_eol_chars).toBool ());
281  cb_show_hscrollbar->setChecked (settings->value (ed_show_hscroll_bar).toBool ());
282 
283  for (int i = 0; i < ed_tab_position_names.length (); i++)
284  editor_combox_tab_pos->insertItem (i,
285  tr (ed_tab_position_names.at (i).toStdString ().data ()));
286  editor_combox_tab_pos->setCurrentIndex
287  (settings->value (ed_tab_position).toInt ());
288 
289  editor_cb_tabs_rotated->setChecked (settings->value (ed_tabs_rotated).toBool ());
290  editor_sb_tabs_max_width->setValue (settings->value (ed_tabs_max_width).toInt ());
291 
292  int selected_comment_string, selected_uncomment_string;
293 
294  if (settings->contains (ed_comment_str.key)) // new version (radio buttons)
295  selected_comment_string = settings->value (ed_comment_str).toInt ();
296  else // old version (combo box)
297  selected_comment_string = settings->value (ed_comment_str_old.key, ed_comment_str.def).toInt ();
298 
299  selected_uncomment_string = settings->value (ed_uncomment_str).toInt ();
300 
301  for (int i = 0; i < ed_comment_strings_count; i++)
302  {
303  m_rb_comment_strings[i] = new QRadioButton ();
304  m_rb_uncomment_strings[i] = new QCheckBox ();
305 
306  connect (m_rb_comment_strings[i], &QRadioButton::clicked,
307  m_rb_uncomment_strings[i], &QCheckBox::setChecked);
308  connect (m_rb_comment_strings[i], &QRadioButton::toggled,
309  m_rb_uncomment_strings[i], &QCheckBox::setDisabled);
310 
311  m_rb_comment_strings[i]->setText (ed_comment_strings.at(i));
312  m_rb_comment_strings[i]->setChecked (i == selected_comment_string);
313  layout_comment_strings->addWidget (m_rb_comment_strings[i]);
314 
315  m_rb_uncomment_strings[i]->setText (ed_comment_strings.at(i));
316  m_rb_uncomment_strings[i]->setAutoExclusive (false);
317  m_rb_uncomment_strings[i]->setChecked ( 1 << i & selected_uncomment_string);
318  layout_uncomment_strings->addWidget (m_rb_uncomment_strings[i]);
319  }
320 
321  combo_eol_mode->setCurrentIndex (settings->value (ed_default_eol_mode).toInt ());
322  editor_auto_ind_checkbox->setChecked (settings->value (ed_auto_indent).toBool ());
323  editor_tab_ind_checkbox->setChecked (settings->value (ed_tab_indents_line).toBool ());
324  editor_bs_unind_checkbox->setChecked (settings->value (ed_backspace_unindents_line).toBool ());
325  editor_ind_guides_checkbox->setChecked (settings->value (ed_show_indent_guides).toBool ());
326  editor_ind_width_spinbox->setValue (settings->value (ed_indent_width).toInt ());
327  editor_ind_uses_tabs_checkbox->setChecked (settings->value (ed_indent_uses_tabs).toBool ());
328  editor_tab_width_spinbox->setValue (settings->value (ed_tab_width).toInt ());
329  editor_restoreSession->setChecked (settings->value (ed_restore_session).toBool ());
330  editor_create_new_file->setChecked (settings->value (ed_create_new_file).toBool ());
331  editor_reload_changed_files->setChecked (settings->value (ed_always_reload_changed_files).toBool ());
332  editor_force_newline->setChecked (settings->value (ed_force_newline).toBool ());
333  editor_remove_trailing_spaces->setChecked (settings->value (ed_rm_trailing_spaces).toBool ());
334  editor_hiding_closes_files->setChecked (settings->value (ed_hiding_closes_files).toBool ());
335  editor_show_dbg_file->setChecked (settings->value (ed_show_dbg_file).toBool ());
336 
337  // terminal
338  QString default_font = settings->value (global_mono_font).toString ();
339  terminal_fontName->setCurrentFont (QFont (settings->value (cs_font.key, default_font).toString ()));
340  terminal_fontSize->setValue (settings->value (cs_font_size).toInt ());
341  terminal_history_buffer->setValue (settings->value (cs_hist_buffer).toInt ());
342  terminal_cursorUseForegroundColor->setChecked (settings->value (cs_cursor_use_fgcol).toBool ());
343  terminal_focus_command->setChecked (settings->value (cs_focus_cmd).toBool ());
344  terminal_print_dbg_location->setChecked (settings->value (cs_dbg_location).toBool ());
345 
346  QString cursor_type
347  = settings->value (cs_cursor).toString ();
348 
349  QStringList items;
350  items << QString ("0") << QString ("1") << QString ("2");
351  terminal_cursorType->addItems (items);
352  terminal_cursorType->setItemText (0, tr ("IBeam Cursor"));
353  terminal_cursorType->setItemText (1, tr ("Block Cursor"));
354  terminal_cursorType->setItemText (2, tr ("Underline Cursor"));
355 
356  for (unsigned int i = 0; i < cs_cursor_types.size (); i++)
357  {
358  if (cursor_type.toStdString () == cs_cursor_types[i])
359  {
360  terminal_cursorType->setCurrentIndex (i);
361  break;
362  }
363  }
364 
365  read_terminal_colors (settings);
366 
367  // file browser
368  connect (sync_octave_directory, &QCheckBox::toggled,
370 
371  sync_octave_directory->setChecked (settings->value (fb_sync_octdir).toBool ());
372  cb_restore_file_browser_dir->setChecked (settings->value (fb_restore_last_dir).toBool ());
373  le_file_browser_dir->setText (settings->value (fb_startup_dir.key).toString ());
374 
375  connect (pb_file_browser_dir, &QPushButton::pressed,
377 
378  le_file_browser_extensions->setText (settings->value (fb_txt_file_ext).toString ());
379 
380  checkbox_allow_web_connect->setChecked (settings->value (nr_allow_connection).toBool ());
381 
382  // Proxy
383  bool use_proxy = settings->value (global_use_proxy.key, global_use_proxy.def).toBool ();
384  use_proxy_server->setChecked (use_proxy);
385  // Fill combo box and activate current one
386  QString proxy_type_string = settings->value (global_proxy_type.key, global_proxy_type.def).toString ();
387  proxy_type->addItems (global_proxy_all_types);
388  for (int i = 0; i < global_proxy_all_types.length (); i++)
389  {
390  if (proxy_type->itemText (i) == proxy_type_string)
391  {
392  proxy_type->setCurrentIndex (i);
393  break;
394  }
395  }
396  // Fill all line edits
397  proxy_host_name->setText (settings->value (global_proxy_host.key, global_proxy_host.def).toString ());
398  proxy_port->setText (settings->value (global_proxy_port.key, global_proxy_port.def).toString ());
399  proxy_username->setText (settings->value (global_proxy_user.key, global_proxy_user.def).toString ());
400  proxy_password->setText (settings->value (global_proxy_pass.key, global_proxy_pass.def).toString ());
401  // Connect relevant signals for dis-/enabling some elements
402  connect (proxy_type, QOverload<int>::of (&QComboBox::currentIndexChanged),
404  connect (use_proxy_server, &QCheckBox::toggled,
406  // Check whehter line edits have to be enabled
407  proxy_items_update ();
408 
409  // Workspace
410  read_workspace_colors (settings);
411 
412  // variable editor
413  varedit_columnWidth->setValue (settings->value (ve_column_width).toInt ());
414  varedit_rowHeight->setValue (settings->value (ve_row_height).toInt ());
415 
416  varedit_font->setCurrentFont (QFont (settings->value (ve_font_name.key,
417  settings->value (cs_font.key, default_font)).toString ()));
418  varedit_fontSize->setValue (settings->value (ve_font_size).toInt ());
419  connect (varedit_useTerminalFont, &QCheckBox::toggled,
420  varedit_font, &QFontComboBox::setDisabled);
421  connect (varedit_useTerminalFont, &QCheckBox::toggled,
422  varedit_fontSize, &QSpinBox::setDisabled);
423  varedit_useTerminalFont->setChecked (settings->value (ve_use_terminal_font).toBool ());
424  varedit_font->setDisabled (varedit_useTerminalFont->isChecked ());
425  varedit_fontSize->setDisabled (varedit_useTerminalFont->isChecked ());
426 
427  varedit_alternate->setChecked (settings->value (ve_alternate_rows).toBool ());
428 
429  // variable editor colors
430  read_varedit_colors (settings);
431 
432  // shortcuts
433 
434  shortcut_manager& scmgr = m_octave_qobj.get_shortcut_manager ();
435 
436  cb_prevent_readline_conflicts->setChecked (
438  sc_prevent_rl_conflicts.def).toBool ());
439  cb_prevent_readline_conflicts_menu->setChecked (
441  sc_prevent_rl_conflicts_menu.def).toBool ());
442 
443  // initialize the tree view with all shortcut data
444  scmgr.fill_treewidget (shortcuts_treewidget);
445 
446  // connect the buttons for import/export of the shortcut sets
447  connect (btn_import_shortcut_set, &QPushButton::clicked,
449 
450  connect (btn_export_shortcut_set, &QPushButton::clicked,
452 
453  connect (btn_default_shortcut_set, &QPushButton::clicked,
455 
456 #if defined (HAVE_QSCINTILLA)
457 
458  int mode = settings->value (ed_color_mode).toInt ();
459 
460  QCheckBox *cb_color_mode = new QCheckBox (tr (settings_color_modes.toStdString ().data ()),
461  group_box_editor_styles);
462  cb_color_mode->setToolTip (tr (settings_color_modes_tooltip.toStdString ().data ()));
463  cb_color_mode->setChecked (mode > 0);
464  cb_color_mode->setObjectName (ed_color_mode.key);
465 
466  QPushButton *pb_reload_default_colors = new QPushButton (tr (settings_reload_styles.toStdString ().data ()));
467  pb_reload_default_colors->setToolTip (tr (settings_reload_styles_tooltip.toStdString ().data ()));
468 
469  color_picker *current_line_color = new color_picker (
472  ed_highlight_current_line_color.def).value<QColor> (), this);
473  current_line_color->setObjectName (ed_highlight_current_line_color.key);
474  QLabel *current_line_color_label = new QLabel(
475  tr ("Color of highlighted current line (magenta (255,0,255) for automatic color)")
476  );
477 
478  QHBoxLayout *color_mode = new QHBoxLayout ();
479  color_mode->addWidget (cb_color_mode);
480  color_mode->addItem (new QSpacerItem (5, 5, QSizePolicy::Expanding));
481  color_mode->addWidget (pb_reload_default_colors);
482 
483  QHBoxLayout *current_line = new QHBoxLayout ();
484  current_line->addWidget (current_line_color_label);
485  current_line->addWidget (current_line_color);
486  current_line->addItem (new QSpacerItem (5, 5, QSizePolicy::Expanding));
487 
488  editor_styles_layout->addLayout (color_mode);
489  editor_styles_layout->addLayout (current_line);
490 
491  // update colors depending on second theme selection
492  connect (cb_color_mode, &QCheckBox::stateChanged,
494  connect (pb_reload_default_colors, &QPushButton::clicked,
495  [=] () { update_editor_lexers (settings_reload_default_colors_flag); });
496 
497  // finally read the lexer colors using the update slot
498  update_editor_lexers ();
499 
500 #endif
501 
502  // which tab is the desired one?
503  show_tab (desired_tab);
504 
505  // connect button box signal
506  connect (button_box, &QDialogButtonBox::clicked,
508 
509  // restore last geometry
510  if (settings->contains (sd_geometry.key))
511  restoreGeometry (settings->value (sd_geometry).toByteArray ());
512  else
513  setGeometry (QRect (10, 50, 1000, 600));
514 }
515 
516 void settings_dialog::show_tab (const QString& tab)
517 {
518  if (tab.isEmpty ())
519  {
522  if (settings)
523  tabWidget->setCurrentIndex (settings->value (sd_last_tab).toInt ());
524  }
525  else
526  {
527  QHash <QString, QWidget *> tab_hash;
528  tab_hash["editor"] = tab_editor;
529  tab_hash["editor_styles"] = tab_editor;
530  tabWidget->setCurrentIndex (tabWidget->indexOf (tab_hash.value (tab)));
531  if (tab == "editor_styles")
532  tab_editor_scroll_area->ensureWidgetVisible (group_box_editor_styles);
533  }
534 }
535 
537 {
538  get_dir (le_octave_dir, tr ("Set Octave Startup Directory"));
539 }
540 
542 {
543  get_dir (le_file_browser_dir, tr ("Set File Browser Startup Directory"));
544 }
545 
546 void settings_dialog::get_dir (QLineEdit *line_edit, const QString& title)
547 {
548  // FIXME: Remove, if for all common KDE versions (bug #54607) is resolved.
549  int opts = QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks;
552  if (! settings->value (global_use_native_dialogs).toBool ())
553  opts |= QFileDialog::DontUseNativeDialog;
554 
555  QString dir = QFileDialog::getExistingDirectory
556  (this, title, line_edit->text (), QFileDialog::Option (opts));
557 
558  line_edit->setText (dir);
559 }
560 
561 void settings_dialog::button_clicked (QAbstractButton *button)
562 {
563  QDialogButtonBox::ButtonRole button_role = button_box->buttonRole (button);
564 
565  if (button_role == QDialogButtonBox::ApplyRole
566  || button_role == QDialogButtonBox::AcceptRole)
567  {
568  write_changed_settings (button_role == QDialogButtonBox::AcceptRole);
569  emit apply_new_settings ();
570  }
571 
572  if (button_role == QDialogButtonBox::RejectRole
573  || button_role == QDialogButtonBox::AcceptRole)
574  {
575  // save last settings dialog's geometry and close
578 
579  settings->setValue (sd_last_tab.key, tabWidget->currentIndex ());
580  settings->setValue (sd_geometry.key, saveGeometry ());
581  settings->sync ();
582 
583  close ();
584  }
585 }
586 
588 {
589  cb_restore_file_browser_dir->setDisabled (disable);
590 
591  if (! disable)
592  {
593  le_file_browser_dir->setDisabled (cb_restore_file_browser_dir->isChecked ());
594  pb_file_browser_dir->setDisabled (cb_restore_file_browser_dir->isChecked ());
595  }
596  else
597  {
598  le_file_browser_dir->setDisabled (disable);
599  pb_file_browser_dir->setDisabled (disable);
600  }
601 }
602 
603 // slot for updating enabled state of proxy settings
605 {
606  bool use_proxy = use_proxy_server->isChecked ();
607 
608  bool manual = false;
609  for (int i = 0; i < global_proxy_manual_types.length (); i++)
610  {
611  if (proxy_type->currentIndex () == global_proxy_manual_types.at (i))
612  {
613  manual = true;
614  break;
615  }
616  }
617 
618  proxy_type->setEnabled (use_proxy);
619  proxy_host_name_label->setEnabled (use_proxy && manual);
620  proxy_host_name->setEnabled (use_proxy && manual);
621  proxy_port_label->setEnabled (use_proxy && manual);
622  proxy_port->setEnabled (use_proxy && manual);
623  proxy_username_label->setEnabled (use_proxy && manual);
624  proxy_username->setEnabled (use_proxy && manual);
625  proxy_password_label->setEnabled (use_proxy && manual);
626  proxy_password->setEnabled (use_proxy && manual);
627 }
628 
629 // slots for import/export of shortcut sets
630 
632 {
634 
636 }
637 
639 {
641 
643 }
644 
646 {
648 
650 }
651 
653 {
654 #if defined (HAVE_QSCINTILLA)
655 
658 
659  QCheckBox *cb_color_mode
660  = group_box_editor_styles->findChild <QCheckBox *> (ed_color_mode.key);
661 
662  int m = 0;
663  if (cb_color_mode && cb_color_mode->isChecked ())
664  m = 1;
665 
666  color_picker *c_picker = findChild <color_picker *> (ed_highlight_current_line_color.key);
667  if (c_picker)
668  {
670  {
671  // Get current value from settings or the default
672  c_picker->set_color (settings->color_value (ed_highlight_current_line_color, m));
673  }
674  else
675  {
676  // Get the default value
677  c_picker->set_color (settings->get_color_value (ed_highlight_current_line_color.def, m));
678  }
679  }
680 
681  // editor styles: create lexer, read settings, and
682  // create or update dialog elements
683  QsciLexer *lexer;
684 
685 # if defined (HAVE_LEXER_OCTAVE)
686  lexer = new QsciLexerOctave ();
687  update_lexer (lexer, settings, m, def);
688  delete lexer;
689 # elif defined (HAVE_LEXER_MATLAB)
690  lexer = new QsciLexerMatlab ();
691  update_lexer (lexer, settings, m, def);
692  delete lexer;
693 # endif
694 
695  lexer = new QsciLexerCPP ();
696  update_lexer (lexer, settings, m, def);
697  delete lexer;
698 
699  lexer = new QsciLexerJava ();
700  update_lexer (lexer, settings, m, def);
701  delete lexer;
702 
703  lexer = new QsciLexerPerl ();
704  update_lexer (lexer, settings, m, def);
705  delete lexer;
706 
707  lexer = new QsciLexerBatch ();
708  update_lexer (lexer, settings, m, def);
709  delete lexer;
710 
711  lexer = new QsciLexerDiff ();
712  update_lexer (lexer, settings, m, def);
713  delete lexer;
714 
715  lexer = new QsciLexerBash ();
716  update_lexer (lexer, settings, m, def);
717  delete lexer;
718 
719  lexer = new octave_txt_lexer ();
720  update_lexer (lexer, settings, m, def);
721  delete lexer;
722 
723 #else
724 
725  octave_unused_parameter (def);
726 
727 #endif
728 }
729 
730 #if defined (HAVE_QSCINTILLA)
731 
733  int mode, int def)
734 {
735  // Get lexer settings and copy from default settings if not yet
736  // available in normal settings file
738  rmgr.read_lexer_settings (lexer, settings, mode, def);
739 
740  // When reloading default styles, the style tabs do already exists.
741  // Otherwise, check if they exist or not.
742  QString lexer_name = lexer->language ();
743 
744  int index = -1;
745  for (int i = 0; i < tabs_editor_lexers->count (); i++)
746  {
747  if (tabs_editor_lexers->tabText (i) == lexer_name)
748  {
749  index = i;
750  break;
751  }
752  }
753 
754  if (index == -1)
755  {
756  // This is not an update, call get_lexer_settings for building
757  // the settings tab
759  return;
760  }
761 
762  // Update the styles elements in all styles
763  int styles[ed_max_lexer_styles]; // array for saving valid styles
764  int max_style = rmgr.get_valid_lexer_styles (lexer, styles);
765  QWidget *tab = tabs_editor_lexers->widget (index);
766  int default_size = 0;
767  QString default_family;
768 
769  for (int i = 0; i < max_style; i++) // create dialog elements for all styles
770  {
771  QString actual_name = lexer->description (styles[i]);
772  color_picker *bg_color
773  = tab->findChild <color_picker *> (actual_name + "_bg_color");
774  if (bg_color)
775  {
776  // Update
777  if (styles[i] == 0)
778  bg_color->set_color (lexer->defaultPaper ());
779  else
780  {
781  if (lexer->paper (styles[i]) == lexer->defaultPaper ())
783  else
784  bg_color->set_color (lexer->paper (styles[i]));
785  }
786  }
787 
788  color_picker *color = tab->findChild <color_picker *> (actual_name + "_color");
789  if (color)
790  color->set_color (lexer->color (styles[i]));
791 
792  QFont font = lexer->font (styles[i]);
793 
794  QCheckBox *cb = tab->findChild <QCheckBox *> (actual_name + "_bold");
795  if (cb)
796  cb->setChecked (font.bold ());
797  cb = tab->findChild <QCheckBox *> (actual_name + "_italic");
798  if (cb)
799  cb->setChecked (font.italic ());
800  cb = tab->findChild <QCheckBox *> (actual_name + "_underline");
801  if (cb)
802  cb->setChecked (font.underline ());
803 
804  QFontComboBox *fcb = tab->findChild <QFontComboBox *> (actual_name + "_font");
805  if (fcb)
806  {
807  if (styles[i] == 0)
808  {
809  default_family = font.family ();
810  fcb->setEditText (default_family);
811  }
812  else
813  {
814  if (font.family () == default_family)
815  fcb->setEditText (lexer->description (0));
816  else
817  fcb->setEditText (font.family ());
818  }
819  }
820  QSpinBox *fs = tab->findChild <QSpinBox *> (actual_name + "_size");
821  if (fs)
822  {
823  if (styles[i] == 0)
824  {
825  default_size = font.pointSize ();
826  fs->setValue (default_size);
827  }
828  else
829  fs->setValue (font.pointSize () - default_size);
830  }
831  }
832 
833 }
834 
837 {
839 
840  int styles[ed_max_lexer_styles]; // array for saving valid styles
841  // (enum is not continuous)
842  int max_style = rmgr.get_valid_lexer_styles (lexer, styles);
843  QGridLayout *style_grid = new QGridLayout ();
844  QVector<QLabel *> description (max_style);
845  QVector<QFontComboBox *> select_font (max_style);
846  QVector<QSpinBox *> font_size (max_style);
847  QVector<QCheckBox *> attrib_font (3 * max_style);
848  QVector<color_picker *> color (max_style);
849  QVector<color_picker *> bg_color (max_style);
850  int default_size = 10;
851  QFont default_font = QFont ();
852  int label_width;
853  QColor default_color = QColor ();
854 
855  for (int i = 0; i < max_style; i++) // create dialog elements for all styles
856  {
857  QString actual_name = lexer->description (styles[i]);
858  QFont actual_font = lexer->font (styles[i]);
859  description[i] = new QLabel (actual_name);
860  description[i]->setWordWrap (true);
861  label_width = 24*description[i]->fontMetrics ().averageCharWidth ();
862  description[i]->setMaximumSize (label_width, QWIDGETSIZE_MAX);
863  description[i]->setMinimumSize (label_width, 1);
864  select_font[i] = new QFontComboBox ();
865  select_font[i]->setObjectName (actual_name + "_font");
866  select_font[i]->setMaximumSize (label_width, QWIDGETSIZE_MAX);
867  select_font[i]->setMinimumSize (label_width, 1);
868  font_size[i] = new QSpinBox ();
869  font_size[i]->setObjectName (actual_name + "_size");
870  if (styles[i] == 0) // the default
871  {
872  select_font[i]->setCurrentFont (actual_font);
873  default_font = actual_font;
874  font_size[i]->setRange (6, 24);
875  default_size = actual_font.pointSize ();
876  font_size[i]->setValue (default_size);
877  default_color = lexer->defaultPaper ();
878  bg_color[i] = new color_picker (default_color);
879  }
880  else // other styles
881  {
882  select_font[i]->setCurrentFont (actual_font);
883  if (actual_font.family () == default_font.family ())
884  select_font[i]->setEditText (lexer->description (0));
885  font_size[i]->setRange (-4, 4);
886  font_size[i]->setValue (actual_font.pointSize ()-default_size);
887  font_size[i]->setToolTip (QObject::tr ("Difference to the default size"));
888  if (lexer->paper (styles[i]) == default_color)
889  bg_color[i] = new color_picker (settings_color_no_change);
890  else
891  bg_color[i] = new color_picker (lexer->paper (styles[i]));
892  bg_color[i]->setToolTip
893  (QObject::tr ("Background color, magenta (255, 0, 255) means default"));
894  }
895  attrib_font[0+3*i] = new QCheckBox (QObject::tr ("b", "short form for bold"));
896  attrib_font[1+3*i] = new QCheckBox (QObject::tr ("i", "short form for italic"));
897  attrib_font[2+3*i] = new QCheckBox (QObject::tr ("u", "short form for underlined"));
898  attrib_font[0+3*i]->setChecked (actual_font.bold ());
899  attrib_font[0+3*i]->setObjectName (actual_name + "_bold");
900  attrib_font[1+3*i]->setChecked (actual_font.italic ());
901  attrib_font[1+3*i]->setObjectName (actual_name + "_italic");
902  attrib_font[2+3*i]->setChecked (actual_font.underline ());
903  attrib_font[2+3*i]->setObjectName (actual_name + "_underline");
904  color[i] = new color_picker (lexer->color (styles[i]));
905  color[i]->setObjectName (actual_name + "_color");
906  bg_color[i]->setObjectName (actual_name + "_bg_color");
907  int column = 1;
908  style_grid->addWidget (description[i], i, column++);
909  style_grid->addWidget (select_font[i], i, column++);
910  style_grid->addWidget (font_size[i], i, column++);
911  style_grid->addWidget (attrib_font[0+3*i], i, column++);
912  style_grid->addWidget (attrib_font[1+3*i], i, column++);
913  style_grid->addWidget (attrib_font[2+3*i], i, column++);
914  style_grid->addWidget (color[i], i, column++);
915  style_grid->addWidget (bg_color[i], i, column++);
916  }
917 
918  // place grid with elements into the tab
919  QScrollArea *scroll_area = new QScrollArea ();
920  QWidget *scroll_area_contents = new QWidget ();
921  scroll_area_contents->setObjectName (QString (lexer->language ()) + "_styles");
922  scroll_area_contents->setLayout (style_grid);
923  scroll_area->setWidget (scroll_area_contents);
924  tabs_editor_lexers->addTab (scroll_area, lexer->language ());
925 
926  tabs_editor_lexers->setCurrentIndex (settings->value (sd_last_editor_styles_tab).toInt ());
927 }
928 
931 {
933 
934  QCheckBox *cb_color_mode
935  = group_box_editor_styles->findChild <QCheckBox *> (ed_color_mode.key);
936  int mode = 0;
937  if (cb_color_mode && cb_color_mode->isChecked ())
938  mode = 1;
939 
940  settings->setValue (ed_color_mode.key, mode);
941 
942  QWidget *tab = tabs_editor_lexers->
943  findChild <QWidget *> (QString (lexer->language ()) + "_styles");
944  int styles[ed_max_lexer_styles]; // array for saving valid styles
945  // (enum is not continuous)
946  int max_style = rmgr.get_valid_lexer_styles (lexer, styles);
947  QFontComboBox *select_font;
948  QSpinBox *font_size;
949  QCheckBox *attrib_font[3];
950  color_picker *color;
951  color_picker *bg_color;
952  int default_size = 10;
953 
954  color = findChild <color_picker *> (ed_highlight_current_line_color.key);
955  if (color)
957  + settings_color_modes_ext[mode], color->color ());
958 
959  QString default_font_name
960  = settings->value (global_mono_font).toString ();
961  QFont default_font = QFont (default_font_name, 10, -1, 0);
962  QColor default_color = QColor ();
963 
964  for (int i = 0; i < max_style; i++) // get dialog elements and their contents
965  {
966  QString actual_name = lexer->description (styles[i]);
967  select_font = tab->findChild <QFontComboBox *> (actual_name + "_font");
968  font_size = tab->findChild <QSpinBox *> (actual_name + "_size");
969  attrib_font[0] = tab->findChild <QCheckBox *> (actual_name + "_bold");
970  attrib_font[1] = tab->findChild <QCheckBox *> (actual_name + "_italic");
971  attrib_font[2] = tab->findChild <QCheckBox *> (actual_name + "_underline");
972  color = tab->findChild <color_picker *> (actual_name + "_color");
973  bg_color = tab->findChild <color_picker *> (actual_name + "_bg_color");
974  QFont new_font = default_font;
975  if (select_font)
976  {
977  new_font = select_font->currentFont ();
978  if (styles[i] == 0)
979  default_font = new_font;
980  else if (select_font->currentText () == lexer->description (0))
981  new_font = default_font;
982  }
983  if (font_size)
984  {
985  if (styles[i] == 0)
986  {
987  default_size = font_size->value ();
988  new_font.setPointSize (font_size->value ());
989  }
990  else
991  new_font.setPointSize (font_size->value ()+default_size);
992  }
993  if (attrib_font[0])
994  new_font.setBold (attrib_font[0]->isChecked ());
995  if (attrib_font[1])
996  new_font.setItalic (attrib_font[1]->isChecked ());
997  if (attrib_font[2])
998  new_font.setUnderline (attrib_font[2]->isChecked ());
999  lexer->setFont (new_font, styles[i]);
1000  if (styles[i] == 0)
1001  lexer->setDefaultFont (new_font);
1002  if (color)
1003  lexer->setColor (color->color (), styles[i]);
1004  if (bg_color)
1005  {
1006  if (styles[i] == 0)
1007  {
1008  default_color = bg_color->color ();
1009  lexer->setPaper (default_color, styles[i]);
1010  lexer->setDefaultPaper (default_color);
1011  }
1012  else
1013  {
1014  if (bg_color->color () == settings_color_no_change)
1015  lexer->setPaper (default_color, styles[i]);
1016  else
1017  lexer->setPaper (bg_color->color (), styles[i]);
1018  }
1019  }
1020  }
1021 
1022  const std::string group =
1023  QString ("Scintilla" + settings_color_modes_ext[mode]).toStdString ();
1024 
1025  lexer->writeSettings (*settings, group.c_str ());
1026 
1028  tabs_editor_lexers->currentIndex ());
1029  settings->sync ();
1030 }
1031 
1032 #endif
1033 
1035 {
1037  gui_settings *settings = rmgr.get_settings ();
1038 
1039  // the icon set
1040  QString widget_icon_set = "NONE";
1041  if (general_icon_letter->isChecked ())
1042  widget_icon_set = "LETTER";
1043  else if (general_icon_graphic->isChecked ())
1044  widget_icon_set = "GRAPHIC";
1045  settings->setValue (dw_icon_set.key, widget_icon_set);
1046 
1047  // language
1048  QString language = comboBox_language->currentText ();
1049  if (language == tr ("System setting"))
1050  language = global_language.def.toString ();
1051  settings->setValue (global_language.key, language);
1052 
1053  // style
1054  QString selected_style = combo_styles->currentText ();
1055  if (selected_style == global_style.def.toString ())
1056  selected_style = global_style.def.toString ();
1057  settings->setValue (global_style.key, selected_style);
1058 
1059  // dock widget title bar
1060  settings->setValue (dw_title_custom_style.key, cb_widget_custom_style->isChecked ());
1061  settings->setValue (dw_title_3d.key, sb_3d_title->value ());
1066 
1067  // icon size and theme
1068  int icon_size = icon_size_large->isChecked () - icon_size_small->isChecked ();
1069  settings->setValue (global_icon_size.key, icon_size);
1070  settings->setValue (global_icon_theme_index.key, combo_box_icon_theme->currentIndex ());
1071 
1072  // native file dialogs
1073  settings->setValue (global_use_native_dialogs.key, cb_use_native_file_dialogs->isChecked ());
1074 
1075  // cursor blinking
1076  settings->setValue (global_cursor_blinking.key, cb_cursor_blinking->isChecked ());
1077 
1078  // focus follows mouse
1079  settings->setValue (dw_focus_follows_mouse.key, cb_focus_follows_mouse->isChecked ());
1080 
1081  // promp to exit
1082  settings->setValue (global_prompt_to_exit.key, cb_prompt_to_exit->isChecked ());
1083 
1084  // status bar
1085  settings->setValue (global_status_bar.key, cb_status_bar->isChecked ());
1086 
1087  // Octave startup
1088  settings->setValue (global_restore_ov_dir.key, cb_restore_octave_dir->isChecked ());
1089  settings->setValue (global_ov_startup_dir.key, le_octave_dir->text ());
1090 
1091  //editor
1092  settings->setValue (global_use_custom_editor.key, useCustomFileEditor->isChecked ());
1093  settings->setValue (global_custom_editor.key, customFileEditor->text ());
1094  settings->setValue (ed_show_line_numbers.key, editor_showLineNumbers->isChecked ());
1095  settings->setValue (ed_line_numbers_size.key, editor_linenr_size->value ());
1096  settings->setValue (ed_highlight_current_line.key, editor_highlightCurrentLine->isChecked ());
1097  settings->setValue (ed_long_line_marker.key, editor_long_line_marker->isChecked ());
1098  settings->setValue (ed_long_line_marker_line.key, editor_long_line_marker_line->isChecked ());
1099  settings->setValue (ed_long_line_marker_background.key, editor_long_line_marker_background->isChecked ());
1100  settings->setValue (ed_long_line_column.key, editor_long_line_column->value ());
1101  settings->setValue (ed_break_lines.key, editor_break_checkbox->isChecked ());
1102  settings->setValue (ed_break_lines_comments.key, editor_break_comments_checkbox->isChecked ());
1103  settings->setValue (ed_wrap_lines.key, editor_wrap_checkbox->isChecked ());
1104  settings->setValue (ed_code_folding.key, cb_code_folding->isChecked ());
1105  settings->setValue (ed_show_edit_status_bar.key, cb_edit_status_bar->isChecked ());
1106  settings->setValue (ed_show_toolbar.key, cb_edit_tool_bar->isChecked ());
1107  settings->setValue (ed_highlight_all_occurrences.key, editor_highlight_all_occurrences->isChecked ());
1108  settings->setValue (ed_code_completion.key, editor_codeCompletion->isChecked ());
1109  settings->setValue (ed_code_completion_threshold.key, editor_spinbox_ac_threshold->value ());
1110  settings->setValue (ed_code_completion_keywords.key, editor_checkbox_ac_keywords->isChecked ());
1111  settings->setValue (ed_code_completion_octave_builtins.key, editor_checkbox_ac_builtins->isChecked ());
1112  settings->setValue (ed_code_completion_octave_functions.key, editor_checkbox_ac_functions->isChecked ());
1113  settings->setValue (ed_code_completion_document.key, editor_checkbox_ac_document->isChecked ());
1114  settings->setValue (ed_code_completion_case.key, editor_checkbox_ac_case->isChecked ());
1115  settings->setValue (ed_code_completion_replace.key, editor_checkbox_ac_replace->isChecked ());
1116  settings->setValue (ed_auto_endif.key, editor_auto_endif->currentIndex ());
1117  settings->setValue (ed_show_white_space.key, editor_ws_checkbox->isChecked ());
1118  settings->setValue (ed_show_white_space_indent.key, editor_ws_indent_checkbox->isChecked ());
1119  settings->setValue (ed_show_eol_chars.key, cb_show_eol->isChecked ());
1120  settings->setValue (ed_show_hscroll_bar.key, cb_show_hscrollbar->isChecked ());
1121  settings->setValue (ed_default_eol_mode.key, combo_eol_mode->currentIndex ());
1122 
1123  settings->setValue (ed_tab_position.key, editor_combox_tab_pos->currentIndex ());
1124  settings->setValue (ed_tabs_rotated.key, editor_cb_tabs_rotated->isChecked ());
1125  settings->setValue (ed_tabs_max_width.key, editor_sb_tabs_max_width->value ());
1126 
1127  // Comment strings
1128  int rb_uncomment = 0;
1129  for (int i = 0; i < ed_comment_strings_count; i++)
1130  {
1131  if (m_rb_comment_strings[i]->isChecked ())
1132  {
1133  settings->setValue (ed_comment_str.key, i);
1134  if (i < 3)
1135  settings->setValue (ed_comment_str_old.key, i);
1136  else
1138  }
1139  if (m_rb_uncomment_strings[i]->isChecked ())
1140  rb_uncomment = rb_uncomment + (1 << i);
1141  }
1142  settings->setValue (ed_uncomment_str.key, rb_uncomment);
1143 
1144  settings->setValue (ed_default_enc.key, editor_combo_encoding->currentText ());
1145  settings->setValue (ed_auto_indent.key, editor_auto_ind_checkbox->isChecked ());
1146  settings->setValue (ed_tab_indents_line.key, editor_tab_ind_checkbox->isChecked ());
1147  settings->setValue (ed_backspace_unindents_line.key, editor_bs_unind_checkbox->isChecked ());
1148  settings->setValue (ed_show_indent_guides.key, editor_ind_guides_checkbox->isChecked ());
1149  settings->setValue (ed_indent_width.key, editor_ind_width_spinbox->value ());
1150  settings->setValue (ed_indent_uses_tabs.key, editor_ind_uses_tabs_checkbox->isChecked ());
1151  settings->setValue (ed_tab_width.key, editor_tab_width_spinbox->value ());
1152  settings->setValue (ed_restore_session.key, editor_restoreSession->isChecked ());
1153  settings->setValue (ed_create_new_file.key, editor_create_new_file->isChecked ());
1154  settings->setValue (ed_hiding_closes_files.key, editor_hiding_closes_files->isChecked ());
1155  settings->setValue (ed_always_reload_changed_files.key, editor_reload_changed_files->isChecked ());
1156  settings->setValue (ed_force_newline.key, editor_force_newline->isChecked ());
1157  settings->setValue (ed_rm_trailing_spaces.key, editor_remove_trailing_spaces->isChecked ());
1158  settings->setValue (ed_show_dbg_file.key, editor_show_dbg_file->isChecked ());
1159 
1160  // file browser
1161  settings->setValue (fb_sync_octdir.key, sync_octave_directory->isChecked ());
1162  settings->setValue (fb_restore_last_dir.key, cb_restore_file_browser_dir->isChecked ());
1163  settings->setValue (fb_startup_dir.key, le_file_browser_dir->text ());
1164  settings->setValue (fb_txt_file_ext.key, le_file_browser_extensions->text ());
1165 
1166  // network
1167  settings->setValue (nr_allow_connection.key, checkbox_allow_web_connect->isChecked ());
1168  settings->setValue (global_use_proxy.key, use_proxy_server->isChecked ());
1169  settings->setValue (global_proxy_type.key, proxy_type->currentText ());
1170  settings->setValue (global_proxy_host.key, proxy_host_name->text ());
1171  settings->setValue (global_proxy_port.key, proxy_port->text ());
1172  settings->setValue (global_proxy_user.key, proxy_username->text ());
1173  settings->setValue (global_proxy_pass.key, proxy_password->text ());
1174 
1175  // command window
1176  settings->setValue (cs_font_size.key, terminal_fontSize->value ());
1177  settings->setValue (cs_font.key, terminal_fontName->currentFont ().family ());
1178  settings->setValue (cs_cursor_use_fgcol.key, terminal_cursorUseForegroundColor->isChecked ());
1179  settings->setValue (cs_focus_cmd.key, terminal_focus_command->isChecked ());
1180  settings->setValue (cs_dbg_location.key, terminal_print_dbg_location->isChecked ());
1181  settings->setValue (cs_hist_buffer.key, terminal_history_buffer->value ());
1183 
1184  // the cursor
1185  QString cursor_type;
1186  unsigned int cursor_int = terminal_cursorType->currentIndex ();
1187  if ((cursor_int > 0) && (cursor_int < cs_cursor_types.size ()))
1188  cursor_type = QString (cs_cursor_types[cursor_int].data ());
1189  else
1190  cursor_type = cs_cursor.def.toString ();
1191 
1192  settings->setValue (cs_cursor.key, cursor_type);
1193 
1194 #if defined (HAVE_QSCINTILLA)
1195  // editor styles: create lexer, get dialog contents, and write settings
1196  QsciLexer *lexer;
1197 
1198 #if defined (HAVE_LEXER_OCTAVE)
1199 
1200  lexer = new QsciLexerOctave ();
1202  delete lexer;
1203 
1204 #elif defined (HAVE_LEXER_MATLAB)
1205 
1206  lexer = new QsciLexerMatlab ();
1208  delete lexer;
1209 
1210 #endif
1211 
1212  lexer = new QsciLexerCPP ();
1214  delete lexer;
1215 
1216  lexer = new QsciLexerJava ();
1218  delete lexer;
1219 
1220  lexer = new QsciLexerPerl ();
1222  delete lexer;
1223 
1224  lexer = new QsciLexerBatch ();
1226  delete lexer;
1227 
1228  lexer = new QsciLexerDiff ();
1230  delete lexer;
1231 
1232  lexer = new QsciLexerBash ();
1234  delete lexer;
1235 
1236  lexer = new octave_txt_lexer ();
1238  delete lexer;
1239 
1240 #endif
1241 
1242  // Workspace
1244 
1245  // Variable editor
1246  settings->setValue (ve_column_width.key, varedit_columnWidth->value ());
1247  settings->setValue (ve_row_height.key, varedit_rowHeight->value ());
1248  settings->setValue (ve_use_terminal_font.key, varedit_useTerminalFont->isChecked ());
1249  settings->setValue (ve_alternate_rows.key, varedit_alternate->isChecked ());
1250  settings->setValue (ve_font_name.key, varedit_font->currentFont ().family ());
1251  settings->setValue (ve_font_size.key, varedit_fontSize->value ());
1253 
1254  // shortcuts
1255 
1256  settings->setValue (sc_prevent_rl_conflicts.key, cb_prevent_readline_conflicts->isChecked ());
1257  settings->setValue (sc_prevent_rl_conflicts_menu.key, cb_prevent_readline_conflicts_menu->isChecked ());
1259  scmgr.write_shortcuts (settings, closing);
1260 
1261  settings->sync ();
1262 }
1263 
1265 {
1266  // Construct the grid with all color related settings
1267  QGridLayout *style_grid = new QGridLayout ();
1268  QVector<QLabel *> description (ws_colors_count);
1269  QVector<color_picker *> color (ws_colors_count);
1270 
1271  int column = 0;
1272  const int color_columns = 3; // place colors in so many columns
1273  int row = 0;
1274  int mode = settings->value (ws_color_mode).toInt ();
1275 
1276  m_ws_enable_colors = new QCheckBox (tr ("Enable attribute colors"));
1277  style_grid->addWidget (m_ws_enable_colors, row++, column, 1, 4);
1278 
1279  m_ws_hide_tool_tips = new QCheckBox (tr ("Hide tools tips"));
1280  style_grid->addWidget (m_ws_hide_tool_tips, row++, column, 1, 4);
1281  connect (m_ws_enable_colors, &QCheckBox::toggled,
1282  m_ws_hide_tool_tips, &QCheckBox::setEnabled);
1283  m_ws_hide_tool_tips->setChecked
1284  (settings->value (ws_hide_tool_tips).toBool ());
1285 
1286  QCheckBox *cb_color_mode = new QCheckBox (tr (settings_color_modes.toStdString ().data ()));
1287  cb_color_mode->setToolTip (tr (settings_color_modes_tooltip.toStdString ().data ()));
1288  cb_color_mode->setChecked (mode == 1);
1289  cb_color_mode->setObjectName (ws_color_mode.key);
1290  connect (m_ws_enable_colors, &QCheckBox::toggled,
1291  cb_color_mode, &QCheckBox::setEnabled);
1292  style_grid->addWidget (cb_color_mode, row, column);
1293 
1294  QPushButton *pb_reload_default_colors = new QPushButton (tr (settings_reload_colors.toStdString ().data ()));
1295  pb_reload_default_colors->setToolTip (tr (settings_reload_colors_tooltip.toStdString ().data ()));
1296  connect (m_ws_enable_colors, &QCheckBox::toggled,
1297  pb_reload_default_colors, &QPushButton::setEnabled);
1298  style_grid->addWidget (pb_reload_default_colors, row+1, column++);
1299 
1300  bool colors_enabled = settings->value (ws_enable_colors).toBool ();
1301 
1302  for (int i = 0; i < ws_colors_count; i++)
1303  {
1304  description[i] = new QLabel (" "
1305  + tr (ws_color_names.at (i).toStdString ().data ()));
1306  description[i]->setAlignment (Qt::AlignRight);
1307  description[i]->setEnabled (colors_enabled);
1308  connect (m_ws_enable_colors, &QCheckBox::toggled,
1309  description[i], &QLabel::setEnabled);
1310 
1311  QColor setting_color = settings->color_value (ws_colors[i], mode);
1312  color[i] = new color_picker (setting_color);
1313  color[i]->setObjectName (ws_colors[i].key);
1314  color[i]->setMinimumSize (30, 10);
1315  color[i]->setEnabled (colors_enabled);
1316  connect (m_ws_enable_colors, &QCheckBox::toggled,
1317  color[i], &color_picker::setEnabled);
1318 
1319  style_grid->addWidget (description[i], row, 3*column);
1320  style_grid->addWidget (color[i], row, 3*column+1);
1321  if (++column > color_columns)
1322  {
1323  style_grid->setColumnStretch (4*column, 10);
1324  row++;
1325  column = 1;
1326  }
1327  }
1328 
1329  // Load enable settings at the end for having signals already connected
1330  m_ws_enable_colors->setChecked (colors_enabled);
1331  m_ws_hide_tool_tips->setEnabled (colors_enabled);
1332  cb_color_mode->setEnabled (colors_enabled);
1333  pb_reload_default_colors->setEnabled (colors_enabled);
1334 
1335  // place grid with elements into the tab
1336  workspace_colors_box->setLayout (style_grid);
1337 
1338  // update colors depending on second theme selection or reloading
1339  // the dfault values
1340  connect (cb_color_mode, &QCheckBox::stateChanged,
1342  connect (pb_reload_default_colors, &QPushButton::clicked,
1344 }
1345 
1347 {
1348  QCheckBox *cb_color_mode
1349  = workspace_colors_box->findChild <QCheckBox *> (ws_color_mode.key);
1350 
1351  int m = 0;
1352  if (cb_color_mode && cb_color_mode->isChecked ())
1353  m = 1;
1354 
1356  gui_settings *settings = rmgr.get_settings ();
1357 
1358  color_picker *c_picker;
1359 
1360  for (unsigned int i = 0; i < ws_colors_count; i++)
1361  {
1362  c_picker = workspace_colors_box->findChild <color_picker *> (ws_colors[i].key);
1363  if (c_picker)
1364  {
1366  {
1367  // Get current value from settings or the default
1368  c_picker->set_color (settings->color_value (ws_colors[i], m));
1369  }
1370  else
1371  {
1372  // Get the default value
1373  c_picker->set_color (settings->get_color_value (ws_colors[i].def, m));
1374  }
1375  }
1376  }
1377 }
1378 
1380 {
1381  settings->setValue (ws_enable_colors.key, m_ws_enable_colors->isChecked ());
1382  settings->setValue (ws_hide_tool_tips.key, m_ws_hide_tool_tips->isChecked ());
1383 
1384  QCheckBox *cb_color_mode
1385  = workspace_colors_box->findChild <QCheckBox *> (ws_color_mode.key);
1386 
1387  int mode = 0;
1388  if (cb_color_mode && cb_color_mode->isChecked ())
1389  mode = 1;
1390 
1391  color_picker *color;
1392 
1393  for (int i = 0; i < ws_colors_count; i++)
1394  {
1395  color = workspace_colors_box->findChild <color_picker *> (ws_colors[i].key);
1396  if (color)
1397  settings->set_color_value (ws_colors[i], color->color (), mode);
1398  }
1399 
1400  settings->setValue (ws_color_mode.key, mode);
1401 
1402  settings->sync ();
1403 }
1404 
1406 {
1407  QGridLayout *style_grid = new QGridLayout ();
1408  QVector<QLabel *> description (cs_colors_count);
1409  QVector<color_picker *> color (cs_colors_count);
1410 
1411  int mode = settings->value (cs_color_mode).toInt ();
1412 
1413  QCheckBox *cb_color_mode = new QCheckBox (tr (settings_color_modes.toStdString ().data ()));
1414  cb_color_mode->setToolTip (tr (settings_color_modes_tooltip.toStdString ().data ()));
1415  cb_color_mode->setChecked (mode == 1);
1416  cb_color_mode->setObjectName (cs_color_mode.key);
1417  style_grid->addWidget (cb_color_mode, 0, 0);
1418 
1419  QPushButton *pb_reload_default_colors = new QPushButton (tr (settings_reload_colors.toStdString ().data ()));
1420  pb_reload_default_colors->setToolTip (tr (settings_reload_colors_tooltip.toStdString ().data ()));
1421  style_grid->addWidget (pb_reload_default_colors, 1, 0);
1422 
1423  int column = 1; // column 0 is for the color mode checkbox
1424  const int color_columns = 2; // place colors in so many columns
1425  int row = 0;
1426  for (unsigned int i = 0; i < cs_colors_count; i++)
1427  {
1428  description[i] = new QLabel (" "
1429  + tr (cs_color_names.at (i).toStdString ().data ()));
1430  description[i]->setAlignment (Qt::AlignRight);
1431  QColor setting_color = settings->color_value (cs_colors[i], mode);
1432  color[i] = new color_picker (setting_color);
1433  color[i]->setObjectName (cs_colors[i].key);
1434  color[i]->setMinimumSize (30, 10);
1435  style_grid->addWidget (description[i], row, 2*column);
1436  style_grid->addWidget (color[i], row, 2*column+1);
1437  if (++column > color_columns)
1438  {
1439  style_grid->setColumnStretch (3*column, 10);
1440  row++;
1441  column = 1;
1442  }
1443  }
1444 
1445  // place grid with elements into the tab
1446  terminal_colors_box->setLayout (style_grid);
1447 
1448  // update colors depending on second theme selection
1449  connect (cb_color_mode, &QCheckBox::stateChanged,
1451  connect (pb_reload_default_colors, &QPushButton::clicked,
1453 }
1454 
1456 {
1457  QCheckBox *cb_color_mode
1458  = terminal_colors_box->findChild <QCheckBox *> (cs_color_mode.key);
1459 
1460  int m = 0;
1461  if (cb_color_mode && cb_color_mode->isChecked ())
1462  m = 1;
1463 
1465  gui_settings *settings = rmgr.get_settings ();
1466 
1467  color_picker *c_picker;
1468 
1469  for (unsigned int i = 0; i < cs_colors_count; i++)
1470  {
1471  c_picker = terminal_colors_box->findChild <color_picker *> (cs_colors[i].key);
1472  if (c_picker)
1473  {
1475  {
1476  // Get current value from settings or the default
1477  c_picker->set_color (settings->color_value (cs_colors[i], m));
1478  }
1479  else
1480  {
1481  // Get the default value
1482  c_picker->set_color (settings->get_color_value (cs_colors[i].def, m));
1483  }
1484  }
1485  }
1486 }
1487 
1489 {
1490  QCheckBox *cb_color_mode
1491  = terminal_colors_box->findChild <QCheckBox *> (cs_color_mode.key);
1492 
1493  int mode = 0;
1494  if (cb_color_mode && cb_color_mode->isChecked ())
1495  mode = 1;
1496 
1497  color_picker *color;
1498 
1499  for (int i = 0; i < cs_color_names.size (); i++)
1500  {
1501  color = terminal_colors_box->findChild <color_picker *> (cs_colors[i].key);
1502  if (color)
1503  settings->set_color_value (cs_colors[i], color->color (), mode);
1504  }
1505 
1506  settings->setValue (cs_color_mode.key, mode);
1507 
1508  settings->sync ();
1509 }
1510 
1512 {
1513  QGridLayout *style_grid = new QGridLayout ();
1514  QVector<QLabel *> description (ve_colors_count);
1515  QVector<color_picker *> color (ve_colors_count);
1516 
1517  int mode = settings->value (ve_color_mode).toInt ();
1518 
1519  QCheckBox *cb_color_mode = new QCheckBox (tr (settings_color_modes.toStdString ().data ()));
1520  cb_color_mode->setToolTip (tr (settings_color_modes_tooltip.toStdString ().data ()));
1521  cb_color_mode->setChecked (mode == 1);
1522  cb_color_mode->setObjectName (ve_color_mode.key);
1523  style_grid->addWidget (cb_color_mode, 0, 0);
1524 
1525  QPushButton *pb_reload_default_colors = new QPushButton (tr (settings_reload_colors.toStdString ().data ()));
1526  pb_reload_default_colors->setToolTip (tr (settings_reload_colors_tooltip.toStdString ().data ()));
1527  style_grid->addWidget (pb_reload_default_colors, 1, 0);
1528 
1529  int column = 1;
1530  int color_columns = 2;
1531  int row = 0;
1532  for (int i = 0; i < ve_colors_count; i++)
1533  {
1534  description[i] = new QLabel (" "
1535  + tr (ve_color_names.at (i).toStdString ().data ()));
1536  description[i]->setAlignment (Qt::AlignRight);
1537 
1538  QColor setting_color = settings->color_value (ve_colors[i], mode);
1539  color[i] = new color_picker (setting_color);
1540  color[i]->setObjectName (ve_colors[i].key);
1541  color[i]->setMinimumSize (30, 10);
1542  style_grid->addWidget (description[i], row, 2*column);
1543  style_grid->addWidget (color[i], row, 2*column+1);
1544  if (++column > color_columns)
1545  {
1546  style_grid->setColumnStretch (3*column, 10);
1547  row++;
1548  column = 1;
1549  }
1550  }
1551 
1552  // place grid with elements into the tab
1553  varedit_colors_box->setLayout (style_grid);
1554 
1555  // update colors depending on second theme selection
1556  connect (cb_color_mode, &QCheckBox::stateChanged,
1558  connect (pb_reload_default_colors, &QPushButton::clicked,
1560 }
1561 
1563 {
1564  QCheckBox *cb_color_mode
1565  = varedit_colors_box->findChild <QCheckBox *> (ve_color_mode.key);
1566 
1567  int m = 0;
1568  if (cb_color_mode && cb_color_mode->isChecked ())
1569  m = 1;
1570 
1572  gui_settings *settings = rmgr.get_settings ();
1573 
1574  color_picker *c_picker;
1575 
1576  for (unsigned int i = 0; i < ve_colors_count; i++)
1577  {
1578  c_picker = varedit_colors_box->findChild <color_picker *> (ve_colors[i].key);
1579  if (c_picker)
1580  {
1582  {
1583  // Get current value from settings or the default
1584  c_picker->set_color (settings->color_value (ve_colors[i], m));
1585  }
1586  else
1587  {
1588  // Get the default value
1589  c_picker->set_color (settings->get_color_value (ve_colors[i].def, m));
1590  }
1591  }
1592  }
1593 }
1594 
1596 {
1597  QCheckBox *cb_color_mode
1598  = varedit_colors_box->findChild <QCheckBox *> (ve_color_mode.key);
1599 
1600  int mode = 0;
1601  if (cb_color_mode && cb_color_mode->isChecked ())
1602  mode = 1;
1603 
1604  color_picker *color;
1605 
1606  for (int i = 0; i < ve_colors_count; i++)
1607  {
1608  color = varedit_colors_box->findChild <color_picker *> (ve_colors[i].key);
1609  if (color)
1610  settings->set_color_value (ve_colors[i], color->color (), mode);
1611  }
1612 
1613  settings->setValue (ve_color_mode.key, mode);
1614 
1615  settings->sync ();
1616 }
1617 
OCTAVE_END_NAMESPACE(octave)
Base class for Octave interfaces that use Qt.
resource_manager & get_resource_manager(void)
shortcut_manager & get_shortcut_manager(void)
QColor color(void) const
Definition: color-picker.h:45
void set_color(QColor new_color)
Definition: color-picker.cc:61
Definition: lex.h:766
gui_settings * get_settings(void) const
void read_lexer_settings(QsciLexer *lexer, gui_settings *settings, int mode=0, int def=0)
QString get_gui_translation_dir(void)
void combo_encoding(QComboBox *combo, const QString &current=QString())
int get_valid_lexer_styles(QsciLexer *lexer, int *styles)
void update_terminal_colors(int def=0)
QCheckBox * m_ws_hide_tool_tips
color_picker * m_widget_title_fg_color
void show_tab(const QString &)
void read_workspace_colors(gui_settings *settings)
void write_workspace_colors(gui_settings *settings)
base_qobject & m_octave_qobj
void update_lexer(QsciLexer *lexer, gui_settings *settings, int mode, int def=0)
void apply_new_settings(void)
QCheckBox * m_rb_uncomment_strings[ed_comment_strings_count]
void default_shortcut_set(void)
color_picker * m_widget_title_fg_color_active
void update_editor_lexers(int def=0)
void get_octave_dir(void)
void import_shortcut_set(void)
void get_file_browser_dir(void)
void read_varedit_colors(gui_settings *settings)
void write_changed_settings(bool closing)
void button_clicked(QAbstractButton *button)
color_picker * m_widget_title_bg_color_active
void write_varedit_colors(gui_settings *settings)
void read_terminal_colors(gui_settings *settings)
QCheckBox * m_ws_enable_colors
void export_shortcut_set(void)
void write_terminal_colors(gui_settings *settings)
void proxy_items_update(void)
void set_disabled_pref_file_browser_dir(bool disable)
void get_lexer_settings(QsciLexer *lexer, gui_settings *settings)
color_picker * m_widget_title_bg_color
QRadioButton * m_rb_comment_strings[ed_comment_strings_count]
void get_dir(QLineEdit *, const QString &)
void update_varedit_colors(int def=0)
void write_lexer_settings(QsciLexer *lexer, gui_settings *settings)
void update_workspace_colors(int def=0)
void write_shortcuts(gui_settings *settings, bool closing)
bool import_export(int action)
void fill_treewidget(QTreeWidget *tree_view)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
const gui_pref cs_colors[2 *cs_colors_count]
const unsigned int cs_colors_count
const gui_pref cs_focus_cmd("terminal/focus_after_command", QVariant(false))
const gui_pref cs_color_mode("terminal/color_mode", QVariant(0))
const gui_pref cs_hist_buffer("terminal/history_buffer", QVariant(1000))
const gui_pref cs_font_size("terminal/fontSize", QVariant(10))
const QStringList cs_color_names
const std::vector< std::string > cs_cursor_types
const gui_pref cs_cursor("terminal/cursorType", QVariant("ibeam"))
const gui_pref cs_dbg_location("terminal/print_debug_location", QVariant(false))
const gui_pref cs_cursor_use_fgcol("terminal/cursorUseForegroundColor", QVariant(true))
const gui_pref cs_font("terminal/fontName", QVariant())
const gui_pref cs_cursor_blinking("terminal/cursorBlinking", QVariant(true))
const gui_pref dw_title_3d("DockWidgets/widget_title_3d", QVariant(20))
const gui_pref dw_title_fg_color("DockWidgets/title_fg_color", QVariant(QColor(0, 0, 0)))
const gui_pref dw_title_fg_color_active("DockWidgets/title_fg_color_active", QVariant(QColor(255, 255, 255)))
const gui_pref dw_title_custom_style("DockWidgets/widget_title_custom_style", QVariant(true))
const gui_pref dw_focus_follows_mouse("DockWidgets/focus_follows_mouse", QVariant(false))
const gui_pref dw_title_bg_color_active("DockWidgets/title_bg_color_active", QVariant(QColor(128, 128, 128)))
const gui_pref dw_title_bg_color("DockWidgets/title_bg_color", QVariant(QColor(192, 192, 192)))
const gui_pref dw_icon_set("DockWidgets/widget_icon_set", QVariant("NONE"))
const gui_pref ed_tabs_rotated("editor/tabs_rotated", QVariant(false))
const gui_pref ed_always_reload_changed_files("editor/always_reload_changed_files", QVariant(false))
const gui_pref ed_comment_str_old("editor/octave_comment_string", QVariant(0))
const gui_pref ed_indent_uses_tabs("editor/indent_uses_tabs", QVariant(false))
const gui_pref ed_code_completion("editor/codeCompletion", QVariant(true))
const gui_pref ed_show_hscroll_bar("editor/show_hscroll_bar", QVariant(true))
const gui_pref ed_code_completion_octave_functions("editor/codeCompletion_octave_functions", QVariant(true))
const gui_pref ed_auto_endif("editor/auto_endif", QVariant(1))
const gui_pref ed_show_toolbar("editor/show_toolbar", QVariant(true))
const gui_pref ed_uncomment_str("editor/oct_uncomment_str", QVariant(1+2+4+8))
const gui_pref ed_show_white_space("editor/show_white_space", QVariant(false))
const gui_pref ed_create_new_file("editor/create_new_file", QVariant(false))
const gui_pref ed_color_mode("editor/color_mode", QVariant(0))
const gui_pref ed_line_numbers_size("editor/line_numbers_size", QVariant(0))
const gui_pref ed_wrap_lines("editor/wrap_lines", QVariant(false))
const gui_pref ed_highlight_current_line("editor/highlightCurrentLine", QVariant(true))
const gui_pref ed_tabs_max_width("editor/tabs_max_width", QVariant(0))
const gui_pref ed_break_lines("editor/break_lines", QVariant(false))
const gui_pref ed_break_lines_comments("editor/break_lines_comments", QVariant(false))
const gui_pref ed_highlight_current_line_color("editor/highlightCurrentLineColor", QVariant(settings_color_no_change))
const gui_pref ed_long_line_marker("editor/long_line_marker", QVariant(true))
const gui_pref ed_tab_position("editor/tab_position", QVariant(QTabWidget::North))
const gui_pref ed_tab_indents_line("editor/tab_indents_line", QVariant(false))
const int ed_max_lexer_styles
const gui_pref ed_code_completion_octave_builtins("editor/codeCompletion_octave_builtins", QVariant(true))
const gui_pref ed_show_edit_status_bar("editor/show_edit_status_bar", QVariant(true))
const gui_pref ed_code_completion_threshold("editor/codeCompletion_threshold", QVariant(3))
const gui_pref ed_code_completion_document("editor/codeCompletion_document", QVariant(true))
const gui_pref ed_backspace_unindents_line("editor/backspace_unindents_line", QVariant(false))
const gui_pref ed_restore_session("editor/restoreSession", QVariant(true))
const gui_pref ed_code_completion_case("editor/codeCompletion_case", QVariant(true))
const gui_pref ed_rm_trailing_spaces("editor/rm_trailing_spaces", QVariant(true))
const gui_pref ed_default_enc("editor/default_encoding", QVariant("UTF-8"))
const gui_pref ed_long_line_marker_background("editor/long_line_marker_background", QVariant(false))
const gui_pref ed_show_dbg_file("editor/show_dbg_file", QVariant(true))
const gui_pref ed_show_white_space_indent("editor/show_white_space_indent", QVariant(false))
const gui_pref ed_show_line_numbers("editor/showLineNumbers", QVariant(true))
const gui_pref ed_highlight_all_occurrences("editor/highlight_all_occurrences", QVariant(true))
const gui_pref ed_show_eol_chars("editor/show_eol_chars", QVariant(false))
const QStringList ed_tab_position_names
const gui_pref ed_show_indent_guides("editor/show_indent_guides", QVariant(false))
const gui_pref ed_code_folding("editor/code_folding", QVariant(true))
const gui_pref ed_force_newline("editor/force_newline", QVariant(true))
const QStringList ed_comment_strings
const gui_pref ed_indent_width("editor/indent_width", QVariant(2))
const gui_pref ed_tab_width("editor/tab_width", QVariant(2))
const gui_pref ed_comment_str("editor/oct_comment_str", QVariant(0))
const gui_pref ed_hiding_closes_files("editor/hiding_closes_files", QVariant(false))
const gui_pref ed_long_line_column("editor/long_line_column", QVariant(80))
const gui_pref ed_default_eol_mode("editor/default_eol_mode", QVariant(os_eol_mode))
const gui_pref ed_code_completion_replace("editor/codeCompletion_replace", QVariant(false))
const int ed_comment_strings_count
const gui_pref ed_code_completion_keywords("editor/codeCompletion_keywords", QVariant(true))
const gui_pref ed_auto_indent("editor/auto_indent", QVariant(true))
const gui_pref ed_long_line_marker_line("editor/long_line_marker_line", QVariant(true))
const gui_pref fb_sync_octdir("filesdockwidget/sync_octave_directory", QVariant(true))
const gui_pref fb_startup_dir("filesdockwidget/startup_dir", QVariant(QString()))
const gui_pref fb_txt_file_ext("filesdockwidget/txt_file_extensions", QVariant("m;c;cc;cpp;h;txt"))
const gui_pref fb_restore_last_dir("filesdockwidget/restore_last_dir", QVariant(false))
const gui_pref global_icon_theme_index("icon_theme", QVariant(ICON_THEME_SYSTEM))
const gui_pref global_use_proxy("useProxyServer", QVariant(false))
const gui_pref global_mono_font("monospace_font", global_font_family)
const gui_pref global_restore_ov_dir("restore_octave_dir", QVariant(false))
const gui_pref global_proxy_pass("proxyPassword", QVariant(QString()))
const gui_pref global_status_bar("show_status_bar", QVariant(true))
const gui_pref global_proxy_host("proxyHostName", QVariant(QString()))
const QList< int > global_proxy_manual_types
const gui_pref global_prompt_to_exit("prompt_to_exit", QVariant(false))
const gui_pref global_proxy_type("proxyType", QVariant(QString()))
const gui_pref global_use_native_dialogs("use_native_file_dialogs", QVariant(true))
const gui_pref global_proxy_user("proxyUserName", QVariant(QString()))
const gui_pref global_use_custom_editor("useCustomFileEditor", QVariant(false))
const QStringList global_proxy_all_types
const gui_pref global_ov_startup_dir("octave_startup_dir", QVariant(QString()))
const gui_pref global_custom_editor("customFileEditor", QVariant("emacs +%l %f"))
const QStringList global_extra_styles
const gui_pref global_proxy_port("proxyPort", QVariant(80))
const gui_pref global_icon_size("toolbar_icon_size", QVariant(0))
const QStringList global_all_icon_theme_names
const gui_pref global_language("language", QVariant("SYSTEM"))
const gui_pref global_cursor_blinking("cursor_blinking", QVariant(true))
const gui_pref global_style("style", QVariant("default"))
const gui_pref nr_allow_connection("news/allow_web_connection", QVariant(false))
const gui_pref sc_prevent_rl_conflicts("shortcuts/prevent_readline_conflicts", QVariant(false))
const gui_pref sc_prevent_rl_conflicts_menu("shortcuts/prevent_readline_conflicts_menu", QVariant(false))
const QString settings_reload_colors_tooltip
const QString settings_color_modes_tooltip
const QString settings_color_modes
const gui_pref sd_geometry("settings/geometry", QVariant())
const QString settings_reload_colors
const QString settings_reload_styles_tooltip
const gui_pref sd_last_editor_styles_tab("settings/last_editor_styles_tab", QVariant(0))
const QString settings_reload_styles
const gui_pref sd_last_tab("settings/last_tab", QVariant(0))
const gui_pref ve_color_mode("variable_editor/color_mode", QVariant(0))
const int ve_colors_count
const gui_pref ve_column_width("variable_editor/column_width", QVariant(100))
const gui_pref ve_use_terminal_font("variable_editor/use_terminal_font", QVariant(true))
const gui_pref ve_font_size("variable_editor/font_size", QVariant(10))
const QStringList ve_color_names
const gui_pref ve_alternate_rows("variable_editor/alternate_rows", QVariant(false))
const gui_pref ve_font_name("variable_editor/font_name", QVariant())
const gui_pref ve_colors[2 *ve_colors_count]
const gui_pref ve_row_height("variable_editor/row_height", QVariant(10))
const gui_pref ws_colors[2 *ws_colors_count]
const gui_pref ws_enable_colors("workspaceview/enable_colors", QVariant(false))
const gui_pref ws_color_mode("workspaceview/color_mode", QVariant(0))
const QStringList ws_color_names
const gui_pref ws_hide_tool_tips("workspaceview/hide_tools_tips", QVariant(false))
const int ws_colors_count
const QColor settings_color_no_change(255, 0, 255)
const QStringList settings_color_modes_ext(QStringList()<< ""<< "_2")
const int settings_reload_default_colors_flag
Definition: gui-settings.h:134
T octave_idx_type m
Definition: mx-inlines.cc:773
#define lexer
Definition: oct-parse.cc:146
const QString key
const QVariant def