Mercurial > octave
annotate libgui/src/settings-dialog.cc @ 25103:078b795c5219 stable
maint: style check C++ ahead of 4.4 release.
* ButtonGroup.cc, Canvas.cc, Figure.cc, GLCanvas.cc, GLCanvas.h,
ListBoxControl.cc, ObjectProxy.cc, QTerminal.h, dialog.cc, documentation.cc,
files-dock-widget.cc, history-dock-widget.cc, file-editor-tab.cc,
file-editor.h, find-dialog.cc, marker.h, octave-qscintilla.cc,
octave-qscintilla.h, main-window.cc, webinfo.cc, resource-manager.h,
settings-dialog.cc, shortcut-manager.cc, shortcut-manager.h,
variable-editor.cc, workspace-view.cc, build-env.in.cc, __ilu__.cc, cellfun.cc,
data.cc, dirfns.cc, dynamic-ld.h, environment.cc, error.cc, fcn-info.cc,
gl-render.cc, gl2ps-print.cc, graphics.cc, graphics.in.h, help.cc,
interpreter.cc, load-path.cc, load-save.cc, ls-mat5.cc, mex.cc, oct-stream.cc,
oct-stream.h, qz.cc, sighandlers.cc, sparse-xpow.cc, svd.cc, symscope.h,
symtab.cc, symtab.h, sysdep.cc, url-handle-manager.h, utils.cc, variables.cc,
__init_fltk__.cc, __ode15__.cc, gzip.cc, ov-base.cc, ov-builtin.h, ov-cell.cc,
ov-class.cc, ov-dld-fcn.h, ov-fcn-handle.cc, ov-java.cc, ov-re-diag.cc,
op-b-sbm.cc, op-bm-b.cc, op-bm-bm.cc, op-bm-sbm.cc, op-cdm-cdm.cc, op-cell.cc,
op-cm-cm.cc, op-cm-cs.cc, op-cm-m.cc, op-cm-s.cc, op-cm-scm.cc, op-cm-sm.cc,
op-cs-cm.cc, op-cs-cs.cc, op-cs-m.cc, op-cs-s.cc, op-cs-scm.cc, op-cs-sm.cc,
op-dm-dm.cc, op-dm-scm.cc, op-dm-sm.cc, op-fcdm-fcdm.cc, op-fcm-fcm.cc,
op-fcm-fcs.cc, op-fcm-fm.cc, op-fcm-fs.cc, op-fcs-fcm.cc, op-fcs-fcs.cc,
op-fcs-fm.cc, op-fcs-fs.cc, op-fdm-fdm.cc, op-fm-fcm.cc, op-fm-fcs.cc,
op-fm-fm.cc, op-fm-fs.cc, op-fs-fcm.cc, op-fs-fcs.cc, op-fs-fm.cc, op-fs-fs.cc,
op-m-cm.cc, op-m-cs.cc, op-m-m.cc, op-m-s.cc, op-m-scm.cc, op-m-sm.cc,
op-pm-pm.cc, op-pm-scm.cc, op-pm-sm.cc, op-range.cc, op-s-cm.cc, op-s-cs.cc,
op-s-m.cc, op-s-s.cc, op-s-scm.cc, op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc,
op-sbm-sbm.cc, op-scm-cm.cc, op-scm-cs.cc, op-scm-m.cc, op-scm-s.cc,
op-scm-scm.cc, op-scm-sm.cc, op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc, op-sm-s.cc,
op-sm-scm.cc, op-sm-sm.cc, op-str-m.cc, op-str-s.cc, op-str-str.cc,
bp-table.cc, comment-list.h, jit-ir.h, jit-typeinfo.cc, jit-typeinfo.h, lex.h,
parse.h, pt-binop.h, pt-decl.h, pt-eval.cc, pt-jit.cc, pt-jit.h, pt-misc.h,
token.h, CMatrix.cc, CMatrix.h, CSparse.cc, CSparse.h, dMatrix.h, fCMatrix.cc,
fCMatrix.h, fMatrix.h, Faddeeva.cc, gepbalance.cc, hess.cc, oct-fftw.cc,
oct-fftw.h, file-stat.cc, lo-sysinfo.cc, action-container.h, f77-fcn.h,
lo-regexp.cc, oct-mutex.h, oct-shlib.cc:
Use Octave coding conventions in C++ files.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 03 Apr 2018 13:52:07 -0700 |
parents | f50fa34827fb |
children | cdaa884568b1 |
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 |
25054
6652d3823428
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
24828
diff
changeset
|
3 Copyright (C) 2011-2018 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 |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24475
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 |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24475
diff
changeset
|
9 the Free Software Foundation, either version 3 of the License, or |
22755
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 |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24475
diff
changeset
|
19 <https://www.gnu.org/licenses/>. |
15204
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 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
23 // Programming Note: this file has many lines longer than 80 characters |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
24 // due to long function, variable, and property names. Please don't |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
25 // break those lines as it tends to make this code even harder to read. |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
26 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
27 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21213
diff
changeset
|
28 # include "config.h" |
15286
ae9079bbc627
Add '#include <config.h>' to C++ files in libgui/src
Rik <rik@octave.org>
parents:
15274
diff
changeset
|
29 #endif |
ae9079bbc627
Add '#include <config.h>' to C++ files in libgui/src
Rik <rik@octave.org>
parents:
15274
diff
changeset
|
30 |
14707
674740c44c09
Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14703
diff
changeset
|
31 #include "resource-manager.h" |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
18610
diff
changeset
|
32 #include "shortcut-manager.h" |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
33 #include "variable-editor.h" |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
34 #include "workspace-model.h" |
14707
674740c44c09
Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14703
diff
changeset
|
35 #include "settings-dialog.h" |
15156
141b0b108292
allow building without gui to work
John W. Eaton <jwe@octave.org>
parents:
14998
diff
changeset
|
36 #include "ui-settings-dialog.h" |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
37 #include <QDir> |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
38 #include <QFileInfo> |
18309
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18302
diff
changeset
|
39 #include <QFileDialog> |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
40 #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
|
41 #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
|
42 #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
|
43 #include <QTextCodec> |
13501 | 44 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
45 #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
|
46 # include "octave-qscintilla.h" |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
21045
diff
changeset
|
47 # 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
|
48 # include <QScrollArea> |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
49 |
21203
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
21045
diff
changeset
|
50 # if defined (HAVE_QSCI_QSCILEXEROCTAVE_H) |
21213
f7d1050b9b53
maint: Clean up various usages of #ifdef.
Rik <rik@octave.org>
parents:
21203
diff
changeset
|
51 # 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
|
52 # include <Qsci/qscilexeroctave.h> |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
21045
diff
changeset
|
53 # elif defined (HAVE_QSCI_QSCILEXERMATLAB_H) |
21213
f7d1050b9b53
maint: Clean up various usages of #ifdef.
Rik <rik@octave.org>
parents:
21203
diff
changeset
|
54 # 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
|
55 # include <Qsci/qscilexermatlab.h> |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
21045
diff
changeset
|
56 # endif |
16677
f6dfc7705623
* settings-dialog.cc: enable octave lexer editor styles if lexer is present
Torsten <ttl@justmail.de>
parents:
16667
diff
changeset
|
57 |
21203
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
21045
diff
changeset
|
58 # include <Qsci/qscilexercpp.h> |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
21045
diff
changeset
|
59 # include <Qsci/qscilexerbash.h> |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
21045
diff
changeset
|
60 # include <Qsci/qscilexerperl.h> |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
21045
diff
changeset
|
61 # include <Qsci/qscilexerbatch.h> |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
21045
diff
changeset
|
62 # include <Qsci/qscilexerdiff.h> |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
63 #endif |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
64 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
65 #if defined (HAVE_QSCINTILLA) |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
66 |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
67 static const int MaxLexerStyles = 64; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
68 static const int MaxStyleNumber = 128; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
69 |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
70 static int |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
71 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
|
72 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
73 int max_style = 0; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
74 int actual_style = 0; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
75 while (actual_style < MaxStyleNumber && max_style < MaxLexerStyles) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
76 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
77 if ((lexer->description (actual_style)) != "") // valid style |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
78 styles[max_style++] = actual_style; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
79 actual_style++; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
80 } |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
81 return max_style; |
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 |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
84 static void |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25074
diff
changeset
|
85 read_lexer_settings (Ui::settings_dialog *ui, QsciLexer *lexer, |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25074
diff
changeset
|
86 QSettings *settings) |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
87 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
88 lexer->readSettings (*settings); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
89 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
|
90 // (enum is not continuous) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
91 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
|
92 QGridLayout *style_grid = new QGridLayout (); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
93 QVector<QLabel*> description (max_style); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
94 QVector<QFontComboBox*> select_font (max_style); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
95 QVector<QSpinBox*> font_size (max_style); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
96 QVector<QCheckBox*> attrib_font (3 * max_style); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
97 QVector<color_picker*> color (max_style); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
98 QVector<color_picker*> bg_color (max_style); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
99 int default_size = 10; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
100 QFont default_font = QFont (); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
101 int label_width; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
102 QColor default_color = QColor (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
103 QColor dummy_color = QColor (255, 0, 255); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
104 |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
105 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
|
106 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
107 QString actual_name = lexer->description (styles[i]); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
108 QFont actual_font = lexer->font (styles[i]); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
109 description[i] = new QLabel (actual_name); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
110 description[i]->setWordWrap (true); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
111 label_width = 24*description[i]->fontMetrics ().averageCharWidth (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
112 description[i]->setMaximumSize (label_width, QWIDGETSIZE_MAX); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
113 description[i]->setMinimumSize (label_width, 1); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
114 select_font[i] = new QFontComboBox (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
115 select_font[i]->setObjectName (actual_name + "_font"); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
116 select_font[i]->setMaximumSize (label_width, QWIDGETSIZE_MAX); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
117 select_font[i]->setMinimumSize (label_width, 1); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
118 font_size[i] = new QSpinBox (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
119 font_size[i]->setObjectName (actual_name + "_size"); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
120 if (styles[i] == 0) // the default |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
121 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
122 select_font[i]->setCurrentFont (actual_font); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
123 default_font = actual_font; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
124 font_size[i]->setRange (6, 24); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
125 default_size = actual_font.pointSize (); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
126 font_size[i]->setValue (default_size); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
127 default_color = lexer->defaultPaper (); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
128 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
|
129 } |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
130 else // other styles |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
131 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
132 select_font[i]->setCurrentFont (actual_font); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
133 if (actual_font.family () == default_font.family ()) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
134 select_font[i]->setEditText (lexer->description (0)); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
135 font_size[i]->setRange (-4, 4); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
136 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
|
137 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
|
138 if (lexer->paper (styles[i]) == default_color) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
139 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
|
140 else |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
141 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
|
142 bg_color[i]->setToolTip |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
143 (QObject::tr ("Background color, pink (255, 0, 255) means default")); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
144 } |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
145 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
|
146 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
|
147 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
|
148 attrib_font[0+3*i]->setChecked (actual_font.bold ()); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
149 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
|
150 attrib_font[1+3*i]->setChecked (actual_font.italic ()); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
151 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
|
152 attrib_font[2+3*i]->setChecked (actual_font.underline ()); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
153 attrib_font[2+3*i]->setObjectName (actual_name + "_underline"); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
154 color[i] = new color_picker (lexer->color (styles[i])); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
155 color[i]->setObjectName (actual_name + "_color"); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
156 bg_color[i]->setObjectName (actual_name + "_bg_color"); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
157 int column = 1; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
158 style_grid->addWidget (description[i], i, column++); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
159 style_grid->addWidget (select_font[i], i, column++); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
160 style_grid->addWidget (font_size[i], i, column++); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
161 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
|
162 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
|
163 style_grid->addWidget (attrib_font[2+3*i], i, column++); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
164 style_grid->addWidget (color[i], i, column++); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
165 style_grid->addWidget (bg_color[i], i, column++); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
166 } |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
167 // place grid with elements into the tab |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
168 QScrollArea *scroll_area = new QScrollArea (); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
169 QWidget *scroll_area_contents = new QWidget (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
170 scroll_area_contents->setObjectName (QString (lexer->language ()) + "_styles"); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
171 scroll_area_contents->setLayout (style_grid); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
172 scroll_area->setWidget (scroll_area_contents); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
173 ui->tabs_editor_lexers->addTab (scroll_area, lexer->language ()); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
174 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
175 ui->tabs_editor_lexers->setCurrentIndex (settings->value ("settings/last_editor_styles_tab", 0).toInt ()); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
176 } |
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 static void |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25074
diff
changeset
|
179 write_lexer_settings (Ui::settings_dialog *ui, QsciLexer *lexer, |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25074
diff
changeset
|
180 QSettings *settings) |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
181 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
182 QWidget *tab = ui->tabs_editor_lexers-> |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25074
diff
changeset
|
183 findChild <QWidget *> (QString (lexer->language ()) + "_styles"); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
184 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
|
185 // (enum is not continuous) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
186 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
|
187 QFontComboBox *select_font; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
188 QSpinBox *font_size; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
189 QCheckBox *attrib_font[3]; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
190 color_picker *color; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
191 color_picker *bg_color; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
192 int default_size = 10; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
193 QFont default_font = QFont ("Courier New", 10, -1, 0); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
194 QColor default_color = QColor (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
195 QColor dummy_color = QColor (255, 0, 255); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
196 |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
197 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
|
198 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
199 QString actual_name = lexer->description (styles[i]); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
200 select_font = tab->findChild <QFontComboBox *> (actual_name + "_font"); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
201 font_size = tab->findChild <QSpinBox *> (actual_name + "_size"); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
202 attrib_font[0] = tab->findChild <QCheckBox *> (actual_name + "_bold"); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
203 attrib_font[1] = tab->findChild <QCheckBox *> (actual_name + "_italic"); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
204 attrib_font[2] = tab->findChild <QCheckBox *> (actual_name + "_underline"); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
205 color = tab->findChild <color_picker *> (actual_name + "_color"); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
206 bg_color = tab->findChild <color_picker *> (actual_name + "_bg_color"); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
207 QFont new_font = default_font; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
208 if (select_font) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
209 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
210 new_font = select_font->currentFont (); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
211 if (styles[i] == 0) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
212 default_font = new_font; |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
213 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
|
214 new_font = default_font; |
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 if (font_size) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
217 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
218 if (styles[i] == 0) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
219 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
220 default_size = font_size->value (); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
221 new_font.setPointSize (font_size->value ()); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
222 } |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
223 else |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
224 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
|
225 } |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
226 if (attrib_font[0]) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
227 new_font.setBold (attrib_font[0]->isChecked ()); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
228 if (attrib_font[1]) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
229 new_font.setItalic (attrib_font[1]->isChecked ()); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
230 if (attrib_font[2]) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
231 new_font.setUnderline (attrib_font[2]->isChecked ()); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
232 lexer->setFont (new_font, styles[i]); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
233 if (styles[i] == 0) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
234 lexer->setDefaultFont (new_font); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
235 if (color) |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
236 lexer->setColor (color->color (), styles[i]); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
237 if (bg_color) |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
238 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
239 if (styles[i] == 0) |
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 default_color = bg_color->color (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
242 lexer->setPaper (default_color, styles[i]); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
243 lexer->setDefaultPaper (default_color); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
244 } |
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 { |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
247 if (bg_color->color () == dummy_color) |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
248 lexer->setPaper (default_color, styles[i]); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
249 else |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
250 lexer->setPaper (bg_color->color (), styles[i]); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
251 } |
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 } |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
254 |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
255 lexer->writeSettings (*settings); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
256 |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25074
diff
changeset
|
257 settings->setValue ("settings/last_editor_styles_tab", |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25074
diff
changeset
|
258 ui->tabs_editor_lexers->currentIndex ()); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
259 settings->sync (); |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
260 } |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
261 |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
262 #endif |
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
263 |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
264 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
|
265 QDialog (p), ui (new Ui::settings_dialog) |
13501 | 266 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
267 ui->setupUi (this); |
13501 | 268 |
15164
bc801a44bb1f
follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents:
15156
diff
changeset
|
269 QSettings *settings = resource_manager::get_settings (); |
18302
e8176099889c
settings dialog with varaible size (bug #41197)
Torsten <ttl@justmail.de>
parents:
18294
diff
changeset
|
270 |
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
|
271 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
|
272 { |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
273 QMessageBox msgBox |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
274 (QMessageBox::Warning, tr ("Octave Settings"), |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
275 tr ("Unable to save settings. Missing settings file or unknown directory.")); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
276 |
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
|
277 msgBox.exec (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
278 |
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
|
279 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
|
280 } |
6e9f5408c0db
Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
22022
diff
changeset
|
281 |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
282 // look for available language files and the actual settings |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
283 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
|
284 QDir qm_dir (qm_dir_name); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
285 QFileInfoList qm_files = qm_dir.entryInfoList (QStringList ("*.qm"), QDir::Files | QDir::Readable, QDir::Name); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
286 |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
287 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
|
288 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
|
289 // System at beginning |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
290 ui->comboBox_language->insertItem (0, tr ("System setting")); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
291 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
|
292 QString language = settings->value ("language", "SYSTEM").toString (); |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
293 if (language == "SYSTEM") |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
294 language = tr ("System setting"); |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
295 int selected = ui->comboBox_language->findText (language); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
296 if (selected >= 0) |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
297 ui->comboBox_language->setCurrentIndex (selected); |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
298 else |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
299 ui->comboBox_language->setCurrentIndex (0); // System is default |
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
300 |
19847
597fc0fd8e54
make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents:
19846
diff
changeset
|
301 // icon size |
597fc0fd8e54
make size of toolbar icons depending on scaling of display
Torsten <ttl@justmail.de>
parents:
19846
diff
changeset
|
302 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
|
303 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
|
304 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
|
305 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
|
306 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
|
307 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
|
308 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
|
309 ui->icon_size_large->setChecked (icon_size == 1); |
16525
e192525236ad
configurable size of toolbar icons
Torsten <ttl@justmail.de>
parents:
16500
diff
changeset
|
310 |
15972
22ab4fe661d7
gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents:
15914
diff
changeset
|
311 // 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
|
312 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
|
313 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
|
314 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
|
315 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
|
316 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
|
317 settings->value ("DockWidgets/widget_icon_set", "NONE").toString (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
318 ui->general_icon_octave->setChecked (true); // the default (if invalid set) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
319 ui->general_icon_octave->setChecked (widget_icon_set == "NONE"); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
320 ui->general_icon_graphic->setChecked (widget_icon_set == "GRAPHIC"); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
321 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
|
322 |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18156
diff
changeset
|
323 // custom title bar of dock widget |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
324 QVariant default_var = QColor (255, 255, 255); |
24280
bda0c5b38bda
consistent case of settings keys in the settings file (important for qt5)
Torsten <mttl@mailbox.org>
parents:
23219
diff
changeset
|
325 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
|
326 default_var).value<QColor> (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
327 m_widget_title_bg_color = new color_picker (bg_color); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
328 m_widget_title_bg_color->setEnabled (false); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
329 ui->layout_widget_bgtitle->addWidget (m_widget_title_bg_color, 0); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
330 |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18156
diff
changeset
|
331 connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)), |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
332 m_widget_title_bg_color, SLOT (setEnabled (bool))); |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18156
diff
changeset
|
333 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
334 default_var = QColor (192, 192, 192); |
24280
bda0c5b38bda
consistent case of settings keys in the settings file (important for qt5)
Torsten <mttl@mailbox.org>
parents:
23219
diff
changeset
|
335 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
|
336 default_var).value<QColor> (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
337 m_widget_title_bg_color_active = new color_picker (bg_color_active); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
338 m_widget_title_bg_color_active->setEnabled (false); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
339 ui->layout_widget_bgtitle_active->addWidget (m_widget_title_bg_color_active, 0); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
340 |
19423
d93293218966
custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents:
19348
diff
changeset
|
341 connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)), |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
342 m_widget_title_bg_color_active, SLOT (setEnabled (bool))); |
19423
d93293218966
custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents:
19348
diff
changeset
|
343 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
344 default_var = QColor (0, 0, 0); |
24280
bda0c5b38bda
consistent case of settings keys in the settings file (important for qt5)
Torsten <mttl@mailbox.org>
parents:
23219
diff
changeset
|
345 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
|
346 default_var).value<QColor> (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
347 m_widget_title_fg_color = new color_picker (fg_color); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
348 m_widget_title_fg_color->setEnabled (false); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
349 ui->layout_widget_fgtitle->addWidget (m_widget_title_fg_color, 0); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
350 |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18156
diff
changeset
|
351 connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)), |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
352 m_widget_title_fg_color, SLOT (setEnabled (bool))); |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18156
diff
changeset
|
353 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
354 default_var = QColor (0, 0, 0); |
24280
bda0c5b38bda
consistent case of settings keys in the settings file (important for qt5)
Torsten <mttl@mailbox.org>
parents:
23219
diff
changeset
|
355 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
|
356 default_var).value<QColor> (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
357 m_widget_title_fg_color_active = new color_picker (fg_color_active); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
358 m_widget_title_fg_color_active->setEnabled (false); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
359 ui->layout_widget_fgtitle_active->addWidget (m_widget_title_fg_color_active, 0); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
360 |
19423
d93293218966
custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents:
19348
diff
changeset
|
361 connect (ui->cb_widget_custom_style, SIGNAL (toggled (bool)), |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
362 m_widget_title_fg_color_active, SLOT (setEnabled (bool))); |
19423
d93293218966
custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents:
19348
diff
changeset
|
363 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
364 ui->sb_3d_title->setValue (settings->value ("DockWidgets/widget_title_3d", 50).toInt ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
365 ui->cb_widget_custom_style->setChecked (settings->value ("DockWidgets/widget_title_custom_style", false).toBool ()); |
19423
d93293218966
custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents:
19348
diff
changeset
|
366 |
23810
9c24aae7515f
allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents:
23807
diff
changeset
|
367 // 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
|
368 // 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
|
369 // 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
|
370 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
|
371 { |
9c24aae7515f
allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents:
23807
diff
changeset
|
372 // Preference exists, read its value |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
373 ui->cb_cursor_blinking->setChecked (settings->value ("cursor_blinking", true).toBool ()); |
23810
9c24aae7515f
allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents:
23807
diff
changeset
|
374 } |
9c24aae7515f
allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents:
23807
diff
changeset
|
375 else |
9c24aae7515f
allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents:
23807
diff
changeset
|
376 { |
9c24aae7515f
allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents:
23807
diff
changeset
|
377 // Pref. does not exist, so take old terminal related pref. |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
378 ui->cb_cursor_blinking->setChecked (settings->value ("terminal/cursorBlinking", true).toBool ()); |
23810
9c24aae7515f
allow cursor flashing to be configured globally in gui (bug #51460)
Torsten <mttl@mailbox.org>
parents:
23807
diff
changeset
|
379 } |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18156
diff
changeset
|
380 |
18639
7cb98e81ecd1
GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents:
18611
diff
changeset
|
381 // prompt on exit |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
382 ui->cb_prompt_to_exit->setChecked (settings->value ("prompt_to_exit", false).toBool ()); |
18639
7cb98e81ecd1
GUI: Prompt to exit Octave option (Bug #41080)
John Donoghue <john.donoghue@ieee.org>
parents:
18611
diff
changeset
|
383 |
18733
f6f1f27026bb
status bars and code folding a user preference (bug #42306)
Torsten <ttl@justmail.de>
parents:
18728
diff
changeset
|
384 // Main status bar |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
385 ui->cb_status_bar->setChecked (settings->value ("show_status_bar", true).toBool ()); |
18733
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 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
388 ui->cb_restore_octave_dir->setChecked (settings->value ("restore_octave_dir", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
389 ui->le_octave_dir->setText (settings->value ("octave_startup_dir").toString ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
390 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
391 connect (ui->pb_octave_dir, SIGNAL (pressed (void)), |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
392 this, SLOT (get_octave_dir (void))); |
18309
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18302
diff
changeset
|
393 |
20731
83611b387bc5
provide a user preference for the encoding used by the editor (bug #45597)
Torsten <ttl@justmail.de>
parents:
20706
diff
changeset
|
394 // |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18156
diff
changeset
|
395 // editor |
20731
83611b387bc5
provide a user preference for the encoding used by the editor (bug #45597)
Torsten <ttl@justmail.de>
parents:
20706
diff
changeset
|
396 // |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
397 ui->useCustomFileEditor->setChecked (settings->value ("useCustomFileEditor", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
398 ui->customFileEditor->setText (settings->value ("customFileEditor").toString ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
399 ui->editor_showLineNumbers->setChecked (settings->value ("editor/showLineNumbers", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
400 ui->editor_linenr_size->setValue (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
|
401 |
20774
5c5e085a1ae6
allow selecting an encoding when saving a file (bug #45688)
Torsten <ttl@justmail.de>
parents:
20753
diff
changeset
|
402 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
|
403 |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
18156
diff
changeset
|
404 default_var = QColor (240, 240, 240); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
405 QColor setting_color = settings->value ("editor/highlight_current_line_color", default_var).value<QColor> (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
406 m_editor_current_line_color = new color_picker (setting_color); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
407 ui->editor_grid_current_line->addWidget (m_editor_current_line_color, 0, 3); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
408 m_editor_current_line_color->setMinimumSize (20, 10); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
409 m_editor_current_line_color->setEnabled (false); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
410 |
16693
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
411 connect (ui->editor_highlightCurrentLine, SIGNAL (toggled (bool)), |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
412 m_editor_current_line_color, SLOT (setEnabled (bool))); |
16693
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16679
diff
changeset
|
413 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
414 ui->editor_highlightCurrentLine->setChecked (settings->value ("editor/highlightCurrentLine", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
415 ui->editor_long_line_marker->setChecked (settings->value ("editor/long_line_marker", true).toBool ()); |
23996
a5b20fc6588a
editor: more consistent behavior of lon line marker settings in (bug #51872)
Torsten <mttl@mailbox.org>
parents:
23936
diff
changeset
|
416 bool long_line = |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
417 settings->value ("editor/long_line_marker_line", true).toBool (); |
23996
a5b20fc6588a
editor: more consistent behavior of lon line marker settings in (bug #51872)
Torsten <mttl@mailbox.org>
parents:
23936
diff
changeset
|
418 ui->editor_long_line_marker_line->setChecked (long_line); |
a5b20fc6588a
editor: more consistent behavior of lon line marker settings in (bug #51872)
Torsten <mttl@mailbox.org>
parents:
23936
diff
changeset
|
419 bool long_back = |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
420 settings->value ("editor/long_line_marker_background", false).toBool (); |
23996
a5b20fc6588a
editor: more consistent behavior of lon line marker settings in (bug #51872)
Torsten <mttl@mailbox.org>
parents:
23936
diff
changeset
|
421 ui->editor_long_line_marker_background->setChecked (long_back); |
a5b20fc6588a
editor: more consistent behavior of lon line marker settings in (bug #51872)
Torsten <mttl@mailbox.org>
parents:
23936
diff
changeset
|
422 if (! (long_line || long_back)) |
a5b20fc6588a
editor: more consistent behavior of lon line marker settings in (bug #51872)
Torsten <mttl@mailbox.org>
parents:
23936
diff
changeset
|
423 ui->editor_long_line_marker_line->setChecked (true); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
424 ui->editor_long_line_column->setValue (settings->value ("editor/long_line_column", 80).toInt ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
425 ui->editor_break_checkbox->setChecked (settings->value ("editor/break_lines", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
426 ui->editor_break_checkbox->setChecked (settings->value ("editor/break_lines_comments", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
427 ui->editor_wrap_checkbox->setChecked (settings->value ("editor/wrap_lines", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
428 ui->cb_edit_status_bar->setChecked (settings->value ("editor/show_edit_status_bar", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
429 ui->cb_edit_tool_bar->setChecked (settings->value ("editor/show_toolbar", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
430 ui->cb_code_folding->setChecked (settings->value ("editor/code_folding", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
431 ui->editor_highlight_all_occurrences->setChecked (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
|
432 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
433 ui->editor_auto_endif->setCurrentIndex (settings->value ("editor/auto_endif", 1).toInt () ); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
434 ui->editor_codeCompletion->setChecked (settings->value ("editor/codeCompletion", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
435 ui->editor_spinbox_ac_threshold->setValue (settings->value ("editor/codeCompletion_threshold", 2).toInt ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
436 ui->editor_checkbox_ac_keywords->setChecked (settings->value ("editor/codeCompletion_keywords", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
437 ui->editor_checkbox_ac_builtins->setEnabled (ui->editor_checkbox_ac_keywords->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
438 ui->editor_checkbox_ac_functions->setEnabled (ui->editor_checkbox_ac_keywords->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
439 ui->editor_checkbox_ac_builtins->setChecked (settings->value ("editor/codeCompletion_octave_builtins", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
440 ui->editor_checkbox_ac_functions->setChecked (settings->value ("editor/codeCompletion_octave_functions", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
441 ui->editor_checkbox_ac_document->setChecked (settings->value ("editor/codeCompletion_document", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
442 ui->editor_checkbox_ac_case->setChecked (settings->value ("editor/codeCompletion_case", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
443 ui->editor_checkbox_ac_replace->setChecked (settings->value ("editor/codeCompletion_replace", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
444 ui->editor_ws_checkbox->setChecked (settings->value ("editor/show_white_space", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
445 ui->editor_ws_indent_checkbox->setChecked (settings->value ("editor/show_white_space_indent", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
446 ui->cb_show_eol->setChecked (settings->value ("editor/show_eol_chars", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
447 ui->cb_show_hscrollbar->setChecked (settings->value ("editor/show_hscroll_bar", true).toBool ()); |
24475
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
448 |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
449 int selected_comment_string, selected_uncomment_string; |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
450 |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
451 if (settings->contains (oct_comment_str)) // new version (radio buttons) |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
452 selected_comment_string = settings->value (oct_comment_str, |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
453 oct_comment_str_d).toInt (); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
454 else // old version (combo box) |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
455 selected_comment_string = settings->value (oct_comment_str_old, |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
456 oct_comment_str_d).toInt (); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
457 |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
458 selected_uncomment_string = settings->value (oct_uncomment_str, |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
459 oct_uncomment_str_d).toInt (); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
460 |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
461 for (int i = 0; i < oct_comment_strings_count; i++) |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
462 { |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
463 m_rb_comment_strings[i] = new QRadioButton (); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
464 m_rb_uncomment_strings[i] = new QRadioButton (); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
465 |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
466 connect (m_rb_comment_strings[i], SIGNAL (clicked (bool)), |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
467 m_rb_uncomment_strings[i], SLOT (setChecked (bool))); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
468 connect (m_rb_comment_strings[i], SIGNAL (toggled (bool)), |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
469 m_rb_uncomment_strings[i], SLOT (setDisabled (bool))); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
470 |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
471 m_rb_comment_strings[i]->setText (oct_comment_strings.at(i)); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
472 m_rb_comment_strings[i]->setChecked (i == selected_comment_string); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
473 ui->layout_comment_strings->addWidget (m_rb_comment_strings[i]); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
474 |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
475 m_rb_uncomment_strings[i]->setText (oct_comment_strings.at(i)); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
476 m_rb_uncomment_strings[i]->setAutoExclusive (false); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
477 m_rb_uncomment_strings[i]->setChecked ( 1 << i & selected_uncomment_string); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
478 ui->layout_uncomment_strings->addWidget (m_rb_uncomment_strings[i]); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
479 } |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
480 |
19430
472a5572849c
hiding horizontal scroll bar in editor when not needed (bug #41592)
Torsten <ttl@justmail.de>
parents:
19423
diff
changeset
|
481 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
482 #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
|
483 # 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
|
484 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
|
485 #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
|
486 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
|
487 #else |
f3c4b48f3c53
add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents:
19042
diff
changeset
|
488 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
|
489 #endif |
f3c4b48f3c53
add a preference for the default eol mode of new files (bug #43334)
Torsten <ttl@justmail.de>
parents:
19042
diff
changeset
|
490 #else |
19248
54943eb0ce37
reorder eol modes in the editor settings
Torsten <ttl@justmail.de>
parents:
19245
diff
changeset
|
491 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
|
492 #endif |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
493 ui->combo_eol_mode->setCurrentIndex (settings->value ("editor/default_eol_mode", eol_mode).toInt ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
494 ui->editor_auto_ind_checkbox->setChecked (settings->value ("editor/auto_indent", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
495 ui->editor_tab_ind_checkbox->setChecked (settings->value ("editor/tab_indents_line", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
496 ui->editor_bs_unind_checkbox->setChecked (settings->value ("editor/backspace_unindents_line", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
497 ui->editor_ind_guides_checkbox->setChecked (settings->value ("editor/show_indent_guides", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
498 ui->editor_ind_width_spinbox->setValue (settings->value ("editor/indent_width", 2).toInt ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
499 ui->editor_ind_uses_tabs_checkbox->setChecked (settings->value ("editor/indent_uses_tabs", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
500 ui->editor_tab_width_spinbox->setValue (settings->value ("editor/tab_width", 2).toInt ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
501 ui->editor_longWindowTitle->setChecked (settings->value ("editor/longWindowTitle", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
502 ui->editor_notebook_tab_width_min->setValue (settings->value ("editor/notebook_tab_width_min", 160).toInt ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
503 ui->editor_notebook_tab_width_max->setValue (settings->value ("editor/notebook_tab_width_max", 300).toInt ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
504 ui->editor_restoreSession->setChecked (settings->value ("editor/restoreSession", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
505 ui->editor_create_new_file->setChecked (settings->value ("editor/create_new_file", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
506 ui->editor_reload_changed_files->setChecked (settings->value ("editor/always_reload_changed_files", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
507 ui->editor_hiding_closes_files->setChecked (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
|
508 |
6eae8ba32e62
provide a long line marker in the editor
Torsten <ttl@justmail.de>
parents:
18343
diff
changeset
|
509 // terminal |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
510 ui->terminal_fontName->setCurrentFont (QFont (settings->value ("terminal/fontName", "Courier New").toString ())); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
511 ui->terminal_fontSize->setValue (settings->value ("terminal/fontSize", 10).toInt ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
512 ui->terminal_history_buffer->setValue (settings->value ("terminal/history_buffer", 1000).toInt ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
513 ui->terminal_cursorUseForegroundColor->setChecked (settings->value ("terminal/cursorUseForegroundColor", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
514 ui->terminal_focus_command->setChecked (settings->value ("terminal/focus_after_command", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
515 ui->terminal_print_dbg_location->setChecked (settings->value ("terminal/print_debug_location", false).toBool ()); |
19585
f9a944b9e1cb
provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents:
19430
diff
changeset
|
516 |
f9a944b9e1cb
provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents:
19430
diff
changeset
|
517 QString cursorType |
f9a944b9e1cb
provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents:
19430
diff
changeset
|
518 = 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
|
519 |
f9a944b9e1cb
provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents:
19430
diff
changeset
|
520 QStringList items; |
f9a944b9e1cb
provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents:
19430
diff
changeset
|
521 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
|
522 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
|
523 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
|
524 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
|
525 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
|
526 |
f9a944b9e1cb
provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents:
19430
diff
changeset
|
527 if (cursorType == "ibeam") |
f9a944b9e1cb
provide a user preference for printing the debug location in the terminal
Torsten <ttl@justmail.de>
parents:
19430
diff
changeset
|
528 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
|
529 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
|
530 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
|
531 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
|
532 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
|
533 |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18309
diff
changeset
|
534 // file browser |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18309
diff
changeset
|
535 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
|
536 this, SLOT (set_disabled_pref_file_browser_dir (bool))); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
537 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
538 ui->sync_octave_directory->setChecked (settings->value ("filesdockwidget/sync_octave_directory", true).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
539 ui->cb_restore_file_browser_dir->setChecked (settings->value ("filesdockwidget/restore_last_dir", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
540 ui->le_file_browser_dir->setText (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
|
541 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
542 connect (ui->pb_file_browser_dir, SIGNAL (pressed (void)), |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
543 this, SLOT (get_file_browser_dir (void))); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
544 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
545 ui->le_file_browser_extensions->setText (settings->value ("filesdockwidget/txt_file_extensions", "m;c;cc;cpp;h;txt").toString ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
546 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
547 ui->checkbox_allow_web_connect->setChecked (settings->value ("news/allow_web_connection", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
548 ui->useProxyServer->setChecked (settings->value ("useProxyServer", false).toBool ()); |
13607
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
549 ui->proxyHostName->setText (settings->value ("proxyHostName").toString ()); |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
550 |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
551 int currentIndex = 0; |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
552 QString proxyTypeString = settings->value ("proxyType").toString (); |
18678
6113e0c6920b
maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents:
18639
diff
changeset
|
553 while ((currentIndex < ui->proxyType->count ()) |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19847
diff
changeset
|
554 && (ui->proxyType->currentText () != proxyTypeString)) |
13607
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
555 { |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
556 currentIndex++; |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
557 ui->proxyType->setCurrentIndex (currentIndex); |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
558 } |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
559 |
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
560 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
|
561 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
|
562 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
|
563 |
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
|
564 // 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
|
565 // colors |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
566 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
|
567 // hide tool tips |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
568 ui->cb_hide_tool_tips->setChecked (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
|
569 |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
570 // terminal colors |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
571 read_terminal_colors (settings); |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
572 |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
573 // variable editor |
25074
f50fa34827fb
use spin boxes for col/row/ width/height in settings for variable editor
Torsten <mttl@mailbox.org>
parents:
25054
diff
changeset
|
574 ui->varedit_columnWidth->setValue (settings->value ("variable_editor/column_width", 100).toInt ()); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
575 ui->varedit_autoFitColumnWidth->setChecked (settings->value ("variable_editor/autofit_column_width", false).toBool ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
576 ui->varedit_autofitType->setCurrentIndex (settings->value ("autofit_type", 0).toInt ()); |
25074
f50fa34827fb
use spin boxes for col/row/ width/height in settings for variable editor
Torsten <mttl@mailbox.org>
parents:
25054
diff
changeset
|
577 ui->varedit_rowHeight->setValue (settings->value ("variable_editor/row_height", 10).toInt ()); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
578 ui->varedit_rowAutofit->setChecked (settings->value ("variable_editor/autofit_row_height", true).toBool ()); |
24749
4aa86466f971
fix font combobox in settings for variable editor (bug #53136)
Torsten <mttl@mailbox.org>
parents:
24716
diff
changeset
|
579 |
4aa86466f971
fix font combobox in settings for variable editor (bug #53136)
Torsten <mttl@mailbox.org>
parents:
24716
diff
changeset
|
580 ui->varedit_font->setCurrentFont (QFont (settings->value ("variable_editor/font_name", settings->value ("terminal/fontName", "Courier New")).toString ())); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
581 ui->varedit_fontSize->setValue (settings->value ("variable_editor/font_size", QVariant (10)).toInt ()); |
24749
4aa86466f971
fix font combobox in settings for variable editor (bug #53136)
Torsten <mttl@mailbox.org>
parents:
24716
diff
changeset
|
582 connect (ui->varedit_useTerminalFont, SIGNAL (toggled (bool)), |
4aa86466f971
fix font combobox in settings for variable editor (bug #53136)
Torsten <mttl@mailbox.org>
parents:
24716
diff
changeset
|
583 ui->varedit_font, SLOT (setDisabled (bool))); |
4aa86466f971
fix font combobox in settings for variable editor (bug #53136)
Torsten <mttl@mailbox.org>
parents:
24716
diff
changeset
|
584 connect (ui->varedit_useTerminalFont, SIGNAL (toggled (bool)), |
4aa86466f971
fix font combobox in settings for variable editor (bug #53136)
Torsten <mttl@mailbox.org>
parents:
24716
diff
changeset
|
585 ui->varedit_fontSize, SLOT (setDisabled (bool))); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
586 ui->varedit_useTerminalFont->setChecked (settings->value ("variable_editor/use_terminal_font", false).toBool ()); |
24749
4aa86466f971
fix font combobox in settings for variable editor (bug #53136)
Torsten <mttl@mailbox.org>
parents:
24716
diff
changeset
|
587 ui->varedit_font->setDisabled (ui->varedit_useTerminalFont->isChecked ()); |
4aa86466f971
fix font combobox in settings for variable editor (bug #53136)
Torsten <mttl@mailbox.org>
parents:
24716
diff
changeset
|
588 ui->varedit_fontSize->setDisabled (ui->varedit_useTerminalFont->isChecked ()); |
4aa86466f971
fix font combobox in settings for variable editor (bug #53136)
Torsten <mttl@mailbox.org>
parents:
24716
diff
changeset
|
589 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
590 ui->varedit_alternate->setChecked (settings->value ("variable_editor/alternate_rows", QVariant (false)).toBool ()); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
591 |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
592 // variable editor colors |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
593 read_varedit_colors (settings); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
594 |
18717
f017240310fb
disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents:
18639
diff
changeset
|
595 // shortcuts |
18822
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18733
diff
changeset
|
596 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
597 ui->cb_prevent_readline_conflicts->setChecked (settings->value ("shortcuts/prevent_readline_conflicts", true).toBool ()); |
18717
f017240310fb
disabling global shortcuts when terminal has focus as user preference
Torsten <ttl@justmail.de>
parents:
18639
diff
changeset
|
598 |
18822
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18733
diff
changeset
|
599 // initialize the tree view with all shortcut data |
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18733
diff
changeset
|
600 shortcut_manager::fill_treewidget (ui->shortcuts_treewidget); |
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18733
diff
changeset
|
601 |
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18733
diff
changeset
|
602 // connect the buttons for import/export of the shortcut sets |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
603 connect (ui->btn_import_shortcut_set, SIGNAL (clicked (void)), |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
604 this, SLOT (import_shortcut_set (void))); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
605 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
606 connect (ui->btn_export_shortcut_set, SIGNAL (clicked (void)), |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
607 this, SLOT (export_shortcut_set (void))); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
608 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
609 connect (ui->btn_default_shortcut_set, SIGNAL (clicked (void)), |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
610 this, SLOT (default_shortcut_set (void))); |
18822
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18733
diff
changeset
|
611 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
612 #if defined (HAVE_QSCINTILLA) |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
613 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
614 // 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
|
615 QsciLexer *lexer; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
616 |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
617 #if defined (HAVE_LEXER_OCTAVE) |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
618 |
16646
025bc6b5080e
use QScintilla's lexer for highlighting Octave programs
John W. Eaton <jwe@octave.org>
parents:
16636
diff
changeset
|
619 lexer = new QsciLexerOctave (); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
620 read_lexer_settings (ui, lexer, settings); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
621 delete lexer; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
622 |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
623 #elif defined (HAVE_LEXER_MATLAB) |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
624 |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
625 lexer = new QsciLexerMatlab (); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
626 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
|
627 delete lexer; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
628 |
16667
7f6f0b3f7369
Allow build to continue without QScintilla lexer for Octave
Ben Abbott <bpabbott@mac.com>
parents:
16646
diff
changeset
|
629 #endif |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
630 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
631 lexer = new QsciLexerCPP (); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
632 read_lexer_settings (ui, lexer, settings); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
633 delete lexer; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
634 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
635 lexer = new QsciLexerPerl (); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
636 read_lexer_settings (ui, lexer, settings); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
637 delete lexer; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
638 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
639 lexer = new QsciLexerBatch (); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
640 read_lexer_settings (ui, lexer, settings); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
641 delete lexer; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
642 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
643 lexer = new QsciLexerDiff (); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
644 read_lexer_settings (ui, lexer, settings); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
645 delete lexer; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
646 |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
647 lexer = new QsciLexerBash (); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
648 read_lexer_settings (ui, lexer, settings); |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
649 delete lexer; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
650 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24559
diff
changeset
|
651 lexer = new octave::octave_txt_lexer (); |
20279
3a745710eaca
Avoid HAVE_ macro in header file.
John W. Eaton <jwe@octave.org>
parents:
19913
diff
changeset
|
652 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
|
653 delete lexer; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
654 |
16623
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
655 #endif |
9c0487bb205b
save and restore last used tabs of the settings dialog
Torsten <ttl@justmail.de>
parents:
16620
diff
changeset
|
656 |
17676
c060ad097056
add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents:
16865
diff
changeset
|
657 // which tab is the desired one? |
19632
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
658 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
|
659 |
19632
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
660 // connect button box signal |
19631
4e85ca0b4887
add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents:
19595
diff
changeset
|
661 connect (ui->button_box, SIGNAL (clicked (QAbstractButton *)), |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
662 this, SLOT (button_clicked (QAbstractButton *))); |
24559
2245b9183bc5
provide a sufficiently large default size for the settings dialog (bug #52802)
Torsten <mttl@mailbox.org>
parents:
24534
diff
changeset
|
663 |
2245b9183bc5
provide a sufficiently large default size for the settings dialog (bug #52802)
Torsten <mttl@mailbox.org>
parents:
24534
diff
changeset
|
664 // restore last geometry |
2245b9183bc5
provide a sufficiently large default size for the settings dialog (bug #52802)
Torsten <mttl@mailbox.org>
parents:
24534
diff
changeset
|
665 if (settings->contains ("settings/geometry")) |
2245b9183bc5
provide a sufficiently large default size for the settings dialog (bug #52802)
Torsten <mttl@mailbox.org>
parents:
24534
diff
changeset
|
666 restoreGeometry (settings->value ("settings/geometry").toByteArray ()); |
2245b9183bc5
provide a sufficiently large default size for the settings dialog (bug #52802)
Torsten <mttl@mailbox.org>
parents:
24534
diff
changeset
|
667 else |
2245b9183bc5
provide a sufficiently large default size for the settings dialog (bug #52802)
Torsten <mttl@mailbox.org>
parents:
24534
diff
changeset
|
668 setGeometry (QRect (10,50,1000,600)); |
13501 | 669 } |
670 | |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
671 settings_dialog::~settings_dialog (void) |
13501 | 672 { |
15274
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
673 delete ui; |
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
674 } |
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
675 |
19632
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
676 void |
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
677 settings_dialog::show_tab (const QString& tab) |
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
678 { |
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
679 if (tab.isEmpty ()) |
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
680 { |
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
681 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
|
682 if (settings) |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
683 ui->tabWidget->setCurrentIndex (settings->value ("settings/last_tab", 0).toInt ()); |
19632
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
684 } |
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
685 else |
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
686 { |
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
687 QHash <QString, QWidget*> tab_hash; |
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
688 tab_hash["editor"] = ui->tab_editor; |
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
689 tab_hash["editor_styles"] = ui->tab_editor_styles; |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
690 ui->tabWidget->setCurrentIndex (ui->tabWidget->indexOf (tab_hash.value (tab))); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
691 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
692 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
693 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
694 void |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
695 settings_dialog::get_octave_dir (void) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
696 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
697 get_dir (ui->le_octave_dir, tr ("Set Octave Startup Directory")); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
698 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
699 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
700 void |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
701 settings_dialog::get_file_browser_dir (void) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
702 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
703 get_dir (ui->le_file_browser_dir, tr ("Set File Browser Startup Directory")); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
704 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
705 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
706 void |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
707 settings_dialog::get_dir (QLineEdit *line_edit, const QString& title) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
708 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
709 QString dir = QFileDialog::getExistingDirectory |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
710 (this, title, line_edit->text (), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
711 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
712 line_edit->setText (dir); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
713 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
714 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
715 void |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
716 settings_dialog::button_clicked (QAbstractButton *button) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
717 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
718 QDialogButtonBox::ButtonRole button_role = ui->button_box->buttonRole (button); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
719 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
720 if (button_role == QDialogButtonBox::ApplyRole |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
721 || button_role == QDialogButtonBox::AcceptRole) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
722 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
723 write_changed_settings (button_role == QDialogButtonBox::AcceptRole); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
724 emit apply_new_settings (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
725 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
726 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
727 if (button_role == QDialogButtonBox::RejectRole |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
728 || button_role == QDialogButtonBox::AcceptRole) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
729 close (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
730 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
731 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
732 void |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
733 settings_dialog::set_disabled_pref_file_browser_dir (bool disable) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
734 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
735 ui->cb_restore_file_browser_dir->setDisabled (disable); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
736 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
737 if (! disable) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
738 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
739 ui->le_file_browser_dir->setDisabled (ui->cb_restore_file_browser_dir->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
740 ui->pb_file_browser_dir->setDisabled (ui->cb_restore_file_browser_dir->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
741 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
742 else |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
743 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
744 ui->le_file_browser_dir->setDisabled (disable); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
745 ui->pb_file_browser_dir->setDisabled (disable); |
19632
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
746 } |
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
747 } |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
748 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
749 // slots for import/export of shortcut sets |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
750 void |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
751 settings_dialog::import_shortcut_set (void) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
752 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
753 shortcut_manager::import_export (shortcut_manager::OSC_IMPORT); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
754 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
755 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
756 void |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
757 settings_dialog::export_shortcut_set (void) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
758 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
759 shortcut_manager::import_export (shortcut_manager::OSC_EXPORT); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
760 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
761 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
762 void |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
763 settings_dialog::default_shortcut_set (void) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
764 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
765 shortcut_manager::import_export (shortcut_manager::OSC_DEFAULT); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
766 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
767 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
768 void |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
769 settings_dialog::write_changed_settings (bool closing) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
770 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
771 QSettings *settings = resource_manager::get_settings (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
772 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
773 // the icon set |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
774 QString widget_icon_set = "NONE"; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
775 if (ui->general_icon_letter->isChecked ()) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
776 widget_icon_set = "LETTER"; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
777 else if (ui->general_icon_graphic->isChecked ()) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
778 widget_icon_set = "GRAPHIC"; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
779 settings->setValue ("DockWidgets/widget_icon_set", widget_icon_set); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
780 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
781 // language |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
782 QString language = ui->comboBox_language->currentText (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
783 if (language == tr ("System setting")) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
784 language = "SYSTEM"; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
785 settings->setValue ("language", language); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
786 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
787 // dock widget title bar |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
788 settings->setValue ("DockWidgets/widget_title_custom_style", ui->cb_widget_custom_style->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
789 settings->setValue ("DockWidgets/widget_title_3d", ui->sb_3d_title->value ()); |
24226
dc85329e6778
consistent case of settings keys in the settings file (important for qt5)
Torsten <mttl@mailbox.org>
parents:
24094
diff
changeset
|
790 settings->setValue ("DockWidgets/title_bg_color", m_widget_title_bg_color->color ()); |
dc85329e6778
consistent case of settings keys in the settings file (important for qt5)
Torsten <mttl@mailbox.org>
parents:
24094
diff
changeset
|
791 settings->setValue ("DockWidgets/title_bg_color_active", m_widget_title_bg_color_active->color ()); |
dc85329e6778
consistent case of settings keys in the settings file (important for qt5)
Torsten <mttl@mailbox.org>
parents:
24094
diff
changeset
|
792 settings->setValue ("DockWidgets/title_fg_color", m_widget_title_fg_color->color ()); |
dc85329e6778
consistent case of settings keys in the settings file (important for qt5)
Torsten <mttl@mailbox.org>
parents:
24094
diff
changeset
|
793 settings->setValue ("DockWidgets/title_fg_color_active", m_widget_title_fg_color_active->color ()); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
794 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
795 // icon size |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
796 int icon_size = 0; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
797 if (ui->icon_size_small->isChecked ()) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
798 icon_size = -1; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
799 else if (ui->icon_size_large->isChecked ()) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
800 icon_size = 1; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
801 settings->setValue ("toolbar_icon_size", icon_size); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
802 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
803 // cursor blinking |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
804 settings->setValue ("cursor_blinking", ui->cb_cursor_blinking->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
805 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
806 // promp to exit |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
807 settings->setValue ("prompt_to_exit", ui->cb_prompt_to_exit->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
808 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
809 // status bar |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
810 settings->setValue ("show_status_bar", ui->cb_status_bar->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
811 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
812 // Octave startup |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
813 settings->setValue ("restore_octave_dir", ui->cb_restore_octave_dir->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
814 settings->setValue ("octave_startup_dir", ui->le_octave_dir->text ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
815 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
816 //editor |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
817 settings->setValue ("useCustomFileEditor", ui->useCustomFileEditor->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
818 settings->setValue ("customFileEditor", ui->customFileEditor->text ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
819 settings->setValue ("editor/showLineNumbers", ui->editor_showLineNumbers->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
820 settings->setValue ("editor/line_numbers_size", ui->editor_linenr_size->value ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
821 settings->setValue ("editor/highlightCurrentLine", ui->editor_highlightCurrentLine->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
822 settings->setValue ("editor/highlight_current_line_color", m_editor_current_line_color->color ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
823 settings->setValue ("editor/long_line_marker", ui->editor_long_line_marker->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
824 settings->setValue ("editor/long_line_marker_line", ui->editor_long_line_marker_line->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
825 settings->setValue ("editor/long_line_marker_background", ui->editor_long_line_marker_background->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
826 settings->setValue ("editor/long_line_column", ui->editor_long_line_column->value ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
827 settings->setValue ("editor/break_lines", ui->editor_break_checkbox->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
828 settings->setValue ("editor/break_lines_comments", ui->editor_break_comments_checkbox->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
829 settings->setValue ("editor/wrap_lines", ui->editor_wrap_checkbox->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
830 settings->setValue ("editor/code_folding", ui->cb_code_folding->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
831 settings->setValue ("editor/show_edit_status_bar", ui->cb_edit_status_bar->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
832 settings->setValue ("editor/show_toolbar", ui->cb_edit_tool_bar->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
833 settings->setValue ("editor/highlight_all_occurrences", ui->editor_highlight_all_occurrences->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
834 settings->setValue ("editor/codeCompletion", ui->editor_codeCompletion->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
835 settings->setValue ("editor/codeCompletion_threshold", ui->editor_spinbox_ac_threshold->value ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
836 settings->setValue ("editor/codeCompletion_keywords", ui->editor_checkbox_ac_keywords->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
837 settings->setValue ("editor/codeCompletion_octave_builtins", ui->editor_checkbox_ac_builtins->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
838 settings->setValue ("editor/codeCompletion_octave_functions", ui->editor_checkbox_ac_functions->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
839 settings->setValue ("editor/codeCompletion_document", ui->editor_checkbox_ac_document->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
840 settings->setValue ("editor/codeCompletion_case", ui->editor_checkbox_ac_case->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
841 settings->setValue ("editor/codeCompletion_replace", ui->editor_checkbox_ac_replace->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
842 settings->setValue ("editor/auto_endif", ui->editor_auto_endif->currentIndex ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
843 settings->setValue ("editor/show_white_space", ui->editor_ws_checkbox->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
844 settings->setValue ("editor/show_white_space_indent", ui->editor_ws_indent_checkbox->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
845 settings->setValue ("editor/show_eol_chars", ui->cb_show_eol->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
846 settings->setValue ("editor/show_hscroll_bar", ui->cb_show_hscrollbar->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
847 settings->setValue ("editor/default_eol_mode", ui->combo_eol_mode->currentIndex ()); |
24475
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
848 |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
849 // Comment strings |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
850 int rb_uncomment = 0; |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
851 for (int i = 0; i < oct_comment_strings_count; i++) |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
852 { |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
853 if (m_rb_comment_strings[i]->isChecked ()) |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
854 { |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
855 settings->setValue (oct_comment_str, i); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
856 if (i < 3) |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
857 settings->setValue (oct_comment_str_old, i); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
858 else |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
859 settings->setValue (oct_comment_str_old, oct_comment_str_d); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
860 } |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
861 if (m_rb_uncomment_strings[i]->isChecked ()) |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
862 rb_uncomment = rb_uncomment + (1 << i); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
863 } |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
864 settings->setValue (oct_uncomment_str, rb_uncomment); |
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24290
diff
changeset
|
865 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
866 settings->setValue ("editor/default_encoding", ui->editor_combo_encoding->currentText ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
867 settings->setValue ("editor/auto_indent", ui->editor_auto_ind_checkbox->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
868 settings->setValue ("editor/tab_indents_line", ui->editor_tab_ind_checkbox->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
869 settings->setValue ("editor/backspace_unindents_line", ui->editor_bs_unind_checkbox->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
870 settings->setValue ("editor/show_indent_guides", ui->editor_ind_guides_checkbox->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
871 settings->setValue ("editor/indent_width", ui->editor_ind_width_spinbox->value ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
872 settings->setValue ("editor/indent_uses_tabs", ui->editor_ind_uses_tabs_checkbox->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
873 settings->setValue ("editor/tab_width", ui->editor_tab_width_spinbox->value ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
874 settings->setValue ("editor/longWindowTitle", ui->editor_longWindowTitle->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
875 settings->setValue ("editor/notebook_tab_width_min", ui->editor_notebook_tab_width_min->value ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
876 settings->setValue ("editor/notebook_tab_width_max", ui->editor_notebook_tab_width_max->value ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
877 settings->setValue ("editor/restoreSession", ui->editor_restoreSession->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
878 settings->setValue ("editor/create_new_file", ui->editor_create_new_file->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
879 settings->setValue ("editor/hiding_closes_files", ui->editor_hiding_closes_files->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
880 settings->setValue ("editor/always_reload_changed_files", ui->editor_reload_changed_files->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
881 settings->setValue ("terminal/fontSize", ui->terminal_fontSize->value ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
882 settings->setValue ("terminal/fontName", ui->terminal_fontName->currentFont ().family ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
883 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
884 // file browser |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
885 settings->setValue ("filesdockwidget/sync_octave_directory", ui->sync_octave_directory->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
886 settings->setValue ("filesdockwidget/restore_last_dir", ui->cb_restore_file_browser_dir->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
887 settings->setValue ("filesdockwidget/startup_dir", ui->le_file_browser_dir->text ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
888 settings->setValue ("filesdockwidget/txt_file_extensions", ui->le_file_browser_extensions->text ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
889 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
890 settings->setValue ("news/allow_web_connection", ui->checkbox_allow_web_connect->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
891 settings->setValue ("useProxyServer", ui->useProxyServer->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
892 settings->setValue ("proxyType", ui->proxyType->currentText ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
893 settings->setValue ("proxyHostName", ui->proxyHostName->text ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
894 settings->setValue ("proxyPort", ui->proxyPort->text ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
895 settings->setValue ("proxyUserName", ui->proxyUserName->text ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
896 settings->setValue ("proxyPassword", ui->proxyPassword->text ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
897 settings->setValue ("terminal/cursorUseForegroundColor", ui->terminal_cursorUseForegroundColor->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
898 settings->setValue ("terminal/focus_after_command", ui->terminal_focus_command->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
899 settings->setValue ("terminal/print_debug_location", ui->terminal_print_dbg_location->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
900 settings->setValue ("terminal/history_buffer", ui->terminal_history_buffer->value ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
901 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
902 // the cursor |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
903 QString cursorType; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
904 switch (ui->terminal_cursorType->currentIndex ()) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
905 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
906 case 0: cursorType = "ibeam"; break; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
907 case 1: cursorType = "block"; break; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
908 case 2: cursorType = "underline"; break; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
909 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
910 settings->setValue ("terminal/cursorType", cursorType); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
911 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
912 #if defined (HAVE_QSCINTILLA) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
913 // editor styles: create lexer, get dialog contents, and write settings |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
914 QsciLexer *lexer; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
915 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
916 #if defined (HAVE_LEXER_OCTAVE) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
917 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
918 lexer = new QsciLexerOctave (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
919 write_lexer_settings (ui, lexer, settings); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
920 delete lexer; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
921 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
922 #elif defined (HAVE_LEXER_MATLAB) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
923 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
924 lexer = new QsciLexerMatlab (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
925 write_lexer_settings (ui, lexer, settings); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
926 delete lexer; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
927 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
928 #endif |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
929 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
930 lexer = new QsciLexerCPP (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
931 write_lexer_settings (ui, lexer, settings); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
932 delete lexer; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
933 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
934 lexer = new QsciLexerPerl (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
935 write_lexer_settings (ui, lexer, settings); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
936 delete lexer; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
937 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
938 lexer = new QsciLexerBatch (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
939 write_lexer_settings (ui, lexer, settings); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
940 delete lexer; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
941 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
942 lexer = new QsciLexerDiff (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
943 write_lexer_settings (ui, lexer, settings); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
944 delete lexer; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
945 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
946 lexer = new QsciLexerBash (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
947 write_lexer_settings (ui, lexer, settings); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
948 delete lexer; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
949 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24559
diff
changeset
|
950 lexer = new octave::octave_txt_lexer (); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
951 write_lexer_settings (ui, lexer, settings); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
952 delete lexer; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
953 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
954 #endif |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
955 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
956 // Workspace |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
957 write_workspace_colors (settings); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
958 // hide tool tips |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
959 settings->setValue ("workspaceview/hide_tool_tips", ui->cb_hide_tool_tips->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
960 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
961 // Terminal |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
962 write_terminal_colors (settings); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
963 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
964 // Variable editor |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
965 settings->setValue ("variable_editor/autofit_column_width", ui->varedit_autoFitColumnWidth->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
966 settings->setValue ("variable_editor/autofit_type", ui->varedit_autofitType->currentIndex ()); |
25074
f50fa34827fb
use spin boxes for col/row/ width/height in settings for variable editor
Torsten <mttl@mailbox.org>
parents:
25054
diff
changeset
|
967 settings->setValue ("variable_editor/column_width", ui->varedit_columnWidth->value ()); |
f50fa34827fb
use spin boxes for col/row/ width/height in settings for variable editor
Torsten <mttl@mailbox.org>
parents:
25054
diff
changeset
|
968 settings->setValue ("variable_editor/row_height", ui->varedit_rowHeight->value ()); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
969 settings->setValue ("variable_editor/autofit_row_height", ui->varedit_rowAutofit->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
970 settings->setValue ("variable_editor/use_terminal_font", ui->varedit_useTerminalFont->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
971 settings->setValue ("variable_editor/alternate_rows", ui->varedit_alternate->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
972 settings->setValue ("variable_editor/font_name", ui->varedit_font->currentFont ().family ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
973 settings->setValue ("variable_editor/font_size", ui->varedit_fontSize->value ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
974 write_varedit_colors (settings); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
975 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
976 // shortcuts |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
977 settings->setValue ("shortcuts/prevent_readline_conflicts", ui->cb_prevent_readline_conflicts->isChecked ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
978 shortcut_manager::write_shortcuts (settings, closing); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
979 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
980 // settings dialog's geometry |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
981 settings->setValue ("settings/last_tab", ui->tabWidget->currentIndex ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
982 settings->setValue ("settings/geometry", saveGeometry ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
983 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
984 settings->sync (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
985 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
986 |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
987 void |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
988 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
|
989 { |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
990 |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
991 QList<QColor> default_colors = |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
992 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
|
993 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
|
994 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
|
995 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
|
996 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
997 QGridLayout *style_grid = new QGridLayout (); |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
998 QVector<QLabel*> description (nr_of_classes); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
999 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
|
1000 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
1001 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
|
1002 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
|
1003 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
|
1004 { |
16749
c9007267cbf5
Variation of color option layouts with columns packed to the left
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16748
diff
changeset
|
1005 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
|
1006 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
|
1007 QVariant default_var = default_colors.at (i); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1008 QColor setting_color = settings->value ("workspaceview/color_" + class_chars.mid (i, 1), default_var).value<QColor> (); |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
1009 color[i] = new color_picker (setting_color); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1010 color[i]->setObjectName ("color_" + class_chars.mid (i, 1)); |
16748
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
1011 color[i]->setMinimumSize (30, 10); |
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
1012 style_grid->addWidget (description[i], row, 3*column); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1013 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
|
1014 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
|
1015 { |
16749
c9007267cbf5
Variation of color option layouts with columns packed to the left
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16748
diff
changeset
|
1016 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
|
1017 row++; |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
1018 column = 0; |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
1019 } |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
1020 } |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
1021 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
1022 // 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
|
1023 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
|
1024 } |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
1025 |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1026 void |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1027 settings_dialog::write_workspace_colors (QSettings *settings) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1028 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1029 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1030 QString class_chars = resource_manager::storage_class_chars (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1031 color_picker *color; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1032 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1033 for (int i = 0; i < class_chars.length (); i++) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1034 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1035 color = ui->workspace_colors_box->findChild <color_picker *> ("color_" + class_chars.mid (i, 1)); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1036 if (color) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1037 settings->setValue ("workspaceview/color_" + class_chars.mid (i, 1), color->color ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1038 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1039 settings->sync (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1040 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1041 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1042 void |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1043 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
|
1044 { |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1045 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1046 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
|
1047 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
|
1048 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
|
1049 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
|
1050 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1051 QGridLayout *style_grid = new QGridLayout (); |
16626
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
1052 QVector<QLabel*> description (nr_of_classes); |
4adf3c4bd80b
GUI compilation fixes for MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16623
diff
changeset
|
1053 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
|
1054 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1055 int column = 0; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1056 int row = 0; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1057 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
|
1058 { |
16749
c9007267cbf5
Variation of color option layouts with columns packed to the left
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16748
diff
changeset
|
1059 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
|
1060 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
|
1061 QVariant default_var = default_colors.at (i); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1062 QColor setting_color = settings->value ("terminal/color_" + class_chars.mid (i, 1), default_var).value<QColor> (); |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1063 color[i] = new color_picker (setting_color); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1064 color[i]->setObjectName ("terminal_color_" + class_chars.mid (i, 1)); |
16748
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
1065 color[i]->setMinimumSize (30, 10); |
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
1066 style_grid->addWidget (description[i], row, 2*column); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1067 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
|
1068 if (++column == 2) |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1069 { |
16748
28a58b06e4ff
Make spacing similar for color option layouts
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16703
diff
changeset
|
1070 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
|
1071 row++; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1072 column = 0; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1073 } |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1074 } |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1075 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1076 // 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
|
1077 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
|
1078 } |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
16379
diff
changeset
|
1079 |
15274
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
1080 void |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1081 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
|
1082 { |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1083 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
|
1084 color_picker *color; |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1085 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
1086 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
|
1087 { |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1088 color = ui->terminal_colors_box->findChild <color_picker *> ("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
|
1089 if (color) |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1090 settings->setValue ("terminal/color_" + class_chars.mid (i, 1), color->color ()); |
19631
4e85ca0b4887
add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents:
19595
diff
changeset
|
1091 } |
19632
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
1092 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1093 settings->sync (); |
18310
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18309
diff
changeset
|
1094 } |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18309
diff
changeset
|
1095 |
18309
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18302
diff
changeset
|
1096 void |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1097 settings_dialog::read_varedit_colors (QSettings *settings) |
18309
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18302
diff
changeset
|
1098 { |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24749
diff
changeset
|
1099 QList<QColor> default_colors = octave::variable_editor::default_colors (); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24749
diff
changeset
|
1100 QStringList class_names = octave::variable_editor::color_names (); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1101 QString class_chars = resource_manager::varedit_color_chars (); |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1102 int nr_of_classes = class_chars.length (); |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1103 |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1104 QGridLayout *style_grid = new QGridLayout (); |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1105 QVector<QLabel*> description (nr_of_classes); |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1106 QVector<color_picker*> color (nr_of_classes); |
18310
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18309
diff
changeset
|
1107 |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1108 int column = 0; |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1109 int row = 0; |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1110 for (int i = 0; i < nr_of_classes; i++) |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1111 { |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1112 description[i] = new QLabel (" " + class_names.at (i)); |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1113 description[i]->setAlignment (Qt::AlignRight); |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1114 QVariant default_var = default_colors.at (i); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1115 QColor setting_color = settings->value ("variable_editor/color_" + class_chars.mid (i, 1), default_var).value<QColor> (); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1116 color[i] = new color_picker (setting_color); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1117 color[i]->setObjectName ("varedit_color_" + class_chars.mid (i, 1)); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1118 color[i]->setMinimumSize (30, 10); |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1119 style_grid->addWidget (description[i], row, 2*column); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1120 style_grid->addWidget (color[i], row, 2*column+1); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1121 if (++column == 2) |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1122 { |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1123 style_grid->setColumnStretch (3*column, 10); |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1124 row++; |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1125 column = 0; |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1126 } |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1127 } |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1128 |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1129 // place grid with elements into the tab |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23810
diff
changeset
|
1130 ui->varedit_colors_box->setLayout (style_grid); |
18310
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18309
diff
changeset
|
1131 } |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18309
diff
changeset
|
1132 |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18309
diff
changeset
|
1133 void |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1134 settings_dialog::write_varedit_colors (QSettings *settings) |
18310
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18309
diff
changeset
|
1135 { |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1136 QString class_chars = resource_manager::varedit_color_chars (); |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
1137 color_picker *color; |
18822
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18733
diff
changeset
|
1138 |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16525
diff
changeset
|
1139 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
|
1140 { |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1141 color = ui->varedit_colors_box->findChild <color_picker *> ("varedit_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
|
1142 if (color) |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1143 settings->setValue ("variable_editor/color_" + class_chars.mid (i, 1), color->color ()); |
19631
4e85ca0b4887
add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents:
19595
diff
changeset
|
1144 } |
18822
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18733
diff
changeset
|
1145 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23996
diff
changeset
|
1146 settings->sync (); |
20702
b6b16d8c8b57
possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents:
20685
diff
changeset
|
1147 } |