/* $Id$ */
/** @file
* VBox Qt GUI - UIWizardExportApp class implementation.
*/
/*
* Copyright (C) 2009-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
# include <precomp.h>
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
# include <QVariant>
# include <QFileInfo>
/* GUI includes: */
# include "UIWizardExportApp.h"
# include "UIWizardExportAppDefs.h"
# include "UIWizardExportAppPageBasic1.h"
# include "UIWizardExportAppPageBasic2.h"
# include "UIWizardExportAppPageBasic3.h"
# include "UIWizardExportAppPageBasic4.h"
# include "UIWizardExportAppPageExpert.h"
# include "UIMessageCenter.h"
/* COM includes: */
# include "CAppliance.h"
#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
#include "CVFSExplorer.h"
{
#ifndef Q_WS_MAC
/* Assign watermark: */
assignWatermark(":/vmw_ovf_export.png");
#else /* Q_WS_MAC */
/* Assign background image: */
assignBackground(":/vmw_ovf_export_bg.png");
#endif /* Q_WS_MAC */
}
{
/* Get export appliance widget: */
UIApplianceExportEditorWidget *pExportApplianceWidget = field("applianceWidget").value<ExportAppliancePointer>();
/* Fetch all settings from the appliance editor. */
/* Get the appliance. */
/* We need to know every filename which will be created, so that we can
* ask the user for confirmation of overwriting. For that we iterating
* over all virtual systems & fetch all descriptions of the type
* HardDiskImage. Also add the manifest file to the check. In the ova
* case only the target file itself get checked. */
{
{
}
}
if (fResult)
{
/* Show some progress, so the user know whats going on: */
msgCenter().showModalProgressDialog(progress, QApplication::translate("UIWizardExportApp", "Checking files ..."),
":/progress_refresh_90px.png", this);
if (progress.GetCanceled())
return false;
{
return false;
}
}
/* Check if the file exists already, if yes get confirmation for overwriting from the user. */
return false;
/* Ok all is confirmed so delete all the files which exists: */
{
if (fResult)
{
/* Show some progress, so the user know whats going on: */
msgCenter().showModalProgressDialog(progress1, QApplication::translate("UIWizardExportApp", "Removing files ..."),
":/progress_delete_90px.png", this);
if (progress1.GetCanceled())
return false;
{
return false;
}
}
}
/* Export the VMs, on success we are finished: */
return exportVMs(*pAppliance);
}
{
/* Write the appliance: */
if (fResult)
{
/* Show some progress, so the user know whats going on: */
msgCenter().showModalProgressDialog(progress, QApplication::translate("UIWizardExportApp", "Exporting Appliance ..."),
":/progress_export_90px.png", this);
if (progress.GetCanceled())
return false;
{
return false;
}
else
return true;
}
if (!fResult)
return false;
}
{
if (!fWithFile)
{
}
switch (type)
{
case Filesystem:
{
return path;
}
case SunCloud:
{
uri = QString("%1%2/%3/%4").arg(uri).arg("object.storage.network.com").arg(field("bucket").toString()).arg(path);
return uri;
}
case S3:
{
uri = QString("%1%2/%3/%4").arg(uri).arg(field("hostname").toString()).arg(field("bucket").toString()).arg(path);
return uri;
}
}
return QString();
}
{
/* Call to base-class: */
/* Enable 2nd button (Reset to Defaults) for 4th and Expert pages only! */
}
{
/* Call to base-class: */
/* Handle 2nd button: */
if (iId == CustomButton2)
{
/* Get appliance widget: */
/* Reset it to default: */
}
}
{
/* Call to base-class: */
/* Translate wizard: */
}
{
/* Create corresponding pages: */
switch (mode())
{
case WizardMode_Basic:
{
break;
}
case WizardMode_Expert:
{
break;
}
default:
{
break;
}
}
/* Call to base-class: */
}