VirtualBox

Changeset 90165 in vbox


Ignore:
Timestamp:
Jul 13, 2021 8:13:50 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996. Using UIUserNamePasswordGroupBox

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardNewVMEditors.cpp

    r90164 r90165  
    7979    return false;
    8080}
     81
     82void UIUserNamePasswordGroupBox::setLabelsVisible(bool fVisible)
     83{
     84    if (m_pUserNamePasswordEditor)
     85        m_pUserNamePasswordEditor->setLabelsVisible(fVisible);
     86}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardNewVMEditors.h

    r90164 r90165  
    5757       void setPassword(const QString &strPassword);
    5858       bool isComplete();
     59       void setLabelsVisible(bool fVisible);
    5960    /** @} */
    6061
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r90163 r90165  
    4343#include "UIUserNamePasswordEditor.h"
    4444#include "UIWizardNewVM.h"
     45#include "UIWizardNewVMEditors.h"
    4546#include "UIWizardNewVMPageExpert.h"
    4647
     
    264265
    265266    // /* Connections for username, password, and hostname: */
    266     // if (m_pUserNamePasswordEditor)
    267     //     connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged,
     267    // if (m_pUserNamePasswordGroupBox)
     268    //     connect(m_pUserNamePasswordGroupBox, &UIUserNamePasswordEditor::sigSomeTextChanged,
    268269    //             this, &UIWizardNewVMPageExpert::completeChanged);
    269270    // if (m_pGAISOFilePathSelector)
     
    402403    pLayout->setContentsMargins(0, 0, 0, 0);
    403404    int iRow = 0;
    404 
    405     /* Username selector: */
    406     pLayout->addWidget(createUserNameWidgets(), iRow, 0, 1, 2);
     405    m_pUserNamePasswordGroupBox = new UIUserNamePasswordGroupBox;
     406    AssertReturn(m_pUserNamePasswordGroupBox, 0);
     407    pLayout->addWidget(m_pUserNamePasswordGroupBox, iRow, 0, 1, 2);
    407408
    408409    /* Additional options: */
     
    520521    //         fIsComplete = false;
    521522    //     }
    522     //     if (m_pUserNamePasswordEditor)
    523     //     {
    524     //         if (!m_pUserNamePasswordEditor->isComplete())
     523    //     if (m_pUserNamePasswordGroupBox)
     524    //     {
     525    //         if (!m_pUserNamePasswordGroupBox->isComplete())
    525526    //         {
    526527    //             m_pToolBox->setPageTitleIcon(ExpertToolboxItems_Unattended,
     
    860861}
    861862
    862 QWidget *UIWizardNewVMPageExpert::createUserNameWidgets()
    863 {
    864     if (m_pUserNameContainer)
    865         return m_pUserNameContainer;
    866 
    867     m_pUserNameContainer = new QGroupBox;
    868     QVBoxLayout *pUserNameContainerLayout = new QVBoxLayout(m_pUserNameContainer);
    869     m_pUserNamePasswordEditor = new UIUserNamePasswordEditor;
    870     AssertReturn(m_pUserNamePasswordEditor, 0);
    871 
    872     m_pUserNamePasswordEditor->setLabelsVisible(true);
    873     m_pUserNamePasswordEditor->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    874     pUserNameContainerLayout->addWidget(m_pUserNamePasswordEditor);
    875 
    876     return m_pUserNameContainer;
    877 }
    878 
    879863QWidget *UIWizardNewVMPageExpert::createAdditionalOptionsWidgets()
    880864{
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r90159 r90165  
    4343class UINameAndSystemEditor;
    4444class UIToolBox;
    45 class UIUserNamePasswordEditor;
     45class UIUserNamePasswordGroupBox;
    4646class QIToolButton;
    4747
     
    114114                                                  CMediumFormat medFormat, bool fPreferred /* = false */);
    115115    QWidget *createNameOSTypeWidgets();
    116     QWidget *createUserNameWidgets();
    117116    QWidget *createAdditionalOptionsWidgets();
    118117    QWidget *createGAInstallWidgets();
     
    152151    UIFilePathSelector *m_pGAISOFilePathSelector;
    153152    QGroupBox *m_pUserNameContainer;
    154     UIUserNamePasswordEditor *m_pUserNamePasswordEditor;
     153    UIUserNamePasswordGroupBox *m_pUserNamePasswordGroupBox;
    155154
    156155    /** @} */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp

    r90157 r90165  
    3131#include "UIFilePathSelector.h"
    3232#include "UIIconPool.h"
    33 #include "UIUserNamePasswordEditor.h"
     33#include "UIWizardNewVMEditors.h"
    3434#include "UIHostnameDomainNameEditor.h"
    3535#include "UIWizardNewVMUnattendedPageBasic.h"
     
    5757UIWizardNewVMUnattendedPageBasic::UIWizardNewVMUnattendedPageBasic()
    5858    : m_pLabel(0)
    59     , m_pUserNameContainer(0)
    6059    , m_pAdditionalOptionsContainer(0)
    6160    , m_pGAInstallationISOContainer(0)
    6261    , m_pStartHeadlessCheckBox(0)
    63     , m_pUserNamePasswordEditor(0)
     62    , m_pUserNamePasswordGroupBox(0)
    6463    , m_pHostnameDomainNameEditor(0)
    6564    , m_pGAISOPathLabel(0)
     
    7877    if (m_pLabel)
    7978        pMainLayout->addWidget(m_pLabel, 0, 0, 1, 2);
    80     pMainLayout->addWidget(createUserNameWidgets(), 1, 0, 1, 1);
     79    m_pUserNamePasswordGroupBox = new UIUserNamePasswordGroupBox;
     80    AssertReturnVoid(m_pUserNamePasswordGroupBox);
     81    pMainLayout->addWidget(m_pUserNamePasswordGroupBox, 1, 0, 1, 1);
    8182    pMainLayout->addWidget(createAdditionalOptionsWidgets(), 1, 1, 1, 1);
    8283    pMainLayout->addWidget(createGAInstallWidgets(), 2, 0, 1, 2);
    8384    pMainLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding), 3, 0, 1, 2);
    8485
    85      createConnections();
     86    createConnections();
    8687}
    8788
    8889void UIWizardNewVMUnattendedPageBasic::createConnections()
    8990{
    90     if (m_pUserNamePasswordEditor)
    91     {
    92         connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigPasswordChanged,
     91    if (m_pUserNamePasswordGroupBox)
     92    {
     93        connect(m_pUserNamePasswordGroupBox, &UIUserNamePasswordGroupBox::sigPasswordChanged,
    9394                this, &UIWizardNewVMUnattendedPageBasic::sltPasswordChanged);
    94         connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigUserNameChanged,
     95        connect(m_pUserNamePasswordGroupBox, &UIUserNamePasswordGroupBox::sigUserNameChanged,
    9596                this, &UIWizardNewVMUnattendedPageBasic::sltUserNameChanged);
    9697    }
     
    132133    if (m_pProductKeyLabel)
    133134        m_pProductKeyLabel->setText(UIWizardNewVM::tr("&Product Key:"));
    134     if (m_pUserNameContainer)
    135         m_pUserNameContainer->setTitle(UIWizardNewVM::tr("Username and Password"));
     135    if (m_pUserNamePasswordGroupBox)
     136        m_pUserNamePasswordGroupBox->setTitle(UIWizardNewVM::tr("Username and Password"));
    136137    if (m_pAdditionalOptionsContainer)
    137138        m_pAdditionalOptionsContainer->setTitle(UIWizardNewVM::tr("Additional Options"));
     
    154155    AssertReturnVoid(pWizard);
    155156    /* Initialize user/password if they are not modified by the user: */
    156     if (m_pUserNamePasswordEditor)
    157     {
    158         m_pUserNamePasswordEditor->blockSignals(true);
     157    if (m_pUserNamePasswordGroupBox)
     158    {
     159        m_pUserNamePasswordGroupBox->blockSignals(true);
    159160        if (!m_userModifiedParameters.contains("UserName"))
    160             m_pUserNamePasswordEditor->setUserName(pWizard->userName());
     161            m_pUserNamePasswordGroupBox->setUserName(pWizard->userName());
    161162        if (!m_userModifiedParameters.contains("Password"))
    162             m_pUserNamePasswordEditor->setPassword(pWizard->password());
    163         m_pUserNamePasswordEditor->blockSignals(false);
     163            m_pUserNamePasswordGroupBox->setPassword(pWizard->password());
     164        m_pUserNamePasswordGroupBox->blockSignals(false);
    164165    }
    165166    if (m_pHostnameDomainNameEditor)
     
    199200        !UIWizardNewVMUnattendedPage::checkGAISOFile(m_pGAISOFilePathSelector))
    200201        return false;
    201     if (m_pUserNamePasswordEditor && !m_pUserNamePasswordEditor->isComplete())
     202    if (m_pUserNamePasswordGroupBox && !m_pUserNamePasswordGroupBox->isComplete())
    202203        return false;
    203204    if (m_pHostnameDomainNameEditor && !m_pHostnameDomainNameEditor->isComplete())
     
    267268{
    268269    newVMWizardPropertySet(StartHeadless, fStartHeadless);
    269 }
    270 
    271 QWidget *UIWizardNewVMUnattendedPageBasic::createUserNameWidgets()
    272 {
    273     if (m_pUserNameContainer)
    274         return m_pUserNameContainer;
    275 
    276     m_pUserNameContainer = new QGroupBox;
    277     QVBoxLayout *pUserNameContainerLayout = new QVBoxLayout(m_pUserNameContainer);
    278     m_pUserNamePasswordEditor = new UIUserNamePasswordEditor;
    279     if (m_pUserNamePasswordEditor)
    280     {
    281         m_pUserNamePasswordEditor->setLabelsVisible(true);
    282         m_pUserNamePasswordEditor->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    283         pUserNameContainerLayout->addWidget(m_pUserNamePasswordEditor);
    284     }
    285     return m_pUserNameContainer;
    286270}
    287271
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.h

    r90157 r90165  
    3434class QIRichTextLabel;
    3535class UIFilePathSelector;
    36 class UIUserNamePasswordEditor;
     36class UIUserNamePasswordGroupBox;
    3737class UIHostnameDomainNameEditor;
    3838struct UIUnattendedInstallData;
     
    7373    void prepare();
    7474    void createConnections();
    75     QWidget *createUserNameWidgets();
    7675    QWidget *createAdditionalOptionsWidgets();
    7776    QWidget *createGAInstallWidgets();
     
    8988      * @{ */
    9089        QIRichTextLabel *m_pLabel;
    91         QGroupBox *m_pUserNameContainer;
    9290        QGroupBox *m_pAdditionalOptionsContainer;
    9391        QGroupBox *m_pGAInstallationISOContainer;
    9492        QCheckBox *m_pStartHeadlessCheckBox;
    95         UIUserNamePasswordEditor *m_pUserNamePasswordEditor;
     93        UIUserNamePasswordGroupBox *m_pUserNamePasswordGroupBox;
    9694        UIHostnameDomainNameEditor *m_pHostnameDomainNameEditor;
    9795        QLabel    *m_pGAISOPathLabel;
Note: See TracChangeset for help on using the changeset viewer.

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