UIWizardNewVDPageExpert.cpp revision ec36440940ba71033f9d8853bb1ba3758f34d8e2
/* $Id$ */
/** @file
*
* VBox frontends: Qt4 GUI ("VirtualBox"):
* UIWizardNewVDPageExpert class implementation
*/
/*
* Copyright (C) 2006-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.
*/
/* Qt includes: */
#include <QGridLayout>
#include <QVBoxLayout>
#include <QRegExpValidator>
#include <QGroupBox>
#include <QRadioButton>
#include <QCheckBox>
#include <QButtonGroup>
#include <QLineEdit>
#include <QSlider>
#include <QLabel>
/* GUI includes: */
#include "UIWizardNewVDPageExpert.h"
#include "UIWizardNewVD.h"
#include "VBoxGlobal.h"
#include "UIMessageCenter.h"
#include "UIIconPool.h"
#include "QIRichTextLabel.h"
#include "QIToolButton.h"
#include "QILineEdit.h"
/* COM includes: */
#include "CSystemProperties.h"
UIWizardNewVDPageExpert::UIWizardNewVDPageExpert(const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize)
{
/* Create widgets: */
{
m_pLocationCnt = new QGroupBox(this);
{
{
{
}
{
m_pLocationOpenButton->setAutoRaise(true);
m_pLocationOpenButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", "select_file_dis_16px.png"));
}
}
}
m_pSizeCnt = new QGroupBox(this);
{
{
{
}
{
}
{
}
{
}
}
}
m_pFormatCnt = new QGroupBox(this);
{
{
{
for (int i = 0; i < medFormats.size(); ++i)
{
}
for (int i = 0; i < medFormats.size(); ++i)
{
}
}
}
}
m_pVariantCnt = new QGroupBox(this);
{
{
{
{
}
}
}
}
}
/* Setup connections: */
connect(m_pFormatButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(sltMediumFormatChanged()));
connect(m_pVariantButtonGroup, SIGNAL(buttonClicked(QAbstractButton *)), this, SIGNAL(completeChanged()));
connect(m_pSizeEditor, SIGNAL(textChanged(const QString &)), this, SLOT(sltSizeEditorTextChanged(const QString &)));
/* Register classes: */
/* Register fields: */
}
{
/* Get medium format: */
ULONG uCapabilities = 0;
for (int i = 0; i < capabilities.size(); i++)
uCapabilities |= capabilities[i];
/* Compose virtual-disk extension: */
/* Broadcast complete-change: */
}
{
/* Call to base-class: */
}
{
}
{
}
void UIWizardNewVDPageExpert::retranslateUi()
{
/* Translate widgets: */
m_pLocationOpenButton->setToolTip(UIWizardNewVD::tr("Choose a location for new virtual hard drive file..."));
{
pButton->setText(VBoxGlobal::fullMediumFormatName(m_formatNames[m_pFormatButtonGroup->id(pButton)]));
}
}
{
/* Translate page: */
}
bool UIWizardNewVDPageExpert::isComplete() const
{
* current name is not empty and current size feats the bounds: */
return !mediumFormat().isNull() &&
}
bool UIWizardNewVDPageExpert::validatePage()
{
/* Initial result: */
bool fResult = true;
/* Lock finish button: */
/* Make sure such virtual-disk doesn't exists: */
if (!fResult)
/* Try to create virtual-disk: */
if (fResult)
/* Unlock finish button: */
/* Return result: */
return fResult;
}