view 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
line wrap: on
line source

////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017-2020 The Octave Project Developers
//
// See the file COPYRIGHT.md in the top-level directory of this
// distribution or <https://octave.org/copyright/>.
//
// This file is part of Octave.
//
// Octave is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Octave is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Octave; see the file COPYING.  If not, see
// <https://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////

#if ! defined (octave_gui_preferences_global_h)
#define octave_gui_preferences_global_h 1

#include "gui-preferences.h"

// Global preferences

// Get the default monospaced font
#if defined (Q_WS_X11)
const QString global_font_family = "Monospace";
#elif defined (Q_WS_WIN) || defined (Q_WS_MAC)
const QString global_font_family = "Courier";
#else
const QString global_font_family = "Courier";
#endif

const gui_pref
global_mono_font ("monospace_font", global_font_family);

// Style

const gui_pref
global_style ("style", QVariant ("default"));

const QString
global_toolbar_style ("QToolBar {"
                      "spacing-top: 0px;"
                      "spacing-bottom: 0px;"
                      "margin-top: 0px;"
                      "margin-bottom: 0px;"
                      "padding-top: 0px;"
                      "padding-bottom: 0px;"
                      "border-top: 0px;"
                      "border-bottom: 0px;"
                      "}");

const QString
global_menubar_style ("QMenuBar {"
                      "spacing-top: 0px;"
                      "spacing-bottom: 0px;"
                      "margin-top: 0px;"
                      "margin-bottom: 0px;"
                      "padding-top: 0px;"
                      "padding-bottom: 0px;"
                      "}");

// Icon size (in preferences: values -1, 0, 1)

const QStyle::PixelMetric global_icon_sizes[3] =
{
  QStyle::PM_SmallIconSize,
  QStyle::PM_ToolBarIconSize,
  QStyle::PM_LargeIconSize
};

const gui_pref
global_icon_size ("toolbar_icon_size", QVariant (0));

const gui_pref
global_icon_theme ("use_system_icon_theme", QVariant (true));

// Other

const gui_pref
global_status_bar ("show_status_bar", QVariant (true));

const gui_pref
global_use_native_dialogs ("use_native_file_dialogs", QVariant (true));

const gui_pref
global_cursor_blinking ("cursor_blinking", QVariant (true));

const gui_pref
global_language ("language", QVariant ("SYSTEM"));

const gui_pref
global_ov_startup_dir ("octave_startup_dir", QVariant (QString ()));
const gui_pref
global_restore_ov_dir ("restore_octave_dir", QVariant (false));

const gui_pref
global_use_custom_editor ("useCustomFileEditor", QVariant (false));
const gui_pref
global_custom_editor ("customFileEditor", QVariant ("emacs +%l %f"));

const gui_pref
global_prompt_to_exit ("prompt_to_exit", QVariant (false));

// Proxy

const gui_pref
global_proxy_host ("proxyHostName", QVariant (QString ()));
const gui_pref
global_use_proxy ("useProxyServer", QVariant (false));
const gui_pref
global_proxy_type ("proxyType", QVariant (QString ()));
const gui_pref
global_proxy_port ("proxyPort", QVariant (80));
const gui_pref
global_proxy_user ("proxyUserName", QVariant (QString ()));
const gui_pref
global_proxy_pass ("proxyPassword", QVariant (QString ()));

const QStringList
global_proxy_all_types (QStringList ()
             << QT_TRANSLATE_NOOP ("octave::settings_dialog", "HttpProxy")
             << QT_TRANSLATE_NOOP ("octave::settings_dialog", "Socks5Proxy")
//             << QT_TRANSLATE_NOOP ("octave::settings_dialog", "Environment Varaibles")
);
const QList<int>
global_proxy_manual_types (QList<int> () << 0 << 1);

#endif