VirtualBox

Changeset 85110 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 8, 2020 2:23:18 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139044
Message:

FE/Qt: bugref:9515. Fixing more isComplete related stuff

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

Legend:

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

    r84969 r85110  
    122122}
    123123
    124 bool UIUserNamePasswordEditor::isComplete()
    125 {
    126     if (m_pUserNameLineEdit && m_pUserNameLineEdit->text().isEmpty())
    127     {
    128         markLineEdit(m_pUserNameLineEdit, true);
    129         return false;
    130     }
    131     else
    132         markLineEdit(m_pUserNameLineEdit, false);
     124bool UIUserNamePasswordEditor::isUserNameComplete()
     125{
     126    bool fComplete = (m_pUserNameLineEdit && !m_pUserNameLineEdit->text().isEmpty());
     127    markLineEdit(m_pUserNameLineEdit, !fComplete);
     128    return fComplete;
     129}
     130
     131bool UIUserNamePasswordEditor::isPasswordComplete()
     132{
    133133    bool fPasswordOK = true;
    134134    if (m_pPasswordLineEdit && m_pPasswordRepeatLineEdit)
     
    144144}
    145145
     146bool UIUserNamePasswordEditor::isComplete()
     147{
     148    bool fUserNameField = isUserNameComplete();
     149    bool fPasswordField = isPasswordComplete();
     150    return fUserNameField && fPasswordField;
     151}
     152
    146153void UIUserNamePasswordEditor::retranslateUi()
    147154{
     
    182189    pLabel->setBuddy(pLineEdit);
    183190    ++iRow;
    184     connect(pLineEdit, &T::textChanged, this, &UIUserNamePasswordEditor::sigSomeTextChanged);
     191    connect(pLineEdit, &T::textChanged, this, &UIUserNamePasswordEditor::sltSomeTextChanged);
    185192    return;
    186193}
     
    228235        m_pPasswordRepeatLineEdit->toggleTextVisibility(fPasswordVisible);
    229236}
     237
     238void UIUserNamePasswordEditor::sltSomeTextChanged()
     239{
     240    /* Check text lines edits and mark them accordingly: */
     241    isComplete();
     242    emit sigSomeTextChanged();
     243}
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.h

    r84969 r85110  
    9191
    9292    void sltHandlePasswordVisibility(bool fPasswordVisible);
     93    void sltSomeTextChanged();
    9394
    9495private:
     
    99100    /** Changes @p pLineEdit's base color to indicate an error or reverts it to the original color. */
    100101    void markLineEdit(QLineEdit *pLineEdit, bool fError);
     102
     103    bool isUserNameComplete();
     104    bool isPasswordComplete();
    101105
    102106    QLineEdit          *m_pUserNameLineEdit;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp

    r85090 r85110  
    207207        {
    208208            if (m_pNameAndSystemEditor)
    209             {
    210                 m_pNameAndSystemEditor->blockSignals(true);
    211209                m_pNameAndSystemEditor->setType(uiCommon().vmGuestOSType(gs_OSTypePattern[i].pcstId));
    212                 m_pNameAndSystemEditor->blockSignals(false);
    213             }
    214210            break;
    215211        }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r85108 r85110  
    352352            return false;
    353353    }
     354    if (m_pUserNamePasswordEditor)
     355    {
     356        if (!m_pUserNamePasswordEditor->isComplete())
     357            return false;
     358    }
    354359    return true;
    355360}
Note: See TracChangeset for help on using the changeset viewer.

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