VirtualBox

Changeset 94757 in vbox for trunk/src


Ignore:
Timestamp:
Apr 29, 2022 9:40:45 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151139
Message:

FE/Qt/Ds: bugref:10205: Reworking settings page interface to hold IHost wrapper providing required IUpdateAgent facility.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r93901 r94757  
    692692          UIErrorString::formatErrorInfo(machine));
    693693    return false;
     694}
     695
     696void UIMessageCenter::cannotSetHostSettings(const CHost &comHost, QWidget *pParent /* = 0 */) const
     697{
     698    error(pParent, MessageType_Critical,
     699          tr("Failed to set global host settings."),
     700          UIErrorString::formatErrorInfo(comHost));
    694701}
    695702
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r93901 r94757  
    283283                                 bool fMount, bool fRetry, QWidget *pParent = 0) const;
    284284
     285        void cannotSetHostSettings(const CHost &comHost, QWidget *pParent = 0) const;
    285286        void cannotSetSystemProperties(const CSystemProperties &properties, QWidget *pParent = 0) const;
    286287        void cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent = 0) const;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r93115 r94757  
    124124void UISettingsDialogGlobal::loadOwnData()
    125125{
    126     /* Get properties: */
     126    /* Get host & properties: */
     127    CHost comHost = uiCommon().host();
    127128    CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties();
    128129    /* Prepare global data: */
    129130    qRegisterMetaType<UISettingsDataGlobal>();
    130     UISettingsDataGlobal data(comProperties);
     131    UISettingsDataGlobal data(comHost, comProperties);
    131132    QVariant varData = QVariant::fromValue(data);
    132133
     
    137138void UISettingsDialogGlobal::saveOwnData()
    138139{
    139     /* Get properties: */
     140    /* Get host & properties: */
     141    CHost comHost = uiCommon().host();
    140142    CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties();
    141143    /* Prepare global data: */
    142144    qRegisterMetaType<UISettingsDataGlobal>();
    143     UISettingsDataGlobal data(comProperties);
     145    UISettingsDataGlobal data(comHost, comProperties);
    144146    QVariant varData = QVariant::fromValue(data);
    145147
    146148    /* Call to base-class: */
    147149    UISettingsDialog::saveData(varData);
     150
     151    /* Get updated host: */
     152    CHost comNewHost = varData.value<UISettingsDataGlobal>().m_host;
     153    /* If host is not OK => show the error: */
     154    if (!comNewHost.isOk())
     155        msgCenter().cannotSetHostSettings(comNewHost, this);
    148156
    149157    /* Get updated properties: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp

    r93115 r94757  
    9595void UISettingsPageGlobal::fetchData(const QVariant &data)
    9696{
    97     /* Fetch data to m_properties: */
     97    /* Fetch data to m_host & m_properties: */
     98    m_host = data.value<UISettingsDataGlobal>().m_host;
    9899    m_properties = data.value<UISettingsDataGlobal>().m_properties;
    99100}
     
    101102void UISettingsPageGlobal::uploadData(QVariant &data) const
    102103{
    103     /* Upload m_properties to data: */
    104     data = QVariant::fromValue(UISettingsDataGlobal(m_properties));
     104    /* Upload m_host & m_properties to data: */
     105    data = QVariant::fromValue(UISettingsDataGlobal(m_host, m_properties));
    105106}
    106107
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h

    r93990 r94757  
    3434#include "COMEnums.h"
    3535#include "CConsole.h"
     36#include "CHost.h"
    3637#include "CMachine.h"
    3738#include "CSystemProperties.h"
     
    5354    /** Constructs NULL global settings data struct. */
    5455    UISettingsDataGlobal() {}
    55     /** Constructs global settings data struct on the basis of @a comProperties. */
    56     UISettingsDataGlobal(const CSystemProperties &comProperties)
    57         : m_properties(comProperties) {}
    58     /** Holds the global VirtualBox properties. */
    59     CSystemProperties m_properties;
     56    /** Constructs global settings data struct on the basis of @a comHost and @a comProperties. */
     57    UISettingsDataGlobal(const CHost &comHost, const CSystemProperties &comProperties)
     58        : m_host(comHost), m_properties(comProperties) {}
     59    /** Holds the host reference. */
     60    CHost              m_host;
     61    /** Holds the properties reference. */
     62    CSystemProperties  m_properties;
    6063};
    6164Q_DECLARE_METATYPE(UISettingsDataGlobal);
     
    7174        : m_machine(comMachine), m_console(comConsole) {}
    7275    /** Holds the machine reference. */
    73     CMachine m_machine;
     76    CMachine  m_machine;
    7477    /** Holds the console reference. */
    75     CConsole m_console;
     78    CConsole  m_console;
    7679};
    7780Q_DECLARE_METATYPE(UISettingsDataMachine);
     
    234237    void uploadData(QVariant &data) const;
    235238
     239    /** Holds the source of host preferences. */
     240    CHost              m_host;
    236241    /** Holds the source of global preferences. */
    237     CSystemProperties m_properties;
     242    CSystemProperties  m_properties;
    238243};
    239244
     
    264269
    265270    /** Holds the source of machine settings. */
    266     CMachine m_machine;
     271    CMachine  m_machine;
    267272    /** Holds the source of console settings. */
    268     CConsole m_console;
     273    CConsole  m_console;
    269274};
    270275
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