Changeset 73017 in vbox
- Timestamp:
- Jul 10, 2018 8:35:25 AM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r72927 r73017 2511 2511 CVirtualBox comVBox = virtualBox(); 2512 2512 2513 /* Remember the path of the last chosen medium: */ 2514 switch (enmMediumType) 2515 { 2516 case UIMediumType_HardDisk: gEDataManager->setRecentFolderForHardDrives(QFileInfo(strMediumLocation).absolutePath()); break; 2517 case UIMediumType_DVD: gEDataManager->setRecentFolderForOpticalDisks(QFileInfo(strMediumLocation).absolutePath()); break; 2518 case UIMediumType_Floppy: gEDataManager->setRecentFolderForFloppyDisks(QFileInfo(strMediumLocation).absolutePath()); break; 2519 default: break; 2520 } 2521 2522 /* Update recently used list: */ 2523 QStringList recentMediumList; 2524 switch (enmMediumType) 2525 { 2526 case UIMediumType_HardDisk: recentMediumList = gEDataManager->recentListOfHardDrives(); break; 2527 case UIMediumType_DVD: recentMediumList = gEDataManager->recentListOfOpticalDisks(); break; 2528 case UIMediumType_Floppy: recentMediumList = gEDataManager->recentListOfFloppyDisks(); break; 2529 default: break; 2530 } 2531 if (recentMediumList.contains(strMediumLocation)) 2532 recentMediumList.removeAll(strMediumLocation); 2533 recentMediumList.prepend(strMediumLocation); 2534 while(recentMediumList.size() > 5) 2535 recentMediumList.removeLast(); 2536 switch (enmMediumType) 2537 { 2538 case UIMediumType_HardDisk: gEDataManager->setRecentListOfHardDrives(recentMediumList); break; 2539 case UIMediumType_DVD: gEDataManager->setRecentListOfOpticalDisks(recentMediumList); break; 2540 case UIMediumType_Floppy: gEDataManager->setRecentListOfFloppyDisks(recentMediumList); break; 2541 default: break; 2542 } 2513 updateRecentlyUsedMediumListAndFolder(enmMediumType, strMediumLocation); 2543 2514 2544 2515 /* Open corresponding medium: */ … … 3101 3072 return fUseHtml ? guiMedium.detailsHTML(true /* no diffs? */, fPredictDiff) : 3102 3073 guiMedium.details(true /* no diffs? */, fPredictDiff); 3074 } 3075 3076 void VBoxGlobal::updateRecentlyUsedMediumListAndFolder(UIMediumType enmMediumType, QString strMediumLocation) 3077 { 3078 /* Remember the path of the last chosen medium: */ 3079 switch (enmMediumType) 3080 { 3081 case UIMediumType_HardDisk: gEDataManager->setRecentFolderForHardDrives(QFileInfo(strMediumLocation).absolutePath()); break; 3082 case UIMediumType_DVD: gEDataManager->setRecentFolderForOpticalDisks(QFileInfo(strMediumLocation).absolutePath()); break; 3083 case UIMediumType_Floppy: gEDataManager->setRecentFolderForFloppyDisks(QFileInfo(strMediumLocation).absolutePath()); break; 3084 default: break; 3085 } 3086 3087 /* Update recently used list: */ 3088 QStringList recentMediumList; 3089 switch (enmMediumType) 3090 { 3091 case UIMediumType_HardDisk: recentMediumList = gEDataManager->recentListOfHardDrives(); break; 3092 case UIMediumType_DVD: recentMediumList = gEDataManager->recentListOfOpticalDisks(); break; 3093 case UIMediumType_Floppy: recentMediumList = gEDataManager->recentListOfFloppyDisks(); break; 3094 default: break; 3095 } 3096 if (recentMediumList.contains(strMediumLocation)) 3097 recentMediumList.removeAll(strMediumLocation); 3098 recentMediumList.prepend(strMediumLocation); 3099 while(recentMediumList.size() > 5) 3100 recentMediumList.removeLast(); 3101 switch (enmMediumType) 3102 { 3103 case UIMediumType_HardDisk: gEDataManager->setRecentListOfHardDrives(recentMediumList); break; 3104 case UIMediumType_DVD: gEDataManager->setRecentListOfOpticalDisks(recentMediumList); break; 3105 case UIMediumType_Floppy: gEDataManager->setRecentListOfFloppyDisks(recentMediumList); break; 3106 default: break; 3107 } 3103 3108 } 3104 3109 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r72903 r73017 532 532 * @param fUseHtml Brings whether HTML subsets should be used in the generated output. */ 533 533 QString details(const CMedium &comMedium, bool fPredictDiff, bool fUseHtml = true); 534 535 /** Update extra data related to recently used/referred media. 536 * @param enmMediumType Passes the medium type. 537 * @param strMediumLocation Passes the medium location. */ 538 void updateRecentlyUsedMediumListAndFolder(UIMediumType enmMediumType, QString strMediumLocation); 534 539 /** @} */ 535 540
Note:
See TracChangeset
for help on using the changeset viewer.