VirtualBox

Changeset 83993 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 27, 2020 10:42:16 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137560
Message:

FE/Qt: bugref:9653: Move some of cloud VM settings dialog stuff to common UICloudNetworkingStuff namespace.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/machinesettings/UICloudMachineSettingsDialog.cpp

    r83963 r83993  
    2525#include "UICloudMachineSettingsDialog.h"
    2626#include "UICloudMachineSettingsDialogPage.h"
     27#include "UICloudNetworkingStuff.h"
    2728
    2829/* COM includes: */
     
    5051void UICloudMachineSettingsDialog::accept()
    5152{
    52     /** Makes sure page data committed: */
     53    /* Makes sure page data committed: */
    5354    if (m_pPage)
    5455        m_pPage->makeSureDataCommitted();
     
    8889{
    8990    /* Update name: */
    90     m_strName = m_comCloudMachine.GetName();
    91     if (!m_comCloudMachine.isOk())
    92     {
    93         msgCenter().cannotAcquireCloudMachineParameter(m_comCloudMachine, this);
     91    if (!cloudMachineName(m_comCloudMachine, m_strName, this))
    9492        reject();
    95     }
    9693
    9794    /* Retranslate title: */
     
    9996
    10097    /* Update form: */
    101     CForm comForm;
    102     CProgress comProgress = m_comCloudMachine.GetSettingsForm(comForm);
    103     if (!m_comCloudMachine.isOk())
    104     {
    105         msgCenter().cannotAcquireCloudMachineParameter(m_comCloudMachine, this);
     98    if (!cloudMachineSettingsForm(m_comCloudMachine, m_comForm, this))
    10699        reject();
    107     }
    108     msgCenter().showModalProgressDialog(comProgress,
    109                                         m_strName,
    110                                         ":/progress_settings_90px.png", this, 0);
    111     if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    112     {
    113         msgCenter().cannotAcquireCloudClientParameter(comProgress, this);
    114         reject();
    115     }
    116     m_comForm = comForm;
    117100
    118101    /* Assign page with form: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp

    r83992 r83993  
    2424/* COM includes: */
    2525#include "CAppliance.h"
     26#include "CForm.h"
    2627#include "CProgress.h"
    2728#include "CStringArray.h"
     
    201202    }
    202203    enmResult = enmState;
     204    return true;
     205}
     206
     207bool UICloudNetworkingStuff::cloudMachineSettingsForm(CCloudMachine &comCloudMachine,
     208                                                      CForm &comResult,
     209                                                      QWidget *pParent /* = 0 */)
     210{
     211    /* Acquire machine name first: */
     212    QString strMachineName;
     213    if (!cloudMachineName(comCloudMachine, strMachineName))
     214        return false;
     215
     216    /* Prepare settings form: */
     217    CForm comForm;
     218
     219    /* Now execute GetSettingsForm async method: */
     220    CProgress comProgress = comCloudMachine.GetSettingsForm(comForm);
     221    if (!comCloudMachine.isOk())
     222    {
     223        msgCenter().cannotAcquireCloudMachineParameter(comCloudMachine, pParent);
     224        return false;
     225    }
     226
     227    /* Show "Get settings form" progress: */
     228    msgCenter().showModalProgressDialog(comProgress,
     229                                        strMachineName,
     230                                        ":/progress_settings_90px.png", pParent, 0);
     231    if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
     232    {
     233        msgCenter().cannotAcquireCloudClientParameter(comProgress, pParent);
     234        return false;
     235    }
     236
     237    /* Return result: */
     238    comResult = comForm;
    203239    return true;
    204240}
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h

    r83992 r83993  
    7575                                                KMachineState &enmResult,
    7676                                                QWidget *pParent = 0);
     77
     78    /** Acquires @a comCloudMachine settings form as a @a comResult, using @a pParent to show messages according to.
     79      * @note  Be aware, this is a blocking function, corresponding progress dialog will be executed. */
     80    SHARED_LIBRARY_STUFF bool cloudMachineSettingsForm(CCloudMachine &comCloudMachine,
     81                                                       CForm &comResult,
     82                                                       QWidget *pParent = 0);
    7783
    7884    /** Acquires instance map.
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