VirtualBox

Changeset 52239 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 30, 2014 7:05:31 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: 7462: Runtime UI: Menu-bar, menu cleanup/rework (part 15).

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

Legend:

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

    r52238 r52239  
    1818/* GUI includes: */
    1919#include "UIActionPoolRuntime.h"
     20#include "UIMultiScreenLayout.h"
    2021#include "UIExtraDataManager.h"
    2122#include "UIShortcutPool.h"
     
    12621263    : UIActionPool(UIActionPoolType_Runtime, fTemporary)
    12631264    , m_pSession(0)
     1265    , m_pMultiScreenLayout(0)
    12641266{
    12651267}
     
    12711273}
    12721274
    1273 UISession* UIActionPoolRuntime::session() const
    1274 {
    1275     return m_pSession;
     1275void UIActionPoolRuntime::setMultiScreenLayout(UIMultiScreenLayout *pMultiScreenLayout)
     1276{
     1277    /* Disconnect old stuff: */
     1278    if (m_pMultiScreenLayout)
     1279    {
     1280        disconnect(this, SIGNAL(sigNotifyAboutTriggeringViewMultiscreen(int, int)),
     1281                   m_pMultiScreenLayout, SLOT(sltHandleScreenLayoutChange(int, int)));
     1282        disconnect(m_pMultiScreenLayout, SIGNAL(sigScreenLayoutUpdate()),
     1283                   this, SLOT(sltHandleScreenLayoutUpdate()));
     1284    }
     1285
     1286    /* Assign new multi-screen layout: */
     1287    m_pMultiScreenLayout = pMultiScreenLayout;
     1288
     1289    /* Connect new stuff: */
     1290    if (m_pMultiScreenLayout)
     1291    {
     1292        connect(this, SIGNAL(sigNotifyAboutTriggeringViewMultiscreen(int, int)),
     1293                m_pMultiScreenLayout, SLOT(sltHandleScreenLayoutChange(int, int)));
     1294        connect(m_pMultiScreenLayout, SIGNAL(sigScreenLayoutUpdate()),
     1295                this, SLOT(sltHandleScreenLayoutUpdate()));
     1296    }
     1297
     1298    /* Invalidate View menu: */
     1299    m_invalidations << UIActionIndexRT_M_View;
    12761300}
    12771301
     
    13581382}
    13591383
     1384void UIActionPoolRuntime::sltPrepareMenuViewMultiscreen()
     1385{
     1386    /* Make sure sender is valid: */
     1387    QMenu *pMenu = qobject_cast<QMenu*>(sender());
     1388    AssertPtrReturnVoid(pMenu);
     1389
     1390    /* Call to corresponding handler: */
     1391    updateMenuViewMultiscreen(pMenu);
     1392}
     1393
    13601394void UIActionPoolRuntime::sltHandleActionTriggerViewResize(QAction *pAction)
    13611395{
     
    13671401    const QSize size = pAction->property("Requested Size").toSize();
    13681402    emit sigNotifyAboutTriggeringViewResize(iGuestScreenIndex, size);
     1403}
     1404
     1405void UIActionPoolRuntime::sltHandleActionTriggerViewMultiscreen(QAction *pAction)
     1406{
     1407    /* Make sure sender is valid: */
     1408    AssertPtrReturnVoid(pAction);
     1409
     1410    /* Send request to remap guest-screen to required host-screen: */
     1411    const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
     1412    const int iHostScreenIndex = pAction->property("Host Screen Index").toInt();
     1413    emit sigNotifyAboutTriggeringViewMultiscreen(iGuestScreenIndex, iHostScreenIndex);
     1414}
     1415
     1416void UIActionPoolRuntime::sltHandleScreenLayoutUpdate()
     1417{
     1418    /* Invalidate View menu: */
     1419    m_invalidations << UIActionIndexRT_M_View;
    13691420}
    13701421
     
    19191970
    19201971
    1921     /* Do we have to show resize menu? */
     1972    /* Do we have to show resize or multiscreen menu? */
    19221973    const bool fAllowToShowActionResize = isAllowedInMenuView(RuntimeMenuViewActionType_Resize);
     1974    const bool fAllowToShowActionMultiscreen = isAllowedInMenuView(RuntimeMenuViewActionType_Multiscreen);
    19231975    if (fAllowToShowActionResize && session())
    19241976    {
     
    19301982            pSubMenu->setProperty("Guest Screen Index", iGuestScreenIndex);
    19311983            connect(pSubMenu, SIGNAL(aboutToShow()), this, SLOT(sltPrepareMenuViewResize()));
     1984        }
     1985    }
     1986    else if (fAllowToShowActionMultiscreen && multiScreenLayout())
     1987    {
     1988        /* Only if host/guest screen count differes from 1: */
     1989        if (session()->hostScreens().size() > 1 ||
     1990            session()->frameBuffers().size() > 1)
     1991        {
     1992            for (int iGuestScreenIndex = 0; iGuestScreenIndex < session()->frameBuffers().size(); ++iGuestScreenIndex)
     1993            {
     1994                /* Add 'Virtual Screen %1' menu: */
     1995                QMenu *pSubMenu = pMenu->addMenu(QApplication::translate("UIMultiScreenLayout",
     1996                                                                         "Virtual Screen %1").arg(iGuestScreenIndex + 1));
     1997                pSubMenu->setProperty("Guest Screen Index", iGuestScreenIndex);
     1998                connect(pSubMenu, SIGNAL(aboutToShow()), this, SLOT(sltPrepareMenuViewMultiscreen()));
     1999            }
    19322000        }
    19332001    }
     
    20772145}
    20782146
     2147void UIActionPoolRuntime::updateMenuViewMultiscreen(QMenu *pMenu)
     2148{
     2149    /* Make sure UI session defined: */
     2150    AssertPtrReturnVoid(multiScreenLayout());
     2151
     2152    /* Clear contents: */
     2153    pMenu->clear();
     2154
     2155    /* Get corresponding screen index and size: */
     2156    const int iGuestScreenIndex = pMenu->property("Guest Screen Index").toInt();
     2157
     2158    /* Create exclusive action-group: */
     2159    QActionGroup *pActionGroup = new QActionGroup(pMenu);
     2160    AssertPtrReturnVoid(pActionGroup);
     2161    {
     2162        /* Configure exclusive action-group: */
     2163        pActionGroup->setExclusive(true);
     2164        for (int iHostScreenIndex = 0; iHostScreenIndex < session()->hostScreens().size(); ++iHostScreenIndex)
     2165        {
     2166            QAction *pAction = pActionGroup->addAction(UIMultiScreenLayout::tr("Use Host Screen %1")
     2167                                                                               .arg(iHostScreenIndex + 1));
     2168            AssertPtrReturnVoid(pAction);
     2169            {
     2170                pAction->setCheckable(true);
     2171                pAction->setProperty("Guest Screen Index", iGuestScreenIndex);
     2172                pAction->setProperty("Host Screen Index", iHostScreenIndex);
     2173                if (multiScreenLayout()->hasHostScreenForGuestScreen(iGuestScreenIndex) &&
     2174                    multiScreenLayout()->hostScreenForGuestScreen(iGuestScreenIndex) == iHostScreenIndex)
     2175                    pAction->setChecked(true);
     2176            }
     2177        }
     2178        /* Insert group actions into menu: */
     2179        pMenu->addActions(pActionGroup->actions());
     2180        /* Install listener for exclusive action-group: */
     2181        connect(pActionGroup, SIGNAL(triggered(QAction*)),
     2182                this, SLOT(sltHandleActionTriggerViewMultiscreen(QAction*)));
     2183    }
     2184}
     2185
    20792186void UIActionPoolRuntime::updateMenuDevices()
    20802187{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h

    r52238 r52239  
    2828/* Forward declarations: */
    2929class UISession;
     30class UIMultiScreenLayout;
    3031
    3132/** Runtime action-pool index enum.
     
    122123    /** Notifies about 'View' : 'Resize' menu action trigger. */
    123124    void sigNotifyAboutTriggeringViewResize(int iGuestScreenIndex, const QSize &size);
     125    /** Notifies about 'View' : 'Multiscreen' menu action trigger. */
     126    void sigNotifyAboutTriggeringViewMultiscreen(int iGuestScreenIndex, int iHostScreenIndex);
    124127
    125128public:
     
    129132    void setSession(UISession *pSession);
    130133    /** Returns UI session object reference. */
    131     UISession* session() const;
     134    UISession* session() const { return m_pSession; }
     135
     136    /** Defines UI multi-screen layout object reference.
     137      * @note For menus which uses it to build contents. */
     138    void setMultiScreenLayout(UIMultiScreenLayout *pMultiScreenLayout);
     139    /** Returns UI multi-screen layout object reference. */
     140    UIMultiScreenLayout* multiScreenLayout() const { return m_pMultiScreenLayout; }
    132141
    133142    /** Returns whether the menu with passed @a type is allowed in menu-bar. */
     
    162171    /** Prepare 'View' : 'Resize' menu routine. */
    163172    void sltPrepareMenuViewResize();
     173    /** Prepare 'View' : 'Multiscreen' menu routine. */
     174    void sltPrepareMenuViewMultiscreen();
    164175
    165176    /** Handles 'View' : 'Resize' menu @a pAction trigger. */
    166177    void sltHandleActionTriggerViewResize(QAction *pAction);
     178    /** Handles 'View' : 'Multiscreen' menu @a pAction trigger. */
     179    void sltHandleActionTriggerViewMultiscreen(QAction *pAction);
     180
     181    /** Handles screen-layout update. */
     182    void sltHandleScreenLayoutUpdate();
    167183
    168184protected:
     
    199215    /** Update 'View' : 'Resize' @a pMenu routine. */
    200216    void updateMenuViewResize(QMenu *pMenu);
     217    /** Update 'View' : 'Multiscreen' @a pMenu routine. */
     218    void updateMenuViewMultiscreen(QMenu *pMenu);
    201219    /** Update 'Devices' menu routine. */
    202220    void updateMenuDevices();
     
    229247    /** Holds the UI session object reference. */
    230248    UISession *m_pSession;
     249    /** Holds the UI multi-screen layout object reference. */
     250    UIMultiScreenLayout *m_pMultiScreenLayout;
    231251
    232252    /** Holds the list of main-menus. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp

    r52202 r52239  
    4343UIMultiScreenLayout::UIMultiScreenLayout(UIMachineLogic *pMachineLogic)
    4444    : m_pMachineLogic(pMachineLogic)
    45     , m_pViewMenu(0)
    4645{
    4746    /* Calculate host/guest screen count: */
    4847    calculateHostMonitorCount();
    4948    calculateGuestScreenCount();
    50 }
    51 
    52 UIMultiScreenLayout::~UIMultiScreenLayout()
    53 {
    54     /* Cleanup view-menu: */
    55     cleanupViewMenu();
    56 }
    57 
    58 void UIMultiScreenLayout::setViewMenu(QMenu *pViewMenu)
    59 {
    60     /* Assign view-menu: */
    61     m_pViewMenu = pViewMenu;
    62     /* Prepare view-menu: */
    63     prepareViewMenu();
    6449}
    6550
     
    178163    }
    179164
    180     /* Update menu actions: */
    181     updateMenuActions(false);
     165    /* Notifies about layout update: */
     166    emit sigScreenLayoutUpdate();
    182167
    183168    LogRelFlow(("UIMultiScreenLayout::update: Finished!\n"));
     
    191176    calculateHostMonitorCount();
    192177    calculateGuestScreenCount();
    193     /* Update view-menu: */
    194     prepareViewMenu();
    195178    /* Update layout: */
    196179    update();
     
    242225}
    243226
    244 void UIMultiScreenLayout::sltScreenLayoutChanged(QAction *pAction)
    245 {
    246     /* Parse incoming information: */
    247     int a = pAction->data().toInt();
    248     int iRequestedGuestScreen = RT_LOWORD(a);
    249     int iRequestedHostScreen = RT_HIWORD(a);
    250 
     227void UIMultiScreenLayout::sltHandleScreenLayoutChange(int iRequestedGuestScreen, int iRequestedHostScreen)
     228{
    251229    /* Search for the virtual screen which is currently displayed on the
    252230     * requested host screen. When there is one found, we swap both. */
     
    282260    /* Swap the maps: */
    283261    m_screenMap = tmpMap;
    284     /* Update menu actions: */
    285     updateMenuActions(true);
    286     /* Inform the observer: */
    287     emit sigScreenLayoutChanged();
     262
     263    /* Save guest-to-host mapping: */
     264    saveScreenMapping();
     265
     266    /* Notifies about layout change: */
     267    emit sigScreenLayoutChange();
    288268}
    289269
     
    307287}
    308288
    309 void UIMultiScreenLayout::prepareViewMenu()
    310 {
    311     /* Make sure view-menu was set: */
    312     if (!m_pViewMenu)
    313         return;
    314 
    315     /* Cleanup menu first: */
    316     cleanupViewMenu();
    317 
    318     /* If we do have more than one host/guest screen: */
    319     if (m_cHostScreens > 1 || m_guestScreens.size() > 1)
    320     {
    321         m_pViewMenu->addSeparator();
    322         foreach (int iGuestScreen, m_guestScreens)
    323         {
    324             m_screenMenuList << m_pViewMenu->addMenu(tr("Virtual Screen %1").arg(iGuestScreen + 1));
    325             m_screenMenuList.last()->menuAction()->setData(true);
    326             QActionGroup *pScreenGroup = new QActionGroup(m_screenMenuList.last());
    327             pScreenGroup->setExclusive(true);
    328             connect(pScreenGroup, SIGNAL(triggered(QAction*)), this, SLOT(sltScreenLayoutChanged(QAction*)));
    329             for (int a = 0; a < m_cHostScreens; ++a)
    330             {
    331                 QAction *pAction = pScreenGroup->addAction(tr("Use Host Screen %1").arg(a + 1));
    332                 pAction->setCheckable(true);
    333                 pAction->setData(RT_MAKE_U32(iGuestScreen, a));
    334             }
    335             m_screenMenuList.last()->addActions(pScreenGroup->actions());
    336         }
    337     }
    338 
    339     /* Update menu actions: */
    340     updateMenuActions(false);
    341 }
    342 
    343 void UIMultiScreenLayout::cleanupViewMenu()
    344 {
    345     /* Make sure view-menu was set: */
    346     if (!m_pViewMenu)
    347         return;
    348 
    349     /* Cleanup view-menu actions: */
    350     while (!m_screenMenuList.isEmpty())
    351         delete m_screenMenuList.takeFirst();
    352 }
    353 
    354 void UIMultiScreenLayout::updateMenuActions(bool fWithSave)
    355 {
    356     /* Make sure view-menu was set: */
    357     if (!m_pViewMenu)
    358         return;
    359 
    360     /* Get the list of all view-menu actions: */
    361     QList<QAction*> viewMenuActions = m_pMachineLogic->actionPool()->action(UIActionIndexRT_M_View)->menu()->actions();
    362     /* Get the list of all view related actions: */
    363     QList<QAction*> viewActions;
    364     for (int i = 0; i < viewMenuActions.size(); ++i)
    365         if (viewMenuActions[i]->data().toBool())
    366             viewActions << viewMenuActions[i];
    367     /* Update view actions: */
    368     CMachine machine = m_pMachineLogic->session().GetMachine();
    369     for (int iViewAction = 0; iViewAction < viewActions.size(); ++iViewAction)
    370     {
    371         int iGuestScreen = m_guestScreens[iViewAction];
    372         int iHostScreen = m_screenMap.value(iGuestScreen, -1);
    373         if (fWithSave)
    374             gEDataManager->setHostScreenForPassedGuestScreen(iViewAction, iHostScreen, vboxGlobal().managedVMUuid());
    375         QList<QAction*> screenActions = viewActions.at(iViewAction)->menu()->actions();
    376         /* Update screen actions: */
    377         for (int j = 0; j < screenActions.size(); ++j)
    378         {
    379             QAction *pTmpAction = screenActions.at(j);
    380             pTmpAction->blockSignals(true);
    381             pTmpAction->setChecked(RT_HIWORD(pTmpAction->data().toInt()) == iHostScreen);
    382             pTmpAction->blockSignals(false);
    383         }
     289void UIMultiScreenLayout::saveScreenMapping()
     290{
     291    foreach (const int &iGuestScreen, m_guestScreens)
     292    {
     293        const int iHostScreen = m_screenMap.value(iGuestScreen, -1);
     294        gEDataManager->setHostScreenForPassedGuestScreen(iGuestScreen, iHostScreen, vboxGlobal().managedVMUuid());
    384295    }
    385296}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.h

    r45402 r52239  
    3636signals:
    3737
    38     /* Notifier: Layout change stuff: */
    39     void sigScreenLayoutChanged();
     38    /** Notifies about layout update. */
     39    void sigScreenLayoutUpdate();
     40    /** Notifies about layout change. */
     41    void sigScreenLayoutChange();
    4042
    4143public:
     
    4345    /* Constructor/destructor: */
    4446    UIMultiScreenLayout(UIMachineLogic *pMachineLogic);
    45     ~UIMultiScreenLayout();
    46 
    47     /* API: View-menu stuff: */
    48     void setViewMenu(QMenu *pViewMenu);
    4947
    5048    /* API: Update stuff: */
     
    6361
    6462    /* Handler: Screen change stuff: */
    65     void sltScreenLayoutChanged(QAction *pAction);
     63    void sltHandleScreenLayoutChange(int iRequestedGuestScreen, int iRequestedHostScreen);
    6664
    6765private:
     
    7068    void calculateHostMonitorCount();
    7169    void calculateGuestScreenCount();
    72     void prepareViewMenu();
    73 
    74     /* Helper: Cleanup stuff: */
    75     void cleanupViewMenu();
    7670
    7771    /* Other helpers: */
    78     void updateMenuActions(bool fWithSave);
     72    void saveScreenMapping();
    7973    quint64 memoryRequirements(const QMap<int, int> &screenLayout) const;
    8074
     
    8579    int m_cHostScreens;
    8680    QMap<int, int> m_screenMap;
    87     QMenu *m_pViewMenu;
    8881    QList<QMenu*> m_screenMenuList;
    8982};
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r52238 r52239  
    839839
    840840    /* Check if display count changed: */
    841     if (pDesktop->screenCount() != m_screens.size())
    842     {
    843         /* Recache display data: */
    844         recacheDisplayData();
     841    if (pDesktop->screenCount() != m_hostScreens.size())
     842    {
    845843        /* Reset watchdog: */
    846844        m_pWatchdogDisplayChange->setProperty("tryNumber", 0);
     
    853851        for (int iScreenIndex = 0; iScreenIndex < pDesktop->screenCount(); ++iScreenIndex)
    854852        {
    855             if (pDesktop->screenGeometry(iScreenIndex) != m_screens.at(iScreenIndex))
     853            if (pDesktop->screenGeometry(iScreenIndex) != m_hostScreens.at(iScreenIndex))
    856854            {
    857                 /* Recache display data: */
    858                 recacheDisplayData();
    859855                /* Reset watchdog: */
    860856                m_pWatchdogDisplayChange->setProperty("tryNumber", 0);
     
    885881    LogRelFlow(("UISession: Host-screen count changed.\n"));
    886882
     883    /* Recache display data: */
     884    updateHostScreenData();
     885
    887886    /* Notify current machine-logic: */
    888887    emit sigHostScreenCountChanged();
     
    892891{
    893892    LogRelFlow(("UISession: Host-screen geometry changed.\n"));
     893
     894    /* Recache display data: */
     895    updateHostScreenData();
    894896
    895897    /* Notify current machine-logic: */
     
    10881090void UISession::prepareScreens()
    10891091{
     1092    /* Recache display data: */
     1093    updateHostScreenData();
     1094
    10901095#ifdef Q_WS_MAC
    1091     /* Recache display data: */
    1092     recacheDisplayData();
    10931096    /* Prepare display-change watchdog: */
    10941097    m_pWatchdogDisplayChange = new QTimer(this);
     
    16211624}
    16221625
    1623 #ifdef Q_WS_MAC
    1624 /** MacOS X: Recaches display-configuration data. */
    1625 void UISession::recacheDisplayData()
    1626 {
    1627     /* Recache display data: */
    1628     m_screens.clear();
     1626void UISession::updateHostScreenData()
     1627{
     1628    m_hostScreens.clear();
    16291629    QDesktopWidget *pDesktop = QApplication::desktop();
    16301630    for (int iScreenIndex = 0; iScreenIndex < pDesktop->screenCount(); ++iScreenIndex)
    1631         m_screens << pDesktop->screenGeometry(iScreenIndex);
    1632 }
    1633 #endif /* Q_WS_MAC */
     1631        m_hostScreens << pDesktop->screenGeometry(iScreenIndex);
     1632}
    16341633
    16351634#ifdef VBOX_GUI_WITH_KEYS_RESET_HANDLER
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r52236 r52239  
    117117    /** @} */
    118118
     119    /** @name Host-screen configuration variables.
     120     ** @{ */
     121    /** Returns the list of host-screen geometries we currently have. */
     122    QList<QRect> hostScreens() const { return m_hostScreens; }
     123    /** @} */
     124
    119125    /** @name Application Close configuration stuff.
    120126     * @{ */
     
    315321    int countOfVisibleWindows();
    316322
    317 #ifdef Q_WS_MAC
    318     /* Helper: Display reconfiguration stuff: */
    319     void recacheDisplayData();
    320 #endif /* Q_WS_MAC */
     323    /** Update host-screen data. */
     324    void updateHostScreenData();
    321325
    322326    /* Private variables: */
     
    373377#endif
    374378
     379    /** @name Host-screen configuration variables.
     380     * @{ */
     381    /** Holds the list of host-screen geometries we currently have. */
     382    QList<QRect> m_hostScreens;
    375383#ifdef Q_WS_MAC
    376     /** @name MacOS X: Display reconfiguration variables.
    377      * @{ */
    378     /** MacOS X: Watchdog timer looking for display reconfiguration. */
     384    /** Mac OS X: Watchdog timer looking for display reconfiguration. */
    379385    QTimer *m_pWatchdogDisplayChange;
    380     /** MacOS X: A list of display geometries we currently have. */
    381     QList<QRect> m_screens;
    382     /** @} */
    383386#endif /* Q_WS_MAC */
     387    /** @} */
    384388
    385389    /** @name Application Close configuration variables.
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r52236 r52239  
    4747    /* Create multiscreen layout: */
    4848    m_pScreenLayout = new UIMultiScreenLayout(this);
     49    actionPool()->toRuntime()->setMultiScreenLayout(m_pScreenLayout);
    4950}
    5051
     
    5253{
    5354    /* Delete multiscreen layout: */
     55    actionPool()->toRuntime()->setMultiScreenLayout(0);
    5456    delete m_pScreenLayout;
    5557}
     
    503505    m_pScreenLayout->update();
    504506
    505     // TODO: Make this through action-pool.
    506     m_pScreenLayout->setViewMenu(actionPool()->action(UIActionIndexRT_M_View)->menu());
    507 
    508507    /* Create machine-window(s): */
    509508    for (uint cScreenId = 0; cScreenId < session().GetMachine().GetMonitorCount(); ++cScreenId)
     
    517516
    518517    /* Connect multi-screen layout change handler: */
    519     connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()),
     518    connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChange()),
    520519            this, SLOT(sltScreenLayoutChanged()));
    521520
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r52236 r52239  
    4646    /* Create multiscreen layout: */
    4747    m_pScreenLayout = new UIMultiScreenLayout(this);
     48    actionPool()->toRuntime()->setMultiScreenLayout(m_pScreenLayout);
    4849}
    4950
     
    5152{
    5253    /* Delete multiscreen layout: */
     54    actionPool()->toRuntime()->setMultiScreenLayout(0);
    5355    delete m_pScreenLayout;
    5456}
     
    251253    m_pScreenLayout->update();
    252254
    253     // TODO: Make this through action-pool.
    254     m_pScreenLayout->setViewMenu(actionPool()->action(UIActionIndexRT_M_View)->menu());
    255 
    256255    /* Create machine-window(s): */
    257256    for (uint cScreenId = 0; cScreenId < session().GetMachine().GetMonitorCount(); ++cScreenId)
     
    265264
    266265    /* Connect multi-screen layout change handler: */
    267     connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()),
     266    connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChange()),
    268267            this, SLOT(sltScreenLayoutChanged()));
    269268
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