Changeset 29419 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 12, 2010 1:04:58 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r29403 r29419 273 273 274 274 QString strToolTip = QApplication::translate("VBoxConsoleWnd", 275 "<p style='white-space:pre'><nobr>Indicates the activity of the "276 "network interfaces:</nobr>%1</p>", "Network adapters tooltip");275 "<p style='white-space:pre'><nobr>Indicates the activity of the " 276 "network interfaces:</nobr>%1</p>", "Network adapters tooltip"); 277 277 278 278 RTTIMESPEC time; … … 280 280 281 281 QString strFlags, strCount; 282 ULONG64 timestamp;283 machine.GetGuestProperty("/VirtualBox/GuestInfo/Net/Count", strCount, timestamp, strFlags);284 bool fPropsValid = (u64Now - timestamp < UINT64_C(60000000000)); /* timeout beacon */285 286 QStringList aIp, aMac;282 ULONG64 uTimestamp; 283 machine.GetGuestProperty("/VirtualBox/GuestInfo/Net/Count", strCount, uTimestamp, strFlags); 284 bool fPropsValid = (u64Now - uTimestamp < UINT64_C(60000000000)); /* timeout beacon */ 285 286 QStringList ipList, macList; 287 287 if (fPropsValid) 288 288 { 289 int cAdapters = RT_MIN(strCount.toInt(), uMaxCount);290 for (int i = 0; i < cAdapters; i++)289 int cAdapters = RT_MIN(strCount.toInt(), (int)uMaxCount); 290 for (int i = 0; i < cAdapters; ++i) 291 291 { 292 aIp<< machine.GetGuestPropertyValue(QString("/VirtualBox/GuestInfo/Net/%1/V4/IP").arg(i));293 aMac<< machine.GetGuestPropertyValue(QString("/VirtualBox/GuestInfo/Net/%1/MAC").arg(i));292 ipList << machine.GetGuestPropertyValue(QString("/VirtualBox/GuestInfo/Net/%1/V4/IP").arg(i)); 293 macList << machine.GetGuestPropertyValue(QString("/VirtualBox/GuestInfo/Net/%1/MAC").arg(i)); 294 294 } 295 295 } 296 296 297 297 ulong uEnabled = 0; 298 for (ulong uSlot = 0; uSlot < uMaxCount; ++ 298 for (ulong uSlot = 0; uSlot < uMaxCount; ++uSlot) 299 299 { 300 300 const CNetworkAdapter &adapter = machine.GetNetworkAdapter(uSlot); … … 305 305 { 306 306 QString strGuestMac = adapter.GetMACAddress(); 307 int iIp = aMac.indexOf(strGuestMac);307 int iIp = macList.indexOf(strGuestMac); 308 308 if (iIp >= 0) 309 strGuestIp = aIp[iIp];309 strGuestIp = ipList[iIp]; 310 310 } 311 311 strFullData += QApplication::translate("VBoxConsoleWnd", … … 315 315 .arg(strGuestIp.isEmpty() ? "" : "IP " + strGuestIp + ", ") 316 316 .arg(adapter.GetCableConnected() ? 317 318 319 ++ 317 QApplication::translate("VBoxConsoleWnd", "connected", "Network adapters tooltip") : 318 QApplication::translate("VBoxConsoleWnd", "disconnected", "Network adapters tooltip")); 319 ++uEnabled; 320 320 } 321 321 } … … 327 327 if (strFullData.isNull()) 328 328 strFullData = QApplication::translate("VBoxConsoleWnd", 329 "<br><nobr><b>All network adapters are disabled</b></nobr>", "Network adapters tooltip");329 "<br><nobr><b>All network adapters are disabled</b></nobr>", "Network adapters tooltip"); 330 330 331 331 setToolTip(strToolTip.arg(strFullData));
Note:
See TracChangeset
for help on using the changeset viewer.