Mercurial > octave
annotate libgui/src/settings-dialog.h @ 25617:44d638d5eea5
reorganize constants for preferences keys and default values
* editor-settings.h: rename into gui-preferences.h
* gui-preferences.h: define a structure for key string and default value,
reorganize existing constants using the new structure, renaming constants
reflecting the main widget they are used in
* file-editor-tab.cc: include gui-preferences.h;
(do_comment_selected_text): use const structure with new names for
preferences keys and default values
file-editor-tab.cc Wed Jul 11 07:56:05 2018 +0200
* octave-qscintilla.cc: include gui-preferences.h;
(comment_string): use const structure with new names for preferences
keys and default values
* module.mk: rename editor-settings.h into gui-preferences.h
* settings-dialog.cc: include gui-preferences.h;
(settings_dialog, write_changed_settings): use const structure with new
names for preferences keys and default values
* settings-dialog.h: include gui-preferences.h, use const structure with new
names for preferences keys and default values
author | Torsten <mttl@mailbox.org> |
---|---|
date | Fri, 13 Jul 2018 22:58:56 +0200 |
parents | 2fa7cd178c4a |
children | 526b51129c06 |
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:
24534
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. |
14291
c39c7f2b1e46
Replaced local-native with local in octave-gui.pro for building on MacOS.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14290
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:
13537
diff
changeset
|
22 |
21203
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20945
diff
changeset
|
23 #if ! defined (octave_settings_dialog_h) |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20945
diff
changeset
|
24 #define octave_settings_dialog_h 1 |
13501 | 25 |
26 #include <QDialog> | |
16636
d788ee8b8a99
Fix GUI includes when built without Qscintilla
Mike Miller <mtmiller@ieee.org>
parents:
16620
diff
changeset
|
27 #include <QSettings> |
18310
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18309
diff
changeset
|
28 #include <QLineEdit> |
24475
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24011
diff
changeset
|
29 #include <QRadioButton> |
16646
025bc6b5080e
use QScintilla's lexer for highlighting Octave programs
John W. Eaton <jwe@octave.org>
parents:
16636
diff
changeset
|
30 |
16693
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16646
diff
changeset
|
31 #include "color-picker.h" |
25617
44d638d5eea5
reorganize constants for preferences keys and default values
Torsten <mttl@mailbox.org>
parents:
25443
diff
changeset
|
32 #include "gui-preferences.h" |
16693
e9d0b8252a0a
make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents:
16646
diff
changeset
|
33 |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
34 namespace Ui |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
35 { |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
36 class settings_dialog; |
13501 | 37 } |
38 | |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
39 class settings_dialog:public QDialog |
13501 | 40 { |
15367
501a9cc2c68f
maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
15274
diff
changeset
|
41 Q_OBJECT public: |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
42 |
23432
e35a5c1233d0
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
43 explicit settings_dialog (QWidget *parent, |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
44 const QString& desired_tab = QString ()); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
45 ~settings_dialog (void); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
46 |
19632
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
47 void show_tab (const QString&); |
13501 | 48 |
19631
4e85ca0b4887
add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents:
19423
diff
changeset
|
49 signals: |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
50 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
51 void apply_new_settings (void); |
19631
4e85ca0b4887
add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents:
19423
diff
changeset
|
52 |
18309
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18180
diff
changeset
|
53 private slots: |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
54 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
55 void get_octave_dir (void); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
56 void get_file_browser_dir (void); |
18310
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18309
diff
changeset
|
57 void get_dir (QLineEdit*, const QString&); |
03a8428adef7
gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents:
18309
diff
changeset
|
58 void set_disabled_pref_file_browser_dir (bool disable); |
18309
024940bd5b77
gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents:
18180
diff
changeset
|
59 |
19631
4e85ca0b4887
add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents:
19423
diff
changeset
|
60 // slots for dialog's buttons |
4e85ca0b4887
add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents:
19423
diff
changeset
|
61 void button_clicked (QAbstractButton *button); |
4e85ca0b4887
add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents:
19423
diff
changeset
|
62 |
18822
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18310
diff
changeset
|
63 // slots for import/export-buttons of shortcut sets |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
64 void import_shortcut_set (void); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
65 void export_shortcut_set (void); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
66 void default_shortcut_set (void); |
18822
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18310
diff
changeset
|
67 |
13501 | 68 private: |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
69 |
23432
e35a5c1233d0
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
70 Ui::settings_dialog *ui; |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16500
diff
changeset
|
71 |
19664
ff56a9899101
fix new shortcut dialog when applying new settings (fix #44196)
Torsten <ttl@justmail.de>
parents:
19632
diff
changeset
|
72 void write_changed_settings (bool closing); |
19632
101ce4eaa56c
prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents:
19631
diff
changeset
|
73 |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16500
diff
changeset
|
74 void read_workspace_colors (QSettings *settings); |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16500
diff
changeset
|
75 void write_workspace_colors (QSettings *settings); |
16620
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
76 |
818eef7b2618
allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents:
16610
diff
changeset
|
77 void 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
|
78 void write_terminal_colors (QSettings *settings); |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
79 |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23432
diff
changeset
|
80 void read_varedit_colors (QSettings *settings); |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23432
diff
changeset
|
81 void write_varedit_colors (QSettings *settings); |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23432
diff
changeset
|
82 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
83 color_picker *m_widget_title_bg_color; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
84 color_picker *m_widget_title_bg_color_active; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
85 color_picker *m_widget_title_fg_color; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
86 color_picker *m_widget_title_fg_color_active; |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23927
diff
changeset
|
87 color_picker *m_editor_current_line_color; |
24475
8cb985e362f3
Allow uncommenting with any kind of comment (bug #52695):
Torsten <mttl@mailbox.org>
parents:
24011
diff
changeset
|
88 |
25617
44d638d5eea5
reorganize constants for preferences keys and default values
Torsten <mttl@mailbox.org>
parents:
25443
diff
changeset
|
89 QRadioButton *m_rb_comment_strings[ed_comment_strings_count]; |
44d638d5eea5
reorganize constants for preferences keys and default values
Torsten <mttl@mailbox.org>
parents:
25443
diff
changeset
|
90 QRadioButton *m_rb_uncomment_strings[ed_comment_strings_count]; |
13501 | 91 }; |
92 | |
20945
9d9270e2f98f
eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents:
20774
diff
changeset
|
93 #endif |