Mercurial > hg > octave-nkf
annotate libgui/src/settings-dialog.cc @ 18898:f6f1f27026bb gui-release
status bars and code folding a user preference (bug #42306)
* settings-dialog.ui: new checkboxes for status bars (main window
and editor) and code folding
* settings-dialog.cc (constructor): init new checkboxes from settings,
(write-changed-settings): write boxes check states into settings
* file-editor-tab.cc (constructor): do not set code folding here,
(notice-settings): set code folding and show/hide status bar
depending on settings
* main-window.cc (notice-settings): show/hide status bar depending on settings
author | Torsten <ttl@justmail.de> |
---|---|
date | Tue, 06 May 2014 20:38:50 +0200 |
parents | 95249367d6fa |
children | dff05c124017 3f6280d0a36b |
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 |
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
17740
diff
changeset
|
3 Copyright (C) 2011-2013 Jacob Dawid |
15204
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" |
18759
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
18758
diff
changeset
|
28 #include "shortcut-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
|
29 #include "workspace-model.h" |
14707
674740c44c09
Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14703
diff
changeset
|
30 #include "settings-dialog.h" |
15156
141b0b108292
allow building without gui to work
John W. Eaton <jwe@octave.org>
parents:
14998
diff
changeset
|
31 #include "ui-settings-dialog.h" |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
32 #include <QDir> |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
33 #include <QFileInfo> |
18351
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
34 #include <QFileDialog> |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
35 #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
|
36 #include <QHash> |
13501 | 37 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
38 #ifdef HAVE_QSCINTILLA |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
39 #include <QScrollArea> |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
40 |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
41 #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
|
42 #define HAVE_LEXER_OCTAVE |
16646
025bc6b5080e
use QScintilla's lexer for highlighting Octave programs
John W. Eaton <jwe@octave.org>
parents:
16636
diff
changeset
|
43 #include <Qsci/qscilexeroctave.h> |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
44 #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
|
45 #define HAVE_LEXER_MATLAB |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
46 #include <Qsci/qscilexermatlab.h> |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
47 #endif |
16677
f6dfc7705623
* settings-dialog.cc: enable octave lexer editor styles if lexer is present
Torsten <ttl@justmail.de>
parents:
16667
diff
changeset
|
48 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
49 #include <Qsci/qscilexercpp.h> |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
50 #include <Qsci/qscilexerbash.h> |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
51 #include <Qsci/qscilexerperl.h> |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
52 #include <Qsci/qscilexerbatch.h> |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
53 #include <Qsci/qscilexerdiff.h> |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
54 #endif |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
55 |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
56 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
|
57 QDialog (p), ui (new Ui::settings_dialog) |
13501 | 58 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
59 ui->setupUi (this); |
13501 | 60 |
18759
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
18758
diff
changeset
|
61 shortcut_manager::fill_treewidget (ui->shortcuts_treewidget); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
18758
diff
changeset
|
62 |
15164
bc801a44bb1f
follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents:
15156
diff
changeset
|
63 QSettings *settings = resource_manager::get_settings (); |
18344
e8176099889c
settings dialog with varaible size (bug #41197)
Torsten <ttl@justmail.de>
parents:
18319
diff
changeset
|
64 |
e8176099889c
settings dialog with varaible size (bug #41197)
Torsten <ttl@justmail.de>
parents:
18319
diff
changeset
|
65 // restore last geometry |
e8176099889c
settings dialog with varaible size (bug #41197)
Torsten <ttl@justmail.de>
parents:
18319
diff
changeset
|
66 restoreGeometry (settings->value("settings/geometry").toByteArray ()); |
15164
bc801a44bb1f
follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents:
15156
diff
changeset
|
67 |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
68 // look for available language files and the actual settings |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
69 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
|
70 QDir qm_dir (qm_dir_name); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
71 QFileInfoList qm_files = qm_dir.entryInfoList (QStringList ("*.qm"), |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
72 QDir::Files | QDir::Readable, |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
73 QDir::Name); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
74 for (int i = 0; i < qm_files.length (); i++) // insert available languages |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
75 ui->comboBox_language->addItem (qm_files.at (i).baseName ()); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
76 // System at beginning |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
77 ui->comboBox_language->insertItem (0,tr ("System setting")); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
78 ui->comboBox_language->insertSeparator (1); // separator after System |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
79 QString language = settings->value ("language","SYSTEM").toString (); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
80 if (language == "SYSTEM") |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
81 language = tr ("System setting"); |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
82 int selected = ui->comboBox_language->findText (language); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
83 if (selected >= 0) |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
84 ui->comboBox_language->setCurrentIndex (selected); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
85 else |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
86 ui->comboBox_language->setCurrentIndex (0); // System is default |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
87 |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
88 ui->toolbar_icon_size->setValue (settings->value ("toolbar_icon_size", |
17988
d62570cfbab9
reduce default icon size to 16 pixel for larger working areas in the widgets
Torsten <ttl@justmail.de>
parents:
17942
diff
changeset
|
89 16).toInt ()); |
16525
e192525236ad
configurable size of toolbar icons
Torsten <ttl@justmail.de>
parents:
16500
diff
changeset
|
90 |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
91 // 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
|
92 QString widget_icon_set = |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
93 settings->value ("DockWidgets/widget_icon_set","NONE").toString (); |
15914
85f9aca30c76
gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents:
15787
diff
changeset
|
94 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
|
95 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
|
96 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
|
97 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
|
98 |
18179
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
99 // custom title bar of dock widget |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
100 QVariant default_var = QColor (255,255,255); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
101 QColor bg_color = settings->value ("Dockwidgets/title_bg_color", |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
102 default_var).value<QColor> (); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
103 _widget_title_bg_color = new color_picker (bg_color); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
104 _widget_title_bg_color->setEnabled (false); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
105 ui->layout_widget_bgtitle->addWidget (_widget_title_bg_color,0); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
106 connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)), |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
107 _widget_title_bg_color, SLOT (setEnabled (bool))); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
108 |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
109 default_var = QColor (0,0,0); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
110 QColor fg_color = settings->value ("Dockwidgets/title_fg_color", |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
111 default_var).value<QColor> (); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
112 _widget_title_fg_color = new color_picker (fg_color); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
113 _widget_title_fg_color->setEnabled (false); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
114 ui->layout_widget_fgtitle->addWidget (_widget_title_fg_color,0); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
115 connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)), |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
116 _widget_title_fg_color, SLOT (setEnabled (bool))); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
117 |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
118 ui->cb_widget_custom_style->setChecked ( |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
119 settings->value ("DockWidgets/widget_title_custom_style",false).toBool ()); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
120 |
18787
7cb98e81ecd1
GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents:
18759
diff
changeset
|
121 // prompt on exit |
7cb98e81ecd1
GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents:
18759
diff
changeset
|
122 ui->cb_prompt_to_exit->setChecked ( |
7cb98e81ecd1
GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents:
18759
diff
changeset
|
123 settings->value ("prompt_to_exit",false).toBool ()); |
7cb98e81ecd1
GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents:
18759
diff
changeset
|
124 |
18898
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
125 // Main status bar |
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
126 ui->cb_status_bar->setChecked ( |
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
127 settings->value ("show_status_bar",true).toBool ()); |
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
128 |
18351
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
129 // Octave startup |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
130 ui->cb_restore_octave_dir->setChecked ( |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
131 settings->value ("restore_octave_dir",false).toBool ()); |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
132 ui->le_octave_dir->setText ( |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
133 settings->value ("octave_startup_dir").toString ()); |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
134 connect (ui->pb_octave_dir, SIGNAL (pressed ()), |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
135 this, SLOT (get_octave_dir ())); |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
136 |
18179
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
137 // editor |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
138 ui->useCustomFileEditor->setChecked (settings->value ("useCustomFileEditor", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
139 false).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
140 ui->customFileEditor->setText ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
141 settings->value ("customFileEditor").toString ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
142 ui->editor_showLineNumbers->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
143 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
|
144 |
18179
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
145 default_var = QColor (240, 240, 240); |
16693
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
146 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
|
147 default_var).value<QColor> (); |
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
148 _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
|
149 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
|
150 _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
|
151 _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
|
152 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
|
153 _editor_current_line_color, SLOT (setEnabled (bool))); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
154 ui->editor_highlightCurrentLine->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
155 settings->value ("editor/highlightCurrentLine",true).toBool () ); |
18557
6eae8ba32e62
provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents:
18411
diff
changeset
|
156 ui->editor_long_line_marker->setChecked ( |
6eae8ba32e62
provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents:
18411
diff
changeset
|
157 settings->value ("editor/long_line_marker",true).toBool ()); |
6eae8ba32e62
provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents:
18411
diff
changeset
|
158 ui->editor_long_line_column->setValue ( |
6eae8ba32e62
provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents:
18411
diff
changeset
|
159 settings->value ("editor/long_line_column",80).toInt ()); |
18898
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
160 ui->cb_edit_status_bar->setChecked ( |
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
161 settings->value ("editor/show_edit_status_bar",true).toBool ()); |
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
162 ui->cb_code_folding->setChecked ( |
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
163 settings->value ("editor/code_folding",true).toBool ()); |
16693
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
164 |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
165 ui->editor_codeCompletion->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
166 settings->value ("editor/codeCompletion", true).toBool () ); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
167 ui->editor_spinbox_ac_threshold->setValue ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
168 settings->value ("editor/codeCompletion_threshold",2).toInt ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
169 ui->editor_checkbox_ac_keywords->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
170 settings->value ("editor/codeCompletion_keywords",true).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
171 ui->editor_checkbox_ac_document->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
172 settings->value ("editor/codeCompletion_document",false).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
173 ui->editor_checkbox_ac_case->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
174 settings->value ("editor/codeCompletion_case",true).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
175 ui->editor_checkbox_ac_replace->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
176 settings->value ("editor/codeCompletion_replace",false).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
177 ui->editor_ws_checkbox->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
178 settings->value ("editor/show_white_space", false).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
179 ui->editor_ws_indent_checkbox->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
180 settings->value ("editor/show_white_space_indent",false).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
181 ui->editor_auto_ind_checkbox->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
182 settings->value ("editor/auto_indent", true).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
183 ui->editor_tab_ind_checkbox->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
184 settings->value ("editor/tab_indents_line",false).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
185 ui->editor_bs_unind_checkbox->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
186 settings->value ("editor/backspace_unindents_line",false).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
187 ui->editor_ind_guides_checkbox->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
188 settings->value ("editor/show_indent_guides",false).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
189 ui->editor_ind_width_spinbox->setValue ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
190 settings->value ("editor/indent_width", 2).toInt ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
191 ui->editor_tab_width_spinbox->setValue ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
192 settings->value ("editor/tab_width", 2).toInt ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
193 ui->editor_longWindowTitle->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
194 settings->value ("editor/longWindowTitle",false).toBool ()); |
18411
3df71e1d3b24
improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents:
18352
diff
changeset
|
195 ui->editor_notebook_tab_width_min->setValue ( |
3df71e1d3b24
improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents:
18352
diff
changeset
|
196 settings->value ("editor/notebook_tab_width_min", 160).toInt ()); |
3df71e1d3b24
improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents:
18352
diff
changeset
|
197 ui->editor_notebook_tab_width_max->setValue ( |
3df71e1d3b24
improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents:
18352
diff
changeset
|
198 settings->value ("editor/notebook_tab_width_max", 300).toInt ()); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
199 ui->editor_restoreSession->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
200 settings->value ("editor/restoreSession", true).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
201 ui->editor_create_new_file->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
202 settings->value ("editor/create_new_file",false).toBool ()); |
18557
6eae8ba32e62
provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents:
18411
diff
changeset
|
203 |
6eae8ba32e62
provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents:
18411
diff
changeset
|
204 // terminal |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
205 ui->terminal_fontName->setCurrentFont (QFont ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
206 settings->value ("terminal/fontName","Courier New").toString ()) ); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
207 ui->terminal_fontSize->setValue ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
208 settings->value ("terminal/fontSize", 10).toInt ()); |
18758
6e81b59d657c
Add preference for terminal windows buffer size (bug #41474)
Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
parents:
18557
diff
changeset
|
209 ui->terminal_history_buffer->setValue ( |
6e81b59d657c
Add preference for terminal windows buffer size (bug #41474)
Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
parents:
18557
diff
changeset
|
210 settings->value ("terminal/history_buffer",1000).toInt ()); |
18352
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
211 |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
212 // file browser |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
213 ui->showFileSize->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
214 settings->value ("filesdockwidget/showFileSize", false).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
215 ui->showFileType->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
216 settings->value ("filesdockwidget/showFileType", false).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
217 ui->showLastModified->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
218 settings->value ("filesdockwidget/showLastModified",false).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
219 ui->showHiddenFiles->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
220 settings->value ("filesdockwidget/showHiddenFiles",false).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
221 ui->useAlternatingRowColors->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
222 settings->value ("filesdockwidget/useAlternatingRowColors",true).toBool ()); |
18352
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
223 connect (ui->sync_octave_directory, SIGNAL (toggled (bool)), |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
224 this, SLOT (set_disabled_pref_file_browser_dir (bool))); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
225 ui->sync_octave_directory->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
226 settings->value ("filesdockwidget/sync_octave_directory",true).toBool ()); |
18352
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
227 ui->cb_restore_file_browser_dir->setChecked ( |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
228 settings->value ("filesdockwidget/restore_last_dir",false).toBool ()); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
229 ui->le_file_browser_dir->setText ( |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
230 settings->value ("filesdockwidget/startup_dir").toString ()); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
231 connect (ui->pb_file_browser_dir, SIGNAL (pressed ()), |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
232 this, SLOT (get_file_browser_dir ())); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
233 |
17942
0b71746689dc
add preference for allowing connections to the octave web site
Torsten <ttl@justmail.de>
parents:
17790
diff
changeset
|
234 ui->checkbox_allow_web_connect->setChecked ( |
0b71746689dc
add preference for allowing connections to the octave web site
Torsten <ttl@justmail.de>
parents:
17790
diff
changeset
|
235 settings->value ("news/allow_web_connection",false).toBool ()); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
236 ui->useProxyServer->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
237 settings->value ("useProxyServer", false).toBool ()); |
13607
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
238 ui->proxyHostName->setText (settings->value ("proxyHostName").toString ()); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
239 ui->terminal_cursorBlinking->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
240 settings->value ("terminal/cursorBlinking",true).toBool ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
241 ui->terminal_cursorUseForegroundColor->setChecked ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
242 settings->value ("terminal/cursorUseForegroundColor",true).toBool ()); |
18155
14acb08d75fa
gui: optionally set focus to console when a command is run from another widget
Torsten <ttl@justmail.de>
parents:
17988
diff
changeset
|
243 ui->terminal_focus_command->setChecked ( |
14acb08d75fa
gui: optionally set focus to console when a command is run from another widget
Torsten <ttl@justmail.de>
parents:
17988
diff
changeset
|
244 settings->value ("terminal/focus_after_command",false).toBool ()); |
14998
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
245 |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
246 QString cursorType |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
247 = 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
|
248 |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
249 QStringList items; |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
250 items << QString ("0") << QString ("1") << QString ("2"); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
251 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
|
252 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
|
253 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
|
254 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
|
255 |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
256 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
|
257 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
|
258 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
|
259 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
|
260 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
|
261 ui->terminal_cursorType->setCurrentIndex (2); |
13607
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
262 |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
263 int currentIndex = 0; |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
264 QString proxyTypeString = settings->value ("proxyType").toString (); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
265 while ( (currentIndex < ui->proxyType->count ()) |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
266 && (ui->proxyType->currentText () != proxyTypeString)) |
13607
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
267 { |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
268 currentIndex++; |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
269 ui->proxyType->setCurrentIndex (currentIndex); |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
270 } |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
271 |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
272 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
|
273 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
|
274 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
|
275 |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
276 // qorkspace colors |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
277 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
|
278 |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
279 // terminal colors |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
280 read_terminal_colors (settings); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
281 |
18882
f017240310fb
disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents:
18787
diff
changeset
|
282 // shortcuts |
f017240310fb
disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents:
18787
diff
changeset
|
283 ui->cb_prevent_readline_conflicts->setChecked ( |
f017240310fb
disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents:
18787
diff
changeset
|
284 settings->value ("shortcuts/prevent_readline_conflicts", true).toBool ()); |
18893
95249367d6fa
provide a second set of shortcuts
Torsten <ttl@justmail.de>
parents:
18882
diff
changeset
|
285 int set = settings->value ("shortcuts/set",0).toInt (); |
95249367d6fa
provide a second set of shortcuts
Torsten <ttl@justmail.de>
parents:
18882
diff
changeset
|
286 ui->rb_sc_set1->setChecked (set == 0); |
95249367d6fa
provide a second set of shortcuts
Torsten <ttl@justmail.de>
parents:
18882
diff
changeset
|
287 ui->rb_sc_set2->setChecked (set == 1); |
18882
f017240310fb
disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents:
18787
diff
changeset
|
288 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
289 #ifdef HAVE_QSCINTILLA |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
290 // 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
|
291 QsciLexer *lexer; |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
292 #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
|
293 lexer = new QsciLexerOctave (); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
294 read_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
295 delete lexer; |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
296 #elif defined (HAVE_LEXER_MATLAB) |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
297 lexer = new QsciLexerMatlab (); |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
298 read_lexer_settings (lexer,settings); |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
299 delete lexer; |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
300 #endif |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
301 lexer = new QsciLexerCPP (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
302 read_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
303 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
304 lexer = new QsciLexerPerl (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
305 read_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
306 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
307 lexer = new QsciLexerBatch (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
308 read_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
309 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
310 lexer = new QsciLexerDiff (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
311 read_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
312 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
313 lexer = new QsciLexerBash (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
314 read_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
315 delete lexer; |
16623
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
316 #endif |
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
317 |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
318 // 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
|
319 if (desired_tab.isEmpty ()) |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
320 ui->tabWidget->setCurrentIndex (settings->value ("settings/last_tab", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
321 0).toInt ()); |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
322 else |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
323 { |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
324 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
|
325 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
|
326 tab_hash["editor_styles"] = ui->tab_editor_styles; |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
327 ui->tabWidget->setCurrentIndex ( |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
328 ui->tabWidget->indexOf (tab_hash.value (desired_tab))); |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
329 } |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
330 |
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
331 |
13501 | 332 } |
333 | |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
334 settings_dialog::~settings_dialog () |
13501 | 335 { |
15274
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
336 delete ui; |
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
337 } |
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
338 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
339 |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
340 #ifdef HAVE_QSCINTILLA |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
341 int |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
342 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
|
343 { |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
344 int max_style = 0; |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
345 int actual_style = 0; |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
346 while (actual_style < MaxStyleNumber && max_style < MaxLexerStyles) |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
347 { |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
348 if ((lexer->description (actual_style)) != "") // valid style |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
349 styles[max_style++] = actual_style; |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
350 actual_style++; |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
351 } |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
352 return max_style; |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
353 } |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
354 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
355 void |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
356 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
|
357 { |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
358 lexer->readSettings (*settings); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
359 int styles[MaxLexerStyles]; // array for saving valid styles |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
360 // (enum is not continuous) |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
361 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
|
362 QGridLayout *style_grid = new QGridLayout (); |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
363 QVector<QLabel*> description (max_style); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
364 QVector<QFontComboBox*> select_font (max_style); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
365 QVector<QSpinBox*> font_size (max_style); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
366 QVector<QCheckBox*> attrib_font (3 * max_style); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
367 QVector<color_picker*> color (max_style); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
368 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
|
369 int default_size = 10; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
370 QFont default_font = QFont (); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
371 QColor default_color = QColor (); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
372 QColor dummy_color = QColor (255,0,255); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
373 |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
374 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
|
375 { |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
376 QString actual_name = lexer->description (styles[i]); |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
377 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
|
378 description[i] = new QLabel (actual_name); |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
379 description[i]->setWordWrap (true); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
380 description[i]->setMaximumSize (160,QWIDGETSIZE_MAX); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
381 description[i]->setMinimumSize (160,1); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
382 select_font[i] = new QFontComboBox (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
383 select_font[i]->setObjectName (actual_name+"_font"); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
384 select_font[i]->setMaximumSize (180,QWIDGETSIZE_MAX); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
385 select_font[i]->setMinimumSize (180,1); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
386 font_size[i] = new QSpinBox (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
387 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
|
388 if (styles[i] == 0) // the default |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
389 { |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
390 select_font[i]->setCurrentFont (actual_font); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
391 default_font = actual_font; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
392 font_size[i]->setRange (6,24); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
393 default_size = actual_font.pointSize (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
394 font_size[i]->setValue (default_size); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
395 default_color = lexer->defaultPaper (); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
396 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
|
397 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
398 else // other styles |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
399 { |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
400 select_font[i]->setCurrentFont (actual_font); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
401 if (actual_font.family () == default_font.family ()) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
402 select_font[i]->setEditText (lexer->description (0)); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
403 font_size[i]->setRange (-4,4); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
404 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
|
405 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
|
406 if (lexer->paper (styles[i]) == default_color) |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
407 bg_color[i] = new color_picker (dummy_color); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
408 else |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
409 bg_color[i] = new color_picker (lexer->paper (styles[i])); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
410 bg_color[i]->setToolTip |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
411 (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
|
412 } |
18276
0b5f669f5b03
fix some translation issues (bug #41159)
Torsten <ttl@justmail.de>
parents:
17988
diff
changeset
|
413 attrib_font[0+3*i] = new QCheckBox (tr ("b", "short form for bold")); |
0b5f669f5b03
fix some translation issues (bug #41159)
Torsten <ttl@justmail.de>
parents:
17988
diff
changeset
|
414 attrib_font[1+3*i] = new QCheckBox (tr ("i", "short form for italic")); |
0b5f669f5b03
fix some translation issues (bug #41159)
Torsten <ttl@justmail.de>
parents:
17988
diff
changeset
|
415 attrib_font[2+3*i] = new QCheckBox (tr ("u", "short form for underlined")); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
416 attrib_font[0+3*i]->setChecked (Qt::Checked && actual_font.bold ()); |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
417 attrib_font[0+3*i]->setObjectName (actual_name+"_bold"); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
418 attrib_font[1+3*i]->setChecked (Qt::Checked && actual_font.italic ()); |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
419 attrib_font[1+3*i]->setObjectName (actual_name+"_italic"); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
420 attrib_font[2+3*i]->setChecked (Qt::Checked && actual_font.underline ()); |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
421 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
|
422 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
|
423 color[i]->setObjectName (actual_name+"_color"); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
424 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
|
425 int column = 1; |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
426 style_grid->addWidget (description[i], i, column++); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
427 style_grid->addWidget (select_font[i], i, column++); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
428 style_grid->addWidget (font_size[i], i, column++); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
429 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
|
430 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
|
431 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
|
432 style_grid->addWidget (color[i], i, column++); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
433 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
|
434 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
435 // place grid with elements into the tab |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
436 QScrollArea *scroll_area = new QScrollArea (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
437 QWidget *scroll_area_contents = new QWidget (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
438 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
|
439 scroll_area_contents->setLayout (style_grid); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
440 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
|
441 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
|
442 |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
443 ui->tabs_editor_lexers->setCurrentIndex ( |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
444 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
|
445 } |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
446 #endif |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
447 |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
448 void |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
449 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
|
450 { |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
451 |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
452 QList<QColor> default_colors = |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
453 resource_manager::storage_class_default_colors (); |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
454 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
|
455 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
|
456 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
|
457 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
458 QGridLayout *style_grid = new QGridLayout (); |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
459 QVector<QLabel*> description (nr_of_classes); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
460 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
|
461 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
462 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
|
463 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
|
464 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
|
465 { |
16749
c9007267cbf5
Variation of color option layouts with columns packed to the left
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16748
diff
changeset
|
466 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
|
467 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
|
468 QVariant default_var = default_colors.at (i); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
469 QColor setting_color = settings->value ("workspaceview/color_" |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
470 + class_chars.mid (i,1), |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
471 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
|
472 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
|
473 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
|
474 color[i]->setMinimumSize (30, 10); |
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
475 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
|
476 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
|
477 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
|
478 { |
16749
c9007267cbf5
Variation of color option layouts with columns packed to the left
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16748
diff
changeset
|
479 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
|
480 row++; |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
481 column = 0; |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
482 } |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
483 } |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
484 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
485 // 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
|
486 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
|
487 } |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
488 |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
489 void |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
490 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
|
491 { |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
492 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
493 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
|
494 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
|
495 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
|
496 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
|
497 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
498 QGridLayout *style_grid = new QGridLayout (); |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
499 QVector<QLabel*> description (nr_of_classes); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
500 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
|
501 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
502 int column = 0; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
503 int row = 0; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
504 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
|
505 { |
16749
c9007267cbf5
Variation of color option layouts with columns packed to the left
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16748
diff
changeset
|
506 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
|
507 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
|
508 QVariant default_var = default_colors.at (i); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
509 QColor setting_color = settings->value ("terminal/color_" |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
510 + class_chars.mid (i,1), |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
511 default_var).value<QColor> (); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
512 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
|
513 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
|
514 color[i]->setMinimumSize (30, 10); |
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
515 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
|
516 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
|
517 if (++column == 2) |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
518 { |
16748
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
519 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
|
520 row++; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
521 column = 0; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
522 } |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
523 } |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
524 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
525 // 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
|
526 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
|
527 } |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
528 |
15274
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
529 void |
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
530 settings_dialog::write_changed_settings () |
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
531 { |
15164
bc801a44bb1f
follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents:
15156
diff
changeset
|
532 QSettings *settings = resource_manager::get_settings (); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
533 // FIXME: what should happen if settings is 0? |
15164
bc801a44bb1f
follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents:
15156
diff
changeset
|
534 |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
535 // the icon set |
15914
85f9aca30c76
gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents:
15787
diff
changeset
|
536 QString widget_icon_set = "NONE"; |
15787
b081fbe80174
provide separate icons for gui's floating widgets
Torsten <ttl@justmail.de>
parents:
15368
diff
changeset
|
537 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
|
538 widget_icon_set = "LETTER"; |
15787
b081fbe80174
provide separate icons for gui's floating widgets
Torsten <ttl@justmail.de>
parents:
15368
diff
changeset
|
539 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
|
540 widget_icon_set = "GRAPHIC"; |
15787
b081fbe80174
provide separate icons for gui's floating widgets
Torsten <ttl@justmail.de>
parents:
15368
diff
changeset
|
541 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
|
542 |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
543 // language |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
544 QString language = ui->comboBox_language->currentText (); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
545 if (language == tr ("System setting")) |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
546 language = "SYSTEM"; |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
547 settings->setValue ("language", language); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
548 |
18179
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
549 // dock widget title bar |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
550 settings->setValue ("DockWidgets/widget_title_custom_style", |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
551 ui->cb_widget_custom_style->isChecked ()); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
552 settings->setValue ("Dockwidgets/title_bg_color", |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
553 _widget_title_bg_color->color ()); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
554 settings->setValue ("Dockwidgets/title_fg_color", |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
555 _widget_title_fg_color->color ()); |
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18155
diff
changeset
|
556 |
18351
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
557 // icon size |
16525
e192525236ad
configurable size of toolbar icons
Torsten <ttl@justmail.de>
parents:
16500
diff
changeset
|
558 settings->setValue ("toolbar_icon_size", ui->toolbar_icon_size->value ()); |
18351
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
559 |
18787
7cb98e81ecd1
GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents:
18759
diff
changeset
|
560 // promp to exit |
7cb98e81ecd1
GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents:
18759
diff
changeset
|
561 settings->setValue ( "prompt_to_exit", ui->cb_prompt_to_exit->isChecked ()); |
7cb98e81ecd1
GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents:
18759
diff
changeset
|
562 |
18898
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
563 // status bar |
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
564 settings->setValue ( "show_status_bar", ui->cb_status_bar->isChecked ()); |
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
565 |
18351
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
566 // Octave startup |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
567 settings->setValue ("restore_octave_dir", |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
568 ui->cb_restore_octave_dir->isChecked ()); |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
569 settings->setValue ("octave_startup_dir", ui->le_octave_dir->text ()); |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
570 |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
571 //editor |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
572 settings->setValue ("useCustomFileEditor", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
573 ui->useCustomFileEditor->isChecked ()); |
13537
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13536
diff
changeset
|
574 settings->setValue ("customFileEditor", ui->customFileEditor->text ()); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
575 settings->setValue ("editor/showLineNumbers", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
576 ui->editor_showLineNumbers->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
577 settings->setValue ("editor/highlightCurrentLine", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
578 ui->editor_highlightCurrentLine->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
579 settings->setValue ("editor/highlight_current_line_color", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
580 _editor_current_line_color->color ()); |
18557
6eae8ba32e62
provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents:
18411
diff
changeset
|
581 settings->setValue ("editor/long_line_marker", |
6eae8ba32e62
provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents:
18411
diff
changeset
|
582 ui->editor_long_line_marker->isChecked ()); |
6eae8ba32e62
provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents:
18411
diff
changeset
|
583 settings->setValue ("editor/long_line_column", |
6eae8ba32e62
provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents:
18411
diff
changeset
|
584 ui->editor_long_line_column->value ()); |
18898
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
585 settings->setValue ("editor/code_folding", |
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
586 ui->cb_code_folding->isChecked ()); |
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
587 settings->setValue ("editor/show_edit_status_bar", |
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18893
diff
changeset
|
588 ui->cb_edit_status_bar->isChecked ()); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
589 settings->setValue ("editor/codeCompletion", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
590 ui->editor_codeCompletion->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
591 settings->setValue ("editor/codeCompletion_threshold", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
592 ui->editor_spinbox_ac_threshold->value ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
593 settings->setValue ("editor/codeCompletion_keywords", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
594 ui->editor_checkbox_ac_keywords->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
595 settings->setValue ("editor/codeCompletion_document", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
596 ui->editor_checkbox_ac_document->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
597 settings->setValue ("editor/codeCompletion_case", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
598 ui->editor_checkbox_ac_case->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
599 settings->setValue ("editor/codeCompletion_replace", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
600 ui->editor_checkbox_ac_replace->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
601 settings->setValue ("editor/show_white_space", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
602 ui->editor_ws_checkbox->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
603 settings->setValue ("editor/show_white_space_indent", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
604 ui->editor_ws_indent_checkbox->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
605 settings->setValue ("editor/auto_indent", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
606 ui->editor_auto_ind_checkbox->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
607 settings->setValue ("editor/tab_indents_line", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
608 ui->editor_tab_ind_checkbox->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
609 settings->setValue ("editor/backspace_unindents_line", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
610 ui->editor_bs_unind_checkbox->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
611 settings->setValue ("editor/show_indent_guides", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
612 ui->editor_ind_guides_checkbox->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
613 settings->setValue ("editor/indent_width", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
614 ui->editor_ind_width_spinbox->value ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
615 settings->setValue ("editor/tab_width", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
616 ui->editor_tab_width_spinbox->value ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
617 settings->setValue ("editor/longWindowTitle", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
618 ui->editor_longWindowTitle->isChecked ()); |
18411
3df71e1d3b24
improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents:
18352
diff
changeset
|
619 settings->setValue ("editor/notebook_tab_width_min", |
3df71e1d3b24
improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents:
18352
diff
changeset
|
620 ui->editor_notebook_tab_width_min->value ()); |
3df71e1d3b24
improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents:
18352
diff
changeset
|
621 settings->setValue ("editor/notebook_tab_width_max", |
3df71e1d3b24
improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents:
18352
diff
changeset
|
622 ui->editor_notebook_tab_width_max->value ()); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
623 settings->setValue ("editor/restoreSession", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
624 ui->editor_restoreSession->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
625 settings->setValue ("editor/create_new_file", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
626 ui->editor_create_new_file->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
627 settings->setValue ("terminal/fontSize", ui->terminal_fontSize->value ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
628 settings->setValue ("terminal/fontName", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
629 ui->terminal_fontName->currentFont ().family ()); |
18352
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
630 |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
631 settings->setValue ("filesdockwidget/showFileSize", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
632 ui->showFileSize->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
633 settings->setValue ("filesdockwidget/showFileType", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
634 ui->showFileType->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
635 settings->setValue ("filesdockwidget/showLastModified", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
636 ui->showLastModified->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
637 settings->setValue ("filesdockwidget/showHiddenFiles", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
638 ui->showHiddenFiles->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
639 settings->setValue ("filesdockwidget/useAlternatingRowColors", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
640 ui->useAlternatingRowColors->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
641 settings->setValue ("filesdockwidget/sync_octave_directory", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
642 ui->sync_octave_directory->isChecked ()); |
18352
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
643 settings->setValue ("filesdockwidget/restore_last_dir", |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
644 ui->cb_restore_file_browser_dir->isChecked ()); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
645 settings->setValue ("filesdockwidget/startup_dir", |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
646 ui->le_file_browser_dir->text ()); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
647 |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
648 |
17942
0b71746689dc
add preference for allowing connections to the octave web site
Torsten <ttl@justmail.de>
parents:
17790
diff
changeset
|
649 settings->setValue ("news/allow_web_connection", |
0b71746689dc
add preference for allowing connections to the octave web site
Torsten <ttl@justmail.de>
parents:
17790
diff
changeset
|
650 ui->checkbox_allow_web_connect->isChecked ()); |
13607
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
651 settings->setValue ("useProxyServer", ui->useProxyServer->isChecked ()); |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
652 settings->setValue ("proxyType", ui->proxyType->currentText ()); |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
653 settings->setValue ("proxyHostName", ui->proxyHostName->text ()); |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
654 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
|
655 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
|
656 settings->setValue ("proxyPassword", ui->proxyPassword->text ()); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
657 settings->setValue ("terminal/cursorBlinking", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
658 ui->terminal_cursorBlinking->isChecked ()); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
659 settings->setValue ("terminal/cursorUseForegroundColor", |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
660 ui->terminal_cursorUseForegroundColor->isChecked ()); |
18155
14acb08d75fa
gui: optionally set focus to console when a command is run from another widget
Torsten <ttl@justmail.de>
parents:
17988
diff
changeset
|
661 settings->setValue ("terminal/focus_after_command", |
14acb08d75fa
gui: optionally set focus to console when a command is run from another widget
Torsten <ttl@justmail.de>
parents:
17988
diff
changeset
|
662 ui->terminal_focus_command->isChecked ()); |
18758
6e81b59d657c
Add preference for terminal windows buffer size (bug #41474)
Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
parents:
18557
diff
changeset
|
663 settings->setValue ("terminal/history_buffer", |
6e81b59d657c
Add preference for terminal windows buffer size (bug #41474)
Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
parents:
18557
diff
changeset
|
664 ui->terminal_history_buffer->value() ); |
14998
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
665 |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
666 // 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
|
667 QString cursorType; |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
668 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
|
669 { |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
670 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
|
671 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
|
672 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
|
673 } |
de3a318128f2
Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14712
diff
changeset
|
674 settings->setValue ("terminal/cursorType", cursorType); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
675 |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
676 #ifdef HAVE_QSCINTILLA |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
677 // 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
|
678 QsciLexer *lexer; |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
679 #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
|
680 lexer = new QsciLexerOctave (); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
681 write_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
682 delete lexer; |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
683 #elif defined (HAVE_LEXER_MATLAB) |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
684 lexer = new QsciLexerMatlab (); |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
685 write_lexer_settings (lexer,settings); |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
686 delete lexer; |
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
687 #endif |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
688 lexer = new QsciLexerCPP (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
689 write_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
690 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
691 lexer = new QsciLexerPerl (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
692 write_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
693 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
694 lexer = new QsciLexerBatch (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
695 write_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
696 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
697 lexer = new QsciLexerDiff (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
698 write_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
699 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
700 lexer = new QsciLexerBash (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
701 write_lexer_settings (lexer,settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
702 delete lexer; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
703 #endif |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
704 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
705 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
|
706 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
707 write_terminal_colors (settings); |
16623
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
708 |
18882
f017240310fb
disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents:
18787
diff
changeset
|
709 // shortcuts |
f017240310fb
disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents:
18787
diff
changeset
|
710 settings->setValue ("shortcuts/prevent_readline_conflicts", |
f017240310fb
disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents:
18787
diff
changeset
|
711 ui->cb_prevent_readline_conflicts->isChecked ()); |
18893
95249367d6fa
provide a second set of shortcuts
Torsten <ttl@justmail.de>
parents:
18882
diff
changeset
|
712 int set = 0; |
95249367d6fa
provide a second set of shortcuts
Torsten <ttl@justmail.de>
parents:
18882
diff
changeset
|
713 if (ui->rb_sc_set2->isChecked ()) |
95249367d6fa
provide a second set of shortcuts
Torsten <ttl@justmail.de>
parents:
18882
diff
changeset
|
714 set = 1; |
95249367d6fa
provide a second set of shortcuts
Torsten <ttl@justmail.de>
parents:
18882
diff
changeset
|
715 settings->setValue ("shortcuts/set",set); |
18759
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
18758
diff
changeset
|
716 shortcut_manager::write_shortcuts (); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
18758
diff
changeset
|
717 |
18882
f017240310fb
disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents:
18787
diff
changeset
|
718 // settings dialog's geometry |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
719 settings->setValue ("settings/last_tab",ui->tabWidget->currentIndex ()); |
18344
e8176099889c
settings dialog with varaible size (bug #41197)
Torsten <ttl@justmail.de>
parents:
18319
diff
changeset
|
720 settings->setValue ("settings/geometry",saveGeometry ()); |
18882
f017240310fb
disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents:
18787
diff
changeset
|
721 |
18344
e8176099889c
settings dialog with varaible size (bug #41197)
Torsten <ttl@justmail.de>
parents:
18319
diff
changeset
|
722 settings->sync (); |
13501 | 723 } |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
724 |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
725 #ifdef HAVE_QSCINTILLA |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
726 void |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
727 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
|
728 { |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
729 QWidget *tab = ui->tabs_editor_lexers-> |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
730 findChild <QWidget *>(QString (lexer->language ())+"_styles"); |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
731 int styles[MaxLexerStyles]; // array for saving valid styles |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
732 // (enum is not continuous) |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
733 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
|
734 QFontComboBox *select_font; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
735 QSpinBox *font_size; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
736 QCheckBox *attrib_font[3]; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
737 color_picker *color; |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
738 color_picker *bg_color; |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
739 int default_size = 10; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
740 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
|
741 QColor default_color = QColor (); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
742 QColor dummy_color = QColor (255,0,255); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
743 |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
744 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
|
745 { |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
746 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
|
747 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
|
748 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
|
749 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
|
750 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
|
751 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
|
752 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
|
753 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
|
754 QFont new_font = default_font; |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
755 if (select_font) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
756 { |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
757 new_font = select_font->currentFont (); |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
758 if (styles[i] == 0) |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
759 default_font = new_font; |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
760 else if (select_font->currentText () == lexer->description (0)) |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
761 new_font = default_font; |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
762 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
763 if (font_size) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
764 { |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
765 if (styles[i] == 0) |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
766 { |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
767 default_size = font_size->value (); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
768 new_font.setPointSize (font_size->value ()); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
769 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
770 else |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
771 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
|
772 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
773 if (attrib_font[0]) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
774 new_font.setBold (attrib_font[0]->isChecked ()); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
775 if (attrib_font[1]) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
776 new_font.setItalic (attrib_font[1]->isChecked ()); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
777 if (attrib_font[2]) |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
778 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
|
779 lexer->setFont (new_font,styles[i]); |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
780 if (styles[i] == 0) |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
781 lexer->setDefaultFont (new_font); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
782 if (color) |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16499
diff
changeset
|
783 lexer->setColor (color->color (),styles[i]); |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
784 if (bg_color) |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
785 { |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
786 if (styles[i] == 0) |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
787 { |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
788 default_color = bg_color->color (); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
789 lexer->setPaper (default_color,styles[i]); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
790 lexer->setDefaultPaper (default_color); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
791 } |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
792 else |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
793 { |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
794 if (bg_color->color () == dummy_color) |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
795 lexer->setPaper (default_color,styles[i]); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
796 else |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
797 lexer->setPaper (bg_color->color (),styles[i]); |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
798 } |
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
799 } |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
800 } |
16700
cd7d08b8c928
make background colors of editor files configurable
Torsten <ttl@justmail.de>
parents:
16693
diff
changeset
|
801 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
802 lexer->writeSettings (*settings); |
16623
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
803 |
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
804 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
|
805 "settings/last_editor_styles_tab",ui->tabs_editor_lexers->currentIndex ()); |
18344
e8176099889c
settings dialog with varaible size (bug #41197)
Torsten <ttl@justmail.de>
parents:
18319
diff
changeset
|
806 settings->sync (); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
807 } |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
808 #endif |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
809 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
810 void |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
811 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
|
812 { |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
813 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
814 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
|
815 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
|
816 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
817 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
|
818 { |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
819 color = ui->workspace_colors_box->findChild <color_picker *>( |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
820 "color_"+class_chars.mid (i,1)); |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
821 if (color) |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
822 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
|
823 color->color ()); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
824 } |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
825 settings->sync (); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
826 } |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
827 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
828 void |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
829 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
|
830 { |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
831 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
|
832 color_picker *color; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
833 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
834 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
|
835 { |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
836 color = ui->terminal_colors_box->findChild <color_picker *>( |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
837 "terminal_color_"+class_chars.mid (i,1)); |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
838 if (color) |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
839 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
|
840 color->color ()); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
841 } |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
842 settings->sync (); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
843 } |
18351
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
844 |
18352
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
845 |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
846 // internal slots |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
847 |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
848 void |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
849 settings_dialog::get_dir (QLineEdit *line_edit, const QString& title) |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
850 { |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
851 QString dir = QFileDialog::getExistingDirectory(this, |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
852 title, line_edit->text (), |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
853 QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
854 line_edit->setText (dir); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
855 } |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
856 |
18351
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
857 void |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
858 settings_dialog::get_octave_dir () |
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18344
diff
changeset
|
859 { |
18352
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
860 get_dir (ui->le_octave_dir, tr ("Set Octave Startup Directory")); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
861 } |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
862 |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
863 void |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
864 settings_dialog::get_file_browser_dir () |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
865 { |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
866 get_dir (ui->le_file_browser_dir, tr ("Set File Browser Startup Directory")); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
867 } |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
868 |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
869 void |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
870 settings_dialog::set_disabled_pref_file_browser_dir (bool disable) |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
871 { |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
872 ui->cb_restore_file_browser_dir->setDisabled (disable); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
873 |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
874 if (! disable) |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
875 { |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
876 ui->le_file_browser_dir->setDisabled (ui->cb_restore_file_browser_dir->isChecked ()); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
877 ui->pb_file_browser_dir->setDisabled (ui->cb_restore_file_browser_dir->isChecked ()); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
878 } |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
879 else |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
880 { |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
881 ui->le_file_browser_dir->setDisabled (disable); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
882 ui->pb_file_browser_dir->setDisabled (disable); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
883 } |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18351
diff
changeset
|
884 } |