VirtualBox

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


Ignore:
Timestamp:
Apr 27, 2020 12:08:33 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137571
Message:

FE/Qt: bugref:9653: Move more 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

    r83993 r84004  
    5757    /* Apply form: */
    5858    AssertReturnVoid(m_comForm.isNotNull());
    59     CProgress comProgress = m_comForm.Apply();
    60     if (!m_comForm.isOk())
    61     {
    62         msgCenter().cannotApplyCloudMachineFormSettings(m_comForm, m_strName, this);
     59    if (!applyCloudMachineSettingsForm(m_comCloudMachine, m_comForm, this))
    6360        return;
    64     }
    65     msgCenter().showModalProgressDialog(comProgress,
    66                                         m_strName,
    67                                         ":/progress_settings_90px.png", this, 0);
    68     if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    69     {
    70         msgCenter().cannotApplyCloudMachineFormSettings(comProgress, m_strName, this);
    71         return;
    72     }
    7361
    7462    /* Call to base-class: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp

    r83993 r84004  
    237237    /* Return result: */
    238238    comResult = comForm;
     239    return true;
     240}
     241
     242bool UICloudNetworkingStuff::applyCloudMachineSettingsForm(CCloudMachine &comCloudMachine,
     243                                                           CForm &comForm,
     244                                                           QWidget *pParent /* = 0 */)
     245{
     246    /* Acquire machine name first: */
     247    QString strMachineName;
     248    if (!cloudMachineName(comCloudMachine, strMachineName))
     249        return false;
     250
     251    /* Now execute Apply async method: */
     252    CProgress comProgress = comForm.Apply();
     253    if (!comForm.isOk())
     254    {
     255        msgCenter().cannotApplyCloudMachineFormSettings(comForm, strMachineName, pParent);
     256        return false;
     257    }
     258
     259    /* Show "Apply" progress: */
     260    msgCenter().showModalProgressDialog(comProgress,
     261                                        strMachineName,
     262                                        ":/progress_settings_90px.png", pParent, 0);
     263    if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
     264    {
     265        msgCenter().cannotApplyCloudMachineFormSettings(comProgress, strMachineName, pParent);
     266        return false;
     267    }
     268
     269    /* Return result: */
    239270    return true;
    240271}
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h

    r83993 r84004  
    8282                                                       QWidget *pParent = 0);
    8383
     84    /** Applies @a comCloudMachine @a comForm settings, using @a pParent to show messages according to.
     85      * @note  Be aware, this is a blocking function, corresponding progress dialog will be executed. */
     86    SHARED_LIBRARY_STUFF bool applyCloudMachineSettingsForm(CCloudMachine &comCloudMachine,
     87                                                            CForm &comForm,
     88                                                            QWidget *pParent = 0);
     89
    8490    /** Acquires instance map.
    8591      * @param  comCloudClient   Brings cloud client object.
Note: See TracChangeset for help on using the changeset viewer.

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