VirtualBox

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


Ignore:
Timestamp:
Mar 1, 2010 4:09:27 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: Initial multi-monitor support for normal mode: VM settings & processing using new running VM core.

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

Legend:

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

    r26890 r26921  
    203203{
    204204    if (machineLogic() &&
    205         machineLogic()->machineWindowWrapper() &&
    206         machineLogic()->machineWindowWrapper()->machineWindow())
    207         return machineLogic()->machineWindowWrapper()->machineWindow();
     205        machineLogic()->mainMachineWindow() &&
     206        machineLogic()->mainMachineWindow()->machineWindow())
     207        return machineLogic()->mainMachineWindow()->machineWindow();
    208208    else
    209209        return 0;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r26919 r26921  
    371371    , m_pActionsPool(pActionsPool)
    372372    , m_visualStateType(visualStateType)
    373     , m_pMachineWindowWrapper(0)
    374373    , m_pRunningActions(0)
    375374    , m_pRunningOrPausedActions(0)
     375    , m_fIsWindowsCreated(false)
    376376    , m_fIsPreventAutoStart(false)
    377377    , m_fIsPreventAutoClose(false)
     
    390390{
    391391    return uisession()->session();
     392}
     393
     394void UIMachineLogic::addMachineWindow(UIMachineWindow *pMachineWindow)
     395{
     396    m_machineWindowsList << pMachineWindow;
    392397}
    393398
     
    727732void UIMachineLogic::sltToggleGuestAutoresize(bool fEnabled)
    728733{
    729     /* Do not process if window or view is missing! */
    730     if (!machineWindowWrapper() || !machineWindowWrapper()->machineView())
     734    /* Do not process if window(s) missed! */
     735    if (!machineWindowsCreated())
    731736        return;
    732737
    733     machineWindowWrapper()->machineView()->setGuestAutoresizeEnabled(fEnabled);
     738    /* Toggle guest-autoresize feature for all view(s)! */
     739    foreach(UIMachineWindow *pMachineWindow, machineWindows())
     740        pMachineWindow->machineView()->setGuestAutoresizeEnabled(fEnabled);
    734741}
    735742
    736743void UIMachineLogic::sltAdjustWindow()
    737744{
    738     /* Do not process if window or view is missing! */
    739     if (!machineWindowWrapper() || !machineWindowWrapper()->machineView())
     745    /* Do not process if window(s) missed! */
     746    if (!machineWindowsCreated())
    740747        return;
    741748
    742     /* Exit maximized window state if actual: */
    743     if (machineWindowWrapper()->machineWindow()->isMaximized())
    744         machineWindowWrapper()->machineWindow()->showNormal();
    745 
    746     /* Normalize view's geometry: */
    747     machineWindowWrapper()->machineView()->normalizeGeometry(true);
     749    /* Adjust all window(s)! */
     750    foreach(UIMachineWindow *pMachineWindow, machineWindows())
     751    {
     752        /* Exit maximized window state if actual: */
     753        if (pMachineWindow->machineWindow()->isMaximized())
     754            pMachineWindow->machineWindow()->showNormal();
     755
     756        /* Normalize view's geometry: */
     757        pMachineWindow->machineView()->normalizeGeometry(true);
     758    }
    748759}
    749760
    750761void UIMachineLogic::sltToggleMouseIntegration(bool fOff)
    751762{
    752     /* Do not process if window or view is missing! */
    753     if (!machineWindowWrapper() || !machineWindowWrapper()->machineView())
     763    /* Do not process if window(s) missed! */
     764    if (!machineWindowsCreated())
    754765        return;
    755766
    756     /* Disable/Enable mouse-integration for view: */
    757     machineWindowWrapper()->machineView()->setMouseIntegrationEnabled(!fOff);
     767    /* Disable/Enable mouse-integration for all view(s): */
     768    foreach(UIMachineWindow *pMachineWindow, machineWindows())
     769        pMachineWindow->machineView()->setMouseIntegrationEnabled(!fOff);
    758770}
    759771
     
    785797void UIMachineLogic::sltTakeSnapshot()
    786798{
    787     /* Do not process if window is missing! */
    788     if (!machineWindowWrapper())
     799    /* Do not process if window(s) missed! */
     800    if (!machineWindowsCreated())
    789801        return;
    790802
     
    801813    CMachine machine = session().GetMachine();
    802814
    803     VBoxTakeSnapshotDlg dlg(machineWindowWrapper()->machineWindow(), machine);
     815    VBoxTakeSnapshotDlg dlg(mainMachineWindow()->machineWindow(), machine);
    804816
    805817    QString strTypeId = machine.GetOSTypeId();
     
    836848void UIMachineLogic::sltShowInformationDialog()
    837849{
    838     /* Do not process if window is missing! */
    839     if (!machineWindowWrapper())
     850    /* Do not process if window(s) missed! */
     851    if (!machineWindowsCreated())
    840852        return;
    841853
    842854    // TODO: Call for singleton information dialog for this machine!
    843     //VBoxVMInformationDlg::createInformationDlg(session(), machineWindowWrapper()->machineWindow());
     855    //VBoxVMInformationDlg::createInformationDlg(session(), mainMachineWindow()->machineWindow());
    844856}
    845857
     
    873885void UIMachineLogic::sltClose()
    874886{
    875     /* Do not process if window is missing! */
    876     if (!machineWindowWrapper())
     887    /* Do not process if window(s) missed! */
     888    if (!machineWindowsCreated())
    877889        return;
    878890
    879891    /* Close machine window: */
    880     machineWindowWrapper()->sltTryClose();
     892    mainMachineWindow()->sltTryClose();
    881893}
    882894
     
    10981110        }
    10991111        /* Open VMM Dialog: */
    1100         VBoxMediaManagerDlg dlg(machineWindowWrapper()->machineWindow());
     1112        VBoxMediaManagerDlg dlg(mainMachineWindow()->machineWindow());
    11011113        dlg.setup(target.type, true /* select? */, true /* refresh? */, machine, currentId, true, usedImages);
    11021114        if (dlg.exec() == QDialog::Accepted)
     
    12181230void UIMachineLogic::sltOpenNetworkAdaptersDialog()
    12191231{
    1220     /* Do not process if window is missing! */
    1221     if (!machineWindowWrapper())
     1232    /* Do not process if window(s) missed! */
     1233    if (!machineWindowsCreated())
    12221234        return;
    12231235
    12241236    /* Show network settings dialog: */
    1225     UINetworkAdaptersDialog dlg(machineWindowWrapper()->machineWindow(), session());
     1237    UINetworkAdaptersDialog dlg(mainMachineWindow()->machineWindow(), session());
    12261238    dlg.exec();
    12271239}
     
    12291241void UIMachineLogic::sltOpenSharedFoldersDialog()
    12301242{
    1231     /* Do not process if window is missing! */
    1232     if (!machineWindowWrapper())
     1243    /* Do not process if window(s) missed! */
     1244    if (!machineWindowsCreated())
    12331245        return;
    12341246
    12351247    /* Show shared folders settings dialog: */
    1236     UISharedFoldersDialog dlg(machineWindowWrapper()->machineWindow(), session());
     1248    UISharedFoldersDialog dlg(mainMachineWindow()->machineWindow(), session());
    12371249    dlg.exec();
    12381250}
     
    12481260void UIMachineLogic::sltInstallGuestAdditions()
    12491261{
    1250     /* Do not process if window is missing! */
    1251     if (!machineWindowWrapper())
     1262    /* Do not process if window(s) missed! */
     1263    if (!machineWindowsCreated())
    12521264        return;
    12531265
     
    14531465
    14541466    PFNDBGGUICREATE pfnGuiCreate;
    1455     int rc = RTLdrGetSymbol (hLdrMod, "DBGGuiCreate", (void**) &pfnGuiCreate);
    1456     if (RT_SUCCESS (rc))
     1467    int rc = RTLdrGetSymbol(hLdrMod, "DBGGuiCreate", (void**)&pfnGuiCreate);
     1468    if (RT_SUCCESS(rc))
    14571469    {
    14581470        ISession *pISession = session().raw();
    1459         rc = pfnGuiCreate (pISession, &m_dbgGui, &m_dbgGuiVT);
    1460         if (RT_SUCCESS (rc))
    1461         {
    1462             if (DBGGUIVT_ARE_VERSIONS_COMPATIBLE (m_dbgGuiVT->u32Version, DBGGUIVT_VERSION) ||
     1471        rc = pfnGuiCreate(pISession, &m_dbgGui, &m_dbgGuiVT);
     1472        if (RT_SUCCESS(rc))
     1473        {
     1474            if (DBGGUIVT_ARE_VERSIONS_COMPATIBLE(m_dbgGuiVT->u32Version, DBGGUIVT_VERSION) ||
    14631475                m_dbgGuiVT->u32EndVersion == m_dbgGuiVT->u32Version)
    14641476            {
    1465                 m_dbgGuiVT->pfnSetParent (m_dbgGui, (QWidget*) machineWindowWrapper());
    1466                 m_dbgGuiVT->pfnSetMenu (m_dbgGui, (QMenu*) actionsPool()->action(UIActionIndex_Menu_Debug));
     1477                m_dbgGuiVT->pfnSetParent(m_dbgGui, (QWidget*)mainMachineWindow());
     1478                m_dbgGuiVT->pfnSetMenu(m_dbgGui, (QMenu*)actionsPool()->action(UIActionIndex_Menu_Debug));
    14671479                dbgAdjustRelativePos();
    14681480                return true;
    14691481            }
    14701482
    1471             LogRel (("DBGGuiCreate failed, incompatible versions (loaded %#x/%#x, expected %#x)\n",
    1472                      m_dbgGuiVT->u32Version, m_dbgGuiVT->u32EndVersion, DBGGUIVT_VERSION));
     1483            LogRel(("DBGGuiCreate failed, incompatible versions (loaded %#x/%#x, expected %#x)\n",
     1484                    m_dbgGuiVT->u32Version, m_dbgGuiVT->u32EndVersion, DBGGUIVT_VERSION));
    14731485        }
    14741486        else
    1475             LogRel (("DBGGuiCreate failed, rc=%Rrc\n", rc));
     1487            LogRel(("DBGGuiCreate failed, rc=%Rrc\n", rc));
    14761488    }
    14771489    else
    1478         LogRel (("RTLdrGetSymbol(,\"DBGGuiCreate\",) -> %Rrc\n", rc));
     1490        LogRel(("RTLdrGetSymbol(,\"DBGGuiCreate\",) -> %Rrc\n", rc));
    14791491
    14801492    m_dbgGui = 0;
     
    14971509    if (m_dbgGui)
    14981510    {
    1499         QRect rct = machineWindowWrapper()->machineWindow()->frameGeometry();
     1511        QRect rct = mainMachineWindow()->machineWindow()->frameGeometry();
    15001512        m_dbgGuiVT->pfnAdjustRelativePos(m_dbgGui, rct.x(), rct.y(), rct.width(), rct.height());
    15011513    }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r26893 r26921  
    6262    UIActionsPool* actionsPool() { return m_pActionsPool; }
    6363    UIVisualStateType visualStateType() const { return m_visualStateType; }
    64     UIMachineWindow* machineWindowWrapper() { return m_pMachineWindowWrapper; }
     64    QList<UIMachineWindow*>& machineWindows() { return m_machineWindowsList; }
     65    UIMachineWindow* mainMachineWindow() { return machineWindows().size() > 0 ? machineWindows()[0] : 0; }
    6566
    6667    /* Maintenance getters/setters: */
     
    7980    virtual ~UIMachineLogic();
    8081
     82    /* Protected getters/setters: */
     83    bool machineWindowsCreated() const { return m_fIsWindowsCreated; }
     84    void setMachineWindowsCreated(bool fIsWindowsCreated) { m_fIsWindowsCreated = fIsWindowsCreated; }
     85
    8186    /* Protected wrappers: */
    8287    CSession& session();
    8388
    84     /* Protected setters: */
    85     void setMachineWindowWrapper(UIMachineWindow *pMachineWindowWrapper) { m_pMachineWindowWrapper = pMachineWindowWrapper; }
     89    /* Protected members: */
     90    void addMachineWindow(UIMachineWindow *pMachineWindow);
    8691
    8792    /* Prepare helpers: */
     
    152157    UIActionsPool *m_pActionsPool;
    153158    UIVisualStateType m_visualStateType;
    154     UIMachineWindow *m_pMachineWindowWrapper;
     159    QList<UIMachineWindow*> m_machineWindowsList;
    155160
    156161    QActionGroup *m_pRunningActions;
    157162    QActionGroup *m_pRunningOrPausedActions;
    158163
     164    bool m_fIsWindowsCreated : 1;
    159165    bool m_fIsPreventAutoStart : 1;
    160166    bool m_fIsPreventAutoClose : 1;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r26914 r26921  
    114114                                     , bool bAccelerate2DVideo
    115115#endif
    116                                      , UIVisualStateType visualStateType)
     116                                     , UIVisualStateType visualStateType
     117                                     , ulong uScreenId)
    117118{
    118119    UIMachineView *view = 0;
     
    125126                                           , bAccelerate2DVideo
    126127#endif
    127                                           );
     128                                           , uScreenId);
    128129            break;
    129130        case UIVisualStateType_Fullscreen:
     
    133134                                               , bAccelerate2DVideo
    134135#endif
    135                                               );
     136                                               , uScreenId);
    136137            break;
    137138        case UIVisualStateType_Seamless:
     
    141142                                           , bAccelerate2DVideo
    142143#endif
    143                                           );
     144                                           , uScreenId);
    144145            break;
    145146        default:
     
    185186}
    186187
    187 #include <QMainWindow>
    188188UIMachineView::UIMachineView(  UIMachineWindow *pMachineWindow
    189189                             , VBoxDefs::RenderMode renderMode
     
    191191                             , bool bAccelerate2DVideo
    192192#endif
    193                             )
     193                             , ulong uScreenId)
    194194// TODO_NEW_CORE: really think of if this is right
    195195//    : QAbstractScrollArea(((QMainWindow*)pMachineWindow->machineWindow())->centralWidget())
     
    198198    , m_pMachineWindow(pMachineWindow)
    199199    , m_mode(renderMode)
     200    , m_uScreenId(uScreenId)
    200201    , m_globalSettings(vboxGlobal().settings())
    201202    , m_pFrameBuffer(0)
     
    415416    {
    416417        m_pFrameBuffer->AddRef();
    417         display.SetFramebuffer(VBOX_VIDEO_PRIMARY_SCREEN, CFramebuffer(m_pFrameBuffer));
     418        display.SetFramebuffer(m_uScreenId, CFramebuffer(m_pFrameBuffer));
    418419    }
    419420}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r26889 r26921  
    6161                                 , bool bAccelerate2DVideo
    6262#endif
    63                                  , UIVisualStateType visualStateType);
     63                                 , UIVisualStateType visualStateType
     64                                 , ulong uScreenId);
    6465    static void destroy(UIMachineView *pWhichView);
    6566
     
    9697                  , bool bAccelerate2DVideo
    9798#endif
    98     );
     99                  , ulong uScreenId);
    99100    virtual ~UIMachineView();
    100101
     
    110111    int visibleHeight() const;
    111112    VBoxDefs::RenderMode mode() const { return m_mode; }
     113    ulong screenId() const { return m_uScreenId; }
    112114    UIFrameBuffer* frameBuffer() const { return m_pFrameBuffer; }
    113115    UIMachineWindow* machineWindowWrapper() const { return m_pMachineWindow; }
     
    223225    UIMachineWindow *m_pMachineWindow;
    224226    VBoxDefs::RenderMode m_mode;
     227    ulong m_uScreenId;
    225228    const VBoxGlobalSettings &m_globalSettings;
    226229    UIFrameBuffer *m_pFrameBuffer;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r26919 r26921  
    4141//#include "UIMachineWindowSeamless.h"
    4242
    43 UIMachineWindow* UIMachineWindow::create(UIMachineLogic *pMachineLogic, UIVisualStateType visualStateType)
     43UIMachineWindow* UIMachineWindow::create(UIMachineLogic *pMachineLogic, UIVisualStateType visualStateType, ulong uScreenId)
    4444{
    4545    UIMachineWindow *window = 0;
     
    4747    {
    4848        case UIVisualStateType_Normal:
    49             window = new UIMachineWindowNormal(pMachineLogic);
     49            window = new UIMachineWindowNormal(pMachineLogic, uScreenId);
    5050            break;
    5151        case UIVisualStateType_Fullscreen:
    52             window = new UIMachineWindowFullscreen(pMachineLogic);
     52            window = new UIMachineWindowFullscreen(pMachineLogic, uScreenId);
    5353            break;
    5454        case UIVisualStateType_Seamless:
    55             // window = new UIMachineWindowSeamless(pMachineLogic);
    56             window = new UIMachineWindowNormal(pMachineLogic);
     55            // window = new UIMachineWindowSeamless(pMachineLogic, uScreenId);
     56            window = new UIMachineWindowNormal(pMachineLogic, uScreenId);
    5757            break;
    5858    }
     
    8787}
    8888
    89 UIMachineWindow::UIMachineWindow(UIMachineLogic *pMachineLogic)
     89UIMachineWindow::UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId)
    9090    : m_pMachineLogic(pMachineLogic)
    9191    , m_pMachineWindow(0)
     92    , m_uScreenId(uScreenId)
    9293    , m_pMachineViewContainer(0)
    9394    , m_pTopSpacer(0)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r26919 r26921  
    4444
    4545    /* Factory function to create required machine window child: */
    46     static UIMachineWindow* create(UIMachineLogic *pMachineLogic, UIVisualStateType visualStateType);
     46    static UIMachineWindow* create(UIMachineLogic *pMachineLogic, UIVisualStateType visualStateType, ulong uScreenId = 0);
    4747    static void destroy(UIMachineWindow *pWhichWindow);
    4848
     
    5858
    5959    /* Machine window constructor/destructor: */
    60     UIMachineWindow(UIMachineLogic *pMachineLogic);
     60    UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId);
    6161    virtual ~UIMachineWindow();
    6262
     
    9696    QWidget *m_pMachineWindow;
    9797
     98    /* Virtual screen number: */
     99    ulong m_uScreenId;
     100
    98101    QGridLayout *m_pMachineViewContainer;
    99102    QSpacerItem *m_pTopSpacer;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r26919 r26921  
    965965qulonglong UISession::winId() const
    966966{
    967     return uimachine()->machineLogic()->machineWindowWrapper()->machineWindow()->winId();
     967    return uimachine()->machineLogic()->mainMachineWindow()->machineWindow()->winId();
    968968}
    969969
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r26889 r26921  
    139139{
    140140    /* Do not prepare window if its ready: */
    141     if (machineWindowWrapper())
     141    if (mainMachineWindow())
    142142        return;
    143143
     
    149149
    150150    /* Create machine window: */
    151     setMachineWindowWrapper(UIMachineWindow::create(this, visualStateType()));
     151    addMachineWindow(UIMachineWindow::create(this, visualStateType()));
    152152
    153153    /* If we are not started yet: */
     
    165165        if (uisession()->isFirstTimeStarted())
    166166        {
    167             UIFirstRunWzd wzd(machineWindowWrapper()->machineWindow(), machine);
     167            UIFirstRunWzd wzd(mainMachineWindow()->machineWindow(), machine);
    168168            wzd.exec();
    169169        }
     
    176176        {
    177177            vboxProblem().cannotStartMachine(console);
    178             machineWindowWrapper()->machineWindow()->close();
     178            mainMachineWindow()->machineWindow()->close();
    179179            return;
    180180        }
     
    185185        /* Show "Starting/Restoring" progress dialog: */
    186186        if (uisession()->isSaved())
    187             vboxProblem().showModalProgressDialog(progress, machine.GetName(), machineWindowWrapper()->machineWindow(), 0);
     187            vboxProblem().showModalProgressDialog(progress, machine.GetName(), mainMachineWindow()->machineWindow(), 0);
    188188        else
    189             vboxProblem().showModalProgressDialog(progress, machine.GetName(), machineWindowWrapper()->machineWindow());
     189            vboxProblem().showModalProgressDialog(progress, machine.GetName(), mainMachineWindow()->machineWindow());
    190190
    191191        /* Check for an progress failure */
     
    193193        {
    194194            vboxProblem().cannotStartMachine(progress);
    195             machineWindowWrapper()->machineWindow()->close();
     195            mainMachineWindow()->machineWindow()->close();
    196196            return;
    197197        }
     
    206206        if (uisession()->isTurnedOff())
    207207        {
    208             machineWindowWrapper()->machineWindow()->close();
     208            mainMachineWindow()->machineWindow()->close();
    209209            return;
    210210        }
     
    228228
    229229            if (!vboxGlobal().isStartPausedEnabled())
    230                 machineWindowWrapper()->machineView()->pause (false);
     230                mainMachineWindow()->machineView()->pause (false);
    231231        }
    232232# endif
     
    243243{
    244244    /* Do not cleanup machine window if it is not present: */
    245     if (!machineWindowWrapper())
     245    if (!mainMachineWindow())
    246246        return;
    247247
    248248    /* Cleanup machine window: */
    249     UIMachineWindow::destroy(machineWindowWrapper());
    250     setMachineWindowWrapper(0);
    251 }
    252 
     249    UIMachineWindow::destroy(mainMachineWindow());
     250}
     251
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r26889 r26921  
    3939
    4040UIMachineViewFullscreen::UIMachineViewFullscreen(  UIMachineWindow *pMachineWindow
    41                                          , VBoxDefs::RenderMode renderMode
     41                                                 , VBoxDefs::RenderMode renderMode
    4242#ifdef VBOX_WITH_VIDEOHWACCEL
    43                                          , bool bAccelerate2DVideo
     43                                                 , bool bAccelerate2DVideo
    4444#endif
    45                                         )
     45                                                 , ulong uMonitor)
    4646    : UIMachineView(  pMachineWindow
    4747                    , renderMode
     
    4949                    , bAccelerate2DVideo
    5050#endif
    51                    )
     51                    , uMonitor)
    5252    , m_bIsGuestAutoresizeEnabled(pMachineWindow->machineLogic()->actionsPool()->action(UIActionIndex_Toggle_GuestAutoresize)->isChecked())
    5353    , m_fShouldWeDoResize(false)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h

    r26889 r26921  
    4040    /* Normal machine view constructor/destructor: */
    4141    UIMachineViewFullscreen(  UIMachineWindow *pMachineWindow
    42                         , VBoxDefs::RenderMode renderMode
     42                            , VBoxDefs::RenderMode renderMode
    4343#ifdef VBOX_WITH_VIDEOHWACCEL
    44                         , bool bAccelerate2DVideo
     44                            , bool bAccelerate2DVideo
    4545#endif
    46     );
     46                            , ulong uMonitor);
    4747    virtual ~UIMachineViewFullscreen();
    4848
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r26919 r26921  
    4343#endif /* Q_WS_MAC */
    4444
    45 UIMachineWindowFullscreen::UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic)
     45UIMachineWindowFullscreen::UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId)
    4646    : QIWithRetranslateUI<QIMainDialog>(0)
    47     , UIMachineWindow(pMachineLogic)
     47    , UIMachineWindow(pMachineLogic, uScreenId)
    4848{
    4949    /* "This" is machine window: */
     
    283283                                           , bAccelerate2DVideo
    284284#endif
    285                                            , machineLogic()->visualStateType());
     285                                           , machineLogic()->visualStateType()
     286                                           , 0 /* Pass a primary screen id (0) for now! */);
    286287
    287288    /* Add machine view into layout: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r26919 r26921  
    5050
    5151    /* Normal machine window constructor/destructor: */
    52     UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic);
     52    UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId);
    5353    virtual ~UIMachineWindowFullscreen();
    5454
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r26895 r26921  
    5959
    6060        /* Prepare normal machine window: */
    61         prepareMachineWindow();
     61        prepareMachineWindows();
    6262
    6363        /* Initialization: */
     
    112112}
    113113
    114 void UIMachineLogicNormal::prepareMachineWindow()
    115 {
    116     /* Do not prepare window if its ready: */
    117     if (machineWindowWrapper())
     114void UIMachineLogicNormal::prepareMachineWindows()
     115{
     116    /* Get monitor count: */
     117    ulong uMonitorCount = session().GetMachine().GetMonitorCount();
     118
     119    /* Do not create window(s) if created already: */
     120    if ((ulong)machineWindows().size() == uMonitorCount)
    118121        return;
     122
     123    /* List should not be filled partially: */
     124    AssertMsg(machineWindows().size() == 0, ("Windows list is filled partially, something broken!\n"));
    119125
    120126#ifdef Q_WS_MAC
     
    124130#endif /* Q_WS_MAC */
    125131
    126     /* Create machine window: */
    127     setMachineWindowWrapper(UIMachineWindow::create(this, visualStateType()));
     132    /* Create machine window(s): */
     133    for (ulong uScreenId = 0; uScreenId < uMonitorCount; ++ uScreenId)
     134        addMachineWindow(UIMachineWindow::create(this, visualStateType(), uScreenId));
     135
     136    /* Notify others about machine window(s) created: */
     137    setMachineWindowsCreated(true);
    128138
    129139    /* If we are not started yet: */
     
    141151        if (uisession()->isFirstTimeStarted())
    142152        {
    143             UIFirstRunWzd wzd(machineWindowWrapper()->machineWindow(), machine);
     153            UIFirstRunWzd wzd(mainMachineWindow()->machineWindow(), machine);
    144154            wzd.exec();
    145155        }
     
    148158        CProgress progress = vboxGlobal().isStartPausedEnabled() || vboxGlobal().isDebuggerAutoShowEnabled() ?
    149159                             console.PowerUpPaused() : console.PowerUp();
    150         /* Check for an immediate failure */
     160
     161#if 0 // TODO: Check immediate failure!
     162        /* Check for an immediate failure: */
    151163        if (!console.isOk())
    152164        {
     
    158170        /* Disable auto-closure because we want to have a chance to show the error dialog on startup failure: */
    159171        setPreventAutoClose(true);
     172#endif
    160173
    161174        /* Show "Starting/Restoring" progress dialog: */
    162175        if (uisession()->isSaved())
    163             vboxProblem().showModalProgressDialog(progress, machine.GetName(), machineWindowWrapper()->machineWindow(), 0);
     176            vboxProblem().showModalProgressDialog(progress, machine.GetName(), mainMachineWindow()->machineWindow(), 0);
    164177        else
    165             vboxProblem().showModalProgressDialog(progress, machine.GetName(), machineWindowWrapper()->machineWindow());
    166 
     178            vboxProblem().showModalProgressDialog(progress, machine.GetName(), mainMachineWindow()->machineWindow());
     179
     180#if 0 // TODO: Check immediate failure!
    167181        /* Check for an progress failure */
    168182        if (progress.GetResultCode() != 0)
     
    173187        }
    174188
    175         /* Process pending events: */
    176         qApp->processEvents();
    177 
    178189        /* Enable auto-closure again: */
    179190        setPreventAutoClose(false);
     
    185196            return;
    186197        }
     198#endif
    187199
    188200#if 0 // TODO: Rework debugger logic!
     
    219231{
    220232    /* Do not cleanup machine window if it is not present: */
    221     if (!machineWindowWrapper())
     233    if (!machineWindowsCreated())
    222234        return;
    223235
    224236    /* Cleanup normal machine window: */
    225     UIMachineWindow::destroy(machineWindowWrapper());
    226     setMachineWindowWrapper(0);
    227 }
    228 
     237    foreach (UIMachineWindow *pMachineWindow, machineWindows())
     238        UIMachineWindow::destroy(pMachineWindow);
     239}
     240
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.h

    r26773 r26921  
    5353    /* Prepare helpers: */
    5454    void prepareActionConnections();
    55     void prepareMachineWindow();
     55    void prepareMachineWindows();
    5656
    5757    /* Cleanup helpers: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r26889 r26921  
    4343                                         , bool bAccelerate2DVideo
    4444#endif
    45                                         )
     45                                         , ulong uMonitor)
    4646    : UIMachineView(  pMachineWindow
    4747                    , renderMode
     
    4949                    , bAccelerate2DVideo
    5050#endif
    51                    )
     51                    , uMonitor)
    5252    , m_bIsGuestAutoresizeEnabled(pMachineWindow->machineLogic()->actionsPool()->action(UIActionIndex_Toggle_GuestAutoresize)->isChecked())
    5353    , m_fShouldWeDoResize(false)
     
    126126
    127127            /* Send new size-hint to the guest: */
    128             session().GetConsole().GetDisplay().SetVideoModeHint(newSize.width(), newSize.height(), 0, 0);
     128            session().GetConsole().GetDisplay().SetVideoModeHint(newSize.width(), newSize.height(), 0, screenId());
    129129        }
    130130        /* We had requested resize now, rejecting accident requests: */
     
    318318
    319319            /* Report to the VM thread that we finished resizing */
    320             session().GetConsole().GetDisplay().ResizeCompleted(0);
     320            session().GetConsole().GetDisplay().ResizeCompleted(screenId());
    321321
    322322            setMachineWindowResizeIgnored(oldIgnoreMainwndResize);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h

    r26889 r26921  
    4444                        , bool bAccelerate2DVideo
    4545#endif
    46     );
     46                        , ulong uMonitor);
    4747    virtual ~UIMachineViewNormal();
    4848
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r26919 r26921  
    4242#include "QIHotKeyEdit.h"
    4343
    44 UIMachineWindowNormal::UIMachineWindowNormal(UIMachineLogic *pMachineLogic)
     44UIMachineWindowNormal::UIMachineWindowNormal(UIMachineLogic *pMachineLogic, ulong uScreenId)
    4545    : QIWithRetranslateUI<QIMainDialog>(0)
    46     , UIMachineWindow(pMachineLogic)
     46    , UIMachineWindow(pMachineLogic, uScreenId)
    4747    , m_pIndicatorsPool(new UIIndicatorsPool(pMachineLogic->uisession()->session(), this))
    4848    , m_pIdleTimer(0)
     
    447447                                           , bAccelerate2DVideo
    448448#endif
    449                                            , machineLogic()->visualStateType());
     449                                           , machineLogic()->visualStateType()
     450                                           , m_uScreenId);
    450451
    451452    /* Add machine view into layout: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h

    r26878 r26921  
    4848
    4949    /* Normal machine window constructor/destructor: */
    50     UIMachineWindowNormal(UIMachineLogic *pMachineLogic);
     50    UIMachineWindowNormal(UIMachineLogic *pMachineLogic, ulong uScreenId);
    5151    virtual ~UIMachineWindowNormal();
    5252
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.cpp

    r26714 r26921  
    77
    88/*
    9  * Copyright (C) 2008-2009 Sun Microsystems, Inc.
     9 * Copyright (C) 2008-2010 Sun Microsystems, Inc.
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5656    const uint MinVRAM = sys.GetMinGuestVRAM();
    5757    const uint MaxVRAM = sys.GetMaxGuestVRAM();
     58    const uint MinMonitors = 1;
     59    const uint MaxMonitors = sys.GetMaxGuestMonitors();
    5860
    5961    /* Setup validators */
    6062    mLeMemory->setValidator (new QIntValidator (MinVRAM, MaxVRAM, this));
     63    mLeMonitors->setValidator (new QIntValidator (MinMonitors, MaxMonitors, this));
    6164    mLeVRDPPort->setValidator (new QRegExpValidator (QRegExp ("(([0-9]{1,5}(\\-[0-9]{1,5}){0,1}),)*([0-9]{1,5}(\\-[0-9]{1,5}){0,1})"), this));
    6265    mLeVRDPTimeout->setValidator (new QIntValidator (this));
    6366
    6467    /* Setup connections */
    65     connect (mSlMemory, SIGNAL (valueChanged (int)),
    66              this, SLOT (valueChangedVRAM (int)));
    67     connect (mLeMemory, SIGNAL (textChanged (const QString&)),
    68              this, SLOT (textChangedVRAM (const QString&)));
     68    connect (mSlMemory, SIGNAL (valueChanged (int)), this, SLOT (valueChangedVRAM (int)));
     69    connect (mLeMemory, SIGNAL (textChanged (const QString&)), this, SLOT (textChangedVRAM (const QString&)));
     70    connect (mSlMonitors, SIGNAL (valueChanged (int)), this, SLOT (valueChangedMonitors (int)));
     71    connect (mLeMonitors, SIGNAL (textChanged (const QString&)), this, SLOT (textChangedMonitors (const QString&)));
    6972
    7073    /* Setup initial values */
     
    7275    mSlMemory->setSingleStep (mSlMemory->pageStep() / 4);
    7376    mSlMemory->setTickInterval (mSlMemory->pageStep());
     77    mSlMonitors->setPageStep (1);
     78    mSlMonitors->setSingleStep (1);
     79    mSlMonitors->setTickInterval (1);
    7480    /* Setup the scale so that ticks are at page step boundaries */
    7581    mSlMemory->setMinimum ((MinVRAM / mSlMemory->pageStep()) * mSlMemory->pageStep());
     
    8086    mSlMemory->setWarningHint (1, needMBytes);
    8187    mSlMemory->setOptimalHint (needMBytes, MaxVRAM);
     88    mSlMonitors->setMinimum (MinMonitors);
     89    mSlMonitors->setMaximum (MaxMonitors);
     90    mSlMonitors->setSnappingEnabled (true);
    8291    /* Limit min/max. size of QLineEdit */
    8392    mLeMemory->setFixedWidthByText (QString().fill ('8', 4));
    84     /* Ensure mLeMemory value and validation is updated */
     93    mLeMonitors->setFixedWidthByText (QString().fill ('8', 4));
     94    /* Ensure value and validation is updated */
    8595    valueChangedVRAM (mSlMemory->value());
     96    valueChangedMonitors (mSlMonitors->value());
    8697    /* Setup VRDP widget */
    8798    mCbVRDPMethod->insertItem (0, ""); /* KVRDPAuthType_Null */
     
    115126    mSlMemory->setValue (mMachine.GetVRAMSize());
    116127
     128    /* Monitors Count */
     129    mSlMonitors->setValue (mMachine.GetMonitorCount());
     130
    117131    /* 3D Acceleration */
    118132    bool isAccelerationSupported = vboxGlobal().virtualBox().GetHost()
     
    147161    /* Memory Size */
    148162    mMachine.SetVRAMSize (mSlMemory->value());
     163
     164    /* Monitors Count */
     165    mMachine.SetMonitorCount (mSlMonitors->value());
    149166
    150167    /* 3D Acceleration */
     
    223240    setTabOrder (mTwDisplay->focusProxy(), mSlMemory);
    224241    setTabOrder (mSlMemory, mLeMemory);
    225     setTabOrder (mLeMemory, mCb3D);
     242    setTabOrder (mLeMemory, mSlMonitors);
     243    setTabOrder (mSlMonitors, mLeMonitors);
     244    setTabOrder (mLeMonitors, mCb3D);
    226245#ifdef VBOX_WITH_VIDEOHWACCEL
    227246    setTabOrder (mCb3D, mCb2DVideo);
     
    243262    mLbMemoryMin->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (sys.GetMinGuestVRAM()));
    244263    mLbMemoryMax->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (sys.GetMaxGuestVRAM()));
     264    mLbMonitorsMin->setText (tr ("<qt>%1</qt>").arg (1));
     265    mLbMonitorsMax->setText (tr ("<qt>%1</qt>").arg (sys.GetMaxGuestMonitors()));
    245266
    246267    mCbVRDPMethod->setItemText (0,
     
    262283}
    263284
     285void VBoxVMSettingsDisplay::valueChangedMonitors (int aVal)
     286{
     287    mLeMonitors->setText (QString().setNum (aVal));
     288}
     289
     290void VBoxVMSettingsDisplay::textChangedMonitors (const QString &aText)
     291{
     292    mSlMonitors->setValue (aText.toInt());
     293}
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.h

    r26163 r26921  
    66
    77/*
    8  * Copyright (C) 2008-2009 Sun Microsystems, Inc.
     8 * Copyright (C) 2008-2010 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5757    void valueChangedVRAM (int aVal);
    5858    void textChangedVRAM (const QString &aText);
     59    void valueChangedMonitors (int aVal);
     60    void textChangedMonitors (const QString &aText);
    5961
    6062private:
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.ui

    r26163 r26921  
    44 VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
    55
    6      Copyright (C) 2008-2009 Sun Microsystems, Inc.
     6     Copyright (C) 2008-2010 Sun Microsystems, Inc.
    77
    88     This file is part of VirtualBox Open Source Edition (OSE), as
     
    152152          </item>
    153153          <item row="2" column="0">
    154            <widget class="QLabel" name="mLbOptions">
    155             <property name="text">
    156              <string>Extended Features:</string>
     154           <widget class="QLabel" name="mLbMonitors">
     155            <property name="text">
     156             <string>Mo&amp;nitor Count:</string>
    157157            </property>
    158158            <property name="alignment">
    159159             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    160160            </property>
    161            </widget>
    162           </item>
    163           <item row="2" column="1" colspan="2">
     161            <property name="buddy">
     162             <cstring>mLeMonitors</cstring>
     163            </property>
     164           </widget>
     165          </item>
     166          <item row="2" column="1" rowspan="2">
     167           <layout class="QVBoxLayout" name="mLtMonitorsSlider">
     168            <property name="spacing">
     169             <number>0</number>
     170            </property>
     171            <item>
     172             <widget class="QIAdvancedSlider" name="mSlMonitors">
     173              <property name="whatsThis">
     174               <string>Controls the amount of virtual monitors provided to the virtual machine.</string>
     175              </property>
     176              <property name="orientation">
     177               <enum>Qt::Horizontal</enum>
     178              </property>
     179              <property name="tickPosition">
     180               <enum>QSlider::TicksBelow</enum>
     181              </property>
     182             </widget>
     183            </item>
     184            <item>
     185             <layout class="QHBoxLayout" name="mLtMonitorsLegend">
     186              <item>
     187               <widget class="QLabel" name="mLbMonitorsMin">
     188                <property name="sizePolicy">
     189                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
     190                  <horstretch>0</horstretch>
     191                  <verstretch>0</verstretch>
     192                 </sizepolicy>
     193                </property>
     194               </widget>
     195              </item>
     196              <item>
     197               <spacer name="mSpHor2">
     198                <property name="orientation">
     199                 <enum>Qt::Horizontal</enum>
     200                </property>
     201                <property name="sizeHint" stdset="0">
     202                 <size>
     203                  <width>0</width>
     204                  <height>0</height>
     205                 </size>
     206                </property>
     207               </spacer>
     208              </item>
     209              <item>
     210               <widget class="QLabel" name="mLbMonitorsMax">
     211                <property name="sizePolicy">
     212                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
     213                  <horstretch>0</horstretch>
     214                  <verstretch>0</verstretch>
     215                 </sizepolicy>
     216                </property>
     217                <property name="alignment">
     218                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     219                </property>
     220               </widget>
     221              </item>
     222             </layout>
     223            </item>
     224           </layout>
     225          </item>
     226          <item row="2" column="2">
     227           <layout class="QHBoxLayout" name="mLtMonitorsSize">
     228            <property name="spacing">
     229             <number>4</number>
     230            </property>
     231            <item>
     232             <widget class="QILineEdit" name="mLeMonitors">
     233              <property name="sizePolicy">
     234               <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
     235                <horstretch>0</horstretch>
     236                <verstretch>0</verstretch>
     237               </sizepolicy>
     238              </property>
     239              <property name="whatsThis">
     240               <string>Controls the amount of virtual monitors provided to the virtual machine.</string>
     241              </property>
     242             </widget>
     243            </item>
     244            <item>
     245             <widget class="QLabel" name="mLbMonitorsUnit"/>
     246            </item>
     247           </layout>
     248          </item>
     249                  <item row="4" column="0">
     250           <widget class="QLabel" name="mLbOptions">
     251            <property name="text">
     252             <string>Extended Features:</string>
     253            </property>
     254            <property name="alignment">
     255             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     256            </property>
     257           </widget>
     258          </item>
     259          <item row="4" column="1" colspan="2">
    164260           <widget class="QCheckBox" name="mCb3D">
    165261            <property name="sizePolicy">
     
    177273           </widget>
    178274          </item>
    179           <item row="3" column="1" colspan="2">
     275          <item row="5" column="1" colspan="2">
    180276           <widget class="QCheckBox" name="mCb2DVideo">
    181277            <property name="sizePolicy">
     
    257353             </property>
    258354             <item row="1" column="0" rowspan="3">
    259               <spacer name="mSpHor2">
     355              <spacer name="mSpHor3">
    260356               <property name="orientation">
    261357                <enum>Qt::Horizontal</enum>
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