VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicInstallSetup.h@ 84961

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

FE/Qt: bugref:9515. Adding an additional page for windows product key.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.1 KB
Line 
1/* $Id: UIWizardNewVMPageBasicInstallSetup.h 84961 2020-06-25 18:49:11Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIWizardNewVMPageBasicInstallSetup class declaration.
4 */
5
6/*
7 * Copyright (C) 2006-2020 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 FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicInstallSetup_h
19#define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicInstallSetup_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/* Qt includes: */
25#include <QLineEdit>
26#include <QStringList>
27#include <QWidget>
28
29/* Local includes: */
30#include "QIWithRetranslateUI.h"
31#include "UIWizardPage.h"
32
33/* Forward declarations: */
34class QGridLayout;
35class QLabel;
36class QSpinBox;
37class QIRichTextLabel;
38struct UIUnattendedInstallData;
39
40class UIPasswordLineEdit : public QLineEdit
41{
42 Q_OBJECT;
43
44signals:
45
46 void sigTextVisibilityToggled(bool fTextVisible);
47
48public:
49
50 UIPasswordLineEdit(QWidget *pParent = 0);
51 void toggleTextVisibility(bool fTextVisible);
52
53protected:
54
55 virtual void paintEvent(QPaintEvent *pevent) /* override */;
56
57private:
58
59 void prepare();
60
61 QToolButton *m_pTextVisibilityButton;
62
63private slots:
64
65 void sltHandleTextVisibilityChange();
66};
67
68class UIUserNamePasswordEditor : public QIWithRetranslateUI<QWidget>
69{
70
71 Q_OBJECT;
72
73signals:
74
75 /** this is emitted whenever the content of one of the line edits is changed. */
76 void sigSomeTextChanged();
77
78public:
79
80 UIUserNamePasswordEditor(QWidget *pParent = 0);
81
82 QString userName() const;
83 void setUserName(const QString &strUserName);
84
85 QString password() const;
86 void setPassword(const QString &strPassword);
87
88 /** Returns false if username or password fields are empty, or password fields do not match. */
89 bool isComplete();
90
91protected:
92
93 void retranslateUi();
94
95private slots:
96
97 void sltHandlePasswordVisibility(bool fPasswordVisible);
98
99private:
100
101 void prepare();
102 template <class T>
103 void addLineEdit(int &iRow, QLabel *&pLabel, T *&pLineEdit, QGridLayout *pLayout);
104 /** Changes @p pLineEdit's base color to indicate an error or reverts it to the original color. */
105 void markLineEdit(QLineEdit *pLineEdit, bool fError);
106
107 QLineEdit *m_pUserNameLineEdit;
108 UIPasswordLineEdit *m_pPasswordLineEdit;
109 UIPasswordLineEdit *m_pPasswordRepeatLineEdit;
110
111 QLabel *m_pUserNameLabel;
112 QLabel *m_pPasswordLabel;
113 QLabel *m_pPasswordRepeatLabel;
114 QColor m_orginalLineEditBaseColor;
115};
116
117/* 2nd page of the New Virtual Machine wizard (base part): */
118class UIWizardNewVMPageInstallSetup : public UIWizardPageBase
119{
120public:
121
122 UIWizardNewVMPageInstallSetup();
123
124 /** @name Property getters
125 * @{ */
126 QString userName() const;
127 QString password() const;
128 QString hostname() const;
129 /** @} */
130
131protected:
132
133 /* Widgets: */
134 UIUserNamePasswordEditor *m_pUserNamePasswordEditor;
135 QLineEdit *m_pHostnameLineEdit;
136 QLabel *m_pHostnameLabel;
137};
138
139class UIWizardNewVMPageBasicInstallSetup : public UIWizardPage, public UIWizardNewVMPageInstallSetup
140{
141 Q_OBJECT;
142 Q_PROPERTY(QString userName READ userName);
143 Q_PROPERTY(QString password READ password);
144 Q_PROPERTY(QString hostname READ hostname);
145
146public:
147
148 /* Constructor: */
149 UIWizardNewVMPageBasicInstallSetup();
150 void setDefaultUnattendedInstallData(const UIUnattendedInstallData &unattendedInstallData);
151 virtual int nextId() const /* override */;
152
153private slots:
154
155private:
156
157 /* Translation stuff: */
158 void retranslateUi();
159
160 /* Prepare stuff: */
161 void initializePage();
162
163 /* Validation stuff: */
164 bool isComplete() const;
165
166 /* Widgets: */
167 QIRichTextLabel *m_pLabel;
168};
169
170#endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicInstallSetup_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette