Changeset 24400 in vbox for trunk/src/VBox
- Timestamp:
- Nov 5, 2009 5:01:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r24398 r24400 2201 2201 2202 2202 /* Mount Medium actions */ 2203 int addedIntoList = 0;2204 2203 CMediumVector mediums; 2205 2204 switch (mediumType) … … 2217 2216 } 2218 2217 2218 int mediumsToBeShown = 0; 2219 2219 const int maxMediumsToBeShown = 5; 2220 2220 CMedium currentMedium = attachment.GetMedium(); … … 2238 2238 if (!isMediumUsed) 2239 2239 { 2240 if ( !currentUsed 2241 && !currentMedium.isNull() 2242 && addedIntoList == maxMediumsToBeShown-1) 2240 if (!currentUsed && !currentMedium.isNull() && mediumsToBeShown == maxMediumsToBeShown - 1) 2243 2241 medium = currentMedium; 2244 2242 … … 2248 2246 QAction *mountMediumAction = new QAction (VBoxMedium (medium, mediumType).name(), attachmentMenu); 2249 2247 mountMediumAction->setCheckable (true); 2250 mountMediumAction->setChecked (!attachment.GetMedium().isNull() && 2251 medium.GetId() == currentId); 2248 mountMediumAction->setChecked (!currentMedium.isNull() && medium.GetId() == currentId); 2252 2249 mountMediumAction->setData (QVariant::fromValue (MountTarget (attachment.GetController().GetName(), 2253 2250 attachment.GetPort(), … … 2256 2253 connect (mountMediumAction, SIGNAL (triggered (bool)), this, SLOT (mountMedium())); 2257 2254 attachmentMenu->addAction (mountMediumAction); 2258 ++ addedIntoList;2259 if ( addedIntoList== maxMediumsToBeShown)2255 ++ mediumsToBeShown; 2256 if (mediumsToBeShown == maxMediumsToBeShown) 2260 2257 break; 2261 2258 } … … 2278 2275 /* Unmount Medium action */ 2279 2276 QAction *unmountMediumAction = new QAction (attachmentMenu); 2280 unmountMediumAction->setEnabled (! attachment.GetMedium().isNull());2277 unmountMediumAction->setEnabled (!currentMedium.isNull()); 2281 2278 unmountMediumAction->setData (QVariant::fromValue (MountTarget (attachment.GetController().GetName(), 2282 2279 attachment.GetPort(),
Note:
See TracChangeset
for help on using the changeset viewer.