VirtualBox

Changeset 92648 in vbox


Ignore:
Timestamp:
Nov 30, 2021 11:55:20 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148543
Message:

FE/Qt: bugref:9371. Using UIPasswordLineEdit instead of QLineEdit in session panel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestSessionPanel.cpp

    r92616 r92648  
    2424#include "QILineEdit.h"
    2525#include "UIFileManagerGuestSessionPanel.h"
     26#include "UIUserNamePasswordEditor.h"
    2627
    2728/*********************************************************************************************************************************
     
    5758
    5859    void sltCreateButtonClick();
    59     void sltShowHidePassword(bool flag);
    6060    void sltHandleTextChanged(const QString &strText);
    6161
     
    6464    void          prepareWidgets();
    6565    QILineEdit   *m_pUserNameEdit;
    66     QILineEdit   *m_pPasswordEdit;
     66    UIPasswordLineEdit   *m_pPasswordEdit;
    6767    QPushButton  *m_pCreateButton;
    6868    QPushButton  *m_pCloseButton;
    6969    QHBoxLayout  *m_pMainLayout;
    70     QCheckBox    *m_pShowPasswordCheckBox;
    7170    QColor        m_defaultBaseColor;
    7271    QColor        m_errorBaseColor;
     
    8685    , m_pCloseButton(0)
    8786    , m_pMainLayout(0)
    88     , m_pShowPasswordCheckBox(0)
    8987    , m_fMarkedForError(0)
    9088{
     
    111109    }
    112110
    113     m_pPasswordEdit = new QILineEdit;
     111    m_pPasswordEdit = new UIPasswordLineEdit;
    114112    if (m_pPasswordEdit)
    115113    {
     
    117115        m_pPasswordEdit->setPlaceholderText(QApplication::translate("UIFileManager", "Password"));
    118116        m_pPasswordEdit->setEchoMode(QLineEdit::Password);
    119         connect(m_pPasswordEdit, &QILineEdit::textChanged,
     117        connect(m_pPasswordEdit, &UIPasswordLineEdit::textChanged,
    120118                this, &UIGuestSessionCreateWidget::sltHandleTextChanged);
    121     }
    122 
    123     m_pShowPasswordCheckBox = new QCheckBox;
    124     if (m_pShowPasswordCheckBox)
    125     {
    126         m_pShowPasswordCheckBox->setText(QApplication::translate("UIFileManager", "Show Password"));
    127         m_pMainLayout->addWidget(m_pShowPasswordCheckBox);
    128         connect(m_pShowPasswordCheckBox, &QCheckBox::toggled,
    129                 this, &UIGuestSessionCreateWidget::sltShowHidePassword);
    130119    }
    131120
     
    152141    if (m_pUserNameEdit && m_pPasswordEdit)
    153142        emit sigCreateSession(m_pUserNameEdit->text(), m_pPasswordEdit->text());
    154 }
    155 
    156 void UIGuestSessionCreateWidget::sltShowHidePassword(bool flag)
    157 {
    158     if (!m_pPasswordEdit)
    159         return;
    160     if (flag)
    161         m_pPasswordEdit->setEchoMode(QLineEdit::Normal);
    162     else
    163         m_pPasswordEdit->setEchoMode(QLineEdit::Password);
    164143}
    165144
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