Changeset 50911 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 27, 2014 3:34:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r50910 r50911 1942 1942 1943 1943 /* Determine device & medium types: */ 1944 const KDeviceType deviceType = currentAttachment.GetType(); 1945 const UIMediumType mediumType = deviceType == KDeviceType_DVD ? UIMediumType_DVD : 1946 deviceType == KDeviceType_Floppy ? UIMediumType_Floppy : 1947 UIMediumType_Invalid; 1948 AssertMsgReturnVoid(deviceType != KDeviceType_Null, ("Incorrect storage device type!\n")); 1944 const UIMediumType mediumType = mediumTypeToLocal(currentAttachment.GetType()); 1949 1945 AssertMsgReturnVoid(mediumType != UIMediumType_Invalid, ("Incorrect storage medium type!\n")); 1950 1946 … … 1954 1950 pActionOpenExistingMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), currentAttachment.GetDevice(), 1955 1951 mediumType))); 1952 switch (mediumType) 1953 { 1954 case UIMediumType_DVD: 1955 pActionOpenExistingMedium->setText(QApplication::translate("UIMachineSettingsStorage", "Choose a virtual CD/DVD disk file...")); 1956 break; 1957 case UIMediumType_Floppy: 1958 pActionOpenExistingMedium->setText(QApplication::translate("UIMachineSettingsStorage", "Choose a virtual floppy disk file...")); 1959 break; 1960 default: 1961 break; 1962 } 1956 1963 1957 1964 … … 1964 1971 switch (mediumType) 1965 1972 { 1966 case UIMediumType_DVD: mediums = vboxGlobal().host().GetDVDDrives(); break;1973 case UIMediumType_DVD: mediums = vboxGlobal().host().GetDVDDrives(); break; 1967 1974 case UIMediumType_Floppy: mediums = vboxGlobal().host().GetFloppyDrives(); break; 1968 1975 default: break; … … 2001 2008 switch (mediumType) 2002 2009 { 2003 case UIMediumType_DVD: strRecentMediumAddress = GUI_RecentListCD; break;2010 case UIMediumType_DVD: strRecentMediumAddress = GUI_RecentListCD; break; 2004 2011 case UIMediumType_Floppy: strRecentMediumAddress = GUI_RecentListFD; break; 2005 2012 default: break; … … 2049 2056 pActionUnmountMedium->setEnabled(!currentMedium.isNull()); 2050 2057 pActionUnmountMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), currentAttachment.GetDevice()))); 2051 2052 2053 /* Switch CD/FD names/icons: */ 2054 switch (mediumType) 2055 { 2056 case UIMediumType_DVD: 2057 pActionOpenExistingMedium->setText(QApplication::translate("UIMachineSettingsStorage", "Choose a virtual CD/DVD disk file...")); 2058 pActionUnmountMedium->setText(QApplication::translate("UIMachineSettingsStorage", "Remove disk from virtual drive")); 2059 pActionUnmountMedium->setIcon(UIIconPool::iconSet(":/cd_unmount_16px.png", ":/cd_unmount_disabled_16px.png")); 2060 break; 2061 case UIMediumType_Floppy: 2062 pActionOpenExistingMedium->setText(QApplication::translate("UIMachineSettingsStorage", "Choose a virtual floppy disk file...")); 2063 pActionUnmountMedium->setText(QApplication::translate("UIMachineSettingsStorage", "Remove disk from virtual drive")); 2064 pActionUnmountMedium->setIcon(UIIconPool::iconSet(":/fd_unmount_16px.png", ":/fd_unmount_disabled_16px.png")); 2065 break; 2066 default: 2067 break; 2068 } 2058 pActionUnmountMedium->setText(QApplication::translate("UIMachineSettingsStorage", "Remove disk from virtual drive")); 2059 if (mediumType == UIMediumType_DVD) 2060 pActionUnmountMedium->setIcon(UIIconPool::iconSet(":/cd_unmount_16px.png", ":/cd_unmount_disabled_16px.png")); 2061 else if (mediumType == UIMediumType_Floppy) 2062 pActionUnmountMedium->setIcon(UIIconPool::iconSet(":/fd_unmount_16px.png", ":/fd_unmount_disabled_16px.png")); 2069 2063 } 2070 2064 … … 2091 2085 /* New mount-target attributes: */ 2092 2086 QString strNewID; 2093 const bool fSelectWithMediaManager = target.mediumType != UIMediumType_Invalid && target.data.isNull();2094 2087 2095 2088 /* Invoke file-open dialog to choose medium ID: */ 2096 if ( fSelectWithMediaManager)2089 if (target.mediumType != UIMediumType_Invalid && target.data.isNull()) 2097 2090 { 2098 2091 /* Keyboard can be captured by machine-view. … … 2176 2169 /* Remount medium to the predefined port/device: */ 2177 2170 bool fWasMounted = false; 2171 /* Remounting: */ 2178 2172 machine.MountMedium(target.name, target.port, target.device, cmedium, false /* force? */); 2179 if (machine.isOk()) 2180 fWasMounted = true; 2181 else 2173 fWasMounted = machine.isOk(); 2174 if (!fWasMounted) 2182 2175 { 2183 2176 /* Ask for force remounting: */ 2184 2177 if (msgCenter().cannotRemountMedium(machine, vboxGlobal().medium(strActualID), 2185 fMount, true /* retry? */ , activeMachineWindow()))2186 { 2187 /* Force remount medium to the predefined port/device: */2178 fMount, true /* retry? */)) 2179 { 2180 /* Force remounting: */ 2188 2181 machine.MountMedium(target.name, target.port, target.device, cmedium, true /* force? */); 2189 if (machine.isOk()) 2190 fWasMounted = true; 2191 else 2182 fWasMounted = machine.isOk(); 2183 if (!fWasMounted) 2192 2184 msgCenter().cannotRemountMedium(machine, vboxGlobal().medium(strActualID), 2193 fMount, false /* retry? */ , activeMachineWindow());2185 fMount, false /* retry? */); 2194 2186 } 2195 2187 }
Note:
See TracChangeset
for help on using the changeset viewer.