Mercurial > octave-dspies
annotate libgui/src/settings-dialog.cc @ 17740:e6ed77b75aec
new preference in settings: editor creates nonexisting files wihtout prompt
* settings-dialog.ui: adding checkbox for new preference
* settings-dialog.cc(constructor): reading new option from the settings and
initializing new checkbox;
(write_changed_settings): write checkbox state into the settings file
* file_editor.cc(request_opren_file): when file to open does not exist
read new option from the settings and skip the dialog accordingly
author | Torsten <ttl@justmail.de> |
---|---|
date | Wed, 23 Oct 2013 22:20:06 +0200 |
parents | c060ad097056 |
children | d63878346099 |
rev | line source |
---|---|
15204
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
1 /* |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
2 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
3 Copyright (C) 2011-2012 Jacob Dawid |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
4 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
5 This file is part of Octave. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
6 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
10 option) any later version. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
11 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
15 for more details. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
16 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
20 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
21 */ |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13672
diff
changeset
|
22 |
15286
ae9079bbc627
Add '#include <config.h>' to C++ files in libgui/src
Rik <rik@octave.org>
parents:
15274
diff
changeset
|
23 #ifdef HAVE_CONFIG_H |
ae9079bbc627
Add '#include <config.h>' to C++ files in libgui/src
Rik <rik@octave.org>
parents:
15274
diff
changeset
|
24 #include <config.h> |
ae9079bbc627
Add '#include <config.h>' to C++ files in libgui/src
Rik <rik@octave.org>
parents:
15274
diff
changeset
|
25 #endif |
ae9079bbc627
Add '#include <config.h>' to C++ files in libgui/src
Rik <rik@octave.org>
parents:
15274
diff
changeset
|
26 |
14707
674740c44c09
Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14703
diff
changeset
|
27 #include "resource-manager.h" |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
28 #include "workspace-model.h" |
14707
674740c44c09
Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14703
diff
changeset
|
29 #include "settings-dialog.h" |
15156
141b0b108292
allow building without gui to work
John W. Eaton <jwe@octave.org>
parents:
14998
diff
changeset
|
30 #include "ui-settings-dialog.h" |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
31 #include <QDir> |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
32 #include <QFileInfo> |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
33 #include <QVector> |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
34 #include <QHash> |
13501 | 35 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
36 #ifdef HAVE_QSCINTILLA |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
37 #include <QScrollArea> |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
38 |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
39 #if defined (HAVE_QSCI_QSCILEXEROCTAVE_H) |
16677
f6dfc7705623
* settings-dialog.cc: enable octave lexer editor styles if lexer is present
Torsten <ttl@justmail.de>
parents:
16667
diff
changeset
|
40 #define HAVE_LEXER_OCTAVE |
16646
025bc6b5080e
use QScintilla's lexer for highlighting Octave programs
John W. Eaton <jwe@octave.org>
parents:
16636
diff
changeset
|
41 #include <Qsci/qscilexeroctave.h> |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
42 #elif defined (HAVE_QSCI_QSCILEXERMATLAB_H) |
16677
f6dfc7705623
* settings-dialog.cc: enable octave lexer editor styles if lexer is present
Torsten <ttl@justmail.de>
parents:
16667
diff
changeset
|
43 #define HAVE_LEXER_MATLAB |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
44 #include <Qsci/qscilexermatlab.h> |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
45 #endif |
16677
f6dfc7705623
* settings-dialog.cc: enable octave lexer editor styles if lexer is present
Torsten <ttl@justmail.de>
parents:
16667
diff
changeset
|
46 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
47 #include <Qsci/qscilexercpp.h> |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
48 #include <Qsci/qscilexerbash.h> |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
49 #include <Qsci/qscilexerperl.h> |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
50 #include <Qsci/qscilexerbatch.h> |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
51 #include <Qsci/qscilexerdiff.h> |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
52 #endif |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
53 |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
54 settings_dialog::settings_dialog (QWidget *p, const QString& desired_tab): |
15368
36ececf69385
avoid some GCC warnings in the libgui code
John W. Eaton <jwe@octave.org>
parents:
15367
diff
changeset
|
55 QDialog (p), ui (new Ui::settings_dialog) |
13501 | 56 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
57 ui->setupUi (this); |
13501 | 58 |
15164
bc801a44bb1f
follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents:
15156
diff
changeset
|
59 QSettings *settings = resource_manager::get_settings (); |
bc801a44bb1f
follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents:
15156
diff
changeset
|
60 // FIXME -- what should happen if settings is 0? |
bc801a44bb1f
follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents:
15156
diff
changeset
|
61 |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
62 // look for available language files and the actual settings |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
63 QString qm_dir_name = resource_manager::get_gui_translation_dir (); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
64 QDir qm_dir (qm_dir_name); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
65 QFileInfoList qm_files = qm_dir.entryInfoList (QStringList ("*.qm"), |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
66 QDir::Files | QDir::Readable, |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
67 QDir::Name); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
68 for (int i = 0; i < qm_files.length (); i++) // insert available languages |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
69 ui->comboBox_language->addItem (qm_files.at (i).baseName ()); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
70 ui->comboBox_language->insertItem (0,tr("System setting")); // System at beginning |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
71 ui->comboBox_language->insertSeparator (1); // separator after System |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
72 QString language = settings->value ("language","SYSTEM").toString (); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
73 if (language == "SYSTEM") |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
74 language = tr("System setting"); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
75 int selected = ui->comboBox_language->findText (language); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
76 if (selected >= 0) |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
77 ui->comboBox_language->setCurrentIndex (selected); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
78 else |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
79 ui->comboBox_language->setCurrentIndex (0); // System is default |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
80 |
16525
e192525236ad
configurable size of toolbar icons
Torsten <ttl@justmail.de>
parents:
16500
diff
changeset
|
81 ui->toolbar_icon_size->setValue (settings->value ("toolbar_icon_size",24).toInt ()); |
e192525236ad
configurable size of toolbar icons
Torsten <ttl@justmail.de>
parents:
16500
diff
changeset
|
82 |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
83 // which icon has to be selected |
15914
85f9aca30c76
gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents:
15787
diff
changeset
|
84 QString widget_icon_set = |
85f9aca30c76
gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents:
15787
diff
changeset
|
85 settings->value ("DockWidgets/widget_icon_set","NONE").toString (); |
85f9aca30c76
gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents:
15787
diff
changeset
|
86 ui->general_icon_octave-> setChecked (true); // the default (if invalid set) |
85f9aca30c76
gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents:
15787
diff
changeset
|
87 ui->general_icon_octave-> setChecked (widget_icon_set == "NONE"); |
85f9aca30c76
gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents:
15787
diff
changeset
|
88 ui->general_icon_graphic-> setChecked (widget_icon_set == "GRAPHIC"); |
85f9aca30c76
gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents:
15787
diff
changeset
|
89 ui->general_icon_letter-> setChecked (widget_icon_set == "LETTER"); |
15787
b081fbe80174
provide separate icons for gui's floating widgets
Torsten <ttl@justmail.de>
parents:
15368
diff
changeset
|
90 |
16379
4bb1b82076e5
gui: provide defaults for all values read from the settings file
Torsten <ttl@justmail.de>
parents:
15972
diff
changeset
|
91 ui->useCustomFileEditor->setChecked (settings->value ("useCustomFileEditor",false).toBool ()); |
13537
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13536
diff
changeset
|
92 ui->customFileEditor->setText (settings->value ("customFileEditor").toString ()); |
13659
d98c6ef06dff
included some editor setting into the setting dialog
ttl <ttl@justmail.de>
parents:
13609
diff
changeset
|
93 ui->editor_showLineNumbers->setChecked (settings->value ("editor/showLineNumbers",true).toBool () ); |
16693
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
94 |
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
95 QVariant default_var = QColor (240, 240, 240); |
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
96 QColor setting_color = settings->value ("editor/highlight_current_line_color", |
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
97 default_var).value<QColor> (); |
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
98 _editor_current_line_color = new color_picker (setting_color); |
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
99 ui->editor_grid_current_line->addWidget (_editor_current_line_color,0,3); |
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
100 _editor_current_line_color->setMinimumSize (50,10); |
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
101 _editor_current_line_color->setEnabled (false); |
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
102 connect (ui->editor_highlightCurrentLine, SIGNAL (toggled (bool)), |
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
103 _editor_current_line_color, SLOT (setEnabled (bool))); |
14307
be3e1a14a6de
Added an interface settings tab to the settings dialog. Made a few improvements on the editor. Wrote a small welcome text in the welcome wizard. Moved configuration file to ~/.config/octave-gui/settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14290
diff
changeset
|
104 ui->editor_highlightCurrentLine->setChecked (settings->value ("editor/highlightCurrentLine",true).toBool () ); |
16693
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
105 |
13659
d98c6ef06dff
included some editor setting into the setting dialog
ttl <ttl@justmail.de>
parents:
13609
diff
changeset
|
106 ui->editor_codeCompletion->setChecked (settings->value ("editor/codeCompletion",true).toBool () ); |
16679
cf939872811c
options for auto completion threshold, source and word replacement in settings
Torsten <ttl@justmail.de>
parents:
16677
diff
changeset
|
107 ui->editor_spinbox_ac_threshold->setValue (settings->value ("editor/codeCompletion_threshold",2).toInt ()); |
cf939872811c
options for auto completion threshold, source and word replacement in settings
Torsten <ttl@justmail.de>
parents:
16677
diff
changeset
|
108 ui->editor_checkbox_ac_keywords->setChecked (settings->value ("editor/codeCompletion_keywords",true).toBool ()); |
cf939872811c
options for auto completion threshold, source and word replacement in settings
Torsten <ttl@justmail.de>
parents:
16677
diff
changeset
|
109 ui->editor_checkbox_ac_document->setChecked (settings->value ("editor/codeCompletion_document",false).toBool ()); |
16701
ccfbc767ff5a
make case sensitivity of editors auto completion list configurable
Torsten <ttl@justmail.de>
parents:
16700
diff
changeset
|
110 ui->editor_checkbox_ac_case->setChecked (settings->value ("editor/codeCompletion_case",true).toBool ()); |
16679
cf939872811c
options for auto completion threshold, source and word replacement in settings
Torsten <ttl@justmail.de>
parents:
16677
diff
changeset
|
111 ui->editor_checkbox_ac_replace->setChecked (settings->value ("editor/codeCompletion_replace",false).toBool ()); |
16702
553cfdd5d660
make white space visibility in the editor configurable
Torsten <ttl@justmail.de>
parents:
16701
diff
changeset
|
112 ui->editor_ws_checkbox->setChecked (settings->value ("editor/show_white_space",false).toBool ()); |
553cfdd5d660
make white space visibility in the editor configurable
Torsten <ttl@justmail.de>
parents:
16701
diff
changeset
|
113 ui->editor_ws_indent_checkbox->setChecked (settings->value ("editor/show_white_space_indent",false).toBool ()); |
16703
5cf19370011d
add more settings concerning tabs and indentation to the editor settings
Torsten <ttl@justmail.de>
parents:
16702
diff
changeset
|
114 ui->editor_auto_ind_checkbox->setChecked (settings->value ("editor/auto_indent",true).toBool ()); |
5cf19370011d
add more settings concerning tabs and indentation to the editor settings
Torsten <ttl@justmail.de>
parents:
16702
diff
changeset
|
115 ui->editor_tab_ind_checkbox->setChecked (settings->value ("editor/tab_indents_line",false).toBool ()); |
5cf19370011d
add more settings concerning tabs and indentation to the editor settings
Torsten <ttl@justmail.de>
parents:
16702
diff
changeset
|
116 ui->editor_bs_unind_checkbox->setChecked (settings->value ("editor/backspace_unindents_line",false).toBool ()); |
5cf19370011d
add more settings concerning tabs and indentation to the editor settings
Torsten <ttl@justmail.de>
parents:
16702
diff
changeset
|
117 ui->editor_ind_guides_checkbox->setChecked (settings->value ("editor/show_indent_guides",false).toBool ()); |
5cf19370011d
add more settings concerning tabs and indentation to the editor settings
Torsten <ttl@justmail.de>
parents:
16702
diff
changeset
|
118 ui->editor_ind_width_spinbox->setValue (settings->value ("editor/indent_width",2).toInt ()); |
5cf19370011d
add more settings concerning tabs and indentation to the editor settings
Torsten <ttl@justmail.de>
parents:
16702
diff
changeset
|
119 ui->editor_tab_width_spinbox->setValue (settings->value ("editor/tab_width",2).toInt ()); |
15355
a9fd6821eedf
GUI: recognize editor prefences for long title names; changed default value to false
Thorsten Liebig <Thorsten.Liebig@gmx.de>
parents:
15286
diff
changeset
|
120 ui->editor_longWindowTitle->setChecked (settings->value ("editor/longWindowTitle",false).toBool ()); |
15356
842ab161c10a
GUI: new setting to restore tabs from previous session; allow silent load file
Thorsten Liebig <Thorsten.Liebig@gmx.de>
parents:
15355
diff
changeset
|
121 ui->editor_restoreSession->setChecked (settings->value ("editor/restoreSession",true).toBool ()); |
17740
e6ed77b75aec
new preference in settings: editor creates nonexisting files wihtout prompt
Torsten <ttl@justmail.de>
parents:
17676
diff
changeset
|
122 ui->editor_create_new_file->setChecked (settings->value ("editor/create_new_file",false).toBool ()); |
16379
4bb1b82076e5
gui: provide defaults for all values read from the settings file
Torsten <ttl@justmail.de>
parents:
15972
diff
changeset
|
123 ui->terminal_fontName->setCurrentFont (QFont (settings->value ("terminal/fontName","Courier New").toString()) ); |
14588
fa52c6e84ae0
Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents:
14308
diff
changeset
|
124 ui->terminal_fontSize->setValue (settings->value ("terminal/fontSize",10).toInt ()); |
16499
facf00ce97d3
gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents:
16410
diff
changeset
|
125 ui->showFileSize->setChecked (settings->value ("filesdockwidget/showFileSize",false).toBool()); |
facf00ce97d3
gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents:
16410
diff
changeset
|
126 ui->showFileType->setChecked (settings->value ("filesdockwidget/showFileType",false).toBool()); |
facf00ce97d3
gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents:
16410
diff
changeset
|
127 ui->showLastModified->setChecked (settings->value ("filesdockwidget/showLastModified",false).toBool()); |
facf00ce97d3
gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents:
16410
diff
changeset
|
128 ui->showHiddenFiles->setChecked (settings->value ("filesdockwidget/showHiddenFiles",false).toBool()); |
facf00ce97d3
gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents:
16410
diff
changeset
|
129 ui->useAlternatingRowColors->setChecked (settings->value ("filesdockwidget/useAlternatingRowColors",true).toBool()); |
facf00ce97d3
gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents:
16410
diff
changeset
|
130 ui->sync_octave_directory->setChecked (settings->value ("filesdockwidget/sync_octave_directory",true).toBool()); |
16379
4bb1b82076e5
gui: provide defaults for all values read from the settings file
Torsten <ttl@justmail.de>
parents:
15972
diff
changeset
|
131 ui->useProxyServer->setChecked (settings->value ("useProxyServer",false).toBool ()); |
13607
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
132 ui->proxyHostName->setText (settings->value ("proxyHostName").toString ()); |
16379
4bb1b82076e5
gui: provide defaults for all values read from the settings file
Torsten <ttl@justmail.de>
parents:
15972
diff
changeset
|
133 ui->terminal_cursorBlinking->setChecked (settings->value ("terminal/cursorBlinking",true).toBool ()); |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
134 ui->terminal_cursorUseForegroundColor->setChecked (settings->value ("terminal/cursorUseForegroundColor",true).toBool ()); |
14998
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
135 |
16379
4bb1b82076e5
gui: provide defaults for all values read from the settings file
Torsten <ttl@justmail.de>
parents:
15972
diff
changeset
|
136 QString cursorType = settings->value ("terminal/cursorType","ibeam").toString (); |
14998
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
137 |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
138 QStringList items; |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
139 items << QString("0") << QString("1") << QString("2"); |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
140 ui->terminal_cursorType->addItems(items); |
16859
54c370a00a4a
* settings-dialog.cc(constructor): enable translation of the cursor types
Torsten <ttl@justmail.de>
parents:
16749
diff
changeset
|
141 ui->terminal_cursorType->setItemText (0, tr ("IBeam Cursor")); |
54c370a00a4a
* settings-dialog.cc(constructor): enable translation of the cursor types
Torsten <ttl@justmail.de>
parents:
16749
diff
changeset
|
142 ui->terminal_cursorType->setItemText (1, tr ("Block Cursor")); |
54c370a00a4a
* settings-dialog.cc(constructor): enable translation of the cursor types
Torsten <ttl@justmail.de>
parents:
16749
diff
changeset
|
143 ui->terminal_cursorType->setItemText (2, tr ("Underline Cursor")); |
14998
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
144 |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
145 if (cursorType == "ibeam") |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
146 ui->terminal_cursorType->setCurrentIndex (0); |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
147 else if (cursorType == "block") |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
148 ui->terminal_cursorType->setCurrentIndex (1); |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
149 else if (cursorType == "underline") |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
150 ui->terminal_cursorType->setCurrentIndex (2); |
13607
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
151 |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
152 int currentIndex = 0; |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
153 QString proxyTypeString = settings->value ("proxyType").toString (); |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
154 while ( (currentIndex < ui->proxyType->count ()) && (ui->proxyType->currentText () != proxyTypeString)) |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
155 { |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
156 currentIndex++; |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
157 ui->proxyType->setCurrentIndex (currentIndex); |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
158 } |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
159 |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
160 ui->proxyPort->setText (settings->value ("proxyPort").toString ()); |
13609
b355901aade4
Added username and password field to proxy settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
161 ui->proxyUserName->setText (settings->value ("proxyUserName").toString ()); |
b355901aade4
Added username and password field to proxy settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
162 ui->proxyPassword->setText (settings->value ("proxyPassword").toString ()); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
163 |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
164 // qorkspace colors |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
165 read_workspace_colors (settings); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
166 |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
167 // terminal colors |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
168 read_terminal_colors (settings); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
169 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
170 #ifdef HAVE_QSCINTILLA |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
171 // editor styles: create lexer, read settings, and create dialog elements |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
172 QsciLexer *lexer; |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
173 #if defined (HAVE_LEXER_OCTAVE) |
16646
025bc6b5080e
use QScintilla's lexer for highlighting Octave programs
John W. Eaton <jwe@octave.org>
parents:
16636
diff
changeset
|
174 lexer = new QsciLexerOctave (); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
175 read_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
176 delete lexer; |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
177 #elif defined (HAVE_LEXER_MATLAB) |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
178 lexer = new QsciLexerMatlab (); |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
179 read_lexer_settings (lexer,settings); |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
180 delete lexer; |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
181 #endif |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
182 lexer = new QsciLexerCPP (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
183 read_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
184 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
185 lexer = new QsciLexerPerl (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
186 read_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
187 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
188 lexer = new QsciLexerBatch (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
189 read_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
190 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
191 lexer = new QsciLexerDiff (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
192 read_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
193 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
194 lexer = new QsciLexerBash (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
195 read_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
196 delete lexer; |
16623
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
197 #endif |
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
198 |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
199 // which tab is the desired one? |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
200 if (desired_tab.isEmpty ()) |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
201 ui->tabWidget->setCurrentIndex (settings->value("settings/last_tab",0).toInt ()); |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
202 else |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
203 { |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
204 QHash <QString, QWidget*> tab_hash; |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
205 tab_hash["editor"] = ui->tab_editor; |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
206 tab_hash["editor_styles"] = ui->tab_editor_styles; |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
207 ui->tabWidget->setCurrentIndex (ui->tabWidget->indexOf (tab_hash.value (desired_tab))); |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
208 } |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
209 |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
210 |
13501 | 211 } |
212 | |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
213 settings_dialog::~settings_dialog () |
13501 | 214 { |
15274
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
215 delete ui; |
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
216 } |
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
217 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
218 |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
219 #ifdef HAVE_QSCINTILLA |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
220 int |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
221 settings_dialog::get_valid_lexer_styles (QsciLexer *lexer, int styles[]) |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
222 { |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
223 int max_style = 0; |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
224 int actual_style = 0; |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
225 while (actual_style < MaxStyleNumber && max_style < MaxLexerStyles) |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
226 { |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
227 if ((lexer->description(actual_style)) != "") // valid style |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
228 styles[max_style++] = actual_style; |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
229 actual_style++; |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
230 } |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
231 return max_style; |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
232 } |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
233 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
234 void |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
235 settings_dialog::read_lexer_settings (QsciLexer *lexer, QSettings *settings) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
236 { |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
237 lexer->readSettings (*settings); |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
238 int styles[MaxLexerStyles]; // array for saving valid styles (enum is not continuous) |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
239 int max_style = get_valid_lexer_styles (lexer, styles); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
240 QGridLayout *style_grid = new QGridLayout (); |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
241 QVector<QLabel*> description (max_style); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
242 QVector<QFontComboBox*> select_font (max_style); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
243 QVector<QSpinBox*> font_size (max_style); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
244 QVector<QCheckBox*> attrib_font (3 * max_style); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
245 QVector<color_picker*> color (max_style); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
246 QVector<color_picker*> bg_color (max_style); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
247 int default_size = 10; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
248 QFont default_font = QFont (); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
249 QColor default_color = QColor (); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
250 QColor dummy_color = QColor (255,0,255); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
251 |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
252 for (int i = 0; i < max_style; i++) // create dialog elements for all styles |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
253 { |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
254 QString actual_name = lexer->description (styles[i]); |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
255 QFont actual_font = lexer->font (styles[i]); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
256 description[i] = new QLabel (actual_name); |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
257 description[i]->setWordWrap (true); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
258 description[i]->setMaximumSize (160,QWIDGETSIZE_MAX); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
259 description[i]->setMinimumSize (160,1); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
260 select_font[i] = new QFontComboBox (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
261 select_font[i]->setObjectName (actual_name+"_font"); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
262 select_font[i]->setMaximumSize (180,QWIDGETSIZE_MAX); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
263 select_font[i]->setMinimumSize (180,1); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
264 font_size[i] = new QSpinBox (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
265 font_size[i]->setObjectName (actual_name+"_size"); |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
266 if (styles[i] == 0) // the default |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
267 { |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
268 select_font[i]->setCurrentFont (actual_font); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
269 default_font = actual_font; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
270 font_size[i]->setRange (6,24); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
271 default_size = actual_font.pointSize (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
272 font_size[i]->setValue (default_size); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
273 default_color = lexer->defaultPaper (); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
274 bg_color[i] = new color_picker (default_color); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
275 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
276 else // other styles |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
277 { |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
278 select_font[i]->setCurrentFont (actual_font); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
279 if (actual_font.family () == default_font.family ()) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
280 select_font[i]->setEditText (lexer->description (0)); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
281 font_size[i]->setRange (-4,4); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
282 font_size[i]->setValue (actual_font.pointSize ()-default_size); |
16865
a86327a7d9fb
fix of typos in text strings of the gui
Torsten <ttl@justmail.de>
parents:
16859
diff
changeset
|
283 font_size[i]->setToolTip (tr ("Difference to the default size")); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
284 if (lexer->paper (styles[i]) == default_color) |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
285 bg_color[i] = new color_picker (dummy_color); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
286 else |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
287 bg_color[i] = new color_picker (lexer->paper (styles[i])); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
288 bg_color[i]->setToolTip |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
289 (tr ("Background color, pink (255,0,255) means default")); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
290 } |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
291 attrib_font[0+3*i] = new QCheckBox (tr("b")); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
292 attrib_font[1+3*i] = new QCheckBox (tr("i")); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
293 attrib_font[2+3*i] = new QCheckBox (tr("u")); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
294 attrib_font[0+3*i]->setChecked(Qt::Checked && actual_font.bold ()); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
295 attrib_font[0+3*i]->setObjectName (actual_name+"_bold"); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
296 attrib_font[1+3*i]->setChecked(Qt::Checked && actual_font.italic ()); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
297 attrib_font[1+3*i]->setObjectName (actual_name+"_italic"); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
298 attrib_font[2+3*i]->setChecked(Qt::Checked && actual_font.underline ()); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
299 attrib_font[2+3*i]->setObjectName (actual_name+"_underline"); |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
300 color[i] = new color_picker (lexer->color (styles[i])); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
301 color[i]->setObjectName (actual_name+"_color"); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
302 bg_color[i]->setObjectName (actual_name+"_bg_color"); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
303 int column = 1; |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
304 style_grid->addWidget (description[i], i, column++); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
305 style_grid->addWidget (select_font[i], i, column++); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
306 style_grid->addWidget (font_size[i], i, column++); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
307 style_grid->addWidget (attrib_font[0+3*i], i, column++); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
308 style_grid->addWidget (attrib_font[1+3*i], i, column++); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
309 style_grid->addWidget (attrib_font[2+3*i], i, column++); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
310 style_grid->addWidget (color[i], i, column++); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
311 style_grid->addWidget (bg_color[i], i, column++); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
312 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
313 // place grid with elements into the tab |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
314 QScrollArea *scroll_area = new QScrollArea (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
315 QWidget *scroll_area_contents = new QWidget (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
316 scroll_area_contents->setObjectName (QString (lexer->language ())+"_styles"); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
317 scroll_area_contents->setLayout (style_grid); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
318 scroll_area->setWidget (scroll_area_contents); |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
319 ui->tabs_editor_lexers->addTab (scroll_area,lexer->language ()); |
16623
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
320 |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
321 ui->tabs_editor_lexers->setCurrentIndex ( |
16623
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
322 settings->value("settings/last_editor_styles_tab",0).toInt ()); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
323 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
324 #endif |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
325 |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
326 void |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
327 settings_dialog::read_workspace_colors (QSettings *settings) |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
328 { |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
329 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
330 QList<QColor> default_colors = resource_manager::storage_class_default_colors (); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
331 QStringList class_names = resource_manager::storage_class_names (); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
332 QString class_chars = resource_manager::storage_class_chars (); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
333 int nr_of_classes = class_chars.length (); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
334 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
335 QGridLayout *style_grid = new QGridLayout (); |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
336 QVector<QLabel*> description (nr_of_classes); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
337 QVector<color_picker*> color (nr_of_classes); |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
338 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
339 int column = 0; |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
340 int row = 0; |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
341 for (int i = 0; i < nr_of_classes; i++) |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
342 { |
16749
c9007267cbf5
Variation of color option layouts with columns packed to the left
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16748
diff
changeset
|
343 description[i] = new QLabel (" " + class_names.at (i)); |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
344 description[i]->setAlignment (Qt::AlignRight); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
345 QVariant default_var = default_colors.at (i); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
346 QColor setting_color = settings->value ("workspaceview/color_"+class_chars.mid (i,1), |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
347 default_var).value<QColor> (); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
348 color[i] = new color_picker (setting_color); |
16748
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
349 color[i]->setObjectName ("color_"+class_chars.mid (i, 1)); |
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
350 color[i]->setMinimumSize (30, 10); |
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
351 style_grid->addWidget (description[i], row, 3*column); |
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
352 style_grid->addWidget (color[i], row, 3*column+1); |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
353 if (++column == 3) |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
354 { |
16749
c9007267cbf5
Variation of color option layouts with columns packed to the left
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16748
diff
changeset
|
355 style_grid->setColumnStretch (4*column, 10); |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
356 row++; |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
357 column = 0; |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
358 } |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
359 } |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
360 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
361 // place grid with elements into the tab |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
362 ui->workspace_colors_box->setLayout (style_grid); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
363 } |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
364 |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
365 void |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
366 settings_dialog::read_terminal_colors (QSettings *settings) |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
367 { |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
368 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
369 QList<QColor> default_colors = resource_manager::terminal_default_colors (); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
370 QStringList class_names = resource_manager::terminal_color_names (); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
371 QString class_chars = resource_manager::terminal_color_chars (); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
372 int nr_of_classes = class_chars.length (); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
373 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
374 QGridLayout *style_grid = new QGridLayout (); |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
375 QVector<QLabel*> description (nr_of_classes); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
376 QVector<color_picker*> color (nr_of_classes); |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
377 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
378 int column = 0; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
379 int row = 0; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
380 for (int i = 0; i < nr_of_classes; i++) |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
381 { |
16749
c9007267cbf5
Variation of color option layouts with columns packed to the left
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16748
diff
changeset
|
382 description[i] = new QLabel (" " + class_names.at (i)); |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
383 description[i]->setAlignment (Qt::AlignRight); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
384 QVariant default_var = default_colors.at (i); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
385 QColor setting_color = settings->value ("terminal/color_"+class_chars.mid (i,1), |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
386 default_var).value<QColor> (); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
387 color[i] = new color_picker (setting_color); |
16748
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
388 color[i]->setObjectName ("terminal_color_"+class_chars.mid (i, 1)); |
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
389 color[i]->setMinimumSize (30, 10); |
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
390 style_grid->addWidget (description[i], row, 2*column); |
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
391 style_grid->addWidget (color[i], row, 2*column+1); |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
392 if (++column == 2) |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
393 { |
16748
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
394 style_grid->setColumnStretch (3*column, 10); |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
395 row++; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
396 column = 0; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
397 } |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
398 } |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
399 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
400 // place grid with elements into the tab |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
401 ui->terminal_colors_box->setLayout (style_grid); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
402 } |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
403 |
15274
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
404 void |
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
405 settings_dialog::write_changed_settings () |
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
406 { |
15164
bc801a44bb1f
follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents:
15156
diff
changeset
|
407 QSettings *settings = resource_manager::get_settings (); |
bc801a44bb1f
follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents:
15156
diff
changeset
|
408 // FIXME -- what should happen if settings is 0? |
bc801a44bb1f
follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents:
15156
diff
changeset
|
409 |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
410 // the icon set |
15914
85f9aca30c76
gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents:
15787
diff
changeset
|
411 QString widget_icon_set = "NONE"; |
15787
b081fbe80174
provide separate icons for gui's floating widgets
Torsten <ttl@justmail.de>
parents:
15368
diff
changeset
|
412 if (ui->general_icon_letter->isChecked ()) |
15914
85f9aca30c76
gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents:
15787
diff
changeset
|
413 widget_icon_set = "LETTER"; |
15787
b081fbe80174
provide separate icons for gui's floating widgets
Torsten <ttl@justmail.de>
parents:
15368
diff
changeset
|
414 else if (ui->general_icon_graphic->isChecked ()) |
15914
85f9aca30c76
gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents:
15787
diff
changeset
|
415 widget_icon_set = "GRAPHIC"; |
15787
b081fbe80174
provide separate icons for gui's floating widgets
Torsten <ttl@justmail.de>
parents:
15368
diff
changeset
|
416 settings->setValue ("DockWidgets/widget_icon_set",widget_icon_set); |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
417 |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
418 // language |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
419 QString language = ui->comboBox_language->currentText (); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
420 if (language == tr("System setting")) |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
421 language = "SYSTEM"; |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
422 settings->setValue ("language", language); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
423 |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
424 // other settings |
16525
e192525236ad
configurable size of toolbar icons
Torsten <ttl@justmail.de>
parents:
16500
diff
changeset
|
425 settings->setValue ("toolbar_icon_size", ui->toolbar_icon_size->value ()); |
13537
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13536
diff
changeset
|
426 settings->setValue ("useCustomFileEditor", ui->useCustomFileEditor->isChecked ()); |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13536
diff
changeset
|
427 settings->setValue ("customFileEditor", ui->customFileEditor->text ()); |
13659
d98c6ef06dff
included some editor setting into the setting dialog
ttl <ttl@justmail.de>
parents:
13609
diff
changeset
|
428 settings->setValue ("editor/showLineNumbers", ui->editor_showLineNumbers->isChecked ()); |
14307
be3e1a14a6de
Added an interface settings tab to the settings dialog. Made a few improvements on the editor. Wrote a small welcome text in the welcome wizard. Moved configuration file to ~/.config/octave-gui/settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14290
diff
changeset
|
429 settings->setValue ("editor/highlightCurrentLine", ui->editor_highlightCurrentLine->isChecked ()); |
16693
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
430 settings->setValue ("editor/highlight_current_line_color",_editor_current_line_color->color ()); |
13659
d98c6ef06dff
included some editor setting into the setting dialog
ttl <ttl@justmail.de>
parents:
13609
diff
changeset
|
431 settings->setValue ("editor/codeCompletion", ui->editor_codeCompletion->isChecked ()); |
16679
cf939872811c
options for auto completion threshold, source and word replacement in settings
Torsten <ttl@justmail.de>
parents:
16677
diff
changeset
|
432 settings->setValue ("editor/codeCompletion_threshold", ui->editor_spinbox_ac_threshold->value ()); |
cf939872811c
options for auto completion threshold, source and word replacement in settings
Torsten <ttl@justmail.de>
parents:
16677
diff
changeset
|
433 settings->setValue ("editor/codeCompletion_keywords", ui->editor_checkbox_ac_keywords->isChecked ()); |
cf939872811c
options for auto completion threshold, source and word replacement in settings
Torsten <ttl@justmail.de>
parents:
16677
diff
changeset
|
434 settings->setValue ("editor/codeCompletion_document", ui->editor_checkbox_ac_document->isChecked ()); |
16701
ccfbc767ff5a
make case sensitivity of editors auto completion list configurable
Torsten <ttl@justmail.de>
parents:
16700
diff
changeset
|
435 settings->setValue ("editor/codeCompletion_case", ui->editor_checkbox_ac_case->isChecked ()); |
16679
cf939872811c
options for auto completion threshold, source and word replacement in settings
Torsten <ttl@justmail.de>
parents:
16677
diff
changeset
|
436 settings->setValue ("editor/codeCompletion_replace", ui->editor_checkbox_ac_replace->isChecked ()); |
16702
553cfdd5d660
make white space visibility in the editor configurable
Torsten <ttl@justmail.de>
parents:
16701
diff
changeset
|
437 settings->setValue ("editor/show_white_space", ui->editor_ws_checkbox->isChecked ()); |
553cfdd5d660
make white space visibility in the editor configurable
Torsten <ttl@justmail.de>
parents:
16701
diff
changeset
|
438 settings->setValue ("editor/show_white_space_indent", ui->editor_ws_indent_checkbox->isChecked ()); |
16703
5cf19370011d
add more settings concerning tabs and indentation to the editor settings
Torsten <ttl@justmail.de>
parents:
16702
diff
changeset
|
439 settings->setValue ("editor/auto_indent", ui->editor_auto_ind_checkbox->isChecked ()); |
5cf19370011d
add more settings concerning tabs and indentation to the editor settings
Torsten <ttl@justmail.de>
parents:
16702
diff
changeset
|
440 settings->setValue ("editor/tab_indents_line", ui->editor_tab_ind_checkbox->isChecked ()); |
5cf19370011d
add more settings concerning tabs and indentation to the editor settings
Torsten <ttl@justmail.de>
parents:
16702
diff
changeset
|
441 settings->setValue ("editor/backspace_unindents_line", ui->editor_bs_unind_checkbox->isChecked ()); |
5cf19370011d
add more settings concerning tabs and indentation to the editor settings
Torsten <ttl@justmail.de>
parents:
16702
diff
changeset
|
442 settings->setValue ("editor/show_indent_guides", ui->editor_ind_guides_checkbox->isChecked ()); |
5cf19370011d
add more settings concerning tabs and indentation to the editor settings
Torsten <ttl@justmail.de>
parents:
16702
diff
changeset
|
443 settings->setValue ("editor/indent_width", ui->editor_ind_width_spinbox->value ()); |
5cf19370011d
add more settings concerning tabs and indentation to the editor settings
Torsten <ttl@justmail.de>
parents:
16702
diff
changeset
|
444 settings->setValue ("editor/tab_width", ui->editor_tab_width_spinbox->value ()); |
13672
c9501268a194
filename with or without full path in tabs of the editor
ttl <ttl@justmail.de>
parents:
13659
diff
changeset
|
445 settings->setValue ("editor/longWindowTitle", ui->editor_longWindowTitle->isChecked()); |
15356
842ab161c10a
GUI: new setting to restore tabs from previous session; allow silent load file
Thorsten Liebig <Thorsten.Liebig@gmx.de>
parents:
15355
diff
changeset
|
446 settings->setValue ("editor/restoreSession", ui->editor_restoreSession->isChecked ()); |
17740
e6ed77b75aec
new preference in settings: editor creates nonexisting files wihtout prompt
Torsten <ttl@justmail.de>
parents:
17676
diff
changeset
|
447 settings->setValue ("editor/create_new_file", ui->editor_create_new_file->isChecked ()); |
14588
fa52c6e84ae0
Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents:
14308
diff
changeset
|
448 settings->setValue ("terminal/fontSize", ui->terminal_fontSize->value()); |
fa52c6e84ae0
Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents:
14308
diff
changeset
|
449 settings->setValue ("terminal/fontName", ui->terminal_fontName->currentFont().family()); |
16499
facf00ce97d3
gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents:
16410
diff
changeset
|
450 settings->setValue ("filesdockwidget/showFileSize", ui->showFileSize->isChecked ()); |
facf00ce97d3
gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents:
16410
diff
changeset
|
451 settings->setValue ("filesdockwidget/showFileType", ui->showFileType->isChecked ()); |
facf00ce97d3
gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents:
16410
diff
changeset
|
452 settings->setValue ("filesdockwidget/showLastModified", ui->showLastModified->isChecked ()); |
facf00ce97d3
gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents:
16410
diff
changeset
|
453 settings->setValue ("filesdockwidget/showHiddenFiles", ui->showHiddenFiles->isChecked ()); |
facf00ce97d3
gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents:
16410
diff
changeset
|
454 settings->setValue ("filesdockwidget/useAlternatingRowColors", ui->useAlternatingRowColors->isChecked ()); |
facf00ce97d3
gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents:
16410
diff
changeset
|
455 settings->setValue ("filesdockwidget/sync_octave_directory", ui->sync_octave_directory->isChecked ()); |
13607
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
456 settings->setValue ("useProxyServer", ui->useProxyServer->isChecked ()); |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
457 settings->setValue ("proxyType", ui->proxyType->currentText ()); |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
458 settings->setValue ("proxyHostName", ui->proxyHostName->text ()); |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
459 settings->setValue ("proxyPort", ui->proxyPort->text ()); |
13609
b355901aade4
Added username and password field to proxy settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
460 settings->setValue ("proxyUserName", ui->proxyUserName->text ()); |
b355901aade4
Added username and password field to proxy settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
461 settings->setValue ("proxyPassword", ui->proxyPassword->text ()); |
14998
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
462 settings->setValue ("terminal/cursorBlinking", ui->terminal_cursorBlinking->isChecked ()); |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
463 settings->setValue ("terminal/cursorUseForegroundColor", ui->terminal_cursorUseForegroundColor->isChecked ()); |
14998
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
464 |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
465 // the cursor |
14998
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
466 QString cursorType; |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
467 switch (ui->terminal_cursorType->currentIndex ()) |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
468 { |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
469 case 0: cursorType = "ibeam"; break; |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
470 case 1: cursorType = "block"; break; |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
471 case 2: cursorType = "underline"; break; |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
472 } |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
473 settings->setValue ("terminal/cursorType", cursorType); |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
474 settings->sync (); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
475 |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
476 #ifdef HAVE_QSCINTILLA |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
477 // editor styles: create lexer, get dialog contents, and write settings |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
478 QsciLexer *lexer; |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
479 #if defined (HAVE_LEXER_OCTAVE) |
16646
025bc6b5080e
use QScintilla's lexer for highlighting Octave programs
John W. Eaton <jwe@octave.org>
parents:
16636
diff
changeset
|
480 lexer = new QsciLexerOctave (); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
481 write_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
482 delete lexer; |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
483 #elif defined (HAVE_LEXER_MATLAB) |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
484 lexer = new QsciLexerMatlab (); |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
485 write_lexer_settings (lexer,settings); |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
486 delete lexer; |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
487 #endif |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
488 lexer = new QsciLexerCPP (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
489 write_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
490 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
491 lexer = new QsciLexerPerl (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
492 write_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
493 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
494 lexer = new QsciLexerBatch (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
495 write_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
496 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
497 lexer = new QsciLexerDiff (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
498 write_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
499 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
500 lexer = new QsciLexerBash (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
501 write_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
502 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
503 #endif |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
504 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
505 write_workspace_colors (settings); |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
506 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
507 write_terminal_colors (settings); |
16623
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
508 |
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
509 settings->setValue("settings/last_tab",ui->tabWidget->currentIndex ()); |
13501 | 510 } |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
511 |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
512 #ifdef HAVE_QSCINTILLA |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
513 void |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
514 settings_dialog::write_lexer_settings (QsciLexer *lexer, QSettings *settings) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
515 { |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
516 QWidget *tab = ui->tabs_editor_lexers-> |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
517 findChild <QWidget *>(QString (lexer->language ())+"_styles"); |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
518 int styles[MaxLexerStyles]; // array for saving valid styles (enum is not continuous) |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
519 int max_style = get_valid_lexer_styles (lexer, styles); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
520 QFontComboBox *select_font; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
521 QSpinBox *font_size; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
522 QCheckBox *attrib_font[3]; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
523 color_picker *color; |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
524 color_picker *bg_color; |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
525 int default_size = 10; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
526 QFont default_font = QFont ("Courier New",10,-1,0); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
527 QColor default_color = QColor (); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
528 QColor dummy_color = QColor (255,0,255); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
529 |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
530 for (int i = 0; i < max_style; i++) // get dialog elements and their contents |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
531 { |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
532 QString actual_name = lexer->description (styles[i]); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
533 select_font = tab->findChild <QFontComboBox *>(actual_name+"_font"); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
534 font_size = tab->findChild <QSpinBox *>(actual_name+"_size"); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
535 attrib_font[0] = tab->findChild <QCheckBox *>(actual_name+"_bold"); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
536 attrib_font[1] = tab->findChild <QCheckBox *>(actual_name+"_italic"); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
537 attrib_font[2] = tab->findChild <QCheckBox *>(actual_name+"_underline"); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
538 color = tab->findChild <color_picker *>(actual_name+"_color"); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
539 bg_color = tab->findChild <color_picker *>(actual_name+"_bg_color"); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
540 QFont new_font = default_font; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
541 if (select_font) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
542 { |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
543 new_font = select_font->currentFont (); |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
544 if (styles[i] == 0) |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
545 default_font = new_font; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
546 else |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
547 if (select_font->currentText () == lexer->description (0)) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
548 new_font = default_font; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
549 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
550 if (font_size) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
551 { |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
552 if (styles[i] == 0) |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
553 { |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
554 default_size = font_size->value (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
555 new_font.setPointSize (font_size->value ()); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
556 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
557 else |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
558 new_font.setPointSize (font_size->value ()+default_size); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
559 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
560 if (attrib_font[0]) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
561 new_font.setBold (attrib_font[0]->isChecked ()); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
562 if (attrib_font[1]) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
563 new_font.setItalic (attrib_font[1]->isChecked ()); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
564 if (attrib_font[2]) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
565 new_font.setUnderline (attrib_font[2]->isChecked ()); |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
566 lexer->setFont (new_font,styles[i]); |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
567 if (styles[i] == 0) |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
568 lexer->setDefaultFont (new_font); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
569 if (color) |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
570 lexer->setColor (color->color (),styles[i]); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
571 if (bg_color) |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
572 { |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
573 if (styles[i] == 0) |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
574 { |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
575 default_color = bg_color->color (); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
576 lexer->setPaper (default_color,styles[i]); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
577 lexer->setDefaultPaper (default_color); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
578 } |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
579 else |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
580 { |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
581 if (bg_color->color () == dummy_color) |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
582 lexer->setPaper (default_color,styles[i]); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
583 else |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
584 lexer->setPaper (bg_color->color (),styles[i]); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
585 } |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
586 } |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
587 } |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
588 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
589 lexer->writeSettings (*settings); |
16623
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
590 |
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
591 settings->setValue ( |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
592 "settings/last_editor_styles_tab",ui->tabs_editor_lexers->currentIndex ()); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
593 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
594 #endif |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
595 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
596 void |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
597 settings_dialog::write_workspace_colors (QSettings *settings) |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
598 { |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
599 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
600 QString class_chars = resource_manager::storage_class_chars (); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
601 color_picker *color; |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
602 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
603 for (int i = 0; i < class_chars.length (); i++) |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
604 { |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
605 color = ui->workspace_colors_box->findChild <color_picker *>( |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
606 "color_"+class_chars.mid (i,1)); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
607 if (color) |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
608 settings->setValue ("workspaceview/color_"+class_chars.mid (i,1), |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
609 color->color ()); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
610 } |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
611 settings->sync (); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
612 } |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
613 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
614 void |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
615 settings_dialog::write_terminal_colors (QSettings *settings) |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
616 { |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
617 QString class_chars = resource_manager::terminal_color_chars (); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
618 color_picker *color; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
619 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
620 for (int i = 0; i < class_chars.length (); i++) |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
621 { |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
622 color = ui->terminal_colors_box->findChild <color_picker *>( |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
623 "terminal_color_"+class_chars.mid (i,1)); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
624 if (color) |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
625 settings->setValue ("terminal/color_"+class_chars.mid (i,1), |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
626 color->color ()); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
627 } |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
628 settings->sync (); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
629 } |