UIWizardCloneVDPageExpert.cpp revision 9ab0743fd2e00994c4657ca9e67ab5dafa78e1af
/* $Id$ */
/** @file
*
* VBox frontends: Qt4 GUI ("VirtualBox"):
* UIWizardCloneVDPageExpert class implementation
*/
/*
* Copyright (C) 2006-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.
*/
/* Global includes: */
#include <QGridLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QButtonGroup>
#include <QGroupBox>
#include <QRadioButton>
#include <QCheckBox>
#include <QLineEdit>
/* Local includes: */
#include "UIWizardCloneVDPageExpert.h"
#include "UIWizardCloneVD.h"
#include "UIMessageCenter.h"
#include "UIIconPool.h"
#include "VBoxMediaComboBox.h"
#include "QIToolButton.h"
{
/* Create widgets: */
{
m_pSourceDiskCnt = new QGroupBox(this);
{
{
{
}
{
m_pSourceDiskOpenButton->setAutoRaise(true);
m_pSourceDiskOpenButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", ":/select_file_dis_16px.png"));
}
}
}
m_pDestinationCnt = new QGroupBox(this);
{
{
{
m_pDestinationDiskOpenButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", "select_file_dis_16px.png"));
}
}
}
{
m_pFormatCnt = new QGroupBox(this);
{
{
m_pFormatButtonGroup = new QButtonGroup(this);
{
for (int i = 0; i < medFormats.size(); ++i)
{
if (strFormatName == "VDI")
{
if (pButton)
{
}
}
}
for (int i = 0; i < medFormats.size(); ++i)
{
if (strFormatName != "VDI")
{
if (pButton)
{
}
}
}
}
}
}
}
{
m_pVariantCnt = new QGroupBox(this);
{
{
{
{
}
}
}
}
}
}
/* Setup connections: */
connect(m_pSourceDiskSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(sltHandleSourceDiskChange()));
connect(m_pFormatButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(sltMediumFormatChanged()));
connect(m_pVariantButtonGroup, SIGNAL(buttonClicked(QAbstractButton *)), this, SIGNAL(completeChanged()));
connect(m_pDestinationDiskEditor, SIGNAL(textChanged(const QString &)), this, SIGNAL(completeChanged()));
connect(m_pDestinationDiskOpenButton, SIGNAL(clicked()), this, SLOT(sltSelectLocationButtonClicked()));
/* Register classes: */
/* Register fields: */
}
{
/* Get source virtual-disk file-information: */
/* Get default path for virtual-disk copy: */
/* Compose name for virtual-disk copy: */
QString strMediumName = UIWizardCloneVD::tr("%1_copy", "copied virtual hard drive name").arg(sourceFileInfo.baseName());
/* Set text to location editor: */
/* Broadcast complete-change: */
}
{
/* Call to base-class: */
/* Broadcast complete-change: */
}
{
/* Get medium format: */
/* Compose virtual-disk extension: */
/* Broadcast complete-change: */
}
{
/* Call to base-class: */
}
{
/* Translate widgets: */
m_pSourceDiskOpenButton->setToolTip(UIWizardCloneVD::tr("Choose a virtual hard drive file to copy..."));
m_pDestinationDiskOpenButton->setToolTip(UIWizardCloneVD::tr("Choose a location for new virtual hard drive file..."));
{
pButton->setText(VBoxGlobal::fullMediumFormatName(m_formatNames[m_pFormatButtonGroup->id(pButton)]));
}
}
{
/* Translate page: */
}
bool UIWizardCloneVDPageExpert::isComplete() const
{
/* Check what source virtual-disk feats the rules,
* current name is not empty: */
return !sourceVirtualDisk().isNull() &&
!mediumFormat().isNull() &&
}
{
/* Initial result: */
bool fResult = true;
/* Lock finish button: */
/* Make sure such virtual-disk doesn't exists: */
if (!fResult)
/* Try to copy virtual-disk: */
if (fResult)
/* Unlock finish button: */
/* Return result: */
return fResult;
}