VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/QIMessageBox.h@ 5480

Last change on this file since 5480 was 4482, checked in by vboxsync, 18 years ago

FE/Qt: Added the guru meditaion message icon.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * innotek Qt extensions: QIMessageBox class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2007 innotek GmbH
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef __QIMessageBox_h__
20#define __QIMessageBox_h__
21
22#include <qdialog.h>
23#include <qvbox.h>
24#include <qmessagebox.h>
25#include <qcheckbox.h>
26#include <qtextedit.h>
27
28class QIRichLabel;
29class QLabel;
30class QPushButton;
31class QSpacerItem;
32
33class QIMessageBox : public QDialog
34{
35 Q_OBJECT
36
37public:
38
39 // for compatibility with QMessageBox
40 enum Icon
41 {
42 NoIcon = QMessageBox::NoIcon,
43 Information = QMessageBox::Information,
44 Warning = QMessageBox::Warning,
45 Critical = QMessageBox::Critical,
46 Question = QMessageBox::Question,
47 GuruMeditation,
48 };
49
50 enum
51 {
52 NoButton = 0, Ok = 1, Cancel = 2, Yes = 3, No = 4, Abort = 5,
53 Retry = 6, Ignore = 7, YesAll = 8, NoAll = 9, ButtonMask = 0xff,
54 Default = 0x100, Escape = 0x200, FlagMask = 0x300
55 };
56
57 QIMessageBox (const QString &aCaption, const QString &aText,
58 Icon aIcon, int aButton0, int aButton1 = 0, int aButton2 = 0,
59 QWidget *aParent = 0, const char *aName = 0, bool aModal = TRUE,
60 WFlags aFlags = WStyle_DialogBorder);
61
62 QString flagText() const { return mFlagCB->isShown() ? mFlagCB->text() : QString::null; }
63 void setFlagText (const QString &aText);
64
65 bool isFlagChecked() const { return mFlagCB->isChecked(); }
66 void setFlagChecked (bool aChecked) { mFlagCB->setChecked (aChecked); }
67
68 QString detailsText () const { return mDetailsText->text(); }
69 void setDetailsText (const QString &aText);
70
71 bool isDetailsShown() const { return mDetailsVBox->isShown(); }
72 void setDetailsShown (bool aShown);
73
74private:
75
76 QPushButton *createButton (QWidget *aParent, int aButton);
77
78private slots:
79
80 void done0() { done (mButton0 & ButtonMask); }
81 void done1() { done (mButton1 & ButtonMask); }
82 void done2() { done (mButton2 & ButtonMask); }
83
84 void reject() {
85 QDialog::reject();
86 if (mButtonEsc)
87 setResult (mButtonEsc & ButtonMask);
88 }
89
90private:
91
92 int mButton0, mButton1, mButton2, mButtonEsc;
93 QLabel *mIconLabel;
94 QIRichLabel *mTextLabel;
95 QPushButton *mButton0PB, *mButton1PB, *mButton2PB;
96 QVBox *mMessageVBox;
97 QCheckBox *mFlagCB, *mFlagCB_Main, *mFlagCB_Details;
98 QVBox *mDetailsVBox;
99 QTextEdit *mDetailsText;
100 QSpacerItem *mSpacer;
101};
102
103#endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette