1 | /* $Id: UISettingsPage.cpp 34740 2010-12-06 11:56:28Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | *
|
---|
4 | * VBox frontends: Qt4 GUI ("VirtualBox"):
|
---|
5 | * UISettingsPage class implementation
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2006-2010 Oracle Corporation
|
---|
10 | *
|
---|
11 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
12 | * available from http://www.virtualbox.org. This file is free software;
|
---|
13 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
14 | * General Public License (GPL) as published by the Free Software
|
---|
15 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
16 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
17 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
18 | */
|
---|
19 |
|
---|
20 | /* Local includes */
|
---|
21 | #include "UISettingsPage.h"
|
---|
22 |
|
---|
23 | /* Returns settings page type: */
|
---|
24 | UISettingsPageType UISettingsPage::type() const
|
---|
25 | {
|
---|
26 | return m_type;
|
---|
27 | }
|
---|
28 |
|
---|
29 | /* Validation stuff: */
|
---|
30 | void UISettingsPage::setValidator(QIWidgetValidator *pValidator)
|
---|
31 | {
|
---|
32 | Q_UNUSED(pValidator);
|
---|
33 | }
|
---|
34 |
|
---|
35 | /* Validation stuff: */
|
---|
36 | bool UISettingsPage::revalidate(QString &strWarningText, QString &strTitle)
|
---|
37 | {
|
---|
38 | Q_UNUSED(strWarningText);
|
---|
39 | Q_UNUSED(strTitle);
|
---|
40 | return true;
|
---|
41 | }
|
---|
42 |
|
---|
43 | /* Navigation stuff: */
|
---|
44 | void UISettingsPage::setOrderAfter(QWidget *pWidget)
|
---|
45 | {
|
---|
46 | m_pFirstWidget = pWidget;
|
---|
47 | }
|
---|
48 |
|
---|
49 | /* Page 'ID' stuff: */
|
---|
50 | int UISettingsPage::id() const
|
---|
51 | {
|
---|
52 | return m_cId;
|
---|
53 | }
|
---|
54 |
|
---|
55 | /* Page 'ID' stuff: */
|
---|
56 | void UISettingsPage::setId(int cId)
|
---|
57 | {
|
---|
58 | m_cId = cId;
|
---|
59 | }
|
---|
60 |
|
---|
61 | /* Page 'processed' stuff: */
|
---|
62 | bool UISettingsPage::processed() const
|
---|
63 | {
|
---|
64 | return m_fProcessed;
|
---|
65 | }
|
---|
66 |
|
---|
67 | /* Page 'processed' stuff: */
|
---|
68 | void UISettingsPage::setProcessed(bool fProcessed)
|
---|
69 | {
|
---|
70 | m_fProcessed = fProcessed;
|
---|
71 | }
|
---|
72 |
|
---|
73 | /* Page 'failed' stuff: */
|
---|
74 | bool UISettingsPage::failed() const
|
---|
75 | {
|
---|
76 | return m_fFailed;
|
---|
77 | }
|
---|
78 |
|
---|
79 | /* Page 'failed' stuff: */
|
---|
80 | void UISettingsPage::setFailed(bool fFailed)
|
---|
81 | {
|
---|
82 | m_fFailed = fFailed;
|
---|
83 | }
|
---|
84 |
|
---|
85 | /* Settings page constructor, hidden: */
|
---|
86 | UISettingsPage::UISettingsPage(UISettingsPageType type, QWidget *pParent)
|
---|
87 | : QIWithRetranslateUI<QWidget>(pParent)
|
---|
88 | , m_type(type)
|
---|
89 | , m_cId(-1)
|
---|
90 | , m_fProcessed(false)
|
---|
91 | , m_fFailed(false)
|
---|
92 | , m_pFirstWidget(0)
|
---|
93 | {
|
---|
94 | }
|
---|
95 |
|
---|
96 | /* Fetch data to m_properties & m_settings: */
|
---|
97 | void UISettingsPageGlobal::fetchData(const QVariant &data)
|
---|
98 | {
|
---|
99 | m_properties = data.value<UISettingsDataGlobal>().m_properties;
|
---|
100 | m_settings = data.value<UISettingsDataGlobal>().m_settings;
|
---|
101 | }
|
---|
102 |
|
---|
103 | /* Upload m_properties & m_settings to data: */
|
---|
104 | void UISettingsPageGlobal::uploadData(QVariant &data) const
|
---|
105 | {
|
---|
106 | data = QVariant::fromValue(UISettingsDataGlobal(m_properties, m_settings));
|
---|
107 | }
|
---|
108 |
|
---|
109 | /* Global settings page constructor, hidden: */
|
---|
110 | UISettingsPageGlobal::UISettingsPageGlobal(QWidget *pParent)
|
---|
111 | : UISettingsPage(UISettingsPageType_Global, pParent)
|
---|
112 | {
|
---|
113 | }
|
---|
114 |
|
---|
115 | /* Fetch data to m_machine: */
|
---|
116 | void UISettingsPageMachine::fetchData(const QVariant &data)
|
---|
117 | {
|
---|
118 | m_machine = data.value<UISettingsDataMachine>().m_machine;
|
---|
119 | }
|
---|
120 |
|
---|
121 | /* Upload m_machine to data: */
|
---|
122 | void UISettingsPageMachine::uploadData(QVariant &data) const
|
---|
123 | {
|
---|
124 | data = QVariant::fromValue(UISettingsDataMachine(m_machine));
|
---|
125 | }
|
---|
126 |
|
---|
127 | /* Machine settings page constructor, hidden: */
|
---|
128 | UISettingsPageMachine::UISettingsPageMachine(QWidget *pParent)
|
---|
129 | : UISettingsPage(UISettingsPageType_Machine, pParent)
|
---|
130 | {
|
---|
131 | }
|
---|
132 |
|
---|