VirtualBox

Ignore:
Timestamp:
Aug 20, 2018 11:15:24 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: VirtualBox Manager UI: Split tool menu actions to the one which used in tool dialog and the one which used in main manager; that allows to control their visibility separately; handle actions visibility separately as well.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r73715 r73780  
    15991599
    16001600    /* Create 'Log Viewer' actions: */
     1601    m_pool[UIActionIndex_M_LogViewerWindow] = new UIActionMenuSelectorLog(this);
    16011602    m_pool[UIActionIndex_M_LogViewer] = new UIActionMenuSelectorLog(this);
    16021603    m_pool[UIActionIndex_M_LogViewer_T_Find] = new UIActionMenuSelectorLogTogglePaneFind(this);
     
    16131614#endif
    16141615    m_menuUpdateHandlers[UIActionIndex_Menu_Help].ptf = &UIActionPool::updateMenuHelp;
     1616    m_menuUpdateHandlers[UIActionIndex_M_LogViewerWindow].ptf = &UIActionPool::updateMenuLogViewerWindow;
    16151617    m_menuUpdateHandlers[UIActionIndex_M_LogViewer].ptf = &UIActionPool::updateMenuLogViewer;
    16161618
     
    18501852}
    18511853
     1854void UIActionPool::updateMenuLogViewerWindow()
     1855{
     1856    /* Update corresponding menu: */
     1857    updateMenuLogViewerWrapper(action(UIActionIndex_M_LogViewerWindow)->menu());
     1858
     1859    /* Mark menu as valid: */
     1860    m_invalidations.remove(UIActionIndex_M_LogViewerWindow);
     1861}
     1862
    18521863void UIActionPool::updateMenuLogViewer()
    18531864{
    1854     /* Get corresponding menu: */
    1855     UIMenu *pMenu = action(UIActionIndex_M_LogViewer)->menu();
    1856     AssertPtrReturnVoid(pMenu);
     1865    /* Update corresponding menu: */
     1866    updateMenuLogViewerWrapper(action(UIActionIndex_M_LogViewer)->menu());
     1867
     1868    /* Mark menu as valid: */
     1869    m_invalidations.remove(UIActionIndex_M_LogViewer);
     1870}
     1871
     1872void UIActionPool::updateMenuLogViewerWrapper(UIMenu *pMenu)
     1873{
    18571874    /* Clear contents: */
    18581875    pMenu->clear();
     
    18891906    /* 'Refresh' action: */
    18901907    fSeparator = addAction(pMenu, action(UIActionIndex_M_LogViewer_S_Refresh)) || fSeparator;;
    1891 
    1892     /* Mark menu as valid: */
    1893     m_invalidations.remove(UIActionIndex_M_LogViewer);
    18941908}
    18951909
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r73717 r73780  
    8989
    9090    /* 'Log Viewer' menu actions: */
     91    UIActionIndex_M_LogViewerWindow,
    9192    UIActionIndex_M_LogViewer,
    9293    UIActionIndex_M_LogViewer_T_Find,
     
    534535    /** Updates 'Help' menu. */
    535536    virtual void updateMenuHelp();
     537    /** Updates 'Log Viewer Window' menu. */
     538    virtual void updateMenuLogViewerWindow();
    536539    /** Updates 'Log Viewer' menu. */
    537540    virtual void updateMenuLogViewer();
     541    /** Updates 'Log Viewer' @a pMenu. */
     542    virtual void updateMenuLogViewerWrapper(UIMenu *pMenu);
    538543
    539544    /** Updates shortcuts. */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.cpp

    r73694 r73780  
    34273427
    34283428    /* 'Log Viewer' menu: */
    3429     updateMenuLogViewer();
     3429    updateMenuLogViewerWindow();
    34303430}
    34313431
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.cpp

    r73735 r73780  
    23602360
    23612361    /* Virtual Medium Manager actions: */
     2362    m_pool[UIActionIndexST_M_MediumWindow] = new UIActionMenuSelectorMedium(this);
    23622363    m_pool[UIActionIndexST_M_Medium] = new UIActionMenuSelectorMedium(this);
    23632364    m_pool[UIActionIndexST_M_Medium_S_Add] = new UIActionMenuSelectorMediumPerformAdd(this);
     
    23702371
    23712372    /* Host Network Manager actions: */
     2373    m_pool[UIActionIndexST_M_NetworkWindow] = new UIActionMenuSelectorNetwork(this);
    23722374    m_pool[UIActionIndexST_M_Network] = new UIActionMenuSelectorNetwork(this);
    23732375    m_pool[UIActionIndexST_M_Network_S_Create] = new UIActionMenuSelectorNetworkPerformCreate(this);
     
    23772379
    23782380    /* Prepare update-handlers for known menus: */
     2381    m_menuUpdateHandlers[UIActionIndexST_M_MediumWindow].ptfs = &UIActionPoolSelector::updateMenuMediumWindow;
    23792382    m_menuUpdateHandlers[UIActionIndexST_M_Medium].ptfs = &UIActionPoolSelector::updateMenuMedium;
     2383    m_menuUpdateHandlers[UIActionIndexST_M_NetworkWindow].ptfs = &UIActionPoolSelector::updateMenuNetworkWindow;
    23802384    m_menuUpdateHandlers[UIActionIndexST_M_Network].ptfs = &UIActionPoolSelector::updateMenuNetwork;
    23812385
     
    24002404
    24012405    /* 'Log Viewer' menu: */
     2406    updateMenuLogViewerWindow();
    24022407    updateMenuLogViewer();
    24032408
    24042409    /* 'Virtual Media Manager' menu: */
     2410    updateMenuMediumWindow();
    24052411    updateMenuMedium();
    24062412    /* 'Host Network Manager' menu: */
     2413    updateMenuNetworkWindow();
    24072414    updateMenuNetwork();
    24082415}
    24092416
     2417void UIActionPoolSelector::updateMenuMediumWindow()
     2418{
     2419    /* Update corresponding menu: */
     2420    updateMenuMediumWrapper(action(UIActionIndexST_M_MediumWindow)->menu());
     2421
     2422    /* Mark menu as valid: */
     2423    m_invalidations.remove(UIActionIndexST_M_MediumWindow);
     2424}
     2425
    24102426void UIActionPoolSelector::updateMenuMedium()
    24112427{
    2412     /* Get corresponding menu: */
    2413     UIMenu *pMenu = action(UIActionIndexST_M_Medium)->menu();
     2428    /* Update corresponding menu: */
     2429    updateMenuMediumWrapper(action(UIActionIndexST_M_Medium)->menu());
     2430
     2431    /* Mark menu as valid: */
     2432    m_invalidations.remove(UIActionIndexST_M_Medium);
     2433}
     2434
     2435void UIActionPoolSelector::updateMenuMediumWrapper(UIMenu *pMenu)
     2436{
    24142437    /* Clear contents: */
    24152438    pMenu->clear();
     
    24482471    /* 'Refresh' action: */
    24492472    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Medium_S_Refresh)) || fSeparator;;
     2473}
     2474
     2475void UIActionPoolSelector::updateMenuNetworkWindow()
     2476{
     2477    /* Update corresponding menu: */
     2478    updateMenuMediumWrapper(action(UIActionIndexST_M_NetworkWindow)->menu());
    24502479
    24512480    /* Mark menu as valid: */
    2452     m_invalidations.remove(UIActionIndexST_M_Medium);
     2481    m_invalidations.remove(UIActionIndexST_M_NetworkWindow);
    24532482}
    24542483
    24552484void UIActionPoolSelector::updateMenuNetwork()
    24562485{
    2457     /* Get corresponding menu: */
    2458     UIMenu *pMenu = action(UIActionIndexST_M_Network)->menu();
     2486    /* Update corresponding menu: */
     2487    updateMenuMediumWrapper(action(UIActionIndexST_M_Network)->menu());
     2488
     2489    /* Mark menu as valid: */
     2490    m_invalidations.remove(UIActionIndexST_M_Network);
     2491}
     2492
     2493void UIActionPoolSelector::updateMenuNetworkWrapper(UIMenu *pMenu)
     2494{
    24592495    /* Clear contents: */
    24602496    pMenu->clear();
     
    24872523//    /* 'Refresh' action: */
    24882524//    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Network_S_Refresh)) || fSeparator;;
    2489 
    2490     /* Mark menu as valid: */
    2491     m_invalidations.remove(UIActionIndexST_M_Network);
    24922525}
    24932526
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.h

    r73735 r73780  
    117117
    118118    /* Virtual Media Manager actions: */
     119    UIActionIndexST_M_MediumWindow,
    119120    UIActionIndexST_M_Medium,
    120121    UIActionIndexST_M_Medium_S_Add,
     
    127128
    128129    /* Host Network Manager actions: */
     130    UIActionIndexST_M_NetworkWindow,
    129131    UIActionIndexST_M_Network,
    130132    UIActionIndexST_M_Network_S_Create,
     
    159161    virtual void updateMenus() /* override */;
    160162
     163    /** Updates 'Medium' window menu. */
     164    void updateMenuMediumWindow();
    161165    /** Updates 'Medium' menu. */
    162166    void updateMenuMedium();
     167    /** Updates 'Medium' @a pMenu. */
     168    void updateMenuMediumWrapper(UIMenu *pMenu);
     169
     170    /** Updates 'Network' window menu. */
     171    void updateMenuNetworkWindow();
    163172    /** Updates 'Network' menu. */
    164173    void updateMenuNetwork();
     174    /** Updates 'Medium' @a pMenu. */
     175    void updateMenuNetworkWrapper(UIMenu *pMenu);
    165176
    166177    /** Updates shortcuts. */
  • trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.cpp

    r73738 r73780  
    209209QMenu *UIHostNetworkManagerWidget::menu() const
    210210{
    211     return m_pActionPool->action(UIActionIndexST_M_Network)->menu();
     211    return m_pActionPool->action(UIActionIndexST_M_NetworkWindow)->menu();
    212212}
    213213
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r73697 r73780  
    112112QMenu *UIVMLogViewerWidget::menu() const
    113113{
    114     return m_pActionPool->action(UIActionIndex_M_LogViewer)->menu();
     114    return m_pActionPool->action(UIActionIndex_M_LogViewerWindow)->menu();
    115115}
    116116
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r73738 r73780  
    20032003    /* Determine whether LogViewer actions should be visible: */
    20042004    const bool fLogViewerMenuShown = fMachineOrGroupMenuShown && m_pWidget->currentMachineTool() == ToolTypeMachine_LogViewer;
     2005    const bool fLogViewerActionsShown = fLogViewerMenuShown || !m_pWidget->isToolOpened(ToolTypeMachine_LogViewer);
    20052006    m_pLogViewerMenuAction->setVisible(fLogViewerMenuShown);
    20062007
    20072008    /* Determine whether VirtualMediaManager actions should be visible: */
    20082009    const bool fMediumMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == ToolTypeGlobal_VirtualMedia;
     2010    const bool fMediumActionsShown = fMediumMenuShown || !m_pWidget->isToolOpened(ToolTypeGlobal_VirtualMedia);
    20092011    m_pVirtualMediaManagerMenuAction->setVisible(fMediumMenuShown);
    20102012
    20112013    /* Determine whether HostNetworkManager actions should be visible: */
    20122014    const bool fNetworkMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == ToolTypeGlobal_HostNetwork;
     2015    const bool fNetworkActionsShown = fNetworkMenuShown || !m_pWidget->isToolOpened(ToolTypeGlobal_HostNetwork);
    20132016    m_pHostNetworkManagerMenuAction->setVisible(fNetworkMenuShown);
    20142017
     
    20292032        pAction->setVisible(fSnapshotMenuShown);
    20302033    foreach (UIAction *pAction, m_logViewerActions)
    2031         pAction->setVisible(fLogViewerMenuShown);
     2034        pAction->setVisible(fLogViewerActionsShown);
    20322035    foreach (UIAction *pAction, m_virtualMediaManagerActions)
    2033         pAction->setVisible(fMediumMenuShown);
     2036        pAction->setVisible(fMediumActionsShown);
    20342037    foreach (UIAction *pAction, m_hostNetworkManagerActions)
    2035         pAction->setVisible(fNetworkMenuShown);
     2038        pAction->setVisible(fNetworkActionsShown);
    20362039
    20372040    /* Show action shortcuts: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r73738 r73780  
    116116bool UIVirtualBoxManagerWidget::isToolOpened(ToolTypeMachine enmType) const
    117117{
    118     return m_pPaneToolsMachine->isToolOpened(enmType);
     118    return m_pPaneToolsMachine ? m_pPaneToolsMachine->isToolOpened(enmType) : false;
    119119}
    120120
    121121bool UIVirtualBoxManagerWidget::isToolOpened(ToolTypeGlobal enmType) const
    122122{
    123     return m_pPaneToolsGlobal->isToolOpened(enmType);
     123    return m_pPaneToolsGlobal ? m_pPaneToolsGlobal->isToolOpened(enmType) : false;
    124124}
    125125
     
    334334    /* Let the parent know: */
    335335    emit sigToolTypeChange();
     336
     337    /* Update toolbar: */
     338    updateToolbar();
    336339}
    337340
     
    348351    /* Let the parent know: */
    349352    emit sigToolTypeChange();
     353
     354    /* Update toolbar: */
     355    updateToolbar();
    350356}
    351357
     
    357363    /* Let the parent know: */
    358364    emit sigToolTypeChange();
     365
     366    /* Update toolbar: */
     367    updateToolbar();
    359368}
    360369
     
    366375    /* Let the parent know: */
    367376    emit sigToolTypeChange();
     377
     378    /* Update toolbar: */
     379    updateToolbar();
    368380}
    369381
     
    398410        m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    399411
    400         /* Add main actions block: */
    401         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_New));
    402         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Settings));
    403         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Discard));
    404         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow));
    405 
    406         /* Separator: */
    407         m_pToolBar->addSeparator();
    408 
    409         /* Add 'Snapshot' actions block: */
    410         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Take));
    411         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Delete));
    412         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Restore));
    413         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_T_Properties));
    414         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Clone));
    415 
    416         /* Add 'Log Viewer' actions block: */
    417         m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_S_Save));
    418         m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_T_Find));
    419         m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_T_Filter));
    420         m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_T_Bookmark));
    421         m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_T_Settings));
    422         m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_S_Refresh));
    423 
    424         /* Add 'Medium' actions block: */
    425         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Add));
    426         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Copy));
    427         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Move));
    428         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Remove));
    429         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Release));
    430         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_T_Details));
    431         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Refresh));
    432 
    433         /* Add 'Network' actions block: */
    434         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Network_S_Create));
    435         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Network_S_Remove));
    436         m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Network_T_Details));
    437 //        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Network_S_Refresh));
    438 
    439 #ifdef VBOX_WS_MAC
    440         // WORKAROUND:
    441         // Actually Qt should do that itself but by some unknown reason it sometimes
    442         // forget to update toolbar after changing its actions on Cocoa platform.
    443         connect(actionPool()->action(UIActionIndexST_M_Machine_S_New), &UIAction::changed,
    444                 m_pToolBar, static_cast<void(UIToolBar::*)(void)>(&UIToolBar::update));
    445         connect(actionPool()->action(UIActionIndexST_M_Machine_S_Settings), &UIAction::changed,
    446                 m_pToolBar, static_cast<void(UIToolBar::*)(void)>(&UIToolBar::update));
    447         connect(actionPool()->action(UIActionIndexST_M_Machine_S_Discard), &UIAction::changed,
    448                 m_pToolBar, static_cast<void(UIToolBar::*)(void)>(&UIToolBar::update));
    449         connect(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow), &UIAction::changed,
    450                 m_pToolBar, static_cast<void(UIToolBar::*)(void)>(&UIToolBar::update));
    451 
    452         // WORKAROUND:
    453         // There is a bug in Qt Cocoa which result in showing a "more arrow" when
    454         // the necessary size of the toolbar is increased. Also for some languages
    455         // the with doesn't match if the text increase. So manually adjust the size
    456         // after changing the text.
    457         m_pToolBar->updateLayout();
    458 #endif /* VBOX_WS_MAC */
     412        /* Update finally: */
     413        updateToolbar();
    459414    }
    460415}
     
    624579}
    625580
     581void UIVirtualBoxManagerWidget::updateToolbar()
     582{
     583    /* Make sure toolbar exists: */
     584    AssertPtrReturnVoid(m_pToolBar);
     585
     586    /* Clear initially: */
     587    m_pToolBar->clear();
     588
     589    /* Add main actions block: */
     590    m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_New));
     591    m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Settings));
     592    m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Discard));
     593    m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow));
     594
     595    /* Separator: */
     596    if (   isToolOpened(ToolTypeMachine_Snapshots)
     597        || isToolOpened(ToolTypeMachine_LogViewer)
     598        || isToolOpened(ToolTypeGlobal_VirtualMedia)
     599        || isToolOpened(ToolTypeGlobal_HostNetwork))
     600        m_pToolBar->addSeparator();
     601
     602    /* Add 'Snapshot' actions block: */
     603    if (isToolOpened(ToolTypeMachine_Snapshots))
     604    {
     605        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Take));
     606        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Delete));
     607        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Restore));
     608        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_T_Properties));
     609        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Clone));
     610    }
     611
     612    /* Add 'Log Viewer' actions block: */
     613    if (isToolOpened(ToolTypeMachine_LogViewer))
     614    {
     615        m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_S_Save));
     616        m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_T_Find));
     617        m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_T_Filter));
     618        m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_T_Bookmark));
     619        m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_T_Settings));
     620        m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_S_Refresh));
     621    }
     622
     623    /* Add 'Medium' actions block: */
     624    if (isToolOpened(ToolTypeGlobal_VirtualMedia))
     625    {
     626        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Add));
     627        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Copy));
     628        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Move));
     629        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Remove));
     630        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Release));
     631        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_T_Details));
     632        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Medium_S_Refresh));
     633    }
     634
     635    /* Add 'Network' actions block: */
     636    if (isToolOpened(ToolTypeGlobal_HostNetwork))
     637    {
     638        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Network_S_Create));
     639        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Network_S_Remove));
     640        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Network_T_Details));
     641//        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Network_S_Refresh));
     642    }
     643
     644#ifdef VBOX_WS_MAC
     645    // WORKAROUND:
     646    // Actually Qt should do that itself but by some unknown reason it sometimes
     647    // forget to update toolbar after changing its actions on Cocoa platform.
     648    connect(actionPool()->action(UIActionIndexST_M_Machine_S_New), &UIAction::changed,
     649            m_pToolBar, static_cast<void(UIToolBar::*)(void)>(&UIToolBar::update));
     650    connect(actionPool()->action(UIActionIndexST_M_Machine_S_Settings), &UIAction::changed,
     651            m_pToolBar, static_cast<void(UIToolBar::*)(void)>(&UIToolBar::update));
     652    connect(actionPool()->action(UIActionIndexST_M_Machine_S_Discard), &UIAction::changed,
     653            m_pToolBar, static_cast<void(UIToolBar::*)(void)>(&UIToolBar::update));
     654    connect(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow), &UIAction::changed,
     655            m_pToolBar, static_cast<void(UIToolBar::*)(void)>(&UIToolBar::update));
     656
     657    // WORKAROUND:
     658    // There is a bug in Qt Cocoa which result in showing a "more arrow" when
     659    // the necessary size of the toolbar is increased. Also for some languages
     660    // the with doesn't match if the text increase. So manually adjust the size
     661    // after changing the text.
     662    m_pToolBar->updateLayout();
     663#endif /* VBOX_WS_MAC */
     664}
     665
    626666void UIVirtualBoxManagerWidget::saveSettings()
    627667{
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r73676 r73780  
    167167        void loadSettings();
    168168
     169        /** Update toolbar. */
     170        void updateToolbar();
     171
    169172        /** Saves settings. */
    170173        void saveSettings();
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r73734 r73780  
    174174QMenu *UIMediumManagerWidget::menu() const
    175175{
    176     return m_pActionPool->action(UIActionIndexST_M_Medium)->menu();
     176    return m_pActionPool->action(UIActionIndexST_M_MediumWindow)->menu();
    177177}
    178178
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