Changeset 28632 in vbox
- Timestamp:
- Apr 23, 2010 8:59:14 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60484
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r28597 r28632 270 270 QString strFullData; 271 271 272 for (ulong uSlot = 0 ; uSlot < uMaxCount; ++ uSlot)272 for (ulong uSlot = 0, uEnabled = 0; uSlot < uMaxCount; ++ uSlot) 273 273 { 274 274 CNetworkAdapter adapter = machine.GetNetworkAdapter(uSlot); 275 275 if (adapter.GetEnabled()) 276 276 { 277 QString strIP; 277 QString strFlags; 278 QString strCount; 278 279 ULONG64 timestamp; 280 machine.GetGuestProperty("/VirtualBox/GuestInfo/Net/Count", strCount, timestamp, strFlags); 279 281 RTTIMESPEC time; 280 282 uint64_t u64Now = RTTimeSpecGetNano(RTTimeNow(&time)); 281 QString strFlags; 282 machine.GetGuestProperty(QString("/VirtualBox/GuestInfo/Net/%1/V4/IP").arg(uSlot), 283 strIP, timestamp, strFlags); 283 QString strIP; 284 if ( u64Now - timestamp < UINT64_C(60000000000) 285 && strCount.toInt() > 0) 286 strIP = machine.GetGuestPropertyValue(QString("/VirtualBox/GuestInfo/Net/%1/V4/IP").arg(uEnabled)); 284 287 strFullData += QApplication::translate("VBoxConsoleWnd", "<br><nobr><b>Adapter %1 (%2)</b>: %3 cable %4</nobr>", "Network adapters tooltip") 285 288 .arg(uSlot + 1) 286 289 .arg(vboxGlobal().toString(adapter.GetAttachmentType())) 287 .arg(strIP.isEmpty() || (u64Now - timestamp > UINT64_C(20000000000))? "" : "IP " + strIP + ", ")290 .arg(strIP.isEmpty() ? "" : "IP " + strIP + ", ") 288 291 .arg(adapter.GetCableConnected() ? 289 292 QApplication::translate("VBoxConsoleWnd", "connected", "Network adapters tooltip") : 290 293 QApplication::translate("VBoxConsoleWnd", "disconnected", "Network adapters tooltip")); 294 uEnabled++; 291 295 } 292 296 }
Note:
See TracChangeset
for help on using the changeset viewer.