Changeset 28671 in vbox
- Timestamp:
- Apr 23, 2010 5:54:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r28609 r28671 3126 3126 QString info; 3127 3127 3128 for (ulong slot = 0; slot < maxCount; ++ slot) 3129 { 3130 CNetworkAdapter adapter = machine.GetNetworkAdapter (slot); 3131 QString ip; 3132 ULONG64 timestamp; 3133 RTTIMESPEC time; 3128 for (ulong slot = 0, uEnabled = 0; slot < maxCount; ++ slot) 3129 { 3130 const CNetworkAdapter &adapter = machine.GetNetworkAdapter (slot); 3134 3131 if (adapter.GetEnabled()) 3135 3132 { 3133 QString strFlags; 3134 QString strCount; 3135 ULONG64 timestamp; 3136 machine.GetGuestProperty("/VirtualBox/GuestInfo/Net/Count", strCount, timestamp, strFlags); 3137 RTTIMESPEC time; 3136 3138 uint64_t u64Now = RTTimeSpecGetNano(RTTimeNow(&time)); 3137 QString flags; 3138 machine.GetGuestProperty(QString("/VirtualBox/GuestInfo/Net/%1/V4/IP").arg(slot), 3139 ip, timestamp, flags); 3139 QString strIP; 3140 if ( u64Now - timestamp < UINT64_C(60000000000) 3141 && strCount.toInt() > 0) 3142 strIP = machine.GetGuestPropertyValue(QString("/VirtualBox/GuestInfo/Net/%1/V4/IP").arg(uEnabled)); 3140 3143 info += tr ("<br><nobr><b>Adapter %1 (%2)</b>: %3 cable %4</nobr>", "Network adapters tooltip") 3141 3144 .arg (slot + 1) 3142 3145 .arg (vboxGlobal().toString (adapter.GetAttachmentType())) 3143 .arg ( ip.isEmpty() || (u64Now - timestamp > UINT64_C(20000000000)) ? "" : "IP " + ip+ ", ")3146 .arg (strIP.isEmpty() ? "" : "IP " + strIP + ", ") 3144 3147 .arg (adapter.GetCableConnected() ? 3145 3148 tr ("connected", "Network adapters tooltip") : 3146 3149 tr ("disconnected", "Network adapters tooltip")); 3150 uEnabled++; 3147 3151 } 3148 3152 }
Note:
See TracChangeset
for help on using the changeset viewer.