VirtualBox

Changeset 26926 in vbox


Ignore:
Timestamp:
Mar 1, 2010 10:19:43 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: New running VM core: cumulative fix for mm-support.

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

Legend:

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

    r26921 r26926  
    363363}
    364364
     365UIMachineWindow* UIMachineLogic::mainMachineWindow()
     366{
     367    /* Return null if windows are not created yet: */
     368    if (!isMachineWindowsCreated())
     369        return 0;
     370
     371    return machineWindows()[0];
     372}
     373
     374UIMachineWindow* UIMachineLogic::defaultMachineWindow()
     375{
     376    /* Return null if windows are not created yet: */
     377    if (!isMachineWindowsCreated())
     378        return 0;
     379
     380    /* Select main machine window by default: */
     381    UIMachineWindow *pWindowToPropose = mainMachineWindow();
     382
     383    /* Check if there is active window present: */
     384    foreach (UIMachineWindow *pWindowToCheck, machineWindows())
     385    {
     386        if (pWindowToCheck->machineWindow()->isActiveWindow())
     387        {
     388            pWindowToPropose = pWindowToCheck;
     389            break;
     390        }
     391    }
     392
     393    /* Return default machine window: */
     394    return pWindowToPropose;
     395}
     396
    365397UIMachineLogic::UIMachineLogic(QObject *pParent,
    366398                               UISession *pSession,
     
    703735    /* Variable falgs: */
    704736    bool fIsMouseSupportsAbsolute = uisession()->isMouseSupportsAbsolute();
    705     /* bool fIsMouseSupportsRelative = uisession()->isMouseSupportsRelative(); */
     737    bool fIsMouseSupportsRelative = uisession()->isMouseSupportsRelative();
    706738    bool fIsMouseHostCursorNeeded = uisession()->isMouseHostCursorNeeded();
    707739
    708740    /* Update action state: */
    709741    QAction *pAction = actionsPool()->action(UIActionIndex_Toggle_MouseIntegration);
    710     pAction->setEnabled(fIsMouseSupportsAbsolute /* && fIsMouseSupportsRelative */ && !fIsMouseHostCursorNeeded);
     742    pAction->setEnabled(fIsMouseSupportsAbsolute && fIsMouseSupportsRelative && !fIsMouseHostCursorNeeded);
    711743    pAction->setChecked(fIsMouseHostCursorNeeded || pAction->isChecked());
    712744}
     
    733765{
    734766    /* Do not process if window(s) missed! */
    735     if (!machineWindowsCreated())
     767    if (!isMachineWindowsCreated())
    736768        return;
    737769
     
    744776{
    745777    /* Do not process if window(s) missed! */
    746     if (!machineWindowsCreated())
     778    if (!isMachineWindowsCreated())
    747779        return;
    748780
     
    762794{
    763795    /* Do not process if window(s) missed! */
    764     if (!machineWindowsCreated())
     796    if (!isMachineWindowsCreated())
    765797        return;
    766798
     
    798830{
    799831    /* Do not process if window(s) missed! */
    800     if (!machineWindowsCreated())
     832    if (!isMachineWindowsCreated())
    801833        return;
    802834
     
    813845    CMachine machine = session().GetMachine();
    814846
    815     VBoxTakeSnapshotDlg dlg(mainMachineWindow()->machineWindow(), machine);
     847    VBoxTakeSnapshotDlg dlg(defaultMachineWindow()->machineWindow(), machine);
    816848
    817849    QString strTypeId = machine.GetOSTypeId();
     
    848880void UIMachineLogic::sltShowInformationDialog()
    849881{
    850     /* Do not process if window(s) missed! */
    851     if (!machineWindowsCreated())
    852         return;
    853 
    854882    // TODO: Call for singleton information dialog for this machine!
    855     //VBoxVMInformationDlg::createInformationDlg(session(), mainMachineWindow()->machineWindow());
     883    //VBoxVMInformationDlg::createInformationDlg(session());
    856884}
    857885
     
    886914{
    887915    /* Do not process if window(s) missed! */
    888     if (!machineWindowsCreated())
     916    if (!isMachineWindowsCreated())
    889917        return;
    890918
    891     /* Close machine window: */
    892     mainMachineWindow()->sltTryClose();
     919    /* Propose to close default machine window: */
     920    defaultMachineWindow()->sltTryClose();
    893921}
    894922
     
    11101138        }
    11111139        /* Open VMM Dialog: */
    1112         VBoxMediaManagerDlg dlg(mainMachineWindow()->machineWindow());
     1140        VBoxMediaManagerDlg dlg(defaultMachineWindow()->machineWindow());
    11131141        dlg.setup(target.type, true /* select? */, true /* refresh? */, machine, currentId, true, usedImages);
    11141142        if (dlg.exec() == QDialog::Accepted)
     
    12311259{
    12321260    /* Do not process if window(s) missed! */
    1233     if (!machineWindowsCreated())
     1261    if (!isMachineWindowsCreated())
    12341262        return;
    12351263
    12361264    /* Show network settings dialog: */
    1237     UINetworkAdaptersDialog dlg(mainMachineWindow()->machineWindow(), session());
     1265    UINetworkAdaptersDialog dlg(defaultMachineWindow()->machineWindow(), session());
    12381266    dlg.exec();
    12391267}
     
    12421270{
    12431271    /* Do not process if window(s) missed! */
    1244     if (!machineWindowsCreated())
     1272    if (!isMachineWindowsCreated())
    12451273        return;
    12461274
    12471275    /* Show shared folders settings dialog: */
    1248     UISharedFoldersDialog dlg(mainMachineWindow()->machineWindow(), session());
     1276    UISharedFoldersDialog dlg(defaultMachineWindow()->machineWindow(), session());
    12491277    dlg.exec();
    12501278}
     
    12611289{
    12621290    /* Do not process if window(s) missed! */
    1263     if (!machineWindowsCreated())
     1291    if (!isMachineWindowsCreated())
    12641292        return;
    12651293
     
    14751503                m_dbgGuiVT->u32EndVersion == m_dbgGuiVT->u32Version)
    14761504            {
    1477                 m_dbgGuiVT->pfnSetParent(m_dbgGui, (QWidget*)mainMachineWindow());
     1505                m_dbgGuiVT->pfnSetParent(m_dbgGui, (QWidget*)defaultMachineWindow());
    14781506                m_dbgGuiVT->pfnSetMenu(m_dbgGui, (QMenu*)actionsPool()->action(UIActionIndex_Menu_Debug));
    14791507                dbgAdjustRelativePos();
     
    15091537    if (m_dbgGui)
    15101538    {
    1511         QRect rct = mainMachineWindow()->machineWindow()->frameGeometry();
     1539        QRect rct = defaultMachineWindow()->machineWindow()->frameGeometry();
    15121540        m_dbgGuiVT->pfnAdjustRelativePos(m_dbgGui, rct.x(), rct.y(), rct.width(), rct.height());
    15131541    }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r26921 r26926  
    6363    UIVisualStateType visualStateType() const { return m_visualStateType; }
    6464    QList<UIMachineWindow*>& machineWindows() { return m_machineWindowsList; }
    65     UIMachineWindow* mainMachineWindow() { return machineWindows().size() > 0 ? machineWindows()[0] : 0; }
     65    UIMachineWindow* mainMachineWindow();
     66    UIMachineWindow* defaultMachineWindow();
    6667
    6768    /* Maintenance getters/setters: */
     
    8182
    8283    /* Protected getters/setters: */
    83     bool machineWindowsCreated() const { return m_fIsWindowsCreated; }
     84    bool isMachineWindowsCreated() const { return m_fIsWindowsCreated; }
    8485    void setMachineWindowsCreated(bool fIsWindowsCreated) { m_fIsWindowsCreated = fIsWindowsCreated; }
    8586
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r26921 r26926  
    402402            strMachineName += " [" + vboxGlobal().toString(state) + "] - ";
    403403        strMachineName += m_strWindowTitlePrefix;
     404        if (machine.GetMonitorCount() > 1)
     405            strMachineName += QString(" : %1").arg(m_uScreenId);
    404406        machineWindow()->setWindowTitle(strMachineName);
    405407
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r26921 r26926  
    133133    for (ulong uScreenId = 0; uScreenId < uMonitorCount; ++ uScreenId)
    134134        addMachineWindow(UIMachineWindow::create(this, visualStateType(), uScreenId));
     135    /* Order machine window(s): */
     136    for (ulong uScreenId = uMonitorCount; uScreenId > 0; -- uScreenId)
     137        machineWindows()[uScreenId - 1]->machineWindow()->raise();
    135138
    136139    /* Notify others about machine window(s) created: */
     
    151154        if (uisession()->isFirstTimeStarted())
    152155        {
    153             UIFirstRunWzd wzd(mainMachineWindow()->machineWindow(), machine);
     156            UIFirstRunWzd wzd(defaultMachineWindow()->machineWindow(), machine);
    154157            wzd.exec();
    155158        }
     
    174177        /* Show "Starting/Restoring" progress dialog: */
    175178        if (uisession()->isSaved())
    176             vboxProblem().showModalProgressDialog(progress, machine.GetName(), mainMachineWindow()->machineWindow(), 0);
     179            vboxProblem().showModalProgressDialog(progress, machine.GetName(), defaultMachineWindow()->machineWindow(), 0);
    177180        else
    178             vboxProblem().showModalProgressDialog(progress, machine.GetName(), mainMachineWindow()->machineWindow());
     181            vboxProblem().showModalProgressDialog(progress, machine.GetName(), defaultMachineWindow()->machineWindow());
    179182
    180183#if 0 // TODO: Check immediate failure!
     
    231234{
    232235    /* Do not cleanup machine window if it is not present: */
    233     if (!machineWindowsCreated())
     236    if (!isMachineWindowsCreated())
    234237        return;
    235238
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