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 |
|
---|
56 | protected:
|
---|
57 |
|
---|
58 | virtual void retranslateUi();
|
---|
59 |
|
---|
60 | void setWarning (const QString &aWarning);
|
---|
61 |
|
---|
62 | VBoxSettingsSelector *mSelector;
|
---|
63 | QStackedWidget *mStack;
|
---|
64 |
|
---|
65 | private slots:
|
---|
66 |
|
---|
67 | void enableOk (const QIWidgetValidator *aWval);
|
---|
68 | void updateWhatsThis (bool aGotFocus = false);
|
---|
69 | void whatsThisCandidateDestroyed (QObject *aObj = 0);
|
---|
70 |
|
---|
71 | void categoryChanged (int aId);
|
---|
72 |
|
---|
73 | private:
|
---|
74 |
|
---|
75 | bool eventFilter (QObject *aObject, QEvent *aEvent);
|
---|
76 | void showEvent (QShowEvent *aEvent);
|
---|
77 |
|
---|
78 | /* Flags */
|
---|
79 | bool mPolished;
|
---|
80 | bool mValid;
|
---|
81 |
|
---|
82 | /* Warning Stuff */
|
---|
83 | VBoxWarnIconLabel *mWarnIconLabel;
|
---|
84 | QString mWarnString;
|
---|
85 |
|
---|
86 | /* WhatsThis Stuff */
|
---|
87 | QTimer *mWhatsThisTimer;
|
---|
88 | QWidget *mWhatsThisCandidate;
|
---|
89 | };
|
---|
90 |
|
---|
91 | #endif // __VBoxSettingsDialog_h__
|
---|
92 |
|
---|