annotate libgui/src/settings-dialog.h @ 19698:ff56a9899101

fix new shortcut dialog when applying new settings (fix #44196) * settings-dialog.cc (write_changed_settings): new boolean parameter whether settings dialog is closing or not, calling function for writing the shortcuts with this parameter; (button_clicked): calling write_changed_settings with new flag set to false when button with accept role was clicked * settings-dialog.h: write_changed_settings with boolean parameter * shortcut-manager.cc (do_write_shortcuts): delete shortcut dialog only if settings dialog is closing, setting to 0 after deletion; (do_import_export): call do_write_shortcuts with new flag * shortcut-manager.h: do_/write_shortcuts with new boolean parameter
author Torsten <ttl@justmail.de>
date Fri, 06 Feb 2015 22:55:01 +0100
parents 101ce4eaa56c
children 4197fc428c7d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
1 /*
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
2
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 17676
diff changeset
3 Copyright (C) 2011-2013 Jacob Dawid
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
4
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
5 This file is part of Octave.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
6
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
8 under the terms of the GNU General Public License as published by the
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
10 option) any later version.
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
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
23 #ifndef SETTINGSDIALOG_H
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
24 #define SETTINGSDIALOG_H
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
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>
16646
025bc6b5080e use QScintilla's lexer for highlighting Octave programs
John W. Eaton <jwe@octave.org>
parents: 16636
diff changeset
29
16693
e9d0b8252a0a make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents: 16646
diff changeset
30 #include "color-picker.h"
e9d0b8252a0a make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents: 16646
diff changeset
31
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 15367
diff changeset
32 #ifdef HAVE_QSCINTILLA
16646
025bc6b5080e use QScintilla's lexer for highlighting Octave programs
John W. Eaton <jwe@octave.org>
parents: 16636
diff changeset
33 class QsciLexer;
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 15367
diff changeset
34 #endif
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
35
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
36 namespace Ui
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
37 {
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
38 class settings_dialog;
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
39 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
40
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
41 class settings_dialog:public QDialog
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
42 {
15367
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15274
diff changeset
43 Q_OBJECT public:
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
44 explicit settings_dialog (QWidget * parent,
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
45 const QString& desired_tab = QString ());
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
46 ~settings_dialog ();
19666
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19665
diff changeset
47 void show_tab (const QString&);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
48
19665
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19457
diff changeset
49 signals:
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19457
diff changeset
50 void apply_new_settings ();
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19457
diff changeset
51
18309
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18179
diff changeset
52 private slots:
024940bd5b77 gui: provide prefernces for the octave directory at startup
Torsten <ttl@justmail.de>
parents: 18179
diff changeset
53 void get_octave_dir ();
18310
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
54 void get_file_browser_dir ();
03a8428adef7 gui: provide prefernces for the file browser's directory at startup
Torsten <ttl@justmail.de>
parents: 18309
diff changeset
55 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
56 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: 18179
diff changeset
57
19665
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19457
diff changeset
58 // slots for dialog's buttons
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19457
diff changeset
59 void button_clicked (QAbstractButton *button);
4e85ca0b4887 add apply button to the settings dialog (bug #44081)
Torsten <ttl@justmail.de>
parents: 19457
diff changeset
60
18861
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
61 // slots for import/export-buttons of shortcut sets
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
62 void import_shortcut_set1 ();
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
63 void export_shortcut_set1 ();
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
64 void import_shortcut_set2 ();
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
65 void export_shortcut_set2 ();
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18310
diff changeset
66
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
67 private:
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
68 Ui::settings_dialog * ui;
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 15367
diff changeset
69 #ifdef HAVE_QSCINTILLA
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 15367
diff changeset
70 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
71 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
72 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
73 enum { MaxLexerStyles = 64,
06bdf84aa3d9 gui: make all styles of the lexers configurable
Torsten <ttl@justmail.de>
parents: 16402
diff changeset
74 MaxStyleNumber = 128 };
16402
7fa90eb41240 gui: individually configurable styles of the editor lexers
Torsten <ttl@justmail.de>
parents: 15367
diff changeset
75 #endif
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16500
diff changeset
76
19698
ff56a9899101 fix new shortcut dialog when applying new settings (fix #44196)
Torsten <ttl@justmail.de>
parents: 19666
diff changeset
77 void write_changed_settings (bool closing);
19666
101ce4eaa56c prevent opening the settings dialog multiple times
Torsten <ttl@justmail.de>
parents: 19665
diff changeset
78
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16500
diff changeset
79 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
80 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
81
818eef7b2618 allow terminal colors to be set from preferences dialog
John W. Eaton <jwe@octave.org>
parents: 16610
diff changeset
82 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
83 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
84
18179
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 17790
diff changeset
85 color_picker *_widget_title_bg_color;
19457
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 18861
diff changeset
86 color_picker *_widget_title_bg_color_active;
18179
b3838cedfe04 redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents: 17790
diff changeset
87 color_picker *_widget_title_fg_color;
19457
d93293218966 custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents: 18861
diff changeset
88 color_picker *_widget_title_fg_color_active;
16693
e9d0b8252a0a make color of current line marker in the editor configurable
Torsten <ttl@justmail.de>
parents: 16646
diff changeset
89 color_picker *_editor_current_line_color;
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
90 };
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
91
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
92 #endif // SETTINGSDIALOG_H