- Timestamp:
- Apr 3, 2015 6:03:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h
r55096 r55097 114 114 void refresh(); 115 115 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; } 120 118 121 119 /** Returns the CMedium wrapped by this UIMedium object. */ 122 120 const CMedium &medium() const { return m_medium; } 123 121 124 /** Returns the type of UIMediumobject. */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(); } 126 124 127 125 /** Returns the medium state. … … 135 133 } 136 134 137 /** Returns the error result of the last blockAndQueryState() call. */138 QString lastAccessError() const { return m_strLastAccessError; }139 140 135 /** Returns the result of the last blockAndQueryState() call. 141 136 * Indicates an error and contain a proper error info if the last state check fails. … … 149 144 } 150 145 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 151 165 /** Returns the medium cache key. */ 152 166 QString key() const { return m_strKey; } … … 154 168 void setKey(const QString &strKey) { m_strKey = strKey; } 155 169 156 /** Returns the medium ID. */157 QString id() const { return m_strId; }158 159 170 /** Returns the medium name. 160 171 * @param fNoDiffs @c true to enable user-friendly "don't show diffs" mode. … … 175 186 QString logicalSize(bool fNoDiffs = false) const { return fNoDiffs ? root().m_strLogicalSize : m_strLogicalSize; } 176 187 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; } 177 192 /** Returns the hard drive medium disk format. 178 193 * @param fNoDiffs @c true to enable user-friendly "don't show diffs" mode. 179 194 * @note In "don't show diffs" mode, this method returns the disk format of root in the given hard drive chain. */ 180 195 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; }185 196 186 197 /** Returns the hard drive medium storage details. */ … … 194 205 /** Returns the short version of medium tool-tip. */ 195 206 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-only201 * (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 case206 * #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 to222 * 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 236 207 237 208 /** Returns the full version of medium tool-tip. … … 244 215 QString toolTip(bool fNoDiffs = false, bool fCheckRO = false, bool fNullAllowed = false) const; 245 216 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 246 220 /** Returns an icon corresponding to the medium state. 247 221 * Distinguishes between the Inaccessible state and the situation when querying the state itself failed. … … 252 226 * hard drive chain will be used to select the medium icon. */ 253 227 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); }257 228 258 229 /** Shortcut to <tt>#icon(fNoDiffs, true)</tt>. */ … … 278 249 QString detailsHTML(bool fNoDiffs = false, bool fPredictDiff = false) const { return details(fNoDiffs, fPredictDiff, true); } 279 250 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; } 282 282 283 283 /** Returns NULL medium ID. */ … … 293 293 void checkNoDiffs(bool fNoDiffs); 294 294 295 /** Holds the type of UIMedium object. */ 296 UIMediumType m_type; 297 295 298 /** Holds the CMedium wrapped by this UIMedium object. */ 296 299 CMedium m_medium; 297 300 298 /** Holds the type of UIMedium object. */299 UIMediumType m_type;300 301 301 /** Holds the medium state. */ 302 302 KMediumState m_state; 303 /** Holds the result of the last blockAndQueryState() call. */ 304 COMResult m_result; 303 305 /** Holds the error result of the last blockAndQueryState() call. */ 304 306 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; 307 314 308 315 /** Holds the medium cache key. */ 309 316 QString m_strKey; 310 /** Holds the medium ID. */311 QString m_strId;312 317 313 318 /** Holds the medium name. */ … … 321 326 QString m_strLogicalSize; 322 327 328 /** Holds the hard drive medium disk type. */ 329 QString m_strHardDiskType; 323 330 /** Holds the hard drive medium disk format. */ 324 331 QString m_strHardDiskFormat; 325 /** Holds the hard drive medium disk type. */326 QString m_strHardDiskType;327 332 /** Holds the hard drive medium storage details. */ 328 333 QString m_strStorageDetails; … … 332 337 /** Holds the medium tool-tip. */ 333 338 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; 334 347 335 348 /** Holds whether this medium is hidden by the corresponding medium property. */ … … 344 357 bool m_fHostDrive : 1; 345 358 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 to349 * 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 360 359 /** Holds the NULL medium ID. */ 361 360 static QString m_sstrNullID;
Note:
See TracChangeset
for help on using the changeset viewer.