VirtualBox

Changeset 67110 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 26, 2017 9:58:07 AM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: Selector UI: Tools pane: A bit of additional API for integration needs.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/selector
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPane.cpp

    r67109 r67110  
    5757    /* Cleanup: */
    5858    cleanup();
     59}
     60
     61bool UIToolsPane::isToolOpened(ToolType enmType) const
     62{
     63    for (int iTabIndex = 0; iTabIndex < m_pTabBar->count(); ++iTabIndex)
     64        if (m_pTabBar->tabData(iTabIndex).value<ToolType>() == enmType)
     65            return true;
     66    return false;
     67}
     68
     69void UIToolsPane::setCurrentTool(ToolType enmType)
     70{
     71    activateTabBarTab(enmType, true);
    5972}
    6073
     
    360373            m_pTabBar->setTabData(iActualTabIndex, QVariant::fromValue(enmType));
    361374        }
     375
     376        /* Notify listeners: */
     377        emit sigToolOpened(enmType);
    362378    }
    363379
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPane.h

    r67109 r67110  
    5555    Q_OBJECT;
    5656
     57signals:
     58
     59    /** Notifies listeners about tool of particular @a enmType is opened. */
     60    void sigToolOpened(ToolType enmType);
     61
    5762public:
    5863
     
    6166    /** Destructs tools pane. */
    6267    virtual ~UIToolsPane() /* override */;
     68
     69    /** Returns whether tool of particular @a enmType is opened. */
     70    bool isToolOpened(ToolType enmType) const;
     71    /** Activates tool of particular @a enmType, creates new one if necessary. */
     72    void setCurrentTool(ToolType enmType);
    6373
    6474    /** Defines the @a comMachine object. */
Note: See TracChangeset for help on using the changeset viewer.

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