Index: trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 17449)
+++ trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 17450)
@@ -288,5 +288,6 @@
 	include/VBoxSettingsSelector.h \
 	include/VBoxImportApplianceWgt.h \
-	include/VBoxImportApplianceWzd.h
+	include/VBoxImportApplianceWzd.h \
+	include/VBoxExportApplianceWzd.h
 
 # Sources containing local definitions of classes that use the Q_OBJECT macro.
@@ -367,5 +368,6 @@
 	src/VBoxMedium.cpp \
 	src/VBoxImportApplianceWgt.cpp \
-	src/VBoxImportApplianceWzd.cpp
+	src/VBoxImportApplianceWzd.cpp \
+	src/VBoxExportApplianceWzd.cpp
 
 ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
Index: trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro	(revision 17449)
+++ trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro	(revision 17450)
@@ -57,5 +57,6 @@
     ui/VBoxGLSettingsLanguage.ui \
     ui/VBoxImportApplianceWgt.ui \
-    ui/VBoxImportApplianceWzd.ui
+    ui/VBoxImportApplianceWzd.ui \
+    ui/VBoxExportApplianceWzd.ui
 
 TRANSLATIONS = \
Index: trunk/src/VBox/Frontends/VirtualBox/include/VBoxExportApplianceWzd.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/include/VBoxExportApplianceWzd.h	(revision 17450)
+++ trunk/src/VBox/Frontends/VirtualBox/include/VBoxExportApplianceWzd.h	(revision 17450)
@@ -0,0 +1,64 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * VBoxExportApplianceWzd class declaration
+ */
+
+/*
+ * Copyright (C) 2009 Sun Microsystems, Inc.
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#ifndef __VBoxExportApplianceWzd_h__
+#define __VBoxExportApplianceWzd_h__
+
+#include "VBoxExportApplianceWzd.gen.h"
+#include "QIAbstractWizard.h"
+#include "QIWithRetranslateUI.h"
+
+class QIWidgetValidator;
+
+class VBoxExportApplianceWzd : public QIWithRetranslateUI<QIAbstractWizard>,
+                               public Ui::VBoxExportApplianceWzd
+{
+    Q_OBJECT;
+
+public:
+    VBoxExportApplianceWzd (QWidget* aParent = NULL, const QString& aSelectName = QString::null);
+
+protected:
+    void retranslateUi();
+
+private slots:
+    void revalidate (QIWidgetValidator *aWval);
+    void enableNext (const QIWidgetValidator *aWval);
+
+    void accept();
+
+    void showNextPage();
+    void onPageShow();
+
+private:
+    void addListViewVMItems (const QString& aSelectName);
+    bool exportVMs();
+
+    /* Private member vars */
+    QString mDefaultApplianceName;
+
+    QIWidgetValidator *mWValVMSelector;
+    QIWidgetValidator *mWValFileSelector;
+};
+
+#endif /* __VBoxExportApplianceWzd_h__ */
+
Index: trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h	(revision 17449)
+++ trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h	(revision 17450)
@@ -88,5 +88,5 @@
 class VBoxProblemReporter : public QObject
 {
-    Q_OBJECT
+    Q_OBJECT;
 
 public:
@@ -109,5 +109,5 @@
     static VBoxProblemReporter &instance();
 
-    bool isValid();
+    bool isValid() const;
 
     // helpers
@@ -119,5 +119,5 @@
                  const QString &aText1 = QString::null,
                  const QString &aText2 = QString::null,
-                 const QString &aText3 = QString::null);
+                 const QString &aText3 = QString::null) const;
 
     int message (QWidget *aParent, Type aType, const QString &aMessage,
@@ -126,5 +126,5 @@
                  const QString &aText1 = QString::null,
                  const QString &aText2 = QString::null,
-                 const QString &aText3 = QString::null)
+                 const QString &aText3 = QString::null) const
     {
         return message (aParent, aType, aMessage, QString::null, aAutoConfirmId,
@@ -136,5 +136,5 @@
                        const char *aAutoConfirmId = 0,
                        const QString &aYesText = QString::null,
-                       const QString &aNoText = QString::null)
+                       const QString &aNoText = QString::null) const
     {
         return (message (aParent, aType, aMessage, aDetails, aAutoConfirmId,
@@ -149,5 +149,5 @@
                        const char *aAutoConfirmId,
                        const QString &aYesText = QString::null,
-                       const QString &aNoText = QString::null)
+                       const QString &aNoText = QString::null) const
     {
         return messageYesNo (aParent, aType, aMessage, QString::null,
@@ -159,5 +159,5 @@
                           const char *aAutoConfirmId = 0,
                           const QString &aOkText = QString::null,
-                          const QString &aCancelText = QString::null)
+                          const QString &aCancelText = QString::null) const
     {
         return (message (aParent, aType, aMessage, aDetails, aAutoConfirmId,
@@ -172,5 +172,5 @@
                           const char *aAutoConfirmId,
                           const QString &aOkText = QString::null,
-                          const QString &aCancelText = QString::null)
+                          const QString &aCancelText = QString::null) const
     {
         return messageOkCancel (aParent, aType, aMessage, QString::null,
@@ -181,5 +181,5 @@
                                   QWidget *aParent, int aMinDuration = 2000);
 
-    QWidget *mainWindowShown();
+    QWidget *mainWindowShown() const;
 
     // problem handlers
@@ -372,10 +372,15 @@
     void cannotRunInSelectorMode();
 
-    void cannotImportAppliance (CAppliance *aAppliance, QWidget *aParent = NULL);
-    void cannotImportAppliance (const CProgress &aProgress, CAppliance *aAppliance, QWidget *aParent = NULL);
+    void cannotImportAppliance (CAppliance *aAppliance, QWidget *aParent = NULL) const;
+    void cannotImportAppliance (const CProgress &aProgress, CAppliance *aAppliance, QWidget *aParent = NULL) const;
+
+
+    bool askForOverridingAppliance (const QString& path, QWidget *aParent = NULL) const;
+    void cannotExportAppliance (CAppliance *aAppliance, QWidget *aParent = NULL) const;
+    void cannotExportAppliance (const CProgress &aProgress, CAppliance *aAppliance, QWidget *aParent = NULL) const;
 
     void showRuntimeError (const CConsole &console, bool fatal,
                            const QString &errorID,
-                           const QString &errorMsg);
+                           const QString &errorMsg) const;
 
     static QString toAccusative (VBoxDefs::MediaType aType);
Index: trunk/src/VBox/Frontends/VirtualBox/include/VBoxSelectorWnd.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/include/VBoxSelectorWnd.h	(revision 17449)
+++ trunk/src/VBox/Frontends/VirtualBox/include/VBoxSelectorWnd.h	(revision 17450)
@@ -69,4 +69,5 @@
     void fileMediaMgr();
     void fileImportAppliance();
+    void fileExportAppliance();
     void fileSettings();
     void fileExit();
@@ -151,4 +152,5 @@
     QAction *mFileMediaMgrAction;
     QAction *mFileApplianceImportAction;
+    QAction *mFileApplianceExportAction;
     QAction *mFileSettingsAction;
     QAction *mFileExitAction;
Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxExportApplianceWzd.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxExportApplianceWzd.cpp	(revision 17450)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxExportApplianceWzd.cpp	(revision 17450)
@@ -0,0 +1,257 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * VBoxExportAppliance class implementation
+ */
+
+/*
+ * Copyright (C) 2009 Sun Microsystems, Inc.
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#include "VBoxExportApplianceWzd.h"
+#include "VBoxGlobal.h"
+#include "QIWidgetValidator.h"
+#include "VBoxProblemReporter.h"
+
+/* Qt includes */
+#include <QDir>
+
+////////////////////////////////////////////////////////////////////////////////
+// VBoxExportApplianceWzd
+
+VBoxExportApplianceWzd::VBoxExportApplianceWzd (QWidget *aParent /* = NULL */, const QString& aSelectName /* = QString::null */)
+    : QIWithRetranslateUI<QIAbstractWizard> (aParent)
+{
+    /* Apply UI decorations */
+    Ui::VBoxExportApplianceWzd::setupUi (this);
+
+    /* Initialize wizard hdr */
+    initializeWizardHdr();
+
+    /* Configure the VM selector widget */
+    mVMListWidget->setAlternatingRowColors (true);
+    mVMListWidget->setSelectionMode (QAbstractItemView::ExtendedSelection);
+
+    /* Validator for the VM selector page */
+    mWValVMSelector = new QIWidgetValidator (mVMSelectPage, this);
+    connect (mWValVMSelector, SIGNAL (validityChanged (const QIWidgetValidator *)),
+             this, SLOT (enableNext (const QIWidgetValidator *)));
+    connect (mWValVMSelector, SIGNAL (isValidRequested (QIWidgetValidator *)),
+             this, SLOT (revalidate (QIWidgetValidator *)));
+    connect (mVMListWidget, SIGNAL (itemSelectionChanged()),
+             mWValVMSelector, SLOT (revalidate()));
+
+    /* Fill the VM selector list */
+    addListViewVMItems (aSelectName);
+    mWValVMSelector->revalidate();
+
+    /* Configure the file selector */
+    mFileSelector->setMode (VBoxFilePathSelectorWidget::Mode_File);
+    mFileSelector->setResetEnabled (false);
+    mFileSelector->setFileDialogTitle (tr ("Select a file to export into"));
+    mFileSelector->setFileFilters (tr ("Open Virtualization Format (%1)").arg ("*.ovf"));
+#ifdef Q_WS_MAC
+    /* Editable boxes are uncommon on the Mac */
+    mFileSelector->setEditable (false);
+#endif /* Q_WS_MAC */
+
+    /* Validator for the file selector page */
+    mWValFileSelector = new QIWidgetValidator (mFileSelectPage, this);
+    connect (mWValFileSelector, SIGNAL (validityChanged (const QIWidgetValidator *)),
+             this, SLOT (enableNext (const QIWidgetValidator *)));
+    connect (mWValFileSelector, SIGNAL (isValidRequested (QIWidgetValidator *)),
+             this, SLOT (revalidate (QIWidgetValidator *)));
+    connect (mFileSelector, SIGNAL (pathChanged (const QString &)),
+             mWValFileSelector, SLOT (revalidate()));
+
+    mWValFileSelector->revalidate();
+
+    /* Initialize wizard ftr */
+    initializeWizardFtr();
+
+    retranslateUi();
+}
+
+void VBoxExportApplianceWzd::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::VBoxExportApplianceWzd::retranslateUi (this);
+
+    mDefaultApplianceName = tr("Appliance");
+}
+
+void VBoxExportApplianceWzd::revalidate (QIWidgetValidator *aWval)
+{
+    /* Do individual validations for pages */
+    bool valid = aWval->isOtherValid();
+
+    if (aWval == mWValVMSelector)
+        valid = mVMListWidget->selectedItems().size() > 0;
+
+    if (aWval == mWValFileSelector)
+        valid = mFileSelector->path().toLower().endsWith (".ovf");
+
+    aWval->setOtherValid (valid);
+}
+
+void VBoxExportApplianceWzd::enableNext (const QIWidgetValidator *aWval)
+{
+    if (aWval == mWValFileSelector)
+        finishButton()->setEnabled (aWval->isValid());
+    else
+        nextButton (aWval->widget())->setEnabled (aWval->isValid());
+}
+
+void VBoxExportApplianceWzd::accept()
+{
+    /* Check if the file exists already, if yes get confirmation for
+     * overwriting from the user. */
+    QFileInfo fi (mFileSelector->path());
+    if (fi.exists())
+        if (!vboxProblem().askForOverridingAppliance (mFileSelector->path(), this))
+            return;
+    /* Export the VMs, on success we are finished */
+    if (exportVMs())
+        QIAbstractWizard::accept();
+}
+
+void VBoxExportApplianceWzd::showNextPage()
+{
+    /* We propose a filename the first time the second page is displayed */
+    if (sender() == mBtnNext1)
+        if (mFileSelector->path().isEmpty())
+        {
+            /* Set the default filename */
+            QString name = mDefaultApplianceName;
+            /* If it is one VM only, we use the VM name as file name */
+            if (mVMListWidget->selectedItems().size() == 1)
+                name = mVMListWidget->selectedItems().first()->text();
+
+            mFileSelector->setPath (QDir::toNativeSeparators (QString ("%1/%2.ovf").arg (QDir::currentPath())
+                                                                                   .arg (name)));
+            mWValFileSelector->revalidate();
+        }
+
+    QIAbstractWizard::showNextPage();
+}
+
+void VBoxExportApplianceWzd::onPageShow()
+{
+    /* Make sure all is properly translated & composed */
+    retranslateUi();
+
+    QWidget *page = mPageStack->currentWidget();
+
+    if (page == mFileSelectPage)
+        finishButton()->setDefault (true);
+    else
+        nextButton (page)->setDefault (true);
+}
+
+void VBoxExportApplianceWzd::addListViewVMItems (const QString& aSelectName)
+{
+    CVirtualBox vbox = vboxGlobal().virtualBox();
+    CMachineVector vec = vbox.GetMachines2();
+    for (CMachineVector::ConstIterator m = vec.begin();
+         m != vec.end(); ++ m)
+    {
+        QPixmap icon;
+        QString name;
+        QString uuid;
+        bool enabled;
+        if (m->GetAccessible())
+        {
+            icon = vboxGlobal().vmGuestOSTypeIcon (m->GetOSTypeId()).scaled (16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+            name = m->GetName();
+            uuid = m->GetId().toString();
+            enabled = m->GetSessionState() == KSessionState_Closed;
+        }
+        else
+        {
+            QString settingsFile = m->GetSettingsFilePath();
+            QFileInfo fi (settingsFile);
+            name = fi.completeSuffix().toLower() == "xml" ?
+                   fi.completeBaseName() : fi.fileName();
+            icon = QPixmap (":/os_other.png").scaled (16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+            enabled = false;
+        }
+        QListWidgetItem *item = new QListWidgetItem (icon, name, mVMListWidget);
+        item->setData (Qt::UserRole, uuid);
+        if (!enabled)
+            item->setFlags (Qt::NoItemFlags);
+        mVMListWidget->addItem (item);
+    }
+    mVMListWidget->sortItems();
+
+    /* Make sure aSelectName is initial selected in the list */
+    QList<QListWidgetItem *> list = mVMListWidget->findItems (aSelectName, Qt::MatchExactly);
+    if (list.size() > 0)
+        mVMListWidget->setCurrentItem (list.first(), QItemSelectionModel::SelectCurrent);
+}
+
+bool VBoxExportApplianceWzd::exportVMs()
+{
+    CVirtualBox vbox = vboxGlobal().virtualBox();
+    /* Create a appliance object */
+    CAppliance appliance = vbox.CreateAppliance();
+    bool fResult = appliance.isOk();
+    if (fResult)
+    {
+        /* Iterate over all selected items */
+        QList<QListWidgetItem *> list = mVMListWidget->selectedItems();
+        foreach (const QListWidgetItem* item, list)
+        {
+            /* The VM uuid can be fetched by the UserRole */
+            QString uuid = item->data (Qt::UserRole).toString();
+            /* Get the machine with the uuid */
+            CMachine m = vbox.GetMachine (uuid);
+            fResult = m.isOk();
+            if (fResult)
+            {
+                /* Add the export description to our appliance object */
+                m.Export (appliance);
+                fResult = m.isOk();
+                if (!fResult)
+                    break;
+            }
+            else
+                break;
+        }
+        /* Proceed if there where no errors */
+        if (fResult)
+        {
+            /* Write the appliance */
+            CProgress progress = appliance.Write (mFileSelector->path());
+            fResult = appliance.isOk();
+            if (fResult)
+            {
+                /* Show some progress, so the user know whats going on */
+                vboxProblem().showModalProgressDialog (progress, tr ("Exporting Appliance ..."), this);
+                if (!progress.isOk() || progress.GetResultCode() != 0)
+                {
+                    vboxProblem().cannotExportAppliance (progress, &appliance, this);
+                    return false;
+                }
+                else
+                    return true;
+            }
+        }
+    }
+    if (!fResult)
+        vboxProblem().cannotExportAppliance (&appliance, this);
+
+    return false;
+}
+
Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxImportApplianceWzd.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxImportApplianceWzd.cpp	(revision 17449)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxImportApplianceWzd.cpp	(revision 17450)
@@ -83,5 +83,5 @@
 
     if (aWval == mWValFileSelector)
-        valid = mFileSelector->path().endsWith (".ovf") &&
+        valid = mFileSelector->path().toLower().endsWith (".ovf") &&
                 QFileInfo (mFileSelector->path()).exists();
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp	(revision 17449)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp	(revision 17450)
@@ -314,5 +314,5 @@
 }
 
-bool VBoxProblemReporter::isValid()
+bool VBoxProblemReporter::isValid() const
 {
     return qApp != 0;
@@ -377,5 +377,5 @@
                                   const QString &aText1 /* = QString::null */,
                                   const QString &aText2 /* = QString::null */,
-                                  const QString &aText3 /* = QString::null */)
+                                  const QString &aText3 /* = QString::null */) const
 {
     if (aButton1 == 0 && aButton2 == 0 && aButton3 == 0)
@@ -520,5 +520,5 @@
  *  zero if none of them. The selector window takes precedence.
  */
-QWidget *VBoxProblemReporter::mainWindowShown()
+QWidget *VBoxProblemReporter::mainWindowShown() const
 {
     /* It may happen that this method is called during VBoxGlobal
@@ -2115,5 +2115,5 @@
 }
 
-void VBoxProblemReporter::cannotImportAppliance (CAppliance *aAppliance, QWidget *aParent /* = NULL */)
+void VBoxProblemReporter::cannotImportAppliance (CAppliance *aAppliance, QWidget *aParent /* = NULL */) const
 {
     if (aAppliance->isNull())
@@ -2134,5 +2134,5 @@
 }
 
-void VBoxProblemReporter::cannotImportAppliance (const CProgress &aProgress, CAppliance* aAppliance, QWidget *aParent /* = NULL */)
+void VBoxProblemReporter::cannotImportAppliance (const CProgress &aProgress, CAppliance* aAppliance, QWidget *aParent /* = NULL */) const
 {
     AssertWrapperOk (aProgress);
@@ -2144,7 +2144,41 @@
 }
 
+bool VBoxProblemReporter::askForOverridingAppliance (const QString& aPath, QWidget *aParent /* = NULL */) const
+{
+    return messageYesNo (aParent, Question, tr ("The file <b>%1</b> exists already. Are you sure you want override it?").arg (aPath), NULL);
+}
+
+void VBoxProblemReporter::cannotExportAppliance (CAppliance *aAppliance, QWidget *aParent /* = NULL */) const
+{
+    if (aAppliance->isNull())
+    {
+        message (aParent ? aParent : mainWindowShown(),
+                 Error,
+                 tr ("Failed to create an appliance."));
+    }else
+    {
+        /* Preserve the current error info before calling the object again */
+        COMResult res (*aAppliance);
+
+        message (aParent ? aParent : mainWindowShown(),
+                 Error,
+                 tr ("Failed to prepare the export of the appliance <b>%1</b>.").arg (aAppliance->GetPath()),
+                 formatErrorInfo (res));
+    }
+}
+
+void VBoxProblemReporter::cannotExportAppliance (const CProgress &aProgress, CAppliance* aAppliance, QWidget *aParent /* = NULL */) const
+{
+    AssertWrapperOk (aProgress);
+
+    message (aParent ? aParent : mainWindowShown(),
+             Error,
+             tr ("Failed to export appliance <b>%1</b>.").arg (aAppliance->GetPath()),
+             formatErrorInfo (aProgress.GetErrorInfo()));
+}
+
 void VBoxProblemReporter::showRuntimeError (const CConsole &aConsole, bool fatal,
                                             const QString &errorID,
-                                            const QString &errorMsg)
+                                            const QString &errorMsg) const
 {
     /// @todo (r=dmik) it's just a preliminary box. We need to:
Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp	(revision 17449)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp	(revision 17450)
@@ -31,4 +31,5 @@
 #include "VBoxMediaManagerDlg.h"
 #include "VBoxImportApplianceWzd.h"
+#include "VBoxExportApplianceWzd.h"
 #include "VBoxSettingsDialogSpecific.h"
 #include "VBoxVMLogViewer.h"
@@ -408,4 +409,7 @@
     mFileApplianceImportAction = new QAction (this);
     mFileApplianceImportAction->setIcon (VBoxGlobal::iconSet (":/import_16px.png"));
+
+    mFileApplianceExportAction = new QAction (this);
+    mFileApplianceExportAction->setIcon (VBoxGlobal::iconSet (":/import_16px.png"));
 
     mFileSettingsAction = new QAction(this);
@@ -546,4 +550,5 @@
     mFileMenu->addAction (mFileMediaMgrAction);
     mFileMenu->addAction (mFileApplianceImportAction);
+    mFileMenu->addAction (mFileApplianceExportAction);
 #ifndef Q_WS_MAC
     mFileMenu->addSeparator();
@@ -651,4 +656,5 @@
     connect (mFileMediaMgrAction, SIGNAL (triggered()), this, SLOT (fileMediaMgr()));
     connect (mFileApplianceImportAction, SIGNAL (triggered()), this, SLOT (fileImportAppliance()));
+    connect (mFileApplianceExportAction, SIGNAL (triggered()), this, SLOT (fileExportAppliance()));
     connect (mFileSettingsAction, SIGNAL (triggered()), this, SLOT (fileSettings()));
     connect (mFileExitAction, SIGNAL (triggered()), this, SLOT (fileExit()));
@@ -751,4 +757,17 @@
 {
     VBoxImportApplianceWzd wzd (this);
+
+    wzd.exec();
+}
+
+void VBoxSelectorWnd::fileExportAppliance()
+{
+    QString name;
+
+    VBoxVMItem *item = mVMListView->selectedItem();
+    if (item)
+        name = item->name();
+
+    VBoxExportApplianceWzd wzd (this, name);
 
     wzd.exec();
@@ -1273,4 +1292,8 @@
     mFileApplianceImportAction->setStatusTip (tr ("Import an appliance into VirtualBox"));
 
+    mFileApplianceExportAction->setText (tr ("&Export Appliance..."));
+    mFileApplianceExportAction->setShortcut (QKeySequence ("Ctrl+J"));
+    mFileApplianceExportAction->setStatusTip (tr ("Export an appliance out of VM's from VirtualBox"));
+
 #ifdef Q_WS_MAC
     /*
Index: trunk/src/VBox/Frontends/VirtualBox/ui/VBoxExportApplianceWzd.ui
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/ui/VBoxExportApplianceWzd.ui	(revision 17450)
+++ trunk/src/VBox/Frontends/VirtualBox/ui/VBoxExportApplianceWzd.ui	(revision 17450)
@@ -0,0 +1,344 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>VBoxExportApplianceWzd</class>
+ <widget class="QWidget" name="VBoxExportApplianceWzd">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>559</width>
+    <height>399</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Appliance Export Wizard</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QStackedWidget" name="mPageStack">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="mVMSelectPage">
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <item>
+        <widget class="QLabel" name="mPageWelcomeHdr">
+         <property name="font">
+          <font>
+           <family>Arial</family>
+           <pointsize>12</pointsize>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Welcome to the Appliance Export Wizard!</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line11">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QGridLayout" name="gridLayout">
+         <item row="0" column="0" rowspan="3">
+          <widget class="QLabel" name="mLogoWelcome">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="autoFillBackground">
+            <bool>true</bool>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+           <property name="pixmap">
+            <pixmap resource="../VirtualBox.qrc">:/vmw_new_welcome.png</pixmap>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QILabel" name="mTextWelcome">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>300</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This wizard will you guide to the process of exporting an Appliance. &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Use the &lt;span style=&quot; font-weight:600;&quot;&gt;Next&lt;/span&gt; button to go the next page of the wizard and the &lt;span style=&quot; font-weight:600;&quot;&gt;Back&lt;/span&gt; button to return to the previous page.&lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;In order to export an Appliance you have to select the virtual machines which should be included. You can select more than one. Please note that these VMs have to be turned off before they can be exported.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+           </property>
+           <property name="wordWrap">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QListWidget" name="mVMListWidget"/>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="Line" name="line12">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="_2">
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>0</width>
+             <height>0</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="mBtnBack1">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>&lt; &amp;Back</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="mBtnNext1">
+           <property name="text">
+            <string>&amp;Next &gt;</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Fixed</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>5</width>
+             <height>0</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="mBtnCancel1">
+           <property name="text">
+            <string>Cancel</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="mFileSelectPage">
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <widget class="QLabel" name="mPageSettingsHdr">
+         <property name="font">
+          <font>
+           <family>Arial</family>
+           <pointsize>12</pointsize>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Appliance Export Settings</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line21">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QGridLayout" name="gridLayout_2">
+         <item row="0" column="0" rowspan="3">
+          <widget class="QLabel" name="mLogoSettings">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="autoFillBackground">
+            <bool>true</bool>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+           <property name="pixmap">
+            <pixmap resource="../VirtualBox.qrc">:/vmw_new_welcome.png</pixmap>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QILabel" name="mTextSettings">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>300</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>You have to select a filename as target for the export. Currently VirtualBox supports the Open Virtualization Format (OVF).</string>
+           </property>
+           <property name="wordWrap">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="VBoxFilePathSelectorWidget" name="mFileSelector"/>
+         </item>
+         <item row="2" column="1">
+          <spacer name="spacer">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>418</width>
+             <height>208</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="Line" name="line22">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="_3">
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>0</width>
+             <height>0</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="mBtnBack2">
+           <property name="text">
+            <string>&lt; &amp;Back</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="mBtnFinish">
+           <property name="text">
+            <string>&amp;Export &gt;</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Fixed</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>5</width>
+             <height>0</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="mBtnCancel2">
+           <property name="text">
+            <string>Cancel</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+  <customwidget>
+   <class>VBoxFilePathSelectorWidget</class>
+   <extends>QComboBox</extends>
+   <header>VBoxFilePathSelectorWidget.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources>
+  <include location="../VirtualBox.qrc"/>
+  <include location="../../VirtualBox.qrc"/>
+ </resources>
+ <connections/>
+</ui>
Index: trunk/src/VBox/Frontends/VirtualBox/ui/VBoxImportApplianceWzd.ui
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/ui/VBoxImportApplianceWzd.ui	(revision 17449)
+++ trunk/src/VBox/Frontends/VirtualBox/ui/VBoxImportApplianceWzd.ui	(revision 17450)
@@ -374,5 +374,5 @@
  <resources>
   <include location="../VirtualBox.qrc"/>
-  <include location="../../VirtualBox.qrc"/>
+  <include location="../VirtualBox.qrc"/>
  </resources>
  <connections/>
