VirtualBox

Changeset 73926 in vbox for trunk


Ignore:
Timestamp:
Aug 28, 2018 10:02:14 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8472. Refactoring the term 'mediums' to media

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/UITakeSnapshotDialog.cpp

    r72813 r73926  
    4747    : QIWithRetranslateUI<QIDialog>(pParent)
    4848    , m_comMachine(comMachine)
    49     , m_cImmutableMediums(0)
     49    , m_cImmutableMedia(0)
    5050    , m_pLabelIcon(0)
    5151    , m_pLabelName(0), m_pEditorName(0)
     
    106106    m_pLabelInfo->setText(tr("Warning: You are taking a snapshot of a running machine which has %n immutable image(s) "
    107107                             "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_cImmutableMediums));
     108                             "will not be reset to avoid loss of data.", "", m_cImmutableMedia));
    109109}
    110110
     
    263263                        && !comMedium.GetParent().isNull()
    264264                        && comMedium.GetBase().GetType() == KMediumType_Immutable)
    265                         ++m_cImmutableMediums;
     265                        ++m_cImmutableMedia;
    266266                }
    267267            }
    268268            /* Hide if machine have no immutable attachments: */
    269             if (!m_cImmutableMediums)
     269            if (!m_cImmutableMedia)
    270270                m_pLabelInfo->setHidden(true);
    271271
  • trunk/src/VBox/Frontends/VirtualBox/src/UITakeSnapshotDialog.h

    r72813 r73926  
    8787
    8888    /** Holds the amount of immutable attachments. */
    89     int  m_cImmutableMediums;
     89    int  m_cImmutableMedia;
    9090
    9191    /** Holds the icon label instance. */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.cpp

    r73860 r73926  
    20802080    virtual QString shortcutExtraDataID() const /* override */
    20812081    {
    2082         return QString("RefreshMediums");
     2082        return QString("RefreshMedia");
    20832083    }
    20842084
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r73917 r73926  
    24402440        /* Redirect request to medium-enumerator: */
    24412441        if (m_pMediumEnumerator)
    2442             m_pMediumEnumerator->enumerateMediums();
     2442            m_pMediumEnumerator->enumerateMedia();
    24432443        m_meCleanupProtectionToken.unlock();
    24442444    }
    24452445}
    24462446
    2447 void VBoxGlobal::refreshMediums()
     2447void VBoxGlobal::refreshMedia()
    24482448{
    24492449    /* Make sure VBoxGlobal is already valid: */
     
    24692469    /* We assume it's safe to call it without locking,
    24702470     * since we are performing blocking operation here. */
    2471     m_pMediumEnumerator->refreshMediums();
     2471    m_pMediumEnumerator->refreshMedia();
    24722472}
    24732473
     
    24982498    {
    24992499        /* Redirect call to medium-enumerator: */
    2500         QList<QString> listOfMediums;
     2500        QList<QString> listOfMedia;
    25012501        if (m_pMediumEnumerator)
    2502             listOfMediums = m_pMediumEnumerator->mediumIDs();
     2502            listOfMedia = m_pMediumEnumerator->mediumIDs();
    25032503        m_meCleanupProtectionToken.unlock();
    2504         return listOfMediums;
     2504        return listOfMedia;
    25052505    }
    25062506    return QList<QString>();
     
    27822782
    27832783    /* Get existing-host-drive vector: */
    2784     CMediumVector comMediums;
     2784    CMediumVector comMedia;
    27852785    switch (enmMediumType)
    27862786    {
    2787         case UIMediumType_DVD:    comMediums = host().GetDVDDrives(); break;
    2788         case UIMediumType_Floppy: comMediums = host().GetFloppyDrives(); break;
     2787        case UIMediumType_DVD:    comMedia = host().GetDVDDrives(); break;
     2788        case UIMediumType_Floppy: comMedia = host().GetFloppyDrives(); break;
    27892789        default: break;
    27902790    }
    27912791    /* Prepare choose-existing-host-drive actions: */
    2792     foreach (const CMedium &comMedium, comMediums)
     2792    foreach (const CMedium &comMedium, comMedia)
    27932793    {
    27942794        /* Make sure host-drive usage is unique: */
     
    30833083    if (!comMedium.isNull() && guiMedium.isNull())
    30843084    {
    3085         /* UI medium may be new and not among our mediums, request enumeration: */
     3085        /* UI medium may be new and not among our media, request enumeration: */
    30863086        startMediumEnumeration();
    30873087
     
    37113711    /* Re-enumerate uimedium since they contain some translations too: */
    37123712    if (m_fValid)
    3713         refreshMediums();
     3713        refreshMedia();
    37143714
    37153715#ifdef VBOX_WS_X11
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r73917 r73926  
    479479        void startMediumEnumeration();
    480480        /** Calls refresh for each medium which has been already enumerated. */
    481         void refreshMediums();
     481        void refreshMedia();
    482482        /** Returns whether medium enumeration is in progress. */
    483483        bool isMediumEnumerationInProgress() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r73882 r73926  
    276276void UIVirtualBoxManager::sltHandleMediumEnumerationFinish()
    277277{
    278     /* To avoid annoying the user, we check for inaccessible mediums just once, after
     278    /* To avoid annoying the user, we check for inaccessible media just once, after
    279279     * the first media emumeration [started from main() at startup] is complete. */
    280280    if (m_fFirstMediumEnumerationHandled)
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r73631 r73926  
    15931593        {
    15941594            /* Unregister machine first: */
    1595             CMediumVector mediums = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);
     1595            CMediumVector media = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);
    15961596            if (!machine.isOk())
    15971597            {
     
    16001600            }
    16011601            /* Prepare cleanup progress: */
    1602             CProgress progress = machine.DeleteConfig(mediums);
     1602            CProgress progress = machine.DeleteConfig(media);
    16031603            if (!machine.isOk())
    16041604            {
     
    16171617        {
    16181618            /* Unregister machine first: */
    1619             CMediumVector mediums = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);
     1619            CMediumVector media = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);
    16201620            if (!machine.isOk())
    16211621            {
     
    16241624            }
    16251625            /* Finally close all media, deliberately ignoring errors: */
    1626             foreach (CMedium medium, mediums)
     1626            foreach (CMedium medium, media)
    16271627            {
    16281628                if (!medium.isNull())
     
    22672267    COMBase::CleanupCOM();
    22682268}
    2269 
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp

    r72433 r73926  
    228228        if (!m_fHostDrive)
    229229        {
    230             /* Only for created and accessible mediums: */
     230            /* Only for created and accessible media: */
    231231            if (m_state != KMediumState_Inaccessible && m_state != KMediumState_NotCreated)
    232232            {
     
    275275                m_strParentId = normalizedID(parentMedium.GetId());
    276276
    277             /* Only for created and accessible mediums: */
     277            /* Only for created and accessible media: */
    278278            if (m_state != KMediumState_Inaccessible && m_state != KMediumState_NotCreated)
    279279            {
     
    662662    return gpConverter->toString(comMedium.GetType());
    663663}
    664 
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h

    r71630 r73926  
    7272  * will cause the corresponding property of this object's root medium to be returned instead
    7373  * 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 mediums, the value of this argument is irrelevant
     74  * "don't show diffs" mode. For non-hard drive media, the value of this argument is irrelevant
    7575  * because the root object for such medium is the medium itself.
    7676  *
     
    7979  * and therefore some parameters such as #size() are meaningless because they can be read only
    8080  * from the accessible medium. The real KMediumState_NotCreated state is not necessary because
    81   * this class is only used with created (existing) mediums. */
     81  * this class is only used with created (existing) media. */
    8282class SHARED_LIBRARY_STUFF UIMedium
    8383{
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp

    r73917 r73926  
    8989{
    9090    /* Return keys of current medium-map: */
    91     return m_mediums.keys();
     91    return m_media.keys();
    9292}
    9393
     
    9595{
    9696    /* Search through current medium-map for the medium with passed ID: */
    97     if (m_mediums.contains(strMediumID))
    98         return m_mediums[strMediumID];
     97    if (m_media.contains(strMediumID))
     98        return m_media[strMediumID];
    9999    /* Return NULL medium otherwise: */
    100100    return UIMedium();
     
    110110    AssertReturnVoid(strMediumID != UIMedium::nullID());
    111111    /* Make sure medium doesn't exists already: */
    112     AssertReturnVoid(!m_mediums.contains(strMediumID));
     112    AssertReturnVoid(!m_media.contains(strMediumID));
    113113
    114114    /* Insert medium: */
    115     m_mediums[strMediumID] = medium;
     115    m_media[strMediumID] = medium;
    116116    LogRel(("GUI: UIMediumEnumerator: Medium with key={%s} created\n", strMediumID.toUtf8().constData()));
    117117
     
    126126    AssertReturnVoid(strMediumID != UIMedium::nullID());
    127127    /* Make sure medium still exists: */
    128     AssertReturnVoid(m_mediums.contains(strMediumID));
     128    AssertReturnVoid(m_media.contains(strMediumID));
    129129
    130130    /* Remove medium: */
    131     m_mediums.remove(strMediumID);
     131    m_media.remove(strMediumID);
    132132    LogRel(("GUI: UIMediumEnumerator: Medium with key={%s} deleted\n", strMediumID.toUtf8().constData()));
    133133
     
    136136}
    137137
    138 void UIMediumEnumerator::enumerateMediums()
     138void UIMediumEnumerator::enumerateMedia()
    139139{
    140140    /* Make sure we are not already in progress: */
    141141    AssertReturnVoid(!m_fMediumEnumerationInProgress);
    142142
    143     /* Compose new map of all currently known mediums & their children.
    144      * While composing we are using data from already existing mediums. */
    145     UIMediumMap mediums;
    146     addNullMediumToMap(mediums);
    147     addHardDisksToMap(vboxGlobal().virtualBox().GetHardDisks(), mediums);
    148     addMediumsToMap(vboxGlobal().host().GetDVDDrives(), mediums, UIMediumType_DVD);
    149     addMediumsToMap(vboxGlobal().virtualBox().GetDVDImages(), mediums, UIMediumType_DVD);
    150     addMediumsToMap(vboxGlobal().host().GetFloppyDrives(), mediums, UIMediumType_Floppy);
    151     addMediumsToMap(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);
    152152    if (VBoxGlobal::isCleaningUp())
    153153        return; /* VBoxGlobal is cleaning up, abort immediately. */
    154     m_mediums = mediums;
     154    m_media = media;
    155155
    156156    /* Notify listener: */
     
    160160
    161161    /* Make sure we really have more than one medium (which is Null): */
    162     if (m_mediums.size() == 1)
     162    if (m_media.size() == 1)
    163163    {
    164164        /* Notify listener: */
     
    169169
    170170    /* Start enumeration for UIMedium(s) with correct ID: */
    171     foreach (const QString &strMediumID, m_mediums.keys())
     171    foreach (const QString &strMediumID, m_media.keys())
    172172        if (!strMediumID.isNull() && strMediumID != UIMedium::nullID())
    173             createMediumEnumerationTask(m_mediums[strMediumID]);
    174 }
    175 
    176 void UIMediumEnumerator::refreshMediums()
     173            createMediumEnumerationTask(m_media[strMediumID]);
     174}
     175
     176void UIMediumEnumerator::refreshMedia()
    177177{
    178178    /* Make sure we are not already in progress: */
     
    180180
    181181    /* Refresh all known media we have: */
    182     foreach (const QString &strMediumID, m_mediums.keys())
    183         m_mediums[strMediumID].refresh();
     182    foreach (const QString &strMediumID, m_media.keys())
     183        m_media[strMediumID].refresh();
    184184}
    185185
     
    202202             currentCMediumIDs.isEmpty() ? "<empty>" : currentCMediumIDs.join(", ").toUtf8().constData()));
    203203
    204     /* Determine excluded mediums: */
     204    /* Determine excluded media: */
    205205    const QSet<QString> previousSet = previousUIMediumIDs.toSet();
    206206    const QSet<QString> currentSet = currentCMediumIDs.toSet();
     
    299299
    300300    /* Make sure such UIMedium still exists: */
    301     if (!m_mediums.contains(strUIMediumKey))
     301    if (!m_media.contains(strUIMediumKey))
    302302    {
    303303        LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} already deleted by a third party\n", strUIMediumKey.toUtf8().constData()));
     
    311311    {
    312312        /* Delete this medium: */
    313         m_mediums.remove(strUIMediumKey);
     313        m_media.remove(strUIMediumKey);
    314314        LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} closed and deleted (after enumeration)\n", strUIMediumKey.toUtf8().constData()));
    315315
     
    321321    {
    322322        /* We have to reinject enumerated medium: */
    323         m_mediums.remove(strUIMediumKey);
    324         m_mediums[strUIMediumID] = uimedium;
    325         m_mediums[strUIMediumID].setKey(strUIMediumID);
     323        m_media.remove(strUIMediumKey);
     324        m_media[strUIMediumID] = uimedium;
     325        m_media[strUIMediumID].setKey(strUIMediumID);
    326326        LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} has it changed to {%s}\n", strUIMediumKey.toUtf8().constData(),
    327327                                                                                           strUIMediumID.toUtf8().constData()));
     
    335335    {
    336336        /* Just update enumerated medium: */
    337         m_mediums[strUIMediumID] = uimedium;
     337        m_media[strUIMediumID] = uimedium;
    338338        LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} updated\n", strUIMediumID.toUtf8().constData()));
    339339
     
    355355{
    356356    /* Translating NULL uimedium by recreating it: */
    357     if (m_mediums.contains(UIMedium::nullID()))
    358         m_mediums[UIMedium::nullID()] = UIMedium();
     357    if (m_media.contains(UIMedium::nullID()))
     358        m_media[UIMedium::nullID()] = UIMedium();
    359359}
    360360
     
    369369}
    370370
    371 void UIMediumEnumerator::addNullMediumToMap(UIMediumMap &mediums)
     371void UIMediumEnumerator::addNullMediumToMap(UIMediumMap &media)
    372372{
    373373    /* Insert NULL uimedium to the passed uimedium map.
    374374     * Get existing one from the previous map if any. */
    375375    QString strNullMediumID = UIMedium::nullID();
    376     UIMedium uimedium = m_mediums.contains(strNullMediumID) ? m_mediums[strNullMediumID] : UIMedium();
    377     mediums.insert(strNullMediumID, uimedium);
    378 }
    379 
    380 void UIMediumEnumerator::addMediumsToMap(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
     380void UIMediumEnumerator::addMediaToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia, UIMediumType mediumType)
    381381{
    382382    /* Insert hard-disks to the passed uimedium map.
    383383     * Get existing one from the previous map if any. */
    384     foreach (CMedium medium, inputMediums)
     384    foreach (CMedium medium, inputMedia)
    385385    {
    386386        /* If VBoxGlobal is cleaning up, abort immediately: */
     
    390390        /* Prepare uimedium on the basis of current medium: */
    391391        QString strMediumID = medium.GetId();
    392         UIMedium uimedium = m_mediums.contains(strMediumID) ? m_mediums[strMediumID] :
     392        UIMedium uimedium = m_media.contains(strMediumID) ? m_media[strMediumID] :
    393393                                                              UIMedium(medium, mediumType);
    394394
    395395        /* Insert uimedium into map: */
    396         outputMediums.insert(uimedium.id(), uimedium);
    397     }
    398 }
    399 
    400 void UIMediumEnumerator::addHardDisksToMap(const CMediumVector &inputMediums, UIMediumMap &outputMediums)
     396        outputMedia.insert(uimedium.id(), uimedium);
     397    }
     398}
     399
     400void UIMediumEnumerator::addHardDisksToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia)
    401401{
    402402    /* Insert hard-disks to the passed uimedium map.
    403403     * Get existing one from the previous map if any. */
    404     foreach (CMedium medium, inputMediums)
     404    foreach (CMedium medium, inputMedia)
    405405    {
    406406        /* If VBoxGlobal is cleaning up, abort immediately: */
     
    410410        /* Prepare uimedium on the basis of current medium: */
    411411        QString strMediumID = medium.GetId();
    412         UIMedium uimedium = m_mediums.contains(strMediumID) ? m_mediums[strMediumID] :
     412        UIMedium uimedium = m_media.contains(strMediumID) ? m_media[strMediumID] :
    413413                                                              UIMedium(medium, UIMediumType_HardDisk);
    414414
    415415        /* Insert uimedium into map: */
    416         outputMediums.insert(uimedium.id(), uimedium);
     416        outputMedia.insert(uimedium.id(), uimedium);
    417417
    418418        /* Insert medium children into map too: */
    419         addHardDisksToMap(medium.GetChildren(), outputMediums);
     419        addHardDisksToMap(medium.GetChildren(), outputMedia);
    420420    }
    421421}
     
    433433    {
    434434        /* Get corresponding UIMedium: */
    435         const UIMedium &uimedium = m_mediums[strMediumID];
     435        const UIMedium &uimedium = m_media[strMediumID];
    436436        /* Get the list of the machines this UIMedium attached to.
    437437         * Take into account current-state only if necessary. */
     
    528528    {
    529529        /* Make sure this ID still in our map: */
    530         if (m_mediums.contains(strMediumID))
     530        if (m_media.contains(strMediumID))
    531531        {
    532532            /* Get corresponding UIMedium: */
    533             UIMedium &uimedium = m_mediums[strMediumID];
     533            UIMedium &uimedium = m_media[strMediumID];
    534534
    535535            /* If corresponding CMedium still exists: */
     
    546546            {
    547547                /* Uncache corresponding UIMedium: */
    548                 m_mediums.remove(strMediumID);
     548                m_media.remove(strMediumID);
    549549                LogRel2(("GUI: UIMediumEnumerator:  Medium with key={%s} uncached\n", strMediumID.toUtf8().constData()));
    550550
     
    567567    {
    568568        /* If that ID is not in our map: */
    569         if (!m_mediums.contains(strCMediumID))
     569        if (!m_media.contains(strCMediumID))
    570570        {
    571571            /* Create new UIMedium: */
     
    575575
    576576            /* Cache created UIMedium: */
    577             m_mediums.insert(strUIMediumKey, uimedium);
     577            m_media.insert(strUIMediumKey, uimedium);
    578578            LogRel2(("GUI: UIMediumEnumerator:  Medium with key={%s} cached\n", strUIMediumKey.toUtf8().constData()));
    579579
     
    583583
    584584        /* Enumerate corresponding UIMedium: */
    585         createMediumEnumerationTask(m_mediums[strCMediumID]);
     585        createMediumEnumerationTask(m_media[strCMediumID]);
    586586    }
    587587}
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h

    r73917 r73926  
    6565    /* API: Medium-enumeration stuff: */
    6666    bool isMediumEnumerationInProgress() const { return m_fMediumEnumerationInProgress; }
    67     void enumerateMediums();
    68     void refreshMediums();
     67    void enumerateMedia();
     68    void refreshMedia();
    6969
    7070private slots:
     
    8787    /* Helpers: Medium-enumeration stuff: */
    8888    void createMediumEnumerationTask(const UIMedium &medium);
    89     void addNullMediumToMap(UIMediumMap &mediums);
    90     void addMediumsToMap(const CMediumVector &inputMediums, UIMediumMap &outputMediums, UIMediumType mediumType);
    91     void addHardDisksToMap(const CMediumVector &inputMediums, 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);
    9292
    9393    /* Helpers: Medium re-caching stuff: */
     
    102102    bool m_fMediumEnumerationInProgress;
    103103    QSet<UITask*> m_tasks;
    104     UIMediumMap m_mediums;
     104    UIMediumMap m_media;
    105105};
    106106
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r73783 r73926  
    388388    UIMedium medium = vboxGlobal().medium(strMediumID);
    389389
    390     /* Ignore non-interesting mediums: */
     390    /* Ignore non-interesting media: */
    391391    if (medium.isNull() || medium.isHostDrive())
    392392        return;
    393393
    394     /* Ignore mediums (and their children) which are
     394    /* Ignore media (and their children) which are
    395395     * marked as hidden or attached to hidden machines only: */
    396396    if (UIMedium::isMediumAttachedToHiddenMachinesOnly(medium))
     
    464464    UIMedium medium = vboxGlobal().medium(strMediumID);
    465465
    466     /* Ignore non-interesting mediums: */
     466    /* Ignore non-interesting media: */
    467467    if (medium.isNull() || medium.isHostDrive())
    468468        return;
    469469
    470     /* Ignore mediums (and their children) which are
     470    /* Ignore media (and their children) which are
    471471     * marked as hidden or attached to hidden machines only: */
    472472    if (UIMedium::isMediumAttachedToHiddenMachinesOnly(medium))
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp

    r73034 r73926  
    624624    /* Cache the currently selected items: */
    625625    QList<QTreeWidgetItem*> selectedItems = m_pTreeWidget->selectedItems();
    626     QStringList selectedMediums = selectedMediumIds();
     626    QStringList selectedMedia = selectedMediumIds();
    627627    /* uuid list of selected items: */
    628628    /* Reset the related data structure: */
     
    667667        }
    668668    }
    669     restoreSelection(selectedMediums, menuItemVector);
     669    restoreSelection(selectedMedia, menuItemVector);
    670670    saveDefaultForeground();
    671671    updateOkButton();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r73871 r73926  
    29142914void UIMachineLogic::askUserForTheDiskEncryptionPasswords()
    29152915{
    2916     /* Prepare the map of the encrypted mediums: */
    2917     EncryptedMediumMap encryptedMediums;
     2916    /* Prepare the map of the encrypted media: */
     2917    EncryptedMediumMap encryptedMedia;
    29182918    foreach (const CMediumAttachment &attachment, machine().GetMediumAttachments())
    29192919    {
     
    29272927            const QString strPasswordId = medium.GetEncryptionSettings(strCipher);
    29282928            if (medium.isOk())
    2929                 encryptedMediums.insert(strPasswordId, medium.GetId());
     2929                encryptedMedia.insert(strPasswordId, medium.GetId());
    29302930        }
    29312931    }
     
    29332933    /* Ask for the disk encryption passwords if necessary: */
    29342934    EncryptionPasswordMap encryptionPasswords;
    2935     if (!encryptedMediums.isEmpty())
     2935    if (!encryptedMedia.isEmpty())
    29362936    {
    29372937        /* Create the dialog for acquiring encryption passwords: */
     
    29402940             new UIAddDiskEncryptionPasswordDialog(pDlgParent,
    29412941                                                   machineName(),
    2942                                                    encryptedMediums);
     2942                                                   encryptedMedia);
    29432943        /* Execute the dialog: */
    29442944        if (pDlg->exec() == QDialog::Accepted)
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r73799 r73926  
    326326void UISelectorWindow::sltHandleMediumEnumerationFinish()
    327327{
    328     /* We try to warn about inaccessible mediums only once
     328    /* We try to warn about inaccessible media only once
    329329     * (after media emumeration started from main() at startup),
    330330     * to avoid annoying the user: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r71644 r73926  
    15721572        {
    15731573            /* Unregister machine first: */
    1574             CMediumVector mediums = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);
     1574            CMediumVector media = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);
    15751575            if (!machine.isOk())
    15761576            {
     
    15791579            }
    15801580            /* Prepare cleanup progress: */
    1581             CProgress progress = machine.DeleteConfig(mediums);
     1581            CProgress progress = machine.DeleteConfig(media);
    15821582            if (!machine.isOk())
    15831583            {
     
    15961596        {
    15971597            /* Unregister machine first: */
    1598             CMediumVector mediums = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);
     1598            CMediumVector media = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);
    15991599            if (!machine.isOk())
    16001600            {
     
    16031603            }
    16041604            /* Finally close all media, deliberately ignoring errors: */
    1605             foreach (CMedium medium, mediums)
     1605            foreach (CMedium medium, media)
    16061606            {
    16071607                if (!medium.isNull())
     
    22402240    COMBase::CleanupCOM();
    22412241}
    2242 
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp

    r73130 r73926  
    112112    QString                m_strEncryptionPassword;
    113113    /** Holds the encrypted medium ids. */
    114     EncryptedMediumMap     m_encryptedMediums;
     114    EncryptedMediumMap     m_encryptedMedia;
    115115    /** Holds the encryption passwords. */
    116116    EncryptionPasswordMap  m_encryptionPasswords;
     
    201201    QString strCipher;
    202202    bool fEncryptionCipherCommon = true;
    203     /* Prepare the map of the encrypted mediums: */
    204     EncryptedMediumMap encryptedMediums;
     203    /* Prepare the map of the encrypted media: */
     204    EncryptedMediumMap encryptedMedia;
    205205    foreach (const CMediumAttachment &attachment, m_machine.GetMediumAttachments())
    206206    {
     
    215215            if (comMedium.isOk())
    216216            {
    217                 encryptedMediums.insert(strCurrentPasswordId, comMedium.GetId());
     217                encryptedMedia.insert(strCurrentPasswordId, comMedium.GetId());
    218218                if (strCurrentCipher != strCipher)
    219219                {
     
    226226        }
    227227    }
    228     oldGeneralData.m_fEncryptionEnabled = !encryptedMediums.isEmpty();
     228    oldGeneralData.m_fEncryptionEnabled = !encryptedMedia.isEmpty();
    229229    oldGeneralData.m_fEncryptionCipherChanged = false;
    230230    oldGeneralData.m_fEncryptionPasswordChanged = false;
     
    233233    if (oldGeneralData.m_iEncryptionCipherIndex == -1)
    234234        oldGeneralData.m_iEncryptionCipherIndex = 0;
    235     oldGeneralData.m_encryptedMediums = encryptedMediums;
     235    oldGeneralData.m_encryptedMedia = encryptedMedia;
    236236
    237237    /* Cache old general data: */
     
    312312    newGeneralData.m_iEncryptionCipherIndex = m_pComboCipher->currentIndex();
    313313    newGeneralData.m_strEncryptionPassword = m_pEditorEncryptionPassword->text();
    314     newGeneralData.m_encryptedMediums = m_pCache->base().m_encryptedMediums;
     314    newGeneralData.m_encryptedMedia = m_pCache->base().m_encryptedMedia;
    315315    /* If encryption status, cipher or password is changed: */
    316316    if (newGeneralData.m_fEncryptionEnabled != m_pCache->base().m_fEncryptionEnabled ||
     
    319319    {
    320320        /* Ask for the disk encryption passwords if necessary: */
    321         if (!m_pCache->base().m_encryptedMediums.isEmpty())
     321        if (!m_pCache->base().m_encryptedMedia.isEmpty())
    322322        {
    323323            /* Create corresponding dialog: */
     
    326326                 new UIAddDiskEncryptionPasswordDialog(pDlgParent,
    327327                                                       newGeneralData.m_strName,
    328                                                        newGeneralData.m_encryptedMediums);
     328                                                       newGeneralData.m_encryptedMedia);
    329329            /* Execute it and acquire the result: */
    330330            if (pDlg->exec() == QDialog::Accepted)
     
    901901                        }
    902902
    903                         /* Get the maps of encrypted mediums and their passwords: */
    904                         const EncryptedMediumMap &encryptedMedium = newGeneralData.m_encryptedMediums;
     903                        /* Get the maps of encrypted media and their passwords: */
     904                        const EncryptedMediumMap &encryptedMedium = newGeneralData.m_encryptedMedia;
    905905                        const EncryptionPasswordMap &encryptionPasswords = newGeneralData.m_encryptionPasswords;
    906906
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r72815 r73926  
    30443044                /* Add "Choose a virtual hard disk file" action: */
    30453045                addChooseExistingMediumAction(pOpenMediumMenu, tr("Choose Virtual Hard Disk File..."));
    3046                 /* Add recent mediums list: */
     3046                /* Add recent media list: */
    30473047                addRecentMediumActions(pOpenMediumMenu, m_pMediumIdHolder->type());
    30483048                break;
     
    30543054                /* Add "Choose a physical drive" actions: */
    30553055                addChooseHostDriveActions(pOpenMediumMenu);
    3056                 /* Add recent mediums list: */
     3056                /* Add recent media list: */
    30573057                addRecentMediumActions(pOpenMediumMenu, m_pMediumIdHolder->type());
    30583058                /* Add "Eject current medium" action: */
     
    30703070                /* Add "Choose a physical drive" actions: */
    30713071                addChooseHostDriveActions(pOpenMediumMenu);
    3072                 /* Add recent mediums list: */
     3072                /* Add recent media list: */
    30733073                addRecentMediumActions(pOpenMediumMenu, m_pMediumIdHolder->type());
    30743074                /* Add "Eject current medium" action: */
     
    34433443    UIIconPoolStorageSettings::create();
    34443444
    3445     /* Enumerate Mediums. We need at least the MediaList filled, so this is the
     3445    /* Enumerate Media. We need at least the MediaList filled, so this is the
    34463446     * lasted point, where we can start. The rest of the media checking is done
    34473447     * in a background thread. */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h

    r72815 r73926  
    704704    /** Mounts existing host-drive. */
    705705    void sltChooseHostDrive();
    706     /** Mounts one of recent mediums. */
     706    /** Mounts one of recent media. */
    707707    void sltChooseRecentMedium();
    708708
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAddDiskEncryptionPasswordDialog.cpp

    r72038 r73926  
    109109
    110110    /** Constructs model passing @a pParent to the base-class.
    111       * @param  encryptedMediums  Brings the lists of medium ids (values) encrypted with passwords with ids (keys). */
    112     UIEncryptionDataModel(QObject *pParent, const EncryptedMediumMap &encryptedMediums);
     111      * @param  encryptedMedia  Brings the lists of medium ids (values) encrypted with passwords with ids (keys). */
     112    UIEncryptionDataModel(QObject *pParent, const EncryptedMediumMap &encryptedMedia);
    113113
    114114    /** Returns the shallow copy of the encryption password map instance. */
     
    137137
    138138    /** Holds the encrypted medium map reference. */
    139     const EncryptedMediumMap &m_encryptedMediums;
     139    const EncryptedMediumMap &m_encryptedMedia;
    140140
    141141    /** Holds the encryption password map instance. */
     
    159159
    160160    /** Constructs table.
    161       * @param  encryptedMediums  Brings the lists of medium ids (values) encrypted with passwords with ids (keys). */
    162     UIEncryptionDataTable(const EncryptedMediumMap &encryptedMediums);
     161      * @param  encryptedMedia  Brings the lists of medium ids (values) encrypted with passwords with ids (keys). */
     162    UIEncryptionDataTable(const EncryptedMediumMap &encryptedMedia);
    163163
    164164    /** Returns the shallow copy of the encryption password map
     
    175175
    176176    /** Holds the encrypted medium map reference. */
    177     const EncryptedMediumMap &m_encryptedMediums;
     177    const EncryptedMediumMap &m_encryptedMedia;
    178178
    179179    /** Holds the encryption-data model instance. */
     
    225225*********************************************************************************************************************************/
    226226
    227 UIEncryptionDataModel::UIEncryptionDataModel(QObject *pParent, const EncryptedMediumMap &encryptedMediums)
     227UIEncryptionDataModel::UIEncryptionDataModel(QObject *pParent, const EncryptedMediumMap &encryptedMedia)
    228228    : QAbstractTableModel(pParent)
    229     , m_encryptedMediums(encryptedMediums)
     229    , m_encryptedMedia(encryptedMedia)
    230230{
    231231    /* Prepare: */
     
    315315            /* We are generating tool-tip here and not in retranslateUi() because of the tricky plural form handling,
    316316             * but be quiet, it's safe enough because the tool-tip being re-acquired every time on mouse-hovering. */
    317             const QStringList encryptedMediums = m_encryptedMediums.values(m_encryptionPasswords.keys().at(index.row()));
     317            const QStringList encryptedMedia = m_encryptedMedia.values(m_encryptionPasswords.keys().at(index.row()));
    318318            return UIAddDiskEncryptionPasswordDialog::tr("<nobr>Used by the following %n hard disk(s):</nobr><br>%1",
    319319                                                         "This text is never used with n == 0. "
     
    322322                                                         "(but the user can see how many hard drives are in the tool-tip "
    323323                                                         "and doesn't need to be told).",
    324                                                          encryptedMediums.size())
    325                                                          .arg(encryptedMediums.join("<br>"));
     324                                                         encryptedMedia.size())
     325                                                         .arg(encryptedMedia.join("<br>"));
    326326        }
    327327        default:
     
    359359{
    360360    /* Populate the map of passwords and statuses: */
    361     foreach (const QString &strPasswordId, m_encryptedMediums.keys())
     361    foreach (const QString &strPasswordId, m_encryptedMedia.keys())
    362362        m_encryptionPasswords.insert(strPasswordId, QString());
    363363}
     
    368368*********************************************************************************************************************************/
    369369
    370 UIEncryptionDataTable::UIEncryptionDataTable(const EncryptedMediumMap &encryptedMediums)
    371     : m_encryptedMediums(encryptedMediums)
     370UIEncryptionDataTable::UIEncryptionDataTable(const EncryptedMediumMap &encryptedMedia)
     371    : m_encryptedMedia(encryptedMedia)
    372372    , m_pModelEncryptionData(0)
    373373{
     
    398398{
    399399    /* Create encryption-data model: */
    400     m_pModelEncryptionData = new UIEncryptionDataModel(this, m_encryptedMediums);
     400    m_pModelEncryptionData = new UIEncryptionDataModel(this, m_encryptedMedia);
    401401    if (m_pModelEncryptionData)
    402402    {
     
    458458UIAddDiskEncryptionPasswordDialog::UIAddDiskEncryptionPasswordDialog(QWidget *pParent,
    459459                                                                     const QString &strMachineName,
    460                                                                      const EncryptedMediumMap &encryptedMediums)
     460                                                                     const EncryptedMediumMap &encryptedMedia)
    461461    : QIWithRetranslateUI<QDialog>(pParent)
    462462    , m_strMachineName(strMachineName)
    463     , m_encryptedMediums(encryptedMediums)
     463    , m_encryptedMedia(encryptedMedia)
    464464    , m_pLabelDescription(0)
    465465    , m_pTableEncryptionData(0)
     
    492492                                    "(but the user can see how many passwords are in the list "
    493493                                    "and doesn't need to be told).",
    494                                     m_encryptedMediums.uniqueKeys().size()));
     494                                    m_encryptedMedia.uniqueKeys().size()));
    495495}
    496496
     
    498498{
    499499    /* Validate passwords status: */
    500     foreach (const QString &strPasswordId, m_encryptedMediums.uniqueKeys())
    501     {
    502         const QString strMediumId = m_encryptedMediums.values(strPasswordId).first();
     500    foreach (const QString &strPasswordId, m_encryptedMedia.uniqueKeys())
     501    {
     502        const QString strMediumId = m_encryptedMedia.values(strPasswordId).first();
    503503        const QString strPassword = m_pTableEncryptionData->encryptionPasswords().value(strPasswordId);
    504504        if (!isPasswordValid(strMediumId, strPassword))
     
    537537
    538538            /* Create encryption-data table: */
    539             m_pTableEncryptionData = new UIEncryptionDataTable(m_encryptedMediums);
     539            m_pTableEncryptionData = new UIEncryptionDataTable(m_encryptedMedia);
    540540            if (m_pTableEncryptionData)
    541541            {
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAddDiskEncryptionPasswordDialog.h

    r72038 r73926  
    4848    /** Constructs dialog passing @a pParent to the base-class.
    4949      * @param  strMachineName    Brings the name of the machine we show this dialog for.
    50       * @param  encryptedMediums  Brings the lists of medium ids (values) encrypted with passwords with ids (keys). */
    51     UIAddDiskEncryptionPasswordDialog(QWidget *pParent, const QString &strMachineName, const EncryptedMediumMap &encryptedMediums);
     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);
    5252
    5353    /** Returns the shallow copy of the encryption password map
     
    8282
    8383    /** Holds the encrypted medium map reference. */
    84     const EncryptedMediumMap &m_encryptedMediums;
     84    const EncryptedMediumMap &m_encryptedMedia;
    8585
    8686    /** Holds the description label instance. */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMediaComboBox.cpp

    r71948 r73926  
    112112    UIMedium guiMedium = vboxGlobal().medium(strMediumId);
    113113
    114     /* Ignore mediums (and their children) which are
     114    /* Ignore media (and their children) which are
    115115     * marked as hidden or attached to hidden machines only: */
    116116    if (UIMedium::isMediumAttachedToHiddenMachinesOnly(guiMedium))
    117117        return;
    118118
    119     /* Add only 1. NULL medium and 2. mediums of required type: */
     119    /* Add only 1. NULL medium and 2. media of required type: */
    120120    if (!guiMedium.isNull() && guiMedium.type() != m_enmMediaType)
    121121        return;
     
    141141    UIMedium guiMedium = vboxGlobal().medium(strMediumId);
    142142
    143     /* Add only 1. NULL medium and 2. mediums of required type: */
     143    /* Add only 1. NULL medium and 2. media of required type: */
    144144    if (!guiMedium.isNull() && guiMedium.type() != m_enmMediaType)
    145145        return;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp

    r73728 r73926  
    237237{
    238238    /* Get the map of the password IDs: */
    239     EncryptedMediumMap encryptedMediums;
     239    EncryptedMediumMap encryptedMedia;
    240240    foreach (const QString &strPasswordId, comAppliance.GetPasswordIds())
    241241        foreach (const QString &strMediumId, comAppliance.GetMediumIdsForPasswordId(strPasswordId))
    242             encryptedMediums.insert(strPasswordId, strMediumId);
     242            encryptedMedia.insert(strPasswordId, strMediumId);
    243243
    244244    /* Ask for the disk encryption passwords if necessary: */
    245     if (!encryptedMediums.isEmpty())
     245    if (!encryptedMedia.isEmpty())
    246246    {
    247247        /* Modal dialog can be destroyed in own event-loop as a part of application
     
    251251             new UIAddDiskEncryptionPasswordDialog(this,
    252252                                                   window()->windowTitle(),
    253                                                    encryptedMediums);
     253                                                   encryptedMedia);
    254254
    255255        /* Execute the dialog: */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette