VirtualBox

Changeset 74320 in vbox for trunk/src


Ignore:
Timestamp:
Sep 17, 2018 5:45:41 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: VirtualBox Manager: Don't use actions to switch tools, do it directly; sync global <-> machine tools switch with actual tool loading, don't do these steps simultaneously.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r74305 r74320  
    21442144    actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->retranslateUi();
    21452145    actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->blockSignals(false);
    2146 
    2147     /* Enable/disable tools actions: */
    2148     actionPool()->action(UIActionIndexST_M_Tools_M_Machine)->setEnabled(isActionEnabled(UIActionIndexST_M_Tools_M_Machine, items));
    2149     actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S_Details)->setEnabled(isActionEnabled(UIActionIndexST_M_Tools_M_Machine_S_Details, items));
    2150     actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots)->setEnabled(isActionEnabled(UIActionIndexST_M_Tools_M_Machine_S_Snapshots, items));
    2151     actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S_LogViewer)->setEnabled(isActionEnabled(UIActionIndexST_M_Tools_M_Machine_S_LogViewer, items));
    21522146}
    21532147
     
    22762270        {
    22772271            return isActionEnabled(UIActionIndexST_M_Machine_M_Close, items);
    2278         }
    2279         case UIActionIndexST_M_Tools_M_Machine:
    2280         case UIActionIndexST_M_Tools_M_Machine_S_Details:
    2281         case UIActionIndexST_M_Tools_M_Machine_S_Snapshots:
    2282         case UIActionIndexST_M_Tools_M_Machine_S_LogViewer:
    2283         {
    2284             return pItem->accessible();
    22852272        }
    22862273        default:
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r74319 r74320  
    219219        && m_pStackedWidget->currentWidget() != m_pPaneToolsGlobal)
    220220    {
     221        /* Just start animation and return, do nothing else.. */
    221222        m_pStackedWidget->setCurrentWidget(m_pPaneToolsGlobal); // rendering w/a
    222223        m_pStackedWidget->setCurrentWidget(m_pSlidingAnimation);
    223224        m_pSlidingAnimation->animate(SlidingDirection_Reverse);
     225        return;
    224226    }
    225227
     
    228230    /* If machine or group item is selected and we are on global tools pane => switch to machine tools pane: */
    229231    if (   (isMachineItemSelected() || isGroupItemSelected())
    230         && m_pStackedWidget->currentWidget() != m_pPaneToolsMachine)
    231     {
     232             && m_pStackedWidget->currentWidget() != m_pPaneToolsMachine)
     233    {
     234        /* Just start animation and return, do nothing else.. */
    232235        m_pStackedWidget->setCurrentWidget(m_pPaneToolsMachine); // rendering w/a
    233236        m_pStackedWidget->setCurrentWidget(m_pSlidingAnimation);
    234237        m_pSlidingAnimation->animate(SlidingDirection_Forward);
     238        return;
    235239    }
    236240
     
    255259                /* Make sure Details or Snapshot pane is chosen if opened: */
    256260                if (m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Details))
    257                     actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S_Details)->trigger();
     261                    switchToTool(ToolTypeMachine_Details);
    258262                else
    259263                if (m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Snapshots))
    260                     actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots)->trigger();
     264                    switchToTool(ToolTypeMachine_Snapshots);
    261265                else
    262266                if (m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_LogViewer))
    263                     actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S_LogViewer)->trigger();
     267                    switchToTool(ToolTypeMachine_LogViewer);
    264268            }
    265269
     
    296300void UIVirtualBoxManagerWidget::sltHandleSlidingAnimationComplete(SlidingDirection enmDirection)
    297301{
     302    /* First switch the panes: */
    298303    switch (enmDirection)
    299304    {
     
    311316        }
    312317    }
     318    /* Then handle current item change (again!): */
     319    sltHandleChooserPaneIndexChangeDefault();
    313320}
    314321
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