VirtualBox

Changeset 52472 in vbox


Ignore:
Timestamp:
Aug 22, 2014 12:45:51 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95687
Message:

FE/Qt: 7462: Mac OS X: Runtime UI: Session: Menu-bar: Listen for configuration changes at runtime.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r52459 r52472  
    663663}
    664664
     665#ifdef RT_OS_DARWIN
     666void UISession::sltHandleMenuBarConfigurationChange()
     667{
     668    /* Update Mac OS X menu-bar: */
     669    updateMenu();
     670}
     671#endif /* RT_OS_DARWIN */
     672
    665673void UISession::sltMousePointerShapeChange(bool fVisible, bool fAlpha, QPoint hotCorner, QSize size, QVector<uint8_t> shape)
    666674{
     
    10701078    AssertPtrReturnVoid(m_pMenuBar);
    10711079    {
    1072         /* Prepare menu-bar: */
    1073         foreach (QMenu *pMenu, actionPool()->menus())
    1074             m_pMenuBar->addMenu(pMenu);
     1080        /* Configure Mac OS X menu-bar: */
     1081        connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange()),
     1082                this, SLOT(sltHandleMenuBarConfigurationChange()));
     1083        /* Update Mac OS X menu-bar: */
     1084        updateMenu();
    10751085    }
    10761086#endif /* Q_WS_MAC */
     
    12631273    UIActionPool::destroy(m_pActionPool);
    12641274}
     1275
     1276#ifdef Q_WS_MAC
     1277void UISession::updateMenu()
     1278{
     1279    /* Rebuild Mac OS X menu-bar: */
     1280    m_pMenuBar->clear();
     1281    foreach (QMenu *pMenu, actionPool()->menus())
     1282        m_pMenuBar->addMenu(pMenu);
     1283}
     1284#endif /* Q_WS_MAC */
    12651285
    12661286WId UISession::winId() const
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r52275 r52472  
    279279    void sltCloseRuntimeUI();
    280280
     281#ifdef RT_OS_DARWIN
     282    /** Mac OS X: Handles menu-bar configuration-change. */
     283    void sltHandleMenuBarConfigurationChange();
     284#endif /* RT_OS_DARWIN */
     285
    281286    /* Console events slots */
    282287    void sltMousePointerShapeChange(bool fVisible, bool fAlpha, QPoint hotCorner, QSize size, QVector<uint8_t> shape);
     
    322327    void cleanupConnections();
    323328    void cleanupActions();
     329
     330#ifdef Q_WS_MAC
     331    /** Mac OS X: Updates menu-bar content. */
     332    void updateMenu();
     333#endif /* Q_WS_MAC */
    324334
    325335    /* Common helpers: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r52471 r52472  
    115115}
    116116
     117#ifndef RT_OS_DARWIN
    117118void UIMachineWindowNormal::sltHandleMenuBarConfigurationChange()
    118119{
     
    120121    updateMenu();
    121122}
     123#endif /* !RT_OS_DARWIN */
    122124
    123125void UIMachineWindowNormal::sltHandleStatusBarConfigurationChange()
     
    508510}
    509511
     512#ifndef Q_WS_MAC
    510513void UIMachineWindowNormal::updateMenu()
    511514{
     
    515518        menuBar()->addMenu(pMenu);
    516519}
     520#endif /* !Q_WS_MAC */
    517521
    518522bool UIMachineWindowNormal::isMaximizedChecked()
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h

    r52471 r52472  
    5959    void sltCPUExecutionCapChange();
    6060
     61#ifndef RT_OS_DARWIN
    6162    /** Handles menu-bar configuration-change. */
    6263    void sltHandleMenuBarConfigurationChange();
     64#endif /* !RT_OS_DARWIN */
    6365
    6466    /** Handles status-bar configuration-change. */
     
    98100    void updateAppearanceOf(int aElement);
    99101
     102#ifndef Q_WS_MAC
    100103    /** Updates menu-bar content. */
    101104    void updateMenu();
     105#endif /* !Q_WS_MAC */
    102106
    103107    /* Event handler: */
Note: See TracChangeset for help on using the changeset viewer.

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