VirtualBox

Ignore:
Timestamp:
Feb 26, 2013 1:13:46 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Multi-screen support: Cleanup multi-screen layout (part 1).

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

Legend:

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

    r44529 r44828  
    77
    88/*
    9  * Copyright (C) 2010-2012 Oracle Corporation
     9 * Copyright (C) 2010-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4343    , m_pScreenMap(new QMap<int, int>())
    4444{
     45    /* Calculate host/guest screen count: */
    4546    CMachine machine = m_pMachineLogic->session().GetMachine();
    4647    /* Get host/guest monitor count: */
     
    6364}
    6465
    65 void UIMultiScreenLayout::initialize(QMenu *pMenu)
     66void UIMultiScreenLayout::setViewMenu(QMenu *pViewMenu)
    6667{
    6768    if (m_cHostScreens > 1)
    6869    {
    69         pMenu->addSeparator();
     70        pViewMenu->addSeparator();
    7071        for (int i = 0; i < m_cGuestScreens; ++i)
    7172        {
    72             m_screenMenuList << pMenu->addMenu(tr("Virtual Screen %1").arg(i + 1));
     73            m_screenMenuList << pViewMenu->addMenu(tr("Virtual Screen %1").arg(i + 1));
    7374            m_screenMenuList.last()->menuAction()->setData(true);
    7475            QActionGroup *pScreenGroup = new QActionGroup(m_screenMenuList.last());
     
    175176}
    176177
    177 int UIMultiScreenLayout::hostScreenForGuestScreen(int screenId) const
    178 {
    179     return m_pScreenMap->value(screenId, 0);
     178int UIMultiScreenLayout::hostScreenForGuestScreen(int iScreenId) const
     179{
     180    return m_pScreenMap->value(iScreenId, 0);
    180181}
    181182
     
    271272    /* On success inform the observer. */
    272273    if (fSuccess)
    273         emit screenLayoutChanged();
     274        emit sigScreenLayoutChanged();
    274275}
    275276
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.h

    r44529 r44828  
    66
    77/*
    8  * Copyright (C) 2010-2011 Oracle Corporation
     8 * Copyright (C) 2010-2013 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#define __UIMultiScreenLayout_h__
    2121
    22 /* Global includes */
     22/* Qt includes: */
    2323#include <QObject>
    2424
     25/* Forward declarations: */
    2526class UIMachineLogic;
    26 
    2727class QMenu;
    2828class QAction;
    2929template <class Key, class T> class QMap;
    3030
     31/* Multi-screen layout manager: */
    3132class UIMultiScreenLayout : public QObject
    3233{
    3334    Q_OBJECT;
    3435
     36signals:
     37
     38    /* Notifier: Layout change stuff: */
     39    void sigScreenLayoutChanged();
     40
    3541public:
     42
     43    /* Constructor/destructor: */
    3644    UIMultiScreenLayout(UIMachineLogic *pMachineLogic);
    3745    ~UIMultiScreenLayout();
    3846
    39     void initialize(QMenu *pMenu);
     47    /* API: View-menu stuff: */
     48    void setViewMenu(QMenu *pViewMenu);
     49
     50    /* API: Update stuff: */
    4051    void update();
     52
     53    /* API: Getters: */
    4154    int hostScreenCount() const;
    4255    int guestScreenCount() const;
    43     int hostScreenForGuestScreen(int screenId) const;
     56    int hostScreenForGuestScreen(int iScreenId) const;
    4457    quint64 memoryRequirements() const;
    4558    bool isHostTaskbarCovert() const;
    4659
    47 signals:
    48     void screenLayoutChanged();
    49 
    5060private slots:
    5161
     62    /* Handler: Screen change stuff: */
    5263    void sltScreenLayoutChanged(QAction *pAction);
    5364
    5465private:
    5566
     67    /* Other helpers: */
    5668    quint64 memoryRequirements(const QMap<int, int> *pScreenLayout) const;
    5769
    58     /* Private member vars */
     70    /* Variables: */
    5971    UIMachineLogic *m_pMachineLogic;
    60 
    6172    int m_cGuestScreens;
    6273    int m_cHostScreens;
    63 
    6474    QMap<int, int> *m_pScreenMap;
    6575    QList<QMenu*> m_screenMenuList;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r44825 r44828  
    128128    /* Add the view menu: */
    129129    QMenu *pMenu = gActionPool->action(UIActionIndexRuntime_Menu_View)->menu();
    130     m_pScreenLayout->initialize(pMenu);
     130    m_pScreenLayout->setViewMenu(pMenu);
    131131    pMenu->setVisible(true);
    132132}
     
    153153    /* Connect screen-layout change handler: */
    154154    for (int i = 0; i < machineWindows().size(); ++i)
    155         connect(m_pScreenLayout, SIGNAL(screenLayoutChanged()),
     155        connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()),
    156156                static_cast<UIMachineWindowFullscreen*>(machineWindows()[i]), SLOT(sltPlaceOnScreen()));
    157157
     
    159159    /* If the user change the screen, we have to decide again if the
    160160     * presentation mode should be changed. */
    161     connect(m_pScreenLayout, SIGNAL(screenLayoutChanged()),
     161    connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()),
    162162            this, SLOT(sltScreenLayoutChanged()));
    163163    /* Note: Presentation mode has to be set *after* the windows are created. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r44825 r44828  
    108108    /* Add the view menu: */
    109109    QMenu *pMenu = gActionPool->action(UIActionIndexRuntime_Menu_View)->menu();
    110     m_pScreenLayout->initialize(pMenu);
     110    m_pScreenLayout->setViewMenu(pMenu);
    111111    pMenu->setVisible(true);
    112112}
     
    133133    /* Connect screen-layout change handler: */
    134134    for (int i = 0; i < machineWindows().size(); ++i)
    135         connect(m_pScreenLayout, SIGNAL(screenLayoutChanged()),
     135        connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()),
    136136                static_cast<UIMachineWindowSeamless*>(machineWindows()[i]), SLOT(sltPlaceOnScreen()));
    137137
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