Changeset 24398 in vbox for trunk/src/VBox
- Timestamp:
- Nov 5, 2009 4:27:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r24395 r24398 2217 2217 } 2218 2218 2219 foreach (const CMedium &medium, mediums) 2219 const int maxMediumsToBeShown = 5; 2220 CMedium currentMedium = attachment.GetMedium(); 2221 QString currentId = currentMedium.isNull() ? QString::null : currentMedium.GetId(); 2222 bool currentUsed = false; 2223 foreach (CMedium medium, mediums) 2220 2224 { 2221 2225 bool isMediumUsed = false; … … 2234 2238 if (!isMediumUsed) 2235 2239 { 2240 if ( !currentUsed 2241 && !currentMedium.isNull() 2242 && addedIntoList == maxMediumsToBeShown-1) 2243 medium = currentMedium; 2244 2245 if (medium.GetId() == currentId) 2246 currentUsed = true; 2247 2236 2248 QAction *mountMediumAction = new QAction (VBoxMedium (medium, mediumType).name(), attachmentMenu); 2237 2249 mountMediumAction->setCheckable (true); 2238 2250 mountMediumAction->setChecked (!attachment.GetMedium().isNull() && 2239 medium.GetId() == attachment.GetMedium().GetId());2251 medium.GetId() == currentId); 2240 2252 mountMediumAction->setData (QVariant::fromValue (MountTarget (attachment.GetController().GetName(), 2241 2253 attachment.GetPort(), … … 2245 2257 attachmentMenu->addAction (mountMediumAction); 2246 2258 ++ addedIntoList; 2247 if (addedIntoList == 5)2259 if (addedIntoList == maxMediumsToBeShown) 2248 2260 break; 2249 2261 }
Note:
See TracChangeset
for help on using the changeset viewer.