Changeset 50272 in vbox
- Timestamp:
- Jan 29, 2014 2:52:52 PM (11 years ago)
- 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 607 607 , mAttIsTempEject (false) 608 608 , mAttIsNonRotational (false) 609 , m_fIsHotPluggable(false) 609 610 { 610 611 /* Check for proper parent type */ … … 670 671 } 671 672 673 bool AttachmentItem::attIsHotPluggable() const 674 { 675 return m_fIsHotPluggable; 676 } 677 672 678 void AttachmentItem::setAttSlot (const StorageSlot &aAttSlot) 673 679 { … … 700 706 { 701 707 mAttIsNonRotational = aIsAttNonRotational; 708 } 709 710 void AttachmentItem::setAttIsHotPluggable(bool fIsHotPluggable) 711 { 712 m_fIsHotPluggable = fIsHotPluggable; 702 713 } 703 714 … … 1188 1199 return false; 1189 1200 } 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 } 1190 1208 case R_AttSize: 1191 1209 { … … 1426 1444 static_cast <AttachmentItem*> (item)->setAttIsNonRotational (aValue.toBool()); 1427 1445 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); 1428 1457 return true; 1429 1458 } … … 1922 1951 connect (mCbTempEject, SIGNAL (stateChanged (int)), this, SLOT (setInformation())); 1923 1952 connect (mCbNonRotational, SIGNAL (stateChanged (int)), this, SLOT (setInformation())); 1953 connect(m_pCheckBoxHotPluggable, SIGNAL(stateChanged(int)), this, SLOT(setInformation())); 1924 1954 1925 1955 /* Applying language settings */ … … 2007 2037 storageAttachmentData.m_fAttachmentTempEject = attachment.GetTemporaryEject(); 2008 2038 storageAttachmentData.m_fAttachmentNonRotational = attachment.GetNonRotational(); 2039 storageAttachmentData.m_fAttachmentHotPluggable = attachment.GetHotPluggable(); 2009 2040 const CMedium cmedium = attachment.GetMedium(); 2010 2041 storageAttachmentData.m_strAttachmentMediumId = cmedium.isNull() ? UIMedium::nullID() : cmedium.GetId(); … … 2067 2098 mStorageModel->setData(attachmentIndex, attachmentData.m_fAttachmentTempEject, StorageModel::R_AttIsTempEject); 2068 2099 mStorageModel->setData(attachmentIndex, attachmentData.m_fAttachmentNonRotational, StorageModel::R_AttIsNonRotational); 2100 mStorageModel->setData(attachmentIndex, attachmentData.m_fAttachmentHotPluggable, StorageModel::R_AttIsHotPluggable); 2069 2101 } 2070 2102 } … … 2120 2152 attachmentData.m_fAttachmentTempEject = mStorageModel->data(attachmentIndex, StorageModel::R_AttIsTempEject).toBool(); 2121 2153 attachmentData.m_fAttachmentNonRotational = mStorageModel->data(attachmentIndex, StorageModel::R_AttIsNonRotational).toBool(); 2154 attachmentData.m_fAttachmentHotPluggable = mStorageModel->data(attachmentIndex, StorageModel::R_AttIsHotPluggable).toBool(); 2122 2155 attachmentData.m_strAttachmentMediumId = mStorageModel->data(attachmentIndex, StorageModel::R_AttMediumId).toString(); 2123 2156 … … 2599 2632 mCbNonRotational->setChecked (mStorageModel->data (index, StorageModel::R_AttIsNonRotational).toBool()); 2600 2633 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 2601 2638 /* Update optional widgets visibility */ 2602 2639 updateAdditionalObjects (device); … … 2678 2715 { 2679 2716 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); 2680 2721 } 2681 2722 break; … … 3553 3594 bool fAttachmentTempEject = attachmentData.m_fAttachmentTempEject; 3554 3595 bool fAttachmentNonRotational = attachmentData.m_fAttachmentNonRotational; 3596 bool fAttachmentHotPluggable = attachmentData.m_fAttachmentHotPluggable; 3555 3597 /* Get GUI medium object: */ 3556 3598 UIMedium vboxMedium = vboxGlobal().medium(strAttachmentMediumId); … … 3592 3634 fSuccess = m_machine.isOk(); 3593 3635 } 3636 m_machine.SetHotPluggableForDevice(strControllerName, iAttachmentPort, iAttachmentDevice, fAttachmentHotPluggable); 3637 /* Check that machine is OK: */ 3638 fSuccess = m_machine.isOk(); 3594 3639 } 3595 3640 else … … 3628 3673 bool fAttachmentTempEject = attachmentData.m_fAttachmentTempEject; 3629 3674 bool fAttachmentNonRotational = attachmentData.m_fAttachmentNonRotational; 3675 bool fAttachmentHotPluggable = attachmentData.m_fAttachmentHotPluggable; 3630 3676 KDeviceType attachmentDeviceType = attachmentData.m_attachmentType; 3631 3677 … … 3671 3717 } 3672 3718 } 3719 m_machine.SetHotPluggableForDevice(strControllerName, iAttachmentPort, iAttachmentDevice, fAttachmentHotPluggable); 3720 /* Check that machine is OK: */ 3721 fSuccess = m_machine.isOk(); 3673 3722 } 3674 3723 else … … 3754 3803 mCbTempEject->setEnabled(isMachineInValidMode()); 3755 3804 mCbNonRotational->setEnabled(isMachineOffline()); 3805 m_pCheckBoxHotPluggable->setEnabled(isMachineOffline()); 3756 3806 mLsInformation->setEnabled(isMachineInValidMode()); 3757 3807 mLbHDFormat->setEnabled(isMachineInValidMode()); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h
r49553 r50272 374 374 bool attIsTempEject() const; 375 375 bool attIsNonRotational() const; 376 bool attIsHotPluggable() const; 376 377 377 378 void setAttSlot (const StorageSlot &aAttSlot); … … 381 382 void setAttIsTempEject (bool aTempEject); 382 383 void setAttIsNonRotational (bool aNonRotational); 384 void setAttIsHotPluggable(bool fIsHotPluggable); 383 385 384 386 QString attSize() const; … … 413 415 bool mAttIsTempEject; 414 416 bool mAttIsNonRotational; 417 bool m_fIsHotPluggable; 415 418 416 419 QString mAttName; … … 471 474 R_AttIsTempEject, 472 475 R_AttIsNonRotational, 476 R_AttIsHotPluggable, 473 477 R_AttSize, 474 478 R_AttLogicalSize, … … 586 590 , m_fAttachmentPassthrough(false) 587 591 , m_fAttachmentTempEject(false) 588 , m_fAttachmentNonRotational(false) {} 592 , m_fAttachmentNonRotational(false) 593 , m_fAttachmentHotPluggable(false) 594 {} 589 595 /* Functions: */ 590 596 bool equal(const UIDataSettingsMachineStorageAttachment &other) const … … 596 602 (m_fAttachmentPassthrough == other.m_fAttachmentPassthrough) && 597 603 (m_fAttachmentTempEject == other.m_fAttachmentTempEject) && 598 (m_fAttachmentNonRotational == other.m_fAttachmentNonRotational); 604 (m_fAttachmentNonRotational == other.m_fAttachmentNonRotational) && 605 (m_fAttachmentHotPluggable == other.m_fAttachmentHotPluggable); 599 606 } 600 607 /* Operators: */ … … 609 616 bool m_fAttachmentTempEject; 610 617 bool m_fAttachmentNonRotational; 618 bool m_fAttachmentHotPluggable; 611 619 }; 612 620 typedef UISettingsCache<UIDataSettingsMachineStorageAttachment> UICacheSettingsMachineStorageAttachment; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.ui
r50268 r50272 389 389 </widget> 390 390 </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>&Hot-pluggable</string> 404 </property> 405 </widget> 406 </item> 391 407 </layout> 392 408 </item>
Note:
See TracChangeset
for help on using the changeset viewer.