GNU Octave 7.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-2022 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
73namespace octave
74{
75
77 const QString& desired_tab)
78 : QDialog (p), Ui::settings_dialog (), m_octave_qobj (oct_qobj)
79 {
80 setupUi (this);
81
84
85 if (! settings)
86 {
87 QMessageBox msgBox
88 (QMessageBox::Warning, tr ("Octave Preferences"),
89 tr ("Unable to save preferences. Missing preferences file or unknown directory."));
90
91 msgBox.exec ();
92
93 return;
94 }
95
96 // look for available language files and the actual settings
97 QString qm_dir_name = rmgr.get_gui_translation_dir ();
98 QDir qm_dir (qm_dir_name);
99 QFileInfoList qm_files = qm_dir.entryInfoList (QStringList ("*.qm"),
100 QDir::Files | QDir::Readable, QDir::Name);
101
102 for (int i = 0; i < qm_files.length (); i++) // insert available languages
103 comboBox_language->addItem (qm_files.at (i).baseName ());
104 // System at beginning
105 comboBox_language->insertItem (0, tr ("System setting"));
106 comboBox_language->insertSeparator (1); // separator after System
107 QString language = settings->value (global_language.key,
108 global_language.def).toString ();
109 if (language == global_language.def.toString ())
110 language = tr ("System setting");
111 int selected = comboBox_language->findText (language);
112 if (selected >= 0)
113 comboBox_language->setCurrentIndex (selected);
114 else
115 comboBox_language->setCurrentIndex (0); // System is default
116
117 // Global style
118 QStringList styles = QStyleFactory::keys();
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 cb_system_icon_theme->setChecked (settings->value (global_icon_theme).toBool ());
141
142 // which icon has to be selected
143 QButtonGroup *icon_group = new QButtonGroup (this);
144 icon_group->addButton (general_icon_octave);
145 icon_group->addButton (general_icon_graphic);
146 icon_group->addButton (general_icon_letter);
147 QString widget_icon_set =
148 settings->value (dw_icon_set).toString ();
149 general_icon_octave->setChecked (true); // the default (if invalid set)
150 general_icon_octave->setChecked (widget_icon_set == "NONE");
151 general_icon_graphic->setChecked (widget_icon_set == "GRAPHIC");
152 general_icon_letter->setChecked (widget_icon_set == "LETTER");
153
154 // custom title bar of dock widget
155 QColor bg_color = settings->value (dw_title_bg_color).value<QColor> ();
156 m_widget_title_bg_color = new color_picker (bg_color);
157 m_widget_title_bg_color->setEnabled (false);
158 layout_widget_bgtitle->addWidget (m_widget_title_bg_color, 0);
159
160 connect (cb_widget_custom_style, &QCheckBox::toggled,
161 m_widget_title_bg_color, &color_picker::setEnabled);
162
163 QColor bg_color_active = settings->value (dw_title_bg_color_active).value<QColor> ();
164 m_widget_title_bg_color_active = new color_picker (bg_color_active);
165 m_widget_title_bg_color_active->setEnabled (false);
166 layout_widget_bgtitle_active->addWidget (m_widget_title_bg_color_active, 0);
167
168 connect (cb_widget_custom_style, &QCheckBox::toggled,
169 m_widget_title_bg_color_active, &color_picker::setEnabled);
170
171 QColor fg_color = settings->value (dw_title_fg_color).value<QColor> ();
172 m_widget_title_fg_color = new color_picker (fg_color);
173 m_widget_title_fg_color->setEnabled (false);
174 layout_widget_fgtitle->addWidget (m_widget_title_fg_color, 0);
175
176 connect (cb_widget_custom_style, &QCheckBox::toggled,
177 m_widget_title_fg_color, &color_picker::setEnabled);
178
179 QColor fg_color_active = settings->value (dw_title_fg_color_active).value<QColor> ();
180 m_widget_title_fg_color_active = new color_picker (fg_color_active);
181 m_widget_title_fg_color_active->setEnabled (false);
182 layout_widget_fgtitle_active->addWidget (m_widget_title_fg_color_active, 0);
183
184 connect (cb_widget_custom_style, &QCheckBox::toggled,
185 m_widget_title_fg_color_active, &color_picker::setEnabled);
186
187 sb_3d_title->setValue (settings->value (dw_title_3d.key,
188 dw_title_3d.def).toInt ());
189 cb_widget_custom_style->setChecked (settings->value (dw_title_custom_style).toBool ());
190
191 // Native file dialogs.
192 // FIXME: This preference can be deprecated / removed if all display
193 // managers, especially KDE, run those dialogs without hangs or
194 // delays from the start (bug #54607).
195 cb_use_native_file_dialogs->setChecked (settings->value (global_use_native_dialogs).toBool ());
196
197 // Cursor blinking: consider old terminal related setting if not yet set
198 // FIXME: This pref. can be deprecated / removed if Qt adds support for
199 // getting the cursor blink preferences from all OS environments
200 if (settings->contains (global_cursor_blinking.key))
201 {
202 // Preference exists, read its value
203 cb_cursor_blinking->setChecked (settings->value
205 }
206 else
207 {
208 // Pref. does not exist, so take old terminal related pref.
209 cb_cursor_blinking->setChecked (settings->value
211 }
212
213 // focus follows mouse
214 cb_focus_follows_mouse->setChecked (
215 settings->value (dw_focus_follows_mouse).toBool ());
216
217 // prompt on exit
218 cb_prompt_to_exit->setChecked (
220
221 // Main status bar
222 cb_status_bar->setChecked (
224
225 // Octave startup
226 cb_restore_octave_dir->setChecked (
228 le_octave_dir->setText (settings->value (global_ov_startup_dir.key,
229 global_ov_startup_dir.def).toString ());
230
231 connect (pb_octave_dir, &QPushButton::pressed,
233
234 //
235 // editor
236 //
237 useCustomFileEditor->setChecked (
239 customFileEditor->setText (
241 editor_showLineNumbers->setChecked (settings->value (ed_show_line_numbers).toBool ());
242 editor_linenr_size->setValue (settings->value (ed_line_numbers_size).toInt ());
243
244 rmgr.combo_encoding (editor_combo_encoding);
245
246 editor_highlightCurrentLine->setChecked (settings->value (ed_highlight_current_line).toBool ());
247 editor_long_line_marker->setChecked (settings->value (ed_long_line_marker).toBool ());
248 bool long_line =
249 settings->value (ed_long_line_marker_line).toBool ();
250 editor_long_line_marker_line->setChecked (long_line);
251 bool long_back =
252 settings->value (ed_long_line_marker_background).toBool ();
253 editor_long_line_marker_background->setChecked (long_back);
254 if (! (long_line || long_back))
255 editor_long_line_marker_line->setChecked (true);
256 editor_long_line_column->setValue (settings->value (ed_long_line_column).toInt ());
257 editor_break_checkbox->setChecked (settings->value (ed_break_lines).toBool ());
258 editor_break_comments_checkbox->setChecked (settings->value (ed_break_lines_comments).toBool ());
259 editor_wrap_checkbox->setChecked (settings->value (ed_wrap_lines).toBool ());
260 cb_edit_status_bar->setChecked (settings->value (ed_show_edit_status_bar).toBool ());
261 cb_edit_tool_bar->setChecked (settings->value (ed_show_toolbar).toBool ());
262 cb_code_folding->setChecked (settings->value (ed_code_folding).toBool ());
263 editor_highlight_all_occurrences->setChecked (settings->value (ed_highlight_all_occurrences).toBool ());
264
265 editor_auto_endif->setCurrentIndex (settings->value (ed_auto_endif).toInt () );
266 editor_codeCompletion->setChecked (settings->value (ed_code_completion).toBool ());
267 editor_spinbox_ac_threshold->setValue (settings->value (ed_code_completion_threshold).toInt ());
268 editor_checkbox_ac_keywords->setChecked (settings->value (ed_code_completion_keywords).toBool ());
269 editor_checkbox_ac_builtins->setEnabled (editor_checkbox_ac_keywords->isChecked ());
270 editor_checkbox_ac_functions->setEnabled (editor_checkbox_ac_keywords->isChecked ());
271 editor_checkbox_ac_builtins->setChecked (settings->value (ed_code_completion_octave_builtins).toBool ());
272 editor_checkbox_ac_functions->setChecked (settings->value (ed_code_completion_octave_functions).toBool ());
273 editor_checkbox_ac_document->setChecked (settings->value (ed_code_completion_document).toBool ());
274 editor_checkbox_ac_case->setChecked (settings->value (ed_code_completion_case).toBool ());
275 editor_checkbox_ac_replace->setChecked (settings->value (ed_code_completion_replace).toBool ());
276 editor_ws_checkbox->setChecked (settings->value (ed_show_white_space).toBool ());
277 editor_ws_indent_checkbox->setChecked (settings->value (ed_show_white_space_indent).toBool ());
278 cb_show_eol->setChecked (settings->value (ed_show_eol_chars).toBool ());
279 cb_show_hscrollbar->setChecked (settings->value (ed_show_hscroll_bar).toBool ());
280
281 for (int i = 0; i < ed_tab_position_names.length (); i++)
282 editor_combox_tab_pos->insertItem (i,
283 tr (ed_tab_position_names.at (i).toStdString ().data ()));
284 editor_combox_tab_pos->setCurrentIndex
285 (settings->value (ed_tab_position).toInt ());
286
287 editor_cb_tabs_rotated->setChecked (settings->value (ed_tabs_rotated).toBool ());
288 editor_sb_tabs_max_width->setValue (settings->value (ed_tabs_max_width).toInt ());
289
290 int selected_comment_string, selected_uncomment_string;
291
292 if (settings->contains (ed_comment_str.key)) // new version (radio buttons)
293 selected_comment_string = settings->value (ed_comment_str).toInt ();
294 else // old version (combo box)
295 selected_comment_string = settings->value (ed_comment_str_old.key, ed_comment_str.def).toInt ();
296
297 selected_uncomment_string = settings->value (ed_uncomment_str).toInt ();
298
299 for (int i = 0; i < ed_comment_strings_count; i++)
300 {
301 m_rb_comment_strings[i] = new QRadioButton ();
302 m_rb_uncomment_strings[i] = new QCheckBox ();
303
304 connect (m_rb_comment_strings[i], &QRadioButton::clicked,
305 m_rb_uncomment_strings[i], &QCheckBox::setChecked);
306 connect (m_rb_comment_strings[i], &QRadioButton::toggled,
307 m_rb_uncomment_strings[i], &QCheckBox::setDisabled);
308
309 m_rb_comment_strings[i]->setText (ed_comment_strings.at(i));
310 m_rb_comment_strings[i]->setChecked (i == selected_comment_string);
311 layout_comment_strings->addWidget (m_rb_comment_strings[i]);
312
313 m_rb_uncomment_strings[i]->setText (ed_comment_strings.at(i));
314 m_rb_uncomment_strings[i]->setAutoExclusive (false);
315 m_rb_uncomment_strings[i]->setChecked ( 1 << i & selected_uncomment_string);
316 layout_uncomment_strings->addWidget (m_rb_uncomment_strings[i]);
317 }
318
319
320 combo_eol_mode->setCurrentIndex (settings->value (ed_default_eol_mode).toInt ());
321 editor_auto_ind_checkbox->setChecked (settings->value (ed_auto_indent).toBool ());
322 editor_tab_ind_checkbox->setChecked (settings->value (ed_tab_indents_line).toBool ());
323 editor_bs_unind_checkbox->setChecked (settings->value (ed_backspace_unindents_line).toBool ());
324 editor_ind_guides_checkbox->setChecked (settings->value (ed_show_indent_guides).toBool ());
325 editor_ind_width_spinbox->setValue (settings->value (ed_indent_width).toInt ());
326 editor_ind_uses_tabs_checkbox->setChecked (settings->value (ed_indent_uses_tabs).toBool ());
327 editor_tab_width_spinbox->setValue (settings->value (ed_tab_width).toInt ());
328 editor_restoreSession->setChecked (settings->value (ed_restore_session).toBool ());
329 editor_create_new_file->setChecked (settings->value (ed_create_new_file).toBool ());
330 editor_reload_changed_files->setChecked (settings->value (ed_always_reload_changed_files).toBool ());
331 editor_force_newline->setChecked (settings->value (ed_force_newline).toBool ());
332 editor_remove_trailing_spaces->setChecked (settings->value (ed_rm_trailing_spaces).toBool ());
333 editor_hiding_closes_files->setChecked (settings->value (ed_hiding_closes_files).toBool ());
334 editor_show_dbg_file->setChecked (settings->value (ed_show_dbg_file).toBool ());
335
336 // terminal
337 QString default_font = settings->value (global_mono_font).toString ();
338 terminal_fontName->setCurrentFont (QFont (settings->value (cs_font.key, default_font).toString ()));
339 terminal_fontSize->setValue (settings->value (cs_font_size).toInt ());
340 terminal_history_buffer->setValue (settings->value (cs_hist_buffer).toInt ());
341 terminal_cursorUseForegroundColor->setChecked (settings->value (cs_cursor_use_fgcol).toBool ());
342 terminal_focus_command->setChecked (settings->value (cs_focus_cmd).toBool ());
343 terminal_print_dbg_location->setChecked (settings->value (cs_dbg_location).toBool ());
344
345 QString cursor_type
346 = settings->value (cs_cursor).toString ();
347
348 QStringList items;
349 items << QString ("0") << QString ("1") << QString ("2");
350 terminal_cursorType->addItems (items);
351 terminal_cursorType->setItemText (0, tr ("IBeam Cursor"));
352 terminal_cursorType->setItemText (1, tr ("Block Cursor"));
353 terminal_cursorType->setItemText (2, tr ("Underline Cursor"));
354
355 for (unsigned int i = 0; i < cs_cursor_types.size (); i++)
356 {
357 if (cursor_type.toStdString () == cs_cursor_types[i])
358 {
359 terminal_cursorType->setCurrentIndex (i);
360 break;
361 }
362 }
363
365
366 // file browser
367 connect (sync_octave_directory, &QCheckBox::toggled,
369
370 sync_octave_directory->setChecked (settings->value (fb_sync_octdir).toBool ());
371 cb_restore_file_browser_dir->setChecked (settings->value (fb_restore_last_dir).toBool ());
372 le_file_browser_dir->setText (settings->value (fb_startup_dir.key).toString ());
373
374 connect (pb_file_browser_dir, &QPushButton::pressed,
376
377 le_file_browser_extensions->setText (settings->value (fb_txt_file_ext).toString ());
378
379 checkbox_allow_web_connect->setChecked (settings->value (nr_allow_connection).toBool ());
380
381 // Proxy
382 bool use_proxy = settings->value (global_use_proxy.key, global_use_proxy.def).toBool ();
383 use_proxy_server->setChecked (use_proxy);
384 // Fill combo box and activate current one
385 QString proxy_type_string = settings->value (global_proxy_type.key, global_proxy_type.def).toString ();
386 proxy_type->addItems (global_proxy_all_types);
387 for (int i = 0; i < global_proxy_all_types.length (); i++)
388 {
389 if (proxy_type->itemText (i) == proxy_type_string)
390 {
391 proxy_type->setCurrentIndex (i);
392 break;
393 }
394 }
395 // Fill all line edits
396 proxy_host_name->setText (settings->value (global_proxy_host.key, global_proxy_host.def).toString ());
397 proxy_port->setText (settings->value (global_proxy_port.key, global_proxy_port.def).toString ());
398 proxy_username->setText (settings->value (global_proxy_user.key, global_proxy_user.def).toString ());
399 proxy_password->setText (settings->value (global_proxy_pass.key, global_proxy_pass.def).toString ());
400 // Connect relevant signals for dis-/enabling some elements
401 connect (proxy_type, QOverload<int>::of (&QComboBox::currentIndexChanged),
403 connect (use_proxy_server, &QCheckBox::toggled,
405 // Check whehter line edits have to be enabled
407
408 // Workspace
410
411 // variable editor
412 varedit_columnWidth->setValue (settings->value (ve_column_width).toInt ());
413 varedit_rowHeight->setValue (settings->value (ve_row_height).toInt ());
414
415 varedit_font->setCurrentFont (QFont (settings->value (ve_font_name.key,
416 settings->value (cs_font.key, default_font)).toString ()));
417 varedit_fontSize->setValue (settings->value (ve_font_size).toInt ());
418 connect (varedit_useTerminalFont, &QCheckBox::toggled,
419 varedit_font, &QFontComboBox::setDisabled);
420 connect (varedit_useTerminalFont, &QCheckBox::toggled,
421 varedit_fontSize, &QSpinBox::setDisabled);
422 varedit_useTerminalFont->setChecked (settings->value (ve_use_terminal_font).toBool ());
423 varedit_font->setDisabled (varedit_useTerminalFont->isChecked ());
424 varedit_fontSize->setDisabled (varedit_useTerminalFont->isChecked ());
425
426 varedit_alternate->setChecked (settings->value (ve_alternate_rows).toBool ());
427
428 // variable editor colors
430
431 // shortcuts
432
434
435 cb_prevent_readline_conflicts->setChecked (
437 sc_prevent_rl_conflicts.def).toBool ());
438 cb_prevent_readline_conflicts_menu->setChecked (
441
442 // initialize the tree view with all shortcut data
443 scmgr.fill_treewidget (shortcuts_treewidget);
444
445 // connect the buttons for import/export of the shortcut sets
446 connect (btn_import_shortcut_set, &QPushButton::clicked,
448
449 connect (btn_export_shortcut_set, &QPushButton::clicked,
451
452 connect (btn_default_shortcut_set, &QPushButton::clicked,
454
455#if defined (HAVE_QSCINTILLA)
456
457 int ed_mode = settings->value (ed_color_mode).toInt ();
458
459 QCheckBox *cb_color_mode = new QCheckBox (settings_color_modes,
460 group_box_editor_styles);
461 cb_color_mode->setToolTip (settings_color_modes_tooltip);
462 cb_color_mode->setChecked (ed_mode > 0);
463 cb_color_mode->setObjectName (ed_color_mode.key);
464
465 QPushButton *pb_reload_default_colors = new QPushButton (settings_reload_styles);
466 pb_reload_default_colors->setToolTip (settings_reload_styles_tooltip);
467
468 editor_style_grid->addWidget (cb_color_mode, 0, 0);
469 editor_style_grid->addWidget (pb_reload_default_colors, 0, 1);
470 editor_style_grid->addItem (new QSpacerItem (5, 5, QSizePolicy::Expanding), 0, 2);
471
472
473
474 // update colors depending on second theme selection
475 connect (cb_color_mode, &QCheckBox::stateChanged,
477 connect (pb_reload_default_colors, &QPushButton::clicked,
479
480 // finally read the lexer colors using the update slot
482
483#endif
484
485 // which tab is the desired one?
486 show_tab (desired_tab);
487
488 // connect button box signal
489 connect (button_box, &QDialogButtonBox::clicked,
491
492 // restore last geometry
493 if (settings->contains (sd_geometry.key))
494 restoreGeometry (settings->value (sd_geometry).toByteArray ());
495 else
496 setGeometry (QRect (10, 50, 1000, 600));
497 }
498
499 void settings_dialog::show_tab (const QString& tab)
500 {
501 if (tab.isEmpty ())
502 {
505 if (settings)
506 tabWidget->setCurrentIndex (settings->value (sd_last_tab).toInt ());
507 }
508 else
509 {
510 QHash <QString, QWidget *> tab_hash;
511 tab_hash["editor"] = tab_editor;
512 tab_hash["editor_styles"] = tab_editor;
513 tabWidget->setCurrentIndex (tabWidget->indexOf (tab_hash.value (tab)));
514 if (tab == "editor_styles")
515 tab_editor_scroll_area->ensureWidgetVisible (group_box_editor_styles);
516 }
517 }
518
520 {
521 get_dir (le_octave_dir, tr ("Set Octave Startup Directory"));
522 }
523
525 {
526 get_dir (le_file_browser_dir, tr ("Set File Browser Startup Directory"));
527 }
528
529 void settings_dialog::get_dir (QLineEdit *line_edit, const QString& title)
530 {
531 // FIXME: Remove, if for all common KDE versions (bug #54607) is resolved.
532 int opts = QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks;
535 if (! settings->value (global_use_native_dialogs).toBool ())
536 opts |= QFileDialog::DontUseNativeDialog;
537
538 QString dir = QFileDialog::getExistingDirectory
539 (this, title, line_edit->text (), QFileDialog::Option (opts));
540
541 line_edit->setText (dir);
542 }
543
544 void settings_dialog::button_clicked (QAbstractButton *button)
545 {
546 QDialogButtonBox::ButtonRole button_role = button_box->buttonRole (button);
547
548 if (button_role == QDialogButtonBox::ApplyRole
549 || button_role == QDialogButtonBox::AcceptRole)
550 {
551 write_changed_settings (button_role == QDialogButtonBox::AcceptRole);
552 emit apply_new_settings ();
553 }
554
555 if (button_role == QDialogButtonBox::RejectRole
556 || button_role == QDialogButtonBox::AcceptRole)
557 close ();
558 }
559
561 {
562 cb_restore_file_browser_dir->setDisabled (disable);
563
564 if (! disable)
565 {
566 le_file_browser_dir->setDisabled (cb_restore_file_browser_dir->isChecked ());
567 pb_file_browser_dir->setDisabled (cb_restore_file_browser_dir->isChecked ());
568 }
569 else
570 {
571 le_file_browser_dir->setDisabled (disable);
572 pb_file_browser_dir->setDisabled (disable);
573 }
574 }
575
576 // slot for updating enabled state of proxy settings
578 {
579 bool use_proxy = use_proxy_server->isChecked ();
580
581 bool manual = false;
582 for (int i = 0; i < global_proxy_manual_types.length (); i++)
583 {
584 if (proxy_type->currentIndex () == global_proxy_manual_types.at (i))
585 {
586 manual = true;
587 break;
588 }
589 }
590
591 proxy_type->setEnabled (use_proxy);
592 proxy_host_name_label->setEnabled (use_proxy && manual);
593 proxy_host_name->setEnabled (use_proxy && manual);
594 proxy_port_label->setEnabled (use_proxy && manual);
595 proxy_port->setEnabled (use_proxy && manual);
596 proxy_username_label->setEnabled (use_proxy && manual);
597 proxy_username->setEnabled (use_proxy && manual);
598 proxy_password_label->setEnabled (use_proxy && manual);
599 proxy_password->setEnabled (use_proxy && manual);
600 }
601
602 // slots for import/export of shortcut sets
603
605 {
607
609 }
610
612 {
614
616 }
617
619 {
621
623 }
624
626 {
627#if defined (HAVE_QSCINTILLA)
628
629 QCheckBox *cb_color_mode
630 = group_box_editor_styles->findChild <QCheckBox *> (ed_color_mode.key);
631
632 int m = 0;
633 if (cb_color_mode && cb_color_mode->isChecked ())
634 m = 1;
635
636 // editor styles: create lexer, read settings, and
637 // create or update dialog elements
639
642
643# if defined (HAVE_LEXER_OCTAVE)
644 lexer = new QsciLexerOctave ();
645 update_lexer (lexer, settings, m, def);
646 delete lexer;
647# elif defined (HAVE_LEXER_MATLAB)
648 lexer = new QsciLexerMatlab ();
649 update_lexer (lexer, settings, m, def);
650 delete lexer;
651# endif
652
653 lexer = new QsciLexerCPP ();
654 update_lexer (lexer, settings, m, def);
655 delete lexer;
656
657 lexer = new QsciLexerJava ();
658 update_lexer (lexer, settings, m, def);
659 delete lexer;
660
661 lexer = new QsciLexerPerl ();
662 update_lexer (lexer, settings, m, def);
663 delete lexer;
664
665 lexer = new QsciLexerBatch ();
666 update_lexer (lexer, settings, m, def);
667 delete lexer;
668
669 lexer = new QsciLexerDiff ();
670 update_lexer (lexer, settings, m, def);
671 delete lexer;
672
673 lexer = new QsciLexerBash ();
674 update_lexer (lexer, settings, m, def);
675 delete lexer;
676
677 lexer = new octave_txt_lexer ();
678 update_lexer (lexer, settings, m, def);
679 delete lexer;
680
681#else
682
683 octave_unused_parameter (def);
684
685#endif
686 }
687
688#if defined (HAVE_QSCINTILLA)
689
691 int mode, int def)
692 {
693 // Get lexer settings and copy from default settings if not yet
694 // available in normal settings file
696 rmgr.read_lexer_settings (lexer, settings, mode, def);
697
698 // When reloading default styles, the style tabs do already exists.
699 // Otherwise, check if they exist or not.
700 QString lexer_name = lexer->language ();
701
702 int index = -1;
703 for (int i = 0; i < tabs_editor_lexers->count (); i++)
704 {
705 if (tabs_editor_lexers->tabText (i) == lexer_name)
706 {
707 index = i;
708 break;
709 }
710 }
711
712 if (index == -1)
713 {
714 // This is not an update, call get_lexer_settings for building
715 // the settings tab
717 return;
718 }
719
720 // Update the styles elements in all styles
721 int styles[ed_max_lexer_styles]; // array for saving valid styles
722 int max_style = rmgr.get_valid_lexer_styles (lexer, styles);
723 QWidget *tab = tabs_editor_lexers->widget (index);
724 int default_size = 0;
725 QString default_family;
726
727 for (int i = 0; i < max_style; i++) // create dialog elements for all styles
728 {
729 QString actual_name = lexer->description (styles[i]);
730 color_picker *bg_color
731 = tab->findChild <color_picker *> (actual_name + "_bg_color");
732 if (bg_color)
733 {
734 // Update
735 if (styles[i] == 0)
736 bg_color->set_color (lexer->defaultPaper ());
737 else
738 {
739 if (lexer->paper (styles[i]) == lexer->defaultPaper ())
741 else
742 bg_color->set_color (lexer->paper (styles[i]));
743 }
744 }
745
746 color_picker *color = tab->findChild <color_picker *> (actual_name + "_color");
747 if (color)
748 color->set_color (lexer->color (styles[i]));
749
750 QFont font = lexer->font (styles[i]);
751
752 QCheckBox *cb = tab->findChild <QCheckBox *> (actual_name + "_bold");
753 if (cb)
754 cb->setChecked (font.bold ());
755 cb = tab->findChild <QCheckBox *> (actual_name + "_italic");
756 if (cb)
757 cb->setChecked (font.italic ());
758 cb = tab->findChild <QCheckBox *> (actual_name + "_underline");
759 if (cb)
760 cb->setChecked (font.underline ());
761
762 QFontComboBox *fcb = tab->findChild <QFontComboBox *> (actual_name + "_font");
763 if (fcb)
764 {
765 if (styles[i] == 0)
766 {
767 default_family = font.family ();
768 fcb->setEditText (default_family);
769 }
770 else
771 {
772 if (font.family () == default_family)
773 fcb->setEditText (lexer->description (0));
774 else
775 fcb->setEditText (font.family ());
776 }
777 }
778 QSpinBox *fs = tab->findChild <QSpinBox *> (actual_name + "_size");
779 if (fs)
780 {
781 if (styles[i] == 0)
782 {
783 default_size = font.pointSize ();
784 fs->setValue (default_size);
785 }
786 else
787 fs->setValue (font.pointSize () - default_size);
788 }
789 }
790
791 }
792
795 {
797
798 int styles[ed_max_lexer_styles]; // array for saving valid styles
799 // (enum is not continuous)
800 int max_style = rmgr.get_valid_lexer_styles (lexer, styles);
801 QGridLayout *style_grid = new QGridLayout ();
802 QVector<QLabel *> description (max_style);
803 QVector<QFontComboBox *> select_font (max_style);
804 QVector<QSpinBox *> font_size (max_style);
805 QVector<QCheckBox *> attrib_font (3 * max_style);
806 QVector<color_picker *> color (max_style);
807 QVector<color_picker *> bg_color (max_style);
808 int default_size = 10;
809 QFont default_font = QFont ();
810 int label_width;
811 QColor default_color = QColor ();
812
813 for (int i = 0; i < max_style; i++) // create dialog elements for all styles
814 {
815 QString actual_name = lexer->description (styles[i]);
816 QFont actual_font = lexer->font (styles[i]);
817 description[i] = new QLabel (actual_name);
818 description[i]->setWordWrap (true);
819 label_width = 24*description[i]->fontMetrics ().averageCharWidth ();
820 description[i]->setMaximumSize (label_width, QWIDGETSIZE_MAX);
821 description[i]->setMinimumSize (label_width, 1);
822 select_font[i] = new QFontComboBox ();
823 select_font[i]->setObjectName (actual_name + "_font");
824 select_font[i]->setMaximumSize (label_width, QWIDGETSIZE_MAX);
825 select_font[i]->setMinimumSize (label_width, 1);
826 font_size[i] = new QSpinBox ();
827 font_size[i]->setObjectName (actual_name + "_size");
828 if (styles[i] == 0) // the default
829 {
830 select_font[i]->setCurrentFont (actual_font);
831 default_font = actual_font;
832 font_size[i]->setRange (6, 24);
833 default_size = actual_font.pointSize ();
834 font_size[i]->setValue (default_size);
835 default_color = lexer->defaultPaper ();
836 bg_color[i] = new color_picker (default_color);
837 }
838 else // other styles
839 {
840 select_font[i]->setCurrentFont (actual_font);
841 if (actual_font.family () == default_font.family ())
842 select_font[i]->setEditText (lexer->description (0));
843 font_size[i]->setRange (-4, 4);
844 font_size[i]->setValue (actual_font.pointSize ()-default_size);
845 font_size[i]->setToolTip (QObject::tr ("Difference to the default size"));
846 if (lexer->paper (styles[i]) == default_color)
847 bg_color[i] = new color_picker (settings_color_no_change);
848 else
849 bg_color[i] = new color_picker (lexer->paper (styles[i]));
850 bg_color[i]->setToolTip
851 (QObject::tr ("Background color, pink (255, 0, 255) means default"));
852 }
853 attrib_font[0+3*i] = new QCheckBox (QObject::tr ("b", "short form for bold"));
854 attrib_font[1+3*i] = new QCheckBox (QObject::tr ("i", "short form for italic"));
855 attrib_font[2+3*i] = new QCheckBox (QObject::tr ("u", "short form for underlined"));
856 attrib_font[0+3*i]->setChecked (actual_font.bold ());
857 attrib_font[0+3*i]->setObjectName (actual_name + "_bold");
858 attrib_font[1+3*i]->setChecked (actual_font.italic ());
859 attrib_font[1+3*i]->setObjectName (actual_name + "_italic");
860 attrib_font[2+3*i]->setChecked (actual_font.underline ());
861 attrib_font[2+3*i]->setObjectName (actual_name + "_underline");
862 color[i] = new color_picker (lexer->color (styles[i]));
863 color[i]->setObjectName (actual_name + "_color");
864 bg_color[i]->setObjectName (actual_name + "_bg_color");
865 int column = 1;
866 style_grid->addWidget (description[i], i, column++);
867 style_grid->addWidget (select_font[i], i, column++);
868 style_grid->addWidget (font_size[i], i, column++);
869 style_grid->addWidget (attrib_font[0+3*i], i, column++);
870 style_grid->addWidget (attrib_font[1+3*i], i, column++);
871 style_grid->addWidget (attrib_font[2+3*i], i, column++);
872 style_grid->addWidget (color[i], i, column++);
873 style_grid->addWidget (bg_color[i], i, column++);
874 }
875
876 // place grid with elements into the tab
877 QScrollArea *scroll_area = new QScrollArea ();
878 QWidget *scroll_area_contents = new QWidget ();
879 scroll_area_contents->setObjectName (QString (lexer->language ()) + "_styles");
880 scroll_area_contents->setLayout (style_grid);
881 scroll_area->setWidget (scroll_area_contents);
882 tabs_editor_lexers->addTab (scroll_area, lexer->language ());
883
884 tabs_editor_lexers->setCurrentIndex (settings->value (sd_last_editor_styles_tab).toInt ());
885 }
886
889 {
891
892 QCheckBox *cb_color_mode
893 = group_box_editor_styles->findChild <QCheckBox *> (ed_color_mode.key);
894 int mode = 0;
895 if (cb_color_mode && cb_color_mode->isChecked ())
896 mode = 1;
897
898 settings->setValue (ed_color_mode.key, mode);
899
900 QWidget *tab = tabs_editor_lexers->
901 findChild <QWidget *> (QString (lexer->language ()) + "_styles");
902 int styles[ed_max_lexer_styles]; // array for saving valid styles
903 // (enum is not continuous)
904 int max_style = rmgr.get_valid_lexer_styles (lexer, styles);
905 QFontComboBox *select_font;
906 QSpinBox *font_size;
907 QCheckBox *attrib_font[3];
908 color_picker *color;
909 color_picker *bg_color;
910 int default_size = 10;
911
912 QString default_font_name
913 = settings->value (global_mono_font).toString ();
914 QFont default_font = QFont (default_font_name, 10, -1, 0);
915 QColor default_color = QColor ();
916
917 for (int i = 0; i < max_style; i++) // get dialog elements and their contents
918 {
919 QString actual_name = lexer->description (styles[i]);
920 select_font = tab->findChild <QFontComboBox *> (actual_name + "_font");
921 font_size = tab->findChild <QSpinBox *> (actual_name + "_size");
922 attrib_font[0] = tab->findChild <QCheckBox *> (actual_name + "_bold");
923 attrib_font[1] = tab->findChild <QCheckBox *> (actual_name + "_italic");
924 attrib_font[2] = tab->findChild <QCheckBox *> (actual_name + "_underline");
925 color = tab->findChild <color_picker *> (actual_name + "_color");
926 bg_color = tab->findChild <color_picker *> (actual_name + "_bg_color");
927 QFont new_font = default_font;
928 if (select_font)
929 {
930 new_font = select_font->currentFont ();
931 if (styles[i] == 0)
932 default_font = new_font;
933 else if (select_font->currentText () == lexer->description (0))
934 new_font = default_font;
935 }
936 if (font_size)
937 {
938 if (styles[i] == 0)
939 {
940 default_size = font_size->value ();
941 new_font.setPointSize (font_size->value ());
942 }
943 else
944 new_font.setPointSize (font_size->value ()+default_size);
945 }
946 if (attrib_font[0])
947 new_font.setBold (attrib_font[0]->isChecked ());
948 if (attrib_font[1])
949 new_font.setItalic (attrib_font[1]->isChecked ());
950 if (attrib_font[2])
951 new_font.setUnderline (attrib_font[2]->isChecked ());
952 lexer->setFont (new_font, styles[i]);
953 if (styles[i] == 0)
954 lexer->setDefaultFont (new_font);
955 if (color)
956 lexer->setColor (color->color (), styles[i]);
957 if (bg_color)
958 {
959 if (styles[i] == 0)
960 {
961 default_color = bg_color->color ();
962 lexer->setPaper (default_color, styles[i]);
963 lexer->setDefaultPaper (default_color);
964 }
965 else
966 {
967 if (bg_color->color () == settings_color_no_change)
968 lexer->setPaper (default_color, styles[i]);
969 else
970 lexer->setPaper (bg_color->color (), styles[i]);
971 }
972 }
973 }
974
975 const std::string group =
976 QString ("Scintilla" + settings_color_modes_ext[mode]).toStdString ();
977
978 lexer->writeSettings (*settings, group.c_str ());
979
981 tabs_editor_lexers->currentIndex ());
982 settings->sync ();
983 }
984
985#endif
986
988 {
991
992 // the icon set
993 QString widget_icon_set = "NONE";
994 if (general_icon_letter->isChecked ())
995 widget_icon_set = "LETTER";
996 else if (general_icon_graphic->isChecked ())
997 widget_icon_set = "GRAPHIC";
998 settings->setValue (dw_icon_set.key, widget_icon_set);
999
1000 // language
1001 QString language = comboBox_language->currentText ();
1002 if (language == tr ("System setting"))
1003 language = global_language.def.toString ();
1004 settings->setValue (global_language.key, language);
1005
1006 // style
1007 QString selected_style = combo_styles->currentText ();
1008 if (selected_style == global_style.def.toString ())
1009 selected_style = global_style.def.toString ();
1010 settings->setValue (global_style.key, selected_style);
1011
1012 // dock widget title bar
1013 settings->setValue (dw_title_custom_style.key, cb_widget_custom_style->isChecked ());
1014 settings->setValue (dw_title_3d.key, sb_3d_title->value ());
1019
1020 // icon size and theme
1021 int icon_size = icon_size_large->isChecked () - icon_size_small->isChecked ();
1022 settings->setValue (global_icon_size.key, icon_size);
1023 settings->setValue (global_icon_theme.key, cb_system_icon_theme->isChecked ());
1024
1025 // native file dialogs
1026 settings->setValue (global_use_native_dialogs.key, cb_use_native_file_dialogs->isChecked ());
1027
1028 // cursor blinking
1029 settings->setValue (global_cursor_blinking.key, cb_cursor_blinking->isChecked ());
1030
1031 // focus follows mouse
1032 settings->setValue (dw_focus_follows_mouse.key, cb_focus_follows_mouse->isChecked ());
1033
1034 // promp to exit
1035 settings->setValue (global_prompt_to_exit.key, cb_prompt_to_exit->isChecked ());
1036
1037 // status bar
1038 settings->setValue (global_status_bar.key, cb_status_bar->isChecked ());
1039
1040 // Octave startup
1041 settings->setValue (global_restore_ov_dir.key, cb_restore_octave_dir->isChecked ());
1042 settings->setValue (global_ov_startup_dir.key, le_octave_dir->text ());
1043
1044 //editor
1045 settings->setValue (global_use_custom_editor.key, useCustomFileEditor->isChecked ());
1046 settings->setValue (global_custom_editor.key, customFileEditor->text ());
1047 settings->setValue (ed_show_line_numbers.key, editor_showLineNumbers->isChecked ());
1048 settings->setValue (ed_line_numbers_size.key, editor_linenr_size->value ());
1049 settings->setValue (ed_highlight_current_line.key, editor_highlightCurrentLine->isChecked ());
1050 settings->setValue (ed_long_line_marker.key, editor_long_line_marker->isChecked ());
1051 settings->setValue (ed_long_line_marker_line.key, editor_long_line_marker_line->isChecked ());
1052 settings->setValue (ed_long_line_marker_background.key, editor_long_line_marker_background->isChecked ());
1053 settings->setValue (ed_long_line_column.key, editor_long_line_column->value ());
1054 settings->setValue (ed_break_lines.key, editor_break_checkbox->isChecked ());
1055 settings->setValue (ed_break_lines_comments.key, editor_break_comments_checkbox->isChecked ());
1056 settings->setValue (ed_wrap_lines.key, editor_wrap_checkbox->isChecked ());
1057 settings->setValue (ed_code_folding.key, cb_code_folding->isChecked ());
1058 settings->setValue (ed_show_edit_status_bar.key, cb_edit_status_bar->isChecked ());
1059 settings->setValue (ed_show_toolbar.key, cb_edit_tool_bar->isChecked ());
1060 settings->setValue (ed_highlight_all_occurrences.key, editor_highlight_all_occurrences->isChecked ());
1061 settings->setValue (ed_code_completion.key, editor_codeCompletion->isChecked ());
1062 settings->setValue (ed_code_completion_threshold.key, editor_spinbox_ac_threshold->value ());
1063 settings->setValue (ed_code_completion_keywords.key, editor_checkbox_ac_keywords->isChecked ());
1064 settings->setValue (ed_code_completion_octave_builtins.key, editor_checkbox_ac_builtins->isChecked ());
1065 settings->setValue (ed_code_completion_octave_functions.key, editor_checkbox_ac_functions->isChecked ());
1066 settings->setValue (ed_code_completion_document.key, editor_checkbox_ac_document->isChecked ());
1067 settings->setValue (ed_code_completion_case.key, editor_checkbox_ac_case->isChecked ());
1068 settings->setValue (ed_code_completion_replace.key, editor_checkbox_ac_replace->isChecked ());
1069 settings->setValue (ed_auto_endif.key, editor_auto_endif->currentIndex ());
1070 settings->setValue (ed_show_white_space.key, editor_ws_checkbox->isChecked ());
1071 settings->setValue (ed_show_white_space_indent.key, editor_ws_indent_checkbox->isChecked ());
1072 settings->setValue (ed_show_eol_chars.key, cb_show_eol->isChecked ());
1073 settings->setValue (ed_show_hscroll_bar.key, cb_show_hscrollbar->isChecked ());
1074 settings->setValue (ed_default_eol_mode.key, combo_eol_mode->currentIndex ());
1075
1076 settings->setValue (ed_tab_position.key, editor_combox_tab_pos->currentIndex ());
1077 settings->setValue (ed_tabs_rotated.key, editor_cb_tabs_rotated->isChecked ());
1078 settings->setValue (ed_tabs_max_width.key, editor_sb_tabs_max_width->value ());
1079
1080 // Comment strings
1081 int rb_uncomment = 0;
1082 for (int i = 0; i < ed_comment_strings_count; i++)
1083 {
1084 if (m_rb_comment_strings[i]->isChecked ())
1085 {
1086 settings->setValue (ed_comment_str.key, i);
1087 if (i < 3)
1088 settings->setValue (ed_comment_str_old.key, i);
1089 else
1091 }
1092 if (m_rb_uncomment_strings[i]->isChecked ())
1093 rb_uncomment = rb_uncomment + (1 << i);
1094 }
1095 settings->setValue (ed_uncomment_str.key, rb_uncomment);
1096
1097 settings->setValue (ed_default_enc.key, editor_combo_encoding->currentText ());
1098 settings->setValue (ed_auto_indent.key, editor_auto_ind_checkbox->isChecked ());
1099 settings->setValue (ed_tab_indents_line.key, editor_tab_ind_checkbox->isChecked ());
1100 settings->setValue (ed_backspace_unindents_line.key, editor_bs_unind_checkbox->isChecked ());
1101 settings->setValue (ed_show_indent_guides.key, editor_ind_guides_checkbox->isChecked ());
1102 settings->setValue (ed_indent_width.key, editor_ind_width_spinbox->value ());
1103 settings->setValue (ed_indent_uses_tabs.key, editor_ind_uses_tabs_checkbox->isChecked ());
1104 settings->setValue (ed_tab_width.key, editor_tab_width_spinbox->value ());
1105 settings->setValue (ed_restore_session.key, editor_restoreSession->isChecked ());
1106 settings->setValue (ed_create_new_file.key, editor_create_new_file->isChecked ());
1107 settings->setValue (ed_hiding_closes_files.key, editor_hiding_closes_files->isChecked ());
1108 settings->setValue (ed_always_reload_changed_files.key, editor_reload_changed_files->isChecked ());
1109 settings->setValue (ed_force_newline.key, editor_force_newline->isChecked ());
1110 settings->setValue (ed_rm_trailing_spaces.key, editor_remove_trailing_spaces->isChecked ());
1111 settings->setValue (ed_show_dbg_file.key, editor_show_dbg_file->isChecked ());
1112
1113 // file browser
1114 settings->setValue (fb_sync_octdir.key, sync_octave_directory->isChecked ());
1115 settings->setValue (fb_restore_last_dir.key, cb_restore_file_browser_dir->isChecked ());
1116 settings->setValue (fb_startup_dir.key, le_file_browser_dir->text ());
1117 settings->setValue (fb_txt_file_ext.key, le_file_browser_extensions->text ());
1118
1119 // network
1120 settings->setValue (nr_allow_connection.key, checkbox_allow_web_connect->isChecked ());
1121 settings->setValue (global_use_proxy.key, use_proxy_server->isChecked ());
1122 settings->setValue (global_proxy_type.key, proxy_type->currentText ());
1123 settings->setValue (global_proxy_host.key, proxy_host_name->text ());
1124 settings->setValue (global_proxy_port.key, proxy_port->text ());
1125 settings->setValue (global_proxy_user.key, proxy_username->text ());
1126 settings->setValue (global_proxy_pass.key, proxy_password->text ());
1127
1128 // command window
1129 settings->setValue (cs_font_size.key, terminal_fontSize->value ());
1130 settings->setValue (cs_font.key, terminal_fontName->currentFont ().family ());
1131 settings->setValue (cs_cursor_use_fgcol.key, terminal_cursorUseForegroundColor->isChecked ());
1132 settings->setValue (cs_focus_cmd.key, terminal_focus_command->isChecked ());
1133 settings->setValue (cs_dbg_location.key, terminal_print_dbg_location->isChecked ());
1134 settings->setValue (cs_hist_buffer.key, terminal_history_buffer->value ());
1136
1137 // the cursor
1138 QString cursor_type;
1139 unsigned int cursor_int = terminal_cursorType->currentIndex ();
1140 if ((cursor_int > 0) && (cursor_int < cs_cursor_types.size ()))
1141 cursor_type = QString (cs_cursor_types[cursor_int].data ());
1142 else
1143 cursor_type = cs_cursor.def.toString ();
1144
1145 settings->setValue (cs_cursor.key, cursor_type);
1146
1147#if defined (HAVE_QSCINTILLA)
1148 // editor styles: create lexer, get dialog contents, and write settings
1150
1151#if defined (HAVE_LEXER_OCTAVE)
1152
1153 lexer = new QsciLexerOctave ();
1155 delete lexer;
1156
1157#elif defined (HAVE_LEXER_MATLAB)
1158
1159 lexer = new QsciLexerMatlab ();
1161 delete lexer;
1162
1163#endif
1164
1165 lexer = new QsciLexerCPP ();
1167 delete lexer;
1168
1169 lexer = new QsciLexerJava ();
1171 delete lexer;
1172
1173 lexer = new QsciLexerPerl ();
1175 delete lexer;
1176
1177 lexer = new QsciLexerBatch ();
1179 delete lexer;
1180
1181 lexer = new QsciLexerDiff ();
1183 delete lexer;
1184
1185 lexer = new QsciLexerBash ();
1187 delete lexer;
1188
1189 lexer = new octave_txt_lexer ();
1191 delete lexer;
1192
1193#endif
1194
1195 // Workspace
1197
1198 // Variable editor
1199 settings->setValue (ve_column_width.key, varedit_columnWidth->value ());
1200 settings->setValue (ve_row_height.key, varedit_rowHeight->value ());
1201 settings->setValue (ve_use_terminal_font.key, varedit_useTerminalFont->isChecked ());
1202 settings->setValue (ve_alternate_rows.key, varedit_alternate->isChecked ());
1203 settings->setValue (ve_font_name.key, varedit_font->currentFont ().family ());
1204 settings->setValue (ve_font_size.key, varedit_fontSize->value ());
1206
1207 // shortcuts
1208
1209 settings->setValue (sc_prevent_rl_conflicts.key, cb_prevent_readline_conflicts->isChecked ());
1210 settings->setValue (sc_prevent_rl_conflicts_menu.key, cb_prevent_readline_conflicts_menu->isChecked ());
1212 scmgr.write_shortcuts (settings, closing);
1213
1214 // settings dialog's geometry
1215 settings->setValue (sd_last_tab.key, tabWidget->currentIndex ());
1216 settings->setValue (sd_geometry.key, saveGeometry ());
1217
1218 settings->sync ();
1219 }
1220
1222 {
1223 // Construct the grid with all color related settings
1224 QGridLayout *style_grid = new QGridLayout ();
1225 QVector<QLabel *> description (ws_colors_count);
1226 QVector<color_picker *> color (ws_colors_count);
1227
1228 int column = 0;
1229 const int color_columns = 3; // place colors in so many columns
1230 int row = 0;
1231 int mode = settings->value (ws_color_mode).toInt ();
1232
1233 m_ws_enable_colors = new QCheckBox (tr ("Enable attribute colors"));
1234 style_grid->addWidget (m_ws_enable_colors, row++, column, 1, 4);
1235
1236 m_ws_hide_tool_tips = new QCheckBox (tr ("Hide tools tips"));
1237 style_grid->addWidget (m_ws_hide_tool_tips, row++, column, 1, 4);
1238 connect (m_ws_enable_colors, &QCheckBox::toggled,
1239 m_ws_hide_tool_tips, &QCheckBox::setEnabled);
1240 m_ws_hide_tool_tips->setChecked
1241 (settings->value (ws_hide_tool_tips).toBool ());
1242
1243 QCheckBox *cb_color_mode = new QCheckBox (settings_color_modes);
1244 cb_color_mode->setToolTip (settings_color_modes_tooltip);
1245 cb_color_mode->setChecked (mode == 1);
1246 cb_color_mode->setObjectName (ws_color_mode.key);
1247 connect (m_ws_enable_colors, &QCheckBox::toggled,
1248 cb_color_mode, &QCheckBox::setEnabled);
1249 style_grid->addWidget (cb_color_mode, row, column);
1250
1251 QPushButton *pb_reload_default_colors = new QPushButton (settings_reload_colors);
1252 pb_reload_default_colors->setToolTip (settings_reload_colors_tooltip);
1253 connect (m_ws_enable_colors, &QCheckBox::toggled,
1254 pb_reload_default_colors, &QPushButton::setEnabled);
1255 style_grid->addWidget (pb_reload_default_colors, row+1, column++);
1256
1257 bool colors_enabled = settings->value (ws_enable_colors).toBool ();
1258
1259 for (int i = 0; i < ws_colors_count; i++)
1260 {
1261 description[i] = new QLabel (" "
1262 + tr (ws_color_names.at (i).toStdString ().data ()));
1263 description[i]->setAlignment (Qt::AlignRight);
1264 description[i]->setEnabled (colors_enabled);
1265 connect (m_ws_enable_colors, &QCheckBox::toggled,
1266 description[i], &QLabel::setEnabled);
1267
1268 QColor setting_color = settings->color_value (ws_colors[i], mode);
1269 color[i] = new color_picker (setting_color);
1270 color[i]->setObjectName (ws_colors[i].key);
1271 color[i]->setMinimumSize (30, 10);
1272 color[i]->setEnabled (colors_enabled);
1273 connect (m_ws_enable_colors, &QCheckBox::toggled,
1274 color[i], &color_picker::setEnabled);
1275
1276 style_grid->addWidget (description[i], row, 3*column);
1277 style_grid->addWidget (color[i], row, 3*column+1);
1278 if (++column > color_columns)
1279 {
1280 style_grid->setColumnStretch (4*column, 10);
1281 row++;
1282 column = 1;
1283 }
1284 }
1285
1286 // Load enable settings at the end for having signals already connected
1287 m_ws_enable_colors->setChecked (colors_enabled);
1288 m_ws_hide_tool_tips->setEnabled (colors_enabled);
1289 cb_color_mode->setEnabled (colors_enabled);
1290 pb_reload_default_colors->setEnabled (colors_enabled);
1291
1292 // place grid with elements into the tab
1293 workspace_colors_box->setLayout (style_grid);
1294
1295 // update colors depending on second theme selection or reloading
1296 // the dfault values
1297 connect (cb_color_mode, &QCheckBox::stateChanged,
1299 connect (pb_reload_default_colors, &QPushButton::clicked,
1301 }
1302
1304 {
1305 QCheckBox *cb_color_mode
1306 = workspace_colors_box->findChild <QCheckBox *> (ws_color_mode.key);
1307
1308 int m = 0;
1309 if (cb_color_mode && cb_color_mode->isChecked ())
1310 m = 1;
1311
1314
1315 color_picker *c_picker;
1316
1317 for (unsigned int i = 0; i < ws_colors_count; i++)
1318 {
1319 c_picker = workspace_colors_box->findChild <color_picker *> (ws_colors[i].key);
1320 if (c_picker)
1321 {
1323 {
1324 // Get current value from settings or the default
1325 c_picker->set_color (settings->color_value (ws_colors[i], m));
1326 }
1327 else
1328 {
1329 // Get the default value
1330 c_picker->set_color (settings->get_color_value (ws_colors[i].def, m));
1331 }
1332 }
1333 }
1334 }
1335
1337 {
1338 settings->setValue (ws_enable_colors.key, m_ws_enable_colors->isChecked ());
1339 settings->setValue (ws_hide_tool_tips.key, m_ws_hide_tool_tips->isChecked ());
1340
1341 QCheckBox *cb_color_mode
1342 = workspace_colors_box->findChild <QCheckBox *> (ws_color_mode.key);
1343
1344 int mode = 0;
1345 if (cb_color_mode && cb_color_mode->isChecked ())
1346 mode = 1;
1347
1348 color_picker *color;
1349
1350 for (int i = 0; i < ws_colors_count; i++)
1351 {
1352 color = workspace_colors_box->findChild <color_picker *> (ws_colors[i].key);
1353 if (color)
1354 settings->set_color_value (ws_colors[i], color->color (), mode);
1355 }
1356
1357 settings->setValue (ws_color_mode.key, mode);
1358
1359 settings->sync ();
1360 }
1361
1363 {
1364 QGridLayout *style_grid = new QGridLayout ();
1365 QVector<QLabel *> description (cs_colors_count);
1366 QVector<color_picker *> color (cs_colors_count);
1367
1368 int mode = settings->value (cs_color_mode).toInt ();
1369
1370 QCheckBox *cb_color_mode = new QCheckBox (settings_color_modes);
1371 cb_color_mode->setToolTip (settings_color_modes_tooltip);
1372 cb_color_mode->setChecked (mode == 1);
1373 cb_color_mode->setObjectName (cs_color_mode.key);
1374 style_grid->addWidget (cb_color_mode, 0, 0);
1375
1376 QPushButton *pb_reload_default_colors = new QPushButton (settings_reload_colors);
1377 pb_reload_default_colors->setToolTip (settings_reload_colors_tooltip);
1378 style_grid->addWidget (pb_reload_default_colors, 1, 0);
1379
1380 int column = 1; // column 0 is for the color mode checkbox
1381 const int color_columns = 2; // place colors in so many columns
1382 int row = 0;
1383 for (unsigned int i = 0; i < cs_colors_count; i++)
1384 {
1385 description[i] = new QLabel (" "
1386 + tr (cs_color_names.at (i).toStdString ().data ()));
1387 description[i]->setAlignment (Qt::AlignRight);
1388 QColor setting_color = settings->color_value (cs_colors[i], mode);
1389 color[i] = new color_picker (setting_color);
1390 color[i]->setObjectName (cs_colors[i].key);
1391 color[i]->setMinimumSize (30, 10);
1392 style_grid->addWidget (description[i], row, 2*column);
1393 style_grid->addWidget (color[i], row, 2*column+1);
1394 if (++column > color_columns)
1395 {
1396 style_grid->setColumnStretch (3*column, 10);
1397 row++;
1398 column = 1;
1399 }
1400 }
1401
1402 // place grid with elements into the tab
1403 terminal_colors_box->setLayout (style_grid);
1404
1405 // update colors depending on second theme selection
1406 connect (cb_color_mode, &QCheckBox::stateChanged,
1408 connect (pb_reload_default_colors, &QPushButton::clicked,
1410 }
1411
1413 {
1414 QCheckBox *cb_color_mode
1415 = terminal_colors_box->findChild <QCheckBox *> (cs_color_mode.key);
1416
1417 int m = 0;
1418 if (cb_color_mode && cb_color_mode->isChecked ())
1419 m = 1;
1420
1423
1424 color_picker *c_picker;
1425
1426 for (unsigned int i = 0; i < cs_colors_count; i++)
1427 {
1428 c_picker = terminal_colors_box->findChild <color_picker *> (cs_colors[i].key);
1429 if (c_picker)
1430 {
1432 {
1433 // Get current value from settings or the default
1434 c_picker->set_color (settings->color_value (cs_colors[i], m));
1435 }
1436 else
1437 {
1438 // Get the default value
1439 c_picker->set_color (settings->get_color_value (cs_colors[i].def, m));
1440 }
1441 }
1442 }
1443 }
1444
1446 {
1447 QCheckBox *cb_color_mode
1448 = terminal_colors_box->findChild <QCheckBox *> (cs_color_mode.key);
1449
1450 int mode = 0;
1451 if (cb_color_mode && cb_color_mode->isChecked ())
1452 mode = 1;
1453
1454 color_picker *color;
1455
1456 for (int i = 0; i < cs_color_names.size (); i++)
1457 {
1458 color = terminal_colors_box->findChild <color_picker *> (cs_colors[i].key);
1459 if (color)
1460 settings->set_color_value (cs_colors[i], color->color (), mode);
1461 }
1462
1463 settings->setValue (cs_color_mode.key, mode);
1464
1465 settings->sync ();
1466 }
1467
1469 {
1470 QGridLayout *style_grid = new QGridLayout ();
1471 QVector<QLabel *> description (ve_colors_count);
1472 QVector<color_picker *> color (ve_colors_count);
1473
1474 int mode = settings->value (ve_color_mode).toInt ();
1475
1476 QCheckBox *cb_color_mode = new QCheckBox (settings_color_modes);
1477 cb_color_mode->setToolTip (settings_color_modes_tooltip);
1478 cb_color_mode->setChecked (mode == 1);
1479 cb_color_mode->setObjectName (ve_color_mode.key);
1480 style_grid->addWidget (cb_color_mode, 0, 0);
1481
1482 QPushButton *pb_reload_default_colors = new QPushButton (settings_reload_colors);
1483 pb_reload_default_colors->setToolTip (settings_reload_colors_tooltip);
1484 style_grid->addWidget (pb_reload_default_colors, 1, 0);
1485
1486 int column = 1;
1487 int color_columns = 2;
1488 int row = 0;
1489 for (int i = 0; i < ve_colors_count; i++)
1490 {
1491 description[i] = new QLabel (" "
1492 + tr (ve_color_names.at (i).toStdString ().data ()));
1493 description[i]->setAlignment (Qt::AlignRight);
1494
1495 QColor setting_color = settings->color_value (ve_colors[i], mode);
1496 color[i] = new color_picker (setting_color);
1497 color[i]->setObjectName (ve_colors[i].key);
1498 color[i]->setMinimumSize (30, 10);
1499 style_grid->addWidget (description[i], row, 2*column);
1500 style_grid->addWidget (color[i], row, 2*column+1);
1501 if (++column > color_columns)
1502 {
1503 style_grid->setColumnStretch (3*column, 10);
1504 row++;
1505 column = 1;
1506 }
1507 }
1508
1509 // place grid with elements into the tab
1510 varedit_colors_box->setLayout (style_grid);
1511
1512 // update colors depending on second theme selection
1513 connect (cb_color_mode, &QCheckBox::stateChanged,
1515 connect (pb_reload_default_colors, &QPushButton::clicked,
1517 }
1518
1520 {
1521 QCheckBox *cb_color_mode
1522 = varedit_colors_box->findChild <QCheckBox *> (ve_color_mode.key);
1523
1524 int m = 0;
1525 if (cb_color_mode && cb_color_mode->isChecked ())
1526 m = 1;
1527
1530
1531 color_picker *c_picker;
1532
1533 for (unsigned int i = 0; i < ve_colors_count; i++)
1534 {
1535 c_picker = varedit_colors_box->findChild <color_picker *> (ve_colors[i].key);
1536 if (c_picker)
1537 {
1539 {
1540 // Get current value from settings or the default
1541 c_picker->set_color (settings->color_value (ve_colors[i], m));
1542 }
1543 else
1544 {
1545 // Get the default value
1546 c_picker->set_color (settings->get_color_value (ve_colors[i].def, m));
1547 }
1548 }
1549 }
1550 }
1551
1553 {
1554 QCheckBox *cb_color_mode
1555 = varedit_colors_box->findChild <QCheckBox *> (ve_color_mode.key);
1556
1557 int mode = 0;
1558 if (cb_color_mode && cb_color_mode->isChecked ())
1559 mode = 1;
1560
1561 color_picker *color;
1562
1563 for (int i = 0; i < ve_colors_count; i++)
1564 {
1565 color = varedit_colors_box->findChild <color_picker *> (ve_colors[i].key);
1566 if (color)
1567 settings->set_color_value (ve_colors[i], color->color (), mode);
1568 }
1569
1570 settings->setValue (ve_color_mode.key, mode);
1571
1572 settings->sync ();
1573 }
1574}
Base class for Octave interfaces that use Qt.
shortcut_manager & get_shortcut_manager(void)
resource_manager & get_resource_manager(void)
void set_color(QColor new_color)
Definition: color-picker.cc:61
QColor color(void) const
Definition: color-picker.h:45
void combo_encoding(QComboBox *combo, const QString &current=QString())
gui_settings * get_settings(void) const
void read_lexer_settings(QsciLexer *lexer, gui_settings *settings, int mode=0, int def=0)
int get_valid_lexer_styles(QsciLexer *lexer, int *styles)
QString get_gui_translation_dir(void)
void write_terminal_colors(gui_settings *settings)
QCheckBox * m_rb_uncomment_strings[ed_comment_strings_count]
void button_clicked(QAbstractButton *button)
void write_lexer_settings(QsciLexer *lexer, gui_settings *settings)
QRadioButton * m_rb_comment_strings[ed_comment_strings_count]
color_picker * m_widget_title_fg_color
void update_editor_lexers(int def=0)
void update_varedit_colors(int def=0)
void get_dir(QLineEdit *, const QString &)
void update_terminal_colors(int def=0)
void write_varedit_colors(gui_settings *settings)
color_picker * m_widget_title_fg_color_active
void update_workspace_colors(int def=0)
color_picker * m_widget_title_bg_color
void read_workspace_colors(gui_settings *settings)
void set_disabled_pref_file_browser_dir(bool disable)
base_qobject & m_octave_qobj
void apply_new_settings(void)
void read_varedit_colors(gui_settings *settings)
color_picker * m_widget_title_bg_color_active
void write_changed_settings(bool closing)
void update_lexer(QsciLexer *lexer, gui_settings *settings, int mode, int def=0)
void read_terminal_colors(gui_settings *settings)
settings_dialog(QWidget *parent, base_qobject &octave_qobj, const QString &desired_tab=QString())
void show_tab(const QString &)
void get_lexer_settings(QsciLexer *lexer, gui_settings *settings)
void write_workspace_colors(gui_settings *settings)
bool import_export(int action)
void fill_treewidget(QTreeWidget *tree_view)
void write_shortcuts(gui_settings *settings, bool closing)
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 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 QStringList cs_color_names(QStringList()<< QT_TRANSLATE_NOOP("octave::settings_dialog", "foreground")<< QT_TRANSLATE_NOOP("octave::settings_dialog", "background")<< QT_TRANSLATE_NOOP("octave::settings_dialog", "selection")<< QT_TRANSLATE_NOOP("octave::settings_dialog", "cursor"))
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_bg_color("DockWidgets/title_bg_color", QVariant(QColor(255, 255, 255)))
const gui_pref dw_title_fg_color("DockWidgets/title_fg_color", QVariant(QColor(0, 0, 0)))
const gui_pref dw_title_3d("DockWidgets/widget_title_3d", QVariant(50))
const gui_pref dw_title_fg_color_active("DockWidgets/title_fg_color_active", QVariant(QColor(0, 0, 0)))
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(192, 192, 192)))
const gui_pref dw_title_custom_style("DockWidgets/widget_title_custom_style", QVariant(false))
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_long_line_marker("editor/long_line_marker", QVariant(true))
const gui_pref ed_tab_position("editor/tab_position", QVariant(QTabWidget::North))
const QStringList ed_tab_position_names(QStringList()<< QT_TRANSLATE_NOOP("octave::settings_dialog", "Top")<< QT_TRANSLATE_NOOP("octave::settings_dialog", "Bottom")<< QT_TRANSLATE_NOOP("octave::settings_dialog", "Left")<< QT_TRANSLATE_NOOP("octave::settings_dialog", "Right"))
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 QStringList ed_comment_strings(QStringList()<< "##"<< "#"<< "%"<< "%%"<< "%!")
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 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 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_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 QStringList global_proxy_all_types(QStringList()<< "HttpProxy"<< "Socks5Proxy"<< QT_TRANSLATE_NOOP("octave::settings_dialog", "Environment Variables"))
const gui_pref global_proxy_host("proxyHostName", QVariant(QString()))
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_icon_theme("use_system_icon_theme", QVariant(true))
const gui_pref global_use_custom_editor("useCustomFileEditor", QVariant(false))
const gui_pref global_ov_startup_dir("octave_startup_dir", QVariant(QString()))
const gui_pref global_custom_editor("customFileEditor", QVariant("emacs +%l %f"))
const gui_pref global_proxy_port("proxyPort", QVariant(80))
const gui_pref global_icon_size("toolbar_icon_size", QVariant(0))
const gui_pref global_language("language", QVariant("SYSTEM"))
const QList< int > global_proxy_manual_types(QList< int >()<< 0<< 1)
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 gui_pref sd_geometry("settings/geometry", QVariant())
const gui_pref sd_last_editor_styles_tab("settings/last_editor_styles_tab", QVariant(0))
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 QStringList ve_color_names(QStringList()<< QT_TRANSLATE_NOOP("octave::settings_dialog", "Foreground")<< QT_TRANSLATE_NOOP("octave::settings_dialog", "Background")<< QT_TRANSLATE_NOOP("octave::settings_dialog", "Selected Foreground")<< QT_TRANSLATE_NOOP("octave::settings_dialog", "Selected Background")<< QT_TRANSLATE_NOOP("octave::settings_dialog", "Alternate Background"))
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 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 QStringList ws_color_names(QStringList()<< QT_TRANSLATE_NOOP("octave::settings_dialog", "argument")<< QT_TRANSLATE_NOOP("octave::settings_dialog", "global")<< QT_TRANSLATE_NOOP("octave::settings_dialog", "persistent"))
const gui_pref ws_enable_colors("workspaceview/enable_colors", QVariant(false))
const gui_pref ws_color_mode("workspaceview/color_mode", QVariant(0))
const gui_pref ws_hide_tool_tips("workspaceview/hide_tools_tips", QVariant(false))
const int ws_colors_count
const QString settings_reload_colors_tooltip
Definition: gui-settings.h:145
const QString settings_color_modes_tooltip
Definition: gui-settings.h:135
const QString settings_color_modes
Definition: gui-settings.h:132
const QString settings_reload_colors
Definition: gui-settings.h:142
const QColor settings_color_no_change(255, 0, 255)
const QString settings_reload_styles_tooltip
Definition: gui-settings.h:152
const QString settings_reload_styles
Definition: gui-settings.h:149
const QStringList settings_color_modes_ext(QStringList()<< ""<< "_2")
const int settings_reload_default_colors_flag
Definition: gui-settings.h:156
#define lexer
Definition: oct-parse.cc:146
const QString key
const QVariant def