VirtualBox

Changeset 47952 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 21, 2013 8:40:17 AM (11 years ago)
Author:
vboxsync
Message:

Frontends/VirtualBox: add a way to hide a medium from the virtual media manager, independent of hiding VMs

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

Legend:

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

    r47150 r47952  
    4242UIMedium& UIMedium::operator= (const UIMedium &aOther)
    4343{
    44     m_fAttachedToHiddenMachinesOnly = aOther.isAttachedToHiddenMachinesOnly();
     44    m_fHide = aOther.m_fHide;
     45    m_fAttachedToHiddenMachinesOnly = aOther.m_fAttachedToHiddenMachinesOnly;
    4546
    4647    mMedium = aOther.medium();
     
    123124void UIMedium::refresh()
    124125{
    125     /* We assume this flag is 'false' by default: */
     126    /* We assume these flags are 'false' by default: */
     127    m_fHide = false;
    126128    m_fAttachedToHiddenMachinesOnly = false;
    127129
     
    142144    mLocation = mMedium.isNull() || mIsHostDrive ? QString ("--") :
    143145                QDir::toNativeSeparators (mMedium.GetLocation());
     146
     147    QString tmp;
     148    if (!mMedium.isNull())
     149        tmp = mMedium.GetProperty("Special/GUI/Hints");
     150    if (!tmp.isEmpty())
     151    {
     152        QStringList tmpList(tmp.split(','));
     153        if (tmpList.contains("Hide", Qt::CaseInsensitive))
     154            m_fHide = true;
     155    }
    144156
    145157    if (mType == UIMediumType_HardDisk)
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h

    r46756 r47952  
    66
    77/*
    8  * Copyright (C) 2009-2012 Oracle Corporation
     8 * Copyright (C) 2009-2013 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    130130    void refresh();
    131131
    132     bool isAttachedToHiddenMachinesOnly() const { return m_fAttachedToHiddenMachinesOnly; }
     132    bool isHidden() const { return m_fHide | m_fAttachedToHiddenMachinesOnly; }
    133133
    134134    const CMedium &medium() const { return mMedium; }
     
    244244    void checkNoDiffs (bool aNoDiffs);
    245245
    246     bool m_fAttachedToHiddenMachinesOnly;
    247 
    248246    CMedium mMedium;
    249247
     
    272270    bool mIsUsedInSnapshots : 1;
    273271    bool mIsHostDrive       : 1;
     272    bool m_fHide            : 1;
     273    bool m_fAttachedToHiddenMachinesOnly : 1;
    274274
    275275    QList <QString> mCurStateMachineIds;
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r47831 r47952  
    778778        return;
    779779
    780     /* Ignore mediums (and their children) attached to hidden machines only: */
     780    /* Ignore mediums (and their children) which are marked as hidden or
     781     * which are attached to hidden machines only: */
    781782    if (isMediumAttachedToHiddenMachinesOnly(aMedium))
    782783        return;
     
    893894        return;
    894895
    895     /* Ignore mediums (and their children) attached to hidden machines only: */
     896    /* Ignore mediums (and their children) which are marked as hidden or
     897     * which are attached to hidden machines only: */
    896898    if (isMediumAttachedToHiddenMachinesOnly(aMedium))
    897899        return;
     
    19982000    do
    19992001    {
    2000         /* Ignore medium if its attached to hidden machines only: */
    2001         if (pMedium->isAttachedToHiddenMachinesOnly())
     2002        /* Ignore medium if its hidden or attached to hidden machines only: */
     2003        if (pMedium->isHidden())
    20022004            return true;
    20032005        /* Move iterator to parent: */
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