VirtualBox

Ignore:
Timestamp:
Apr 30, 2015 11:26:20 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99911
Message:

FE/Qt: 7676: Disk Encryption (DE) support: UIMedium should cache the encryption status during the enumeration and reflect in own details report.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/medium
Files:
2 edited

Legend:

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

    r55104 r55545  
    104104    m_fUsedInSnapshots = other.isUsedInSnapshots();
    105105    m_fHostDrive = other.isHostDrive();
     106    m_fEncrypted = other.isEncrypted();
    106107
    107108    return *this;
     
    170171    m_fUsedInSnapshots = false;
    171172    m_fHostDrive = false;
     173    m_fEncrypted = false;
    172174
    173175    /* For non NULL medium: */
     
    241243                    m_strRootId = parentMedium.GetId();
    242244                    parentMedium = parentMedium.GetParent();
     245                }
     246
     247                /* Check whether this medium is encrypted: */
     248                if (m_strRootId != m_strId)
     249                    m_fEncrypted = root().isEncrypted();
     250                else
     251                {
     252                    QString strCipher;
     253                    CMedium medium(m_medium);
     254                    medium.GetEncryptionSettings(strCipher);
     255                    m_fEncrypted = medium.isOk();
    243256                }
    244257            }
     
    474487            strDetails = QString("%1, ").arg(rootMedium.m_strHardDiskType);
    475488        }
     489
     490        /* Add encryption status: */
     491        if (m_fEncrypted)
     492            strDetails += QString("%1, ").arg(VBoxGlobal::tr("Encrypted", "medium"));
    476493    }
    477494
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h

    r55401 r55545  
    264264    bool isHostDrive() const { return m_fHostDrive; }
    265265
     266    /** Returns whether this medium is encrypted. */
     267    bool isEncrypted() const { return m_fEncrypted; }
     268
    266269    /** Returns whether this medium is attached to any VM (in the current state or in a snapshot) in which case
    267270      * #usage() will contain a string with comma-separated VM names (with snapshot names, if any, in parenthesis). */
     
    357360    /** Holds whether this medium corresponds to real host drive. */
    358361    bool m_fHostDrive                : 1;
     362    /** Holds whether this medium is encrypted. */
     363    bool m_fEncrypted                : 1;
    359364
    360365    /** Holds the NULL medium ID. */
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