UIPopupPaneButtonPane.cpp revision 27a76824c2115a7594095315c069f289388d4355
/* $Id$ */
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* UIPopupPaneButtonPane class implementation
*/
/*
* Copyright (C) 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 <QHBoxLayout>
#include <QVBoxLayout>
#include <QKeyEvent>
/* GUI includes: */
#include "UIPopupPaneButtonPane.h"
#include "UIIconPool.h"
#include "QIToolButton.h"
#include "QIMessageBox.h"
, m_iDefaultButton(0)
, m_iEscapeButton(0)
{
/* Prepare: */
prepare();
}
{
/* Make sure something changed: */
return;
/* Assign new button-descriptions: */
/* Recreate buttons: */
}
{
/* Make sure the slot is called by the button: */
if (!pButton)
return;
/* Make sure we still have that button: */
if (!iButtonID)
return;
/* Notify listeners button was clicked: */
}
void UIPopupPaneButtonPane::prepare()
{
/* Prepare layouts: */
}
void UIPopupPaneButtonPane::prepareLayouts()
{
/* Create layouts: */
m_pButtonLayout = new QHBoxLayout;
m_pButtonLayout->setContentsMargins(0, 0, 0, 0);
pMainLayout->setContentsMargins(0, 0, 0, 0);
pMainLayout->setSpacing(0);
}
void UIPopupPaneButtonPane::prepareButtons()
{
/* Add all the buttons: */
{
}
}
void UIPopupPaneButtonPane::cleanupButtons()
{
/* Remove all the buttons: */
{
}
}
{
/* Depending on pressed key: */
{
case Qt::Key_Return:
{
if (m_iDefaultButton)
{
return;
}
break;
}
case Qt::Key_Escape:
{
if (m_iEscapeButton)
{
return;
}
break;
}
default:
break;
}
/* Call to base-class: */
}
/* static */
{
/* Create button: */
pButton->removeBorder();
/* Sign the 'default' button: */
/* Sign the 'escape' button: */
/* Return button: */
return pButton;
}
/* static */
{
switch (iButtonID & AlertButtonMask)
{
default: strToolTip = QString(); break;
}
return strToolTip;
}
/* static */
{
switch (iButtonID & AlertButtonMask)
{
case AlertButton_Choice1: break;
case AlertButton_Choice2: break;
default: break;
}
return icon;
}