GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
settings-dialog.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2011-2015 Jacob Dawid
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26 
27 #include "resource-manager.h"
28 #include "shortcut-manager.h"
29 #include "workspace-model.h"
30 #include "settings-dialog.h"
31 #include "ui-settings-dialog.h"
32 #include <QDir>
33 #include <QFileInfo>
34 #include <QFileDialog>
35 #include <QVector>
36 #include <QHash>
37 
38 #ifdef HAVE_QSCINTILLA
39 #include "octave-qscintilla.h"
40 #include "octave-txt-lexer.h"
41 #include <QScrollArea>
42 
43 #if defined (HAVE_QSCI_QSCILEXEROCTAVE_H)
44 #define HAVE_LEXER_OCTAVE
45 #include <Qsci/qscilexeroctave.h>
46 #elif defined (HAVE_QSCI_QSCILEXERMATLAB_H)
47 #define HAVE_LEXER_MATLAB
48 #include <Qsci/qscilexermatlab.h>
49 #endif
50 
51 #include <Qsci/qscilexercpp.h>
52 #include <Qsci/qscilexerbash.h>
53 #include <Qsci/qscilexerperl.h>
54 #include <Qsci/qscilexerbatch.h>
55 #include <Qsci/qscilexerdiff.h>
56 #endif
57 
58 settings_dialog::settings_dialog (QWidget *p, const QString& desired_tab):
59  QDialog (p), ui (new Ui::settings_dialog)
60 {
61  ui->setupUi (this);
62 
63  QSettings *settings = resource_manager::get_settings ();
64 
65  // restore last geometry
66  restoreGeometry (settings->value("settings/geometry").toByteArray ());
67 
68  // look for available language files and the actual settings
69  QString qm_dir_name = resource_manager::get_gui_translation_dir ();
70  QDir qm_dir (qm_dir_name);
71  QFileInfoList qm_files = qm_dir.entryInfoList (QStringList ("*.qm"),
72  QDir::Files | QDir::Readable,
73  QDir::Name);
74  for (int i = 0; i < qm_files.length (); i++) // insert available languages
75  ui->comboBox_language->addItem (qm_files.at (i).baseName ());
76  // System at beginning
77  ui->comboBox_language->insertItem (0,tr ("System setting"));
78  ui->comboBox_language->insertSeparator (1); // separator after System
79  QString language = settings->value ("language","SYSTEM").toString ();
80  if (language == "SYSTEM")
81  language = tr ("System setting");
82  int selected = ui->comboBox_language->findText (language);
83  if (selected >= 0)
84  ui->comboBox_language->setCurrentIndex (selected);
85  else
86  ui->comboBox_language->setCurrentIndex (0); // System is default
87 
88  // icon size
89  QButtonGroup *icon_size_group = new QButtonGroup (this);
90  icon_size_group->addButton (ui->icon_size_small);
91  icon_size_group->addButton (ui->icon_size_normal);
92  icon_size_group->addButton (ui->icon_size_large);
93  int icon_size = settings->value ("toolbar_icon_size", 0).toInt ();
94  ui->icon_size_normal->setChecked (true); // the default
95  ui->icon_size_small->setChecked (icon_size == -1);
96  ui->icon_size_large->setChecked (icon_size == 1);
97 
98  // which icon has to be selected
99  QButtonGroup *icon_group = new QButtonGroup (this);
100  icon_group->addButton (ui->general_icon_octave);
101  icon_group->addButton (ui->general_icon_graphic);
102  icon_group->addButton (ui->general_icon_letter);
103  QString widget_icon_set =
104  settings->value ("DockWidgets/widget_icon_set","NONE").toString ();
105  ui->general_icon_octave-> setChecked (true); // the default (if invalid set)
106  ui->general_icon_octave-> setChecked (widget_icon_set == "NONE");
107  ui->general_icon_graphic-> setChecked (widget_icon_set == "GRAPHIC");
108  ui->general_icon_letter-> setChecked (widget_icon_set == "LETTER");
109 
110  // custom title bar of dock widget
111  QVariant default_var = QColor (255,255,255);
112  QColor bg_color = settings->value ("Dockwidgets/title_bg_color",
113  default_var).value<QColor> ();
114  _widget_title_bg_color = new color_picker (bg_color);
115  _widget_title_bg_color->setEnabled (false);
116  ui->layout_widget_bgtitle->addWidget (_widget_title_bg_color,0);
117  connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)),
118  _widget_title_bg_color, SLOT (setEnabled (bool)));
119 
120  default_var = QColor (192,192,192);
121  QColor bg_color_active = settings->value ("Dockwidgets/title_bg_color_active",
122  default_var).value<QColor> ();
123  _widget_title_bg_color_active = new color_picker (bg_color_active);
124  _widget_title_bg_color_active->setEnabled (false);
125  ui->layout_widget_bgtitle_active->addWidget (_widget_title_bg_color_active,0);
126  connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)),
127  _widget_title_bg_color_active, SLOT (setEnabled (bool)));
128 
129  default_var = QColor (0,0,0);
130  QColor fg_color = settings->value ("Dockwidgets/title_fg_color",
131  default_var).value<QColor> ();
132  _widget_title_fg_color = new color_picker (fg_color);
133  _widget_title_fg_color->setEnabled (false);
134  ui->layout_widget_fgtitle->addWidget (_widget_title_fg_color,0);
135  connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)),
136  _widget_title_fg_color, SLOT (setEnabled (bool)));
137 
138  default_var = QColor (0,0,0);
139  QColor fg_color_active = settings->value ("Dockwidgets/title_fg_color_active",
140  default_var).value<QColor> ();
141  _widget_title_fg_color_active = new color_picker (fg_color_active);
142  _widget_title_fg_color_active->setEnabled (false);
143  ui->layout_widget_fgtitle_active->addWidget (_widget_title_fg_color_active,0);
144  connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)),
145  _widget_title_fg_color_active, SLOT (setEnabled (bool)));
146 
147  ui->sb_3d_title->setValue (
148  settings->value ("DockWidgets/widget_title_3d", 50).toInt ());
149  ui->cb_widget_custom_style->setChecked (
150  settings->value ("DockWidgets/widget_title_custom_style",false).toBool ());
151 
152  // prompt on exit
153  ui->cb_prompt_to_exit->setChecked (
154  settings->value ("prompt_to_exit",false).toBool ());
155 
156  // Main status bar
157  ui->cb_status_bar->setChecked (
158  settings->value ("show_status_bar",true).toBool ());
159 
160  // Octave startup
161  ui->cb_restore_octave_dir->setChecked (
162  settings->value ("restore_octave_dir",false).toBool ());
163  ui->le_octave_dir->setText (
164  settings->value ("octave_startup_dir").toString ());
165  connect (ui->pb_octave_dir, SIGNAL (pressed ()),
166  this, SLOT (get_octave_dir ()));
167 
168  // editor
169  ui->useCustomFileEditor->setChecked (settings->value ("useCustomFileEditor",
170  false).toBool ());
171  ui->customFileEditor->setText (
172  settings->value ("customFileEditor").toString ());
173  ui->editor_showLineNumbers->setChecked (
174  settings->value ("editor/showLineNumbers",true).toBool ());
175 
176  default_var = QColor (240, 240, 240);
177  QColor setting_color = settings->value ("editor/highlight_current_line_color",
178  default_var).value<QColor> ();
179  _editor_current_line_color = new color_picker (setting_color);
180  ui->editor_grid_current_line->addWidget (_editor_current_line_color,0,3);
181  _editor_current_line_color->setMinimumSize (50,10);
182  _editor_current_line_color->setEnabled (false);
183  connect (ui->editor_highlightCurrentLine, SIGNAL (toggled (bool)),
184  _editor_current_line_color, SLOT (setEnabled (bool)));
185  ui->editor_highlightCurrentLine->setChecked (
186  settings->value ("editor/highlightCurrentLine",true).toBool ());
187  ui->editor_long_line_marker->setChecked (
188  settings->value ("editor/long_line_marker",true).toBool ());
189  ui->editor_long_line_column->setValue (
190  settings->value ("editor/long_line_column",80).toInt ());
191  ui->cb_edit_status_bar->setChecked (
192  settings->value ("editor/show_edit_status_bar",true).toBool ());
193  ui->cb_code_folding->setChecked (
194  settings->value ("editor/code_folding",true).toBool ());
195 
196  ui->editor_codeCompletion->setChecked (
197  settings->value ("editor/codeCompletion", true).toBool ());
198  ui->editor_spinbox_ac_threshold->setValue (
199  settings->value ("editor/codeCompletion_threshold",2).toInt ());
200  ui->editor_checkbox_ac_keywords->setChecked (
201  settings->value ("editor/codeCompletion_keywords",true).toBool ());
202  ui->editor_checkbox_ac_builtins->setEnabled (
203  ui->editor_checkbox_ac_keywords->isChecked ());
204  ui->editor_checkbox_ac_functions->setEnabled (
205  ui->editor_checkbox_ac_keywords->isChecked ());
206  ui->editor_checkbox_ac_builtins->setChecked (
207  settings->value ("editor/codeCompletion_octave_builtins",true).toBool ());
208  ui->editor_checkbox_ac_functions->setChecked (
209  settings->value ("editor/codeCompletion_octave_functions",true).toBool ());
210  ui->editor_checkbox_ac_document->setChecked (
211  settings->value ("editor/codeCompletion_document",false).toBool ());
212  ui->editor_checkbox_ac_case->setChecked (
213  settings->value ("editor/codeCompletion_case",true).toBool ());
214  ui->editor_checkbox_ac_replace->setChecked (
215  settings->value ("editor/codeCompletion_replace",false).toBool ());
216  ui->editor_ws_checkbox->setChecked (
217  settings->value ("editor/show_white_space", false).toBool ());
218  ui->editor_ws_indent_checkbox->setChecked (
219  settings->value ("editor/show_white_space_indent",false).toBool ());
220  ui->cb_show_eol->setChecked (
221  settings->value ("editor/show_eol_chars",false).toBool () );
222  ui->cb_show_hscrollbar->setChecked (
223  settings->value ("editor/show_hscroll_bar",true).toBool ());
224 
225 #ifdef HAVE_QSCINTILLA
226 #if defined (Q_OS_WIN32)
227  int eol_mode = QsciScintilla::EolWindows;
228 #elif defined (Q_OS_MAC)
229  int eol_mode = QsciScintilla::EolMac;
230 #else
231  int eol_mode = QsciScintilla::EolUnix;
232 #endif
233 #else
234  int eol_mode = 2;
235 #endif
236  ui->combo_eol_mode->setCurrentIndex (
237  settings->value ("editor/default_eol_mode",eol_mode).toInt () );
238  ui->editor_auto_ind_checkbox->setChecked (
239  settings->value ("editor/auto_indent", true).toBool ());
240  ui->editor_tab_ind_checkbox->setChecked (
241  settings->value ("editor/tab_indents_line",false).toBool ());
242  ui->editor_bs_unind_checkbox->setChecked (
243  settings->value ("editor/backspace_unindents_line",false).toBool ());
244  ui->editor_ind_guides_checkbox->setChecked (
245  settings->value ("editor/show_indent_guides",false).toBool ());
246  ui->editor_ind_width_spinbox->setValue (
247  settings->value ("editor/indent_width", 2).toInt ());
248  ui->editor_ind_uses_tabs_checkbox->setChecked (
249  settings->value ("editor/indent_uses_tabs", false).toBool ());
250  ui->editor_tab_width_spinbox->setValue (
251  settings->value ("editor/tab_width", 2).toInt ());
252  ui->editor_longWindowTitle->setChecked (
253  settings->value ("editor/longWindowTitle",false).toBool ());
254  ui->editor_notebook_tab_width_min->setValue (
255  settings->value ("editor/notebook_tab_width_min", 160).toInt ());
256  ui->editor_notebook_tab_width_max->setValue (
257  settings->value ("editor/notebook_tab_width_max", 300).toInt ());
258  ui->editor_restoreSession->setChecked (
259  settings->value ("editor/restoreSession", true).toBool ());
260  ui->editor_create_new_file->setChecked (
261  settings->value ("editor/create_new_file",false).toBool ());
262  ui->editor_reload_changed_files->setChecked (
263  settings->value ("editor/always_reload_changed_files",false).toBool ());
264 
265  // terminal
266  ui->terminal_fontName->setCurrentFont (QFont (
267  settings->value ("terminal/fontName","Courier New").toString ()));
268  ui->terminal_fontSize->setValue (
269  settings->value ("terminal/fontSize", 10).toInt ());
270  ui->terminal_history_buffer->setValue (
271  settings->value ("terminal/history_buffer",1000).toInt ());
272  ui->terminal_cursorBlinking->setChecked (
273  settings->value ("terminal/cursorBlinking",true).toBool ());
275  settings->value ("terminal/cursorUseForegroundColor",true).toBool ());
276  ui->terminal_focus_command->setChecked (
277  settings->value ("terminal/focus_after_command",false).toBool ());
278  ui->terminal_print_dbg_location->setChecked (
279  settings->value ("terminal/print_debug_location",false).toBool ());
280 
281  QString cursorType
282  = settings->value ("terminal/cursorType", "ibeam").toString ();
283 
284  QStringList items;
285  items << QString ("0") << QString ("1") << QString ("2");
286  ui->terminal_cursorType->addItems (items);
287  ui->terminal_cursorType->setItemText (0, tr ("IBeam Cursor"));
288  ui->terminal_cursorType->setItemText (1, tr ("Block Cursor"));
289  ui->terminal_cursorType->setItemText (2, tr ("Underline Cursor"));
290 
291  if (cursorType == "ibeam")
292  ui->terminal_cursorType->setCurrentIndex (0);
293  else if (cursorType == "block")
294  ui->terminal_cursorType->setCurrentIndex (1);
295  else if (cursorType == "underline")
296  ui->terminal_cursorType->setCurrentIndex (2);
297 
298  // file browser
299  ui->showFileSize->setChecked (
300  settings->value ("filesdockwidget/showFileSize", false).toBool ());
301  ui->showFileType->setChecked (
302  settings->value ("filesdockwidget/showFileType", false).toBool ());
303  ui->showLastModified->setChecked (
304  settings->value ("filesdockwidget/showLastModified",false).toBool ());
305  ui->showHiddenFiles->setChecked (
306  settings->value ("filesdockwidget/showHiddenFiles",false).toBool ());
307  ui->useAlternatingRowColors->setChecked (
308  settings->value ("filesdockwidget/useAlternatingRowColors",true).toBool ());
309  connect (ui->sync_octave_directory, SIGNAL (toggled (bool)),
310  this, SLOT (set_disabled_pref_file_browser_dir (bool)));
311  ui->sync_octave_directory->setChecked (
312  settings->value ("filesdockwidget/sync_octave_directory",true).toBool ());
313  ui->cb_restore_file_browser_dir->setChecked (
314  settings->value ("filesdockwidget/restore_last_dir",false).toBool ());
315  ui->le_file_browser_dir->setText (
316  settings->value ("filesdockwidget/startup_dir").toString ());
317  connect (ui->pb_file_browser_dir, SIGNAL (pressed ()),
318  this, SLOT (get_file_browser_dir ()));
319 
320  ui->checkbox_allow_web_connect->setChecked (
321  settings->value ("news/allow_web_connection",false).toBool ());
322  ui->useProxyServer->setChecked (
323  settings->value ("useProxyServer", false).toBool ());
324  ui->proxyHostName->setText (settings->value ("proxyHostName").toString ());
325 
326  int currentIndex = 0;
327  QString proxyTypeString = settings->value ("proxyType").toString ();
328  while ((currentIndex < ui->proxyType->count ())
329  && (ui->proxyType->currentText () != proxyTypeString))
330  {
331  currentIndex++;
332  ui->proxyType->setCurrentIndex (currentIndex);
333  }
334 
335  ui->proxyPort->setText (settings->value ("proxyPort").toString ());
336  ui->proxyUserName->setText (settings->value ("proxyUserName").toString ());
337  ui->proxyPassword->setText (settings->value ("proxyPassword").toString ());
338 
339  // Workspace
340  // colors
341  read_workspace_colors (settings);
342  // hide tool tips
343  ui->cb_hide_tool_tips->setChecked (
344  settings->value ("workspaceview/hide_tool_tips",false).toBool ());
345 
346  // terminal colors
347  read_terminal_colors (settings);
348 
349  // shortcuts
350 
351  ui->cb_prevent_readline_conflicts->setChecked (
352  settings->value ("shortcuts/prevent_readline_conflicts", true).toBool ());
353  int set = settings->value ("shortcuts/set",0).toInt ();
354  ui->rb_sc_set1->setChecked (set == 0);
355  ui->rb_sc_set2->setChecked (set == 1);
356 
357  // initialize the tree view with all shortcut data
359 
360  // connect the buttons for import/export of the shortcut sets
361  connect (ui->btn_import_shortcut_set1, SIGNAL (clicked ()),
362  this, SLOT (import_shortcut_set1 ()));
363  connect (ui->btn_export_shortcut_set1, SIGNAL (clicked ()),
364  this, SLOT (export_shortcut_set1 ()));
365  connect (ui->btn_import_shortcut_set2, SIGNAL (clicked ()),
366  this, SLOT (import_shortcut_set2 ()));
367  connect (ui->btn_export_shortcut_set2, SIGNAL (clicked ()),
368  this, SLOT (export_shortcut_set2 ()));
369 
370 
371 #ifdef HAVE_QSCINTILLA
372  // editor styles: create lexer, read settings, and create dialog elements
373  QsciLexer *lexer;
374 #if defined (HAVE_LEXER_OCTAVE)
375  lexer = new QsciLexerOctave ();
376  read_lexer_settings (lexer,settings);
377  delete lexer;
378 #elif defined (HAVE_LEXER_MATLAB)
379  lexer = new QsciLexerMatlab ();
380  read_lexer_settings (lexer,settings);
381  delete lexer;
382 #endif
383  lexer = new QsciLexerCPP ();
384  read_lexer_settings (lexer,settings);
385  delete lexer;
386  lexer = new QsciLexerPerl ();
387  read_lexer_settings (lexer,settings);
388  delete lexer;
389  lexer = new QsciLexerBatch ();
390  read_lexer_settings (lexer,settings);
391  delete lexer;
392  lexer = new QsciLexerDiff ();
393  read_lexer_settings (lexer,settings);
394  delete lexer;
395  lexer = new QsciLexerBash ();
396  read_lexer_settings (lexer,settings);
397  delete lexer;
398  lexer = new octave_txt_lexer ();
399  read_lexer_settings (lexer,settings);
400  delete lexer;
401 #endif
402 
403  // which tab is the desired one?
404  show_tab (desired_tab);
405 
406  // connect button box signal
407  connect (ui->button_box, SIGNAL (clicked (QAbstractButton *)),
408  this, SLOT (button_clicked (QAbstractButton *)));
409 }
410 
412 {
413  delete ui;
414 }
415 
416 void
417 settings_dialog::show_tab (const QString& tab)
418 {
419  if (tab.isEmpty ())
420  {
421  QSettings *settings = resource_manager::get_settings ();
422  ui->tabWidget->setCurrentIndex (settings->value ("settings/last_tab",
423  0).toInt ());
424  }
425  else
426  {
427  QHash <QString, QWidget*> tab_hash;
428  tab_hash["editor"] = ui->tab_editor;
429  tab_hash["editor_styles"] = ui->tab_editor_styles;
430  ui->tabWidget->setCurrentIndex (
431  ui->tabWidget->indexOf (tab_hash.value (tab)));
432  }
433 }
434 
435 #ifdef HAVE_QSCINTILLA
436 int
437 settings_dialog::get_valid_lexer_styles (QsciLexer *lexer, int styles[])
438 {
439  int max_style = 0;
440  int actual_style = 0;
441  while (actual_style < MaxStyleNumber && max_style < MaxLexerStyles)
442  {
443  if ((lexer->description (actual_style)) != "") // valid style
444  styles[max_style++] = actual_style;
445  actual_style++;
446  }
447  return max_style;
448 }
449 
450 void
451 settings_dialog::read_lexer_settings (QsciLexer *lexer, QSettings *settings)
452 {
453  lexer->readSettings (*settings);
454  int styles[MaxLexerStyles]; // array for saving valid styles
455  // (enum is not continuous)
456  int max_style = get_valid_lexer_styles (lexer, styles);
457  QGridLayout *style_grid = new QGridLayout ();
458  QVector<QLabel*> description (max_style);
459  QVector<QFontComboBox*> select_font (max_style);
460  QVector<QSpinBox*> font_size (max_style);
461  QVector<QCheckBox*> attrib_font (3 * max_style);
462  QVector<color_picker*> color (max_style);
463  QVector<color_picker*> bg_color (max_style);
464  int default_size = 10;
465  QFont default_font = QFont ();
466  int label_width;
467  QColor default_color = QColor ();
468  QColor dummy_color = QColor (255,0,255);
469 
470  for (int i = 0; i < max_style; i++) // create dialog elements for all styles
471  {
472  QString actual_name = lexer->description (styles[i]);
473  QFont actual_font = lexer->font (styles[i]);
474  description[i] = new QLabel (actual_name);
475  description[i]->setWordWrap (true);
476  label_width = 24*description[i]->fontMetrics ().averageCharWidth ();
477  description[i]->setMaximumSize (label_width,QWIDGETSIZE_MAX);
478  description[i]->setMinimumSize (label_width,1);
479  select_font[i] = new QFontComboBox ();
480  select_font[i]->setObjectName (actual_name+"_font");
481  select_font[i]->setMaximumSize (label_width,QWIDGETSIZE_MAX);
482  select_font[i]->setMinimumSize (label_width,1);
483  font_size[i] = new QSpinBox ();
484  font_size[i]->setObjectName (actual_name+"_size");
485  if (styles[i] == 0) // the default
486  {
487  select_font[i]->setCurrentFont (actual_font);
488  default_font = actual_font;
489  font_size[i]->setRange (6,24);
490  default_size = actual_font.pointSize ();
491  font_size[i]->setValue (default_size);
492  default_color = lexer->defaultPaper ();
493  bg_color[i] = new color_picker (default_color);
494  }
495  else // other styles
496  {
497  select_font[i]->setCurrentFont (actual_font);
498  if (actual_font.family () == default_font.family ())
499  select_font[i]->setEditText (lexer->description (0));
500  font_size[i]->setRange (-4,4);
501  font_size[i]->setValue (actual_font.pointSize ()-default_size);
502  font_size[i]->setToolTip (tr ("Difference to the default size"));
503  if (lexer->paper (styles[i]) == default_color)
504  bg_color[i] = new color_picker (dummy_color);
505  else
506  bg_color[i] = new color_picker (lexer->paper (styles[i]));
507  bg_color[i]->setToolTip
508  (tr ("Background color, pink (255,0,255) means default"));
509  }
510  attrib_font[0+3*i] = new QCheckBox (tr ("b", "short form for bold"));
511  attrib_font[1+3*i] = new QCheckBox (tr ("i", "short form for italic"));
512  attrib_font[2+3*i] = new QCheckBox (tr ("u", "short form for underlined"));
513  attrib_font[0+3*i]->setChecked (Qt::Checked && actual_font.bold ());
514  attrib_font[0+3*i]->setObjectName (actual_name+"_bold");
515  attrib_font[1+3*i]->setChecked (Qt::Checked && actual_font.italic ());
516  attrib_font[1+3*i]->setObjectName (actual_name+"_italic");
517  attrib_font[2+3*i]->setChecked (Qt::Checked && actual_font.underline ());
518  attrib_font[2+3*i]->setObjectName (actual_name+"_underline");
519  color[i] = new color_picker (lexer->color (styles[i]));
520  color[i]->setObjectName (actual_name+"_color");
521  bg_color[i]->setObjectName (actual_name+"_bg_color");
522  int column = 1;
523  style_grid->addWidget (description[i], i, column++);
524  style_grid->addWidget (select_font[i], i, column++);
525  style_grid->addWidget (font_size[i], i, column++);
526  style_grid->addWidget (attrib_font[0+3*i], i, column++);
527  style_grid->addWidget (attrib_font[1+3*i], i, column++);
528  style_grid->addWidget (attrib_font[2+3*i], i, column++);
529  style_grid->addWidget (color[i], i, column++);
530  style_grid->addWidget (bg_color[i], i, column++);
531  }
532  // place grid with elements into the tab
533  QScrollArea *scroll_area = new QScrollArea ();
534  QWidget *scroll_area_contents = new QWidget ();
535  scroll_area_contents->setObjectName (QString (lexer->language ())+"_styles");
536  scroll_area_contents->setLayout (style_grid);
537  scroll_area->setWidget (scroll_area_contents);
538  ui->tabs_editor_lexers->addTab (scroll_area,lexer->language ());
539 
540  ui->tabs_editor_lexers->setCurrentIndex (
541  settings->value ("settings/last_editor_styles_tab",0).toInt ());
542 }
543 #endif
544 
545 void
547 {
548 
549  QList<QColor> default_colors =
551  QStringList class_names = resource_manager::storage_class_names ();
552  QString class_chars = resource_manager::storage_class_chars ();
553  int nr_of_classes = class_chars.length ();
554 
555  QGridLayout *style_grid = new QGridLayout ();
556  QVector<QLabel*> description (nr_of_classes);
557  QVector<color_picker*> color (nr_of_classes);
558 
559  int column = 0;
560  int row = 0;
561  for (int i = 0; i < nr_of_classes; i++)
562  {
563  description[i] = new QLabel (" " + class_names.at (i));
564  description[i]->setAlignment (Qt::AlignRight);
565  QVariant default_var = default_colors.at (i);
566  QColor setting_color = settings->value ("workspaceview/color_"
567  + class_chars.mid (i,1),
568  default_var).value<QColor> ();
569  color[i] = new color_picker (setting_color);
570  color[i]->setObjectName ("color_"+class_chars.mid (i, 1));
571  color[i]->setMinimumSize (30, 10);
572  style_grid->addWidget (description[i], row, 3*column);
573  style_grid->addWidget (color[i], row, 3*column+1);
574  if (++column == 3)
575  {
576  style_grid->setColumnStretch (4*column, 10);
577  row++;
578  column = 0;
579  }
580  }
581 
582  // place grid with elements into the tab
583  ui->workspace_colors_box->setLayout (style_grid);
584 }
585 
586 void
588 {
589 
591  QStringList class_names = resource_manager::terminal_color_names ();
592  QString class_chars = resource_manager::terminal_color_chars ();
593  int nr_of_classes = class_chars.length ();
594 
595  QGridLayout *style_grid = new QGridLayout ();
596  QVector<QLabel*> description (nr_of_classes);
597  QVector<color_picker*> color (nr_of_classes);
598 
599  int column = 0;
600  int row = 0;
601  for (int i = 0; i < nr_of_classes; i++)
602  {
603  description[i] = new QLabel (" " + class_names.at (i));
604  description[i]->setAlignment (Qt::AlignRight);
605  QVariant default_var = default_colors.at (i);
606  QColor setting_color = settings->value ("terminal/color_"
607  + class_chars.mid (i,1),
608  default_var).value<QColor> ();
609  color[i] = new color_picker (setting_color);
610  color[i]->setObjectName ("terminal_color_"+class_chars.mid (i, 1));
611  color[i]->setMinimumSize (30, 10);
612  style_grid->addWidget (description[i], row, 2*column);
613  style_grid->addWidget (color[i], row, 2*column+1);
614  if (++column == 2)
615  {
616  style_grid->setColumnStretch (3*column, 10);
617  row++;
618  column = 0;
619  }
620  }
621 
622  // place grid with elements into the tab
623  ui->terminal_colors_box->setLayout (style_grid);
624 }
625 
626 void
628 {
629  QSettings *settings = resource_manager::get_settings ();
630  // FIXME: what should happen if settings is 0?
631 
632  // the icon set
633  QString widget_icon_set = "NONE";
634  if (ui->general_icon_letter->isChecked ())
635  widget_icon_set = "LETTER";
636  else if (ui->general_icon_graphic->isChecked ())
637  widget_icon_set = "GRAPHIC";
638  settings->setValue ("DockWidgets/widget_icon_set",widget_icon_set);
639 
640  // language
641  QString language = ui->comboBox_language->currentText ();
642  if (language == tr ("System setting"))
643  language = "SYSTEM";
644  settings->setValue ("language", language);
645 
646  // dock widget title bar
647  settings->setValue ("DockWidgets/widget_title_custom_style",
648  ui->cb_widget_custom_style->isChecked ());
649  settings->setValue ("DockWidgets/widget_title_3d",
650  ui->sb_3d_title->value ( ));
651  settings->setValue ("Dockwidgets/title_bg_color",
653  settings->setValue ("Dockwidgets/title_bg_color_active",
655  settings->setValue ("Dockwidgets/title_fg_color",
657  settings->setValue ("Dockwidgets/title_fg_color_active",
659 
660  // icon size
661  int icon_size = 0;
662  if (ui->icon_size_small->isChecked ())
663  icon_size = -1;
664  else if (ui->icon_size_large->isChecked ())
665  icon_size = 1;
666  settings->setValue ("toolbar_icon_size", icon_size);
667 
668  // promp to exit
669  settings->setValue ("prompt_to_exit", ui->cb_prompt_to_exit->isChecked ());
670 
671  // status bar
672  settings->setValue ( "show_status_bar", ui->cb_status_bar->isChecked ());
673 
674  // Octave startup
675  settings->setValue ("restore_octave_dir",
676  ui->cb_restore_octave_dir->isChecked ());
677  settings->setValue ("octave_startup_dir", ui->le_octave_dir->text ());
678 
679  //editor
680  settings->setValue ("useCustomFileEditor",
681  ui->useCustomFileEditor->isChecked ());
682  settings->setValue ("customFileEditor", ui->customFileEditor->text ());
683  settings->setValue ("editor/showLineNumbers",
684  ui->editor_showLineNumbers->isChecked ());
685  settings->setValue ("editor/highlightCurrentLine",
686  ui->editor_highlightCurrentLine->isChecked ());
687  settings->setValue ("editor/highlight_current_line_color",
689  settings->setValue ("editor/long_line_marker",
690  ui->editor_long_line_marker->isChecked ());
691  settings->setValue ("editor/long_line_column",
692  ui->editor_long_line_column->value ());
693  settings->setValue ("editor/code_folding",
694  ui->cb_code_folding->isChecked ());
695  settings->setValue ("editor/show_edit_status_bar",
696  ui->cb_edit_status_bar->isChecked ());
697  settings->setValue ("editor/codeCompletion",
698  ui->editor_codeCompletion->isChecked ());
699  settings->setValue ("editor/codeCompletion_threshold",
700  ui->editor_spinbox_ac_threshold->value ());
701  settings->setValue ("editor/codeCompletion_keywords",
702  ui->editor_checkbox_ac_keywords->isChecked ());
703  settings->setValue ("editor/codeCompletion_octave_builtins",
704  ui->editor_checkbox_ac_builtins->isChecked ());
705  settings->setValue ("editor/codeCompletion_octave_functions",
706  ui->editor_checkbox_ac_functions->isChecked ());
707  settings->setValue ("editor/codeCompletion_document",
708  ui->editor_checkbox_ac_document->isChecked ());
709  settings->setValue ("editor/codeCompletion_case",
710  ui->editor_checkbox_ac_case->isChecked ());
711  settings->setValue ("editor/codeCompletion_replace",
712  ui->editor_checkbox_ac_replace->isChecked ());
713  settings->setValue ("editor/show_white_space",
714  ui->editor_ws_checkbox->isChecked ());
715  settings->setValue ("editor/show_white_space_indent",
716  ui->editor_ws_indent_checkbox->isChecked ());
717  settings->setValue ("editor/show_eol_chars",
718  ui->cb_show_eol->isChecked ());
719  settings->setValue ("editor/show_hscroll_bar",
720  ui->cb_show_hscrollbar->isChecked ());
721  settings->setValue ("editor/default_eol_mode",
722  ui->combo_eol_mode->currentIndex ());
723  settings->setValue ("editor/auto_indent",
724  ui->editor_auto_ind_checkbox->isChecked ());
725  settings->setValue ("editor/tab_indents_line",
726  ui->editor_tab_ind_checkbox->isChecked ());
727  settings->setValue ("editor/backspace_unindents_line",
728  ui->editor_bs_unind_checkbox->isChecked ());
729  settings->setValue ("editor/show_indent_guides",
730  ui->editor_ind_guides_checkbox->isChecked ());
731  settings->setValue ("editor/indent_width",
732  ui->editor_ind_width_spinbox->value ());
733  settings->setValue ("editor/indent_uses_tabs",
734  ui->editor_ind_uses_tabs_checkbox->isChecked ());
735  settings->setValue ("editor/tab_width",
736  ui->editor_tab_width_spinbox->value ());
737  settings->setValue ("editor/longWindowTitle",
738  ui->editor_longWindowTitle->isChecked ());
739  settings->setValue ("editor/notebook_tab_width_min",
740  ui->editor_notebook_tab_width_min->value ());
741  settings->setValue ("editor/notebook_tab_width_max",
742  ui->editor_notebook_tab_width_max->value ());
743  settings->setValue ("editor/restoreSession",
744  ui->editor_restoreSession->isChecked ());
745  settings->setValue ("editor/create_new_file",
746  ui->editor_create_new_file->isChecked ());
747  settings->setValue ("editor/always_reload_changed_files",
748  ui->editor_reload_changed_files->isChecked ());
749  settings->setValue ("terminal/fontSize", ui->terminal_fontSize->value ());
750  settings->setValue ("terminal/fontName",
751  ui->terminal_fontName->currentFont ().family ());
752 
753  settings->setValue ("filesdockwidget/showFileSize",
754  ui->showFileSize->isChecked ());
755  settings->setValue ("filesdockwidget/showFileType",
756  ui->showFileType->isChecked ());
757  settings->setValue ("filesdockwidget/showLastModified",
758  ui->showLastModified->isChecked ());
759  settings->setValue ("filesdockwidget/showHiddenFiles",
760  ui->showHiddenFiles->isChecked ());
761  settings->setValue ("filesdockwidget/useAlternatingRowColors",
762  ui->useAlternatingRowColors->isChecked ());
763  settings->setValue ("filesdockwidget/sync_octave_directory",
764  ui->sync_octave_directory->isChecked ());
765  settings->setValue ("filesdockwidget/restore_last_dir",
766  ui->cb_restore_file_browser_dir->isChecked ());
767  settings->setValue ("filesdockwidget/startup_dir",
768  ui->le_file_browser_dir->text ());
769 
770 
771  settings->setValue ("news/allow_web_connection",
772  ui->checkbox_allow_web_connect->isChecked ());
773  settings->setValue ("useProxyServer", ui->useProxyServer->isChecked ());
774  settings->setValue ("proxyType", ui->proxyType->currentText ());
775  settings->setValue ("proxyHostName", ui->proxyHostName->text ());
776  settings->setValue ("proxyPort", ui->proxyPort->text ());
777  settings->setValue ("proxyUserName", ui->proxyUserName->text ());
778  settings->setValue ("proxyPassword", ui->proxyPassword->text ());
779  settings->setValue ("terminal/cursorBlinking",
780  ui->terminal_cursorBlinking->isChecked ());
781  settings->setValue ("terminal/cursorUseForegroundColor",
782  ui->terminal_cursorUseForegroundColor->isChecked ());
783  settings->setValue ("terminal/focus_after_command",
784  ui->terminal_focus_command->isChecked ());
785  settings->setValue ("terminal/print_debug_location",
786  ui->terminal_print_dbg_location->isChecked ());
787  settings->setValue ("terminal/history_buffer",
788  ui->terminal_history_buffer->value ());
789 
790  // the cursor
791  QString cursorType;
792  switch (ui->terminal_cursorType->currentIndex ())
793  {
794  case 0: cursorType = "ibeam"; break;
795  case 1: cursorType = "block"; break;
796  case 2: cursorType = "underline"; break;
797  }
798  settings->setValue ("terminal/cursorType", cursorType);
799 
800 #ifdef HAVE_QSCINTILLA
801  // editor styles: create lexer, get dialog contents, and write settings
802  QsciLexer *lexer;
803 #if defined (HAVE_LEXER_OCTAVE)
804  lexer = new QsciLexerOctave ();
805  write_lexer_settings (lexer,settings);
806  delete lexer;
807 #elif defined (HAVE_LEXER_MATLAB)
808  lexer = new QsciLexerMatlab ();
809  write_lexer_settings (lexer,settings);
810  delete lexer;
811 #endif
812  lexer = new QsciLexerCPP ();
813  write_lexer_settings (lexer,settings);
814  delete lexer;
815  lexer = new QsciLexerPerl ();
816  write_lexer_settings (lexer,settings);
817  delete lexer;
818  lexer = new QsciLexerBatch ();
819  write_lexer_settings (lexer,settings);
820  delete lexer;
821  lexer = new QsciLexerDiff ();
822  write_lexer_settings (lexer,settings);
823  delete lexer;
824  lexer = new QsciLexerBash ();
825  write_lexer_settings (lexer,settings);
826  delete lexer;
827  lexer = new octave_txt_lexer ();
828  write_lexer_settings (lexer,settings);
829  delete lexer;
830 #endif
831 
832  // Workspace
833  write_workspace_colors (settings);
834  // hide tool tips
835  settings->setValue ("workspaceview/hide_tool_tips",
836  ui->cb_hide_tool_tips->isChecked ());
837 
838  // Terminal
839  write_terminal_colors (settings);
840 
841  // shortcuts
842  settings->setValue ("shortcuts/prevent_readline_conflicts",
843  ui->cb_prevent_readline_conflicts->isChecked ());
844  int set = 0;
845  if (ui->rb_sc_set2->isChecked ())
846  set = 1;
847  settings->setValue ("shortcuts/set",set);
848  shortcut_manager::write_shortcuts (0, settings, closing); // 0: write both sets
849 
850  // settings dialog's geometry
851  settings->setValue ("settings/last_tab",ui->tabWidget->currentIndex ());
852  settings->setValue ("settings/geometry",saveGeometry ());
853 
854  settings->sync ();
855 }
856 
857 #ifdef HAVE_QSCINTILLA
858 void
859 settings_dialog::write_lexer_settings (QsciLexer *lexer, QSettings *settings)
860 {
861  QWidget *tab = ui->tabs_editor_lexers->
862  findChild <QWidget *>(QString (lexer->language ())+"_styles");
863  int styles[MaxLexerStyles]; // array for saving valid styles
864  // (enum is not continuous)
865  int max_style = get_valid_lexer_styles (lexer, styles);
866  QFontComboBox *select_font;
867  QSpinBox *font_size;
868  QCheckBox *attrib_font[3];
869  color_picker *color;
870  color_picker *bg_color;
871  int default_size = 10;
872  QFont default_font = QFont ("Courier New",10,-1,0);
873  QColor default_color = QColor ();
874  QColor dummy_color = QColor (255,0,255);
875 
876  for (int i = 0; i < max_style; i++) // get dialog elements and their contents
877  {
878  QString actual_name = lexer->description (styles[i]);
879  select_font = tab->findChild <QFontComboBox *>(actual_name+"_font");
880  font_size = tab->findChild <QSpinBox *>(actual_name+"_size");
881  attrib_font[0] = tab->findChild <QCheckBox *>(actual_name+"_bold");
882  attrib_font[1] = tab->findChild <QCheckBox *>(actual_name+"_italic");
883  attrib_font[2] = tab->findChild <QCheckBox *>(actual_name+"_underline");
884  color = tab->findChild <color_picker *>(actual_name+"_color");
885  bg_color = tab->findChild <color_picker *>(actual_name+"_bg_color");
886  QFont new_font = default_font;
887  if (select_font)
888  {
889  new_font = select_font->currentFont ();
890  if (styles[i] == 0)
891  default_font = new_font;
892  else if (select_font->currentText () == lexer->description (0))
893  new_font = default_font;
894  }
895  if (font_size)
896  {
897  if (styles[i] == 0)
898  {
899  default_size = font_size->value ();
900  new_font.setPointSize (font_size->value ());
901  }
902  else
903  new_font.setPointSize (font_size->value ()+default_size);
904  }
905  if (attrib_font[0])
906  new_font.setBold (attrib_font[0]->isChecked ());
907  if (attrib_font[1])
908  new_font.setItalic (attrib_font[1]->isChecked ());
909  if (attrib_font[2])
910  new_font.setUnderline (attrib_font[2]->isChecked ());
911  lexer->setFont (new_font,styles[i]);
912  if (styles[i] == 0)
913  lexer->setDefaultFont (new_font);
914  if (color)
915  lexer->setColor (color->color (),styles[i]);
916  if (bg_color)
917  {
918  if (styles[i] == 0)
919  {
920  default_color = bg_color->color ();
921  lexer->setPaper (default_color,styles[i]);
922  lexer->setDefaultPaper (default_color);
923  }
924  else
925  {
926  if (bg_color->color () == dummy_color)
927  lexer->setPaper (default_color,styles[i]);
928  else
929  lexer->setPaper (bg_color->color (),styles[i]);
930  }
931  }
932  }
933 
934  lexer->writeSettings (*settings);
935 
936  settings->setValue (
937  "settings/last_editor_styles_tab",ui->tabs_editor_lexers->currentIndex ());
938  settings->sync ();
939 }
940 #endif
941 
942 void
944 {
945 
946  QString class_chars = resource_manager::storage_class_chars ();
947  color_picker *color;
948 
949  for (int i = 0; i < class_chars.length (); i++)
950  {
951  color = ui->workspace_colors_box->findChild <color_picker *>(
952  "color_"+class_chars.mid (i,1));
953  if (color)
954  settings->setValue ("workspaceview/color_"+class_chars.mid (i,1),
955  color->color ());
956  }
957  settings->sync ();
958 }
959 
960 void
962 {
963  QString class_chars = resource_manager::terminal_color_chars ();
964  color_picker *color;
965 
966  for (int i = 0; i < class_chars.length (); i++)
967  {
968  color = ui->terminal_colors_box->findChild <color_picker *>(
969  "terminal_color_"+class_chars.mid (i,1));
970  if (color)
971  settings->setValue ("terminal/color_"+class_chars.mid (i,1),
972  color->color ());
973  }
974  settings->sync ();
975 }
976 
977 
978 // internal slots
979 
980 void
981 settings_dialog::button_clicked (QAbstractButton *button)
982 {
983  QDialogButtonBox::ButtonRole button_role = ui->button_box->buttonRole (button);
984 
985  if (button_role == QDialogButtonBox::ApplyRole ||
986  button_role == QDialogButtonBox::AcceptRole)
987  {
988  write_changed_settings (button_role == QDialogButtonBox::AcceptRole);
989  emit apply_new_settings ();
990  }
991 
992  if (button_role == QDialogButtonBox::RejectRole ||
993  button_role == QDialogButtonBox::AcceptRole)
994  close ();
995 }
996 
997 void
998 settings_dialog::get_dir (QLineEdit *line_edit, const QString& title)
999 {
1000  QString dir = QFileDialog::getExistingDirectory(this,
1001  title, line_edit->text (),
1002  QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
1003  line_edit->setText (dir);
1004 }
1005 
1006 void
1008 {
1009  get_dir (ui->le_octave_dir, tr ("Set Octave Startup Directory"));
1010 }
1011 
1012 void
1014 {
1015  get_dir (ui->le_file_browser_dir, tr ("Set File Browser Startup Directory"));
1016 }
1017 
1018 void
1020 {
1021  ui->cb_restore_file_browser_dir->setDisabled (disable);
1022 
1023  if (! disable)
1024  {
1025  ui->le_file_browser_dir->setDisabled (
1026  ui->cb_restore_file_browser_dir->isChecked ());
1027  ui->pb_file_browser_dir->setDisabled (
1028  ui->cb_restore_file_browser_dir->isChecked ());
1029  }
1030  else
1031  {
1032  ui->le_file_browser_dir->setDisabled (disable);
1033  ui->pb_file_browser_dir->setDisabled (disable);
1034  }
1035 }
1036 
1037 // slots for import/export of shortcut sets
1038 void
1040 {
1042 }
1043 
1044 void
1046 {
1048 }
1049 
1050 void
1052 {
1054 }
1055 
1056 void
1058 {
1060 }
QHBoxLayout * layout_widget_fgtitle
settings_dialog(QWidget *parent, const QString &desired_tab=QString())
QComboBox * comboBox_language
QCheckBox * terminal_cursorBlinking
QLineEdit * le_file_browser_dir
QCheckBox * cb_prevent_readline_conflicts
QRadioButton * general_icon_octave
QSpinBox * terminal_history_buffer
QCheckBox * editor_checkbox_ac_document
QCheckBox * editor_tab_ind_checkbox
QSpinBox * editor_ind_width_spinbox
QCheckBox * editor_highlightCurrentLine
QCheckBox * cb_hide_tool_tips
QCheckBox * useCustomFileEditor
QCheckBox * cb_show_hscrollbar
static QString terminal_color_chars(void)
QCheckBox * cb_restore_octave_dir
QCheckBox * editor_reload_changed_files
void set_disabled_pref_file_browser_dir(bool disable)
QPushButton * btn_export_shortcut_set1
QCheckBox * cb_widget_custom_style
QCheckBox * editor_checkbox_ac_replace
static QString get_gui_translation_dir(void)
QPushButton * btn_import_shortcut_set2
QCheckBox * editor_ws_indent_checkbox
static QStringList terminal_color_names(void)
Ui::settings_dialog * ui
QCheckBox * showLastModified
QRadioButton * general_icon_graphic
void read_terminal_colors(QSettings *settings)
QCheckBox * useAlternatingRowColors
QCheckBox * editor_bs_unind_checkbox
QTreeWidget * shortcuts_treewidget
QCheckBox * editor_auto_ind_checkbox
QCheckBox * editor_checkbox_ac_functions
QCheckBox * editor_showLineNumbers
QCheckBox * editor_create_new_file
color_picker * _widget_title_fg_color
static QList< QColor > storage_class_default_colors(void)
QCheckBox * editor_longWindowTitle
QHBoxLayout * layout_widget_fgtitle_active
color_picker * _widget_title_bg_color
QCheckBox * editor_ind_guides_checkbox
color_picker * _widget_title_fg_color_active
#define lexer
Definition: oct-parse.cc:170
void write_workspace_colors(QSettings *settings)
static void fill_treewidget(QTreeWidget *tree_view)
QCheckBox * editor_long_line_marker
QRadioButton * icon_size_normal
QHBoxLayout * layout_widget_bgtitle_active
QPushButton * btn_export_shortcut_set2
QFontComboBox * terminal_fontName
QHBoxLayout * layout_widget_bgtitle
static void import_export(bool import, int set)
QCheckBox * cb_restore_file_browser_dir
QSpinBox * editor_notebook_tab_width_max
QCheckBox * editor_ws_checkbox
QRadioButton * rb_sc_set1
QCheckBox * editor_checkbox_ac_keywords
QSpinBox * editor_tab_width_spinbox
QRadioButton * rb_sc_set2
QCheckBox * terminal_focus_command
QSpinBox * editor_spinbox_ac_threshold
QCheckBox * checkbox_allow_web_connect
static QSettings * get_settings(void)
QCheckBox * editor_checkbox_ac_builtins
QCheckBox * terminal_print_dbg_location
void setupUi(QDialog *settings_dialog)
void write_changed_settings(bool closing)
static QList< QColor > terminal_default_colors(void)
QPushButton * pb_octave_dir
QCheckBox * terminal_cursorUseForegroundColor
QTabWidget * tabs_editor_lexers
QCheckBox * editor_restoreSession
void show_tab(const QString &)
QCheckBox * editor_ind_uses_tabs_checkbox
QCheckBox * editor_checkbox_ac_case
static void write_shortcuts(int set, QSettings *settings, bool closing)
color_picker * _widget_title_bg_color_active
color_picker * _editor_current_line_color
QPushButton * pb_file_browser_dir
QSpinBox * editor_long_line_column
static QString storage_class_chars(void)
QColor color() const
Definition: color-picker.h:39
static QStringList storage_class_names(void)
QGroupBox * terminal_colors_box
QComboBox * terminal_cursorType
void write_terminal_colors(QSettings *settings)
QLineEdit * customFileEditor
void get_dir(QLineEdit *, const QString &)
void button_clicked(QAbstractButton *button)
QRadioButton * icon_size_small
QRadioButton * general_icon_letter
QCheckBox * editor_codeCompletion
QDialogButtonBox * button_box
QCheckBox * sync_octave_directory
void read_workspace_colors(QSettings *settings)
QGridLayout * editor_grid_current_line
QRadioButton * icon_size_large
QGroupBox * workspace_colors_box
QPushButton * btn_import_shortcut_set1
QCheckBox * cb_prompt_to_exit
QCheckBox * cb_edit_status_bar
QSpinBox * editor_notebook_tab_width_min