UIWizardExportAppPageBasic1.cpp revision ca87590cb28f22bccab88dc2f87c5ce2682b1ba1
/* $Id$ */
/** @file
* VBox Qt GUI - UIWizardExportAppPageBasic1 class implementation.
*/
/*
* Copyright (C) 2009-2012 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.
*/
/* Qt includes: */
#include <QVBoxLayout>
/* Local includes: */
#include "UIWizardExportAppPageBasic1.h"
#include "UIWizardExportApp.h"
#include "UIWizardExportAppDefs.h"
#include "VBoxGlobal.h"
#include "UIMessageCenter.h"
#include "QILabelSeparator.h"
#include "QIRichTextLabel.h"
/* COM includes: */
#include "CMachine.h"
{
}
{
/* Add all VM items into 'VM Selector': */
{
bool fInSaveState = false;
bool fEnabled = false;
if (machine.GetAccessible())
{
pixIcon = vboxGlobal().vmGuestOSTypeIcon(machine.GetOSTypeId()).scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
}
else
{
strName = VBoxGlobal::hasAllowedExtension(fi.completeSuffix(), VBoxFileExts) ? fi.completeBaseName() : fi.fileName();
pixIcon = QPixmap(":/os_other.png").scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
}
QListWidgetItem *pItem = new VMListWidgetItem(pixIcon, strName, strUuid, fInSaveState, m_pVMSelector);
if (!fEnabled)
}
/* Choose initially selected items (if passed): */
for (int i = 0; i < selectedVMNames.size(); ++i)
{
{
else
}
}
}
{
/* Prepare list: */
/* Iterate over all the selected items: */
/* Return result list: */
return machineNames;
}
{
/* Prepare list: */
/* Iterate over all the selected items: */
/* Return result list: */
return machineIDs;
}
{
/* Create widgets: */
{
m_pLabel = new QIRichTextLabel(this);
m_pVMSelector = new QListWidget(this);
{
m_pVMSelector->setAlternatingRowColors(true);
}
}
/* Setup connections: */
/* Register fields: */
}
{
/* Translate page: */
/* Translate widgets: */
m_pLabel->setText(UIWizardExportApp::tr("<p>Please select the virtual machines that should be added to the appliance. "
"You can select more than one. Please note that these machines have to be "
"turned off before they can be exported.</p>"));
}
{
/* Translate page: */
}
bool UIWizardExportAppPageBasic1::isComplete() const
{
/* There should be at least one vm selected: */
}
{
/* Initial result: */
bool fResult = true;
/* Ask user about machines which are in save state currently: */
{
}
if (!savedMachines.isEmpty())
/* Return result: */
return fResult;
}
int UIWizardExportAppPageBasic1::nextId() const
{
/* Skip next (2nd, storage-type) page for now! */
return UIWizardExportApp::Page3;
}