VirtualBox

Changeset 50272 in vbox


Ignore:
Timestamp:
Jan 29, 2014 2:52:52 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: 6863: Machine settings: Storage page: SATA hot-plug support (step 1): Adding hot-pluggable check-box.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r49553 r50272  
    607607    , mAttIsTempEject (false)
    608608    , mAttIsNonRotational (false)
     609    , m_fIsHotPluggable(false)
    609610{
    610611    /* Check for proper parent type */
     
    670671}
    671672
     673bool AttachmentItem::attIsHotPluggable() const
     674{
     675    return m_fIsHotPluggable;
     676}
     677
    672678void AttachmentItem::setAttSlot (const StorageSlot &aAttSlot)
    673679{
     
    700706{
    701707    mAttIsNonRotational = aIsAttNonRotational;
     708}
     709
     710void AttachmentItem::setAttIsHotPluggable(bool fIsHotPluggable)
     711{
     712    m_fIsHotPluggable = fIsHotPluggable;
    702713}
    703714
     
    11881199            return false;
    11891200        }
     1201        case R_AttIsHotPluggable:
     1202        {
     1203            if (AbstractItem *item = static_cast<AbstractItem*>(aIndex.internalPointer()))
     1204                if (item->rtti() == AbstractItem::Type_AttachmentItem)
     1205                    return static_cast<AttachmentItem*>(item)->attIsHotPluggable();
     1206            return false;
     1207        }
    11901208        case R_AttSize:
    11911209        {
     
    14261444                    static_cast <AttachmentItem*> (item)->setAttIsNonRotational (aValue.toBool());
    14271445                    emit dataChanged (aIndex, aIndex);
     1446                    return true;
     1447                }
     1448            return false;
     1449        }
     1450        case R_AttIsHotPluggable:
     1451        {
     1452            if (AbstractItem *item = static_cast<AbstractItem*>(aIndex.internalPointer()))
     1453                if (item->rtti() == AbstractItem::Type_AttachmentItem)
     1454                {
     1455                    static_cast<AttachmentItem*>(item)->setAttIsHotPluggable(aValue.toBool());
     1456                    emit dataChanged(aIndex, aIndex);
    14281457                    return true;
    14291458                }
     
    19221951    connect (mCbTempEject, SIGNAL (stateChanged (int)), this, SLOT (setInformation()));
    19231952    connect (mCbNonRotational, SIGNAL (stateChanged (int)), this, SLOT (setInformation()));
     1953    connect(m_pCheckBoxHotPluggable, SIGNAL(stateChanged(int)), this, SLOT(setInformation()));
    19241954
    19251955    /* Applying language settings */
     
    20072037                    storageAttachmentData.m_fAttachmentTempEject = attachment.GetTemporaryEject();
    20082038                    storageAttachmentData.m_fAttachmentNonRotational = attachment.GetNonRotational();
     2039                    storageAttachmentData.m_fAttachmentHotPluggable = attachment.GetHotPluggable();
    20092040                    const CMedium cmedium = attachment.GetMedium();
    20102041                    storageAttachmentData.m_strAttachmentMediumId = cmedium.isNull() ? UIMedium::nullID() : cmedium.GetId();
     
    20672098            mStorageModel->setData(attachmentIndex, attachmentData.m_fAttachmentTempEject, StorageModel::R_AttIsTempEject);
    20682099            mStorageModel->setData(attachmentIndex, attachmentData.m_fAttachmentNonRotational, StorageModel::R_AttIsNonRotational);
     2100            mStorageModel->setData(attachmentIndex, attachmentData.m_fAttachmentHotPluggable, StorageModel::R_AttIsHotPluggable);
    20692101        }
    20702102    }
     
    21202152            attachmentData.m_fAttachmentTempEject = mStorageModel->data(attachmentIndex, StorageModel::R_AttIsTempEject).toBool();
    21212153            attachmentData.m_fAttachmentNonRotational = mStorageModel->data(attachmentIndex, StorageModel::R_AttIsNonRotational).toBool();
     2154            attachmentData.m_fAttachmentHotPluggable = mStorageModel->data(attachmentIndex, StorageModel::R_AttIsHotPluggable).toBool();
    21222155            attachmentData.m_strAttachmentMediumId = mStorageModel->data(attachmentIndex, StorageModel::R_AttMediumId).toString();
    21232156
     
    25992632                mCbNonRotational->setChecked (mStorageModel->data (index, StorageModel::R_AttIsNonRotational).toBool());
    26002633
     2634                /* Getting hot-pluggable state: */
     2635                m_pCheckBoxHotPluggable->setVisible(slt.bus == KStorageBus_SATA);
     2636                m_pCheckBoxHotPluggable->setChecked(mStorageModel->data(index, StorageModel::R_AttIsHotPluggable).toBool());
     2637
    26012638                /* Update optional widgets visibility */
    26022639                updateAdditionalObjects (device);
     
    26782715            {
    26792716                mStorageModel->setData (index, mCbNonRotational->isChecked(), StorageModel::R_AttIsNonRotational);
     2717            }
     2718            else if (sdr == m_pCheckBoxHotPluggable)
     2719            {
     2720                mStorageModel->setData(index, m_pCheckBoxHotPluggable->isChecked(), StorageModel::R_AttIsHotPluggable);
    26802721            }
    26812722            break;
     
    35533594        bool fAttachmentTempEject = attachmentData.m_fAttachmentTempEject;
    35543595        bool fAttachmentNonRotational = attachmentData.m_fAttachmentNonRotational;
     3596        bool fAttachmentHotPluggable = attachmentData.m_fAttachmentHotPluggable;
    35553597        /* Get GUI medium object: */
    35563598        UIMedium vboxMedium = vboxGlobal().medium(strAttachmentMediumId);
     
    35923634                    fSuccess = m_machine.isOk();
    35933635                }
     3636                m_machine.SetHotPluggableForDevice(strControllerName, iAttachmentPort, iAttachmentDevice, fAttachmentHotPluggable);
     3637                /* Check that machine is OK: */
     3638                fSuccess = m_machine.isOk();
    35943639            }
    35953640            else
     
    36283673        bool fAttachmentTempEject = attachmentData.m_fAttachmentTempEject;
    36293674        bool fAttachmentNonRotational = attachmentData.m_fAttachmentNonRotational;
     3675        bool fAttachmentHotPluggable = attachmentData.m_fAttachmentHotPluggable;
    36303676        KDeviceType attachmentDeviceType = attachmentData.m_attachmentType;
    36313677
     
    36713717                    }
    36723718                }
     3719                m_machine.SetHotPluggableForDevice(strControllerName, iAttachmentPort, iAttachmentDevice, fAttachmentHotPluggable);
     3720                /* Check that machine is OK: */
     3721                fSuccess = m_machine.isOk();
    36733722            }
    36743723            else
     
    37543803    mCbTempEject->setEnabled(isMachineInValidMode());
    37553804    mCbNonRotational->setEnabled(isMachineOffline());
     3805    m_pCheckBoxHotPluggable->setEnabled(isMachineOffline());
    37563806    mLsInformation->setEnabled(isMachineInValidMode());
    37573807    mLbHDFormat->setEnabled(isMachineInValidMode());
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h

    r49553 r50272  
    374374    bool attIsTempEject() const;
    375375    bool attIsNonRotational() const;
     376    bool attIsHotPluggable() const;
    376377
    377378    void setAttSlot (const StorageSlot &aAttSlot);
     
    381382    void setAttIsTempEject (bool aTempEject);
    382383    void setAttIsNonRotational (bool aNonRotational);
     384    void setAttIsHotPluggable(bool fIsHotPluggable);
    383385
    384386    QString attSize() const;
     
    413415    bool mAttIsTempEject;
    414416    bool mAttIsNonRotational;
     417    bool m_fIsHotPluggable;
    415418
    416419    QString mAttName;
     
    471474        R_AttIsTempEject,
    472475        R_AttIsNonRotational,
     476        R_AttIsHotPluggable,
    473477        R_AttSize,
    474478        R_AttLogicalSize,
     
    586590        , m_fAttachmentPassthrough(false)
    587591        , m_fAttachmentTempEject(false)
    588         , m_fAttachmentNonRotational(false) {}
     592        , m_fAttachmentNonRotational(false)
     593        , m_fAttachmentHotPluggable(false)
     594    {}
    589595    /* Functions: */
    590596    bool equal(const UIDataSettingsMachineStorageAttachment &other) const
     
    596602               (m_fAttachmentPassthrough == other.m_fAttachmentPassthrough) &&
    597603               (m_fAttachmentTempEject == other.m_fAttachmentTempEject) &&
    598                (m_fAttachmentNonRotational == other.m_fAttachmentNonRotational);
     604               (m_fAttachmentNonRotational == other.m_fAttachmentNonRotational) &&
     605               (m_fAttachmentHotPluggable == other.m_fAttachmentHotPluggable);
    599606    }
    600607    /* Operators: */
     
    609616    bool m_fAttachmentTempEject;
    610617    bool m_fAttachmentNonRotational;
     618    bool m_fAttachmentHotPluggable;
    611619};
    612620typedef UISettingsCache<UIDataSettingsMachineStorageAttachment> UICacheSettingsMachineStorageAttachment;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.ui

    r50268 r50272  
    389389           </widget>
    390390          </item>
     391          <item>
     392           <widget class="QCheckBox" name="m_pCheckBoxHotPluggable">
     393            <property name="sizePolicy">
     394             <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding">
     395              <horstretch>0</horstretch>
     396              <verstretch>0</verstretch>
     397             </sizepolicy>
     398            </property>
     399            <property name="whatsThis">
     400             <string>When checked the guest system will see the virtual disk as a hot-pluggable device.</string>
     401            </property>
     402            <property name="text">
     403             <string>&amp;Hot-pluggable</string>
     404            </property>
     405           </widget>
     406          </item>
    391407         </layout>
    392408        </item>
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