<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks a lot, in Java it was the same :-)<br>
<br>
Thomas<br>
<br>
<br>
<br>
Achim Hasenmueller schrieb:
<blockquote cite="mid:50D4915D-F841-41C4-88CF-7F9EF17CDF34@sun.com"
type="cite">
<pre wrap="">This is how the Qt GUI populates the list:
QStringList VBoxVMSettingsNetworkPage::intList (bool aRefresh)
593 {
594 if (aRefresh)
595 {
596 /* Load total network list of all VMs */
597 mIntList.clear();
598 CVirtualBox vbox = vboxGlobal().virtualBox();
599 ulong count = qMin ((ULONG) 4, vbox.GetSystemProperties().GetNetworkAdapterCount());
600 CMachineVector vec = vbox.GetMachines();
601 for (CMachineVector::ConstIterator m = vec.begin(); m != vec.end(); ++ m)
602 {
603 if (m->GetAccessible())
604 {
605 for (ulong slot = 0; slot < count; ++ slot)
606 {
607 QString name = m->GetNetworkAdapter (slot).GetInternalNetwork();
608 if (!name.isEmpty() && !mIntList.contains (name))
609 mIntList << name;
610 }
611 }
612 }
613 }
614
615 /* Append network list with names from all the pages */
616 QStringList list (mIntList);
617 for (int index = 0; index < mTwAdapters->count(); ++ index)
618 {
619 VBoxVMSettingsNetwork *page =
620 qobject_cast <VBoxVMSettingsNetwork*> (mTwAdapters->widget (index));
621 if (page)
622 {
623 QString name = page->alternativeName (KNetworkAttachmentType_Internal);
624 if (!name.isEmpty() && !list.contains (name))
625 list << name;
626 }
627 }
628
629 return list;
630 }
On Jan 16, 2010, at 17:11 , Thomas Trepper wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi all,
while trying to get the IMachine-attached network adapters I wonder if there is a way to get the amount of attached or available slots?
I can try
INetworkAdapter tmp = vBoxFromHost.getNetworkAdapter(0L);
but I have not idea, how many slots can exit on various machines. Is there a way to obtain the maximum for iteration?
Thanks a lot and best regards,
Thomas
_______________________________________________
vbox-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:vbox-dev@virtualbox.org">vbox-dev@virtualbox.org</a>
<a class="moz-txt-link-freetext" href="http://vbox.innotek.de/mailman/listinfo/vbox-dev">http://vbox.innotek.de/mailman/listinfo/vbox-dev</a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>