Changeset 50910 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 27, 2014 3:21:43 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 93034
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r50897 r50910 1952 1952 /* Prepare open-existing-medium action: */ 1953 1953 QAction *pActionOpenExistingMedium = menu.addAction(QIcon(":/select_file_16px.png"), QString(), pListener, pszSlotName); 1954 pActionOpenExistingMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), 1955 currentAttachment.GetDevice(),mediumType)));1954 pActionOpenExistingMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), currentAttachment.GetDevice(), 1955 mediumType))); 1956 1956 1957 1957 … … 1991 1991 pActionChooseHostDrive->setCheckable(true); 1992 1992 pActionChooseHostDrive->setChecked(!currentMedium.isNull() && medium.GetId() == strCurrentID); 1993 pActionChooseHostDrive->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), 1994 currentAttachment.GetDevice(), medium.GetId())));1993 pActionChooseHostDrive->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), currentAttachment.GetDevice(), 1994 mediumType, UIMediumTarget::UIMediumTargetType_WithID, medium.GetId()))); 1995 1995 } 1996 1996 } … … 2034 2034 pActionChooseRecentMedium->setCheckable(true); 2035 2035 pActionChooseRecentMedium->setChecked(!currentMedium.isNull() && strRecentMediumLocation == strCurrentLocation); 2036 pActionChooseRecentMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), 2037 currentAttachment.GetDevice(), mediumType, 2038 strRecentMediumLocation))); 2036 pActionChooseRecentMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), currentAttachment.GetDevice(), 2037 mediumType, UIMediumTarget::UIMediumTargetType_WithLocation, strRecentMediumLocation))); 2039 2038 pActionChooseRecentMedium->setToolTip(strRecentMediumLocation); 2040 2039 } … … 2049 2048 QAction *pActionUnmountMedium = menu.addAction(QString(), pListener, pszSlotName); 2050 2049 pActionUnmountMedium->setEnabled(!currentMedium.isNull()); 2051 pActionUnmountMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, 2052 currentAttachment.GetPort(), currentAttachment.GetDevice()))); 2050 pActionUnmountMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), currentAttachment.GetDevice()))); 2053 2051 2054 2052 … … 2093 2091 /* New mount-target attributes: */ 2094 2092 QString strNewID; 2095 const bool fSelectWithMediaManager = target.mediumType != UIMediumType_Invalid ;2093 const bool fSelectWithMediaManager = target.mediumType != UIMediumType_Invalid && target.data.isNull(); 2096 2094 2097 2095 /* Invoke file-open dialog to choose medium ID: */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h
r50864 r50910 49 49 enum UIMediumTargetType { UIMediumTargetType_WithID, UIMediumTargetType_WithLocation }; 50 50 51 /** Default medium-target constructor. */ 52 UIMediumTarget() 53 : type(UIMediumTargetType_WithID) 54 , name(QString()), port(0), device(0), mediumType(UIMediumType_Invalid) 55 , data(QString()) 51 /** Medium-target constructor. */ 52 UIMediumTarget(const QString &strName = QString(), LONG iPort = 0, LONG iDevice = 0, 53 UIMediumType aMediumType = UIMediumType_Invalid, 54 UIMediumTargetType aType = UIMediumTargetType_WithID, const QString &strData = QString()) 55 : name(strName), port(iPort), device(iDevice) 56 , mediumType(aMediumType) 57 , type(aType), data(strData) 56 58 {} 57 58 /** Unmount medium-target constructor. */59 UIMediumTarget(const QString &strName, LONG iPort, LONG iDevice)60 : type(UIMediumTargetType_WithID)61 , name(strName), port(iPort), device(iDevice), mediumType(UIMediumType_Invalid)62 , data(QString())63 {}64 65 /** Open medium-target constructor. */66 UIMediumTarget(const QString &strName, LONG iPort, LONG iDevice, UIMediumType otherMediumType)67 : type(UIMediumTargetType_WithID)68 , name(strName), port(iPort), device(iDevice), mediumType(otherMediumType)69 , data(QString())70 {}71 72 /** Predefined medium-target constructor. */73 UIMediumTarget(const QString &strName, LONG iPort, LONG iDevice, const QString &strID)74 : type(UIMediumTargetType_WithID)75 , name(strName), port(iPort), device(iDevice), mediumType(UIMediumType_Invalid)76 , data(strID)77 {}78 79 /** Recent medium-target constructor. */80 UIMediumTarget(const QString &strName, LONG iPort, LONG iDevice, UIMediumType otherMediumType, const QString &strLocation)81 : type(UIMediumTargetType_WithLocation)82 , name(strName), port(iPort), device(iDevice), mediumType(otherMediumType)83 , data(strLocation)84 {}85 86 /** Determines medium-target type. */87 UIMediumTargetType type;88 59 89 60 /** Determines controller name. */ … … 97 68 UIMediumType mediumType; 98 69 70 /** Determines medium-target type. */ 71 UIMediumTargetType type; 99 72 /** Depending on medium-target type holds <i>ID</i> or <i>location</i>. */ 100 73 QString data;
Note:
See TracChangeset
for help on using the changeset viewer.