annotate libgui/src/gui-preferences-global.h @ 28409:ed8d11b1027d

reorganize network preferences in settings dialog * gui-preferences-global.h: new lists with proxy types and flags for those requiring manual input from the user in the dialog * settings-dialog.cc (settings_dialog): fill the combo box of proxy types witht the list defined in gui-preferences, connect signal for des-/enabling dialog elements depending on changed selections, new names for the elements avoiding camel-case (proxy_items_update): slot for changes in proxy settings, des-/enabling the line edits for the proxy accordingly (write_changed_settings): new variable names * settings-dialog.h: new slot proxy_items_update * settings-dialog.ui: reordering network preferences in groups, new variable names for proxy settings, removed realted signals and slots for dis-/enabling elements which are now in settings_dialog
author Torsten Lilge <ttl-octave@mailbox.org>
date Fri, 05 Jun 2020 20:50:22 +0200
parents bd51beb6205e
children e2e615821ef5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
3 // Copyright (C) 2017-2020 The Octave Project Developers
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
27560
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 #if ! defined (octave_gui_preferences_global_h)
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 #define octave_gui_preferences_global_h 1
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 #include "gui-preferences.h"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 // Global preferences
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 // Get the default monospaced font
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 #if defined (Q_WS_X11)
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 const QString global_font_family = "Monospace";
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 #elif defined (Q_WS_WIN) || defined (Q_WS_MAC)
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 const QString global_font_family = "Courier";
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 #else
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 const QString global_font_family = "Courier";
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 #endif
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 const gui_pref
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 global_mono_font ("monospace_font", global_font_family);
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44
27805
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
45 // Style
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
46
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
47 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
48 global_style ("style", QVariant ("default"));
27560
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 const QString
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 global_toolbar_style ("QToolBar {"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 "spacing-top: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 "spacing-bottom: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 "margin-top: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55 "margin-bottom: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 "padding-top: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 "padding-bottom: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 "border-top: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 "border-bottom: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 "}");
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 const QString
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 global_menubar_style ("QMenuBar {"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64 "spacing-top: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 "spacing-bottom: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 "margin-top: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 "margin-bottom: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 "padding-top: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 "padding-bottom: 0px;"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 "}");
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 // Icon size (in preferences: values -1, 0, 1)
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 const QStyle::PixelMetric global_icon_sizes[3] =
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75 {
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 QStyle::PM_SmallIconSize,
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77 QStyle::PM_ToolBarIconSize,
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 QStyle::PM_LargeIconSize
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79 };
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81 const gui_pref
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 global_icon_size ("toolbar_icon_size", QVariant (0));
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 const gui_pref
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85 global_icon_theme ("use_system_icon_theme", QVariant (true));
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86
27805
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
87 // Other
27560
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 const gui_pref
27805
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
90 global_status_bar ("show_status_bar", QVariant (true));
27570
775412096ae4 use symbolic constants for file dock widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
91
775412096ae4 use symbolic constants for file dock widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
92 const gui_pref
775412096ae4 use symbolic constants for file dock widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
93 global_use_native_dialogs ("use_native_file_dialogs", QVariant (true));
775412096ae4 use symbolic constants for file dock widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
94
27583
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27570
diff changeset
95 const gui_pref
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27570
diff changeset
96 global_cursor_blinking ("cursor_blinking", QVariant (true));
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27570
diff changeset
97
27805
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
98 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
99 global_language ("language", QVariant ("SYSTEM"));
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
100
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
101 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
102 global_ov_startup_dir ("octave_startup_dir", QVariant (QString ()));
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
103 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
104 global_restore_ov_dir ("restore_octave_dir", QVariant (false));
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
105
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
106 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
107 global_use_custom_editor ("useCustomFileEditor", QVariant (false));
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
108 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
109 global_custom_editor ("customFileEditor", QVariant ("emacs +%l %f"));
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
110
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
111 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
112 global_prompt_to_exit ("prompt_to_exit", QVariant (false));
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
113
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
114 // Proxy
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
115
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
116 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
117 global_proxy_host ("proxyHostName", QVariant (QString ()));
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
118 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
119 global_use_proxy ("useProxyServer", QVariant (false));
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
120 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
121 global_proxy_type ("proxyType", QVariant (QString ()));
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
122 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
123 global_proxy_port ("proxyPort", QVariant (80));
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
124 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
125 global_proxy_user ("proxyUserName", QVariant (QString ()));
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
126 const gui_pref
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
127 global_proxy_pass ("proxyPassword", QVariant (QString ()));
dccc551aa83b replace literal strings by symbolic constants for global preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
128
28409
ed8d11b1027d reorganize network preferences in settings dialog
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27923
diff changeset
129 const QStringList
ed8d11b1027d reorganize network preferences in settings dialog
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27923
diff changeset
130 global_proxy_all_types (QStringList ()
ed8d11b1027d reorganize network preferences in settings dialog
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27923
diff changeset
131 << QT_TRANSLATE_NOOP ("octave::settings_dialog", "HttpProxy")
ed8d11b1027d reorganize network preferences in settings dialog
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27923
diff changeset
132 << QT_TRANSLATE_NOOP ("octave::settings_dialog", "Socks5Proxy")
ed8d11b1027d reorganize network preferences in settings dialog
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27923
diff changeset
133 // << QT_TRANSLATE_NOOP ("octave::settings_dialog", "Environment Varaibles")
ed8d11b1027d reorganize network preferences in settings dialog
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27923
diff changeset
134 );
ed8d11b1027d reorganize network preferences in settings dialog
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27923
diff changeset
135 const QList<int>
ed8d11b1027d reorganize network preferences in settings dialog
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27923
diff changeset
136 global_proxy_manual_types (QList<int> () << 0 << 1);
ed8d11b1027d reorganize network preferences in settings dialog
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27923
diff changeset
137
27560
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
138 #endif