annotate libgui/src/settings-dialog.cc @ 23810:9c24aae7515f

allow cursor flashing to be configured globally in gui (bug #51460) * default-qt-settings.in: remove the related preference in the termibal tab * main-window.cc (notice_settings): read the new preference from the settings file and if not available, use the old one from the terminal tab as fallback; set the flashing period for the scintilla editor * file-editor-tab.cc (notice_settings): read the new preference from the settings file and if not available, use the old one from the terminal tab as fallback; set the application wide flashing period * QTerminal.cc (notice_settings): read the new preference from the settings file and if not available, use the old one from the terminal tab as fallback * settings-dialog.cc (settings_dialog): read the new preference from the settings file and if not available, use the old one from the terminal tab as fallback; remove obsolete preference from terminal tab; (write_changed_settings): save new preference into the settings file * settings-dialog.ui: move preference for cursor blinking from terminal to general tab
author Torsten <mttl@mailbox.org>
date Sun, 23 Jul 2017 10:53:55 +0200
parents 336f89b6208b
children e3a36f84d01d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
23219
3ac9f9ecfae5 maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents: 23083
diff changeset
3 Copyright (C) 2011-2017 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
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
8 under the terms of the GNU General Public License as published by
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
9 the Free Software Foundation; either version 3 of the License, or
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
10 (at your option) any later version.
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
11
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
12 Octave is distributed in the hope that it will be useful, but
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
13 WITHOUT ANY WARRANTY; without even the implied warranty of
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
15 GNU General Public License for more details.
15204
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
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
23 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21213
diff changeset
24 # include "config.h"
15286
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"
18611
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents: 18610
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>
18309
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
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>
22177
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
37 #include <QMessageBox>
20731
83611b387bc5 provide a user preference for the encoding used by the editor (bug #45597)
Torsten <ttl@justmail.de>
parents: 20706
diff changeset
38 #include <QTextCodec>
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
39
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
40 #if defined (HAVE_QSCINTILLA)
21203
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
41 # include "octave-qscintilla.h"
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
42 # include "octave-txt-lexer.h"
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
43 # include <QScrollArea>
16667
7f6f0b3f7369 Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents: 16646
diff changeset
44
21203
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
45 # if defined (HAVE_QSCI_QSCILEXEROCTAVE_H)
21213
f7d1050b9b53 maint: Clean up various usages of #ifdef.
Rik <rik@octave.org>
parents: 21203
diff changeset
46 # define HAVE_LEXER_OCTAVE 1
21203
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
47 # include <Qsci/qscilexeroctave.h>
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
48 # elif defined (HAVE_QSCI_QSCILEXERMATLAB_H)
21213
f7d1050b9b53 maint: Clean up various usages of #ifdef.
Rik <rik@octave.org>
parents: 21203
diff changeset
49 # define HAVE_LEXER_MATLAB 1
21203
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
50 # include <Qsci/qscilexermatlab.h>
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
51 # endif
16677
f6dfc7705623 * settings-dialog.cc: enable octave lexer editor styles if lexer is present
Torsten <ttl@justmail.de>
parents: 16667
diff changeset
52
21203
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
53 # include <Qsci/qscilexercpp.h>
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
54 # include <Qsci/qscilexerbash.h>
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
55 # include <Qsci/qscilexerperl.h>
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
56 # include <Qsci/qscilexerbatch.h>
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
57 # include <Qsci/qscilexerdiff.h>
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
58 #endif
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
59
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
60 #if defined (HAVE_QSCINTILLA)
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
61
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
62 static const int MaxLexerStyles = 64;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
63 static const int MaxStyleNumber = 128;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
64
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
65 static int
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
66 get_valid_lexer_styles (QsciLexer *lexer, int styles[])
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
67 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
68 int max_style = 0;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
69 int actual_style = 0;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
70 while (actual_style < MaxStyleNumber && max_style < MaxLexerStyles)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
71 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
72 if ((lexer->description (actual_style)) != "") // valid style
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
73 styles[max_style++] = actual_style;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
74 actual_style++;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
75 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
76 return max_style;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
77 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
78
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
79 static void
23433
c9fab0bc983e maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents: 23237
diff changeset
80 read_lexer_settings (Ui::settings_dialog *ui, QsciLexer *lexer,
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
81 QSettings *settings)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
82 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
83 lexer->readSettings (*settings);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
84 int styles[MaxLexerStyles]; // array for saving valid styles
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
85 // (enum is not continuous)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
86 int max_style = get_valid_lexer_styles (lexer, styles);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
87 QGridLayout *style_grid = new QGridLayout ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
88 QVector<QLabel*> description (max_style);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
89 QVector<QFontComboBox*> select_font (max_style);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
90 QVector<QSpinBox*> font_size (max_style);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
91 QVector<QCheckBox*> attrib_font (3 * max_style);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
92 QVector<color_picker*> color (max_style);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
93 QVector<color_picker*> bg_color (max_style);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
94 int default_size = 10;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
95 QFont default_font = QFont ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
96 int label_width;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
97 QColor default_color = QColor ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
98 QColor dummy_color = QColor (255,0,255);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
99
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
100 for (int i = 0; i < max_style; i++) // create dialog elements for all styles
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
101 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
102 QString actual_name = lexer->description (styles[i]);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
103 QFont actual_font = lexer->font (styles[i]);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
104 description[i] = new QLabel (actual_name);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
105 description[i]->setWordWrap (true);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
106 label_width = 24*description[i]->fontMetrics ().averageCharWidth ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
107 description[i]->setMaximumSize (label_width,QWIDGETSIZE_MAX);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
108 description[i]->setMinimumSize (label_width,1);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
109 select_font[i] = new QFontComboBox ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
110 select_font[i]->setObjectName (actual_name+"_font");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
111 select_font[i]->setMaximumSize (label_width,QWIDGETSIZE_MAX);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
112 select_font[i]->setMinimumSize (label_width,1);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
113 font_size[i] = new QSpinBox ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
114 font_size[i]->setObjectName (actual_name+"_size");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
115 if (styles[i] == 0) // the default
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
116 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
117 select_font[i]->setCurrentFont (actual_font);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
118 default_font = actual_font;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
119 font_size[i]->setRange (6,24);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
120 default_size = actual_font.pointSize ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
121 font_size[i]->setValue (default_size);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
122 default_color = lexer->defaultPaper ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
123 bg_color[i] = new color_picker (default_color);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
124 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
125 else // other styles
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
126 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
127 select_font[i]->setCurrentFont (actual_font);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
128 if (actual_font.family () == default_font.family ())
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
129 select_font[i]->setEditText (lexer->description (0));
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
130 font_size[i]->setRange (-4,4);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
131 font_size[i]->setValue (actual_font.pointSize ()-default_size);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
132 font_size[i]->setToolTip (QObject::tr ("Difference to the default size"));
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
133 if (lexer->paper (styles[i]) == default_color)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
134 bg_color[i] = new color_picker (dummy_color);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
135 else
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
136 bg_color[i] = new color_picker (lexer->paper (styles[i]));
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
137 bg_color[i]->setToolTip
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
138 (QObject::tr ("Background color, pink (255,0,255) means default"));
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
139 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
140 attrib_font[0+3*i] = new QCheckBox (QObject::tr ("b", "short form for bold"));
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
141 attrib_font[1+3*i] = new QCheckBox (QObject::tr ("i", "short form for italic"));
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
142 attrib_font[2+3*i] = new QCheckBox (QObject::tr ("u", "short form for underlined"));
23799
964843643377 settings-dialog.cc: Don't mix enum with bool which provokes compiler warning.
Rik <rik@octave.org>
parents: 23688
diff changeset
143 attrib_font[0+3*i]->setChecked (actual_font.bold ());
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
144 attrib_font[0+3*i]->setObjectName (actual_name+"_bold");
23799
964843643377 settings-dialog.cc: Don't mix enum with bool which provokes compiler warning.
Rik <rik@octave.org>
parents: 23688
diff changeset
145 attrib_font[1+3*i]->setChecked (actual_font.italic ());
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
146 attrib_font[1+3*i]->setObjectName (actual_name+"_italic");
23799
964843643377 settings-dialog.cc: Don't mix enum with bool which provokes compiler warning.
Rik <rik@octave.org>
parents: 23688
diff changeset
147 attrib_font[2+3*i]->setChecked (actual_font.underline ());
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
148 attrib_font[2+3*i]->setObjectName (actual_name+"_underline");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
149 color[i] = new color_picker (lexer->color (styles[i]));
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
150 color[i]->setObjectName (actual_name+"_color");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
151 bg_color[i]->setObjectName (actual_name+"_bg_color");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
152 int column = 1;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
153 style_grid->addWidget (description[i], i, column++);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
154 style_grid->addWidget (select_font[i], i, column++);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
155 style_grid->addWidget (font_size[i], i, column++);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
156 style_grid->addWidget (attrib_font[0+3*i], i, column++);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
157 style_grid->addWidget (attrib_font[1+3*i], i, column++);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
158 style_grid->addWidget (attrib_font[2+3*i], i, column++);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
159 style_grid->addWidget (color[i], i, column++);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
160 style_grid->addWidget (bg_color[i], i, column++);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
161 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
162 // place grid with elements into the tab
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
163 QScrollArea *scroll_area = new QScrollArea ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
164 QWidget *scroll_area_contents = new QWidget ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
165 scroll_area_contents->setObjectName (QString (lexer->language ())+"_styles");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
166 scroll_area_contents->setLayout (style_grid);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
167 scroll_area->setWidget (scroll_area_contents);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
168 ui->tabs_editor_lexers->addTab (scroll_area,lexer->language ());
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
169
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
170 ui->tabs_editor_lexers->setCurrentIndex (
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
171 settings->value ("settings/last_editor_styles_tab",0).toInt ());
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
172 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
173
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
174 static void
23433
c9fab0bc983e maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents: 23237
diff changeset
175 write_lexer_settings (Ui::settings_dialog *ui, QsciLexer *lexer,
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
176 QSettings *settings)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
177 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
178 QWidget *tab = ui->tabs_editor_lexers->
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
179 findChild <QWidget *>(QString (lexer->language ())+"_styles");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
180 int styles[MaxLexerStyles]; // array for saving valid styles
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
181 // (enum is not continuous)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
182 int max_style = get_valid_lexer_styles (lexer, styles);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
183 QFontComboBox *select_font;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
184 QSpinBox *font_size;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
185 QCheckBox *attrib_font[3];
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
186 color_picker *color;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
187 color_picker *bg_color;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
188 int default_size = 10;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
189 QFont default_font = QFont ("Courier New",10,-1,0);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
190 QColor default_color = QColor ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
191 QColor dummy_color = QColor (255,0,255);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
192
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
193 for (int i = 0; i < max_style; i++) // get dialog elements and their contents
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
194 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
195 QString actual_name = lexer->description (styles[i]);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
196 select_font = tab->findChild <QFontComboBox *>(actual_name+"_font");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
197 font_size = tab->findChild <QSpinBox *>(actual_name+"_size");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
198 attrib_font[0] = tab->findChild <QCheckBox *>(actual_name+"_bold");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
199 attrib_font[1] = tab->findChild <QCheckBox *>(actual_name+"_italic");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
200 attrib_font[2] = tab->findChild <QCheckBox *>(actual_name+"_underline");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
201 color = tab->findChild <color_picker *>(actual_name+"_color");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
202 bg_color = tab->findChild <color_picker *>(actual_name+"_bg_color");
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
203 QFont new_font = default_font;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
204 if (select_font)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
205 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
206 new_font = select_font->currentFont ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
207 if (styles[i] == 0)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
208 default_font = new_font;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
209 else if (select_font->currentText () == lexer->description (0))
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
210 new_font = default_font;
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
211 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
212 if (font_size)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
213 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
214 if (styles[i] == 0)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
215 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
216 default_size = font_size->value ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
217 new_font.setPointSize (font_size->value ());
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
218 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
219 else
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
220 new_font.setPointSize (font_size->value ()+default_size);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
221 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
222 if (attrib_font[0])
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
223 new_font.setBold (attrib_font[0]->isChecked ());
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
224 if (attrib_font[1])
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
225 new_font.setItalic (attrib_font[1]->isChecked ());
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
226 if (attrib_font[2])
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
227 new_font.setUnderline (attrib_font[2]->isChecked ());
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
228 lexer->setFont (new_font,styles[i]);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
229 if (styles[i] == 0)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
230 lexer->setDefaultFont (new_font);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
231 if (color)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
232 lexer->setColor (color->color (),styles[i]);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
233 if (bg_color)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
234 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
235 if (styles[i] == 0)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
236 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
237 default_color = bg_color->color ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
238 lexer->setPaper (default_color,styles[i]);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
239 lexer->setDefaultPaper (default_color);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
240 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
241 else
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
242 {
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
243 if (bg_color->color () == dummy_color)
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
244 lexer->setPaper (default_color,styles[i]);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
245 else
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
246 lexer->setPaper (bg_color->color (),styles[i]);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
247 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
248 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
249 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
250
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
251 lexer->writeSettings (*settings);
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
252
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
253 settings->setValue (
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
254 "settings/last_editor_styles_tab",ui->tabs_editor_lexers->currentIndex ());
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
255 settings->sync ();
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
256 }
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
257
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
258 #endif
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
259
17676
c060ad097056 add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents: 16865
diff changeset
260 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
261 QDialog (p), ui (new Ui::settings_dialog)
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
262 {
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
263 ui->setupUi (this);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
264
15164
bc801a44bb1f follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents: 15156
diff changeset
265 QSettings *settings = resource_manager::get_settings ();
18302
e8176099889c settings dialog with varaible size (bug #41197)
Torsten <ttl@justmail.de>
parents: 18294
diff changeset
266
22177
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
267 if (! settings)
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
268 {
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
269 QMessageBox msgBox (QMessageBox::Warning, tr ("Octave Settings"),
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
270 tr ("Unable to save settings. Missing settings "
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
271 "file or unknown directory."));
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
272 msgBox.exec ();
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
273 return;
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
274 }
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
275
18302
e8176099889c settings dialog with varaible size (bug #41197)
Torsten <ttl@justmail.de>
parents: 18294
diff changeset
276 // restore last geometry
23070
bef714f45999 maint: Use space after function name/before parenthesis in libgui.
Rik <rik@octave.org>
parents: 23066
diff changeset
277 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
278
15972
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
279 // look for available language files and the actual settings
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
280 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
281 QDir qm_dir (qm_dir_name);
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
282 QFileInfoList qm_files = qm_dir.entryInfoList (QStringList ("*.qm"),
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
283 QDir::Files | QDir::Readable,
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
284 QDir::Name);
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
285 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
286 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
287 // System at beginning
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
288 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
289 ui->comboBox_language->insertSeparator (1); // separator after System
23807
336f89b6208b Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents: 23799
diff changeset
290 QString language = settings->value ("language", "SYSTEM").toString ();
15972
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
291 if (language == "SYSTEM")
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
292 language = tr ("System setting");
15972
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
293 int selected = ui->comboBox_language->findText (language);
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
294 if (selected >= 0)
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
295 ui->comboBox_language->setCurrentIndex (selected);
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
296 else
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
297 ui->comboBox_language->setCurrentIndex (0); // System is default
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
298
19847
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
299 // icon size
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
300 QButtonGroup *icon_size_group = new QButtonGroup (this);
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
301 icon_size_group->addButton (ui->icon_size_small);
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
302 icon_size_group->addButton (ui->icon_size_normal);
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
303 icon_size_group->addButton (ui->icon_size_large);
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
304 int icon_size = settings->value ("toolbar_icon_size", 0).toInt ();
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
305 ui->icon_size_normal->setChecked (true); // the default
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
306 ui->icon_size_small->setChecked (icon_size == -1);
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
307 ui->icon_size_large->setChecked (icon_size == 1);
16525
e192525236ad configurable size of toolbar icons
Torsten <ttl@justmail.de>
parents: 16500
diff changeset
308
15972
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
309 // which icon has to be selected
19847
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
310 QButtonGroup *icon_group = new QButtonGroup (this);
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
311 icon_group->addButton (ui->general_icon_octave);
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
312 icon_group->addButton (ui->general_icon_graphic);
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
313 icon_group->addButton (ui->general_icon_letter);
15914
85f9aca30c76 gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents: 15787
diff changeset
314 QString widget_icon_set =
23807
336f89b6208b Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents: 23799
diff changeset
315 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
316 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
317 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
318 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
319 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
320
18180
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
321 // custom title bar of dock widget
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
322 QVariant default_var = QColor (255,255,255);
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
323 QColor bg_color = settings->value ("Dockwidgets/title_bg_color",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19847
diff changeset
324 default_var).value<QColor> ();
18180
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
325 _widget_title_bg_color = new color_picker (bg_color);
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
326 _widget_title_bg_color->setEnabled (false);
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
327 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: 18156
diff changeset
328 connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)),
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
329 _widget_title_bg_color, SLOT (setEnabled (bool)));
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
330
19423
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
331 default_var = QColor (192,192,192);
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
332 QColor bg_color_active = settings->value ("Dockwidgets/title_bg_color_active",
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
333 default_var).value<QColor> ();
19423
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
334 _widget_title_bg_color_active = new color_picker (bg_color_active);
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
335 _widget_title_bg_color_active->setEnabled (false);
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
336 ui->layout_widget_bgtitle_active->addWidget (_widget_title_bg_color_active,0);
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
337 connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)),
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
338 _widget_title_bg_color_active, SLOT (setEnabled (bool)));
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
339
18180
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
340 default_var = QColor (0,0,0);
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
341 QColor fg_color = settings->value ("Dockwidgets/title_fg_color",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19847
diff changeset
342 default_var).value<QColor> ();
18180
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
343 _widget_title_fg_color = new color_picker (fg_color);
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
344 _widget_title_fg_color->setEnabled (false);
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
345 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: 18156
diff changeset
346 connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)),
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
347 _widget_title_fg_color, SLOT (setEnabled (bool)));
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
348
19423
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
349 default_var = QColor (0,0,0);
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
350 QColor fg_color_active = settings->value ("Dockwidgets/title_fg_color_active",
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
351 default_var).value<QColor> ();
19423
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
352 _widget_title_fg_color_active = new color_picker (fg_color_active);
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
353 _widget_title_fg_color_active->setEnabled (false);
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
354 ui->layout_widget_fgtitle_active->addWidget (_widget_title_fg_color_active,0);
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
355 connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)),
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
356 _widget_title_fg_color_active, SLOT (setEnabled (bool)));
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
357
19913
2a992bd19169 make color gradient of custom title bar adjustable (bug #44435)
Torsten <ttl@justmail.de>
parents: 19861
diff changeset
358 ui->sb_3d_title->setValue (
2a992bd19169 make color gradient of custom title bar adjustable (bug #44435)
Torsten <ttl@justmail.de>
parents: 19861
diff changeset
359 settings->value ("DockWidgets/widget_title_3d", 50).toInt ());
18180
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
360 ui->cb_widget_custom_style->setChecked (
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
361 settings->value ("DockWidgets/widget_title_custom_style",false).toBool ());
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
362
23810
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
363 // Cursor blinking: consider old terminal related setting if not yet set
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
364 // TODO: This pref. can be deprecated / removed if Qt adds support for
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
365 // getting the cursor blink preferences from all OS environments
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
366 if (settings->contains ("cursor_blinking"))
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
367 {
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
368 // Preference exists, read its value
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
369 ui->cb_cursor_blinking->setChecked (
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
370 settings->value ("cursor_blinking",true).toBool ());
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
371 }
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
372 else
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
373 {
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
374 // Pref. does not exist, so take old terminal related pref.
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
375 ui->cb_cursor_blinking->setChecked (
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
376 settings->value ("terminal/cursorBlinking",true).toBool ());
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
377 }
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
378
18639
7cb98e81ecd1 GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents: 18611
diff changeset
379 // prompt on exit
7cb98e81ecd1 GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents: 18611
diff changeset
380 ui->cb_prompt_to_exit->setChecked (
7cb98e81ecd1 GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents: 18611
diff changeset
381 settings->value ("prompt_to_exit",false).toBool ());
7cb98e81ecd1 GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents: 18611
diff changeset
382
18733
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
383 // Main status bar
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
384 ui->cb_status_bar->setChecked (
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
385 settings->value ("show_status_bar",true).toBool ());
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
386
18309
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
387 // Octave startup
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
388 ui->cb_restore_octave_dir->setChecked (
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19847
diff changeset
389 settings->value ("restore_octave_dir",false).toBool ());
18309
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
390 ui->le_octave_dir->setText (
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19847
diff changeset
391 settings->value ("octave_startup_dir").toString ());
18309
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
392 connect (ui->pb_octave_dir, SIGNAL (pressed ()),
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
393 this, SLOT (get_octave_dir ()));
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
394
20731
83611b387bc5 provide a user preference for the encoding used by the editor (bug #45597)
Torsten <ttl@justmail.de>
parents: 20706
diff changeset
395 //
18180
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
396 // editor
20731
83611b387bc5 provide a user preference for the encoding used by the editor (bug #45597)
Torsten <ttl@justmail.de>
parents: 20706
diff changeset
397 //
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
398 ui->useCustomFileEditor->setChecked (settings->value ("useCustomFileEditor",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
399 false).toBool ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
400 ui->customFileEditor->setText (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
401 settings->value ("customFileEditor").toString ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
402 ui->editor_showLineNumbers->setChecked (
18678
6113e0c6920b maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents: 18639
diff changeset
403 settings->value ("editor/showLineNumbers",true).toBool ());
23490
7463c8e91dba customizable size of line numbers in the editor (bug #46959)
Torsten <mttl@mailbox.org>
parents: 23433
diff changeset
404 ui->editor_linenr_size->setValue (
7463c8e91dba customizable size of line numbers in the editor (bug #46959)
Torsten <mttl@mailbox.org>
parents: 23433
diff changeset
405 settings->value ("editor/line_numbers_size",0).toInt ());
16693
e9d0b8252a0a make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents: 16679
diff changeset
406
20774
5c5e085a1ae6 allow selecting an encoding when saving a file (bug #45688)
Torsten <ttl@justmail.de>
parents: 20753
diff changeset
407 resource_manager::combo_encoding (ui->editor_combo_encoding);
20731
83611b387bc5 provide a user preference for the encoding used by the editor (bug #45597)
Torsten <ttl@justmail.de>
parents: 20706
diff changeset
408
18180
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
409 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
410 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
411 default_var).value<QColor> ();
e9d0b8252a0a make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents: 16679
diff changeset
412 _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
413 ui->editor_grid_current_line->addWidget (_editor_current_line_color,0,3);
23490
7463c8e91dba customizable size of line numbers in the editor (bug #46959)
Torsten <mttl@mailbox.org>
parents: 23433
diff changeset
414 _editor_current_line_color->setMinimumSize (20,10);
16693
e9d0b8252a0a make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents: 16679
diff changeset
415 _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
416 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
417 _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
418 ui->editor_highlightCurrentLine->setChecked (
18678
6113e0c6920b maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents: 18639
diff changeset
419 settings->value ("editor/highlightCurrentLine",true).toBool ());
23186
9da0d6a86914 enable text background as long line marker in the editor
Torsten <mttl@mailbox.org>
parents: 23181
diff changeset
420 ui->editor_long_line_marker_none->setChecked (
9da0d6a86914 enable text background as long line marker in the editor
Torsten <mttl@mailbox.org>
parents: 23181
diff changeset
421 settings->value ("editor/long_line_marker_none",false).toBool ());
18489
6eae8ba32e62 provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents: 18343
diff changeset
422 ui->editor_long_line_marker->setChecked (
6eae8ba32e62 provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents: 18343
diff changeset
423 settings->value ("editor/long_line_marker",true).toBool ());
23186
9da0d6a86914 enable text background as long line marker in the editor
Torsten <mttl@mailbox.org>
parents: 23181
diff changeset
424 ui->editor_long_line_marker_background->setChecked (
9da0d6a86914 enable text background as long line marker in the editor
Torsten <mttl@mailbox.org>
parents: 23181
diff changeset
425 settings->value ("editor/long_line_marker_background",false).toBool ());
18489
6eae8ba32e62 provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents: 18343
diff changeset
426 ui->editor_long_line_column->setValue (
6eae8ba32e62 provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents: 18343
diff changeset
427 settings->value ("editor/long_line_column",80).toInt ());
23181
78f04a9dfeee allow line breaking in the editor (bug #41555)
Torsten <mttl@mailbox.org>
parents: 23179
diff changeset
428 ui->editor_break_checkbox->setChecked (
78f04a9dfeee allow line breaking in the editor (bug #41555)
Torsten <mttl@mailbox.org>
parents: 23179
diff changeset
429 settings->value ("editor/break_lines",false).toBool ());
23237
904c8a356e76 provide the possibility for breaking lines only in comments (bug #41555)
Torsten <mttl@mailbox.org>
parents: 23220
diff changeset
430 ui->editor_break_checkbox->setChecked (
904c8a356e76 provide the possibility for breaking lines only in comments (bug #41555)
Torsten <mttl@mailbox.org>
parents: 23220
diff changeset
431 settings->value ("editor/break_lines_comments",false).toBool ());
23179
751c389404b9 enable line wrapping in the editor if desired (bug #41555)
Torsten <mttl@mailbox.org>
parents: 23084
diff changeset
432 ui->editor_wrap_checkbox->setChecked (
751c389404b9 enable line wrapping in the editor if desired (bug #41555)
Torsten <mttl@mailbox.org>
parents: 23084
diff changeset
433 settings->value ("editor/wrap_lines",false).toBool ());
18733
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
434 ui->cb_edit_status_bar->setChecked (
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
435 settings->value ("editor/show_edit_status_bar",true).toBool ());
20992
73e92fca3c78 GUI: add editor toolbar display option (Bug #46705)
John Donoghue <john.donoghue@ieee.org>
parents: 20774
diff changeset
436 ui->cb_edit_tool_bar->setChecked (
73e92fca3c78 GUI: add editor toolbar display option (Bug #46705)
John Donoghue <john.donoghue@ieee.org>
parents: 20774
diff changeset
437 settings->value ("editor/show_toolbar",true).toBool ());
18733
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
438 ui->cb_code_folding->setChecked (
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
439 settings->value ("editor/code_folding",true).toBool ());
23190
4a2c42792d6c highlight all occurrences of a selected word in the editor (bug #41470)
Torsten <mttl@mailbox.org>
parents: 23186
diff changeset
440 ui->editor_highlight_all_occurrences->setChecked (
4a2c42792d6c highlight all occurrences of a selected word in the editor (bug #41470)
Torsten <mttl@mailbox.org>
parents: 23186
diff changeset
441 settings->value ("editor/highlight_all_occurrences",true).toBool ());
16693
e9d0b8252a0a make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents: 16679
diff changeset
442
23688
cb36684b7a33 In the GUI editor, automatically add "endif" for "if" etc.
Lachlan Andrew <lachlanbis@gmail.com>
parents: 23490
diff changeset
443 ui->editor_auto_endif->setCurrentIndex (
cb36684b7a33 In the GUI editor, automatically add "endif" for "if" etc.
Lachlan Andrew <lachlanbis@gmail.com>
parents: 23490
diff changeset
444 settings->value ("editor/auto_endif", 1).toInt () );
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
445 ui->editor_codeCompletion->setChecked (
18678
6113e0c6920b maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents: 18639
diff changeset
446 settings->value ("editor/codeCompletion", true).toBool ());
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
447 ui->editor_spinbox_ac_threshold->setValue (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
448 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
449 ui->editor_checkbox_ac_keywords->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
450 settings->value ("editor/codeCompletion_keywords",true).toBool ());
18833
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
451 ui->editor_checkbox_ac_builtins->setEnabled (
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
452 ui->editor_checkbox_ac_keywords->isChecked ());
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
453 ui->editor_checkbox_ac_functions->setEnabled (
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
454 ui->editor_checkbox_ac_keywords->isChecked ());
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
455 ui->editor_checkbox_ac_builtins->setChecked (
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
456 settings->value ("editor/codeCompletion_octave_builtins",true).toBool ());
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
457 ui->editor_checkbox_ac_functions->setChecked (
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
458 settings->value ("editor/codeCompletion_octave_functions",true).toBool ());
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
459 ui->editor_checkbox_ac_document->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
460 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
461 ui->editor_checkbox_ac_case->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
462 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
463 ui->editor_checkbox_ac_replace->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
464 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
465 ui->editor_ws_checkbox->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
466 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
467 ui->editor_ws_indent_checkbox->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
468 settings->value ("editor/show_white_space_indent",false).toBool ());
19245
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
469 ui->cb_show_eol->setChecked (
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
470 settings->value ("editor/show_eol_chars",false).toBool ());
19430
472a5572849c hiding horizontal scroll bar in editor when not needed (bug #41592)
Torsten <ttl@justmail.de>
parents: 19423
diff changeset
471 ui->cb_show_hscrollbar->setChecked (
472a5572849c hiding horizontal scroll bar in editor when not needed (bug #41592)
Torsten <ttl@justmail.de>
parents: 19423
diff changeset
472 settings->value ("editor/show_hscroll_bar",true).toBool ());
23066
bd8ea9e44230 Allow changing comment character when using Ctrl+R... (bug #49182)
Abhinav Tripathi <genuinelucifer@gmail.com>
parents: 22755
diff changeset
473 ui->combo_oct_comment_str->setCurrentIndex (
bd8ea9e44230 Allow changing comment character when using Ctrl+R... (bug #49182)
Abhinav Tripathi <genuinelucifer@gmail.com>
parents: 22755
diff changeset
474 settings->value ("editor/octave_comment_string", 0).toInt ());
19430
472a5572849c hiding horizontal scroll bar in editor when not needed (bug #41592)
Torsten <ttl@justmail.de>
parents: 19423
diff changeset
475
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
476 #if defined (HAVE_QSCINTILLA)
21203
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21045
diff changeset
477 # if defined (Q_OS_WIN32)
19245
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
478 int eol_mode = QsciScintilla::EolWindows;
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
479 #elif defined (Q_OS_MAC)
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
480 int eol_mode = QsciScintilla::EolMac;
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
481 #else
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
482 int eol_mode = QsciScintilla::EolUnix;
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
483 #endif
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
484 #else
19248
54943eb0ce37 reorder eol modes in the editor settings
Torsten <ttl@justmail.de>
parents: 19245
diff changeset
485 int eol_mode = 2;
19245
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
486 #endif
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
487 ui->combo_eol_mode->setCurrentIndex (
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
488 settings->value ("editor/default_eol_mode",eol_mode).toInt ());
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
489 ui->editor_auto_ind_checkbox->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
490 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
491 ui->editor_tab_ind_checkbox->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
492 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
493 ui->editor_bs_unind_checkbox->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
494 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
495 ui->editor_ind_guides_checkbox->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
496 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
497 ui->editor_ind_width_spinbox->setValue (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
498 settings->value ("editor/indent_width", 2).toInt ());
19312
5fb4505b84ff provide option for using tabs for indentations in the editor
Torsten <ttl@justmail.de>
parents: 19248
diff changeset
499 ui->editor_ind_uses_tabs_checkbox->setChecked (
5fb4505b84ff provide option for using tabs for indentations in the editor
Torsten <ttl@justmail.de>
parents: 19248
diff changeset
500 settings->value ("editor/indent_uses_tabs", false).toBool ());
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
501 ui->editor_tab_width_spinbox->setValue (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
502 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
503 ui->editor_longWindowTitle->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
504 settings->value ("editor/longWindowTitle",false).toBool ());
18343
3df71e1d3b24 improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
505 ui->editor_notebook_tab_width_min->setValue (
3df71e1d3b24 improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
506 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: 18310
diff changeset
507 ui->editor_notebook_tab_width_max->setValue (
3df71e1d3b24 improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
508 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
509 ui->editor_restoreSession->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
510 settings->value ("editor/restoreSession", true).toBool ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
511 ui->editor_create_new_file->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
512 settings->value ("editor/create_new_file",false).toBool ());
18946
0be65bd7f369 add an user preference for loading changed files without a prompt (bug #42678)
Torsten <ttl@justmail.de>
parents: 18833
diff changeset
513 ui->editor_reload_changed_files->setChecked (
0be65bd7f369 add an user preference for loading changed files without a prompt (bug #42678)
Torsten <ttl@justmail.de>
parents: 18833
diff changeset
514 settings->value ("editor/always_reload_changed_files",false).toBool ());
23204
75515a7b1b4b add preference for closing files when editor is closed/hidden (bug #50106)
Torsten <mttl@mailbox.org>
parents: 23190
diff changeset
515 ui->editor_hiding_closes_files->setChecked (
75515a7b1b4b add preference for closing files when editor is closed/hidden (bug #50106)
Torsten <mttl@mailbox.org>
parents: 23190
diff changeset
516 settings->value ("editor/hiding_closes_files",false).toBool ());
18489
6eae8ba32e62 provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents: 18343
diff changeset
517
6eae8ba32e62 provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents: 18343
diff changeset
518 // terminal
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
519 ui->terminal_fontName->setCurrentFont (QFont (
23807
336f89b6208b Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents: 23799
diff changeset
520 settings->value ("terminal/fontName", "Courier New").toString ()));
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
521 ui->terminal_fontSize->setValue (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
522 settings->value ("terminal/fontSize", 10).toInt ());
18610
6e81b59d657c Add preference for terminal windows buffer size (bug #41474)
Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
parents: 18489
diff changeset
523 ui->terminal_history_buffer->setValue (
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19847
diff changeset
524 settings->value ("terminal/history_buffer",1000).toInt ());
19585
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
525 ui->terminal_cursorUseForegroundColor->setChecked (
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
526 settings->value ("terminal/cursorUseForegroundColor",true).toBool ());
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
527 ui->terminal_focus_command->setChecked (
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
528 settings->value ("terminal/focus_after_command",false).toBool ());
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
529 ui->terminal_print_dbg_location->setChecked (
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
530 settings->value ("terminal/print_debug_location",false).toBool ());
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
531
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
532 QString cursorType
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
533 = settings->value ("terminal/cursorType", "ibeam").toString ();
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
534
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
535 QStringList items;
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
536 items << QString ("0") << QString ("1") << QString ("2");
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
537 ui->terminal_cursorType->addItems (items);
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
538 ui->terminal_cursorType->setItemText (0, tr ("IBeam Cursor"));
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
539 ui->terminal_cursorType->setItemText (1, tr ("Block Cursor"));
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
540 ui->terminal_cursorType->setItemText (2, tr ("Underline Cursor"));
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
541
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
542 if (cursorType == "ibeam")
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
543 ui->terminal_cursorType->setCurrentIndex (0);
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
544 else if (cursorType == "block")
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
545 ui->terminal_cursorType->setCurrentIndex (1);
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
546 else if (cursorType == "underline")
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
547 ui->terminal_cursorType->setCurrentIndex (2);
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
548
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
549 // file browser
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
550 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: 18309
diff changeset
551 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
552 ui->sync_octave_directory->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
553 settings->value ("filesdockwidget/sync_octave_directory",true).toBool ());
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
554 ui->cb_restore_file_browser_dir->setChecked (
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19847
diff changeset
555 settings->value ("filesdockwidget/restore_last_dir",false).toBool ());
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
556 ui->le_file_browser_dir->setText (
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19847
diff changeset
557 settings->value ("filesdockwidget/startup_dir").toString ());
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
558 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: 18309
diff changeset
559 this, SLOT (get_file_browser_dir ()));
20706
fec7cc73507b Make the file browser open files more consistently (bug #45844)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20702
diff changeset
560 ui->le_file_browser_extensions->setText (
fec7cc73507b Make the file browser open files more consistently (bug #45844)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20702
diff changeset
561 settings->value ("filesdockwidget/txt_file_extensions", "m;c;cc;cpp;h;txt")
fec7cc73507b Make the file browser open files more consistently (bug #45844)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20702
diff changeset
562 .toString ());
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
563
17942
0b71746689dc add preference for allowing connections to the octave web site
Torsten <ttl@justmail.de>
parents: 17790
diff changeset
564 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
565 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
566 ui->useProxyServer->setChecked (
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
567 settings->value ("useProxyServer", false).toBool ());
13607
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
568 ui->proxyHostName->setText (settings->value ("proxyHostName").toString ());
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
569
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
570 int currentIndex = 0;
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
571 QString proxyTypeString = settings->value ("proxyType").toString ();
18678
6113e0c6920b maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents: 18639
diff changeset
572 while ((currentIndex < ui->proxyType->count ())
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19847
diff changeset
573 && (ui->proxyType->currentText () != proxyTypeString))
13607
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
574 {
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
575 currentIndex++;
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
576 ui->proxyType->setCurrentIndex (currentIndex);
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
577 }
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
578
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
579 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
580 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
581 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
582
19042
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18946
diff changeset
583 // Workspace
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18946
diff changeset
584 // colors
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
585 read_workspace_colors (settings);
19042
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18946
diff changeset
586 // hide tool tips
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18946
diff changeset
587 ui->cb_hide_tool_tips->setChecked (
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18946
diff changeset
588 settings->value ("workspaceview/hide_tool_tips",false).toBool ());
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
589
16620
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
590 // terminal colors
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
591 read_terminal_colors (settings);
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
592
18717
f017240310fb disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents: 18639
diff changeset
593 // shortcuts
18822
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
594
18717
f017240310fb disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents: 18639
diff changeset
595 ui->cb_prevent_readline_conflicts->setChecked (
f017240310fb disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents: 18639
diff changeset
596 settings->value ("shortcuts/prevent_readline_conflicts", true).toBool ());
f017240310fb disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents: 18639
diff changeset
597
18822
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
598 // initialize the tree view with all shortcut data
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
599 shortcut_manager::fill_treewidget (ui->shortcuts_treewidget);
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
600
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
601 // connect the buttons for import/export of the shortcut sets
20685
be130eb147f8 provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents: 20647
diff changeset
602 connect (ui->btn_import_shortcut_set, SIGNAL (clicked ()),
be130eb147f8 provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents: 20647
diff changeset
603 this, SLOT (import_shortcut_set ()));
be130eb147f8 provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents: 20647
diff changeset
604 connect (ui->btn_export_shortcut_set, SIGNAL (clicked ()),
be130eb147f8 provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents: 20647
diff changeset
605 this, SLOT (export_shortcut_set ()));
20702
b6b16d8c8b57 possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents: 20685
diff changeset
606 connect (ui->btn_default_shortcut_set, SIGNAL (clicked ()),
b6b16d8c8b57 possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents: 20685
diff changeset
607 this, SLOT (default_shortcut_set ()));
18822
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
608
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
609 #if defined (HAVE_QSCINTILLA)
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
610 // 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
611 QsciLexer *lexer;
16667
7f6f0b3f7369 Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents: 16646
diff changeset
612 #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
613 lexer = new QsciLexerOctave ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
614 read_lexer_settings (ui, lexer, settings);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
615 delete lexer;
16667
7f6f0b3f7369 Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents: 16646
diff changeset
616 #elif defined (HAVE_LEXER_MATLAB)
7f6f0b3f7369 Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents: 16646
diff changeset
617 lexer = new QsciLexerMatlab ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
618 read_lexer_settings (ui, lexer, settings);
16667
7f6f0b3f7369 Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents: 16646
diff changeset
619 delete lexer;
7f6f0b3f7369 Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents: 16646
diff changeset
620 #endif
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
621 lexer = new QsciLexerCPP ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
622 read_lexer_settings (ui, lexer, settings);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
623 delete lexer;
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
624 lexer = new QsciLexerPerl ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
625 read_lexer_settings (ui, lexer, settings);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
626 delete lexer;
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
627 lexer = new QsciLexerBatch ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
628 read_lexer_settings (ui, lexer, settings);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
629 delete lexer;
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
630 lexer = new QsciLexerDiff ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
631 read_lexer_settings (ui, lexer, settings);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
632 delete lexer;
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
633 lexer = new QsciLexerBash ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
634 read_lexer_settings (ui, lexer, settings);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
635 delete lexer;
19348
c364b9a44580 provide an editor lexer for text or unknown files (bug #43572)
Torsten <ttl@justmail.de>
parents: 19312
diff changeset
636 lexer = new octave_txt_lexer ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
637 read_lexer_settings (ui, lexer, settings);
19348
c364b9a44580 provide an editor lexer for text or unknown files (bug #43572)
Torsten <ttl@justmail.de>
parents: 19312
diff changeset
638 delete lexer;
16623
9c0487bb205b save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents: 16620
diff changeset
639 #endif
9c0487bb205b save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents: 16620
diff changeset
640
17676
c060ad097056 add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents: 16865
diff changeset
641 // which tab is the desired one?
19632
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
642 show_tab (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
643
19632
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
644 // connect button box signal
19631
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
645 connect (ui->button_box, SIGNAL (clicked (QAbstractButton *)),
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
646 this, SLOT (button_clicked (QAbstractButton *)));
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
647 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
648
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
649 settings_dialog::~settings_dialog ()
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
650 {
15274
c5d09a57ceb2 provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents: 15204
diff changeset
651 delete ui;
c5d09a57ceb2 provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents: 15204
diff changeset
652 }
c5d09a57ceb2 provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents: 15204
diff changeset
653
19632
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
654 void
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
655 settings_dialog::show_tab (const QString& tab)
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
656 {
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
657 if (tab.isEmpty ())
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
658 {
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
659 QSettings *settings = resource_manager::get_settings ();
22177
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
660 if (settings)
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
661 ui->tabWidget->setCurrentIndex (settings->value ("settings/last_tab",
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 22022
diff changeset
662 0).toInt ());
19632
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
663 }
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
664 else
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
665 {
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
666 QHash <QString, QWidget*> tab_hash;
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
667 tab_hash["editor"] = ui->tab_editor;
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
668 tab_hash["editor_styles"] = ui->tab_editor_styles;
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
669 ui->tabWidget->setCurrentIndex (
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
670 ui->tabWidget->indexOf (tab_hash.value (tab)));
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
671 }
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
672 }
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
673
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
674 void
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
675 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
676 {
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
677
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
678 QList<QColor> default_colors =
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
679 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
680 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
681 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
682 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
683
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
684 QGridLayout *style_grid = new QGridLayout ();
16626
4adf3c4bd80b GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 16623
diff changeset
685 QVector<QLabel*> description (nr_of_classes);
4adf3c4bd80b GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 16623
diff changeset
686 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
687
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
688 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
689 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
690 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
691 {
16749
c9007267cbf5 Variation of color option layouts with columns packed to the left
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16748
diff changeset
692 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
693 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
694 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
695 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
696 + 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
697 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
698 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
699 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
700 color[i]->setMinimumSize (30, 10);
28a58b06e4ff Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16703
diff changeset
701 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
702 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
703 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
704 {
16749
c9007267cbf5 Variation of color option layouts with columns packed to the left
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16748
diff changeset
705 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
706 row++;
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
707 column = 0;
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
708 }
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
709 }
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
710
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
711 // 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
712 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
713 }
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
714
16620
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
715 void
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
716 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
717 {
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
718
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
719 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
720 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
721 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
722 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
723
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
724 QGridLayout *style_grid = new QGridLayout ();
16626
4adf3c4bd80b GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 16623
diff changeset
725 QVector<QLabel*> description (nr_of_classes);
4adf3c4bd80b GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 16623
diff changeset
726 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
727
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
728 int column = 0;
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
729 int row = 0;
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
730 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
731 {
16749
c9007267cbf5 Variation of color option layouts with columns packed to the left
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16748
diff changeset
732 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
733 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
734 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
735 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
736 + 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
737 default_var).value<QColor> ();
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
738 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
739 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
740 color[i]->setMinimumSize (30, 10);
28a58b06e4ff Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16703
diff changeset
741 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
742 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
743 if (++column == 2)
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
744 {
16748
28a58b06e4ff Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16703
diff changeset
745 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
746 row++;
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
747 column = 0;
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
748 }
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
749 }
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
750
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
751 // 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
752 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
753 }
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
754
15274
c5d09a57ceb2 provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents: 15204
diff changeset
755 void
19664
ff56a9899101 fix new shortcut dialog when applying new settings (fix #44196)
Torsten <ttl@justmail.de>
parents: 19642
diff changeset
756 settings_dialog::write_changed_settings (bool closing)
15274
c5d09a57ceb2 provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents: 15204
diff changeset
757 {
15164
bc801a44bb1f follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents: 15156
diff changeset
758 QSettings *settings = resource_manager::get_settings ();
21007
0a09c3cae800 New marker class for modified file breakpoint and position maintenance.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 20992
diff changeset
759
15972
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
760 // the icon set
15914
85f9aca30c76 gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents: 15787
diff changeset
761 QString widget_icon_set = "NONE";
15787
b081fbe80174 provide separate icons for gui's floating widgets
Torsten <ttl@justmail.de>
parents: 15368
diff changeset
762 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
763 widget_icon_set = "LETTER";
15787
b081fbe80174 provide separate icons for gui's floating widgets
Torsten <ttl@justmail.de>
parents: 15368
diff changeset
764 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
765 widget_icon_set = "GRAPHIC";
15787
b081fbe80174 provide separate icons for gui's floating widgets
Torsten <ttl@justmail.de>
parents: 15368
diff changeset
766 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
767
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
768 // language
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
769 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
770 if (language == tr ("System setting"))
15972
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
771 language = "SYSTEM";
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
772 settings->setValue ("language", language);
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
773
18180
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
774 // dock widget title bar
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
775 settings->setValue ("DockWidgets/widget_title_custom_style",
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
776 ui->cb_widget_custom_style->isChecked ());
19913
2a992bd19169 make color gradient of custom title bar adjustable (bug #44435)
Torsten <ttl@justmail.de>
parents: 19861
diff changeset
777 settings->setValue ("DockWidgets/widget_title_3d",
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
778 ui->sb_3d_title->value ());
18180
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
779 settings->setValue ("Dockwidgets/title_bg_color",
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
780 _widget_title_bg_color->color ());
19423
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
781 settings->setValue ("Dockwidgets/title_bg_color_active",
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
782 _widget_title_bg_color_active->color ());
18180
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
783 settings->setValue ("Dockwidgets/title_fg_color",
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
784 _widget_title_fg_color->color ());
19423
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
785 settings->setValue ("Dockwidgets/title_fg_color_active",
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 19348
diff changeset
786 _widget_title_fg_color_active->color ());
18180
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 18156
diff changeset
787
18309
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
788 // icon size
19847
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
789 int icon_size = 0;
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
790 if (ui->icon_size_small->isChecked ())
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
791 icon_size = -1;
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
792 else if (ui->icon_size_large->isChecked ())
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
793 icon_size = 1;
597fc0fd8e54 make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents: 19846
diff changeset
794 settings->setValue ("toolbar_icon_size", icon_size);
18309
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
795
23810
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
796 // cursor blinking
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
797 settings->setValue ("cursor_blinking", ui->cb_cursor_blinking->isChecked ());
9c24aae7515f allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents: 23807
diff changeset
798
18639
7cb98e81ecd1 GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents: 18611
diff changeset
799 // promp to exit
18678
6113e0c6920b maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents: 18639
diff changeset
800 settings->setValue ("prompt_to_exit", ui->cb_prompt_to_exit->isChecked ());
18639
7cb98e81ecd1 GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents: 18611
diff changeset
801
18733
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
802 // status bar
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
803 settings->setValue ("show_status_bar", ui->cb_status_bar->isChecked ());
18733
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
804
18309
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
805 // Octave startup
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
806 settings->setValue ("restore_octave_dir",
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
807 ui->cb_restore_octave_dir->isChecked ());
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
808 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: 18302
diff changeset
809
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
810 //editor
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
811 settings->setValue ("useCustomFileEditor",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
812 ui->useCustomFileEditor->isChecked ());
13537
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
813 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
814 settings->setValue ("editor/showLineNumbers",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
815 ui->editor_showLineNumbers->isChecked ());
23490
7463c8e91dba customizable size of line numbers in the editor (bug #46959)
Torsten <mttl@mailbox.org>
parents: 23433
diff changeset
816 settings->setValue ("editor/line_numbers_size",
7463c8e91dba customizable size of line numbers in the editor (bug #46959)
Torsten <mttl@mailbox.org>
parents: 23433
diff changeset
817 ui->editor_linenr_size->value ());
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
818 settings->setValue ("editor/highlightCurrentLine",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
819 ui->editor_highlightCurrentLine->isChecked ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
820 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
821 _editor_current_line_color->color ());
23186
9da0d6a86914 enable text background as long line marker in the editor
Torsten <mttl@mailbox.org>
parents: 23181
diff changeset
822 settings->setValue ("editor/long_line_marker_none",
9da0d6a86914 enable text background as long line marker in the editor
Torsten <mttl@mailbox.org>
parents: 23181
diff changeset
823 ui->editor_long_line_marker_none->isChecked ());
18489
6eae8ba32e62 provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents: 18343
diff changeset
824 settings->setValue ("editor/long_line_marker",
6eae8ba32e62 provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents: 18343
diff changeset
825 ui->editor_long_line_marker->isChecked ());
23186
9da0d6a86914 enable text background as long line marker in the editor
Torsten <mttl@mailbox.org>
parents: 23181
diff changeset
826 settings->setValue ("editor/long_line_marker_background",
9da0d6a86914 enable text background as long line marker in the editor
Torsten <mttl@mailbox.org>
parents: 23181
diff changeset
827 ui->editor_long_line_marker_background->isChecked ());
18489
6eae8ba32e62 provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents: 18343
diff changeset
828 settings->setValue ("editor/long_line_column",
6eae8ba32e62 provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents: 18343
diff changeset
829 ui->editor_long_line_column->value ());
23181
78f04a9dfeee allow line breaking in the editor (bug #41555)
Torsten <mttl@mailbox.org>
parents: 23179
diff changeset
830 settings->setValue ("editor/break_lines",
78f04a9dfeee allow line breaking in the editor (bug #41555)
Torsten <mttl@mailbox.org>
parents: 23179
diff changeset
831 ui->editor_break_checkbox->isChecked ());
23237
904c8a356e76 provide the possibility for breaking lines only in comments (bug #41555)
Torsten <mttl@mailbox.org>
parents: 23220
diff changeset
832 settings->setValue ("editor/break_lines_comments",
904c8a356e76 provide the possibility for breaking lines only in comments (bug #41555)
Torsten <mttl@mailbox.org>
parents: 23220
diff changeset
833 ui->editor_break_comments_checkbox->isChecked ());
23179
751c389404b9 enable line wrapping in the editor if desired (bug #41555)
Torsten <mttl@mailbox.org>
parents: 23084
diff changeset
834 settings->setValue ("editor/wrap_lines",
751c389404b9 enable line wrapping in the editor if desired (bug #41555)
Torsten <mttl@mailbox.org>
parents: 23084
diff changeset
835 ui->editor_wrap_checkbox->isChecked ());
18733
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
836 settings->setValue ("editor/code_folding",
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
837 ui->cb_code_folding->isChecked ());
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
838 settings->setValue ("editor/show_edit_status_bar",
f6f1f27026bb status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
839 ui->cb_edit_status_bar->isChecked ());
20992
73e92fca3c78 GUI: add editor toolbar display option (Bug #46705)
John Donoghue <john.donoghue@ieee.org>
parents: 20774
diff changeset
840 settings->setValue ("editor/show_toolbar",
73e92fca3c78 GUI: add editor toolbar display option (Bug #46705)
John Donoghue <john.donoghue@ieee.org>
parents: 20774
diff changeset
841 ui->cb_edit_tool_bar->isChecked ());
23190
4a2c42792d6c highlight all occurrences of a selected word in the editor (bug #41470)
Torsten <mttl@mailbox.org>
parents: 23186
diff changeset
842 settings->setValue ("editor/highlight_all_occurrences",
4a2c42792d6c highlight all occurrences of a selected word in the editor (bug #41470)
Torsten <mttl@mailbox.org>
parents: 23186
diff changeset
843 ui->editor_highlight_all_occurrences->isChecked ());
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
844 settings->setValue ("editor/codeCompletion",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
845 ui->editor_codeCompletion->isChecked ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
846 settings->setValue ("editor/codeCompletion_threshold",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
847 ui->editor_spinbox_ac_threshold->value ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
848 settings->setValue ("editor/codeCompletion_keywords",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
849 ui->editor_checkbox_ac_keywords->isChecked ());
18833
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
850 settings->setValue ("editor/codeCompletion_octave_builtins",
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
851 ui->editor_checkbox_ac_builtins->isChecked ());
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
852 settings->setValue ("editor/codeCompletion_octave_functions",
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
853 ui->editor_checkbox_ac_functions->isChecked ());
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
854 settings->setValue ("editor/codeCompletion_document",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
855 ui->editor_checkbox_ac_document->isChecked ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
856 settings->setValue ("editor/codeCompletion_case",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
857 ui->editor_checkbox_ac_case->isChecked ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
858 settings->setValue ("editor/codeCompletion_replace",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
859 ui->editor_checkbox_ac_replace->isChecked ());
23688
cb36684b7a33 In the GUI editor, automatically add "endif" for "if" etc.
Lachlan Andrew <lachlanbis@gmail.com>
parents: 23490
diff changeset
860 settings->setValue ("editor/auto_endif",
cb36684b7a33 In the GUI editor, automatically add "endif" for "if" etc.
Lachlan Andrew <lachlanbis@gmail.com>
parents: 23490
diff changeset
861 ui->editor_auto_endif->currentIndex ());
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
862 settings->setValue ("editor/show_white_space",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
863 ui->editor_ws_checkbox->isChecked ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
864 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
865 ui->editor_ws_indent_checkbox->isChecked ());
19245
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
866 settings->setValue ("editor/show_eol_chars",
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
867 ui->cb_show_eol->isChecked ());
19430
472a5572849c hiding horizontal scroll bar in editor when not needed (bug #41592)
Torsten <ttl@justmail.de>
parents: 19423
diff changeset
868 settings->setValue ("editor/show_hscroll_bar",
472a5572849c hiding horizontal scroll bar in editor when not needed (bug #41592)
Torsten <ttl@justmail.de>
parents: 19423
diff changeset
869 ui->cb_show_hscrollbar->isChecked ());
19245
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
870 settings->setValue ("editor/default_eol_mode",
f3c4b48f3c53 add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
871 ui->combo_eol_mode->currentIndex ());
23066
bd8ea9e44230 Allow changing comment character when using Ctrl+R... (bug #49182)
Abhinav Tripathi <genuinelucifer@gmail.com>
parents: 22755
diff changeset
872 settings->setValue ("editor/octave_comment_string",
bd8ea9e44230 Allow changing comment character when using Ctrl+R... (bug #49182)
Abhinav Tripathi <genuinelucifer@gmail.com>
parents: 22755
diff changeset
873 ui->combo_oct_comment_str->currentIndex ());
20753
7d6f38541902 default encoding for editor on non windows systems is utf-8 (bug #45597)
Torsten <ttl@justmail.de>
parents: 20731
diff changeset
874 settings->setValue ("editor/default_encoding",
7d6f38541902 default encoding for editor on non windows systems is utf-8 (bug #45597)
Torsten <ttl@justmail.de>
parents: 20731
diff changeset
875 ui->editor_combo_encoding->currentText ());
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
876 settings->setValue ("editor/auto_indent",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
877 ui->editor_auto_ind_checkbox->isChecked ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
878 settings->setValue ("editor/tab_indents_line",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
879 ui->editor_tab_ind_checkbox->isChecked ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
880 settings->setValue ("editor/backspace_unindents_line",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
881 ui->editor_bs_unind_checkbox->isChecked ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
882 settings->setValue ("editor/show_indent_guides",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
883 ui->editor_ind_guides_checkbox->isChecked ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
884 settings->setValue ("editor/indent_width",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
885 ui->editor_ind_width_spinbox->value ());
19312
5fb4505b84ff provide option for using tabs for indentations in the editor
Torsten <ttl@justmail.de>
parents: 19248
diff changeset
886 settings->setValue ("editor/indent_uses_tabs",
5fb4505b84ff provide option for using tabs for indentations in the editor
Torsten <ttl@justmail.de>
parents: 19248
diff changeset
887 ui->editor_ind_uses_tabs_checkbox->isChecked ());
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
888 settings->setValue ("editor/tab_width",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
889 ui->editor_tab_width_spinbox->value ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
890 settings->setValue ("editor/longWindowTitle",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
891 ui->editor_longWindowTitle->isChecked ());
18343
3df71e1d3b24 improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
892 settings->setValue ("editor/notebook_tab_width_min",
3df71e1d3b24 improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
893 ui->editor_notebook_tab_width_min->value ());
3df71e1d3b24 improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
894 settings->setValue ("editor/notebook_tab_width_max",
3df71e1d3b24 improve width of editor tabs when showing complete file path
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
895 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
896 settings->setValue ("editor/restoreSession",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
897 ui->editor_restoreSession->isChecked ());
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
898 settings->setValue ("editor/create_new_file",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
899 ui->editor_create_new_file->isChecked ());
23204
75515a7b1b4b add preference for closing files when editor is closed/hidden (bug #50106)
Torsten <mttl@mailbox.org>
parents: 23190
diff changeset
900 settings->setValue ("editor/hiding_closes_files",
75515a7b1b4b add preference for closing files when editor is closed/hidden (bug #50106)
Torsten <mttl@mailbox.org>
parents: 23190
diff changeset
901 ui->editor_hiding_closes_files->isChecked ());
18946
0be65bd7f369 add an user preference for loading changed files without a prompt (bug #42678)
Torsten <ttl@justmail.de>
parents: 18833
diff changeset
902 settings->setValue ("editor/always_reload_changed_files",
0be65bd7f369 add an user preference for loading changed files without a prompt (bug #42678)
Torsten <ttl@justmail.de>
parents: 18833
diff changeset
903 ui->editor_reload_changed_files->isChecked ());
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
904 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
905 settings->setValue ("terminal/fontName",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
906 ui->terminal_fontName->currentFont ().family ());
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
907
20647
98a730e0dd51 remove column visibility of file browser from settings dialog
Torsten <ttl@justmail.de>
parents: 20279
diff changeset
908 // file browser
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
909 settings->setValue ("filesdockwidget/sync_octave_directory",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
910 ui->sync_octave_directory->isChecked ());
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
911 settings->setValue ("filesdockwidget/restore_last_dir",
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
912 ui->cb_restore_file_browser_dir->isChecked ());
19595
be7ac98fab43 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19585
diff changeset
913 settings->setValue ("filesdockwidget/startup_dir",
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
914 ui->le_file_browser_dir->text ());
20706
fec7cc73507b Make the file browser open files more consistently (bug #45844)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20702
diff changeset
915 settings->setValue ("filesdockwidget/txt_file_extensions",
fec7cc73507b Make the file browser open files more consistently (bug #45844)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20702
diff changeset
916 ui->le_file_browser_extensions->text ());
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
917
17942
0b71746689dc add preference for allowing connections to the octave web site
Torsten <ttl@justmail.de>
parents: 17790
diff changeset
918 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
919 ui->checkbox_allow_web_connect->isChecked ());
13607
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
920 settings->setValue ("useProxyServer", ui->useProxyServer->isChecked ());
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
921 settings->setValue ("proxyType", ui->proxyType->currentText ());
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
922 settings->setValue ("proxyHostName", ui->proxyHostName->text ());
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
923 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
924 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
925 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
926 settings->setValue ("terminal/cursorUseForegroundColor",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
927 ui->terminal_cursorUseForegroundColor->isChecked ());
18156
14acb08d75fa gui: optionally set focus to console when a command is run from another widget
Torsten <ttl@justmail.de>
parents: 17988
diff changeset
928 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
929 ui->terminal_focus_command->isChecked ());
19585
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
930 settings->setValue ("terminal/print_debug_location",
f9a944b9e1cb provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents: 19430
diff changeset
931 ui->terminal_print_dbg_location->isChecked ());
18610
6e81b59d657c Add preference for terminal windows buffer size (bug #41474)
Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
parents: 18489
diff changeset
932 settings->setValue ("terminal/history_buffer",
18678
6113e0c6920b maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents: 18639
diff changeset
933 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
934
15972
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
935 // 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
936 QString cursorType;
de3a318128f2 Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14712
diff changeset
937 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
938 {
de3a318128f2 Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14712
diff changeset
939 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
940 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
941 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
942 }
de3a318128f2 Added support for changing the terminal cursor and the cursor blinking.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14712
diff changeset
943 settings->setValue ("terminal/cursorType", cursorType);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
944
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
945 #if defined (HAVE_QSCINTILLA)
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
946 // 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
947 QsciLexer *lexer;
16667
7f6f0b3f7369 Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents: 16646
diff changeset
948 #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
949 lexer = new QsciLexerOctave ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
950 write_lexer_settings (ui, lexer, settings);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
951 delete lexer;
16667
7f6f0b3f7369 Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents: 16646
diff changeset
952 #elif defined (HAVE_LEXER_MATLAB)
7f6f0b3f7369 Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents: 16646
diff changeset
953 lexer = new QsciLexerMatlab ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
954 write_lexer_settings (ui, lexer, settings);
16667
7f6f0b3f7369 Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents: 16646
diff changeset
955 delete lexer;
7f6f0b3f7369 Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents: 16646
diff changeset
956 #endif
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
957 lexer = new QsciLexerCPP ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
958 write_lexer_settings (ui, lexer, settings);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
959 delete lexer;
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
960 lexer = new QsciLexerPerl ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
961 write_lexer_settings (ui, lexer, settings);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
962 delete lexer;
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
963 lexer = new QsciLexerBatch ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
964 write_lexer_settings (ui, lexer, settings);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
965 delete lexer;
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
966 lexer = new QsciLexerDiff ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
967 write_lexer_settings (ui, lexer, settings);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
968 delete lexer;
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
969 lexer = new QsciLexerBash ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
970 write_lexer_settings (ui, lexer, settings);
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
971 delete lexer;
19348
c364b9a44580 provide an editor lexer for text or unknown files (bug #43572)
Torsten <ttl@justmail.de>
parents: 19312
diff changeset
972 lexer = new octave_txt_lexer ();
20279
3a745710eaca Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents: 19913
diff changeset
973 write_lexer_settings (ui, lexer, settings);
19348
c364b9a44580 provide an editor lexer for text or unknown files (bug #43572)
Torsten <ttl@justmail.de>
parents: 19312
diff changeset
974 delete lexer;
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
975 #endif
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
976
19042
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18946
diff changeset
977 // Workspace
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
978 write_workspace_colors (settings);
19042
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18946
diff changeset
979 // hide tool tips
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18946
diff changeset
980 settings->setValue ("workspaceview/hide_tool_tips",
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18946
diff changeset
981 ui->cb_hide_tool_tips->isChecked ());
16620
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
982
19042
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18946
diff changeset
983 // Terminal
16620
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
984 write_terminal_colors (settings);
16623
9c0487bb205b save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents: 16620
diff changeset
985
18717
f017240310fb disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents: 18639
diff changeset
986 // shortcuts
f017240310fb disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents: 18639
diff changeset
987 settings->setValue ("shortcuts/prevent_readline_conflicts",
f017240310fb disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents: 18639
diff changeset
988 ui->cb_prevent_readline_conflicts->isChecked ());
20685
be130eb147f8 provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents: 20647
diff changeset
989 shortcut_manager::write_shortcuts (settings, closing);
18611
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents: 18610
diff changeset
990
18717
f017240310fb disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents: 18639
diff changeset
991 // settings dialog's geometry
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
992 settings->setValue ("settings/last_tab",ui->tabWidget->currentIndex ());
18302
e8176099889c settings dialog with varaible size (bug #41197)
Torsten <ttl@justmail.de>
parents: 18294
diff changeset
993 settings->setValue ("settings/geometry",saveGeometry ());
18717
f017240310fb disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents: 18639
diff changeset
994
18302
e8176099889c settings dialog with varaible size (bug #41197)
Torsten <ttl@justmail.de>
parents: 18294
diff changeset
995 settings->sync ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
996 }
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 16379
diff changeset
997
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
998 void
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
999 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
1000 {
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
1001
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
1002 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
1003 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
1004
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
1005 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
1006 {
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
1007 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
1008 "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
1009 if (color)
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
1010 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
1011 color->color ());
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
1012 }
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
1013 settings->sync ();
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16525
diff changeset
1014 }
16620
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
1015
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
1016 void
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
1017 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
1018 {
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
1019 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
1020 color_picker *color;
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
1021
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
1022 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
1023 {
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
1024 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
1025 "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
1026 if (color)
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
1027 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
1028 color->color ());
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
1029 }
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
1030 settings->sync ();
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
1031 }
18309
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
1032
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1033 // internal slots
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1034
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1035 void
19631
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
1036 settings_dialog::button_clicked (QAbstractButton *button)
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
1037 {
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
1038 QDialogButtonBox::ButtonRole button_role = ui->button_box->buttonRole (button);
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
1039
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
1040 if (button_role == QDialogButtonBox::ApplyRole ||
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
1041 button_role == QDialogButtonBox::AcceptRole)
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
1042 {
19664
ff56a9899101 fix new shortcut dialog when applying new settings (fix #44196)
Torsten <ttl@justmail.de>
parents: 19642
diff changeset
1043 write_changed_settings (button_role == QDialogButtonBox::AcceptRole);
19631
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
1044 emit apply_new_settings ();
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
1045 }
19632
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
1046
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
1047 if (button_role == QDialogButtonBox::RejectRole ||
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
1048 button_role == QDialogButtonBox::AcceptRole)
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19631
diff changeset
1049 close ();
19631
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
1050 }
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
1051
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19595
diff changeset
1052 void
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1053 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: 18309
diff changeset
1054 {
23070
bef714f45999 maint: Use space after function name/before parenthesis in libgui.
Rik <rik@octave.org>
parents: 23066
diff changeset
1055 QString dir = QFileDialog::getExistingDirectory (this,
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1056 title, line_edit->text (),
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1057 QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1058 line_edit->setText (dir);
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1059 }
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1060
18309
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
1061 void
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
1062 settings_dialog::get_octave_dir ()
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18302
diff changeset
1063 {
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1064 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: 18309
diff changeset
1065 }
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1066
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1067 void
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1068 settings_dialog::get_file_browser_dir ()
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1069 {
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1070 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: 18309
diff changeset
1071 }
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1072
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1073 void
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1074 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: 18309
diff changeset
1075 {
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1076 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: 18309
diff changeset
1077
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1078 if (! disable)
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1079 {
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19847
diff changeset
1080 ui->le_file_browser_dir->setDisabled (
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19847
diff changeset
1081 ui->cb_restore_file_browser_dir->isChecked ());
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19847
diff changeset
1082 ui->pb_file_browser_dir->setDisabled (
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19847
diff changeset
1083 ui->cb_restore_file_browser_dir->isChecked ());
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1084 }
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1085 else
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1086 {
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1087 ui->le_file_browser_dir->setDisabled (disable);
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1088 ui->pb_file_browser_dir->setDisabled (disable);
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1089 }
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
1090 }
18822
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
1091
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
1092 // slots for import/export of shortcut sets
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
1093 void
20685
be130eb147f8 provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents: 20647
diff changeset
1094 settings_dialog::import_shortcut_set ()
18822
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
1095 {
20702
b6b16d8c8b57 possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents: 20685
diff changeset
1096 shortcut_manager::import_export (shortcut_manager::OSC_IMPORT);
18822
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
1097 }
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
1098
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
1099 void
20685
be130eb147f8 provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents: 20647
diff changeset
1100 settings_dialog::export_shortcut_set ()
18822
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18733
diff changeset
1101 {
20702
b6b16d8c8b57 possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents: 20685
diff changeset
1102 shortcut_manager::import_export (shortcut_manager::OSC_EXPORT);
b6b16d8c8b57 possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents: 20685
diff changeset
1103 }
b6b16d8c8b57 possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents: 20685
diff changeset
1104
b6b16d8c8b57 possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents: 20685
diff changeset
1105 void
b6b16d8c8b57 possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents: 20685
diff changeset
1106 settings_dialog::default_shortcut_set ()
b6b16d8c8b57 possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents: 20685
diff changeset
1107 {
b6b16d8c8b57 possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents: 20685
diff changeset
1108 shortcut_manager::import_export (shortcut_manager::OSC_DEFAULT);
20992
73e92fca3c78 GUI: add editor toolbar display option (Bug #46705)
John Donoghue <john.donoghue@ieee.org>
parents: 20774
diff changeset
1109 }