VirtualBox

Changeset 55038 in vbox


Ignore:
Timestamp:
Mar 31, 2015 2:25:29 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: 7676: Runtime UI: Disk Encryption (DE) support: Add Password dialog: Automatically select the first password editor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIAddDiskEncryptionPasswordDialog.cpp

    r55016 r55038  
    166166    /** Returns whether the table is valid. */
    167167    bool isValid() const;
     168
     169    /** Initiates the editor for the first index available. */
     170    void editFirstIndex();
    168171
    169172private:
     
    430433}
    431434
     435void UIEncryptionDataTable::editFirstIndex()
     436{
     437    AssertPtrReturnVoid(m_pModelEncryptionData);
     438    /* Compose the password field index of the first available table record: */
     439    const QModelIndex index = m_pModelEncryptionData->index(0, UIEncryptionDataTableSection_Password);
     440    /* Navigate table to the corresponding index: */
     441    setCurrentIndex(index);
     442    /* Compose the fake mouse-event which will trigger the embedded editor: */
     443    QMouseEvent event(QEvent::MouseButtonPress, QPoint(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
     444    /* Initiate the embedded editor for the corresponding index: */
     445    edit(index, QAbstractItemView::SelectedClicked, &event);
     446}
     447
    432448void UIEncryptionDataTable::prepare()
    433449{
     
    533549                connect(m_pTableEncryptionData, SIGNAL(sigDataChanged()),
    534550                        this, SLOT(sltDataChanged()));
     551                m_pTableEncryptionData->setFocus();
     552                m_pTableEncryptionData->editFirstIndex();
    535553                /* Add label into layout: */
    536554                pInputLayout->addWidget(m_pTableEncryptionData);
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