diff options
author | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2022-06-01 18:00:07 +0000 |
---|---|---|
committer | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2022-06-01 18:00:07 +0000 |
commit | 459be5d2ee987c6d4c73b408c114622c4030f48a (patch) | |
tree | a1315676831ba3d45d7d80bb1767178c6e2aef77 | |
parent | 5ed30a43fc77b699cd33bd8df1077130ef2317f1 (diff) | |
download | VirtualBox-svn-459be5d2ee987c6d4c73b408c114622c4030f48a.tar.gz |
FE/Qt: ​bugref:9515. Adding a label to the first page of the new vm wizard to inform user about the state of the unattended install.
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@95165 cfe28804-0f27-0410-a406-dd0f0b0b656f
3 files changed, 47 insertions, 2 deletions
diff --git a/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp b/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp index e3d814fc665..a7de74da95c 100644 --- a/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp +++ b/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp @@ -349,7 +349,7 @@ void UINameAndSystemEditor::retranslateUi() "(called a guest operating system).")); if (m_pSelectorImage) m_pSelectorImage->setToolTip(tr("Selects an ISO image to be attached to the new " - "virtual machine or used in attended install.")); + "virtual machine or used in unattended install.")); } void UINameAndSystemEditor::sltFamilyChanged(int iIndex) diff --git a/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.cpp b/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.cpp index 71318f24a9c..cbee9179d29 100644 --- a/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.cpp +++ b/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.cpp @@ -402,6 +402,7 @@ UIWizardNewVMNameOSTypePage::UIWizardNewVMNameOSTypePage() , m_pNameAndSystemEditor(0) , m_pSkipUnattendedCheckBox(0) , m_pNameOSTypeLabel(0) + , m_pInfoLabel(0) { prepare(); } @@ -492,7 +493,8 @@ void UIWizardNewVMNameOSTypePage::retranslateUi() if (m_pNameOSTypeLabel) m_pNameOSTypeLabel->setText(UIWizardNewVM::tr("Please choose a descriptive name and destination folder for the new " "virtual machine. The name you choose will be used throughout VirtualBox " - "to identify this machine.")); + "to identify this machine. Additionally, you can select an ISO image which " + "may be used to install the guest operating system.")); if (m_pSkipUnattendedCheckBox) { @@ -503,6 +505,42 @@ void UIWizardNewVMNameOSTypePage::retranslateUi() if (m_pNameAndSystemLayout && m_pNameAndSystemEditor) m_pNameAndSystemLayout->setColumnMinimumWidth(0, m_pNameAndSystemEditor->firstColumnWidth()); + + updateInfoLabel(); +} + +void UIWizardNewVMNameOSTypePage::updateInfoLabel() +{ + UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>(); + AssertReturnVoid(pWizard); + + if (!m_pInfoLabel) + return; + + /* + * Here are the scenarios we consider while updating the info label: + * - No ISO selected, + * - Unattended cannot determine OS type from the ISO, + * - Unattended can determine the OS type from the ISO but cannot install it, + * - User has disabled unattended explicitly, + * - Unattended install will kick off. + */ + QString strMessage; + if (m_pNameAndSystemEditor->ISOImagePath().isEmpty()) + strMessage = UIWizardNewVM::tr("No ISO selected, the guest OS will need to be installed manually."); + else if (pWizard->detectedOSTypeId().isEmpty()) + strMessage = UIWizardNewVM::tr("OS type cannot be determined from the selected ISO, the guest OS will need to be installed manually."); + else if (!pWizard->detectedOSTypeId().isEmpty()) + { + if (!pWizard->isUnattendedInstallSupported()) + strMessage = UIWizardNewVM::tr("Detected OS type cannot be installed unattendedly, the guest OS will need to be installed manually."); + else if (pWizard->skipUnattendedInstall()) + strMessage = UIWizardNewVM::tr("You have selected to skip unattended guest OS install, the guest OS will need to be installed manually."); + else + strMessage = UIWizardNewVM::tr("After closing this wizard the guest OS system will start installing from the selected ISO."); + } + + m_pInfoLabel->setText(QString("<img src=\":/session_info_16px.png\" style=\"vertical-align:top\"> %1").arg(strMessage)); } void UIWizardNewVMNameOSTypePage::initializePage() @@ -563,6 +601,7 @@ void UIWizardNewVMNameOSTypePage::sltISOPathChanged(const QString &strPath) setSkipCheckBoxEnable(); setEditionSelectorEnabled(); + updateInfoLabel(); emit completeChanged(); } @@ -587,6 +626,7 @@ void UIWizardNewVMNameOSTypePage::sltSkipUnattendedInstallChanged(bool fSkip) m_userModifiedParameters << "SkipUnattendedInstall"; wizardWindow<UIWizardNewVM>()->setSkipUnattendedInstall(fSkip); setEditionSelectorEnabled(); + updateInfoLabel(); } QWidget *UIWizardNewVMNameOSTypePage::createNameOSTypeWidgets() @@ -615,6 +655,9 @@ QWidget *UIWizardNewVMNameOSTypePage::createNameOSTypeWidgets() m_pSkipUnattendedCheckBox = new QCheckBox; if (m_pSkipUnattendedCheckBox) m_pNameAndSystemLayout->addWidget(m_pSkipUnattendedCheckBox, 1, 1); + m_pInfoLabel = new QIRichTextLabel; + if (m_pInfoLabel) + m_pNameAndSystemLayout->addWidget(m_pInfoLabel, 2, 1); } } diff --git a/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.h b/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.h index b576a661b38..01dc94b9975 100644 --- a/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.h +++ b/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.h @@ -88,6 +88,7 @@ private: bool isUnattendedEnabled() const; bool isUnattendedInstallSupported() const; void setEditionSelectorEnabled(); + void updateInfoLabel(); /** @name Widgets * @{ */ @@ -95,6 +96,7 @@ private: UINameAndSystemEditor *m_pNameAndSystemEditor; QCheckBox *m_pSkipUnattendedCheckBox; QIRichTextLabel *m_pNameOSTypeLabel; + QIRichTextLabel *m_pInfoLabel; /** @} */ QSet<QString> m_userModifiedParameters; }; |