VirtualBox

Ignore:
Timestamp:
Jun 19, 2013 4:58:50 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
86573
Message:

FE/Qt: UI status-bar indicator-pool interface: Cleanup (part 3).

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  
    250250};
    251251
    252 class UIIndicatorNetworkAdapters : public QIStateIndicator
    253 {
    254     Q_OBJECT;
    255 
    256 public:
    257 
    258     UIIndicatorNetworkAdapters(CSession &session)
     252class UIIndicatorNetwork : public QIStateIndicator
     253{
     254    Q_OBJECT;
     255
     256public:
     257
     258    UIIndicatorNetwork(CSession &session)
    259259      : m_session(session)
    260260      , m_pUpdateTimer(new QTimer(this))
     
    356356};
    357357
    358 class UIIndicatorUSBDevices : public QIStateIndicator
    359 {
    360     Q_OBJECT;
    361 
    362 public:
    363 
    364     UIIndicatorUSBDevices(CSession &session)
     358class UIIndicatorUSB : public QIStateIndicator
     359{
     360    Q_OBJECT;
     361
     362public:
     363
     364    UIIndicatorUSB(CSession &session)
    365365      : m_session(session)
    366366    {
     
    579579};
    580580
    581 class UIIndicatorVirtualization : public QIStateIndicator
    582 {
    583     Q_OBJECT;
    584 
    585 public:
    586 
    587     UIIndicatorVirtualization(CSession &session)
     581class UIIndicatorFeatures : public QIStateIndicator
     582{
     583    Q_OBJECT;
     584
     585public:
     586
     587    UIIndicatorFeatures(CSession &session)
    588588      : m_session(session)
    589589    {
     
    705705};
    706706
    707 class UIIndicatorHostkey : public QIStateIndicator
    708 {
    709     Q_OBJECT;
    710 
    711 public:
    712 
    713     UIIndicatorHostkey(CSession &session)
     707class UIIndicatorKeyboard : public QIStateIndicator
     708{
     709    Q_OBJECT;
     710
     711public:
     712
     713    UIIndicatorKeyboard(CSession &session)
    714714      : m_session(session)
    715715    {
     
    737737    : QObject(pParent)
    738738    , m_session(session)
    739     , m_pool(UIIndicatorIndex_End)
     739    , m_pool(UIIndicatorIndex_Max)
    740740{
    741741    /* Prepare: */
     
    758758{
    759759    /* Populate indicator-pool: */
    760     for (int iIndex = 0; iIndex < UIIndicatorIndex_End; ++iIndex)
     760    for (int iIndex = 0; iIndex < UIIndicatorIndex_Max; ++iIndex)
    761761    {
    762762        /* Prepare indicator: */
     
    764764        switch (index)
    765765        {
    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_NetworkAdapters: m_pool[index] = new UIIndicatorNetworkAdapters(m_session); break;
    770             case UIIndicatorIndex_USBDevices:      m_pool[index] = new UIIndicatorUSBDevices(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_Virtualization:  m_pool[index] = new UIIndicatorVirtualization(m_session); break;
    774             case UIIndicatorIndex_Mouse:           m_pool[index] = new UIIndicatorMouse(m_session); break;
    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;
    776776            default: break;
    777777        }
     
    782782{
    783783    /* Wipe-out indicator-pool: */
    784     for (int iIndex = 0; iIndex < UIIndicatorIndex_End; ++iIndex)
     784    for (int iIndex = 0; iIndex < UIIndicatorIndex_Max; ++iIndex)
    785785    {
    786786        /* Wipe-out indicator: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.h

    r46677 r46680  
    3232    UIIndicatorIndex_OpticalDisks,
    3333    UIIndicatorIndex_FloppyDisks,
    34     UIIndicatorIndex_NetworkAdapters,
    35     UIIndicatorIndex_USBDevices,
     34    UIIndicatorIndex_Network,
     35    UIIndicatorIndex_USB,
    3636    UIIndicatorIndex_SharedFolders,
    3737    UIIndicatorIndex_VideoCapture,
    38     UIIndicatorIndex_Virtualization,
     38    UIIndicatorIndex_Features,
    3939    UIIndicatorIndex_Mouse,
    40     UIIndicatorIndex_Hostkey,
    41     UIIndicatorIndex_End
     40    UIIndicatorIndex_Keyboard,
     41    UIIndicatorIndex_Max
    4242};
    4343
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineDefs.h

    r46582 r46680  
    4545    UIVisualElement_SharedFolderStuff     = RT_BIT(8),
    4646    UIVisualElement_VideoCapture          = RT_BIT(9),
    47     UIVisualElement_VirtualizationStuff   = RT_BIT(10),
     47    UIVisualElement_FeaturesStuff         = RT_BIT(10),
    4848    UIVisualElement_MiniToolBar           = RT_BIT(11),
    4949    UIVisualElement_AllStuff              = 0xFFFF
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r46626 r46680  
    6161
    6262    /* Update pause and virtualization stuff: */
    63     updateAppearanceOf(UIVisualElement_PauseStuff | UIVisualElement_VirtualizationStuff);
     63    updateAppearanceOf(UIVisualElement_PauseStuff | UIVisualElement_FeaturesStuff);
    6464}
    6565
     
    109109{
    110110    /* Update virtualization stuff: */
    111     updateAppearanceOf(UIVisualElement_VirtualizationStuff);
     111    updateAppearanceOf(UIVisualElement_FeaturesStuff);
    112112}
    113113
    114114void UIMachineWindowNormal::sltUpdateIndicators()
    115115{
    116     /* Update LEDs: */
     116    /* Update indicators: */
    117117    updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_HardDisks), KDeviceType_HardDisk);
    118118    updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_OpticalDisks), KDeviceType_DVD);
    119119    updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_FloppyDisks), KDeviceType_Floppy);
    120     updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_USBDevices), KDeviceType_USB);
    121     updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_NetworkAdapters), KDeviceType_Network);
     120    updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_USB), KDeviceType_USB);
     121    updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_Network), KDeviceType_Network);
    122122    updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_SharedFolders), KDeviceType_SharedFolder);
    123123}
     
    125125void UIMachineWindowNormal::sltShowIndicatorsContextMenu(QIStateIndicator *pIndicator, QContextMenuEvent *pEvent)
    126126{
    127     /* Show CD/DVD device LED context menu: */
     127    /* Show optical-disks LED context menu: */
    128128    if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_OpticalDisks))
    129129    {
     
    131131            gActionPool->action(UIActionIndexRuntime_Menu_OpticalDevices)->menu()->exec(pEvent->globalPos());
    132132    }
    133     /* Show floppy drive LED context menu: */
     133    /* Show floppy-disks LED context menu: */
    134134    else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_FloppyDisks))
    135135    {
     
    137137            gActionPool->action(UIActionIndexRuntime_Menu_FloppyDevices)->menu()->exec(pEvent->globalPos());
    138138    }
    139     /* Show USB device LED context menu: */
    140     else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_USBDevices))
     139    /* Show usb LED context menu: */
     140    else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_USB))
    141141    {
    142142        if (gActionPool->action(UIActionIndexRuntime_Menu_USBDevices)->isEnabled())
    143143            gActionPool->action(UIActionIndexRuntime_Menu_USBDevices)->menu()->exec(pEvent->globalPos());
    144144    }
    145     /* Show network adapter LED context menu: */
    146     else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_NetworkAdapters))
     145    /* Show network LED context menu: */
     146    else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_Network))
    147147    {
    148148        if (gActionPool->action(UIActionIndexRuntime_Menu_Network)->isEnabled())
     
    171171void UIMachineWindowNormal::sltProcessGlobalSettingChange(const char * /* aPublicName */, const char * /* aName */)
    172172{
    173     /* Update host-combination LED: */
     173    /* Update host-combination status-bar label: */
    174174    m_pNameHostkey->setText(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo()));
    175175}
     
    247247            this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*)));
    248248
    249     /* USB Devices: */
    250     QIStateIndicator *pLedUSBDevices = indicatorsPool()->indicator(UIIndicatorIndex_USBDevices);
    251     pIndicatorBoxHLayout->addWidget(pLedUSBDevices);
    252     connect(pLedUSBDevices, SIGNAL(contextMenuRequested(QIStateIndicator*, QContextMenuEvent*)),
     249    /* USB: */
     250    QIStateIndicator *pLedUSB = indicatorsPool()->indicator(UIIndicatorIndex_USB);
     251    pIndicatorBoxHLayout->addWidget(pLedUSB);
     252    connect(pLedUSB, SIGNAL(contextMenuRequested(QIStateIndicator*, QContextMenuEvent*)),
    253253            this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*)));
    254254
    255     /* Network Adapters: */
    256     QIStateIndicator *pLedNetworkAdapters = indicatorsPool()->indicator(UIIndicatorIndex_NetworkAdapters);
    257     pIndicatorBoxHLayout->addWidget(pLedNetworkAdapters);
    258     connect(pLedNetworkAdapters, SIGNAL(contextMenuRequested(QIStateIndicator*, QContextMenuEvent*)),
     255    /* Network: */
     256    QIStateIndicator *pLedNetwork = indicatorsPool()->indicator(UIIndicatorIndex_Network);
     257    pIndicatorBoxHLayout->addWidget(pLedNetwork);
     258    connect(pLedNetwork, SIGNAL(contextMenuRequested(QIStateIndicator*, QContextMenuEvent*)),
    259259            this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*)));
    260260
     
    271271            this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*)));
    272272
    273     /* Virtualization: */
    274     pIndicatorBoxHLayout->addWidget(indicatorsPool()->indicator(UIIndicatorIndex_Virtualization));
     273    /* Features: */
     274    pIndicatorBoxHLayout->addWidget(indicatorsPool()->indicator(UIIndicatorIndex_Features));
    275275
    276276    /* Separator: */
     
    285285            this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*)));
    286286
    287     /* Host Key: */
     287    /* Keyboard: */
    288288    m_pCntHostkey = new QWidget;
    289289    QHBoxLayout *pHostkeyLedContainerLayout = new QHBoxLayout(m_pCntHostkey);
     
    291291    pHostkeyLedContainerLayout->setSpacing(3);
    292292    pIndicatorBoxHLayout->addWidget(m_pCntHostkey);
    293     pHostkeyLedContainerLayout->addWidget(indicatorsPool()->indicator(UIIndicatorIndex_Hostkey));
     293    pHostkeyLedContainerLayout->addWidget(indicatorsPool()->indicator(UIIndicatorIndex_Keyboard));
    294294    m_pNameHostkey = new QLabel(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo()));
    295295    pHostkeyLedContainerLayout->addWidget(m_pNameHostkey);
     
    342342    UIMachineWindow::prepareHandlers();
    343343
    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: */
    347347    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());
    350350    indicatorsPool()->indicator(UIIndicatorIndex_Mouse)->setState(machineLogic()->mouseHandler()->mouseState());
    351351}
     
    436436        {
    437437            /* Hide USB menu: */
    438             indicatorsPool()->indicator(UIIndicatorIndex_USBDevices)->setHidden(true);
     438            indicatorsPool()->indicator(UIIndicatorIndex_USB)->setHidden(true);
    439439        }
    440440        else
    441441        {
    442442            /* Toggle USB LED: */
    443             indicatorsPool()->indicator(UIIndicatorIndex_USBDevices)->setState(
     443            indicatorsPool()->indicator(UIIndicatorIndex_USB)->setState(
    444444                usbController.GetEnabled() ? KDeviceActivity_Idle : KDeviceActivity_Null);
    445445        }
     
    572572        indicatorsPool()->indicator(UIIndicatorIndex_FloppyDisks)->updateAppearance();
    573573    if (iElement & UIVisualElement_NetworkStuff)
    574         indicatorsPool()->indicator(UIIndicatorIndex_NetworkAdapters)->updateAppearance();
     574        indicatorsPool()->indicator(UIIndicatorIndex_Network)->updateAppearance();
    575575    if (iElement & UIVisualElement_USBStuff &&
    576         !indicatorsPool()->indicator(UIIndicatorIndex_USBDevices)->isHidden())
    577         indicatorsPool()->indicator(UIIndicatorIndex_USBDevices)->updateAppearance();
     576        !indicatorsPool()->indicator(UIIndicatorIndex_USB)->isHidden())
     577        indicatorsPool()->indicator(UIIndicatorIndex_USB)->updateAppearance();
    578578    if (iElement & UIVisualElement_SharedFolderStuff)
    579579        indicatorsPool()->indicator(UIIndicatorIndex_SharedFolders)->updateAppearance();
    580580    if (iElement & UIVisualElement_VideoCapture)
    581581        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();
    584584}
    585585
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette