- Timestamp:
- Aug 28, 2018 10:02:14 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/UITakeSnapshotDialog.cpp
r72813 r73926 47 47 : QIWithRetranslateUI<QIDialog>(pParent) 48 48 , m_comMachine(comMachine) 49 , m_cImmutableMedi ums(0)49 , m_cImmutableMedia(0) 50 50 , m_pLabelIcon(0) 51 51 , m_pLabelName(0), m_pEditorName(0) … … 106 106 m_pLabelInfo->setText(tr("Warning: You are taking a snapshot of a running machine which has %n immutable image(s) " 107 107 "attached to it. As long as you are working from this snapshot the immutable image(s) " 108 "will not be reset to avoid loss of data.", "", m_cImmutableMedi ums));108 "will not be reset to avoid loss of data.", "", m_cImmutableMedia)); 109 109 } 110 110 … … 263 263 && !comMedium.GetParent().isNull() 264 264 && comMedium.GetBase().GetType() == KMediumType_Immutable) 265 ++m_cImmutableMedi ums;265 ++m_cImmutableMedia; 266 266 } 267 267 } 268 268 /* Hide if machine have no immutable attachments: */ 269 if (!m_cImmutableMedi ums)269 if (!m_cImmutableMedia) 270 270 m_pLabelInfo->setHidden(true); 271 271 -
trunk/src/VBox/Frontends/VirtualBox/src/UITakeSnapshotDialog.h
r72813 r73926 87 87 88 88 /** Holds the amount of immutable attachments. */ 89 int m_cImmutableMedi ums;89 int m_cImmutableMedia; 90 90 91 91 /** Holds the icon label instance. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.cpp
r73860 r73926 2080 2080 virtual QString shortcutExtraDataID() const /* override */ 2081 2081 { 2082 return QString("RefreshMedi ums");2082 return QString("RefreshMedia"); 2083 2083 } 2084 2084 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r73917 r73926 2440 2440 /* Redirect request to medium-enumerator: */ 2441 2441 if (m_pMediumEnumerator) 2442 m_pMediumEnumerator->enumerateMedi ums();2442 m_pMediumEnumerator->enumerateMedia(); 2443 2443 m_meCleanupProtectionToken.unlock(); 2444 2444 } 2445 2445 } 2446 2446 2447 void VBoxGlobal::refreshMedi ums()2447 void VBoxGlobal::refreshMedia() 2448 2448 { 2449 2449 /* Make sure VBoxGlobal is already valid: */ … … 2469 2469 /* We assume it's safe to call it without locking, 2470 2470 * since we are performing blocking operation here. */ 2471 m_pMediumEnumerator->refreshMedi ums();2471 m_pMediumEnumerator->refreshMedia(); 2472 2472 } 2473 2473 … … 2498 2498 { 2499 2499 /* Redirect call to medium-enumerator: */ 2500 QList<QString> listOfMedi ums;2500 QList<QString> listOfMedia; 2501 2501 if (m_pMediumEnumerator) 2502 listOfMedi ums= m_pMediumEnumerator->mediumIDs();2502 listOfMedia = m_pMediumEnumerator->mediumIDs(); 2503 2503 m_meCleanupProtectionToken.unlock(); 2504 return listOfMedi ums;2504 return listOfMedia; 2505 2505 } 2506 2506 return QList<QString>(); … … 2782 2782 2783 2783 /* Get existing-host-drive vector: */ 2784 CMediumVector comMedi ums;2784 CMediumVector comMedia; 2785 2785 switch (enmMediumType) 2786 2786 { 2787 case UIMediumType_DVD: comMedi ums= host().GetDVDDrives(); break;2788 case UIMediumType_Floppy: comMedi ums= host().GetFloppyDrives(); break;2787 case UIMediumType_DVD: comMedia = host().GetDVDDrives(); break; 2788 case UIMediumType_Floppy: comMedia = host().GetFloppyDrives(); break; 2789 2789 default: break; 2790 2790 } 2791 2791 /* Prepare choose-existing-host-drive actions: */ 2792 foreach (const CMedium &comMedium, comMedi ums)2792 foreach (const CMedium &comMedium, comMedia) 2793 2793 { 2794 2794 /* Make sure host-drive usage is unique: */ … … 3083 3083 if (!comMedium.isNull() && guiMedium.isNull()) 3084 3084 { 3085 /* UI medium may be new and not among our medi ums, request enumeration: */3085 /* UI medium may be new and not among our media, request enumeration: */ 3086 3086 startMediumEnumeration(); 3087 3087 … … 3711 3711 /* Re-enumerate uimedium since they contain some translations too: */ 3712 3712 if (m_fValid) 3713 refreshMedi ums();3713 refreshMedia(); 3714 3714 3715 3715 #ifdef VBOX_WS_X11 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r73917 r73926 479 479 void startMediumEnumeration(); 480 480 /** Calls refresh for each medium which has been already enumerated. */ 481 void refreshMedi ums();481 void refreshMedia(); 482 482 /** Returns whether medium enumeration is in progress. */ 483 483 bool isMediumEnumerationInProgress() const; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r73882 r73926 276 276 void UIVirtualBoxManager::sltHandleMediumEnumerationFinish() 277 277 { 278 /* To avoid annoying the user, we check for inaccessible medi umsjust once, after278 /* To avoid annoying the user, we check for inaccessible media just once, after 279 279 * the first media emumeration [started from main() at startup] is complete. */ 280 280 if (m_fFirstMediumEnumerationHandled) -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r73631 r73926 1593 1593 { 1594 1594 /* Unregister machine first: */ 1595 CMediumVector medi ums= machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);1595 CMediumVector media = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly); 1596 1596 if (!machine.isOk()) 1597 1597 { … … 1600 1600 } 1601 1601 /* Prepare cleanup progress: */ 1602 CProgress progress = machine.DeleteConfig(medi ums);1602 CProgress progress = machine.DeleteConfig(media); 1603 1603 if (!machine.isOk()) 1604 1604 { … … 1617 1617 { 1618 1618 /* Unregister machine first: */ 1619 CMediumVector medi ums= machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);1619 CMediumVector media = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly); 1620 1620 if (!machine.isOk()) 1621 1621 { … … 1624 1624 } 1625 1625 /* Finally close all media, deliberately ignoring errors: */ 1626 foreach (CMedium medium, medi ums)1626 foreach (CMedium medium, media) 1627 1627 { 1628 1628 if (!medium.isNull()) … … 2267 2267 COMBase::CleanupCOM(); 2268 2268 } 2269 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp
r72433 r73926 228 228 if (!m_fHostDrive) 229 229 { 230 /* Only for created and accessible medi ums: */230 /* Only for created and accessible media: */ 231 231 if (m_state != KMediumState_Inaccessible && m_state != KMediumState_NotCreated) 232 232 { … … 275 275 m_strParentId = normalizedID(parentMedium.GetId()); 276 276 277 /* Only for created and accessible medi ums: */277 /* Only for created and accessible media: */ 278 278 if (m_state != KMediumState_Inaccessible && m_state != KMediumState_NotCreated) 279 279 { … … 662 662 return gpConverter->toString(comMedium.GetType()); 663 663 } 664 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h
r71630 r73926 72 72 * will cause the corresponding property of this object's root medium to be returned instead 73 73 * of its own one. This is useful when hard drive medium is reflected in the user-friendly 74 * "don't show diffs" mode. For non-hard drive medi ums, the value of this argument is irrelevant74 * "don't show diffs" mode. For non-hard drive media, the value of this argument is irrelevant 75 75 * because the root object for such medium is the medium itself. 76 76 * … … 79 79 * and therefore some parameters such as #size() are meaningless because they can be read only 80 80 * from the accessible medium. The real KMediumState_NotCreated state is not necessary because 81 * this class is only used with created (existing) medi ums. */81 * this class is only used with created (existing) media. */ 82 82 class SHARED_LIBRARY_STUFF UIMedium 83 83 { -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp
r73917 r73926 89 89 { 90 90 /* Return keys of current medium-map: */ 91 return m_medi ums.keys();91 return m_media.keys(); 92 92 } 93 93 … … 95 95 { 96 96 /* Search through current medium-map for the medium with passed ID: */ 97 if (m_medi ums.contains(strMediumID))98 return m_medi ums[strMediumID];97 if (m_media.contains(strMediumID)) 98 return m_media[strMediumID]; 99 99 /* Return NULL medium otherwise: */ 100 100 return UIMedium(); … … 110 110 AssertReturnVoid(strMediumID != UIMedium::nullID()); 111 111 /* Make sure medium doesn't exists already: */ 112 AssertReturnVoid(!m_medi ums.contains(strMediumID));112 AssertReturnVoid(!m_media.contains(strMediumID)); 113 113 114 114 /* Insert medium: */ 115 m_medi ums[strMediumID] = medium;115 m_media[strMediumID] = medium; 116 116 LogRel(("GUI: UIMediumEnumerator: Medium with key={%s} created\n", strMediumID.toUtf8().constData())); 117 117 … … 126 126 AssertReturnVoid(strMediumID != UIMedium::nullID()); 127 127 /* Make sure medium still exists: */ 128 AssertReturnVoid(m_medi ums.contains(strMediumID));128 AssertReturnVoid(m_media.contains(strMediumID)); 129 129 130 130 /* Remove medium: */ 131 m_medi ums.remove(strMediumID);131 m_media.remove(strMediumID); 132 132 LogRel(("GUI: UIMediumEnumerator: Medium with key={%s} deleted\n", strMediumID.toUtf8().constData())); 133 133 … … 136 136 } 137 137 138 void UIMediumEnumerator::enumerateMedi ums()138 void UIMediumEnumerator::enumerateMedia() 139 139 { 140 140 /* Make sure we are not already in progress: */ 141 141 AssertReturnVoid(!m_fMediumEnumerationInProgress); 142 142 143 /* Compose new map of all currently known medi ums& their children.144 * While composing we are using data from already existing medi ums. */145 UIMediumMap medi ums;146 addNullMediumToMap(medi ums);147 addHardDisksToMap(vboxGlobal().virtualBox().GetHardDisks(), medi ums);148 addMedi umsToMap(vboxGlobal().host().GetDVDDrives(), mediums, UIMediumType_DVD);149 addMedi umsToMap(vboxGlobal().virtualBox().GetDVDImages(), mediums, UIMediumType_DVD);150 addMedi umsToMap(vboxGlobal().host().GetFloppyDrives(), mediums, UIMediumType_Floppy);151 addMedi umsToMap(vboxGlobal().virtualBox().GetFloppyImages(), mediums, UIMediumType_Floppy);143 /* Compose new map of all currently known media & their children. 144 * While composing we are using data from already existing media. */ 145 UIMediumMap media; 146 addNullMediumToMap(media); 147 addHardDisksToMap(vboxGlobal().virtualBox().GetHardDisks(), media); 148 addMediaToMap(vboxGlobal().host().GetDVDDrives(), media, UIMediumType_DVD); 149 addMediaToMap(vboxGlobal().virtualBox().GetDVDImages(), media, UIMediumType_DVD); 150 addMediaToMap(vboxGlobal().host().GetFloppyDrives(), media, UIMediumType_Floppy); 151 addMediaToMap(vboxGlobal().virtualBox().GetFloppyImages(), media, UIMediumType_Floppy); 152 152 if (VBoxGlobal::isCleaningUp()) 153 153 return; /* VBoxGlobal is cleaning up, abort immediately. */ 154 m_medi ums = mediums;154 m_media = media; 155 155 156 156 /* Notify listener: */ … … 160 160 161 161 /* Make sure we really have more than one medium (which is Null): */ 162 if (m_medi ums.size() == 1)162 if (m_media.size() == 1) 163 163 { 164 164 /* Notify listener: */ … … 169 169 170 170 /* Start enumeration for UIMedium(s) with correct ID: */ 171 foreach (const QString &strMediumID, m_medi ums.keys())171 foreach (const QString &strMediumID, m_media.keys()) 172 172 if (!strMediumID.isNull() && strMediumID != UIMedium::nullID()) 173 createMediumEnumerationTask(m_medi ums[strMediumID]);174 } 175 176 void UIMediumEnumerator::refreshMedi ums()173 createMediumEnumerationTask(m_media[strMediumID]); 174 } 175 176 void UIMediumEnumerator::refreshMedia() 177 177 { 178 178 /* Make sure we are not already in progress: */ … … 180 180 181 181 /* Refresh all known media we have: */ 182 foreach (const QString &strMediumID, m_medi ums.keys())183 m_medi ums[strMediumID].refresh();182 foreach (const QString &strMediumID, m_media.keys()) 183 m_media[strMediumID].refresh(); 184 184 } 185 185 … … 202 202 currentCMediumIDs.isEmpty() ? "<empty>" : currentCMediumIDs.join(", ").toUtf8().constData())); 203 203 204 /* Determine excluded medi ums: */204 /* Determine excluded media: */ 205 205 const QSet<QString> previousSet = previousUIMediumIDs.toSet(); 206 206 const QSet<QString> currentSet = currentCMediumIDs.toSet(); … … 299 299 300 300 /* Make sure such UIMedium still exists: */ 301 if (!m_medi ums.contains(strUIMediumKey))301 if (!m_media.contains(strUIMediumKey)) 302 302 { 303 303 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} already deleted by a third party\n", strUIMediumKey.toUtf8().constData())); … … 311 311 { 312 312 /* Delete this medium: */ 313 m_medi ums.remove(strUIMediumKey);313 m_media.remove(strUIMediumKey); 314 314 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} closed and deleted (after enumeration)\n", strUIMediumKey.toUtf8().constData())); 315 315 … … 321 321 { 322 322 /* We have to reinject enumerated medium: */ 323 m_medi ums.remove(strUIMediumKey);324 m_medi ums[strUIMediumID] = uimedium;325 m_medi ums[strUIMediumID].setKey(strUIMediumID);323 m_media.remove(strUIMediumKey); 324 m_media[strUIMediumID] = uimedium; 325 m_media[strUIMediumID].setKey(strUIMediumID); 326 326 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} has it changed to {%s}\n", strUIMediumKey.toUtf8().constData(), 327 327 strUIMediumID.toUtf8().constData())); … … 335 335 { 336 336 /* Just update enumerated medium: */ 337 m_medi ums[strUIMediumID] = uimedium;337 m_media[strUIMediumID] = uimedium; 338 338 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} updated\n", strUIMediumID.toUtf8().constData())); 339 339 … … 355 355 { 356 356 /* Translating NULL uimedium by recreating it: */ 357 if (m_medi ums.contains(UIMedium::nullID()))358 m_medi ums[UIMedium::nullID()] = UIMedium();357 if (m_media.contains(UIMedium::nullID())) 358 m_media[UIMedium::nullID()] = UIMedium(); 359 359 } 360 360 … … 369 369 } 370 370 371 void UIMediumEnumerator::addNullMediumToMap(UIMediumMap &medi ums)371 void UIMediumEnumerator::addNullMediumToMap(UIMediumMap &media) 372 372 { 373 373 /* Insert NULL uimedium to the passed uimedium map. 374 374 * Get existing one from the previous map if any. */ 375 375 QString strNullMediumID = UIMedium::nullID(); 376 UIMedium uimedium = m_medi ums.contains(strNullMediumID) ? m_mediums[strNullMediumID] : UIMedium();377 medi ums.insert(strNullMediumID, uimedium);378 } 379 380 void UIMediumEnumerator::addMedi umsToMap(const CMediumVector &inputMediums, UIMediumMap &outputMediums, UIMediumType mediumType)376 UIMedium uimedium = m_media.contains(strNullMediumID) ? m_media[strNullMediumID] : UIMedium(); 377 media.insert(strNullMediumID, uimedium); 378 } 379 380 void UIMediumEnumerator::addMediaToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia, UIMediumType mediumType) 381 381 { 382 382 /* Insert hard-disks to the passed uimedium map. 383 383 * Get existing one from the previous map if any. */ 384 foreach (CMedium medium, inputMedi ums)384 foreach (CMedium medium, inputMedia) 385 385 { 386 386 /* If VBoxGlobal is cleaning up, abort immediately: */ … … 390 390 /* Prepare uimedium on the basis of current medium: */ 391 391 QString strMediumID = medium.GetId(); 392 UIMedium uimedium = m_medi ums.contains(strMediumID) ? m_mediums[strMediumID] :392 UIMedium uimedium = m_media.contains(strMediumID) ? m_media[strMediumID] : 393 393 UIMedium(medium, mediumType); 394 394 395 395 /* Insert uimedium into map: */ 396 outputMedi ums.insert(uimedium.id(), uimedium);397 } 398 } 399 400 void UIMediumEnumerator::addHardDisksToMap(const CMediumVector &inputMedi ums, UIMediumMap &outputMediums)396 outputMedia.insert(uimedium.id(), uimedium); 397 } 398 } 399 400 void UIMediumEnumerator::addHardDisksToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia) 401 401 { 402 402 /* Insert hard-disks to the passed uimedium map. 403 403 * Get existing one from the previous map if any. */ 404 foreach (CMedium medium, inputMedi ums)404 foreach (CMedium medium, inputMedia) 405 405 { 406 406 /* If VBoxGlobal is cleaning up, abort immediately: */ … … 410 410 /* Prepare uimedium on the basis of current medium: */ 411 411 QString strMediumID = medium.GetId(); 412 UIMedium uimedium = m_medi ums.contains(strMediumID) ? m_mediums[strMediumID] :412 UIMedium uimedium = m_media.contains(strMediumID) ? m_media[strMediumID] : 413 413 UIMedium(medium, UIMediumType_HardDisk); 414 414 415 415 /* Insert uimedium into map: */ 416 outputMedi ums.insert(uimedium.id(), uimedium);416 outputMedia.insert(uimedium.id(), uimedium); 417 417 418 418 /* Insert medium children into map too: */ 419 addHardDisksToMap(medium.GetChildren(), outputMedi ums);419 addHardDisksToMap(medium.GetChildren(), outputMedia); 420 420 } 421 421 } … … 433 433 { 434 434 /* Get corresponding UIMedium: */ 435 const UIMedium &uimedium = m_medi ums[strMediumID];435 const UIMedium &uimedium = m_media[strMediumID]; 436 436 /* Get the list of the machines this UIMedium attached to. 437 437 * Take into account current-state only if necessary. */ … … 528 528 { 529 529 /* Make sure this ID still in our map: */ 530 if (m_medi ums.contains(strMediumID))530 if (m_media.contains(strMediumID)) 531 531 { 532 532 /* Get corresponding UIMedium: */ 533 UIMedium &uimedium = m_medi ums[strMediumID];533 UIMedium &uimedium = m_media[strMediumID]; 534 534 535 535 /* If corresponding CMedium still exists: */ … … 546 546 { 547 547 /* Uncache corresponding UIMedium: */ 548 m_medi ums.remove(strMediumID);548 m_media.remove(strMediumID); 549 549 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} uncached\n", strMediumID.toUtf8().constData())); 550 550 … … 567 567 { 568 568 /* If that ID is not in our map: */ 569 if (!m_medi ums.contains(strCMediumID))569 if (!m_media.contains(strCMediumID)) 570 570 { 571 571 /* Create new UIMedium: */ … … 575 575 576 576 /* Cache created UIMedium: */ 577 m_medi ums.insert(strUIMediumKey, uimedium);577 m_media.insert(strUIMediumKey, uimedium); 578 578 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} cached\n", strUIMediumKey.toUtf8().constData())); 579 579 … … 583 583 584 584 /* Enumerate corresponding UIMedium: */ 585 createMediumEnumerationTask(m_medi ums[strCMediumID]);585 createMediumEnumerationTask(m_media[strCMediumID]); 586 586 } 587 587 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h
r73917 r73926 65 65 /* API: Medium-enumeration stuff: */ 66 66 bool isMediumEnumerationInProgress() const { return m_fMediumEnumerationInProgress; } 67 void enumerateMedi ums();68 void refreshMedi ums();67 void enumerateMedia(); 68 void refreshMedia(); 69 69 70 70 private slots: … … 87 87 /* Helpers: Medium-enumeration stuff: */ 88 88 void createMediumEnumerationTask(const UIMedium &medium); 89 void addNullMediumToMap(UIMediumMap &medi ums);90 void addMedi umsToMap(const CMediumVector &inputMediums, UIMediumMap &outputMediums, UIMediumType mediumType);91 void addHardDisksToMap(const CMediumVector &inputMedi ums, UIMediumMap &outputMediums);89 void addNullMediumToMap(UIMediumMap &media); 90 void addMediaToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia, UIMediumType mediumType); 91 void addHardDisksToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia); 92 92 93 93 /* Helpers: Medium re-caching stuff: */ … … 102 102 bool m_fMediumEnumerationInProgress; 103 103 QSet<UITask*> m_tasks; 104 UIMediumMap m_medi ums;104 UIMediumMap m_media; 105 105 }; 106 106 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r73783 r73926 388 388 UIMedium medium = vboxGlobal().medium(strMediumID); 389 389 390 /* Ignore non-interesting medi ums: */390 /* Ignore non-interesting media: */ 391 391 if (medium.isNull() || medium.isHostDrive()) 392 392 return; 393 393 394 /* Ignore medi ums(and their children) which are394 /* Ignore media (and their children) which are 395 395 * marked as hidden or attached to hidden machines only: */ 396 396 if (UIMedium::isMediumAttachedToHiddenMachinesOnly(medium)) … … 464 464 UIMedium medium = vboxGlobal().medium(strMediumID); 465 465 466 /* Ignore non-interesting medi ums: */466 /* Ignore non-interesting media: */ 467 467 if (medium.isNull() || medium.isHostDrive()) 468 468 return; 469 469 470 /* Ignore medi ums(and their children) which are470 /* Ignore media (and their children) which are 471 471 * marked as hidden or attached to hidden machines only: */ 472 472 if (UIMedium::isMediumAttachedToHiddenMachinesOnly(medium)) -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp
r73034 r73926 624 624 /* Cache the currently selected items: */ 625 625 QList<QTreeWidgetItem*> selectedItems = m_pTreeWidget->selectedItems(); 626 QStringList selectedMedi ums= selectedMediumIds();626 QStringList selectedMedia = selectedMediumIds(); 627 627 /* uuid list of selected items: */ 628 628 /* Reset the related data structure: */ … … 667 667 } 668 668 } 669 restoreSelection(selectedMedi ums, menuItemVector);669 restoreSelection(selectedMedia, menuItemVector); 670 670 saveDefaultForeground(); 671 671 updateOkButton(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r73871 r73926 2914 2914 void UIMachineLogic::askUserForTheDiskEncryptionPasswords() 2915 2915 { 2916 /* Prepare the map of the encrypted medi ums: */2917 EncryptedMediumMap encryptedMedi ums;2916 /* Prepare the map of the encrypted media: */ 2917 EncryptedMediumMap encryptedMedia; 2918 2918 foreach (const CMediumAttachment &attachment, machine().GetMediumAttachments()) 2919 2919 { … … 2927 2927 const QString strPasswordId = medium.GetEncryptionSettings(strCipher); 2928 2928 if (medium.isOk()) 2929 encryptedMedi ums.insert(strPasswordId, medium.GetId());2929 encryptedMedia.insert(strPasswordId, medium.GetId()); 2930 2930 } 2931 2931 } … … 2933 2933 /* Ask for the disk encryption passwords if necessary: */ 2934 2934 EncryptionPasswordMap encryptionPasswords; 2935 if (!encryptedMedi ums.isEmpty())2935 if (!encryptedMedia.isEmpty()) 2936 2936 { 2937 2937 /* Create the dialog for acquiring encryption passwords: */ … … 2940 2940 new UIAddDiskEncryptionPasswordDialog(pDlgParent, 2941 2941 machineName(), 2942 encryptedMedi ums);2942 encryptedMedia); 2943 2943 /* Execute the dialog: */ 2944 2944 if (pDlg->exec() == QDialog::Accepted) -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r73799 r73926 326 326 void UISelectorWindow::sltHandleMediumEnumerationFinish() 327 327 { 328 /* We try to warn about inaccessible medi umsonly once328 /* We try to warn about inaccessible media only once 329 329 * (after media emumeration started from main() at startup), 330 330 * to avoid annoying the user: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
r71644 r73926 1572 1572 { 1573 1573 /* Unregister machine first: */ 1574 CMediumVector medi ums= machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);1574 CMediumVector media = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly); 1575 1575 if (!machine.isOk()) 1576 1576 { … … 1579 1579 } 1580 1580 /* Prepare cleanup progress: */ 1581 CProgress progress = machine.DeleteConfig(medi ums);1581 CProgress progress = machine.DeleteConfig(media); 1582 1582 if (!machine.isOk()) 1583 1583 { … … 1596 1596 { 1597 1597 /* Unregister machine first: */ 1598 CMediumVector medi ums= machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);1598 CMediumVector media = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly); 1599 1599 if (!machine.isOk()) 1600 1600 { … … 1603 1603 } 1604 1604 /* Finally close all media, deliberately ignoring errors: */ 1605 foreach (CMedium medium, medi ums)1605 foreach (CMedium medium, media) 1606 1606 { 1607 1607 if (!medium.isNull()) … … 2240 2240 COMBase::CleanupCOM(); 2241 2241 } 2242 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r73130 r73926 112 112 QString m_strEncryptionPassword; 113 113 /** Holds the encrypted medium ids. */ 114 EncryptedMediumMap m_encryptedMedi ums;114 EncryptedMediumMap m_encryptedMedia; 115 115 /** Holds the encryption passwords. */ 116 116 EncryptionPasswordMap m_encryptionPasswords; … … 201 201 QString strCipher; 202 202 bool fEncryptionCipherCommon = true; 203 /* Prepare the map of the encrypted medi ums: */204 EncryptedMediumMap encryptedMedi ums;203 /* Prepare the map of the encrypted media: */ 204 EncryptedMediumMap encryptedMedia; 205 205 foreach (const CMediumAttachment &attachment, m_machine.GetMediumAttachments()) 206 206 { … … 215 215 if (comMedium.isOk()) 216 216 { 217 encryptedMedi ums.insert(strCurrentPasswordId, comMedium.GetId());217 encryptedMedia.insert(strCurrentPasswordId, comMedium.GetId()); 218 218 if (strCurrentCipher != strCipher) 219 219 { … … 226 226 } 227 227 } 228 oldGeneralData.m_fEncryptionEnabled = !encryptedMedi ums.isEmpty();228 oldGeneralData.m_fEncryptionEnabled = !encryptedMedia.isEmpty(); 229 229 oldGeneralData.m_fEncryptionCipherChanged = false; 230 230 oldGeneralData.m_fEncryptionPasswordChanged = false; … … 233 233 if (oldGeneralData.m_iEncryptionCipherIndex == -1) 234 234 oldGeneralData.m_iEncryptionCipherIndex = 0; 235 oldGeneralData.m_encryptedMedi ums = encryptedMediums;235 oldGeneralData.m_encryptedMedia = encryptedMedia; 236 236 237 237 /* Cache old general data: */ … … 312 312 newGeneralData.m_iEncryptionCipherIndex = m_pComboCipher->currentIndex(); 313 313 newGeneralData.m_strEncryptionPassword = m_pEditorEncryptionPassword->text(); 314 newGeneralData.m_encryptedMedi ums = m_pCache->base().m_encryptedMediums;314 newGeneralData.m_encryptedMedia = m_pCache->base().m_encryptedMedia; 315 315 /* If encryption status, cipher or password is changed: */ 316 316 if (newGeneralData.m_fEncryptionEnabled != m_pCache->base().m_fEncryptionEnabled || … … 319 319 { 320 320 /* Ask for the disk encryption passwords if necessary: */ 321 if (!m_pCache->base().m_encryptedMedi ums.isEmpty())321 if (!m_pCache->base().m_encryptedMedia.isEmpty()) 322 322 { 323 323 /* Create corresponding dialog: */ … … 326 326 new UIAddDiskEncryptionPasswordDialog(pDlgParent, 327 327 newGeneralData.m_strName, 328 newGeneralData.m_encryptedMedi ums);328 newGeneralData.m_encryptedMedia); 329 329 /* Execute it and acquire the result: */ 330 330 if (pDlg->exec() == QDialog::Accepted) … … 901 901 } 902 902 903 /* Get the maps of encrypted medi umsand their passwords: */904 const EncryptedMediumMap &encryptedMedium = newGeneralData.m_encryptedMedi ums;903 /* Get the maps of encrypted media and their passwords: */ 904 const EncryptedMediumMap &encryptedMedium = newGeneralData.m_encryptedMedia; 905 905 const EncryptionPasswordMap &encryptionPasswords = newGeneralData.m_encryptionPasswords; 906 906 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r72815 r73926 3044 3044 /* Add "Choose a virtual hard disk file" action: */ 3045 3045 addChooseExistingMediumAction(pOpenMediumMenu, tr("Choose Virtual Hard Disk File...")); 3046 /* Add recent medi umslist: */3046 /* Add recent media list: */ 3047 3047 addRecentMediumActions(pOpenMediumMenu, m_pMediumIdHolder->type()); 3048 3048 break; … … 3054 3054 /* Add "Choose a physical drive" actions: */ 3055 3055 addChooseHostDriveActions(pOpenMediumMenu); 3056 /* Add recent medi umslist: */3056 /* Add recent media list: */ 3057 3057 addRecentMediumActions(pOpenMediumMenu, m_pMediumIdHolder->type()); 3058 3058 /* Add "Eject current medium" action: */ … … 3070 3070 /* Add "Choose a physical drive" actions: */ 3071 3071 addChooseHostDriveActions(pOpenMediumMenu); 3072 /* Add recent medi umslist: */3072 /* Add recent media list: */ 3073 3073 addRecentMediumActions(pOpenMediumMenu, m_pMediumIdHolder->type()); 3074 3074 /* Add "Eject current medium" action: */ … … 3443 3443 UIIconPoolStorageSettings::create(); 3444 3444 3445 /* Enumerate Medi ums. We need at least the MediaList filled, so this is the3445 /* Enumerate Media. We need at least the MediaList filled, so this is the 3446 3446 * lasted point, where we can start. The rest of the media checking is done 3447 3447 * in a background thread. */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h
r72815 r73926 704 704 /** Mounts existing host-drive. */ 705 705 void sltChooseHostDrive(); 706 /** Mounts one of recent medi ums. */706 /** Mounts one of recent media. */ 707 707 void sltChooseRecentMedium(); 708 708 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAddDiskEncryptionPasswordDialog.cpp
r72038 r73926 109 109 110 110 /** Constructs model passing @a pParent to the base-class. 111 * @param encryptedMedi umsBrings the lists of medium ids (values) encrypted with passwords with ids (keys). */112 UIEncryptionDataModel(QObject *pParent, const EncryptedMediumMap &encryptedMedi ums);111 * @param encryptedMedia Brings the lists of medium ids (values) encrypted with passwords with ids (keys). */ 112 UIEncryptionDataModel(QObject *pParent, const EncryptedMediumMap &encryptedMedia); 113 113 114 114 /** Returns the shallow copy of the encryption password map instance. */ … … 137 137 138 138 /** Holds the encrypted medium map reference. */ 139 const EncryptedMediumMap &m_encryptedMedi ums;139 const EncryptedMediumMap &m_encryptedMedia; 140 140 141 141 /** Holds the encryption password map instance. */ … … 159 159 160 160 /** Constructs table. 161 * @param encryptedMedi umsBrings the lists of medium ids (values) encrypted with passwords with ids (keys). */162 UIEncryptionDataTable(const EncryptedMediumMap &encryptedMedi ums);161 * @param encryptedMedia Brings the lists of medium ids (values) encrypted with passwords with ids (keys). */ 162 UIEncryptionDataTable(const EncryptedMediumMap &encryptedMedia); 163 163 164 164 /** Returns the shallow copy of the encryption password map … … 175 175 176 176 /** Holds the encrypted medium map reference. */ 177 const EncryptedMediumMap &m_encryptedMedi ums;177 const EncryptedMediumMap &m_encryptedMedia; 178 178 179 179 /** Holds the encryption-data model instance. */ … … 225 225 *********************************************************************************************************************************/ 226 226 227 UIEncryptionDataModel::UIEncryptionDataModel(QObject *pParent, const EncryptedMediumMap &encryptedMedi ums)227 UIEncryptionDataModel::UIEncryptionDataModel(QObject *pParent, const EncryptedMediumMap &encryptedMedia) 228 228 : QAbstractTableModel(pParent) 229 , m_encryptedMedi ums(encryptedMediums)229 , m_encryptedMedia(encryptedMedia) 230 230 { 231 231 /* Prepare: */ … … 315 315 /* We are generating tool-tip here and not in retranslateUi() because of the tricky plural form handling, 316 316 * but be quiet, it's safe enough because the tool-tip being re-acquired every time on mouse-hovering. */ 317 const QStringList encryptedMedi ums = m_encryptedMediums.values(m_encryptionPasswords.keys().at(index.row()));317 const QStringList encryptedMedia = m_encryptedMedia.values(m_encryptionPasswords.keys().at(index.row())); 318 318 return UIAddDiskEncryptionPasswordDialog::tr("<nobr>Used by the following %n hard disk(s):</nobr><br>%1", 319 319 "This text is never used with n == 0. " … … 322 322 "(but the user can see how many hard drives are in the tool-tip " 323 323 "and doesn't need to be told).", 324 encryptedMedi ums.size())325 .arg(encryptedMedi ums.join("<br>"));324 encryptedMedia.size()) 325 .arg(encryptedMedia.join("<br>")); 326 326 } 327 327 default: … … 359 359 { 360 360 /* Populate the map of passwords and statuses: */ 361 foreach (const QString &strPasswordId, m_encryptedMedi ums.keys())361 foreach (const QString &strPasswordId, m_encryptedMedia.keys()) 362 362 m_encryptionPasswords.insert(strPasswordId, QString()); 363 363 } … … 368 368 *********************************************************************************************************************************/ 369 369 370 UIEncryptionDataTable::UIEncryptionDataTable(const EncryptedMediumMap &encryptedMedi ums)371 : m_encryptedMedi ums(encryptedMediums)370 UIEncryptionDataTable::UIEncryptionDataTable(const EncryptedMediumMap &encryptedMedia) 371 : m_encryptedMedia(encryptedMedia) 372 372 , m_pModelEncryptionData(0) 373 373 { … … 398 398 { 399 399 /* Create encryption-data model: */ 400 m_pModelEncryptionData = new UIEncryptionDataModel(this, m_encryptedMedi ums);400 m_pModelEncryptionData = new UIEncryptionDataModel(this, m_encryptedMedia); 401 401 if (m_pModelEncryptionData) 402 402 { … … 458 458 UIAddDiskEncryptionPasswordDialog::UIAddDiskEncryptionPasswordDialog(QWidget *pParent, 459 459 const QString &strMachineName, 460 const EncryptedMediumMap &encryptedMedi ums)460 const EncryptedMediumMap &encryptedMedia) 461 461 : QIWithRetranslateUI<QDialog>(pParent) 462 462 , m_strMachineName(strMachineName) 463 , m_encryptedMedi ums(encryptedMediums)463 , m_encryptedMedia(encryptedMedia) 464 464 , m_pLabelDescription(0) 465 465 , m_pTableEncryptionData(0) … … 492 492 "(but the user can see how many passwords are in the list " 493 493 "and doesn't need to be told).", 494 m_encryptedMedi ums.uniqueKeys().size()));494 m_encryptedMedia.uniqueKeys().size())); 495 495 } 496 496 … … 498 498 { 499 499 /* Validate passwords status: */ 500 foreach (const QString &strPasswordId, m_encryptedMedi ums.uniqueKeys())501 { 502 const QString strMediumId = m_encryptedMedi ums.values(strPasswordId).first();500 foreach (const QString &strPasswordId, m_encryptedMedia.uniqueKeys()) 501 { 502 const QString strMediumId = m_encryptedMedia.values(strPasswordId).first(); 503 503 const QString strPassword = m_pTableEncryptionData->encryptionPasswords().value(strPasswordId); 504 504 if (!isPasswordValid(strMediumId, strPassword)) … … 537 537 538 538 /* Create encryption-data table: */ 539 m_pTableEncryptionData = new UIEncryptionDataTable(m_encryptedMedi ums);539 m_pTableEncryptionData = new UIEncryptionDataTable(m_encryptedMedia); 540 540 if (m_pTableEncryptionData) 541 541 { -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAddDiskEncryptionPasswordDialog.h
r72038 r73926 48 48 /** Constructs dialog passing @a pParent to the base-class. 49 49 * @param strMachineName Brings the name of the machine we show this dialog for. 50 * @param encryptedMedi umsBrings the lists of medium ids (values) encrypted with passwords with ids (keys). */51 UIAddDiskEncryptionPasswordDialog(QWidget *pParent, const QString &strMachineName, const EncryptedMediumMap &encryptedMedi ums);50 * @param encryptedMedia Brings the lists of medium ids (values) encrypted with passwords with ids (keys). */ 51 UIAddDiskEncryptionPasswordDialog(QWidget *pParent, const QString &strMachineName, const EncryptedMediumMap &encryptedMedia); 52 52 53 53 /** Returns the shallow copy of the encryption password map … … 82 82 83 83 /** Holds the encrypted medium map reference. */ 84 const EncryptedMediumMap &m_encryptedMedi ums;84 const EncryptedMediumMap &m_encryptedMedia; 85 85 86 86 /** Holds the description label instance. */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMediaComboBox.cpp
r71948 r73926 112 112 UIMedium guiMedium = vboxGlobal().medium(strMediumId); 113 113 114 /* Ignore medi ums(and their children) which are114 /* Ignore media (and their children) which are 115 115 * marked as hidden or attached to hidden machines only: */ 116 116 if (UIMedium::isMediumAttachedToHiddenMachinesOnly(guiMedium)) 117 117 return; 118 118 119 /* Add only 1. NULL medium and 2. medi umsof required type: */119 /* Add only 1. NULL medium and 2. media of required type: */ 120 120 if (!guiMedium.isNull() && guiMedium.type() != m_enmMediaType) 121 121 return; … … 141 141 UIMedium guiMedium = vboxGlobal().medium(strMediumId); 142 142 143 /* Add only 1. NULL medium and 2. medi umsof required type: */143 /* Add only 1. NULL medium and 2. media of required type: */ 144 144 if (!guiMedium.isNull() && guiMedium.type() != m_enmMediaType) 145 145 return; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp
r73728 r73926 237 237 { 238 238 /* Get the map of the password IDs: */ 239 EncryptedMediumMap encryptedMedi ums;239 EncryptedMediumMap encryptedMedia; 240 240 foreach (const QString &strPasswordId, comAppliance.GetPasswordIds()) 241 241 foreach (const QString &strMediumId, comAppliance.GetMediumIdsForPasswordId(strPasswordId)) 242 encryptedMedi ums.insert(strPasswordId, strMediumId);242 encryptedMedia.insert(strPasswordId, strMediumId); 243 243 244 244 /* Ask for the disk encryption passwords if necessary: */ 245 if (!encryptedMedi ums.isEmpty())245 if (!encryptedMedia.isEmpty()) 246 246 { 247 247 /* Modal dialog can be destroyed in own event-loop as a part of application … … 251 251 new UIAddDiskEncryptionPasswordDialog(this, 252 252 window()->windowTitle(), 253 encryptedMedi ums);253 encryptedMedia); 254 254 255 255 /* Execute the dialog: */
Note:
See TracChangeset
for help on using the changeset viewer.