UIWarningPane.cpp revision 235d3bea31bdca1dd7f555821eacfd0dd36bd6f5
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync/* $Id$ */
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync/** @file
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync *
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync * VBox frontends: Qt4 GUI ("VirtualBox"):
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync * UIWarningPane class implementation
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync */
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync/*
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync * Copyright (C) 2009-2013 Oracle Corporation
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync *
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync * available from http://www.virtualbox.org. This file is free software;
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync * you can redistribute it and/or modify it under the terms of the GNU
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync * General Public License (GPL) as published by the Free Software
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync */
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync/* Qt includes: */
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync#include <QHBoxLayout>
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync#include <QLabel>
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync/* GUI includes: */
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync#include "UIWarningPane.h"
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsyncUIWarningPane::UIWarningPane(QWidget *pParent)
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync : QWidget(pParent)
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync , m_pLabelIcon(0)
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync , m_pLabelText(0)
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync{
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync /* Prepare: */
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync prepare();
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync}
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsyncvoid UIWarningPane::setWarningPixmap(const QPixmap &pixmap)
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync{
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync m_pLabelIcon->setPixmap(pixmap);
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync}
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsyncvoid UIWarningPane::setWarningText(const QString &strText)
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync{
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync m_pLabelText->setText(strText);
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync}
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsyncvoid UIWarningPane::prepare()
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync{
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync /* Prepare content: */
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync prepareContent();
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync}
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsyncvoid UIWarningPane::prepareContent()
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync{
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync /* Create layout: */
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync QHBoxLayout *pLayout = new QHBoxLayout(this);
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync {
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync /* Configure layout: */
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync pLayout->setContentsMargins(0, 0, 0, 0);
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync /* Create icon label: */
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync m_pLabelIcon = new QLabel;
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync /* Create text label: */
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync m_pLabelText = new QLabel;
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync /* Add widgets into layout: */
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync pLayout->addWidget(m_pLabelIcon);
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync pLayout->addWidget(m_pLabelText);
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync }
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync}
235d3bea31bdca1dd7f555821eacfd0dd36bd6f5vboxsync