Mercurial > octave
annotate libgui/src/settings-dialog.h @ 16610:a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
* resource-manager.cc/.h(storage_class_names): function returning scope names
(storage_class_colors): function returning default colors for scopes
(storage_class_chars): function returning the ident. characters of the scopes
* color-picker.cc(constructor): prevent focus for the colored pushbutton
* settings-dialog.cc/.h(read_workspace_colors): function reading the colors from
the setitngs and creating a table with color-pickers in the settings dialog
(write_wirkspace_colors): function getting the states of the color-pickers
and writing them into the settings files
* settings-dialog.cc(constructor): call read_workspace_colors
(write_changed_settings): call write_workspace_colors
* settings-dialog.ui: new tab for workspace settings with a box for the colors
* workspace_model.cc/.h(notice_settings): reading colors from the settings
* workspace-model.cc(constructor): initialize list of colors
(data): reorganize determining the appropriate data and take background
color role into consideration
* workspace-model.h(storage_class_color): returns the color for a specific scope
* workspace-view.cc/.h(notice_settings): create tool tip with color key
(setModel): not inline anymore, actual model is stored in _model
author | Torsten <ttl@justmail.de> |
---|---|
date | Sat, 04 May 2013 09:37:28 +0200 |
parents | 06bdf84aa3d9 |
children | 818eef7b2618 |
rev | line source |
---|---|
15204
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
1 /* |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
2 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
3 Copyright (C) 2011-2012 Jacob Dawid |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
4 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
5 This file is part of Octave. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
6 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
10 option) any later version. |
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 |
15204
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
15 for more details. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
16 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
20 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
21 */ |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
22 |
13501 | 23 #ifndef SETTINGSDIALOG_H |
24 #define SETTINGSDIALOG_H | |
25 | |
26 #include <QDialog> | |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
15367
diff
changeset
|
27 #ifdef HAVE_QSCINTILLA |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
15367
diff
changeset
|
28 #include "lexer-octave-gui.h" |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
15367
diff
changeset
|
29 #endif |
13501 | 30 |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
31 namespace Ui |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
32 { |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
33 class settings_dialog; |
13501 | 34 } |
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:public QDialog |
13501 | 37 { |
15367
501a9cc2c68f
maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
15274
diff
changeset
|
38 Q_OBJECT public: |
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 explicit settings_dialog (QWidget * parent); |
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
40 ~settings_dialog (); |
15274
c5d09a57ceb2
provide buttons for the settings dialog (bug #36981)
Torsten <ttl@justmail.de>
parents:
15204
diff
changeset
|
41 void write_changed_settings (); |
13501 | 42 |
43 private: | |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
44 Ui::settings_dialog * ui; |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
15367
diff
changeset
|
45 #ifdef HAVE_QSCINTILLA |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
15367
diff
changeset
|
46 void read_lexer_settings (QsciLexer *lexer, QSettings *settings); |
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
15367
diff
changeset
|
47 void write_lexer_settings (QsciLexer *lexer, QSettings *settings); |
16500
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16402
diff
changeset
|
48 int get_valid_lexer_styles (QsciLexer *lexer, int styles[]); |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16402
diff
changeset
|
49 enum { MaxLexerStyles = 64, |
06bdf84aa3d9
gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents:
16402
diff
changeset
|
50 MaxStyleNumber = 128 }; |
16402
7fa90eb41240
gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents:
15367
diff
changeset
|
51 #endif |
16610
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16500
diff
changeset
|
52 |
a1f613e5066d
workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents:
16500
diff
changeset
|
53 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
|
54 void write_workspace_colors (QSettings *settings); |
13501 | 55 }; |
56 | |
57 #endif // SETTINGSDIALOG_H |