1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt4 GUI ("VirtualBox"):
|
---|
4 | * VBoxSettingsDialog class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2008 Sun Microsystems, Inc.
|
---|
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 (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __VBoxSettingsDialog_h__
|
---|
24 | #define __VBoxSettingsDialog_h__
|
---|
25 |
|
---|
26 | #include "VBoxSettingsDialog.gen.h"
|
---|
27 | #include "QIMainDialog.h"
|
---|
28 | #include "QIWithRetranslateUI.h"
|
---|
29 |
|
---|
30 | class VBoxWarnIconLabel;
|
---|
31 | class QIWidgetValidator;
|
---|
32 | class VBoxSettingsSelector;
|
---|
33 | class QTimer;
|
---|
34 | class QStackedWidget;
|
---|
35 |
|
---|
36 | /*
|
---|
37 | * Base dialog class for both Global & VM settings which
|
---|
38 | * encapsulates most of their similar functionalities.
|
---|
39 | */
|
---|
40 | class VBoxSettingsDialog : public QIWithRetranslateUI<QIMainDialog>,
|
---|
41 | public Ui::VBoxSettingsDialog
|
---|
42 | {
|
---|
43 | Q_OBJECT;
|
---|
44 |
|
---|
45 | public:
|
---|
46 |
|
---|
47 | VBoxSettingsDialog (QWidget *aParent = NULL);
|
---|
48 |
|
---|
49 | virtual void getFrom() = 0;
|
---|
50 | virtual void putBackTo() = 0;
|
---|
51 |
|
---|
52 | protected slots:
|
---|
53 |
|
---|
54 | virtual void revalidate (QIWidgetValidator * /* aWval */) {}
|
---|
55 | void categoryChanged (int aId);
|
---|
56 |
|
---|
57 | protected:
|
---|
58 |
|
---|
59 | virtual void retranslateUi();
|
---|
60 |
|
---|
61 | virtual QString dialogTitle() const = 0;
|
---|
62 | QString titleExtension() const;
|
---|
63 |
|
---|
64 | void setError (const QString &aError);
|
---|
65 | void setWarning (const QString &aWarning);
|
---|
66 |
|
---|
67 | VBoxSettingsSelector *mSelector;
|
---|
68 | QStackedWidget *mStack;
|
---|
69 |
|
---|
70 | private slots:
|
---|
71 |
|
---|
72 | void enableOk (const QIWidgetValidator *aWval);
|
---|
73 | void updateWhatsThis (bool aGotFocus = false);
|
---|
74 | void whatsThisCandidateDestroyed (QObject *aObj = 0);
|
---|
75 |
|
---|
76 | private:
|
---|
77 |
|
---|
78 | bool eventFilter (QObject *aObject, QEvent *aEvent);
|
---|
79 | void showEvent (QShowEvent *aEvent);
|
---|
80 |
|
---|
81 | /* Flags */
|
---|
82 | bool mPolished;
|
---|
83 |
|
---|
84 | /* Error & Warning stuff */
|
---|
85 | bool mValid;
|
---|
86 | bool mSilent;
|
---|
87 | QString mErrorHint;
|
---|
88 | QString mWarnHint;
|
---|
89 | QString mErrorString;
|
---|
90 | QString mWarnString;
|
---|
91 | QPixmap mErrorIcon;
|
---|
92 | QPixmap mWarnIcon;
|
---|
93 | VBoxWarnIconLabel *mIconLabel;
|
---|
94 |
|
---|
95 | /* WhatsThis Stuff */
|
---|
96 | QTimer *mWhatsThisTimer;
|
---|
97 | QWidget *mWhatsThisCandidate;
|
---|
98 |
|
---|
99 | #ifdef Q_WS_MAC
|
---|
100 | QList<QSize> mSizeList;
|
---|
101 | #endif /* Q_WS_MAC */
|
---|
102 | };
|
---|
103 |
|
---|
104 | #endif // __VBoxSettingsDialog_h__
|
---|
105 |
|
---|