VirtualBox

Changeset 24419 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 5, 2009 11:32:59 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: Storage Settings UI: More correct verbose attribute processing when adding new attachment (including adding when loading).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxVMSettingsHD.h

    r24395 r24419  
    467467    void delController (const QUuid &aCtrId);
    468468
    469     QModelIndex addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType);
     469    QModelIndex addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, bool aVerbose);
    470470    void delAttachment (const QUuid &aCtrId, const QUuid &aAttId);
    471471
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsHD.cpp

    r24417 r24419  
    504504    QStringList usedImages;
    505505    for (int i = 0; i < mAttachments.size(); ++ i)
    506         usedImages << static_cast <AttachmentItem*> (mAttachments [i])->attMediumId();
     506    {
     507        QString usedMediumId = static_cast <AttachmentItem*> (mAttachments [i])->attMediumId();
     508        if (!vboxGlobal().findMedium (usedMediumId).isNull())
     509            usedImages << usedMediumId;
     510    }
    507511    return usedImages;
    508512}
     
    13521356}
    13531357
    1354 QModelIndex StorageModel::addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType)
     1358QModelIndex StorageModel::addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, bool aVerbose)
    13551359{
    13561360    if (AbstractItem *parent = mRootItem->childById (aCtrId))
     
    13591363        QModelIndex parentIndex = index (parentPosition, 0, root());
    13601364        beginInsertRows (parentIndex, parent->childCount(), parent->childCount());
    1361         new AttachmentItem (parent, aDeviceType, qobject_cast <QWidget*> (QObject::parent())->isVisible());
     1365        new AttachmentItem (parent, aDeviceType, aVerbose);
    13621366        endInsertRows();
    13631367        return index (parent->childCount() - 1, 0, parentIndex);
     
    16731677        foreach (const CMediumAttachment &attachment, attachments)
    16741678        {
    1675             QModelIndex attIndex = mStorageModel->addAttachment (ctrId, attachment.GetType());
     1679            QModelIndex attIndex = mStorageModel->addAttachment (ctrId, attachment.GetType(), false);
    16761680            mStorageModel->setData (attIndex, QVariant::fromValue (StorageSlot (controller.GetBus(), attachment.GetPort(), attachment.GetDevice())), StorageModel::R_AttSlot);
    16771681            CMedium medium (attachment.GetMedium());
     
    24682472    Assert (mStorageModel->data (index, StorageModel::R_IsMoreAttachmentsPossible).toBool());
    24692473
    2470     mStorageModel->addAttachment (QUuid (mStorageModel->data (index, StorageModel::R_ItemId).toString()), aDevice);
     2474    mStorageModel->addAttachment (QUuid (mStorageModel->data (index, StorageModel::R_ItemId).toString()), aDevice, true);
    24712475    emit storageChanged();
    24722476    if (mValidator) mValidator->revalidate();
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