3
* VBox frontends: Qt4 GUI ("VirtualBox"):
4
* UIMachineSettingsParallel class declaration
8
* Copyright (C) 2006-2012 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 __UIMachineSettingsParallel_h__
20
#define __UIMachineSettingsParallel_h__
23
#include "UISettingsPage.h"
24
#include "UIMachineSettingsParallel.gen.h"
26
/* Forward declarations: */
27
class UIMachineSettingsParallelPage;
30
/* Machine settings / Parallel page / Port data: */
31
struct UIDataSettingsMachineParallelPort
33
/* Default constructor: */
34
UIDataSettingsMachineParallelPort()
36
, m_fPortEnabled(false)
39
, m_strPath(QString()) {}
41
bool equal(const UIDataSettingsMachineParallelPort &other) const
43
return (m_iSlot == other.m_iSlot) &&
44
(m_fPortEnabled == other.m_fPortEnabled) &&
45
(m_uIRQ == other.m_uIRQ) &&
46
(m_uIOBase == other.m_uIOBase) &&
47
(m_strPath == other.m_strPath);
50
bool operator==(const UIDataSettingsMachineParallelPort &other) const { return equal(other); }
51
bool operator!=(const UIDataSettingsMachineParallelPort &other) const { return !equal(other); }
59
typedef UISettingsCache<UIDataSettingsMachineParallelPort> UICacheSettingsMachineParallelPort;
61
/* Machine settings / Parallel page / Ports data: */
62
struct UIDataSettingsMachineParallel
64
/* Default constructor: */
65
UIDataSettingsMachineParallel() {}
67
bool operator==(const UIDataSettingsMachineParallel& /* other */) const { return true; }
68
bool operator!=(const UIDataSettingsMachineParallel& /* other */) const { return false; }
70
typedef UISettingsCachePool<UIDataSettingsMachineParallel, UICacheSettingsMachineParallelPort> UICacheSettingsMachineParallel;
72
class UIMachineSettingsParallel : public QIWithRetranslateUI<QWidget>,
73
public Ui::UIMachineSettingsParallel
79
UIMachineSettingsParallel(UIMachineSettingsParallelPage *pParent);
83
void fetchPortData(const UICacheSettingsMachineParallelPort &portCache);
84
void uploadPortData(UICacheSettingsMachineParallelPort &portCache);
86
QWidget* setOrderAfter (QWidget *aAfter);
88
QString pageTitle() const;
97
void mGbParallelToggled (bool aOn);
98
void mCbNumberActivated (const QString &aText);
102
/* Helper: Prepare stuff: */
103
void prepareValidation();
105
UIMachineSettingsParallelPage *m_pParent;
109
/* Machine settings / Parallel page: */
110
class UIMachineSettingsParallelPage : public UISettingsPageMachine
116
UIMachineSettingsParallelPage();
120
/* Load data to cache from corresponding external object(s),
121
* this task COULD be performed in other than GUI thread: */
122
void loadToCacheFrom(QVariant &data);
123
/* Load data to corresponding widgets from cache,
124
* this task SHOULD be performed in GUI thread only: */
127
/* Save data from corresponding widgets to cache,
128
* this task SHOULD be performed in GUI thread only: */
130
/* Save data from cache to corresponding external object(s),
131
* this task COULD be performed in other than GUI thread: */
132
void saveFromCacheTo(QVariant &data);
135
bool changed() const { return m_cache.wasChanged(); }
137
/* API: Validation stuff: */
138
bool validate(QList<UIValidationMessage> &messages);
140
void retranslateUi();
146
QITabWidget *mTabWidget;
149
UICacheSettingsMachineParallel m_cache;
152
#endif // __UIMachineSettingsParallel_h__