VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.h@ 76553

Last change on this file since 76553 was 76553, checked in by vboxsync, 5 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 KB
Line 
1/* $Id: UINameAndSystemEditor.h 76553 2019-01-01 01:45:53Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UINameAndSystemEditor class declaration.
4 */
5
6/*
7 * Copyright (C) 2008-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ___UINameAndSystemEditor_h___
19#define ___UINameAndSystemEditor_h___
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/* Qt includes: */
25#include <QWidget>
26
27/* GUI includes: */
28#include "QIWithRetranslateUI.h"
29#include "UILibraryDefs.h"
30
31/* COM includes: */
32#include "COMEnums.h"
33#include "CGuestOSType.h"
34
35/* Forward declarations: */
36class QComboBox;
37class QLabel;
38class QILineEdit;
39class QString;
40class UIFilePathSelector;
41
42/** QWidget subclass providing complex editor for basic VM parameters. */
43class SHARED_LIBRARY_STUFF UINameAndSystemEditor : public QIWithRetranslateUI<QWidget>
44{
45 Q_OBJECT;
46 Q_PROPERTY(QString name READ name WRITE setName);
47 Q_PROPERTY(CGuestOSType type READ type WRITE setType);
48
49 /** Simple struct representing CGuestOSType cache. */
50 struct UIGuestOSType
51 {
52 QString typeId;
53 QString typeDescription;
54 bool is64bit;
55 };
56
57signals:
58
59 /** Notifies listeners about VM name change. */
60 void sigNameChanged(const QString &strNewName);
61 void sigPathChanged(const QString &strName);
62
63 /** Notifies listeners about VM OS type change. */
64 void sigOsTypeChanged();
65
66public:
67
68 /** Constructs VM parameters editor passing @a pParent to the base-class.
69 * @param fChooseFullPath Controls whether we should propose to choose location. */
70 UINameAndSystemEditor(QWidget *pParent, bool fChooseLocation = false);
71
72 /** Returns the VM name. */
73 QString name() const;
74 /** Returns path string selected by the user. */
75 QString path() const;
76
77 /** Defines the VM @a strName. */
78 void setName(const QString &strName);
79
80 /** Defines the VM OS @a strTypeId and @a strFamilyId if passed. */
81 void setTypeId(QString strTypeId, QString strFamilyId = QString());
82 /** Returns the VM OS type ID. */
83 QString typeId() const;
84 /** Returns the VM OS family ID. */
85 QString familyId() const;
86
87 /** Returns the VM OS type. */
88 CGuestOSType type() const;
89 /** Defines the VM OS @a enmType. */
90 void setType(const CGuestOSType &enmType);
91
92 /** Defines the name-field @a strValidator. */
93 void setNameFieldValidator(const QString &strValidator);
94
95protected:
96
97 /** Handles translation event. */
98 virtual void retranslateUi() /* override */;
99
100private slots:
101
102 /** Handles VM OS family @a iIndex change. */
103 void sltFamilyChanged(int iIndex);
104
105 /** Handles VM OS type @a iIndex change. */
106 void sltTypeChanged(int iIndex);
107
108private:
109
110 /** @name Prepare cascade.
111 * @{ */
112 /** Prepares all. */
113 void prepare();
114 /** Prepares this. */
115 void prepareThis();
116 /** Prepares widgets. */
117 void prepareWidgets();
118 /** Prepares VM OS family combo. */
119 void prepareFamilyCombo();
120 /** Prepares connections. */
121 void prepareConnections();
122 /** @} */
123
124 /** Holds the current family ID list. */
125 QStringList m_familyIDs;
126
127 /** Holds the current type cache. */
128 QMap<QString, QList<UIGuestOSType> > m_types;
129
130 /** Holds the VM OS type ID. */
131 QString m_strTypeId;
132 /** Holds the VM OS family ID. */
133 QString m_strFamilyId;
134
135 /** Holds the currently chosen OS type IDs on per-family basis. */
136 QMap<QString, QString> m_currentIds;
137 /** Holds whether we should propose to choose a full path. */
138 bool m_fChooseLocation;
139 /** Holds whether host supports hardware virtualization. */
140 bool m_fSupportsHWVirtEx;
141 /** Holds whether host supports long mode. */
142 bool m_fSupportsLongMode;
143
144 /** Holds the VM OS family label instance. */
145 QLabel *m_pLabelFamily;
146 /** Holds the VM OS type label instance. */
147 QLabel *m_pLabelType;
148 /** Holds the VM OS type icon instance. */
149 QLabel *m_pIconType;
150
151 QLabel *m_pNameLabel;
152 QLabel *m_pPathLabel;
153 QILineEdit *m_pNameLineEdit;
154 UIFilePathSelector *m_pPathSelector;
155 /** Holds the VM OS family combo instance. */
156 QComboBox *m_pComboFamily;
157 /** Holds the VM OS type combo instance. */
158 QComboBox *m_pComboType;
159 QString m_strGroupName;
160};
161
162#endif /* !___UINameAndSystemEditor_h___ */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use