- Timestamp:
- May 24, 2019 12:01:05 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r78395 r78721 2493 2493 } 2494 2494 2495 void VBoxGlobal::startMedi umEnumeration(const CMediumVector &mediaList/* = CMediumVector() */)2495 void VBoxGlobal::startMediaEnumeration(const CMediumVector &comMedia /* = CMediumVector() */) 2496 2496 { 2497 2497 /* Make sure VBoxGlobal is already valid: */ 2498 2498 AssertReturnVoid(m_fValid); 2499 /* Ignore the request during VBoxGlobal cleanup: */ 2500 if (s_fCleaningUp) 2501 return; 2502 /* Ignore the request during startup snapshot restoring: */ 2503 if (shouldRestoreCurrentSnapshot()) 2504 return; 2499 2505 2500 2506 /* Make sure medium-enumerator is already created: */ 2501 2507 if (!m_pMediumEnumerator) 2502 2508 return; 2503 2504 2509 /* Make sure enumeration is not already started: */ 2505 2510 if (isMediumEnumerationInProgress()) 2506 2511 return; 2507 2512 2508 /* Ignore the request during VBoxGlobal cleanup: */ 2509 if (s_fCleaningUp) 2510 return; 2511 2512 /* If asked to restore snapshot, don't do this till *after* we're done 2513 * restoring or the code with have a heart attack. */ 2514 if (shouldRestoreCurrentSnapshot()) 2515 return; 2516 2513 /* Redirect request to medium-enumerator under proper lock: */ 2517 2514 if (m_meCleanupProtectionToken.tryLockForRead()) 2518 2515 { 2519 /* Redirect request to medium-enumerator: */2520 2516 if (m_pMediumEnumerator) 2521 m_pMediumEnumerator-> enumerateMedia(mediaList);2517 m_pMediumEnumerator->startMediaEnumeration(comMedia); 2522 2518 m_meCleanupProtectionToken.unlock(); 2523 2519 } … … 3311 3307 { 3312 3308 /* UI medium may be new and not among our media, request enumeration: */ 3313 startMedi umEnumeration();3309 startMediaEnumeration(); 3314 3310 3315 3311 /* Search for corresponding UI medium again: */ … … 3939 3935 void VBoxGlobal::sltGUILanguageChange(QString strLanguage) 3940 3936 { 3941 /* Make sure medi um-enumeration is not in progress! */3937 /* Make sure media-enumeration is not in progress! */ 3942 3938 AssertReturnVoid(!isMediumEnumerationInProgress()); 3943 3939 /* Load passed language: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r77556 r78721 92 92 void sigMediumDeleted(const QUuid &uMediumID); 93 93 94 /** Notifies listeners about medi umenumeration started. */94 /** Notifies listeners about media-enumeration started. */ 95 95 void sigMediumEnumerationStarted(); 96 96 /** Notifies listeners about medium with certain @a uMediumID enumerated. */ 97 97 void sigMediumEnumerated(const QUuid &uMediumID); 98 /** Notifies listeners about medi umenumeration finished. */98 /** Notifies listeners about media-enumeration finished. */ 99 99 void sigMediumEnumerationFinished(); 100 100 /** @} */ … … 210 210 bool showStartVMErrors() const { return m_fShowStartVMErrors; } 211 211 212 /** Returns the --aggressive-caching / --no-aggressive-caching option value (whether medi um-enumeration is required). */212 /** Returns the --aggressive-caching / --no-aggressive-caching option value (whether media-enumeration is required). */ 213 213 bool agressiveCaching() const { return m_fAgressiveCaching; } 214 214 … … 476 476 /** @name COM: Virtual Media stuff. 477 477 * @{ */ 478 /** Starts medi umenumeration. */479 void startMedi umEnumeration(const CMediumVector &mediaList = CMediumVector());478 /** Starts media-enumeration. */ 479 void startMediaEnumeration(const CMediumVector &mediaList = CMediumVector()); 480 480 /** Calls refresh for each medium which has been already enumerated. */ 481 481 void refreshMedia(); 482 /** Returns whether medi umenumeration is in progress. */482 /** Returns whether media-enumeration is in progress. */ 483 483 bool isMediumEnumerationInProgress() const; 484 484 /** Returns enumerated medium with certain @a uMediumID. */ … … 806 806 bool m_fShowStartVMErrors; 807 807 808 /** Holds the --aggressive-caching / --no-aggressive-caching option value (whether medi um-enumeration is required). */808 /** Holds the --aggressive-caching / --no-aggressive-caching option value (whether media-enumeration is required). */ 809 809 bool m_fAgressiveCaching; 810 810 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r78063 r78721 1249 1249 /* Cache medium data early if necessary: */ 1250 1250 if (vboxGlobal().agressiveCaching()) 1251 vboxGlobal().startMedi umEnumeration();1251 vboxGlobal().startMediaEnumeration(); 1252 1252 1253 1253 /* Prepare: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r76941 r78721 115 115 #endif /* VBOX_WS_X11 */ 116 116 117 /** Handles signal about medi um-enumeration finished. */117 /** Handles signal about media-enumeration finished. */ 118 118 void sltHandleMediumEnumerationFinish(); 119 119 … … 343 343 /** Holds whether the dialog is polished. */ 344 344 bool m_fPolished : 1; 345 /** Holds whether first medi umenumeration handled. */345 /** Holds whether first media-enumeration handled. */ 346 346 bool m_fFirstMediumEnumerationHandled : 1; 347 347 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp
r78421 r78721 45 45 46 46 47 /** UITask extension used for medi um-enumeration purposes.47 /** UITask extension used for media-enumeration purposes. 48 48 * @note Indeed property/setProperty API isn't thread-safe stuff. 49 49 * This isn't dangerous for us since setter/getter API calls … … 58 58 public: 59 59 60 /** Constructs @a medi um-enumeration task. */60 /** Constructs @a media-enumeration task. */ 61 61 UITaskMediumEnumeration(const UIMedium &medium) 62 62 : UITask(UITask::Type_MediumEnumeration) … … 69 69 private: 70 70 71 /** Contains medi um-enumeration task body. */71 /** Contains media-enumeration task body. */ 72 72 virtual void run() /* override */ 73 73 { … … 174 174 } 175 175 176 void UIMediumEnumerator:: enumerateMedia(const CMediumVector &inputMedia /* = CMediumVector() */)176 void UIMediumEnumerator::startMediaEnumeration(const CMediumVector &comMedia /* = CMediumVector() */) 177 177 { 178 178 /* Make sure we are not already in progress: */ … … 183 183 UIMediumMap media; 184 184 addNullMediumToMap(media); 185 /* If @p inputMedia is empty we start the mediaenumeration with all186 * known hard disk media. Otherwise only passed inputMedia will be187 * enumerated. But be aware we will enumerate all the optical /floppy188 * media in any case to make them listed within the first run wizard189 * for now. But I think later we can add proper enumeration call to190 * the wizard instead and enumerate only inputMedia in 'else' case. */191 if ( inputMedia.isEmpty())185 /* If @p comMedia is empty we start the media-enumeration with all 186 * known hard disk media. Otherwise only passed comMedia will be 187 * enumerated. But be aware we will enumerate all the optical media 188 * in any case to make them listed within the first run wizard for 189 * now. But I think later we can add proper enumeration call to the 190 * wizard instead and enumerate only comMedia in 'else' case. */ 191 if (comMedia.isEmpty()) 192 192 { 193 193 addMediaToMap(vboxGlobal().virtualBox().GetHardDisks(), media); … … 201 201 addMediaToMap(vboxGlobal().host().GetDVDDrives(), media); 202 202 addMediaToMap(vboxGlobal().virtualBox().GetDVDImages(), media); 203 addMediaToMap( inputMedia, media);203 addMediaToMap(comMedia, media); 204 204 } 205 205 … … 208 208 return; 209 209 210 /* Re member newmedia map: */210 /* Replace existing media map: */ 211 211 m_media = media; 212 212 213 /* Notify listener : */213 /* Notify listener about enumeration started: */ 214 214 LogRel(("GUI: UIMediumEnumerator: Medium-enumeration started...\n")); 215 215 m_fMediumEnumerationInProgress = true; … … 219 219 if (m_media.size() == 1) 220 220 { 221 /* Notify listener : */221 /* Notify listener about enumeration finished instantly: */ 222 222 LogRel(("GUI: UIMediumEnumerator: Medium-enumeration finished!\n")); 223 223 m_fMediumEnumerationInProgress = false; … … 542 542 void UIMediumEnumerator::createMediumEnumerationTask(const UIMedium &guiMedium) 543 543 { 544 /* Prepare medi um-enumeration task: */544 /* Prepare media-enumeration task: */ 545 545 UITask *pTask = new UITaskMediumEnumeration(guiMedium); 546 546 /* Append to internal set: */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h
r78421 r78721 46 46 typedef QMap<QUuid, CMedium> CMediumMap; 47 47 48 /** QObject extension operating as medi um-enumeration object.48 /** QObject extension operating as media-enumeration object. 49 49 * Manages access to cached UIMedium information via public API. 50 50 * Updates cache on corresponding Main events using thread-pool interface. */ … … 60 60 void sigMediumDeleted(const QUuid &uMediumID); 61 61 62 /** Notifies listeners about consolidated medi um-enumeration process has started. */62 /** Notifies listeners about consolidated media-enumeration process has started. */ 63 63 void sigMediumEnumerationStarted(); 64 64 /** Notifies listeners about UIMedium with @a uMediumID updated. */ 65 65 void sigMediumEnumerated(const QUuid &uMediumID); 66 /** Notifies listeners about consolidated medi um-enumeration process has finished. */66 /** Notifies listeners about consolidated media-enumeration process has finished. */ 67 67 void sigMediumEnumerationFinished(); 68 68 … … 82 82 void deleteMedium(const QUuid &uMediumID); 83 83 84 /** Returns whether consolidated medi um-enumeration process is in progress. */84 /** Returns whether consolidated media-enumeration process is in progress. */ 85 85 bool isMediumEnumerationInProgress() const { return m_fMediumEnumerationInProgress; } 86 /** Makes a request to enumerate specified @a inputMedia. 87 * @note Empty list means that full/overall medium-enumeration is requested. */ 88 void enumerateMedia(const CMediumVector &inputMedia = CMediumVector()); 86 /** Makes a request to enumerate specified @a comMedia. 87 * @note Previous map will be replaced with the new one, values present in both 88 * maps will be merged from the previous to new one, keep that all in mind. 89 * @note Empty passed map means that full/overall media-enumeration is requested. */ 90 void startMediaEnumeration(const CMediumVector &comMedia = CMediumVector()); 89 91 /** Refresh all the lightweight UIMedium information for all the cached UIMedium(s). 90 92 * @note Please note that this is a lightweight version, which doesn't perform … … 129 131 #endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 130 132 131 /** Handles medi um-enumeration @a pTask complete signal. */133 /** Handles media-enumeration @a pTask complete signal. */ 132 134 void sltHandleMediumEnumerationTaskComplete(UITask *pTask); 133 135 134 136 private: 135 137 136 /** Creates medi um-enumeration task for certain @a guiMedium. */138 /** Creates media-enumeration task for certain @a guiMedium. */ 137 139 void createMediumEnumerationTask(const UIMedium &guiMedium); 138 140 /** Adds NULL UIMedium to specified @a outputMedia map. */ … … 184 186 #endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 185 187 186 /** Holds whether consolidated medi um-enumeration process is in progress. */188 /** Holds whether consolidated media-enumeration process is in progress. */ 187 189 bool m_fMediumEnumerationInProgress; 188 190 189 /** Holds a set of current medi um-enumeration tasks. */191 /** Holds a set of current media-enumeration tasks. */ 190 192 QSet<UITask*> m_tasks; 191 193 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r78432 r78721 375 375 376 376 /* If medium-item change allowed and 377 * 1. medi um-enumeration is not currently in progress or377 * 1. media-enumeration is not currently in progress or 378 378 * 2. if there is no currently medium-item selected 379 379 * we have to choose newly added medium-item as current one: */ … … 579 579 void UIMediumManagerWidget::sltRefreshAll() 580 580 { 581 /* Start medi um-enumeration: */582 vboxGlobal().startMedi umEnumeration();581 /* Start media-enumeration: */ 582 vboxGlobal().startMediaEnumeration(); 583 583 } 584 584 … … 694 694 retranslateUi(); 695 695 696 /* Start medi um-enumeration (if necessary): */696 /* Start media-enumeration (if necessary): */ 697 697 if (!vboxGlobal().isMediumEnumerationInProgress()) 698 vboxGlobal().startMedi umEnumeration();699 /* Emulate medi um-enumeration otherwise: */698 vboxGlobal().startMediaEnumeration(); 699 /* Emulate media-enumeration otherwise: */ 700 700 else 701 701 { 702 /* Start medi um-enumeration: */702 /* Start media-enumeration: */ 703 703 sltHandleMediumEnumerationStart(); 704 704 705 /* Finish medi um-enumeration (if necessary): */705 /* Finish media-enumeration (if necessary): */ 706 706 if (!vboxGlobal().isMediumEnumerationInProgress()) 707 707 sltHandleMediumEnumerationFinish(); … … 721 721 this, &UIMediumManagerWidget::sltHandleMediumDeleted); 722 722 723 /* Configure medi um-enumeration connections: */723 /* Configure media-enumeration connections: */ 724 724 connect(&vboxGlobal(), &VBoxGlobal::sigMediumEnumerationStarted, 725 725 this, &UIMediumManagerWidget::sltHandleMediumEnumerationStart); -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
r78432 r78721 58 58 59 59 /** Medium manager progress-bar. 60 * Reflects medi um-enumeration progress, stays hidden otherwise. */60 * Reflects media-enumeration progress, stays hidden otherwise. */ 61 61 class UIEnumerationProgressBar : public QWidget 62 62 { -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp
r77372 r78721 81 81 { 82 82 if (vboxGlobal().uiType() == VBoxGlobal::UIType_RuntimeUI) 83 vboxGlobal().startMedi umEnumeration();83 vboxGlobal().startMediaEnumeration(); 84 84 configure(); 85 85 finalize(); … … 233 233 void UIMediumSelector::prepareConnections() 234 234 { 235 /* Configure medi um-enumeration connections: */235 /* Configure media-enumeration connections: */ 236 236 connect(&vboxGlobal(), &VBoxGlobal::sigMediumEnumerationStarted, 237 237 this, &UIMediumSelector::sltHandleMediumEnumerationStart); … … 496 496 { 497 497 /* Initialize media enumation: */ 498 vboxGlobal().startMedi umEnumeration();498 vboxGlobal().startMediaEnumeration(); 499 499 /* Update the search: */ 500 500 m_pSearchWidget->search(m_pTreeWidget); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r76606 r78721 210 210 { 211 211 AssertReturn(m_pSession, false); 212 vboxGlobal().startMedi umEnumeration(m_pSession->getMachineMedia());212 vboxGlobal().startMediaEnumeration(m_pSession->getMachineMedia()); 213 213 } 214 214 /* Prepare machine-logic: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
r77647 r78721 169 169 /* This is needed at least for some vm to show correct storage info. For the manager UI enumeration has been done already: */ 170 170 if (vboxGlobal().uiType() == VBoxGlobal::UIType_RuntimeUI) 171 vboxGlobal().startMedi umEnumeration();171 vboxGlobal().startMediaEnumeration(); 172 172 } 173 173 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r76606 r78721 670 670 #endif 671 671 672 /* Allow to reset first-run flag just when medi umenumeration was finished: */672 /* Allow to reset first-run flag just when media-enumeration was finished: */ 673 673 connect(&vboxGlobal(), &VBoxGlobal::sigMediumEnumerationFinished, 674 674 this, &UISettingsDialogMachine::sltAllowResetFirstRunFlag); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r78627 r78721 3711 3711 * lasted point, where we can start. The rest of the media checking is done 3712 3712 * in a background thread. */ 3713 vboxGlobal().startMedi umEnumeration();3713 vboxGlobal().startMediaEnumeration(); 3714 3714 3715 3715 /* Layout created in the .ui file. */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMediaComboBox.cpp
r76606 r78721 59 59 { 60 60 if (!vboxGlobal().isMediumEnumerationInProgress()) 61 vboxGlobal().startMedi umEnumeration();61 vboxGlobal().startMediaEnumeration(); 62 62 else 63 63 refresh(); … … 206 206 this, &UIMediaComboBox::sltHandleMediumDeleted); 207 207 208 /* Setup medi um-enumeration handlers: */208 /* Setup media-enumeration handlers: */ 209 209 connect(&vboxGlobal(), &VBoxGlobal::sigMediumEnumerationStarted, 210 210 this, &UIMediaComboBox::sltHandleMediumEnumerationStart); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMediaComboBox.h
r76581 r78721 73 73 void sltHandleMediumDeleted(const QUuid &uMediumId); 74 74 75 /** Handles medi umenumeration start. */75 /** Handles media-enumeration start. */ 76 76 void sltHandleMediumEnumerationStart(); 77 77
Note:
See TracChangeset
for help on using the changeset viewer.