Changeset 51994 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jul 11, 2014 3:27:09 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r51992 r51994 84 84 : UISessionStateStatusBarIndicator(session) 85 85 { 86 /* Assign state-icons: */ 86 87 setStateIcon(KDeviceActivity_Idle, UIIconPool::iconSet(":/hd_16px.png")); 87 88 setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/hd_read_16px.png")); 88 89 setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/hd_write_16px.png")); 89 90 setStateIcon(KDeviceActivity_Null, UIIconPool::iconSet(":/hd_disabled_16px.png")); 90 91 /* Translate finally: */ 91 92 retranslateUi(); 92 93 } … … 103 104 void updateAppearance() 104 105 { 105 const CMachine &machine = m_session.GetMachine(); 106 107 QString strToolTip = QApplication::translate("UIIndicatorsPool", "<p style='white-space:pre'><nobr>Indicates the activity " 106 /* Get machine: */ 107 const CMachine machine = m_session.GetMachine(); 108 109 /* Prepare tool-tip: */ 110 QString strToolTip = QApplication::translate("UIIndicatorsPool", 111 "<p style='white-space:pre'><nobr>Indicates the activity " 108 112 "of the virtual hard disks:</nobr>%1</p>", "HDD tooltip"); 109 110 113 QString strFullData; 114 115 /* Enumerate all the controllers: */ 111 116 bool fAttachmentsPresent = false; 112 113 const CStorageControllerVector &controllers = machine.GetStorageControllers(); 114 foreach (const CStorageController &controller, controllers) 117 foreach (const CStorageController &controller, machine.GetStorageControllers()) 115 118 { 116 119 QString strAttData; 117 const CMediumAttachmentVector &attachments = machine.GetMediumAttachmentsOfController(controller.GetName());118 foreach (const CMediumAttachment &attachment, attachments)120 /* Enumerate all the attachments: */ 121 foreach (const CMediumAttachment &attachment, machine.GetMediumAttachmentsOfController(controller.GetName())) 119 122 { 123 /* Skip unrelated attachments: */ 120 124 if (attachment.GetType() != KDeviceType_HardDisk) 121 125 continue; 126 /* Append attachment data: */ 122 127 strAttData += QString("<br> <nobr>%1: %2</nobr>") 123 128 .arg(gpConverter->toString(StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()))) … … 125 130 fAttachmentsPresent = true; 126 131 } 132 /* Append controller data: */ 127 133 if (!strAttData.isNull()) 128 134 strFullData += QString("<br><nobr><b>%1</b></nobr>").arg(controller.GetName()) + strAttData; 129 135 } 130 136 131 /* For now we will hide that LED at all if there are no attachments!*/137 /* Hide indicator if there are no attachments: */ 132 138 if (!fAttachmentsPresent) 133 setHidden(true); 134 //if (!fAttachmentsPresent) 135 // strFullData += QApplication::translate("UIIndicatorsPool", "<br><nobr><b>No hard disks attached</b></nobr>", "HDD tooltip"); 136 139 hide(); 140 141 /* Update tool-tip: */ 137 142 setToolTip(strToolTip.arg(strFullData)); 143 /* Update indicator state: */ 138 144 setState(fAttachmentsPresent ? KDeviceActivity_Idle : KDeviceActivity_Null); 139 145 } … … 151 157 : UISessionStateStatusBarIndicator(session) 152 158 { 159 /* Assign state-icons: */ 153 160 setStateIcon(KDeviceActivity_Idle, UIIconPool::iconSet(":/cd_16px.png")); 154 161 setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/cd_read_16px.png")); 155 162 setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/cd_write_16px.png")); 156 163 setStateIcon(KDeviceActivity_Null, UIIconPool::iconSet(":/cd_disabled_16px.png")); 157 164 /* Translate finally: */ 158 165 retranslateUi(); 159 166 } … … 170 177 void updateAppearance() 171 178 { 172 const CMachine &machine = m_session.GetMachine(); 173 174 QString strToolTip = QApplication::translate("UIIndicatorsPool", "<p style='white-space:pre'><nobr>Indicates the activity " 179 /* Get machine: */ 180 const CMachine machine = m_session.GetMachine(); 181 182 /* Prepare tool-tip: */ 183 QString strToolTip = QApplication::translate("UIIndicatorsPool", 184 "<p style='white-space:pre'><nobr>Indicates the activity " 175 185 "of the CD/DVD devices:</nobr>%1</p>", "CD/DVD tooltip"); 176 177 186 QString strFullData; 187 188 /* Enumerate all the controllers: */ 178 189 bool fAttachmentsPresent = false; 179 190 bool fAttachmentsMounted = false; 180 181 const CStorageControllerVector &controllers = machine.GetStorageControllers(); 182 foreach (const CStorageController &controller, controllers) 191 foreach (const CStorageController &controller, machine.GetStorageControllers()) 183 192 { 184 193 QString strAttData; 185 const CMediumAttachmentVector &attachments = machine.GetMediumAttachmentsOfController(controller.GetName());186 foreach (const CMediumAttachment &attachment, attachments)194 /* Enumerate all the attachments: */ 195 foreach (const CMediumAttachment &attachment, machine.GetMediumAttachmentsOfController(controller.GetName())) 187 196 { 197 /* Skip unrelated attachments: */ 188 198 if (attachment.GetType() != KDeviceType_DVD) 189 199 continue; 200 /* Append attachment data: */ 190 201 UIMedium vboxMedium(attachment.GetMedium(), UIMediumType_DVD); 191 202 strAttData += QString("<br> <nobr>%1: %2</nobr>") … … 196 207 fAttachmentsMounted = true; 197 208 } 209 /* Append controller data: */ 198 210 if (!strAttData.isNull()) 199 211 strFullData += QString("<br><nobr><b>%1</b></nobr>").arg(controller.GetName()) + strAttData; 200 212 } 201 213 202 /* For now we will hide that LED at all if there are no attachments!*/214 /* Hide indicator if there are no attachments: */ 203 215 if (!fAttachmentsPresent) 204 setHidden(true); 205 //if (!fAttachmentsPresent) 206 // strFullData = QApplication::translate("UIIndicatorsPool", "<br><nobr><b>No CD/DVD devices attached</b></nobr>", "CD/DVD tooltip"); 207 216 hide(); 217 218 /* Update tool-tip: */ 208 219 setToolTip(strToolTip.arg(strFullData)); 220 /* Update indicator state: */ 209 221 setState(fAttachmentsMounted ? KDeviceActivity_Idle : KDeviceActivity_Null); 210 222 } … … 222 234 : UISessionStateStatusBarIndicator(session) 223 235 { 236 /* Assign state-icons: */ 224 237 setStateIcon(KDeviceActivity_Idle, UIIconPool::iconSet(":/fd_16px.png")); 225 238 setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/fd_read_16px.png")); 226 239 setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/fd_write_16px.png")); 227 240 setStateIcon(KDeviceActivity_Null, UIIconPool::iconSet(":/fd_disabled_16px.png")); 228 241 /* Translate finally: */ 229 242 retranslateUi(); 230 243 } … … 241 254 void updateAppearance() 242 255 { 243 const CMachine &machine = m_session.GetMachine(); 244 245 QString strToolTip = QApplication::translate("UIIndicatorsPool", "<p style='white-space:pre'><nobr>Indicates the activity " 256 /* Get machine: */ 257 const CMachine machine = m_session.GetMachine(); 258 259 /* Prepare tool-tip: */ 260 QString strToolTip = QApplication::translate("UIIndicatorsPool", 261 "<p style='white-space:pre'><nobr>Indicates the activity " 246 262 "of the floppy devices:</nobr>%1</p>", "FD tooltip"); 247 248 263 QString strFullData; 264 265 /* Enumerate all the controllers: */ 249 266 bool fAttachmentsPresent = false; 250 267 bool fAttachmentsMounted = false; 251 252 const CStorageControllerVector &controllers = machine.GetStorageControllers(); 253 foreach (const CStorageController &controller, controllers) 268 foreach (const CStorageController &controller, machine.GetStorageControllers()) 254 269 { 255 270 QString strAttData; 256 const CMediumAttachmentVector &attachments = machine.GetMediumAttachmentsOfController(controller.GetName());257 foreach (const CMediumAttachment &attachment, attachments)271 /* Enumerate all the attachments: */ 272 foreach (const CMediumAttachment &attachment, machine.GetMediumAttachmentsOfController(controller.GetName())) 258 273 { 274 /* Skip unrelated attachments: */ 259 275 if (attachment.GetType() != KDeviceType_Floppy) 260 276 continue; 277 /* Append attachment data: */ 261 278 UIMedium vboxMedium(attachment.GetMedium(), UIMediumType_Floppy); 262 279 strAttData += QString("<br> <nobr>%1: %2</nobr>") … … 267 284 fAttachmentsMounted = true; 268 285 } 286 /* Append controller data: */ 269 287 if (!strAttData.isNull()) 270 288 strFullData += QString("<br><nobr><b>%1</b></nobr>").arg(controller.GetName()) + strAttData; 271 289 } 272 290 273 /* For now we will hide that LED at all if there are no attachments!*/291 /* Hide indicator if there are no attachments: */ 274 292 if (!fAttachmentsPresent) 275 setHidden(true); 276 //if (!fAttachmentsPresent) 277 // strFullData = QApplication::translate("UIIndicatorsPool", "<br><nobr><b>No floppy devices attached</b></nobr>", "FD tooltip"); 278 293 hide(); 294 295 /* Update tool-tip: */ 279 296 setToolTip(strToolTip.arg(strFullData)); 297 /* Update indicator state: */ 280 298 setState(fAttachmentsMounted ? KDeviceActivity_Idle : KDeviceActivity_Null); 299 } 300 }; 301 302 /** UISessionStateStatusBarIndicator extension for Runtime UI: USB indicator. */ 303 class UIIndicatorUSB : public UISessionStateStatusBarIndicator 304 { 305 Q_OBJECT; 306 307 public: 308 309 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */ 310 UIIndicatorUSB(CSession &session) 311 : UISessionStateStatusBarIndicator(session) 312 { 313 /* Assign state-icons: */ 314 setStateIcon(KDeviceActivity_Idle, UIIconPool::iconSet(":/usb_16px.png")); 315 setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/usb_read_16px.png")); 316 setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/usb_write_16px.png")); 317 setStateIcon(KDeviceActivity_Null, UIIconPool::iconSet(":/usb_disabled_16px.png")); 318 /* Translate finally: */ 319 retranslateUi(); 320 } 321 322 private: 323 324 /** Retranslation routine. */ 325 void retranslateUi() 326 { 327 updateAppearance(); 328 } 329 330 /** Update routine. */ 331 void updateAppearance() 332 { 333 /* Get machine: */ 334 const CMachine machine = m_session.GetMachine(); 335 336 /* Prepare tool-tip: */ 337 QString strToolTip = QApplication::translate("UIIndicatorsPool", 338 "<p style='white-space:pre'><nobr>Indicates the activity of " 339 "the attached USB devices:</nobr>%1</p>", "USB device tooltip"); 340 QString strFullData; 341 342 /* Check whether there is at least one USB controller with an available proxy. */ 343 bool fUSBEnabled = !machine.GetUSBDeviceFilters().isNull() 344 && !machine.GetUSBControllers().isEmpty() 345 && machine.GetUSBProxyAvailable(); 346 if (fUSBEnabled) 347 { 348 /* Enumerate all the USB devices: */ 349 const CConsole &console = m_session.GetConsole(); 350 foreach (const CUSBDevice &usbDevice, console.GetUSBDevices()) 351 strFullData += QString("<br><b><nobr>%1</nobr></b>").arg(vboxGlobal().details(usbDevice)); 352 /* Handle 'no-usb-devices' case: */ 353 if (strFullData.isNull()) 354 strFullData = QApplication::translate("UIIndicatorsPool", "<br><nobr><b>No USB devices attached</b></nobr>", "USB device tooltip"); 355 } 356 357 /* Hide indicator if there are USB controllers: */ 358 if (!fUSBEnabled) 359 hide(); 360 361 /* Update tool-tip: */ 362 setToolTip(strToolTip.arg(strFullData)); 363 /* Update indicator state: */ 364 setState(fUSBEnabled ? KDeviceActivity_Idle : KDeviceActivity_Null); 281 365 } 282 366 }; … … 292 376 UIIndicatorNetwork(CSession &session) 293 377 : UISessionStateStatusBarIndicator(session) 294 , m_pUpdateTimer(new QTimer(this)) 295 { 378 , m_pTimerAutoUpdate(0) 379 { 380 /* Assign state-icons: */ 296 381 setStateIcon(KDeviceActivity_Idle, UIIconPool::iconSet(":/nw_16px.png")); 297 382 setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/nw_read_16px.png")); 298 383 setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/nw_write_16px.png")); 299 384 setStateIcon(KDeviceActivity_Null, UIIconPool::iconSet(":/nw_disabled_16px.png")); 300 301 connect(m_pUpdateTimer, SIGNAL(timeout()), SLOT(sltUpdateNetworkIPs())); 302 m_pUpdateTimer->start(5000); 303 385 /* Create auto-update timer: */ 386 m_pTimerAutoUpdate = new QTimer(this); 387 if (m_pTimerAutoUpdate) 388 { 389 /* Configure auto-update timer: */ 390 connect(m_pTimerAutoUpdate, SIGNAL(timeout()), SLOT(sltUpdateNetworkIPs())); 391 m_pTimerAutoUpdate->start(5000); 392 } 393 /* Translate finally: */ 304 394 retranslateUi(); 305 395 } … … 324 414 void updateAppearance() 325 415 { 326 const CMachine &machine = m_session.GetMachine(); 416 /* Get machine: */ 417 const CMachine machine = m_session.GetMachine(); 418 419 /* Prepare tool-tip: */ 420 QString strToolTip = QApplication::translate("UIIndicatorsPool", 421 "<p style='white-space:pre'><nobr>Indicates the activity of the " 422 "network interfaces:</nobr>%1</p>", "Network adapters tooltip"); 327 423 QString strFullData; 328 424 329 ulong uMaxCount = vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3); 330 331 QString strToolTip = QApplication::translate("UIIndicatorsPool", 332 "<p style='white-space:pre'><nobr>Indicates the activity of the " 333 "network interfaces:</nobr>%1</p>", "Network adapters tooltip"); 334 425 /* Gather adapter properties: */ 335 426 RTTIMESPEC time; 336 427 uint64_t u64Now = RTTimeSpecGetNano(RTTimeNow(&time)); 337 338 428 QString strFlags, strCount; 339 429 LONG64 iTimestamp; 340 430 machine.GetGuestProperty("/VirtualBox/GuestInfo/Net/Count", strCount, iTimestamp, strFlags); 341 431 bool fPropsValid = (u64Now - iTimestamp < UINT64_C(60000000000)); /* timeout beacon */ 342 432 ulong uMaxCount = vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(machine.GetChipsetType()); 343 433 QStringList ipList, macList; 344 434 if (fPropsValid) 345 435 { 346 int cAdapters = RT_MIN(strCount.toInt(), (int)uMaxCount);436 const int cAdapters = RT_MIN(strCount.toInt(), (int)uMaxCount); 347 437 for (int i = 0; i < cAdapters; ++i) 348 438 { … … 352 442 } 353 443 354 ulong uEnabled = 0; 444 /* Enumerate up to uMaxCount adapters: */ 445 bool fAdaptersPresent = false; 355 446 for (ulong uSlot = 0; uSlot < uMaxCount; ++uSlot) 356 447 { … … 358 449 if (adapter.GetEnabled()) 359 450 { 451 fAdaptersPresent = true; 360 452 QString strGuestIp; 361 453 if (fPropsValid) 362 454 { 363 QString strGuestMac = adapter.GetMACAddress();455 const QString strGuestMac = adapter.GetMACAddress(); 364 456 int iIp = macList.indexOf(strGuestMac); 365 457 if (iIp >= 0) 366 458 strGuestIp = ipList[iIp]; 367 459 } 460 /* Append adapter data: */ 368 461 strFullData += QApplication::translate("UIIndicatorsPool", 369 462 "<br><nobr><b>Adapter %1 (%2)</b>: %3 cable %4</nobr>", "Network adapters tooltip") 370 463 .arg(uSlot + 1) 371 464 .arg(gpConverter->toString(adapter.GetAttachmentType())) … … 374 467 QApplication::translate("UIIndicatorsPool", "connected", "Network adapters tooltip") : 375 468 QApplication::translate("UIIndicatorsPool", "disconnected", "Network adapters tooltip")); 376 ++uEnabled;377 469 } 378 470 } 379 380 setState(uEnabled > 0 ? KDeviceActivity_Idle : KDeviceActivity_Null); 381 if (!uEnabled) 382 setHidden(true); 383 471 /* Handle 'no-adapters' case: */ 384 472 if (strFullData.isNull()) 385 473 strFullData = QApplication::translate("UIIndicatorsPool", 386 474 "<br><nobr><b>All network adapters are disabled</b></nobr>", "Network adapters tooltip"); 387 475 476 /* Hide indicator if there are no enabled adapters: */ 477 if (!fAdaptersPresent) 478 hide(); 479 480 /* Update tool-tip: */ 388 481 setToolTip(strToolTip.arg(strFullData)); 482 /* Update indicator state: */ 483 setState(fAdaptersPresent ? KDeviceActivity_Idle : KDeviceActivity_Null); 389 484 } 390 485 391 486 /** Holds the auto-update timer instance. */ 392 QTimer *m_pUpdateTimer; 393 }; 394 395 /** UISessionStateStatusBarIndicator extension for Runtime UI: USB indicator. */ 396 class UIIndicatorUSB : public UISessionStateStatusBarIndicator 397 { 398 Q_OBJECT; 399 400 public: 401 402 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */ 403 UIIndicatorUSB(CSession &session) 404 : UISessionStateStatusBarIndicator(session) 405 { 406 setStateIcon(KDeviceActivity_Idle, UIIconPool::iconSet(":/usb_16px.png")); 407 setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/usb_read_16px.png")); 408 setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/usb_write_16px.png")); 409 setStateIcon(KDeviceActivity_Null, UIIconPool::iconSet(":/usb_disabled_16px.png")); 410 411 retranslateUi(); 412 } 413 414 private: 415 416 /** Retranslation routine. */ 417 void retranslateUi() 418 { 419 updateAppearance(); 420 } 421 422 /** Update routine. */ 423 void updateAppearance() 424 { 425 const CMachine &machine = m_session.GetMachine(); 426 427 QString strToolTip = QApplication::translate("UIIndicatorsPool", "<p style='white-space:pre'><nobr>Indicates the activity of " 428 "the attached USB devices:</nobr>%1</p>", "USB device tooltip"); 429 QString strFullData; 430 431 /* Check whether there is at least one USB controller with an available proxy. */ 432 bool fUSBEnabled = !machine.GetUSBDeviceFilters().isNull() 433 && !machine.GetUSBControllers().isEmpty() 434 && machine.GetUSBProxyAvailable(); 435 436 setState(fUSBEnabled ? KDeviceActivity_Idle : KDeviceActivity_Null); 437 if (fUSBEnabled) 438 { 439 const CConsole &console = m_session.GetConsole(); 440 441 const CUSBDeviceVector &devsvec = console.GetUSBDevices(); 442 for (int i = 0; i < devsvec.size(); ++ i) 443 { 444 CUSBDevice usb = devsvec[i]; 445 strFullData += QString("<br><b><nobr>%1</nobr></b>").arg(vboxGlobal().details(usb)); 446 } 447 if (strFullData.isNull()) 448 strFullData = QApplication::translate("UIIndicatorsPool", "<br><nobr><b>No USB devices attached</b></nobr>", "USB device tooltip"); 449 } 450 else 451 strFullData = QApplication::translate("UIIndicatorsPool", "<br><nobr><b>USB Controller is disabled</b></nobr>", "USB device tooltip"); 452 453 setToolTip(strToolTip.arg(strFullData)); 454 } 487 QTimer *m_pTimerAutoUpdate; 455 488 }; 456 489 … … 466 499 : UISessionStateStatusBarIndicator(session) 467 500 { 501 /* Assign state-icons: */ 468 502 setStateIcon(KDeviceActivity_Idle, UIIconPool::iconSet(":/sf_16px.png")); 469 503 setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/sf_read_16px.png")); 470 504 setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/sf_write_16px.png")); 471 505 setStateIcon(KDeviceActivity_Null, UIIconPool::iconSet(":/sf_disabled_16px.png")); 472 506 /* Translate finally: */ 473 507 retranslateUi(); 474 508 } … … 485 519 void updateAppearance() 486 520 { 487 const CMachine &machine = m_session.GetMachine(); 488 const CConsole &console = m_session.GetConsole(); 489 490 QString strToolTip = QApplication::translate("UIIndicatorsPool", "<p style='white-space:pre'><nobr>Indicates the activity of " 491 "the machine's shared folders:</nobr>%1</p>", "Shared folders tooltip"); 492 521 /* Get machine: */ 522 const CMachine machine = m_session.GetMachine(); 523 const CConsole console = m_session.GetConsole(); 524 525 /* Prepare tool-tip: */ 526 QString strToolTip = QApplication::translate("UIIndicatorsPool", 527 "<p style='white-space:pre'><nobr>Indicates the activity of " 528 "the machine's shared folders:</nobr>%1</p>", "Shared folders tooltip"); 493 529 QString strFullData; 530 531 /* Enumerate all the folders: */ 494 532 QMap<QString, QString> sfs; 495 496 /* Permanent folders */ 497 const CSharedFolderVector &psfvec = machine.GetSharedFolders(); 498 499 for (int i = 0; i < psfvec.size(); ++ i) 500 { 501 const CSharedFolder &sf = psfvec[i]; 533 foreach (const CSharedFolder &sf, machine.GetSharedFolders()) 502 534 sfs.insert(sf.GetName(), sf.GetHostPath()); 503 } 504 505 /* Transient folders */ 506 const CSharedFolderVector &tsfvec = console.GetSharedFolders(); 507 508 for (int i = 0; i < tsfvec.size(); ++ i) 509 { 510 const CSharedFolder &sf = tsfvec[i]; 535 foreach (const CSharedFolder &sf, console.GetSharedFolders()) 511 536 sfs.insert(sf.GetName(), sf.GetHostPath()); 512 } 513 514 for (QMap<QString, QString>::const_iterator it = sfs.constBegin(); it != sfs.constEnd(); ++ 515 { 516 /* Select slashes depending on the OS type */537 538 /* Append attachment data: */ 539 for (QMap<QString, QString>::const_iterator it = sfs.constBegin(); it != sfs.constEnd(); ++it) 540 { 541 /* Select slashes depending on the OS type: */ 517 542 if (VBoxGlobal::isDOSType(console.GetGuest().GetOSTypeId())) 518 543 strFullData += QString("<br><nobr><b>\\\\vboxsvr\\%1 </b></nobr><nobr>%2</nobr>") … … 522 547 .arg(it.key(), it.value()); 523 548 } 524 525 if (sfs. count() == 0)549 /* Handle 'no-folders' case: */ 550 if (sfs.isEmpty()) 526 551 strFullData = QApplication::translate("UIIndicatorsPool", "<br><nobr><b>No shared folders</b></nobr>", "Shared folders tooltip"); 527 552 553 /* Update tool-tip: */ 554 setToolTip(strToolTip.arg(strFullData)); 555 /* Update indicator state: */ 528 556 setState(!sfs.isEmpty() ? KDeviceActivity_Idle : KDeviceActivity_Null); 529 setToolTip(strToolTip.arg(strFullData));530 557 } 531 558 }; … … 554 581 , m_dRotationAngle(0) 555 582 { 556 /* Assign state 583 /* Assign state-icons: */ 557 584 setStateIcon(UIIndicatorStateVideoCapture_Disabled, UIIconPool::iconSet(":/video_capture_16px.png")); 558 585 setStateIcon(UIIndicatorStateVideoCapture_Enabled, UIIconPool::iconSet(":/movie_reel_16px.png")); 559 560 /* Prepare *enabled* state animation: */ 586 /* Create *enabled* state animation: */ 561 587 m_pAnimation = UIAnimationLoop::installAnimationLoop(this, "rotationAngle", 562 588 "rotationAngleStart", "rotationAngleFinal", 563 589 1000); 564 565 590 /* Translate finally: */ 566 591 retranslateUi(); … … 623 648 { 624 649 /* Get machine: */ 625 CMachine machine = m_session.GetMachine(); 626 627 /* Update LED state: */ 628 setState(machine.GetVideoCaptureEnabled()); 629 630 /* Update LED tool-tip: */ 650 const CMachine machine = m_session.GetMachine(); 651 652 /* Prepare tool-tip: */ 631 653 QString strToolTip = QApplication::translate("UIIndicatorsPool", "<nobr>Indicates video capturing activity:</nobr><br>%1"); 632 654 switch (state()) … … 646 668 break; 647 669 } 670 671 /* Update tool-tip: */ 648 672 setToolTip(strToolTip); 673 /* Update indicator state: */ 674 setState(machine.GetVideoCaptureEnabled()); 649 675 } 650 676 … … 675 701 : UISessionStateStatusBarIndicator(session) 676 702 { 703 /* Assign state-icons: */ 677 704 setStateIcon(0, UIIconPool::iconSet(":/vtx_amdv_disabled_16px.png")); 678 705 setStateIcon(1, UIIconPool::iconSet(":/vtx_amdv_16px.png")); 679 706 /* Translate finally: */ 680 707 retranslateUi(); 681 708 } … … 692 719 void updateAppearance() 693 720 { 694 const CConsole &console = m_session.GetConsole(); 721 /* Get console: */ 722 const CConsole console = m_session.GetConsole(); 695 723 if (console.isNull()) 696 724 return; 697 725 698 const CMachineDebugger &debugger = console.GetDebugger(); 726 /* Get debugger: */ 727 const CMachineDebugger debugger = console.GetDebugger(); 699 728 if (debugger.isNull()) 700 729 return; 701 730 731 /* VT-x/AMD-V feature: */ 702 732 bool bVirtEnabled = debugger.GetHWVirtExEnabled(); 703 733 QString virtualization = bVirtEnabled ? … … 705 735 VBoxGlobal::tr("Disabled", "details report (VT-x/AMD-V)"); 706 736 737 /* Nested Paging feature: */ 707 738 bool bNestEnabled = debugger.GetHWVirtExNestedPagingEnabled(); 708 739 QString nestedPaging = bNestEnabled ? … … 710 741 VBoxGlobal::tr("Disabled", "details report (Nested Paging)"); 711 742 743 /* Unrestricted Execution feature: */ 712 744 bool bUXEnabled = debugger.GetHWVirtExUXEnabled(); 713 745 QString unrestrictExec = bUXEnabled ? … … 715 747 VBoxGlobal::tr("Disabled", "details report (Unrestricted Execution)"); 716 748 749 /* CPU Execution Cap feature: */ 717 750 QString strCPUExecCap = QString::number(console.GetMachine().GetCPUExecutionCap()); 718 751 752 /* Prepare tool-tip: */ 719 753 QString tip(QApplication::translate("UIIndicatorsPool", 720 754 "Additional feature status:" … … 729 763 .arg(VBoxGlobal::tr("Execution Cap", "details report"), strCPUExecCap)); 730 764 765 /* CPU count: */ 731 766 int cpuCount = console.GetMachine().GetCPUCount(); 732 767 if (cpuCount > 1) … … 734 769 .arg(VBoxGlobal::tr("Processor(s)", "details report")).arg(cpuCount); 735 770 771 /* Update tool-tip: */ 736 772 setToolTip(tip); 773 /* Update indicator state: */ 737 774 setState(bVirtEnabled); 738 775 } … … 750 787 : UISessionStateStatusBarIndicator(session) 751 788 { 789 /* Assign state-icons: */ 752 790 setStateIcon(0, UIIconPool::iconSet(":/mouse_disabled_16px.png")); 753 791 setStateIcon(1, UIIconPool::iconSet(":/mouse_16px.png")); … … 755 793 setStateIcon(3, UIIconPool::iconSet(":/mouse_can_seamless_16px.png")); 756 794 setStateIcon(4, UIIconPool::iconSet(":/mouse_can_seamless_uncaptured_16px.png")); 757 795 /* Translate finally: */ 758 796 retranslateUi(); 759 797 } … … 806 844 : UISessionStateStatusBarIndicator(session) 807 845 { 846 /* Assign state-icons: */ 808 847 setStateIcon(0, UIIconPool::iconSet(":/hostkey_16px.png")); 809 848 setStateIcon(1, UIIconPool::iconSet(":/hostkey_captured_16px.png")); 810 849 setStateIcon(2, UIIconPool::iconSet(":/hostkey_pressed_16px.png")); 811 850 setStateIcon(3, UIIconPool::iconSet(":/hostkey_captured_pressed_16px.png")); 812 851 /* Translate finally: */ 813 852 retranslateUi(); 814 853 }
Note:
See TracChangeset
for help on using the changeset viewer.