Changeset 67854 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jul 7, 2017 2:12:58 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 116809
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r67277 r67854 697 697 698 698 /** 699 * Similar to toString (KMediumType), but returns 'Differencing' for700 * normal hard disks that have a parent.701 */702 QString VBoxGlobal::mediumTypeString(const CMedium &medium) const703 {704 if (!medium.GetParent().isNull())705 {706 Assert(medium.GetType() == KMediumType_Normal);707 return mDiskTypes_Differencing;708 }709 return gpConverter->toString(medium.GetType());710 }711 712 /**713 699 * Returns the list of the standard COM port names (i.e. "COMx"). 714 700 */ … … 1633 1619 void VBoxGlobal::retranslateUi() 1634 1620 { 1635 mDiskTypes_Differencing = tr ("Differencing", "DiskType");1636 1637 1621 mUserDefinedPortName = tr ("User-defined", "serial port"); 1638 1622 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r67277 r67854 271 271 return tr("%n second(s)", "", cVal); 272 272 } 273 274 QString differencingMediumTypeName() const { return mDiskTypes_Differencing; }275 276 /**277 * Similar to toString (KMediumType), but returns 'Differencing' for278 * normal hard disks that have a parent.279 */280 QString mediumTypeString(const CMedium &medium) const;281 273 282 274 QStringList COMPortNames() const; … … 629 621 int m3DAvailable; 630 622 631 QString mDiskTypes_Differencing;632 633 623 QString mUserDefinedPortName; 634 624 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp
r63567 r67854 41 41 , m_medium(CMedium()) 42 42 , m_state(KMediumState_NotCreated) 43 , m_enmMediumType(KMediumType_Max) 43 44 { 44 45 refresh(); … … 49 50 , m_medium(medium) 50 51 , m_state(KMediumState_NotCreated) 52 , m_enmMediumType(KMediumType_Max) 51 53 { 52 54 refresh(); … … 57 59 , m_medium(medium) 58 60 , m_state(state) 61 , m_enmMediumType(KMediumType_Max) 59 62 { 60 63 refresh(); … … 87 90 m_strSize = other.size(); 88 91 m_strLogicalSize = other.logicalSize(); 92 93 m_enmMediumType = other.mediumType(); 89 94 90 95 m_strHardDiskType = other.hardDiskType(); … … 147 152 m_strName = VBoxGlobal::tr("Empty", "medium"); 148 153 m_strLocation = m_strSize = m_strLogicalSize = QString("--"); 154 155 /* Reset medium type parameter: */ 156 m_enmMediumType = KMediumType_Max; 149 157 150 158 /* Reset hard drive related parameters: */ … … 211 219 } 212 220 221 /* Refresh medium type: */ 222 m_enmMediumType = m_medium.GetType(); 223 213 224 /* For hard drive medium: */ 214 225 if (m_type == UIMediumType_HardDisk) 215 226 { 216 227 /* Refresh hard drive disk type: */ 217 m_strHardDiskType = vboxGlobal().mediumTypeString(m_medium);228 m_strHardDiskType = mediumTypeToString(m_medium); 218 229 /* Refresh hard drive format: */ 219 230 m_strHardDiskFormat = m_medium.GetFormat(); … … 610 621 } 611 622 623 /* static */ 624 QString UIMedium::mediumTypeToString(const CMedium &comMedium) 625 { 626 if (!comMedium.GetParent().isNull()) 627 { 628 Assert(comMedium.GetType() == KMediumType_Normal); 629 return QApplication::translate("VBoxGlobal", "Differencing", "MediumType"); 630 } 631 return gpConverter->toString(comMedium.GetType()); 632 } 633 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h
r62493 r67854 187 187 QString logicalSize(bool fNoDiffs = false) const { return fNoDiffs ? root().m_strLogicalSize : m_strLogicalSize; } 188 188 189 /** Returns the medium disk type. 190 * @param fNoDiffs @c true to enable user-friendly "don't show diffs" mode. 191 * @note In "don't show diffs" mode, this method returns the disk type of root in the given hard drive chain. */ 192 KMediumType mediumType(bool fNoDiffs = false) const { return fNoDiffs ? root().m_enmMediumType : m_enmMediumType; } 193 189 194 /** Returns the hard drive medium disk type. 190 195 * @param fNoDiffs @c true to enable user-friendly "don't show diffs" mode. … … 307 312 void checkNoDiffs(bool fNoDiffs); 308 313 314 /** Returns string representation for passed @a comMedium type. */ 315 static QString mediumTypeToString(const CMedium &comMedium); 316 309 317 /** Holds the type of UIMedium object. */ 310 318 UIMediumType m_type; … … 339 347 /** Holds the medium logical size. */ 340 348 QString m_strLogicalSize; 349 350 /** Holds the medium disk type. */ 351 KMediumType m_enmMediumType; 341 352 342 353 /** Holds the hard drive medium disk type. */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r67810 r67854 384 384 m_enmType = m_guiMedium.type(); 385 385 /* Gather medium options data: */ 386 m_options.m_enmType = m_guiMedium.medium ().GetType(); /// @todo: Cache it in UIMedium class!386 m_options.m_enmType = m_guiMedium.mediumType(); 387 387 /* Gather medium details data: */ 388 388 m_details.m_aFields.clear();
Note:
See TracChangeset
for help on using the changeset viewer.