VirtualBox

Changeset 55564 in vbox


Ignore:
Timestamp:
Apr 30, 2015 3:37:42 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: 7676: Disk Encryption (DE) support: Reflect the Encryption Password ID information in VM Settings / Storage page and in Medium Manager.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r54597 r55564  
    140140    /** Returns QString <i>storage details</i> of the wrapped UIMedium. */
    141141    QString details() const { return m_medium.storageDetails(); }
     142    /** Returns QString <i>encryption password ID</i> of the wrapped UIMedium. */
     143    QString encryptionPasswordID() const { return m_medium.encryptionPasswordID(); }
    142144
    143145    /** Returns QString <i>tool-tip</i> of the wrapped UIMedium. */
     
    12051207            prepareTreeWidget(type, type == UIMediumType_HardDisk ? 3 : 2);
    12061208            /* Prepare information-container: */
    1207             prepareInformationContainer(type, type == UIMediumType_HardDisk ? 6 : 3);
     1209            prepareInformationContainer(type, type == UIMediumType_HardDisk ? 7 : 3);
    12081210        }
    12091211    }
     
    16101612    {
    16111613        /* Acquire required details: */
    1612         QString strDetails = pCurrentItem->details();
    1613         QString strUsage = pCurrentItem->usage().isNull() ?
    1614                            formatFieldText(QApplication::translate("VBoxMediaManagerDlg", "<i>Not&nbsp;Attached</i>"), false) :
    1615                            formatFieldText(pCurrentItem->usage());
     1614        const QString strDetails = pCurrentItem->details();
     1615        const QString strUsage = pCurrentItem->usage().isNull() ?
     1616                                 formatFieldText(QApplication::translate("VBoxMediaManagerDlg", "<i>Not&nbsp;Attached</i>"), false) :
     1617                                 formatFieldText(pCurrentItem->usage());
     1618        const QString strEncryptionPasswordID = pCurrentItem->encryptionPasswordID().isNull() ?
     1619                                                formatFieldText(QApplication::translate("VBoxMediaManagerDlg", "<i>Not&nbsp;Encrypted</i>"), false) :
     1620                                                formatFieldText(pCurrentItem->encryptionPasswordID());
    16161621        const QString strID = pCurrentItem->id();
    16171622        if (infoField(UIMediumType_HardDisk, 0))
     
    16261631            infoField(UIMediumType_HardDisk, 4)->setText(strUsage);
    16271632        if (infoField(UIMediumType_HardDisk, 5))
    1628             infoField(UIMediumType_HardDisk, 5)->setText(strID);
     1633            infoField(UIMediumType_HardDisk, 5)->setText(strEncryptionPasswordID);
     1634        if (infoField(UIMediumType_HardDisk, 6))
     1635            infoField(UIMediumType_HardDisk, 6)->setText(strID);
    16291636    }
    16301637
     
    18031810        infoLabel(UIMediumType_HardDisk, 4)->setText(QApplication::translate("VBoxMediaManagerDlg", "Attached to:"));
    18041811    if (infoLabel(UIMediumType_HardDisk, 5))
    1805         infoLabel(UIMediumType_HardDisk, 5)->setText(QApplication::translate("VBoxMediaManagerDlg", "UUID:"));
     1812        infoLabel(UIMediumType_HardDisk, 5)->setText(QApplication::translate("VBoxMediaManagerDlg", "Encrypted with key:"));
     1813    if (infoLabel(UIMediumType_HardDisk, 6))
     1814        infoLabel(UIMediumType_HardDisk, 6)->setText(QApplication::translate("VBoxMediaManagerDlg", "UUID:"));
    18061815
    18071816    /* Translate CD tree-widget: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r54285 r55564  
    866866}
    867867
     868QString AttachmentItem::attEncryptionPasswordID() const
     869{
     870    return m_strAttEncryptionPasswordID;
     871}
     872
    868873void AttachmentItem::cache()
    869874{
     
    880885    mAttLogicalSize = medium.logicalSize (true);
    881886    mAttLocation = medium.location (true);
     887    m_strAttEncryptionPasswordID = QString("--");
    882888    if (medium.isNull())
    883889    {
     
    892898                mAttFormat = QString("%1 (%2)").arg(medium.hardDiskType(true)).arg(medium.hardDiskFormat(true));
    893899                mAttDetails = medium.storageDetails();
     900                const QString strAttEncryptionPasswordID = medium.encryptionPasswordID();
     901                if (!strAttEncryptionPasswordID.isNull())
     902                    m_strAttEncryptionPasswordID = strAttEncryptionPasswordID;
    894903                break;
    895904            }
     
    13751384                if (item->rtti() == AbstractItem::Type_AttachmentItem)
    13761385                    return static_cast <AttachmentItem*> (item)->attUsage();
     1386            return QString();
     1387        }
     1388        case R_AttEncryptionPasswordID:
     1389        {
     1390            if (AbstractItem *pItem = static_cast<AbstractItem*>(aIndex.internalPointer()))
     1391                if (pItem->rtti() == AbstractItem::Type_AttachmentItem)
     1392                    return static_cast<AttachmentItem*>(pItem)->attEncryptionPasswordID();
    13771393            return QString();
    13781394        }
     
    20222038    mLbLocationValue->setFullSizeSelection (true);
    20232039    mLbUsageValue->setFullSizeSelection (true);
     2040    m_pLabelEncryptionValue->setFullSizeSelection(true);
    20242041
    20252042    /* Setup connections: */
     
    27812798                mLbLocationValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttLocation).toString()));
    27822799                mLbUsageValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttUsage).toString()));
     2800                m_pLabelEncryptionValue->setText(compressText(mStorageModel->data(index, StorageModel::R_AttEncryptionPasswordID).toString()));
    27832801
    27842802                /* Showing Attachment Page */
     
    39653983    mLbUsage->setEnabled(isMachineInValidMode());
    39663984    mLbUsageValue->setEnabled(isMachineInValidMode());
     3985    m_pLabelEncryption->setEnabled(isMachineInValidMode());
     3986    m_pLabelEncryptionValue->setEnabled(isMachineInValidMode());
    39673987
    39683988    /* Update action states: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h

    r55401 r55564  
    374374    QString attDetails() const;
    375375    QString attUsage() const;
     376    QString attEncryptionPasswordID() const;
    376377
    377378private:
     
    411412    QString mAttDetails;
    412413    QString mAttUsage;
     414    QString m_strAttEncryptionPasswordID;
    413415};
    414416
     
    465467        R_AttDetails,
    466468        R_AttUsage,
     469        R_AttEncryptionPasswordID,
    467470
    468471        R_Margin,
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.ui

    r51276 r55564  
    571571         </widget>
    572572        </item>
    573         <item row="12" column="0" colspan="3" >
     573        <item row="12" column="1">
     574         <widget class="QLabel" name="m_pLabelEncryption">
     575          <property name="text">
     576           <string>Encrypted with key:</string>
     577          </property>
     578          <property name="alignment">
     579           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     580          </property>
     581         </widget>
     582        </item>
     583        <item row="12" column="2">
     584         <widget class="QILabel" name="m_pLabelEncryptionValue">
     585          <property name="sizePolicy">
     586           <sizepolicy vsizetype="Preferred" hsizetype="Ignored">
     587            <horstretch>0</horstretch>
     588            <verstretch>0</verstretch>
     589           </sizepolicy>
     590          </property>
     591         </widget>
     592        </item>
     593        <item row="13" column="0" colspan="3" >
    574594         <spacer name="mSp6" >
    575595          <property name="orientation" >
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