VirtualBox

Changeset 55097 in vbox for trunk


Ignore:
Timestamp:
Apr 3, 2015 6:03:16 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: 7127: Medium-enumeration improvements: UIMedium header logical reordering.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h

    r55096 r55097  
    114114    void refresh();
    115115
    116     /** Returns whether this medium is hidden.
    117       * @note The medium is considered hidden if it has corresponding
    118       *       medium property or is connected to hidden VMs only. */
    119     bool isHidden() const { return m_fHidden | m_fAttachedToHiddenMachinesOnly; }
     116    /** Returns the type of UIMedium object. */
     117    UIMediumType type() const { return m_type; }
    120118
    121119    /** Returns the CMedium wrapped by this UIMedium object. */
    122120    const CMedium &medium() const { return m_medium; }
    123121
    124     /** Returns the type of UIMedium object. */
    125     UIMediumType type() const { return m_type; }
     122    /** Returns @c true if CMedium wrapped by this UIMedium object is a NULL object. */
     123    bool isNull() const { return m_medium.isNull(); }
    126124
    127125    /** Returns the medium state.
     
    135133    }
    136134
    137     /** Returns the error result of the last blockAndQueryState() call. */
    138     QString lastAccessError() const { return m_strLastAccessError; }
    139 
    140135    /** Returns the result of the last blockAndQueryState() call.
    141136      * Indicates an error and contain a proper error info if the last state check fails.
     
    149144    }
    150145
     146    /** Returns the error result of the last blockAndQueryState() call. */
     147    QString lastAccessError() const { return m_strLastAccessError; }
     148
     149    /** Returns the medium ID. */
     150    QString id() const { return m_strId; }
     151
     152    /** Returns the medium root ID. */
     153    QString rootID() const { return m_strRootID; }
     154    /** Returns the medium parent ID. */
     155    QString parentID() const { return m_strParentID; }
     156
     157    /** Returns medium root. */
     158    UIMedium root() const;
     159    /** Returns medium parent. */
     160    UIMedium parent() const;
     161
     162    /** Updates medium parent. */
     163    void updateParentID();
     164
    151165    /** Returns the medium cache key. */
    152166    QString key() const { return m_strKey; }
     
    154168    void setKey(const QString &strKey) { m_strKey = strKey; }
    155169
    156     /** Returns the medium ID. */
    157     QString id() const { return m_strId; }
    158 
    159170    /** Returns the medium name.
    160171      * @param fNoDiffs @c true to enable user-friendly "don't show diffs" mode.
     
    175186    QString logicalSize(bool fNoDiffs = false) const { return fNoDiffs ? root().m_strLogicalSize : m_strLogicalSize; }
    176187
     188    /** Returns the hard drive medium disk type.
     189      * @param fNoDiffs @c true to enable user-friendly "don't show diffs" mode.
     190      * @note  In "don't show diffs" mode, this method returns the disk type of root in the given hard drive chain. */
     191    QString hardDiskType(bool fNoDiffs = false) const { return fNoDiffs ? root().m_strHardDiskType : m_strHardDiskType; }
    177192    /** Returns the hard drive medium disk format.
    178193      * @param fNoDiffs @c true to enable user-friendly "don't show diffs" mode.
    179194      * @note  In "don't show diffs" mode, this method returns the disk format of root in the given hard drive chain. */
    180195    QString hardDiskFormat(bool fNoDiffs = false) const { return fNoDiffs ? root().m_strHardDiskFormat : m_strHardDiskFormat; }
    181     /** Returns the hard drive medium disk type.
    182       * @param fNoDiffs @c true to enable user-friendly "don't show diffs" mode.
    183       * @note  In "don't show diffs" mode, this method returns the disk type of root in the given hard drive chain. */
    184     QString hardDiskType(bool fNoDiffs = false) const { return fNoDiffs ? root().m_strHardDiskType : m_strHardDiskType; }
    185196
    186197    /** Returns the hard drive medium storage details. */
     
    194205    /** Returns the short version of medium tool-tip. */
    195206    QString tip() const { return m_strToolTip; }
    196 
    197     /** Returns the medium cache for "don't show diffs" mode. */
    198     const NoDiffsCache& cache() const { return m_noDiffs; }
    199 
    200     /** Returns whether this medium is read-only
    201       * (either because it is Immutable or because it has child hard drives).
    202       * @note Read-only medium can only be attached indirectly. */
    203     bool isReadOnly() const { return m_fReadOnly; }
    204 
    205     /** Returns whether this medium is attached to any VM (in the current state or in a snapshot) in which case
    206       * #usage() will contain a string with comma-separated VM names (with snapshot names, if any, in parenthesis). */
    207     bool isUsed() const { return !m_strUsage.isNull(); }
    208 
    209     /** Returns whether this medium is attached to any VM in any snapshot. */
    210     bool isUsedInSnapshots() const { return m_fUsedInSnapshots; }
    211 
    212     /** Returns whether this medium corresponds to real host drive. */
    213     bool isHostDrive() const { return m_fHostDrive; }
    214 
    215     /** Returns a vector of IDs of all machines this medium is attached to. */
    216     const QList <QString> &machineIds() const { return m_machineIds; }
    217 
    218     /** Returns whether this medium is attached to the given machine in the current state. */
    219     bool isAttachedInCurStateTo(const QString &strMachineId) const { return m_curStateMachineIds.indexOf(strMachineId) >= 0; }
    220 
    221     /** Returns a vector of IDs of all machines this medium is attached to
    222       * in their current state (i.e. excluding snapshots). */
    223     const QList <QString> &curStateMachineIds() const { return m_curStateMachineIds; }
    224 
    225     /** Updates medium parent. */
    226     void updateParentID();
    227     /** Returns the medium parent ID. */
    228     QString parentID() const { return m_strParentID; }
    229     /** Returns the medium root ID. */
    230     QString rootID() const { return m_strRootID; }
    231     /** Returns medium parent. */
    232     UIMedium parent() const;
    233     /** Returns medium root. */
    234     UIMedium root() const;
    235 
    236207
    237208    /** Returns the full version of medium tool-tip.
     
    244215    QString toolTip(bool fNoDiffs = false, bool fCheckRO = false, bool fNullAllowed = false) const;
    245216
     217    /** Shortcut to <tt>#toolTip(fNoDiffs, true, fNullAllowed)</tt>. */
     218    QString toolTipCheckRO(bool fNoDiffs = false, bool fNullAllowed = false) const { return toolTip(fNoDiffs, true, fNullAllowed); }
     219
    246220    /** Returns an icon corresponding to the medium state.
    247221      * Distinguishes between the Inaccessible state and the situation when querying the state itself failed.
     
    252226      *        hard drive chain will be used to select the medium icon. */
    253227    QPixmap icon(bool fNoDiffs = false, bool fCheckRO = false) const;
    254 
    255     /** Shortcut to <tt>#toolTip(fNoDiffs, true, fNullAllowed)</tt>. */
    256     QString toolTipCheckRO(bool fNoDiffs = false, bool fNullAllowed = false) const { return toolTip(fNoDiffs, true, fNullAllowed); }
    257228
    258229    /** Shortcut to <tt>#icon(fNoDiffs, true)</tt>. */
     
    278249    QString detailsHTML(bool fNoDiffs = false, bool fPredictDiff = false) const { return details(fNoDiffs, fPredictDiff, true); }
    279250
    280     /** Returns @c true if CMedium wrapped by this UIMedium object is a NULL object. */
    281     bool isNull() const { return m_medium.isNull(); }
     251    /** Returns the medium cache for "don't show diffs" mode. */
     252    const NoDiffsCache& cache() const { return m_noDiffs; }
     253
     254    /** Returns whether this medium is hidden.
     255      * @note The medium is considered hidden if it has corresponding
     256      *       medium property or is connected to hidden VMs only. */
     257    bool isHidden() const { return m_fHidden | m_fAttachedToHiddenMachinesOnly; }
     258
     259    /** Returns whether this medium is read-only
     260      * (either because it is Immutable or because it has child hard drives).
     261      * @note Read-only medium can only be attached indirectly. */
     262    bool isReadOnly() const { return m_fReadOnly; }
     263
     264    /** Returns whether this medium is attached to any VM in any snapshot. */
     265    bool isUsedInSnapshots() const { return m_fUsedInSnapshots; }
     266
     267    /** Returns whether this medium corresponds to real host drive. */
     268    bool isHostDrive() const { return m_fHostDrive; }
     269
     270    /** Returns whether this medium is attached to any VM (in the current state or in a snapshot) in which case
     271      * #usage() will contain a string with comma-separated VM names (with snapshot names, if any, in parenthesis). */
     272    bool isUsed() const { return !m_strUsage.isNull(); }
     273
     274    /** Returns whether this medium is attached to the given machine in the current state. */
     275    bool isAttachedInCurStateTo(const QString &strMachineId) const { return m_curStateMachineIds.indexOf(strMachineId) >= 0; }
     276
     277    /** Returns a vector of IDs of all machines this medium is attached to. */
     278    const QList <QString> &machineIds() const { return m_machineIds; }
     279    /** Returns a vector of IDs of all machines this medium is attached to
     280      * in their current state (i.e. excluding snapshots). */
     281    const QList <QString> &curStateMachineIds() const { return m_curStateMachineIds; }
    282282
    283283    /** Returns NULL medium ID. */
     
    293293    void checkNoDiffs(bool fNoDiffs);
    294294
     295    /** Holds the type of UIMedium object. */
     296    UIMediumType m_type;
     297
    295298    /** Holds the CMedium wrapped by this UIMedium object. */
    296299    CMedium m_medium;
    297300
    298     /** Holds the type of UIMedium object. */
    299     UIMediumType m_type;
    300 
    301301    /** Holds the medium state. */
    302302    KMediumState m_state;
     303    /** Holds the result of the last blockAndQueryState() call. */
     304    COMResult m_result;
    303305    /** Holds the error result of the last blockAndQueryState() call. */
    304306    QString m_strLastAccessError;
    305     /** Holds the result of the last blockAndQueryState() call. */
    306     COMResult m_result;
     307
     308    /** Holds the medium ID. */
     309    QString m_strId;
     310    /** Holds the medium root ID. */
     311    QString m_strRootID;
     312    /** Holds the medium parent ID. */
     313    QString m_strParentID;
    307314
    308315    /** Holds the medium cache key. */
    309316    QString m_strKey;
    310     /** Holds the medium ID. */
    311     QString m_strId;
    312317
    313318    /** Holds the medium name. */
     
    321326    QString m_strLogicalSize;
    322327
     328    /** Holds the hard drive medium disk type. */
     329    QString m_strHardDiskType;
    323330    /** Holds the hard drive medium disk format. */
    324331    QString m_strHardDiskFormat;
    325     /** Holds the hard drive medium disk type. */
    326     QString m_strHardDiskType;
    327332    /** Holds the hard drive medium storage details. */
    328333    QString m_strStorageDetails;
     
    332337    /** Holds the medium tool-tip. */
    333338    QString m_strToolTip;
     339    /** Holds the vector of IDs of all machines this medium is attached to. */
     340    QList<QString> m_machineIds;
     341    /** Hodls the vector of IDs of all machines this medium is attached to
     342      * in their current state (i.e. excluding snapshots). */
     343    QList<QString> m_curStateMachineIds;
     344
     345    /** Holds the medium cache for "don't show diffs" mode. */
     346    NoDiffsCache m_noDiffs;
    334347
    335348    /** Holds whether this medium is hidden by the corresponding medium property. */
     
    344357    bool m_fHostDrive                    : 1;
    345358
    346     /** Holds the vector of IDs of all machines this medium is attached to. */
    347     QList<QString> m_machineIds;
    348     /** Hodls the vector of IDs of all machines this medium is attached to
    349       * in their current state (i.e. excluding snapshots). */
    350     QList<QString> m_curStateMachineIds;
    351 
    352     /** Holds the medium parent ID. */
    353     QString m_strParentID;
    354     /** Holds the medium root ID. */
    355     QString m_strRootID;
    356 
    357     /** Holds the medium cache for "don't show diffs" mode. */
    358     NoDiffsCache m_noDiffs;
    359 
    360359    /** Holds the NULL medium ID. */
    361360    static QString m_sstrNullID;
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