VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h@ 35740

Last change on this file since 35740 was 35131, checked in by vboxsync, 13 years ago

FE/Qt: Prevent closing global/machine settings dialog while not all the settings pages loaded.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 3.6 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt4 GUI ("VirtualBox"):
4 * UISettingsDialog class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2010 Oracle Corporation
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
19#ifndef __UISettingsDialog_h__
20#define __UISettingsDialog_h__
21
22/* Local includes */
23#include "QIMainDialog.h"
24#include "QIWithRetranslateUI.h"
25#include "UISettingsDialog.gen.h"
26
27/* Forward declarations */
28class QIWidgetValidator;
29class QStackedWidget;
30class QTimer;
31class VBoxWarningPane;
32class VBoxSettingsSelector;
33class UISettingsPage;
34
35/* Base dialog class for both Global & VM settings which encapsulates most of their similar functionalities */
36class UISettingsDialog : public QIWithRetranslateUI<QIMainDialog>, public Ui::UISettingsDialog
37{
38 Q_OBJECT;
39
40public:
41
42 /* Settings Dialog Constructor/Destructor: */
43 UISettingsDialog(QWidget *pParent = 0);
44 ~UISettingsDialog();
45
46 /* Save/Load interface: */
47 virtual void getFrom() = 0;
48 virtual void putBackTo() = 0;
49
50protected slots:
51
52 /* Validation handler: */
53 virtual void sltRevalidate(QIWidgetValidator *pValidator);
54
55 /* Category-change slot: */
56 virtual void sltCategoryChanged(int cId);
57
58 /* Mark dialog as processed: */
59 virtual void sltMarkProcessed();
60
61protected:
62
63 /* UI translator: */
64 virtual void retranslateUi();
65
66 /* Dialog title: */
67 virtual QString title() const = 0;
68 /* Dialog title extension: */
69 virtual QString titleExtension() const;
70
71 /* Setters for error/warning: */
72 void setError(const QString &strError);
73 void setWarning(const QString &strWarning);
74
75 /* Add settings page: */
76 void addItem(const QString &strBigIcon, const QString &strBigIconDisabled,
77 const QString &strSmallIcon, const QString &strSmallIconDisabled,
78 int cId, const QString &strLink,
79 UISettingsPage* pSettingsPage = 0, int iParentId = -1);
80
81 /* Correlation handler: */
82 virtual bool recorrelate(QWidget *pPage, QString &strWarning);
83
84 /* Protected variables: */
85 VBoxSettingsSelector *m_pSelector;
86 QStackedWidget *m_pStack;
87
88private slots:
89
90 /* Slot to handle validity-changes: */
91 void sltHandleValidityChanged(const QIWidgetValidator *pValidator);
92
93 /* Slot to update whats-this: */
94 void sltUpdateWhatsThis(bool fGotFocus = false);
95
96 /* Slot to handle reject: */
97 void reject();
98
99private:
100
101 /* Event-handlers: */
102 bool eventFilter(QObject *pObject, QEvent *pEvent);
103 void showEvent(QShowEvent *pEvent);
104 void closeEvent(QCloseEvent *pEvent);
105
106 void assignValidator(UISettingsPage *pPage);
107
108 /* Global Flags: */
109 bool m_fPolished;
110
111 /* Error & Warning stuff: */
112 bool m_fProcessed;
113 bool m_fValid;
114 bool m_fSilent;
115 QString m_strErrorHint;
116 QString m_strWarningHint;
117 QString m_strErrorString;
118 QString m_strWarningString;
119 QPixmap m_errorIcon;
120 QPixmap m_warningIcon;
121 VBoxWarningPane *m_pWarningPane;
122
123 /* Whats-This stuff: */
124 QTimer *m_pWhatsThisTimer;
125 QPointer<QWidget> m_pWhatsThisCandidate;
126
127 QMap<int, int> m_pages;
128#ifdef Q_WS_MAC
129 QList<QSize> m_sizeList;
130#endif /* Q_WS_MAC */
131};
132
133#endif // __UISettingsDialog_h__
134
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use