VirtualBox

Changeset 68221 in vbox for trunk/src


Ignore:
Timestamp:
Aug 1, 2017 4:04:00 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8900: Selector UI: Machine Tools: Keep the currently opened tool while switching between machine items; A bit of corresponding API for both Machine and Global tools.

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

Legend:

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

    r68212 r68221  
    258258    if (pItem && pItem->accessible())
    259259    {
    260         /* Make sure Machine Tools-pane raised: */
    261         if (m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Details))
    262             m_pPaneToolsMachine->openTool(ToolTypeMachine_Details);
    263         else
    264         if (m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Snapshots))
    265             m_pPaneToolsMachine->openTool(ToolTypeMachine_Snapshots);
     260        /* If Desktop pane is chosen currently: */
     261        if (m_pPaneToolsMachine->currentTool() == ToolTypeMachine_Desktop)
     262        {
     263            /* Make sure Details or Snapshot pane is chosen if opened: */
     264            if (m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Details))
     265                m_pPaneToolsMachine->openTool(ToolTypeMachine_Details);
     266            else
     267            if (m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Snapshots))
     268                m_pPaneToolsMachine->openTool(ToolTypeMachine_Snapshots);
     269        }
    266270
    267271        /* Refresh Machine Tools-pane if requested: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneGlobal.cpp

    r68200 r68221  
    5252    /* Cleanup: */
    5353    cleanup();
     54}
     55
     56ToolTypeGlobal UIToolsPaneGlobal::currentTool() const
     57{
     58    return m_pLayout->currentWidget()->property("ToolType").value<ToolTypeGlobal>();
    5459}
    5560
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneGlobal.h

    r68200 r68221  
    5959    virtual ~UIToolsPaneGlobal() /* override */;
    6060
     61    /** Returns type of tool currently opened. */
     62    ToolTypeGlobal currentTool() const;
    6163    /** Returns whether tool of particular @a enmType is opened. */
    6264    bool isToolOpened(ToolTypeGlobal enmType) const;
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneMachine.cpp

    r68175 r68221  
    5252    /* Cleanup: */
    5353    cleanup();
     54}
     55
     56ToolTypeMachine UIToolsPaneMachine::currentTool() const
     57{
     58    return m_pLayout->currentWidget()->property("ToolType").value<ToolTypeMachine>();
    5459}
    5560
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneMachine.h

    r68175 r68221  
    7070    virtual ~UIToolsPaneMachine() /* override */;
    7171
     72    /** Returns type of tool currently opened. */
     73    ToolTypeMachine currentTool() const;
    7274    /** Returns whether tool of particular @a enmType is opened. */
    7375    bool isToolOpened(ToolTypeMachine enmType) const;
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