VirtualBox

Changeset 91262 in vbox


Ignore:
Timestamp:
Sep 15, 2021 7:24:39 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996: Export Appliance wizard: Get rid of UIWizardExportAppDefs.h; Moving UIApplianceExportEditorWidget include directly to required place; This also means no more applianceWidget field blinking around, new localAppliance field is used instead of it for consistency with cloud stuff.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp

    r91261 r91262  
    2727#include "UINotificationCenter.h"
    2828#include "UIWizardExportApp.h"
    29 #include "UIWizardExportAppDefs.h"
    3029#include "UIWizardExportAppPageBasic1.h"
    3130#include "UIWizardExportAppPageBasic2.h"
     
    7271    else
    7372    {
    74         /* Get export appliance widget & fetch all settings from the appliance editor: */
    75         UIApplianceExportEditorWidget *pExportApplianceWidget = field("applianceWidget").value<ExportAppliancePointer>();
    76         AssertPtrReturn(pExportApplianceWidget, false);
    77         pExportApplianceWidget->prepareExport();
    78 
    79         /* Acquire the appliance: */
    80         CAppliance *pComAppliance = pExportApplianceWidget->appliance();
    81         AssertPtrReturn(pComAppliance, false);
     73        /* Get appliance: */
     74        CAppliance comAppliance = field("localAppliance").value<CAppliance>();
     75        AssertReturn(comAppliance.isNotNull(), false);
    8276
    8377        /* We need to know every filename which will be created, so that we can ask the user for confirmation of overwriting.
     
    10094
    10195            /* Add all hard disk images: */
    102             CVirtualSystemDescriptionVector vsds = pComAppliance->GetVirtualSystemDescriptions();
     96            CVirtualSystemDescriptionVector vsds = comAppliance.GetVirtualSystemDescriptions();
    10397            for (int i = 0; i < vsds.size(); ++i)
    10498            {
     
    113107
    114108        /* Initialize VFS explorer: */
    115         CVFSExplorer comExplorer = pComAppliance->CreateVFSExplorer(uri(false /* fWithFile */));
     109        CVFSExplorer comExplorer = comAppliance.CreateVFSExplorer(uri(false /* fWithFile */));
    116110        if (comExplorer.isNotNull())
    117111        {
     
    130124        }
    131125        else
    132             return msgCenter().cannotCheckFiles(*pComAppliance, this);
     126            return msgCenter().cannotCheckFiles(comAppliance, this);
    133127
    134128        /* Confirm overwriting for existing files: */
     
    155149
    156150        /* Export the VMs, on success we are finished: */
    157         return exportVMs(*pComAppliance);
     151        return exportVMs(comAppliance);
    158152    }
    159153}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp

    r91261 r91262  
    4040#include "UIVirtualBoxManager.h"
    4141#include "UIWizardExportApp.h"
    42 #include "UIWizardExportAppDefs.h"
    4342#include "UIWizardExportAppPageBasic2.h"
    4443
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp

    r91259 r91262  
    2323#include "QILabelSeparator.h"
    2424#include "QIRichTextLabel.h"
     25#include "UIApplianceExportEditorWidget.h"
    2526#include "UICommon.h"
    2627#include "UIMessageCenter.h"
     
    2930
    3031/* COM includes: */
    31 #include "CAppliance.h"
    3232#include "CMachine.h"
    3333#include "CVirtualSystemDescriptionForm.h"
     
    4040UIWizardExportAppPage3::UIWizardExportAppPage3()
    4141    : m_pSettingsCntLayout(0)
     42    , m_pApplianceWidget(0)
    4243{
    4344}
     
    9899}
    99100
     101CAppliance UIWizardExportAppPage3::localAppliance() const
     102{
     103    CAppliance *pAppliance = m_pApplianceWidget->appliance();
     104    return pAppliance ? *pAppliance : CAppliance();
     105}
     106
    100107
    101108/*********************************************************************************************************************************
     
    174181    }
    175182
    176     /* Register classes: */
    177     qRegisterMetaType<ExportAppliancePointer>();
    178 
    179183    /* Register fields: */
    180     registerField("applianceWidget", this, "applianceWidget");
     184    registerField("localAppliance", this, "localAppliance");
    181185}
    182186
     
    247251        }
    248252    }
     253    /* Otherwise if there was local target selected: */
     254    else
     255    {
     256        /* Prepare export: */
     257        m_pApplianceWidget->prepareExport();
     258    }
    249259
    250260    /* Try to export appliance: */
     
    287297    {
    288298        /* Reset widget to default: */
    289         AssertPtrReturnVoid(m_pApplianceWidget.data());
    290299        m_pApplianceWidget->restoreDefaults();
    291300    }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h

    r91259 r91262  
    2929#include "UIExtraDataDefs.h"
    3030#include "UIFormEditorWidget.h"
    31 #include "UIWizardExportAppDefs.h"
    3231#include "UIWizardPage.h"
     32
     33/* COM includes: */
     34#include "CAppliance.h"
    3335
    3436/* Forward declarations: */
    3537class QStackedLayout;
    3638class QIRichTextLabel;
     39class UIApplianceExportEditorWidget;
    3740class UIWizardExportApp;
    3841
     
    5457    void refreshFormPropertiesTable();
    5558
    56     /** Returns the appliance widget reference. */
    57     ExportAppliancePointer applianceWidget() const { return m_pApplianceWidget; }
     59    /** Returns Local Appliance object. */
     60    CAppliance localAppliance() const;
    5861
    5962    /** Holds the settings container layout instance. */
     
    6164
    6265    /** Holds the appliance widget reference. */
    63     ExportAppliancePointer     m_pApplianceWidget;
     66    UIApplianceExportEditorWidget *m_pApplianceWidget;
    6467    /** Holds the Form Editor widget instance. */
    65     UIFormEditorWidgetPointer  m_pFormEditor;
     68    UIFormEditorWidgetPointer      m_pFormEditor;
    6669};
    6770
     
    7174{
    7275    Q_OBJECT;
    73     Q_PROPERTY(ExportAppliancePointer applianceWidget READ applianceWidget);
     76    Q_PROPERTY(CAppliance localAppliance READ localAppliance);
    7477
    7578public:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp

    r91261 r91262  
    4141#include "UIVirtualBoxManager.h"
    4242#include "UIWizardExportApp.h"
    43 #include "UIWizardExportAppDefs.h"
    4443#include "UIWizardExportAppPageExpert.h"
    4544
     
    423422            this, &UIWizardExportAppPageExpert::sltHandleProfileButtonClick);
    424423
    425     /* Register classes: */
    426     qRegisterMetaType<ExportAppliancePointer>();
    427 
    428424    /* Register fields: */
    429425    registerField("machineNames", this, "machineNames");
     
    441437    registerField("vsdExportForm", this, "vsdExportForm");
    442438    registerField("cloudExportMode", this, "cloudExportMode");
    443     registerField("applianceWidget", this, "applianceWidget");
     439    registerField("localAppliance", this, "localAppliance");
    444440}
    445441
     
    634630        }
    635631    }
     632    /* Otherwise if there was local target selected: */
     633    else
     634    {
     635        /* Prepare export: */
     636        m_pApplianceWidget->prepareExport();
     637    }
    636638
    637639    /* Try to export appliance: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h

    r91261 r91262  
    5151    Q_PROPERTY(CVirtualSystemDescriptionForm vsdExportForm READ vsdExportForm);
    5252    Q_PROPERTY(CloudExportMode cloudExportMode READ cloudExportMode);
    53     Q_PROPERTY(ExportAppliancePointer applianceWidget READ applianceWidget);
     53    Q_PROPERTY(CAppliance localAppliance READ localAppliance);
    5454
    5555public:
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