VirtualBox

Changeset 90037 in vbox


Ignore:
Timestamp:
Jul 5, 2021 7:14:04 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996. Unattended install page changes.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.cpp

    r88267 r90037  
    206206    , m_pPasswordLabel(0)
    207207    , m_pPasswordRepeatLabel(0)
    208     , m_fForceUnmark(false)
    209208    , m_fShowPlaceholderText(true)
    210209    , m_fLabelsVisible(true)
     
    256255        if (m_pPasswordLineEdit->text() != m_pPasswordRepeatLineEdit->text())
    257256            fPasswordOK = false;
     257#if 0
    258258        if (m_pPasswordLineEdit->text().isEmpty())
    259259            fPasswordOK = false;
    260 
     260#endif
    261261        m_pPasswordLineEdit->mark(!fPasswordOK, m_strPasswordError);
    262262        m_pPasswordRepeatLineEdit->mark(!fPasswordOK, m_strPasswordError);
     
    270270    bool fPasswordField = isPasswordComplete();
    271271    return fUserNameField && fPasswordField;
    272 }
    273 
    274 void UIUserNamePasswordEditor::setForceUnmark(bool fForceUnmark)
    275 {
    276     m_fForceUnmark = fForceUnmark;
    277     isUserNameComplete();
    278     isPasswordComplete();
    279272}
    280273
     
    355348    pLayout->addWidget(pLabel, iRow, 0, 1, 1);
    356349
    357 
    358350    pLineEdit = new T;
    359351    if (!pLineEdit)
     
    363355    pLabel->setBuddy(pLineEdit);
    364356    ++iRow;
    365     connect(pLineEdit, &T::textChanged, this, &UIUserNamePasswordEditor::sltSomeTextChanged);
    366357    return;
    367358}
     
    385376    connect(m_pPasswordRepeatLineEdit, &UIPasswordLineEdit::sigTextVisibilityToggled,
    386377            this, &UIUserNamePasswordEditor::sltHandlePasswordVisibility);
     378    connect(m_pPasswordLineEdit, &UIPasswordLineEdit::textChanged,
     379            this, &UIUserNamePasswordEditor::sltPasswordChanged);
     380    connect(m_pUserNameLineEdit, &QILineEdit::textChanged,
     381            this, &UIUserNamePasswordEditor::sltUserNameChanged);
     382
    387383    /* Cache the original back color of the line edit to restore it correctly: */
    388384    if (m_pUserNameLineEdit)
     
    400396}
    401397
    402 void UIUserNamePasswordEditor::sltSomeTextChanged()
    403 {
    404     /* Check text lines edits and mark them accordingly: */
    405     isComplete();
    406     emit sigSomeTextChanged();
    407 }
     398void UIUserNamePasswordEditor::sltUserNameChanged()
     399{
     400    if (isUserNameComplete())
     401        emit sigUserNameChanged(m_pUserNameLineEdit->text());
     402}
     403
     404void UIUserNamePasswordEditor::sltPasswordChanged()
     405{
     406    if (isPasswordComplete())
     407        emit sigPasswordChanged(m_pPasswordLineEdit->text());
     408}
     409
    408410
    409411#include "UIUserNamePasswordEditor.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.h

    r87734 r90037  
    4242signals:
    4343
    44     /** this is emitted whenever the content of one of the line edits is changed. */
    45     void sigSomeTextChanged();
     44    void sigUserNameChanged(const QString &strUserName);
     45    void sigPasswordChanged(const QString &strPassword);
     46
    4647
    4748public:
     
    5758    /** Returns false if username or password fields are empty, or password fields do not match. */
    5859    bool isComplete();
    59     /** Sets m_fForceUnmark flag. see it for more info. */
    60     void setForceUnmark(bool fForceUnmark);
    6160
    6261    /** When fEnabled true place holder texts for the line edits are shown. */
     
    7170
    7271    void sltHandlePasswordVisibility(bool fPasswordVisible);
    73     void sltSomeTextChanged();
     72    void sltUserNameChanged();
     73    void sltPasswordChanged();
    7474
    7575private:
     
    9090    QLabel *m_pPasswordRepeatLabel;
    9191    QColor m_orginalLineEditBaseColor;
    92     /** When true line edits are not marked even if they have to be. */
    93     bool m_fForceUnmark;
     92
    9493    bool m_fShowPlaceholderText;
    9594    bool m_fLabelsVisible;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r90033 r90037  
    630630}
    631631
    632 QString UIWizardNewVM::ISOFilePath() const
    633 {
    634     // QString strPath = getStringFieldValue("ISOFilePath");
    635     // if (strPath.isNull() || strPath.isEmpty())
    636     //     return QString();
    637     // QFileInfo isoFileInfo(strPath);
    638     // if (isoFileInfo.exists() && isoFileInfo.isReadable())
    639     //     return strPath;
    640     return QString();
    641 }
    642 
    643632CMedium &UIWizardNewVM::virtualDisk()
    644633{
     
    735724}
    736725
     726const QString &UIWizardNewVM::ISOFilePath() const
     727{
     728    return m_strISOFilePath;
     729}
     730
     731void UIWizardNewVM::setISOFilePath(const QString &strISOFilePath)
     732{
     733    m_strISOFilePath = strISOFilePath;
     734}
     735
     736const QString &UIWizardNewVM::userName() const
     737{
     738    return m_strUserName;
     739}
     740
     741void UIWizardNewVM::setUserName(const QString &strUserName)
     742{
     743    m_strUserName = strUserName;
     744}
     745
     746const QString &UIWizardNewVM::password() const
     747{
     748    return m_strPassword;
     749}
     750
     751void UIWizardNewVM::setPassword(const QString &strPassword)
     752{
     753    m_strPassword = strPassword;
     754}
     755
    737756const UIUnattendedInstallData &UIWizardNewVM::unattendedInstallData() const
    738757{
    739     // m_unattendedInstallData.m_strISOPath = getStringFieldValue("ISOFilePath");
     758    m_unattendedInstallData.m_strISOPath = m_strISOFilePath;
    740759    // m_unattendedInstallData.m_strUserName = getStringFieldValue("userName");
    741760    // m_unattendedInstallData.m_strHostname = getStringFieldValue("hostname");
    742761    // m_unattendedInstallData.m_strPassword = getStringFieldValue("password");
    743     // m_unattendedInstallData.m_strDetectedOSTypeId = getStringFieldValue("detectedOSTypeId");
     762    m_unattendedInstallData.m_strDetectedOSTypeId = m_strDetectedOSTypeId;
    744763    // // m_unattendedInstallData.m_strDetectedOSVersion = getStringFieldValue("detectedOSVersion");
    745764    // // m_unattendedInstallData.m_strDetectedOSFlavor = getStringFieldValue("detectedOSFlavor");
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h

    r90033 r90037  
    111111    void setInstallGuestAdditions(bool fInstallGA);
    112112
     113    const QString &ISOFilePath() const;
     114    void setISOFilePath(const QString &strISOFilePath);
     115
     116    const QString &userName() const;
     117    void setUserName(const QString &strUserName);
     118
     119    const QString &password() const;
     120    void setPassword(const QString &strPassword);
     121
    113122protected:
    114123
     
    138147    QString getNextControllerName(KStorageBus type);
    139148    void setFieldsFromDefaultUnttendedInstallData();
    140     /* Returns ISO file path if a readable ISO file is selected. Returns an empty string otherwise. */
    141     QString ISOFilePath() const;
    142149
    143150    /** @name Variables
     
    154161       mutable UIUnattendedInstallData m_unattendedInstallData;
    155162    /** @} */
     163
     164    /** Path of the ISO file attached to the new vm. Possibly used for the unattended install. */
     165    QString m_strISOFilePath;
    156166
    157167    /** Path of the folder created by this wizard page. Used to remove previously created
     
    174184    /** True if guest additions are to be installed during unattended install. */
    175185    bool m_fInstallGuestAdditions;
     186
     187    QString m_strUserName;
     188    QString m_strPassword;
    176189};
    177190
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePageBasic.cpp

    r90033 r90037  
    463463{
    464464    UIWizardNewVMNameOSTypePage::determineOSType(strPath, m_pWizard);
    465     if (m_pWizard && !m_pWizard->detectedOSTypeId().isEmpty())
    466         UIWizardNewVMNameOSTypePage::onNameChanged(m_pNameAndSystemEditor, m_pWizard->detectedOSTypeId());
     465    if (m_pWizard)
     466    {
     467        if (!m_pWizard->detectedOSTypeId().isEmpty())
     468            UIWizardNewVMNameOSTypePage::onNameChanged(m_pNameAndSystemEditor, m_pWizard->detectedOSTypeId());
     469        m_pWizard->setISOFilePath(strPath);
     470    }
    467471    /* Update the global recent ISO path: */
    468472    QFileInfo fileInfo(strPath);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePageBasic.h

    r90033 r90037  
    5353    /** Return false if ISO path is not empty but points to an missing or unreadable file. */
    5454    bool checkISOFile(UINameAndSystemEditor *pNameAndSystemEditor);
    55 //     /** @name Property getters/setters
    56 //       * @{ */
    5755
    5856//         QString guestOSFamiyId() const;
    59 
    6057//         const QString &detectedOSTypeId() const;
    61 
    6258//         bool skipUnattendedInstall() const;
    63 //     /** @} */
    64 
    65 
    66 //     /** Colors the widgets red if they cause isComplete to fail. */
    67 //     void retranslateWidgets();
    68 //     QString ISOFilePath() const;
    69 
    70 
    71 //
    72 
    73 // private:
    74 
    75 
    76 // };
    7759}
    7860
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp

    r90033 r90037  
    8585
    8686
    87 // void UIWizardNewVMUnattendedPage::setInstallGuestAdditions(bool fInstallGA)
    88 // {
    89 //     if (m_pGAInstallationISOContainer)
    90 //         m_pGAInstallationISOContainer->setChecked(fInstallGA);
    91 // }
    9287
    9388// QString UIWizardNewVMUnattendedPage::guestAdditionsISOPath() const
     
    171166void UIWizardNewVMUnattendedPageBasic::createConnections()
    172167{
    173     if (m_pUserNamePasswordEditor)
    174         connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged,
    175                 this, &UIWizardNewVMUnattendedPageBasic::completeChanged);
     168    // if (m_pUserNamePasswordEditor)
     169    //     connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged,
     170    //             this, &UIWizardNewVMUnattendedPageBasic::completeChanged);
    176171    if (m_pGAISOFilePathSelector)
    177172        connect(m_pGAISOFilePathSelector, &UIFilePathSelector::pathChanged,
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.h

    r90033 r90037  
    8787    void sltInstallGACheckBoxToggle(bool fChecked);
    8888    void sltGAISOPathChanged(const QString &strPath);
     89    // void sltPasswordChanged(const QString &strPassword);
     90    // void sltUserNameChanged(const QString &strUserName);
    8991
    9092private:
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