Changeset 81099 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 2, 2019 1:20:26 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 133710
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r81098 r81099 33 33 #include "UIExtraDataManager.h" 34 34 #include "UIIconPool.h" 35 #include "UIMessageCenter.h"36 35 #include "UIMachineSettingsStorage.h" 37 36 #include "UIMedium.h" 38 37 #include "UIMediumSelector.h" 38 #include "UIMessageCenter.h" 39 39 40 40 /* COM includes: */ … … 258 258 public: 259 259 260 /** Icon-pool instance access method. */261 static UIIconPoolStorageSettings* instance();262 260 /** Create icon-pool instance. */ 263 261 static void create(); … … 276 274 /** Icon-pool destructor. */ 277 275 ~UIIconPoolStorageSettings(); 276 277 /** Icon-pool instance access method. */ 278 static UIIconPoolStorageSettings *instance(); 278 279 279 280 /** Icon-pool instance. */ … … 283 284 /** Icon-pool icons cache. */ 284 285 mutable QMap<PixmapType, QIcon> m_icons; 286 287 /** Allows for shortcut access. */ 288 friend UIIconPoolStorageSettings *iconPool(); 285 289 }; 286 290 UIIconPoolStorageSettings* iconPool() { return UIIconPoolStorageSettings::instance(); } … … 322 326 /** Returns runtime type information. */ 323 327 virtual ItemType rtti() const = 0; 328 324 329 /** Returns child item with specified @a iIndex. */ 325 330 virtual AbstractItem* childItem (int iIndex) const = 0; … … 328 333 /** Returns position of specified child @a pItem. */ 329 334 virtual int posOfChild (AbstractItem *pItem) const = 0; 335 330 336 /** Returns tool-tip information. */ 331 337 virtual QString toolTip() const = 0; … … 339 345 /** Removes the child @a pItem. */ 340 346 virtual void delChild (AbstractItem *pItem) = 0; 347 348 private: 341 349 342 350 /** Holds the parent item reference. */ … … 365 373 ULONG childCount (KStorageBus enmBus) const; 366 374 367 pr ivate:375 protected: 368 376 369 377 /** Returns runtime type information. */ 370 378 ItemType rtti() const; 379 371 380 /** Returns child item with specified @a iIndex. */ 372 381 AbstractItem* childItem (int iIndex) const; … … 377 386 /** Returns the number of children. */ 378 387 int childCount() const; 388 379 389 /** Returns the item text. */ 380 390 QString text() const; … … 383 393 /** Returns pixmap information for specified @a enmState. */ 384 394 QPixmap pixmap (ItemState enmState); 395 385 396 /** Adds a child @a pItem. */ 386 397 void addChild (AbstractItem *pItem); 387 398 /** Removes the child @a pItem. */ 388 399 void delChild (AbstractItem *pItem); 400 401 private: 389 402 390 403 /** Holds the list of controller items. */ … … 409 422 ~ControllerItem(); 410 423 424 /** Defines current @a strName. */ 425 void setName(const QString &strName); 426 /** Returns current name. */ 427 QString name() const; 428 /** Returns old name. */ 429 QString oldName() const; 430 431 /** Defines @a enmBus. */ 432 void setBus(KStorageBus enmBus); 411 433 /** Returns bus. */ 412 434 KStorageBus bus() const; 413 435 /** Returns possible buses to switch from current one. */ 414 436 ControllerBusList buses() const; 415 /** Returns old name. */ 416 QString oldName() const; 417 /** Returns current name. */ 418 QString name() const; 437 438 /** Defines @a enmType. */ 439 void setType(KStorageControllerType enmType); 419 440 /** Returns type. */ 420 441 KStorageControllerType type() const; 421 442 /** Returns possible types to switch from current one. */ 422 443 ControllerTypeList types() const; 444 445 /** Defines current @a uPortCount. */ 446 void setPortCount(uint uPortCount); 423 447 /** Returns current port count. */ 424 448 uint portCount(); 425 449 /** Returns maximum port count. */ 426 450 uint maxPortCount(); 451 452 /** Defines whether controller @a fUseIoCache. */ 453 void setUseIoCache(bool fUseIoCache); 427 454 /** Returns whether controller uses IO cache. */ 428 455 bool useIoCache() const; 429 430 /** Defines @a enmBus. */431 void setBus(KStorageBus enmBus);432 /** Defines current @a strName. */433 void setName(const QString &strName);434 /** Defines @a enmType. */435 void setType(KStorageControllerType enmType);436 /** Defines current @a uPortCount. */437 void setPortCount(uint uPortCount);438 /** Defines whether controller @a fUseIoCache. */439 void setUseIoCache(bool fUseIoCache);440 456 441 457 /** Returns possible controller slots. */ … … 446 462 DeviceTypeList deviceTypeList() const; 447 463 464 /** Defines a list of @a attachments. */ 465 void setAttachments(const QList<AbstractItem*> &attachments) { m_attachments = attachments; } 466 /** Returns a list of attachments. */ 467 QList<AbstractItem*> attachments() const { return m_attachments; } 448 468 /** Returns an ID list of attached media of specified @a enmType. */ 449 469 QList<QUuid> attachmentIDs(KDeviceType enmType = KDeviceType_Null) const; 450 470 451 /** Returns a list of attachments. */452 QList<AbstractItem*> attachments() const { return m_attachments; }453 /** Defines a list of @a attachments. */454 void setAttachments(const QList<AbstractItem*> &attachments) { m_attachments = attachments; }455 456 471 private: 457 472 458 473 /** Returns runtime type information. */ 459 474 ItemType rtti() const; 475 460 476 /** Returns child item with specified @a iIndex. */ 461 477 AbstractItem* childItem (int iIndex) const; … … 466 482 /** Returns the number of children. */ 467 483 int childCount() const; 484 468 485 /** Returns the item text. */ 469 486 QString text() const; … … 472 489 /** Returns pixmap information for specified @a enmState. */ 473 490 QPixmap pixmap (ItemState enmState); 491 474 492 /** Adds a child @a pItem. */ 475 493 void addChild (AbstractItem *pItem); … … 484 502 void updatePixmaps(); 485 503 504 /** Holds the current name. */ 505 QString m_strName; 506 /** Holds the old name. */ 507 QString m_strOldName; 508 486 509 /** Holds the bus. */ 487 510 KStorageBus m_enmBus; … … 496 519 QList<PixmapType> m_pixmaps; 497 520 498 /** Holds the old name. */499 QString m_strOldName;500 /** Holds the current name. */501 QString m_strName;502 521 /** Holds the current port count. */ 503 522 uint m_uPortCount; 504 523 /** Holds whether controller uses IO cache. */ 505 524 bool m_fUseIoCache; 525 506 526 /** Holds the list of attachments. */ 507 527 QList<AbstractItem*> m_attachments; … … 520 540 AttachmentItem(AbstractItem *pParentItem, KDeviceType enmDeviceType); 521 541 542 /** Defines @a enmDeviceType. */ 543 void setDeviceType(KDeviceType enmDeviceType); 544 /** Returns device type. */ 545 KDeviceType deviceType() const; 546 /** Returns possible device types. */ 547 DeviceTypeList deviceTypes() const; 548 549 /** Defines storage @a slot. */ 550 void setStorageSlot(const StorageSlot &slot); 522 551 /** Returns storage slot. */ 523 552 StorageSlot storageSlot() const; 524 553 /** Returns possible storage slots. */ 525 554 SlotsList storageSlots() const; 526 /** Returns device type. */ 527 KDeviceType deviceType() const; 528 /** Returns possible device types. */ 529 DeviceTypeList deviceTypes() const; 555 556 /** Defines @a uMediumId. */ 557 void setMediumId(const QUuid &uMediumId); 530 558 /** Returns the medium id. */ 531 559 QUuid mediumId() const; 560 532 561 /** Returns whether attachment is a host drive. */ 533 562 bool isHostDrive() const; 563 564 /** Defines whether attachment is @a fPassthrough. */ 565 void setPassthrough(bool fPassthrough); 534 566 /** Returns whether attachment is passthrough. */ 535 567 bool isPassthrough() const; 568 569 /** Defines whether attachment is @a fTemporaryEjectable. */ 570 void setTempEject(bool fTemporaryEjectable); 536 571 /** Returns whether attachment is temporary ejectable. */ 537 572 bool isTempEject() const; 573 574 /** Defines whether attachment is @a fNonRotational. */ 575 void setNonRotational(bool fNonRotational); 538 576 /** Returns whether attachment is non-rotational. */ 539 577 bool isNonRotational() const; 578 579 /** Returns whether attachment is @a fIsHotPluggable. */ 580 void setHotPluggable(bool fIsHotPluggable); 540 581 /** Returns whether attachment is hot-pluggable. */ 541 582 bool isHotPluggable() const; 542 543 /** Defines storage @a slot. */544 void setStorageSlot(const StorageSlot &slot);545 /** Defines @a enmDeviceType. */546 void setDeviceType(KDeviceType enmDeviceType);547 /** Defines @a uMediumId. */548 void setMediumId(const QUuid &uMediumId);549 /** Defines whether attachment is @a fPassthrough. */550 void setPassthrough(bool fPassthrough);551 /** Defines whether attachment is @a fTemporaryEjectable. */552 void setTempEject(bool fTemporaryEjectable);553 /** Defines whether attachment is @a fNonRotational. */554 void setNonRotational(bool fNonRotational);555 /** Returns whether attachment is @a fIsHotPluggable. */556 void setHotPluggable(bool fIsHotPluggable);557 583 558 584 /** Returns medium size. */ … … 578 604 /** Returns runtime type information. */ 579 605 ItemType rtti() const; 606 580 607 /** Returns child item with specified @a iIndex. */ 581 608 AbstractItem* childItem (int iIndex) const; … … 586 613 /** Returns the number of children. */ 587 614 int childCount() const; 615 588 616 /** Returns the item text. */ 589 617 QString text() const; … … 592 620 /** Returns pixmap information for specified @a enmState. */ 593 621 QPixmap pixmap (ItemState enmState); 622 594 623 /** Adds a child @a pItem. */ 595 624 void addChild (AbstractItem *pItem); … … 599 628 /** Holds the device type. */ 600 629 KDeviceType m_enmDeviceType; 601 602 630 /** Holds the storage slot. */ 603 631 StorageSlot m_storageSlot; … … 844 872 UIMediumIDHolder(QWidget *pParent) : QObject(pParent) {} 845 873 874 /** Defines medium @a uId. */ 875 void setId(const QUuid &uId) { m_uId = uId; emit sigChanged(); } 846 876 /** Returns medium ID. */ 847 877 QUuid id() const { return m_uId; } 848 /** Defines medium @a uId. */ 849 void setId(const QUuid &uId) { m_uId = uId; emit sigChanged(); }850 878 879 /** Defines medium device @a enmType. */ 880 void setType(UIMediumDeviceType enmType) { m_enmType = enmType; } 851 881 /** Returns medium device type. */ 852 882 UIMediumDeviceType type() const { return m_enmType; } 853 /** Defines medium device @a enmType. */854 void setType(UIMediumDeviceType enmType) { m_enmType = enmType; }855 883 856 884 /** Returns whether medium ID is null. */ … … 1225 1253 } 1226 1254 1255 void ControllerItem::setName (const QString &strName) 1256 { 1257 m_strName = strName; 1258 } 1259 1260 QString ControllerItem::name() const 1261 { 1262 return m_strName; 1263 } 1264 1265 QString ControllerItem::oldName() const 1266 { 1267 return m_strOldName; 1268 } 1269 1270 void ControllerItem::setBus(KStorageBus enmBus) 1271 { 1272 m_enmBus = enmBus; 1273 1274 updateBusInfo(); 1275 updateTypeInfo(); 1276 updatePixmaps(); 1277 } 1278 1227 1279 KStorageBus ControllerItem::bus() const 1228 1280 { … … 1235 1287 } 1236 1288 1237 QString ControllerItem::name() const 1238 { 1239 return m_strName; 1240 } 1241 1242 QString ControllerItem::oldName() const 1243 { 1244 return m_strOldName; 1289 void ControllerItem::setType (KStorageControllerType enmType) 1290 { 1291 m_enmType = enmType; 1245 1292 } 1246 1293 … … 1253 1300 { 1254 1301 return m_types; 1302 } 1303 1304 void ControllerItem::setPortCount (uint uPortCount) 1305 { 1306 /* Limit maximum port count: */ 1307 m_uPortCount = qMin(uPortCount, (uint)uiCommon().virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus(bus())); 1255 1308 } 1256 1309 … … 1272 1325 } 1273 1326 1327 void ControllerItem::setUseIoCache (bool fUseIoCache) 1328 { 1329 m_fUseIoCache = fUseIoCache; 1330 } 1331 1274 1332 bool ControllerItem::useIoCache() const 1275 1333 { 1276 1334 return m_fUseIoCache; 1277 }1278 1279 void ControllerItem::setBus(KStorageBus enmBus)1280 {1281 m_enmBus = enmBus;1282 1283 updateBusInfo();1284 updateTypeInfo();1285 updatePixmaps();1286 }1287 1288 void ControllerItem::setName (const QString &strName)1289 {1290 m_strName = strName;1291 }1292 1293 void ControllerItem::setType (KStorageControllerType enmType)1294 {1295 m_enmType = enmType;1296 }1297 1298 void ControllerItem::setPortCount (uint uPortCount)1299 {1300 /* Limit maximum port count: */1301 m_uPortCount = qMin(uPortCount, (uint)uiCommon().virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus(bus()));1302 }1303 1304 void ControllerItem::setUseIoCache (bool fUseIoCache)1305 {1306 m_fUseIoCache = fUseIoCache;1307 1335 } 1308 1336 … … 1511 1539 } 1512 1540 1541 void AttachmentItem::setDeviceType (KDeviceType enmDeviceType) 1542 { 1543 m_enmDeviceType = enmDeviceType; 1544 } 1545 1546 KDeviceType AttachmentItem::deviceType() const 1547 { 1548 return m_enmDeviceType; 1549 } 1550 1551 DeviceTypeList AttachmentItem::deviceTypes() const 1552 { 1553 return qobject_cast<ControllerItem*>(parent())->deviceTypeList(); 1554 } 1555 1556 void AttachmentItem::setStorageSlot (const StorageSlot &storageSlot) 1557 { 1558 m_storageSlot = storageSlot; 1559 } 1560 1513 1561 StorageSlot AttachmentItem::storageSlot() const 1514 1562 { … … 1530 1578 } 1531 1579 1532 KDeviceType AttachmentItem::deviceType() const1533 {1534 return m_enmDeviceType;1535 }1536 1537 DeviceTypeList AttachmentItem::deviceTypes() const1538 {1539 return qobject_cast<ControllerItem*>(parent())->deviceTypeList();1540 }1541 1542 QUuid AttachmentItem::mediumId() const1543 {1544 return m_uMediumId;1545 }1546 1547 bool AttachmentItem::isHostDrive() const1548 {1549 return m_fHostDrive;1550 }1551 1552 bool AttachmentItem::isPassthrough() const1553 {1554 return m_fPassthrough;1555 }1556 1557 bool AttachmentItem::isTempEject() const1558 {1559 return m_fTempEject;1560 }1561 1562 bool AttachmentItem::isNonRotational() const1563 {1564 return m_fNonRotational;1565 }1566 1567 bool AttachmentItem::isHotPluggable() const1568 {1569 return m_fHotPluggable;1570 }1571 1572 void AttachmentItem::setStorageSlot (const StorageSlot &storageSlot)1573 {1574 m_storageSlot = storageSlot;1575 }1576 1577 void AttachmentItem::setDeviceType (KDeviceType enmDeviceType)1578 {1579 m_enmDeviceType = enmDeviceType;1580 }1581 1582 1580 void AttachmentItem::setMediumId (const QUuid &uMediumId) 1583 1581 { … … 1588 1586 } 1589 1587 1588 QUuid AttachmentItem::mediumId() const 1589 { 1590 return m_uMediumId; 1591 } 1592 1593 bool AttachmentItem::isHostDrive() const 1594 { 1595 return m_fHostDrive; 1596 } 1597 1590 1598 void AttachmentItem::setPassthrough (bool fPassthrough) 1591 1599 { … … 1593 1601 } 1594 1602 1603 bool AttachmentItem::isPassthrough() const 1604 { 1605 return m_fPassthrough; 1606 } 1607 1595 1608 void AttachmentItem::setTempEject (bool fTempEject) 1596 1609 { … … 1598 1611 } 1599 1612 1613 bool AttachmentItem::isTempEject() const 1614 { 1615 return m_fTempEject; 1616 } 1617 1600 1618 void AttachmentItem::setNonRotational (bool fNonRotational) 1601 1619 { … … 1603 1621 } 1604 1622 1623 bool AttachmentItem::isNonRotational() const 1624 { 1625 return m_fNonRotational; 1626 } 1627 1605 1628 void AttachmentItem::setHotPluggable(bool fHotPluggable) 1606 1629 { 1607 1630 m_fHotPluggable = fHotPluggable; 1631 } 1632 1633 bool AttachmentItem::isHotPluggable() const 1634 { 1635 return m_fHotPluggable; 1608 1636 } 1609 1637 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h
r81098 r81099 23 23 24 24 /* GUI includes: */ 25 #include "UIMachineSettingsStorage.gen.h" 25 26 #include "UIMediumDefs.h" 26 27 #include "UISettingsPage.h" 27 #include "UIMachineSettingsStorage.gen.h"28 28 29 29 /* Forward declarations: */
Note:
See TracChangeset
for help on using the changeset viewer.