VirtualBox

Changeset 68282 in vbox for trunk/src


Ignore:
Timestamp:
Aug 3, 2017 11:59:34 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8900: UISelectorWindow: Make sure no Machine tools opened at startup if no machines exists.

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

Legend:

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

    r68278 r68282  
    147147void UISelectorWindow::sltHandlePolishEvent()
    148148{
    149     // WORKAROUND:
    150     // By some reason some of X11 DEs unable to update()
    151     // tab-bars on startup.  Let's try to _create_ them instead.
    152     /* Make sure 'Details' and 'Snapshots' Machine tools ares opened at startup for now: */
    153     actionPool()->action(UIActionIndexST_M_Tools_M_Machine_Snapshots)->trigger();
    154     actionPool()->action(UIActionIndexST_M_Tools_M_Machine_Details)->trigger();
     149    /* Get current item: */
     150    UIVMItem *pItem = currentItem();
     151
     152    /* Make sure there is accessible VM item chosen: */
     153    if (pItem && pItem->accessible())
     154    {
     155        // WORKAROUND:
     156        // By some reason some of X11 DEs unable to update()
     157        // tab-bars on startup.  Let's try to _create_ them instead.
     158        /* Make sure 'Details' and 'Snapshots' Machine tools ares opened at startup for now: */
     159        actionPool()->action(UIActionIndexST_M_Tools_M_Machine_Snapshots)->trigger();
     160        actionPool()->action(UIActionIndexST_M_Tools_M_Machine_Details)->trigger();
     161    }
    155162}
    156163
     
    255262
    256263void UISelectorWindow::sltHandleChooserPaneIndexChange(bool fUpdateDetails /* = true */,
    257                                                        bool fUpdateTools /* = true */)
     264                                                       bool fUpdateSnapshots /* = true */)
    258265{
    259266    /* Get current item: */
     
    264271    /* Update action appearance: */
    265272    updateActionsAppearance();
    266 
    267     /* Update Details-pane: */
    268     if (   fUpdateDetails
    269         && m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Details))
    270         m_pPaneToolsMachine->setItems(currentItems());
    271273
    272274    /* If current item exists & accessible: */
     
    284286        }
    285287
    286         /* Refresh Machine Tools-pane if requested: */
    287         if (   fUpdateTools
     288        /* Update Details-pane (if requested): */
     289        if (   fUpdateDetails
     290            && m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Details))
     291            m_pPaneToolsMachine->setItems(currentItems());
     292        /* Update Snapshots-pane (if requested): */
     293        if (   fUpdateSnapshots
    288294            && m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Snapshots))
    289295            m_pPaneToolsMachine->setMachine(pItem->machine());
     
    321327        }
    322328
    323         /* Refresh Tools-pane in any case: */
     329        /* Update Details-pane (in any case): */
     330        if (m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Details))
     331            m_pPaneToolsMachine->setItems(currentItems());
     332        /* Update Snapshots-pane (in any case): */
    324333        if (m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Snapshots))
    325334            m_pPaneToolsMachine->setMachine(CMachine());
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h

    r68278 r68282  
    9191
    9292    /** Handles signal about Chooser-pane index change.
    93       * @param  fUpdateDetails  Brings whether details should be updated.
    94       * @param  fUpdateTools    Brings whether tools should be updated. */
     93      * @param  fUpdateDetails    Brings whether details should be updated.
     94      * @param  fUpdateSnapshots  Brings whether tools should be updated. */
    9595    void sltHandleChooserPaneIndexChange(bool fUpdateDetails = true,
    96                                          bool fUpdateTools = true);
     96                                         bool fUpdateSnapshots = true);
    9797
    9898    /** Handles signal about medium-enumeration finished. */
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