VirtualBox

Changeset 37779 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 5, 2011 12:13:15 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72655
Message:

Main/VirtualBox: add two attributes for querying the list of internal networks and generic network drivers
Frontend/VirtualBox: use new methods to decrease time needed before the settings dialog opens

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp

    r37645 r37779  
    10661066{
    10671067    /* Load total internal network list of all VMs: */
    1068     QStringList otherInternalNetworks;
    10691068    CVirtualBox vbox = vboxGlobal().virtualBox();
    1070     ulong uCount = qMin((ULONG) 4, vbox.GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3));
    1071     const CMachineVector &machines = vbox.GetMachines();
    1072     for (int i = 0; i < machines.size(); ++i)
    1073     {
    1074         const CMachine &machine = machines[i];
    1075         if (machine.GetAccessible())
    1076         {
    1077             for (ulong uSlot = 0; uSlot < uCount; ++uSlot)
    1078             {
    1079                 QString strName = machine.GetNetworkAdapter(uSlot).GetInternalNetwork();
    1080                 if (!strName.isEmpty() && !otherInternalNetworks.contains(strName))
    1081                     otherInternalNetworks << strName;
    1082             }
    1083         }
    1084     }
     1069    QStringList otherInternalNetworks(QList<QString>::fromVector(vbox.GetInternalNetworks()));
    10851070    return otherInternalNetworks;
    10861071}
     
    10901075{
    10911076    /* Load total generic driver list of all VMs: */
    1092     QStringList otherGenericDrivers;
    10931077    CVirtualBox vbox = vboxGlobal().virtualBox();
    1094     ulong uCount = qMin((ULONG) 4, vbox.GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3));
    1095     const CMachineVector &machines = vbox.GetMachines();
    1096     for (int i = 0; i < machines.size(); ++i)
    1097     {
    1098         const CMachine &machine = machines[i];
    1099         if (machine.GetAccessible())
    1100         {
    1101             for (ulong uSlot = 0; uSlot < uCount; ++uSlot)
    1102             {
    1103                 QString strName = machine.GetNetworkAdapter(uSlot).GetGenericDriver();
    1104                 if (!strName.isEmpty() && !otherGenericDrivers.contains(strName))
    1105                     otherGenericDrivers << strName;
    1106             }
    1107         }
    1108     }
     1078    QStringList otherGenericDrivers(QList<QString>::fromVector(vbox.GetGenericNetworkDrivers()));
    11091079    return otherGenericDrivers;
    11101080}
Note: See TracChangeset for help on using the changeset viewer.

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