VirtualBox

Changeset 65678 in vbox for trunk/src


Ignore:
Timestamp:
Feb 8, 2017 1:27:21 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: Global preferences: Refactoring to prpeare to settings cache integration.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/global
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.cpp

    r62493 r65678  
    55
    66/*
    7  * Copyright (C) 2012-2016 Oracle Corporation
     7 * Copyright (C) 2012-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2727
    2828
    29 /* Display page constructor: */
    3029UIGlobalSettingsDisplay::UIGlobalSettingsDisplay()
    3130{
     
    4948}
    5049
    51 /* Load data to cache from corresponding external object(s),
    52  * this task COULD be performed in other than GUI thread: */
    5350void UIGlobalSettingsDisplay::loadToCacheFrom(QVariant &data)
    5451{
     
    6461}
    6562
    66 /* Load data to corresponding widgets from cache,
    67  * this task SHOULD be performed in GUI thread only: */
    6863void UIGlobalSettingsDisplay::getFromCache()
    6964{
     
    9186        m_pResolutionHeightSpin->setValue(iHeight);
    9287    }
    93     /* Set state for corresponding check-box: */
    9488    m_pCheckBoxActivateOnMouseHover->setChecked(m_cache.m_fActivateHoveredMachineWindow);
    9589}
    9690
    97 /* Save data from corresponding widgets to cache,
    98  * this task SHOULD be performed in GUI thread only: */
    9991void UIGlobalSettingsDisplay::putToCache()
    10092{
     
    117109        m_cache.m_strMaxGuestResolution = QString("%1,%2").arg(m_pResolutionWidthSpin->value()).arg(m_pResolutionHeightSpin->value());
    118110    }
    119     /* Acquire state from corresponding check-box: */
    120111    m_cache.m_fActivateHoveredMachineWindow = m_pCheckBoxActivateOnMouseHover->isChecked();
    121112}
    122113
    123 /* Save data from cache to corresponding external object(s),
    124  * this task COULD be performed in other than GUI thread: */
    125114void UIGlobalSettingsDisplay::saveFromCacheTo(QVariant &data)
    126115{
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.h

    r62493 r65678  
    55
    66/*
    7  * Copyright (C) 2012-2016 Oracle Corporation
     7 * Copyright (C) 2012-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIGlobalSettingsDisplay_h__
    19 #define __UIGlobalSettingsDisplay_h__
     18#ifndef ___UIGlobalSettingsDisplay_h___
     19#define ___UIGlobalSettingsDisplay_h___
    2020
    21 /* Local includes: */
     21/* GUI includes: */
    2222#include "UISettingsPage.h"
    2323#include "UIGlobalSettingsDisplay.gen.h"
    2424
    25 /* Global settings / Display page / Cache: */
     25
     26/** Global settings: Display page cache structure. */
    2627struct UISettingsCacheGlobalDisplay
    2728{
     29    /** Holds the maximum guest resolution or preset name. */
    2830    QString m_strMaxGuestResolution;
     31    /** Holds whether we should automatically activate machine window under the mouse cursor. */
    2932    bool m_fActivateHoveredMachineWindow;
    3033};
    3134
    32 /* Global settings / Display page: */
     35
     36/** Global settings: Display page. */
    3337class UIGlobalSettingsDisplay : public UISettingsPageGlobal, public Ui::UIGlobalSettingsDisplay
    3438{
     
    7680};
    7781
    78 #endif // __UIGlobalSettingsDisplay_h__
     82#endif /* !___UIGlobalSettingsDisplay_h___ */
    7983
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.cpp

    r64778 r65678  
    55
    66/*
    7  * Copyright (C) 2010-2016 Oracle Corporation
     7 * Copyright (C) 2010-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6363        if (m_data.m_strVersion.contains(QRegExp("[-_]")))
    6464            strAppend = m_data.m_strVersion.section(QRegExp("[-_]"), 1, -1, QString::SectionIncludeLeadingSep);
    65         setText(2, QString("%1r%2%3").arg(strVersion).arg(m_data.m_strRevision).arg(strAppend));
     65        setText(2, QString("%1r%2%3").arg(strVersion).arg(m_data.m_uRevision).arg(strAppend));
    6666
    6767        /* Tool-tip: */
     
    9797};
    9898
    99 /* Extension page constructor: */
     99
    100100UIGlobalSettingsExtension::UIGlobalSettingsExtension()
    101101    : m_pActionAdd(0), m_pActionRemove(0)
     
    237237}
    238238
    239 /* Load data to cache from corresponding external object(s),
    240  * this task COULD be performed in other than GUI thread: */
    241239void UIGlobalSettingsExtension::loadToCacheFrom(QVariant &data)
    242240{
     
    254252}
    255253
    256 /* Load data to corresponding widgets from cache,
    257  * this task SHOULD be performed in GUI thread only: */
    258254void UIGlobalSettingsExtension::getFromCache()
    259255{
     
    268264}
    269265
    270 /* Save data from corresponding widgets to cache,
    271  * this task SHOULD be performed in GUI thread only: */
    272266void UIGlobalSettingsExtension::putToCache()
    273267{
    274     /* Nothing to put to cache... */
    275 }
    276 
    277 /* Save data from cache to corresponding external object(s),
    278  * this task COULD be performed in other than GUI thread: */
     268    /* Nothing to upload to cache... */
     269}
     270
    279271void UIGlobalSettingsExtension::saveFromCacheTo(QVariant &data)
    280272{
     
    467459    item.m_strDescription = package.GetDescription();
    468460    item.m_strVersion = package.GetVersion();
    469     item.m_strRevision = package.GetRevision();
     461    item.m_uRevision = package.GetRevision();
    470462    item.m_fIsUsable = package.GetUsable();
    471463    if (!item.m_fIsUsable)
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.h

    r62493 r65678  
    55
    66/*
    7  * Copyright (C) 2010-2016 Oracle Corporation
     7 * Copyright (C) 2010-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIGlobalSettingsExtension_h__
    19 #define __UIGlobalSettingsExtension_h__
     18#ifndef ___UIGlobalSettingsExtension_h___
     19#define ___UIGlobalSettingsExtension_h___
    2020
    21 /* Local includes */
     21/* GUI includes: */
    2222#include "UISettingsPage.h"
    2323#include "UIGlobalSettingsExtension.gen.h"
    2424
    25 /* Global settings / Extension page / Cache Item: */
     25
     26/** Global settings: Extension page item cache structure. */
    2627struct UISettingsCacheGlobalExtensionItem
    2728{
     29    /** Holds the extension item name. */
    2830    QString m_strName;
     31    /** Holds the extension item description. */
    2932    QString m_strDescription;
     33    /** Holds the extension item version. */
    3034    QString m_strVersion;
    31     ULONG m_strRevision;
     35    /** Holds the extension item revision. */
     36    ULONG m_uRevision;
     37    /** Holds whether the extension item usable. */
    3238    bool m_fIsUsable;
     39    /** Holds why the extension item is unusable. */
    3340    QString m_strWhyUnusable;
    3441};
    3542
    36 /* Global settings / Extension page / Cache: */
     43
     44/** Global settings: Extension page cache structure. */
    3745struct UISettingsCacheGlobalExtension
    3846{
     47    /** Holds the extension items. */
    3948    QList<UISettingsCacheGlobalExtensionItem> m_items;
    4049};
    4150
    42 /* Global settings / Extension page: */
     51
     52/** Global settings: Extension page. */
    4353class UIGlobalSettingsExtension : public UISettingsPageGlobal, public Ui::UIGlobalSettingsExtension
    4454{
     
    97107};
    98108
    99 #endif // __UIGlobalSettingsExtension_h__
     109#endif /* !___UIGlobalSettingsExtension_h___ */
    100110
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp

    r62493 r65678  
    55
    66/*
    7  * Copyright (C) 2006-2016 Oracle Corporation
     7 * Copyright (C) 2006-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4848}
    4949
    50 /* Load data to cache from corresponding external object(s),
    51  * this task COULD be performed in other than GUI thread: */
    5250void UIGlobalSettingsGeneral::loadToCacheFrom(QVariant &data)
    5351{
     
    6462}
    6563
    66 /* Load data to corresponding widgets from cache,
    67  * this task SHOULD be performed in GUI thread only: */
    6864void UIGlobalSettingsGeneral::getFromCache()
    6965{
     
    7470}
    7571
    76 /* Save data from corresponding widgets to cache,
    77  * this task SHOULD be performed in GUI thread only: */
    7872void UIGlobalSettingsGeneral::putToCache()
    7973{
     
    8478}
    8579
    86 /* Save data from cache to corresponding external object(s),
    87  * this task COULD be performed in other than GUI thread: */
    8880void UIGlobalSettingsGeneral::saveFromCacheTo(QVariant &data)
    8981{
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.h

    r62493 r65678  
    55
    66/*
    7  * Copyright (C) 2006-2016 Oracle Corporation
     7 * Copyright (C) 2006-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIGlobalSettingsGeneral_h__
    19 #define __UIGlobalSettingsGeneral_h__
     18#ifndef ___UIGlobalSettingsGeneral_h___
     19#define ___UIGlobalSettingsGeneral_h___
    2020
    21 /* Local includes */
     21/* GUI includes: */
    2222#include "UISettingsPage.h"
    2323#include "UIGlobalSettingsGeneral.gen.h"
    2424
    25 /* Global settings / General page / Cache: */
     25
     26/** Global settings: General page cache structure. */
    2627struct UISettingsCacheGlobalGeneral
    2728{
     29    /** Holds the default machine folder path. */
    2830    QString m_strDefaultMachineFolder;
     31    /** Holds the VRDE authentication library name. */
    2932    QString m_strVRDEAuthLibrary;
     33    /** Holds whether host screen-saver should be disabled. */
    3034    bool m_fHostScreenSaverDisabled;
    3135};
    3236
    33 /* Global settings / General page: */
     37
     38/** Global settings: General page. */
    3439class UIGlobalSettingsGeneral : public UISettingsPageGlobal, public Ui::UIGlobalSettingsGeneral
    3540{
     
    6974};
    7075
    71 #endif // __UIGlobalSettingsGeneral_h__
     76#endif /* !___UIGlobalSettingsGeneral_h___ */
     77
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp

    r64266 r65678  
    55
    66/*
    7  * Copyright (C) 2006-2016 Oracle Corporation
     7 * Copyright (C) 2006-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3030# include "QIStyledItemDelegate.h"
    3131# include "QITableView.h"
     32# include "UIActionPool.h"
    3233# include "UIGlobalSettingsInput.h"
    3334# include "UIShortcutPool.h"
     
    5354
    5455
    55 /** Global settings / Input page / Shortcut table cell. */
     56/** Global settings: Input page: Shortcut cell cache structure. */
    5657class UIShortcutCacheCell : public QITableViewCell
    5758{
     
    7879
    7980
    80 /** Global settings / Input page / Shortcut table row. */
     81/** Global settings: Input page: Shortcut cache structure. */
    8182class UIShortcutCacheRow : public QITableViewRow
    8283{
     
    214215    QPair<UIShortcutCacheCell*, UIShortcutCacheCell*> m_cells;
    215216};
    216 
    217 
    218 /** Global settings / Input page / Cache / Shortcut cache. */
    219217typedef QList<UIShortcutCacheRow> UIShortcutCache;
    220218
    221219
    222 /** Global settings / Input page / Cache. */
     220/** Global settings: Input page cache structure. */
    223221class UISettingsCacheGlobalInput : public QObject
    224222{
     
    251249
    252250
    253 /** Global settings / Input page / Cache / Shortcut cache item sort functor. */
     251/** Global settings: Input page: Shortcut cache sort functor. */
    254252class UIShortcutCacheItemFunctor
    255253{
     
    869867}
    870868
    871 /* Load data to cache from corresponding external object(s),
    872  * this task COULD be performed in other than GUI thread: */
    873869void UIGlobalSettingsInput::loadToCacheFrom(QVariant &data)
    874870{
     
    876872    UISettingsPageGlobal::fetchData(data);
    877873
    878     /* Load host-combo shortcut to cache: */
     874    /* Load to cache: */
    879875    m_pCache->shortcuts() << UIShortcutCacheRow(m_pMachineTable, UIHostCombo::hostComboCacheKey(), tr("Host Key Combination"),  m_settings.hostCombo(), QString());
    880     /* Load all other shortcuts to cache: */
    881876    const QMap<QString, UIShortcut>& shortcuts = gShortcutPool->shortcuts();
    882877    const QList<QString> shortcutKeys = shortcuts.keys();
     
    891886                                                    shortcut.defaultSequence().toString(QKeySequence::NativeText));
    892887    }
    893     /* Load other things to cache: */
    894888    m_pCache->setAutoCapture(m_settings.autoCapture());
    895889
     
    898892}
    899893
    900 /* Load data to corresponding widgets from cache,
    901  * this task SHOULD be performed in GUI thread only: */
    902894void UIGlobalSettingsInput::getFromCache()
    903895{
     
    911903}
    912904
    913 /* Save data from corresponding widgets to cache,
    914  * this task SHOULD be performed in GUI thread only: */
    915905void UIGlobalSettingsInput::putToCache()
    916906{
     
    921911}
    922912
    923 /* Save data from cache to corresponding external object(s),
    924  * this task COULD be performed in other than GUI thread: */
    925913void UIGlobalSettingsInput::saveFromCacheTo(QVariant &data)
    926914{
     
    928916    UISettingsPageGlobal::fetchData(data);
    929917
    930     /* Save host-combo shortcut from cache: */
     918    /* Save from cache: */
    931919    UIShortcutCacheRow fakeHostComboItem(0, UIHostCombo::hostComboCacheKey(), QString(), QString(), QString());
    932920    int iIndexOfHostComboItem = m_pCache->shortcuts().indexOf(fakeHostComboItem);
    933921    if (iIndexOfHostComboItem != -1)
    934922        m_settings.setHostCombo(m_pCache->shortcuts()[iIndexOfHostComboItem].currentSequence());
    935     /* Iterate over cached shortcuts: */
    936923    QMap<QString, QString> sequences;
    937924    foreach (const UIShortcutCacheRow &item, m_pCache->shortcuts())
    938925        sequences.insert(item.key(), item.currentSequence());
    939     /* Save shortcut sequences from cache: */
    940926    gShortcutPool->setOverrides(sequences);
    941     /* Save other things from cache: */
    942927    m_settings.setAutoCapture(m_pCache->autoCapture());
    943928
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.h

    r64259 r65678  
    55
    66/*
    7  * Copyright (C) 2006-2016 Oracle Corporation
     7 * Copyright (C) 2006-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIGlobalSettingsInput_h__
    19 #define __UIGlobalSettingsInput_h__
    20 
    21 /* Qt includes: */
    22 #include <QAbstractTableModel>
     18#ifndef ___UIGlobalSettingsInput_h___
     19#define ___UIGlobalSettingsInput_h___
    2320
    2421/* GUI includes: */
    2522#include "UISettingsPage.h"
    2623#include "UIGlobalSettingsInput.gen.h"
    27 #include "UIActionPool.h"
    2824
    2925/* Forward declartions: */
     
    3531
    3632
    37 /* Global settings / Input page: */
     33/** Global settings: Input page. */
    3834class UIGlobalSettingsInput : public UISettingsPageGlobal, public Ui::UIGlobalSettingsInput
    3935{
     
    9490};
    9591
    96 #endif // __UIGlobalSettingsInput_h__
     92#endif /* !___UIGlobalSettingsInput_h___ */
    9793
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.cpp

    r64127 r65678  
    55
    66/*
    7  * Copyright (C) 2006-2016 Oracle Corporation
     7 * Copyright (C) 2006-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4646extern const char *gVBoxLangIDRegExp;
    4747extern const char *gVBoxBuiltInLangName;
     48
    4849
    4950/* Language item: */
     
    176177};
    177178
     179
    178180/* Language page constructor: */
    179181UIGlobalSettingsLanguage::UIGlobalSettingsLanguage()
     
    203205}
    204206
    205 /* Load data to cache from corresponding external object(s),
    206  * this task COULD be performed in other than GUI thread: */
    207207void UIGlobalSettingsLanguage::loadToCacheFrom(QVariant &data)
    208208{
     
    217217}
    218218
    219 /* Load data to corresponding widgets from cache,
    220  * this task SHOULD be performed in GUI thread only: */
    221219void UIGlobalSettingsLanguage::getFromCache()
    222220{
     
    225223}
    226224
    227 /* Save data from corresponding widgets to cache,
    228  * this task SHOULD be performed in GUI thread only: */
    229225void UIGlobalSettingsLanguage::putToCache()
    230226{
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.h

    r62493 r65678  
    55
    66/*
    7  * Copyright (C) 2006-2016 Oracle Corporation
     7 * Copyright (C) 2006-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIGlobalSettingsLanguage_h__
    19 #define __UIGlobalSettingsLanguage_h__
     18#ifndef ___UIGlobalSettingsLanguage_h___
     19#define ___UIGlobalSettingsLanguage_h___
    2020
    2121/* GUI includes: */
     
    2323#include "UIGlobalSettingsLanguage.gen.h"
    2424
    25 /* Global settings / Language page / Cache: */
     25
     26/** Global settings: Language page cache structure. */
    2627struct UISettingsCacheGlobalLanguage
    2728{
     29    /** Holds the current language id. */
    2830    QString m_strLanguageId;
    2931};
    3032
    31 /* Global settings / Language page: */
     33
     34/** Global settings: Language page. */
    3235class UIGlobalSettingsLanguage : public UISettingsPageGlobal, public Ui::UIGlobalSettingsLanguage
    3336{
     
    8689};
    8790
    88 #endif // __UIGlobalSettingsLanguage_h__
     91#endif /* !___UIGlobalSettingsLanguage_h___ */
     92
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.cpp

    r65629 r65678  
    55
    66/*
    7  * Copyright (C) 2009-2016 Oracle Corporation
     7 * Copyright (C) 2009-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4141#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    4242
     43/* COM includes: */
    4344#include "CDHCPServer.h"
    44 
    4545
    4646
     
    517517    UISettingsPageGlobal::fetchData(data);
    518518
    519     /* Load NAT networks to cache: */
     519    /* Load to cache: */
    520520    m_cache.m_networksNAT.clear();
    521521    const CNATNetworkVector &networks = vboxGlobal().virtualBox().GetNATNetworks();
    522522    foreach (const CNATNetwork &network, networks)
    523523        m_cache.m_networksNAT << generateDataNetworkNAT(network);
    524 
    525     /* Load Host networks to cache: */
    526524    m_cache.m_networksHost.clear();
    527525    const CHostNetworkInterfaceVector &interfaces = vboxGlobal().host().GetNetworkInterfaces();
     
    536534void UIGlobalSettingsNetwork::getFromCache()
    537535{
    538     /* Fetch NAT networks from cache: */
     536    /* Fetch from cache: */
    539537    foreach (const UIDataSettingsGlobalNetworkNAT &network, m_cache.m_networksNAT)
    540538        createTreeItemNetworkNAT(network);
     
    542540    m_pTreeNetworkNAT->setCurrentItem(m_pTreeNetworkNAT->topLevelItem(0));
    543541    sltHandleCurrentItemChangeNetworkNAT();
    544 
    545     /* Fetch Host networks from cache: */
    546542    foreach (const UIDataSettingsGlobalNetworkHost &network, m_cache.m_networksHost)
    547543        createTreeItemNetworkHost(network);
     
    556552void UIGlobalSettingsNetwork::putToCache()
    557553{
    558     /* Upload NAT networks to cache: */
     554    /* Upload to cache: */
    559555    m_cache.m_networksNAT.clear();
    560556    for (int iNetworkIndex = 0; iNetworkIndex < m_pTreeNetworkNAT->topLevelItemCount(); ++iNetworkIndex)
     
    565561        m_cache.m_networksNAT << data;
    566562    }
    567 
    568     /* Upload Host networks to cache: */
    569563    m_cache.m_networksHost.clear();
    570564    for (int iNetworkIndex = 0; iNetworkIndex < m_pTreeNetworkHost->topLevelItemCount(); ++iNetworkIndex)
     
    586580    UISettingsPageGlobal::fetchData(data);
    587581
    588     /* Save NAT networks from cache: */
     582    /* Save from cache: */
    589583    foreach (const UIDataSettingsGlobalNetworkNAT &data, m_cache.m_networksNAT)
    590584        saveCacheItemNetworkNAT(data);
    591 
    592     /* Save Host networks from cache: */
    593585    foreach (const UIDataSettingsGlobalNetworkHost &data, m_cache.m_networksHost)
    594586        saveCacheItemNetworkHost(data);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.h

    • Property svn:keywords set to Date Revision Author Id
    r65629 r65678  
    1 /* $Id: $ */
     1/* $Id$ */
    22/** @file
    33 * VBox Qt GUI - UIGlobalSettingsNetwork class declaration.
     
    55
    66/*
    7  * Copyright (C) 2009-2016 Oracle Corporation
     7 * Copyright (C) 2009-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIGlobalSettingsNetwork_h__
    19 #define __UIGlobalSettingsNetwork_h__
     18#ifndef ___UIGlobalSettingsNetwork_h___
     19#define ___UIGlobalSettingsNetwork_h___
    2020
    2121/* GUI includes: */
     
    2929
    3030
    31 /* Global settings / Network page / NAT network data: */
     31/** Global settings: Network page: NAT network cache structure. */
    3232struct UIDataSettingsGlobalNetworkNAT
    3333{
    34     /* NAT Network: */
     34    /** Holds whether this network enabled. */
    3535    bool m_fEnabled;
     36    /** Holds network name. */
    3637    QString m_strName;
     38    /** Holds new network name. */
    3739    QString m_strNewName;
     40    /** Holds network CIDR. */
    3841    QString m_strCIDR;
     42    /** Holds whether this network supports DHCP. */
    3943    bool m_fSupportsDHCP;
     44    /** Holds whether this network supports IPv6. */
    4045    bool m_fSupportsIPv6;
     46    /** Holds whether this network advertised as default IPv6 route. */
    4147    bool m_fAdvertiseDefaultIPv6Route;
     48    /** Holds IPv4 port forwarding rules. */
    4249    UIPortForwardingDataList m_ipv4rules;
     50    /** Holds IPv6 port forwarding rules. */
    4351    UIPortForwardingDataList m_ipv6rules;
     52
     53    /** Returns whether the @a other passed data is equal to this one. */
    4454    bool operator==(const UIDataSettingsGlobalNetworkNAT &other) const
    4555    {
    46         return m_fEnabled == other.m_fEnabled &&
    47                m_strName == other.m_strName &&
    48                m_strNewName == other.m_strNewName &&
    49                m_strCIDR == other.m_strCIDR &&
    50                m_fSupportsDHCP == other.m_fSupportsDHCP &&
    51                m_fSupportsIPv6 == other.m_fSupportsIPv6 &&
    52                m_fAdvertiseDefaultIPv6Route == other.m_fAdvertiseDefaultIPv6Route &&
    53                m_ipv4rules == other.m_ipv4rules &&
    54                m_ipv6rules == other.m_ipv6rules;
    55     }
    56 };
    57 
    58 
    59 /* Global settings / Network page / Host interface data: */
     56        return true
     57               && (m_fEnabled == other.m_fEnabled)
     58               && (m_strName == other.m_strName)
     59               && (m_strNewName == other.m_strNewName)
     60               && (m_strCIDR == other.m_strCIDR)
     61               && (m_fSupportsDHCP == other.m_fSupportsDHCP)
     62               && (m_fSupportsIPv6 == other.m_fSupportsIPv6)
     63               && (m_fAdvertiseDefaultIPv6Route == other.m_fAdvertiseDefaultIPv6Route)
     64               && (m_ipv4rules == other.m_ipv4rules)
     65               && (m_ipv6rules == other.m_ipv6rules)
     66               ;
     67    }
     68};
     69
     70
     71/** Global settings: Network page: Host interface cache structure. */
    6072struct UIDataSettingsGlobalNetworkHostInterface
    6173{
    62     /* Host Interface: */
     74    /** Holds host interface name. */
    6375    QString m_strName;
     76    /** Holds whether DHCP client enabled. */
    6477    bool m_fDhcpClientEnabled;
     78    /** Holds IPv4 interface address. */
    6579    QString m_strInterfaceAddress;
     80    /** Holds IPv4 interface mask. */
    6681    QString m_strInterfaceMask;
     82    /** Holds whether IPv6 protocol supported. */
    6783    bool m_fIpv6Supported;
     84    /** Holds IPv6 interface address. */
    6885    QString m_strInterfaceAddress6;
     86    /** Holds IPv6 interface mask length. */
    6987    QString m_strInterfaceMaskLength6;
     88
     89    /** Returns whether the @a other passed data is equal to this one. */
    7090    bool operator==(const UIDataSettingsGlobalNetworkHostInterface &other) const
    7191    {
    72         return m_strName == other.m_strName &&
    73                m_fDhcpClientEnabled == other.m_fDhcpClientEnabled &&
    74                m_strInterfaceAddress == other.m_strInterfaceAddress &&
    75                m_strInterfaceMask == other.m_strInterfaceMask &&
    76                m_fIpv6Supported == other.m_fIpv6Supported &&
    77                m_strInterfaceAddress6 == other.m_strInterfaceAddress6 &&
    78                m_strInterfaceMaskLength6 == other.m_strInterfaceMaskLength6;
    79     }
    80 };
    81 
    82 /* Global settings / Network page / Host DHCP server data: */
     92        return true
     93               && (m_strName == other.m_strName)
     94               && (m_fDhcpClientEnabled == other.m_fDhcpClientEnabled)
     95               && (m_strInterfaceAddress == other.m_strInterfaceAddress)
     96               && (m_strInterfaceMask == other.m_strInterfaceMask)
     97               && (m_fIpv6Supported == other.m_fIpv6Supported)
     98               && (m_strInterfaceAddress6 == other.m_strInterfaceAddress6)
     99               && (m_strInterfaceMaskLength6 == other.m_strInterfaceMaskLength6)
     100               ;
     101    }
     102};
     103
     104
     105/** Global settings: Network page: DHCP server cache structure. */
    83106struct UIDataSettingsGlobalNetworkDHCPServer
    84107{
    85     /* DHCP Server: */
     108    /** Holds whether DHCP server enabled. */
    86109    bool m_fDhcpServerEnabled;
     110    /** Holds DHCP server address. */
    87111    QString m_strDhcpServerAddress;
     112    /** Holds DHCP server mask. */
    88113    QString m_strDhcpServerMask;
     114    /** Holds DHCP server lower address. */
    89115    QString m_strDhcpLowerAddress;
     116    /** Holds DHCP server upper address. */
    90117    QString m_strDhcpUpperAddress;
     118
     119    /** Returns whether the @a other passed data is equal to this one. */
    91120    bool operator==(const UIDataSettingsGlobalNetworkDHCPServer &other) const
    92121    {
    93         return m_fDhcpServerEnabled == other.m_fDhcpServerEnabled &&
    94                m_strDhcpServerAddress == other.m_strDhcpServerAddress &&
    95                m_strDhcpServerMask == other.m_strDhcpServerMask &&
    96                m_strDhcpLowerAddress == other.m_strDhcpLowerAddress &&
    97                m_strDhcpUpperAddress == other.m_strDhcpUpperAddress;
    98     }
    99 };
    100 
    101 /* Global settings / Network page / Host network data: */
     122        return true
     123               && (m_fDhcpServerEnabled == other.m_fDhcpServerEnabled)
     124               && (m_strDhcpServerAddress == other.m_strDhcpServerAddress)
     125               && (m_strDhcpServerMask == other.m_strDhcpServerMask)
     126               && (m_strDhcpLowerAddress == other.m_strDhcpLowerAddress)
     127               && (m_strDhcpUpperAddress == other.m_strDhcpUpperAddress)
     128               ;
     129    }
     130};
     131
     132
     133/** Global settings: Network page: Host network cache structure. */
    102134struct UIDataSettingsGlobalNetworkHost
    103135{
     136    /** Holds the host interface data. */
    104137    UIDataSettingsGlobalNetworkHostInterface m_interface;
     138    /** Holds the DHCP server data. */
    105139    UIDataSettingsGlobalNetworkDHCPServer m_dhcpserver;
     140
     141    /** Returns whether the @a other passed data is equal to this one. */
    106142    bool operator==(const UIDataSettingsGlobalNetworkHost &other) const
    107143    {
    108         return m_interface == other.m_interface &&
    109                m_dhcpserver == other.m_dhcpserver;
    110     }
    111 };
    112 
    113 
    114 /* Global settings / Network page / Global network cache: */
     144        return true
     145               && (m_interface == other.m_interface)
     146               && (m_dhcpserver == other.m_dhcpserver)
     147               ;
     148    }
     149};
     150
     151
     152/** Global settings: Network page cache structure. */
    115153struct UISettingsCacheGlobalNetwork
    116154{
     155    /** Holds the NAT network data. */
    117156    QList<UIDataSettingsGlobalNetworkNAT> m_networksNAT;
     157    /** Holds the host network data. */
    118158    QList<UIDataSettingsGlobalNetworkHost> m_networksHost;
    119159};
    120160
    121161
    122 /* Global settings / Network page: */
     162/** Global settings: Network page. */
    123163class UIGlobalSettingsNetwork : public UISettingsPageGlobal, public Ui::UIGlobalSettingsNetwork
    124164{
     
    211251};
    212252
    213 #endif // __UIGlobalSettingsNetwork_h__
     253#endif /* !___UIGlobalSettingsNetwork_h___ */
     254
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.cpp

    r62493 r65678  
    55
    66/*
    7  * Copyright (C) 2011-2016 Oracle Corporation
     7 * Copyright (C) 2011-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
    2121
    22 /* Global includes */
     22/* Qt includes: */
    2323# include <QRegExpValidator>
    2424
    25 /* Local includes */
     25/* GUI includes: */
    2626# include "QIWidgetValidator.h"
    2727# include "UIGlobalSettingsProxy.h"
     
    3131
    3232
    33 /* General page constructor: */
    3433UIGlobalSettingsProxy::UIGlobalSettingsProxy()
    3534{
     
    5554}
    5655
    57 /* Load data to cache from corresponding external object(s),
    58  * this task COULD be performed in other than GUI thread: */
    5956void UIGlobalSettingsProxy::loadToCacheFrom(QVariant &data)
    6057{
     
    7269}
    7370
    74 /* Load data to corresponding widgets from cache,
    75  * this task SHOULD be performed in GUI thread only: */
    7671void UIGlobalSettingsProxy::getFromCache()
    7772{
     
    9186}
    9287
    93 /* Save data from corresponding widgets to cache,
    94  * this task SHOULD be performed in GUI thread only: */
    9588void UIGlobalSettingsProxy::putToCache()
    9689{
     
    10396}
    10497
    105 /* Save data from cache to corresponding external object(s),
    106  * this task COULD be performed in other than GUI thread: */
    10798void UIGlobalSettingsProxy::saveFromCacheTo(QVariant &data)
    10899{
     
    110101    UISettingsPageGlobal::fetchData(data);
    111102
     103    /* Save from cache: */
    112104    UIProxyManager proxyManager;
    113105    proxyManager.setProxyState(m_cache.m_enmProxyState);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.h

    r62493 r65678  
    55
    66/*
    7  * Copyright (C) 2011-2016 Oracle Corporation
     7 * Copyright (C) 2011-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIGlobalSettingsProxy_h__
    19 #define __UIGlobalSettingsProxy_h__
     18#ifndef ___UIGlobalSettingsProxy_h___
     19#define ___UIGlobalSettingsProxy_h___
    2020
    21 /* Local includes */
    22 #include "VBoxUtils.h"
     21/* GUI includes: */
    2322#include "UISettingsPage.h"
    2423#include "UIGlobalSettingsProxy.gen.h"
     24#include "VBoxUtils.h"
    2525
    26 /* Global settings / Proxy page / Cache: */
     26
     27/** Global settings: Proxy page cache structure. */
    2728struct UISettingsCacheGlobalProxy
    2829{
     30    /** Constructs data. */
    2931    UISettingsCacheGlobalProxy()
    3032        : m_enmProxyState(UIProxyManager::ProxyState_Auto)
     33        , m_strProxyHost(QString())
     34        , m_strProxyPort(QString())
    3135    {}
     36
     37    /** Holds the proxy state. */
    3238    UIProxyManager::ProxyState m_enmProxyState;
     39    /** Holds the proxy host. */
    3340    QString m_strProxyHost;
     41    /** Holds the proxy port. */
    3442    QString m_strProxyPort;
    3543};
    3644
    37 /* Global settings / Proxy page: */
     45
     46/** Global settings: Proxy page. */
    3847class UIGlobalSettingsProxy : public UISettingsPageGlobal, public Ui::UIGlobalSettingsProxy
    3948{
     
    8190};
    8291
    83 #endif // __UIGlobalSettingsProxy_h__
     92#endif /* !___UIGlobalSettingsProxy_h___ */
    8493
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.cpp

    r62493 r65678  
    55
    66/*
    7  * Copyright (C) 2006-2016 Oracle Corporation
     7 * Copyright (C) 2006-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4646}
    4747
    48 /* Load data to cache from corresponding external object(s),
    49  * this task COULD be performed in other than GUI thread: */
    5048void UIGlobalSettingsUpdate::loadToCacheFrom(QVariant &data)
    5149{
     
    5351    UISettingsPageGlobal::fetchData(data);
    5452
    55     /* Fill internal variables with corresponding values: */
     53    /* Load to cache: */
    5654    VBoxUpdateData updateData(gEDataManager->applicationUpdateData());
    5755    m_cache.m_fCheckEnabled = !updateData.isNoNeedToCheck();
     
    6462}
    6563
    66 /* Load data to corresponding widgets from cache,
    67  * this task SHOULD be performed in GUI thread only: */
    6864void UIGlobalSettingsUpdate::getFromCache()
    6965{
    70     /* Apply internal variables data to QWidget(s): */
     66    /* Fetch from cache: */
    7167    m_pCheckBoxUpdate->setChecked(m_cache.m_fCheckEnabled);
    7268    if (m_pCheckBoxUpdate->isChecked())
     
    8783}
    8884
    89 /* Save data from corresponding widgets to cache,
    90  * this task SHOULD be performed in GUI thread only: */
    9185void UIGlobalSettingsUpdate::putToCache()
    9286{
    93     /* Gather internal variables data from QWidget(s): */
     87    /* Upload to cache: */
    9488    m_cache.m_periodIndex = periodType();
    9589    m_cache.m_branchIndex = branchType();
    9690}
    9791
    98 /* Save data from cache to corresponding external object(s),
    99  * this task COULD be performed in other than GUI thread: */
    10092void UIGlobalSettingsUpdate::saveFromCacheTo(QVariant &data)
    10193{
     
    10799    UISettingsPageGlobal::fetchData(data);
    108100
    109     /* Gather corresponding values from internal variables: */
     101    /* Save from cache: */
    110102    VBoxUpdateData newData(m_cache.m_periodIndex, m_cache.m_branchIndex);
    111103    gEDataManager->setApplicationUpdateData(newData.data());
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.h

    r62493 r65678  
    55
    66/*
    7  * Copyright (C) 2006-2016 Oracle Corporation
     7 * Copyright (C) 2006-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIGlobalSettingsUpdate_h__
    19 #define __UIGlobalSettingsUpdate_h__
     18#ifndef ___UIGlobalSettingsUpdate_h___
     19#define ___UIGlobalSettingsUpdate_h___
    2020
    2121/* GUI includes: */
     
    2424#include "UIUpdateDefs.h"
    2525
    26 /* Global settings / Update page / Cache: */
     26
     27/** Global settings: Update page cache structure. */
    2728struct UISettingsCacheGlobalUpdate
    2829{
     30    /** Holds whether the update check is enabled. */
    2931    bool m_fCheckEnabled;
     32    /** Holds the update check period. */
    3033    VBoxUpdateData::PeriodType m_periodIndex;
     34    /** Holds the update branch type. */
    3135    VBoxUpdateData::BranchType m_branchIndex;
     36    /** Holds the next update date. */
    3237    QString m_strDate;
    3338};
    3439
    35 /* Global settings / Update page: */
     40
     41/** Global settings: Update page. */
    3642class UIGlobalSettingsUpdate : public UISettingsPageGlobal, public Ui::UIGlobalSettingsUpdate
    3743{
     
    8692};
    8793
    88 #endif // __UIGlobalSettingsUpdate_h__
     94#endif /* !___UIGlobalSettingsUpdate_h___ */
     95
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette