Changeset 28804 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 27, 2010 9:54:17 AM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsHD.cpp
r28800 r28804 406 406 , mCtrName (aName) 407 407 , mCtrType (0) 408 , mUseIoCache (true) 408 409 { 409 410 /* Check for proper parent type */ … … 461 462 } 462 463 464 bool ControllerItem::ctrUseIoCache() const 465 { 466 return mUseIoCache; 467 } 468 463 469 void ControllerItem::setCtrName (const QString &aCtrName) 464 470 { … … 469 475 { 470 476 mCtrType->setCtrType (aCtrType); 477 } 478 479 void ControllerItem::setCtrUseIoCache (bool aUseIoCache) 480 { 481 mUseIoCache = aUseIoCache; 471 482 } 472 483 … … 1101 1112 return result; 1102 1113 } 1114 case R_CtrIoCache: 1115 { 1116 if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer())) 1117 if (item->rtti() == AbstractItem::Type_ControllerItem) 1118 return static_cast <ControllerItem*> (item)->ctrUseIoCache(); 1119 return false; 1120 } 1103 1121 1104 1122 case R_AttSlot: … … 1295 1313 { 1296 1314 static_cast <ControllerItem*> (item)->setCtrType (aValue.value <KStorageControllerType>()); 1315 emit dataChanged (aIndex, aIndex); 1316 return true; 1317 } 1318 return false; 1319 } 1320 case R_CtrIoCache: 1321 { 1322 if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer())) 1323 if (item->rtti() == AbstractItem::Type_ControllerItem) 1324 { 1325 static_cast <ControllerItem*> (item)->setCtrUseIoCache (aValue.toBool()); 1297 1326 emit dataChanged (aIndex, aIndex); 1298 1327 return true; … … 1672 1701 connect (mCbType, SIGNAL (activated (int)), this, SLOT (setInformation())); 1673 1702 connect (mCbSlot, SIGNAL (activated (int)), this, SLOT (setInformation())); 1703 connect (mCbIoCache, SIGNAL (stateChanged (int)), this, SLOT (setInformation())); 1674 1704 connect (mCbVdi, SIGNAL (activated (int)), this, SLOT (setInformation())); 1675 1705 connect (mTbVmm, SIGNAL (clicked (bool)), this, SLOT (onVmmInvoked())); … … 1703 1733 QModelIndex ctrIndex = mStorageModel->addController (controllerName, controller.GetBus(), controller.GetControllerType()); 1704 1734 QUuid ctrId = QUuid (mStorageModel->data (ctrIndex, StorageModel::R_ItemId).toString()); 1735 1736 bool useIoCache = true; 1737 if (controller.GetIoBackend() == KIoBackendType_Unbuffered) 1738 useIoCache = false; 1739 1740 mStorageModel->setData (ctrIndex, useIoCache, StorageModel::R_CtrIoCache); 1705 1741 1706 1742 CMediumAttachmentVector attachments = mMachine.GetMediumAttachmentsOfController (controllerName); … … 1743 1779 KStorageBus ctrBusType = mStorageModel->data (ctrIndex, StorageModel::R_CtrBusType).value <KStorageBus>(); 1744 1780 KStorageControllerType ctrType = mStorageModel->data (ctrIndex, StorageModel::R_CtrType).value <KStorageControllerType>(); 1781 bool useIoCache = mStorageModel->data (ctrIndex, StorageModel::R_CtrIoCache).toBool(); 1745 1782 CStorageController ctr = mMachine.AddStorageController (ctrName, ctrBusType); 1746 1783 ctr.SetControllerType (ctrType); 1784 ctr.SetIoBackend(useIoCache ? KIoBackendType_Buffered : KIoBackendType_Unbuffered); 1747 1785 int maxUsedPort = -1; 1748 1786 for (int j = 0; j < mStorageModel->rowCount (ctrIndex); ++ j) … … 2070 2108 mCbType->setCurrentIndex (ctrPos == -1 ? 0 : ctrPos); 2071 2109 2110 bool isUseIoCache = mStorageModel->data (index, StorageModel::R_CtrIoCache).toBool(); 2111 mCbIoCache->setChecked(isUseIoCache); 2112 2072 2113 /* Showing Controller Page */ 2073 2114 mSwRightPane->setCurrentIndex (1); … … 2160 2201 mStorageModel->setData (index, QVariant::fromValue (vboxGlobal().toControllerType (mCbType->currentText())), 2161 2202 StorageModel::R_CtrType); 2203 else if (sdr == mCbIoCache) 2204 mStorageModel->setData (index, mCbIoCache->isChecked(), StorageModel::R_CtrIoCache); 2162 2205 break; 2163 2206 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsHD.h
r28800 r28804 297 297 KStorageControllerType ctrType() const; 298 298 ControllerTypeList ctrTypes() const; 299 bool ctrUseIoCache() const; 299 300 300 301 void setCtrName (const QString &aCtrName); 301 302 void setCtrType (KStorageControllerType aCtrType); 303 void setCtrUseIoCache (bool aUseIoCache); 302 304 303 305 SlotsList ctrAllSlots() const; … … 322 324 QString mCtrName; 323 325 AbstractControllerType *mCtrType; 326 bool mUseIoCache; 324 327 QList <AbstractItem*> mAttachments; 325 328 }; … … 419 422 R_CtrDevices, 420 423 R_CtrBusType, 424 R_CtrIoCache, 421 425 422 426 R_AttSlot, -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsHD.ui
r28800 r28804 209 209 </widget> 210 210 </item> 211 <item row="3" column="0" colspan="3" > 211 <item row="3" column="2" > 212 <widget class="QCheckBox" name="mCbIoCache" > 213 <property name="whatsThis" > 214 <string>Allows to use host I/O caching capabilities.</string> 215 </property> 216 <property name="text" > 217 <string>Use host I/O cache</string> 218 </property> 219 </widget> 220 </item> 221 <item row="4" column="0" colspan="3" > 212 222 <spacer name="mSp3" > 213 223 <property name="orientation" > -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp
r28800 r28804 668 668 /* Create default storage controllers */ 669 669 QString ctrName = VBoxVMSettingsHD::tr("Storage Controller"); 670 KStorageBus ideBus = KStorageBus_IDE;670 KStorageBus storageBus = type.GetRecommendedStorageBus(); 671 671 672 672 // Add storage controller 673 m_Machine.AddStorageController(ctrName, ideBus);673 m_Machine.AddStorageController(ctrName, storageBus); 674 674 675 675 // Set storage controller type
Note:
See TracChangeset
for help on using the changeset viewer.