Changeset 46680 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 19, 2013 4:58:50 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86573
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r46677 r46680 250 250 }; 251 251 252 class UIIndicatorNetwork Adapters: public QIStateIndicator253 { 254 Q_OBJECT; 255 256 public: 257 258 UIIndicatorNetwork Adapters(CSession &session)252 class UIIndicatorNetwork : public QIStateIndicator 253 { 254 Q_OBJECT; 255 256 public: 257 258 UIIndicatorNetwork(CSession &session) 259 259 : m_session(session) 260 260 , m_pUpdateTimer(new QTimer(this)) … … 356 356 }; 357 357 358 class UIIndicatorUSB Devices: public QIStateIndicator359 { 360 Q_OBJECT; 361 362 public: 363 364 UIIndicatorUSB Devices(CSession &session)358 class UIIndicatorUSB : public QIStateIndicator 359 { 360 Q_OBJECT; 361 362 public: 363 364 UIIndicatorUSB(CSession &session) 365 365 : m_session(session) 366 366 { … … 579 579 }; 580 580 581 class UIIndicator Virtualization: public QIStateIndicator582 { 583 Q_OBJECT; 584 585 public: 586 587 UIIndicator Virtualization(CSession &session)581 class UIIndicatorFeatures : public QIStateIndicator 582 { 583 Q_OBJECT; 584 585 public: 586 587 UIIndicatorFeatures(CSession &session) 588 588 : m_session(session) 589 589 { … … 705 705 }; 706 706 707 class UIIndicator Hostkey: public QIStateIndicator708 { 709 Q_OBJECT; 710 711 public: 712 713 UIIndicator Hostkey(CSession &session)707 class UIIndicatorKeyboard : public QIStateIndicator 708 { 709 Q_OBJECT; 710 711 public: 712 713 UIIndicatorKeyboard(CSession &session) 714 714 : m_session(session) 715 715 { … … 737 737 : QObject(pParent) 738 738 , m_session(session) 739 , m_pool(UIIndicatorIndex_ End)739 , m_pool(UIIndicatorIndex_Max) 740 740 { 741 741 /* Prepare: */ … … 758 758 { 759 759 /* Populate indicator-pool: */ 760 for (int iIndex = 0; iIndex < UIIndicatorIndex_ End; ++iIndex)760 for (int iIndex = 0; iIndex < UIIndicatorIndex_Max; ++iIndex) 761 761 { 762 762 /* Prepare indicator: */ … … 764 764 switch (index) 765 765 { 766 case UIIndicatorIndex_HardDisks: 767 case UIIndicatorIndex_OpticalDisks: 768 case UIIndicatorIndex_FloppyDisks: 769 case UIIndicatorIndex_Network Adapters: m_pool[index] = new UIIndicatorNetworkAdapters(m_session); break;770 case UIIndicatorIndex_USB Devices: m_pool[index] = new UIIndicatorUSBDevices(m_session); break;771 case UIIndicatorIndex_SharedFolders: 772 case UIIndicatorIndex_VideoCapture: 773 case UIIndicatorIndex_ Virtualization: m_pool[index] = new UIIndicatorVirtualization(m_session); break;774 case UIIndicatorIndex_Mouse: 775 case UIIndicatorIndex_ Hostkey: m_pool[index] = new UIIndicatorHostkey(m_session); break;766 case UIIndicatorIndex_HardDisks: m_pool[index] = new UIIndicatorHardDisks(m_session); break; 767 case UIIndicatorIndex_OpticalDisks: m_pool[index] = new UIIndicatorOpticalDisks(m_session); break; 768 case UIIndicatorIndex_FloppyDisks: m_pool[index] = new UIIndicatorFloppyDisks(m_session); break; 769 case UIIndicatorIndex_Network: m_pool[index] = new UIIndicatorNetwork(m_session); break; 770 case UIIndicatorIndex_USB: m_pool[index] = new UIIndicatorUSB(m_session); break; 771 case UIIndicatorIndex_SharedFolders: m_pool[index] = new UIIndicatorSharedFolders(m_session); break; 772 case UIIndicatorIndex_VideoCapture: m_pool[index] = new UIIndicatorVideoCapture(m_session); break; 773 case UIIndicatorIndex_Features: m_pool[index] = new UIIndicatorFeatures(m_session); break; 774 case UIIndicatorIndex_Mouse: m_pool[index] = new UIIndicatorMouse(m_session); break; 775 case UIIndicatorIndex_Keyboard: m_pool[index] = new UIIndicatorKeyboard(m_session); break; 776 776 default: break; 777 777 } … … 782 782 { 783 783 /* Wipe-out indicator-pool: */ 784 for (int iIndex = 0; iIndex < UIIndicatorIndex_ End; ++iIndex)784 for (int iIndex = 0; iIndex < UIIndicatorIndex_Max; ++iIndex) 785 785 { 786 786 /* Wipe-out indicator: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.h
r46677 r46680 32 32 UIIndicatorIndex_OpticalDisks, 33 33 UIIndicatorIndex_FloppyDisks, 34 UIIndicatorIndex_Network Adapters,35 UIIndicatorIndex_USB Devices,34 UIIndicatorIndex_Network, 35 UIIndicatorIndex_USB, 36 36 UIIndicatorIndex_SharedFolders, 37 37 UIIndicatorIndex_VideoCapture, 38 UIIndicatorIndex_ Virtualization,38 UIIndicatorIndex_Features, 39 39 UIIndicatorIndex_Mouse, 40 UIIndicatorIndex_ Hostkey,41 UIIndicatorIndex_ End40 UIIndicatorIndex_Keyboard, 41 UIIndicatorIndex_Max 42 42 }; 43 43 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineDefs.h
r46582 r46680 45 45 UIVisualElement_SharedFolderStuff = RT_BIT(8), 46 46 UIVisualElement_VideoCapture = RT_BIT(9), 47 UIVisualElement_ VirtualizationStuff= RT_BIT(10),47 UIVisualElement_FeaturesStuff = RT_BIT(10), 48 48 UIVisualElement_MiniToolBar = RT_BIT(11), 49 49 UIVisualElement_AllStuff = 0xFFFF -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r46626 r46680 61 61 62 62 /* Update pause and virtualization stuff: */ 63 updateAppearanceOf(UIVisualElement_PauseStuff | UIVisualElement_ VirtualizationStuff);63 updateAppearanceOf(UIVisualElement_PauseStuff | UIVisualElement_FeaturesStuff); 64 64 } 65 65 … … 109 109 { 110 110 /* Update virtualization stuff: */ 111 updateAppearanceOf(UIVisualElement_ VirtualizationStuff);111 updateAppearanceOf(UIVisualElement_FeaturesStuff); 112 112 } 113 113 114 114 void UIMachineWindowNormal::sltUpdateIndicators() 115 115 { 116 /* Update LEDs: */116 /* Update indicators: */ 117 117 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_HardDisks), KDeviceType_HardDisk); 118 118 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_OpticalDisks), KDeviceType_DVD); 119 119 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_FloppyDisks), KDeviceType_Floppy); 120 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_USB Devices), KDeviceType_USB);121 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_Network Adapters), KDeviceType_Network);120 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_USB), KDeviceType_USB); 121 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_Network), KDeviceType_Network); 122 122 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_SharedFolders), KDeviceType_SharedFolder); 123 123 } … … 125 125 void UIMachineWindowNormal::sltShowIndicatorsContextMenu(QIStateIndicator *pIndicator, QContextMenuEvent *pEvent) 126 126 { 127 /* Show CD/DVD deviceLED context menu: */127 /* Show optical-disks LED context menu: */ 128 128 if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_OpticalDisks)) 129 129 { … … 131 131 gActionPool->action(UIActionIndexRuntime_Menu_OpticalDevices)->menu()->exec(pEvent->globalPos()); 132 132 } 133 /* Show floppy driveLED context menu: */133 /* Show floppy-disks LED context menu: */ 134 134 else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_FloppyDisks)) 135 135 { … … 137 137 gActionPool->action(UIActionIndexRuntime_Menu_FloppyDevices)->menu()->exec(pEvent->globalPos()); 138 138 } 139 /* Show USB deviceLED context menu: */140 else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_USB Devices))139 /* Show usb LED context menu: */ 140 else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_USB)) 141 141 { 142 142 if (gActionPool->action(UIActionIndexRuntime_Menu_USBDevices)->isEnabled()) 143 143 gActionPool->action(UIActionIndexRuntime_Menu_USBDevices)->menu()->exec(pEvent->globalPos()); 144 144 } 145 /* Show network adapterLED context menu: */146 else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_Network Adapters))145 /* Show network LED context menu: */ 146 else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_Network)) 147 147 { 148 148 if (gActionPool->action(UIActionIndexRuntime_Menu_Network)->isEnabled()) … … 171 171 void UIMachineWindowNormal::sltProcessGlobalSettingChange(const char * /* aPublicName */, const char * /* aName */) 172 172 { 173 /* Update host-combination LED: */173 /* Update host-combination status-bar label: */ 174 174 m_pNameHostkey->setText(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())); 175 175 } … … 247 247 this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*))); 248 248 249 /* USB Devices: */250 QIStateIndicator *pLedUSB Devices = indicatorsPool()->indicator(UIIndicatorIndex_USBDevices);251 pIndicatorBoxHLayout->addWidget(pLedUSB Devices);252 connect(pLedUSB Devices, SIGNAL(contextMenuRequested(QIStateIndicator*, QContextMenuEvent*)),249 /* USB: */ 250 QIStateIndicator *pLedUSB = indicatorsPool()->indicator(UIIndicatorIndex_USB); 251 pIndicatorBoxHLayout->addWidget(pLedUSB); 252 connect(pLedUSB, SIGNAL(contextMenuRequested(QIStateIndicator*, QContextMenuEvent*)), 253 253 this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*))); 254 254 255 /* Network Adapters: */256 QIStateIndicator *pLedNetwork Adapters = indicatorsPool()->indicator(UIIndicatorIndex_NetworkAdapters);257 pIndicatorBoxHLayout->addWidget(pLedNetwork Adapters);258 connect(pLedNetwork Adapters, SIGNAL(contextMenuRequested(QIStateIndicator*, QContextMenuEvent*)),255 /* Network: */ 256 QIStateIndicator *pLedNetwork = indicatorsPool()->indicator(UIIndicatorIndex_Network); 257 pIndicatorBoxHLayout->addWidget(pLedNetwork); 258 connect(pLedNetwork, SIGNAL(contextMenuRequested(QIStateIndicator*, QContextMenuEvent*)), 259 259 this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*))); 260 260 … … 271 271 this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*))); 272 272 273 /* Virtualization: */274 pIndicatorBoxHLayout->addWidget(indicatorsPool()->indicator(UIIndicatorIndex_ Virtualization));273 /* Features: */ 274 pIndicatorBoxHLayout->addWidget(indicatorsPool()->indicator(UIIndicatorIndex_Features)); 275 275 276 276 /* Separator: */ … … 285 285 this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*))); 286 286 287 /* Host Key: */287 /* Keyboard: */ 288 288 m_pCntHostkey = new QWidget; 289 289 QHBoxLayout *pHostkeyLedContainerLayout = new QHBoxLayout(m_pCntHostkey); … … 291 291 pHostkeyLedContainerLayout->setSpacing(3); 292 292 pIndicatorBoxHLayout->addWidget(m_pCntHostkey); 293 pHostkeyLedContainerLayout->addWidget(indicatorsPool()->indicator(UIIndicatorIndex_ Hostkey));293 pHostkeyLedContainerLayout->addWidget(indicatorsPool()->indicator(UIIndicatorIndex_Keyboard)); 294 294 m_pNameHostkey = new QLabel(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())); 295 295 pHostkeyLedContainerLayout->addWidget(m_pNameHostkey); … … 342 342 UIMachineWindow::prepareHandlers(); 343 343 344 /* Keyboard state-change updater: */345 connect(machineLogic()->keyboardHandler(), SIGNAL(keyboardStateChanged(int)), indicatorsPool()->indicator(UIIndicatorIndex_ Hostkey), SLOT(setState(int)));346 /* Mouse state-change updater: */344 /* Connect keyboard state-change handler: */ 345 connect(machineLogic()->keyboardHandler(), SIGNAL(keyboardStateChanged(int)), indicatorsPool()->indicator(UIIndicatorIndex_Keyboard), SLOT(setState(int))); 346 /* Connect mouse state-change handler: */ 347 347 connect(machineLogic()->mouseHandler(), SIGNAL(mouseStateChanged(int)), indicatorsPool()->indicator(UIIndicatorIndex_Mouse), SLOT(setState(int))); 348 /* Early initialize required connections: */349 indicatorsPool()->indicator(UIIndicatorIndex_ Hostkey)->setState(machineLogic()->keyboardHandler()->keyboardState());348 /* Early initialize created connections: */ 349 indicatorsPool()->indicator(UIIndicatorIndex_Keyboard)->setState(machineLogic()->keyboardHandler()->keyboardState()); 350 350 indicatorsPool()->indicator(UIIndicatorIndex_Mouse)->setState(machineLogic()->mouseHandler()->mouseState()); 351 351 } … … 436 436 { 437 437 /* Hide USB menu: */ 438 indicatorsPool()->indicator(UIIndicatorIndex_USB Devices)->setHidden(true);438 indicatorsPool()->indicator(UIIndicatorIndex_USB)->setHidden(true); 439 439 } 440 440 else 441 441 { 442 442 /* Toggle USB LED: */ 443 indicatorsPool()->indicator(UIIndicatorIndex_USB Devices)->setState(443 indicatorsPool()->indicator(UIIndicatorIndex_USB)->setState( 444 444 usbController.GetEnabled() ? KDeviceActivity_Idle : KDeviceActivity_Null); 445 445 } … … 572 572 indicatorsPool()->indicator(UIIndicatorIndex_FloppyDisks)->updateAppearance(); 573 573 if (iElement & UIVisualElement_NetworkStuff) 574 indicatorsPool()->indicator(UIIndicatorIndex_Network Adapters)->updateAppearance();574 indicatorsPool()->indicator(UIIndicatorIndex_Network)->updateAppearance(); 575 575 if (iElement & UIVisualElement_USBStuff && 576 !indicatorsPool()->indicator(UIIndicatorIndex_USB Devices)->isHidden())577 indicatorsPool()->indicator(UIIndicatorIndex_USB Devices)->updateAppearance();576 !indicatorsPool()->indicator(UIIndicatorIndex_USB)->isHidden()) 577 indicatorsPool()->indicator(UIIndicatorIndex_USB)->updateAppearance(); 578 578 if (iElement & UIVisualElement_SharedFolderStuff) 579 579 indicatorsPool()->indicator(UIIndicatorIndex_SharedFolders)->updateAppearance(); 580 580 if (iElement & UIVisualElement_VideoCapture) 581 581 indicatorsPool()->indicator(UIIndicatorIndex_VideoCapture)->updateAppearance(); 582 if (iElement & UIVisualElement_ VirtualizationStuff)583 indicatorsPool()->indicator(UIIndicatorIndex_ Virtualization)->updateAppearance();582 if (iElement & UIVisualElement_FeaturesStuff) 583 indicatorsPool()->indicator(UIIndicatorIndex_Features)->updateAppearance(); 584 584 } 585 585
Note:
See TracChangeset
for help on using the changeset viewer.