UIWizardCloneVMPageBasic2.cpp revision 9ab0743fd2e00994c4657ca9e67ab5dafa78e1af
/* $Id$ */
/** @file
*
* VBox frontends: Qt4 GUI ("VirtualBox"):
* UIWizardCloneVMPageBasic2 class implementation
*/
/*
* Copyright (C) 2011-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 <QVBoxLayout>
#include <QGroupBox>
#include <QRadioButton>
#include <QButtonGroup>
/* Local includes: */
#include "UIWizardCloneVMPageBasic2.h"
#include "UIWizardCloneVM.h"
#include "COMDefs.h"
#include "QIRichTextLabel.h"
{
}
bool UIWizardCloneVMPage2::isLinkedClone() const
{
return m_pLinkedCloneRadio->isChecked();
}
{
/* Create widgets: */
{
m_pLabel = new QIRichTextLabel(this);
m_pCloneTypeCnt = new QGroupBox(this);
{
{
{
{
m_pFullCloneRadio->setChecked(true);
}
}
}
}
}
/* Setup connections: */
connect(m_pButtonGroup, SIGNAL(buttonClicked(QAbstractButton *)), this, SLOT(sltButtonClicked(QAbstractButton *)));
/* Register fields: */
}
{
/* On older Qt versions the content of the current page isn't updated when
* using setFinalPage. So switch back and for to simulate it. */
#if QT_VERSION < 0x040700
#endif
}
{
/* Translate page: */
/* Translate widgets: */
"<p>If you choose <b>Full clone</b>, "
"an exact copy (including all virtual hard drive images) "
"of the original VM will be created.</p>"
"<p>If you select <b>Linked clone</b>, "
"a new VM will be created, but the virtual hard drive images "
"will point to the virtual hard drive images of original VM.</p>");
if (m_fAdditionalInfo)
strLabel += UIWizardCloneVM::tr("<p>Note that a new snapshot within the source VM is created in case you select <b>Linked clone</b>.</p>");
}
{
/* Translate page: */
}
{
/* This page could be final: */
if (isFinalPage())
{
/* Initial result: */
bool fResult = true;
/* Lock finish button: */
/* Trying to clone VM: */
if (fResult)
/* Unlock finish button: */
/* Return result: */
return fResult;
}
else
return true;
}
int UIWizardCloneVMPageBasic2::nextId() const
{
return m_pFullCloneRadio->isChecked() && wizard()->page(UIWizardCloneVM::Page3) ? UIWizardCloneVM::Page3 : -1;
}