VirtualBox

Ignore:
Timestamp:
Oct 2, 2019 1:20:26 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133710
Message:

FE/Qt: bugref:9582: VM settings / Storage page: Cleanup related to variable and function reodering.

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  
    3333#include "UIExtraDataManager.h"
    3434#include "UIIconPool.h"
    35 #include "UIMessageCenter.h"
    3635#include "UIMachineSettingsStorage.h"
    3736#include "UIMedium.h"
    3837#include "UIMediumSelector.h"
     38#include "UIMessageCenter.h"
    3939
    4040/* COM includes: */
     
    258258public:
    259259
    260     /** Icon-pool instance access method. */
    261     static UIIconPoolStorageSettings* instance();
    262260    /** Create icon-pool instance. */
    263261    static void create();
     
    276274    /** Icon-pool destructor. */
    277275    ~UIIconPoolStorageSettings();
     276
     277    /** Icon-pool instance access method. */
     278    static UIIconPoolStorageSettings *instance();
    278279
    279280    /** Icon-pool instance. */
     
    283284    /** Icon-pool icons cache. */
    284285    mutable QMap<PixmapType, QIcon> m_icons;
     286
     287    /** Allows for shortcut access. */
     288    friend UIIconPoolStorageSettings *iconPool();
    285289};
    286290UIIconPoolStorageSettings* iconPool() { return UIIconPoolStorageSettings::instance(); }
     
    322326    /** Returns runtime type information. */
    323327    virtual ItemType rtti() const = 0;
     328
    324329    /** Returns child item with specified @a iIndex. */
    325330    virtual AbstractItem* childItem (int iIndex) const = 0;
     
    328333    /** Returns position of specified child @a pItem. */
    329334    virtual int posOfChild (AbstractItem *pItem) const = 0;
     335
    330336    /** Returns tool-tip information. */
    331337    virtual QString toolTip() const = 0;
     
    339345    /** Removes the child @a pItem. */
    340346    virtual void delChild (AbstractItem *pItem) = 0;
     347
     348private:
    341349
    342350    /** Holds the parent item reference. */
     
    365373    ULONG childCount (KStorageBus enmBus) const;
    366374
    367 private:
     375protected:
    368376
    369377    /** Returns runtime type information. */
    370378    ItemType rtti() const;
     379
    371380    /** Returns child item with specified @a iIndex. */
    372381    AbstractItem* childItem (int iIndex) const;
     
    377386    /** Returns the number of children. */
    378387    int childCount() const;
     388
    379389    /** Returns the item text. */
    380390    QString text() const;
     
    383393    /** Returns pixmap information for specified @a enmState. */
    384394    QPixmap pixmap (ItemState enmState);
     395
    385396    /** Adds a child @a pItem. */
    386397    void addChild (AbstractItem *pItem);
    387398    /** Removes the child @a pItem. */
    388399    void delChild (AbstractItem *pItem);
     400
     401private:
    389402
    390403    /** Holds the list of controller items. */
     
    409422   ~ControllerItem();
    410423
     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);
    411433    /** Returns bus. */
    412434    KStorageBus bus() const;
    413435    /** Returns possible buses to switch from current one. */
    414436    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);
    419440    /** Returns type. */
    420441    KStorageControllerType type() const;
    421442    /** Returns possible types to switch from current one. */
    422443    ControllerTypeList types() const;
     444
     445    /** Defines current @a uPortCount. */
     446    void setPortCount(uint uPortCount);
    423447    /** Returns current port count. */
    424448    uint portCount();
    425449    /** Returns maximum port count. */
    426450    uint maxPortCount();
     451
     452    /** Defines whether controller @a fUseIoCache. */
     453    void setUseIoCache(bool fUseIoCache);
    427454    /** Returns whether controller uses IO cache. */
    428455    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);
    440456
    441457    /** Returns possible controller slots. */
     
    446462    DeviceTypeList deviceTypeList() const;
    447463
     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; }
    448468    /** Returns an ID list of attached media of specified @a enmType. */
    449469    QList<QUuid> attachmentIDs(KDeviceType enmType = KDeviceType_Null) const;
    450470
    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 
    456471private:
    457472
    458473    /** Returns runtime type information. */
    459474    ItemType rtti() const;
     475
    460476    /** Returns child item with specified @a iIndex. */
    461477    AbstractItem* childItem (int iIndex) const;
     
    466482    /** Returns the number of children. */
    467483    int childCount() const;
     484
    468485    /** Returns the item text. */
    469486    QString text() const;
     
    472489    /** Returns pixmap information for specified @a enmState. */
    473490    QPixmap pixmap (ItemState enmState);
     491
    474492    /** Adds a child @a pItem. */
    475493    void addChild (AbstractItem *pItem);
     
    484502    void updatePixmaps();
    485503
     504    /** Holds the current name. */
     505    QString m_strName;
     506    /** Holds the old name. */
     507    QString m_strOldName;
     508
    486509    /** Holds the bus. */
    487510    KStorageBus m_enmBus;
     
    496519    QList<PixmapType> m_pixmaps;
    497520
    498     /** Holds the old name. */
    499     QString m_strOldName;
    500     /** Holds the current name. */
    501     QString m_strName;
    502521    /** Holds the current port count. */
    503522    uint m_uPortCount;
    504523    /** Holds whether controller uses IO cache. */
    505524    bool m_fUseIoCache;
     525
    506526    /** Holds the list of attachments. */
    507527    QList<AbstractItem*> m_attachments;
     
    520540    AttachmentItem(AbstractItem *pParentItem, KDeviceType enmDeviceType);
    521541
     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);
    522551    /** Returns storage slot. */
    523552    StorageSlot storageSlot() const;
    524553    /** Returns possible storage slots. */
    525554    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);
    530558    /** Returns the medium id. */
    531559    QUuid mediumId() const;
     560
    532561    /** Returns whether attachment is a host drive. */
    533562    bool isHostDrive() const;
     563
     564    /** Defines whether attachment is @a fPassthrough. */
     565    void setPassthrough(bool fPassthrough);
    534566    /** Returns whether attachment is passthrough. */
    535567    bool isPassthrough() const;
     568
     569    /** Defines whether attachment is @a fTemporaryEjectable. */
     570    void setTempEject(bool fTemporaryEjectable);
    536571    /** Returns whether attachment is temporary ejectable. */
    537572    bool isTempEject() const;
     573
     574    /** Defines whether attachment is @a fNonRotational. */
     575    void setNonRotational(bool fNonRotational);
    538576    /** Returns whether attachment is non-rotational. */
    539577    bool isNonRotational() const;
     578
     579    /** Returns whether attachment is @a fIsHotPluggable. */
     580    void setHotPluggable(bool fIsHotPluggable);
    540581    /** Returns whether attachment is hot-pluggable. */
    541582    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);
    557583
    558584    /** Returns medium size. */
     
    578604    /** Returns runtime type information. */
    579605    ItemType rtti() const;
     606
    580607    /** Returns child item with specified @a iIndex. */
    581608    AbstractItem* childItem (int iIndex) const;
     
    586613    /** Returns the number of children. */
    587614    int childCount() const;
     615
    588616    /** Returns the item text. */
    589617    QString text() const;
     
    592620    /** Returns pixmap information for specified @a enmState. */
    593621    QPixmap pixmap (ItemState enmState);
     622
    594623    /** Adds a child @a pItem. */
    595624    void addChild (AbstractItem *pItem);
     
    599628    /** Holds the device type. */
    600629    KDeviceType m_enmDeviceType;
    601 
    602630    /** Holds the storage slot. */
    603631    StorageSlot m_storageSlot;
     
    844872    UIMediumIDHolder(QWidget *pParent) : QObject(pParent) {}
    845873
     874    /** Defines medium @a uId. */
     875    void setId(const QUuid &uId) { m_uId = uId; emit sigChanged(); }
    846876    /** Returns medium ID. */
    847877    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; }
    851881    /** Returns medium device type. */
    852882    UIMediumDeviceType type() const { return m_enmType; }
    853     /** Defines medium device @a enmType. */
    854     void setType(UIMediumDeviceType enmType) { m_enmType = enmType; }
    855883
    856884    /** Returns whether medium ID is null. */
     
    12251253}
    12261254
     1255void ControllerItem::setName (const QString &strName)
     1256{
     1257    m_strName = strName;
     1258}
     1259
     1260QString ControllerItem::name() const
     1261{
     1262    return m_strName;
     1263}
     1264
     1265QString ControllerItem::oldName() const
     1266{
     1267    return m_strOldName;
     1268}
     1269
     1270void ControllerItem::setBus(KStorageBus enmBus)
     1271{
     1272    m_enmBus = enmBus;
     1273
     1274    updateBusInfo();
     1275    updateTypeInfo();
     1276    updatePixmaps();
     1277}
     1278
    12271279KStorageBus ControllerItem::bus() const
    12281280{
     
    12351287}
    12361288
    1237 QString ControllerItem::name() const
    1238 {
    1239     return m_strName;
    1240 }
    1241 
    1242 QString ControllerItem::oldName() const
    1243 {
    1244     return m_strOldName;
     1289void ControllerItem::setType (KStorageControllerType enmType)
     1290{
     1291    m_enmType = enmType;
    12451292}
    12461293
     
    12531300{
    12541301    return m_types;
     1302}
     1303
     1304void ControllerItem::setPortCount (uint uPortCount)
     1305{
     1306    /* Limit maximum port count: */
     1307    m_uPortCount = qMin(uPortCount, (uint)uiCommon().virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus(bus()));
    12551308}
    12561309
     
    12721325}
    12731326
     1327void ControllerItem::setUseIoCache (bool fUseIoCache)
     1328{
     1329    m_fUseIoCache = fUseIoCache;
     1330}
     1331
    12741332bool ControllerItem::useIoCache() const
    12751333{
    12761334    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;
    13071335}
    13081336
     
    15111539}
    15121540
     1541void AttachmentItem::setDeviceType (KDeviceType enmDeviceType)
     1542{
     1543    m_enmDeviceType = enmDeviceType;
     1544}
     1545
     1546KDeviceType AttachmentItem::deviceType() const
     1547{
     1548    return m_enmDeviceType;
     1549}
     1550
     1551DeviceTypeList AttachmentItem::deviceTypes() const
     1552{
     1553    return qobject_cast<ControllerItem*>(parent())->deviceTypeList();
     1554}
     1555
     1556void AttachmentItem::setStorageSlot (const StorageSlot &storageSlot)
     1557{
     1558    m_storageSlot = storageSlot;
     1559}
     1560
    15131561StorageSlot AttachmentItem::storageSlot() const
    15141562{
     
    15301578}
    15311579
    1532 KDeviceType AttachmentItem::deviceType() const
    1533 {
    1534     return m_enmDeviceType;
    1535 }
    1536 
    1537 DeviceTypeList AttachmentItem::deviceTypes() const
    1538 {
    1539     return qobject_cast<ControllerItem*>(parent())->deviceTypeList();
    1540 }
    1541 
    1542 QUuid AttachmentItem::mediumId() const
    1543 {
    1544     return m_uMediumId;
    1545 }
    1546 
    1547 bool AttachmentItem::isHostDrive() const
    1548 {
    1549     return m_fHostDrive;
    1550 }
    1551 
    1552 bool AttachmentItem::isPassthrough() const
    1553 {
    1554     return m_fPassthrough;
    1555 }
    1556 
    1557 bool AttachmentItem::isTempEject() const
    1558 {
    1559     return m_fTempEject;
    1560 }
    1561 
    1562 bool AttachmentItem::isNonRotational() const
    1563 {
    1564     return m_fNonRotational;
    1565 }
    1566 
    1567 bool AttachmentItem::isHotPluggable() const
    1568 {
    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 
    15821580void AttachmentItem::setMediumId (const QUuid &uMediumId)
    15831581{
     
    15881586}
    15891587
     1588QUuid AttachmentItem::mediumId() const
     1589{
     1590    return m_uMediumId;
     1591}
     1592
     1593bool AttachmentItem::isHostDrive() const
     1594{
     1595    return m_fHostDrive;
     1596}
     1597
    15901598void AttachmentItem::setPassthrough (bool fPassthrough)
    15911599{
     
    15931601}
    15941602
     1603bool AttachmentItem::isPassthrough() const
     1604{
     1605    return m_fPassthrough;
     1606}
     1607
    15951608void AttachmentItem::setTempEject (bool fTempEject)
    15961609{
     
    15981611}
    15991612
     1613bool AttachmentItem::isTempEject() const
     1614{
     1615    return m_fTempEject;
     1616}
     1617
    16001618void AttachmentItem::setNonRotational (bool fNonRotational)
    16011619{
     
    16031621}
    16041622
     1623bool AttachmentItem::isNonRotational() const
     1624{
     1625    return m_fNonRotational;
     1626}
     1627
    16051628void AttachmentItem::setHotPluggable(bool fHotPluggable)
    16061629{
    16071630    m_fHotPluggable = fHotPluggable;
     1631}
     1632
     1633bool AttachmentItem::isHotPluggable() const
     1634{
     1635    return m_fHotPluggable;
    16081636}
    16091637
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h

    r81098 r81099  
    2323
    2424/* GUI includes: */
     25#include "UIMachineSettingsStorage.gen.h"
    2526#include "UIMediumDefs.h"
    2627#include "UISettingsPage.h"
    27 #include "UIMachineSettingsStorage.gen.h"
    2828
    2929/* Forward declarations: */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette