3
* VBox frontends: Qt4 GUI ("VirtualBox"):
4
* UISettingsDialog class declaration
8
* Copyright (C) 2006-2010 Oracle Corporation
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.
19
#ifndef __UISettingsDialog_h__
20
#define __UISettingsDialog_h__
23
#include "QIMainDialog.h"
24
#include "QIWithRetranslateUI.h"
25
#include "UISettingsDialog.gen.h"
27
/* Forward declarations */
28
class QIWidgetValidator;
31
class VBoxWarningPane;
32
class VBoxSettingsSelector;
35
/* Base dialog class for both Global & VM settings which encapsulates most of their similar functionalities */
36
class UISettingsDialog : public QIWithRetranslateUI<QIMainDialog>, public Ui::UISettingsDialog
42
/* Settings Dialog Constructor/Destructor: */
43
UISettingsDialog(QWidget *pParent = 0);
46
/* Save/Load interface: */
47
virtual void getFrom() = 0;
48
virtual void putBackTo() = 0;
52
/* Validation handler: */
53
virtual void sltRevalidate(QIWidgetValidator *pValidator);
55
/* Category-change slot: */
56
virtual void sltCategoryChanged(int cId);
58
/* Mark dialog as processed: */
59
virtual void sltMarkProcessed();
64
virtual void retranslateUi();
67
virtual QString title() const = 0;
68
/* Dialog title extension: */
69
virtual QString titleExtension() const;
71
/* Setters for error/warning: */
72
void setError(const QString &strError);
73
void setWarning(const QString &strWarning);
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);
81
/* Correlation handler: */
82
virtual bool recorrelate(QWidget *pPage, QString &strWarning);
84
/* Protected variables: */
85
VBoxSettingsSelector *m_pSelector;
86
QStackedWidget *m_pStack;
90
/* Slot to handle validity-changes: */
91
void sltHandleValidityChanged(const QIWidgetValidator *pValidator);
93
/* Slot to update whats-this: */
94
void sltUpdateWhatsThis(bool fGotFocus = false);
96
/* Slot to handle reject: */
101
/* Event-handlers: */
102
bool eventFilter(QObject *pObject, QEvent *pEvent);
103
void showEvent(QShowEvent *pEvent);
104
void closeEvent(QCloseEvent *pEvent);
106
void assignValidator(UISettingsPage *pPage);
111
/* Error & Warning stuff: */
115
QString m_strErrorHint;
116
QString m_strWarningHint;
117
QString m_strErrorString;
118
QString m_strWarningString;
120
QPixmap m_warningIcon;
121
VBoxWarningPane *m_pWarningPane;
123
/* Whats-This stuff: */
124
QTimer *m_pWhatsThisTimer;
125
QPointer<QWidget> m_pWhatsThisCandidate;
127
QMap<int, int> m_pages;
129
QList<QSize> m_sizeList;
130
#endif /* Q_WS_MAC */
133
#endif // __UISettingsDialog_h__