VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp@ 35740

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

FE/Qt: Add errors processing for settings save procedure (problem-reporter updated for inter-thread cases).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 3.1 KB
Line 
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: */
24UISettingsPageType UISettingsPage::type() const
25{
26 return m_type;
27}
28
29/* Validation stuff: */
30void UISettingsPage::setValidator(QIWidgetValidator *pValidator)
31{
32 Q_UNUSED(pValidator);
33}
34
35/* Validation stuff: */
36bool UISettingsPage::revalidate(QString &strWarningText, QString &strTitle)
37{
38 Q_UNUSED(strWarningText);
39 Q_UNUSED(strTitle);
40 return true;
41}
42
43/* Navigation stuff: */
44void UISettingsPage::setOrderAfter(QWidget *pWidget)
45{
46 m_pFirstWidget = pWidget;
47}
48
49/* Page 'ID' stuff: */
50int UISettingsPage::id() const
51{
52 return m_cId;
53}
54
55/* Page 'ID' stuff: */
56void UISettingsPage::setId(int cId)
57{
58 m_cId = cId;
59}
60
61/* Page 'processed' stuff: */
62bool UISettingsPage::processed() const
63{
64 return m_fProcessed;
65}
66
67/* Page 'processed' stuff: */
68void UISettingsPage::setProcessed(bool fProcessed)
69{
70 m_fProcessed = fProcessed;
71}
72
73/* Page 'failed' stuff: */
74bool UISettingsPage::failed() const
75{
76 return m_fFailed;
77}
78
79/* Page 'failed' stuff: */
80void UISettingsPage::setFailed(bool fFailed)
81{
82 m_fFailed = fFailed;
83}
84
85/* Settings page constructor, hidden: */
86UISettingsPage::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: */
97void 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: */
104void UISettingsPageGlobal::uploadData(QVariant &data) const
105{
106 data = QVariant::fromValue(UISettingsDataGlobal(m_properties, m_settings));
107}
108
109/* Global settings page constructor, hidden: */
110UISettingsPageGlobal::UISettingsPageGlobal(QWidget *pParent)
111 : UISettingsPage(UISettingsPageType_Global, pParent)
112{
113}
114
115/* Fetch data to m_machine: */
116void UISettingsPageMachine::fetchData(const QVariant &data)
117{
118 m_machine = data.value<UISettingsDataMachine>().m_machine;
119}
120
121/* Upload m_machine to data: */
122void UISettingsPageMachine::uploadData(QVariant &data) const
123{
124 data = QVariant::fromValue(UISettingsDataMachine(m_machine));
125}
126
127/* Machine settings page constructor, hidden: */
128UISettingsPageMachine::UISettingsPageMachine(QWidget *pParent)
129 : UISettingsPage(UISettingsPageType_Machine, pParent)
130{
131}
132
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use