Changeset 26921 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 1, 2010 4:09:27 PM (15 years ago)
- 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 203 203 { 204 204 if (machineLogic() && 205 machineLogic()->ma chineWindowWrapper() &&206 machineLogic()->ma chineWindowWrapper()->machineWindow())207 return machineLogic()->ma chineWindowWrapper()->machineWindow();205 machineLogic()->mainMachineWindow() && 206 machineLogic()->mainMachineWindow()->machineWindow()) 207 return machineLogic()->mainMachineWindow()->machineWindow(); 208 208 else 209 209 return 0; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r26919 r26921 371 371 , m_pActionsPool(pActionsPool) 372 372 , m_visualStateType(visualStateType) 373 , m_pMachineWindowWrapper(0)374 373 , m_pRunningActions(0) 375 374 , m_pRunningOrPausedActions(0) 375 , m_fIsWindowsCreated(false) 376 376 , m_fIsPreventAutoStart(false) 377 377 , m_fIsPreventAutoClose(false) … … 390 390 { 391 391 return uisession()->session(); 392 } 393 394 void UIMachineLogic::addMachineWindow(UIMachineWindow *pMachineWindow) 395 { 396 m_machineWindowsList << pMachineWindow; 392 397 } 393 398 … … 727 732 void UIMachineLogic::sltToggleGuestAutoresize(bool fEnabled) 728 733 { 729 /* Do not process if window or view is missing! */730 if (!machineWindow Wrapper() || !machineWindowWrapper()->machineView())734 /* Do not process if window(s) missed! */ 735 if (!machineWindowsCreated()) 731 736 return; 732 737 733 machineWindowWrapper()->machineView()->setGuestAutoresizeEnabled(fEnabled); 738 /* Toggle guest-autoresize feature for all view(s)! */ 739 foreach(UIMachineWindow *pMachineWindow, machineWindows()) 740 pMachineWindow->machineView()->setGuestAutoresizeEnabled(fEnabled); 734 741 } 735 742 736 743 void UIMachineLogic::sltAdjustWindow() 737 744 { 738 /* Do not process if window or view is missing! */739 if (!machineWindow Wrapper() || !machineWindowWrapper()->machineView())745 /* Do not process if window(s) missed! */ 746 if (!machineWindowsCreated()) 740 747 return; 741 748 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 } 748 759 } 749 760 750 761 void UIMachineLogic::sltToggleMouseIntegration(bool fOff) 751 762 { 752 /* Do not process if window or view is missing! */753 if (!machineWindow Wrapper() || !machineWindowWrapper()->machineView())763 /* Do not process if window(s) missed! */ 764 if (!machineWindowsCreated()) 754 765 return; 755 766 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); 758 770 } 759 771 … … 785 797 void UIMachineLogic::sltTakeSnapshot() 786 798 { 787 /* Do not process if window is missing! */788 if (!machineWindow Wrapper())799 /* Do not process if window(s) missed! */ 800 if (!machineWindowsCreated()) 789 801 return; 790 802 … … 801 813 CMachine machine = session().GetMachine(); 802 814 803 VBoxTakeSnapshotDlg dlg(ma chineWindowWrapper()->machineWindow(), machine);815 VBoxTakeSnapshotDlg dlg(mainMachineWindow()->machineWindow(), machine); 804 816 805 817 QString strTypeId = machine.GetOSTypeId(); … … 836 848 void UIMachineLogic::sltShowInformationDialog() 837 849 { 838 /* Do not process if window is missing! */839 if (!machineWindow Wrapper())850 /* Do not process if window(s) missed! */ 851 if (!machineWindowsCreated()) 840 852 return; 841 853 842 854 // TODO: Call for singleton information dialog for this machine! 843 //VBoxVMInformationDlg::createInformationDlg(session(), ma chineWindowWrapper()->machineWindow());855 //VBoxVMInformationDlg::createInformationDlg(session(), mainMachineWindow()->machineWindow()); 844 856 } 845 857 … … 873 885 void UIMachineLogic::sltClose() 874 886 { 875 /* Do not process if window is missing! */876 if (!machineWindow Wrapper())887 /* Do not process if window(s) missed! */ 888 if (!machineWindowsCreated()) 877 889 return; 878 890 879 891 /* Close machine window: */ 880 ma chineWindowWrapper()->sltTryClose();892 mainMachineWindow()->sltTryClose(); 881 893 } 882 894 … … 1098 1110 } 1099 1111 /* Open VMM Dialog: */ 1100 VBoxMediaManagerDlg dlg(ma chineWindowWrapper()->machineWindow());1112 VBoxMediaManagerDlg dlg(mainMachineWindow()->machineWindow()); 1101 1113 dlg.setup(target.type, true /* select? */, true /* refresh? */, machine, currentId, true, usedImages); 1102 1114 if (dlg.exec() == QDialog::Accepted) … … 1218 1230 void UIMachineLogic::sltOpenNetworkAdaptersDialog() 1219 1231 { 1220 /* Do not process if window is missing! */1221 if (!machineWindow Wrapper())1232 /* Do not process if window(s) missed! */ 1233 if (!machineWindowsCreated()) 1222 1234 return; 1223 1235 1224 1236 /* Show network settings dialog: */ 1225 UINetworkAdaptersDialog dlg(ma chineWindowWrapper()->machineWindow(), session());1237 UINetworkAdaptersDialog dlg(mainMachineWindow()->machineWindow(), session()); 1226 1238 dlg.exec(); 1227 1239 } … … 1229 1241 void UIMachineLogic::sltOpenSharedFoldersDialog() 1230 1242 { 1231 /* Do not process if window is missing! */1232 if (!machineWindow Wrapper())1243 /* Do not process if window(s) missed! */ 1244 if (!machineWindowsCreated()) 1233 1245 return; 1234 1246 1235 1247 /* Show shared folders settings dialog: */ 1236 UISharedFoldersDialog dlg(ma chineWindowWrapper()->machineWindow(), session());1248 UISharedFoldersDialog dlg(mainMachineWindow()->machineWindow(), session()); 1237 1249 dlg.exec(); 1238 1250 } … … 1248 1260 void UIMachineLogic::sltInstallGuestAdditions() 1249 1261 { 1250 /* Do not process if window is missing! */1251 if (!machineWindow Wrapper())1262 /* Do not process if window(s) missed! */ 1263 if (!machineWindowsCreated()) 1252 1264 return; 1253 1265 … … 1453 1465 1454 1466 PFNDBGGUICREATE pfnGuiCreate; 1455 int rc = RTLdrGetSymbol (hLdrMod, "DBGGuiCreate", (void**)&pfnGuiCreate);1456 if (RT_SUCCESS 1467 int rc = RTLdrGetSymbol(hLdrMod, "DBGGuiCreate", (void**)&pfnGuiCreate); 1468 if (RT_SUCCESS(rc)) 1457 1469 { 1458 1470 ISession *pISession = session().raw(); 1459 rc = pfnGuiCreate 1460 if (RT_SUCCESS 1461 { 1462 if (DBGGUIVT_ARE_VERSIONS_COMPATIBLE 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) || 1463 1475 m_dbgGuiVT->u32EndVersion == m_dbgGuiVT->u32Version) 1464 1476 { 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)); 1467 1479 dbgAdjustRelativePos(); 1468 1480 return true; 1469 1481 } 1470 1482 1471 LogRel 1472 1483 LogRel(("DBGGuiCreate failed, incompatible versions (loaded %#x/%#x, expected %#x)\n", 1484 m_dbgGuiVT->u32Version, m_dbgGuiVT->u32EndVersion, DBGGUIVT_VERSION)); 1473 1485 } 1474 1486 else 1475 LogRel 1487 LogRel(("DBGGuiCreate failed, rc=%Rrc\n", rc)); 1476 1488 } 1477 1489 else 1478 LogRel 1490 LogRel(("RTLdrGetSymbol(,\"DBGGuiCreate\",) -> %Rrc\n", rc)); 1479 1491 1480 1492 m_dbgGui = 0; … … 1497 1509 if (m_dbgGui) 1498 1510 { 1499 QRect rct = ma chineWindowWrapper()->machineWindow()->frameGeometry();1511 QRect rct = mainMachineWindow()->machineWindow()->frameGeometry(); 1500 1512 m_dbgGuiVT->pfnAdjustRelativePos(m_dbgGui, rct.x(), rct.y(), rct.width(), rct.height()); 1501 1513 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r26893 r26921 62 62 UIActionsPool* actionsPool() { return m_pActionsPool; } 63 63 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; } 65 66 66 67 /* Maintenance getters/setters: */ … … 79 80 virtual ~UIMachineLogic(); 80 81 82 /* Protected getters/setters: */ 83 bool machineWindowsCreated() const { return m_fIsWindowsCreated; } 84 void setMachineWindowsCreated(bool fIsWindowsCreated) { m_fIsWindowsCreated = fIsWindowsCreated; } 85 81 86 /* Protected wrappers: */ 82 87 CSession& session(); 83 88 84 /* Protected setters: */85 void setMachineWindowWrapper(UIMachineWindow *pMachineWindowWrapper) { m_pMachineWindowWrapper = pMachineWindowWrapper; }89 /* Protected members: */ 90 void addMachineWindow(UIMachineWindow *pMachineWindow); 86 91 87 92 /* Prepare helpers: */ … … 152 157 UIActionsPool *m_pActionsPool; 153 158 UIVisualStateType m_visualStateType; 154 UIMachineWindow *m_pMachineWindowWrapper;159 QList<UIMachineWindow*> m_machineWindowsList; 155 160 156 161 QActionGroup *m_pRunningActions; 157 162 QActionGroup *m_pRunningOrPausedActions; 158 163 164 bool m_fIsWindowsCreated : 1; 159 165 bool m_fIsPreventAutoStart : 1; 160 166 bool m_fIsPreventAutoClose : 1; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r26914 r26921 114 114 , bool bAccelerate2DVideo 115 115 #endif 116 , UIVisualStateType visualStateType) 116 , UIVisualStateType visualStateType 117 , ulong uScreenId) 117 118 { 118 119 UIMachineView *view = 0; … … 125 126 , bAccelerate2DVideo 126 127 #endif 127 );128 , uScreenId); 128 129 break; 129 130 case UIVisualStateType_Fullscreen: … … 133 134 , bAccelerate2DVideo 134 135 #endif 135 );136 , uScreenId); 136 137 break; 137 138 case UIVisualStateType_Seamless: … … 141 142 , bAccelerate2DVideo 142 143 #endif 143 );144 , uScreenId); 144 145 break; 145 146 default: … … 185 186 } 186 187 187 #include <QMainWindow>188 188 UIMachineView::UIMachineView( UIMachineWindow *pMachineWindow 189 189 , VBoxDefs::RenderMode renderMode … … 191 191 , bool bAccelerate2DVideo 192 192 #endif 193 )193 , ulong uScreenId) 194 194 // TODO_NEW_CORE: really think of if this is right 195 195 // : QAbstractScrollArea(((QMainWindow*)pMachineWindow->machineWindow())->centralWidget()) … … 198 198 , m_pMachineWindow(pMachineWindow) 199 199 , m_mode(renderMode) 200 , m_uScreenId(uScreenId) 200 201 , m_globalSettings(vboxGlobal().settings()) 201 202 , m_pFrameBuffer(0) … … 415 416 { 416 417 m_pFrameBuffer->AddRef(); 417 display.SetFramebuffer( VBOX_VIDEO_PRIMARY_SCREEN, CFramebuffer(m_pFrameBuffer));418 display.SetFramebuffer(m_uScreenId, CFramebuffer(m_pFrameBuffer)); 418 419 } 419 420 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r26889 r26921 61 61 , bool bAccelerate2DVideo 62 62 #endif 63 , UIVisualStateType visualStateType); 63 , UIVisualStateType visualStateType 64 , ulong uScreenId); 64 65 static void destroy(UIMachineView *pWhichView); 65 66 … … 96 97 , bool bAccelerate2DVideo 97 98 #endif 98 );99 , ulong uScreenId); 99 100 virtual ~UIMachineView(); 100 101 … … 110 111 int visibleHeight() const; 111 112 VBoxDefs::RenderMode mode() const { return m_mode; } 113 ulong screenId() const { return m_uScreenId; } 112 114 UIFrameBuffer* frameBuffer() const { return m_pFrameBuffer; } 113 115 UIMachineWindow* machineWindowWrapper() const { return m_pMachineWindow; } … … 223 225 UIMachineWindow *m_pMachineWindow; 224 226 VBoxDefs::RenderMode m_mode; 227 ulong m_uScreenId; 225 228 const VBoxGlobalSettings &m_globalSettings; 226 229 UIFrameBuffer *m_pFrameBuffer; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r26919 r26921 41 41 //#include "UIMachineWindowSeamless.h" 42 42 43 UIMachineWindow* UIMachineWindow::create(UIMachineLogic *pMachineLogic, UIVisualStateType visualStateType )43 UIMachineWindow* UIMachineWindow::create(UIMachineLogic *pMachineLogic, UIVisualStateType visualStateType, ulong uScreenId) 44 44 { 45 45 UIMachineWindow *window = 0; … … 47 47 { 48 48 case UIVisualStateType_Normal: 49 window = new UIMachineWindowNormal(pMachineLogic );49 window = new UIMachineWindowNormal(pMachineLogic, uScreenId); 50 50 break; 51 51 case UIVisualStateType_Fullscreen: 52 window = new UIMachineWindowFullscreen(pMachineLogic );52 window = new UIMachineWindowFullscreen(pMachineLogic, uScreenId); 53 53 break; 54 54 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); 57 57 break; 58 58 } … … 87 87 } 88 88 89 UIMachineWindow::UIMachineWindow(UIMachineLogic *pMachineLogic )89 UIMachineWindow::UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId) 90 90 : m_pMachineLogic(pMachineLogic) 91 91 , m_pMachineWindow(0) 92 , m_uScreenId(uScreenId) 92 93 , m_pMachineViewContainer(0) 93 94 , m_pTopSpacer(0) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
r26919 r26921 44 44 45 45 /* 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); 47 47 static void destroy(UIMachineWindow *pWhichWindow); 48 48 … … 58 58 59 59 /* Machine window constructor/destructor: */ 60 UIMachineWindow(UIMachineLogic *pMachineLogic );60 UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId); 61 61 virtual ~UIMachineWindow(); 62 62 … … 96 96 QWidget *m_pMachineWindow; 97 97 98 /* Virtual screen number: */ 99 ulong m_uScreenId; 100 98 101 QGridLayout *m_pMachineViewContainer; 99 102 QSpacerItem *m_pTopSpacer; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r26919 r26921 965 965 qulonglong UISession::winId() const 966 966 { 967 return uimachine()->machineLogic()->ma chineWindowWrapper()->machineWindow()->winId();967 return uimachine()->machineLogic()->mainMachineWindow()->machineWindow()->winId(); 968 968 } 969 969 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r26889 r26921 139 139 { 140 140 /* Do not prepare window if its ready: */ 141 if (ma chineWindowWrapper())141 if (mainMachineWindow()) 142 142 return; 143 143 … … 149 149 150 150 /* Create machine window: */ 151 setMachineWindowWrapper(UIMachineWindow::create(this, visualStateType()));151 addMachineWindow(UIMachineWindow::create(this, visualStateType())); 152 152 153 153 /* If we are not started yet: */ … … 165 165 if (uisession()->isFirstTimeStarted()) 166 166 { 167 UIFirstRunWzd wzd(ma chineWindowWrapper()->machineWindow(), machine);167 UIFirstRunWzd wzd(mainMachineWindow()->machineWindow(), machine); 168 168 wzd.exec(); 169 169 } … … 176 176 { 177 177 vboxProblem().cannotStartMachine(console); 178 ma chineWindowWrapper()->machineWindow()->close();178 mainMachineWindow()->machineWindow()->close(); 179 179 return; 180 180 } … … 185 185 /* Show "Starting/Restoring" progress dialog: */ 186 186 if (uisession()->isSaved()) 187 vboxProblem().showModalProgressDialog(progress, machine.GetName(), ma chineWindowWrapper()->machineWindow(), 0);187 vboxProblem().showModalProgressDialog(progress, machine.GetName(), mainMachineWindow()->machineWindow(), 0); 188 188 else 189 vboxProblem().showModalProgressDialog(progress, machine.GetName(), ma chineWindowWrapper()->machineWindow());189 vboxProblem().showModalProgressDialog(progress, machine.GetName(), mainMachineWindow()->machineWindow()); 190 190 191 191 /* Check for an progress failure */ … … 193 193 { 194 194 vboxProblem().cannotStartMachine(progress); 195 ma chineWindowWrapper()->machineWindow()->close();195 mainMachineWindow()->machineWindow()->close(); 196 196 return; 197 197 } … … 206 206 if (uisession()->isTurnedOff()) 207 207 { 208 ma chineWindowWrapper()->machineWindow()->close();208 mainMachineWindow()->machineWindow()->close(); 209 209 return; 210 210 } … … 228 228 229 229 if (!vboxGlobal().isStartPausedEnabled()) 230 ma chineWindowWrapper()->machineView()->pause (false);230 mainMachineWindow()->machineView()->pause (false); 231 231 } 232 232 # endif … … 243 243 { 244 244 /* Do not cleanup machine window if it is not present: */ 245 if (!ma chineWindowWrapper())245 if (!mainMachineWindow()) 246 246 return; 247 247 248 248 /* 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 39 39 40 40 UIMachineViewFullscreen::UIMachineViewFullscreen( UIMachineWindow *pMachineWindow 41 , VBoxDefs::RenderMode renderMode41 , VBoxDefs::RenderMode renderMode 42 42 #ifdef VBOX_WITH_VIDEOHWACCEL 43 , bool bAccelerate2DVideo43 , bool bAccelerate2DVideo 44 44 #endif 45 )45 , ulong uMonitor) 46 46 : UIMachineView( pMachineWindow 47 47 , renderMode … … 49 49 , bAccelerate2DVideo 50 50 #endif 51 )51 , uMonitor) 52 52 , m_bIsGuestAutoresizeEnabled(pMachineWindow->machineLogic()->actionsPool()->action(UIActionIndex_Toggle_GuestAutoresize)->isChecked()) 53 53 , m_fShouldWeDoResize(false) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h
r26889 r26921 40 40 /* Normal machine view constructor/destructor: */ 41 41 UIMachineViewFullscreen( UIMachineWindow *pMachineWindow 42 , VBoxDefs::RenderMode renderMode42 , VBoxDefs::RenderMode renderMode 43 43 #ifdef VBOX_WITH_VIDEOHWACCEL 44 , bool bAccelerate2DVideo44 , bool bAccelerate2DVideo 45 45 #endif 46 );46 , ulong uMonitor); 47 47 virtual ~UIMachineViewFullscreen(); 48 48 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r26919 r26921 43 43 #endif /* Q_WS_MAC */ 44 44 45 UIMachineWindowFullscreen::UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic )45 UIMachineWindowFullscreen::UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId) 46 46 : QIWithRetranslateUI<QIMainDialog>(0) 47 , UIMachineWindow(pMachineLogic )47 , UIMachineWindow(pMachineLogic, uScreenId) 48 48 { 49 49 /* "This" is machine window: */ … … 283 283 , bAccelerate2DVideo 284 284 #endif 285 , machineLogic()->visualStateType()); 285 , machineLogic()->visualStateType() 286 , 0 /* Pass a primary screen id (0) for now! */); 286 287 287 288 /* Add machine view into layout: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h
r26919 r26921 50 50 51 51 /* Normal machine window constructor/destructor: */ 52 UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic );52 UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId); 53 53 virtual ~UIMachineWindowFullscreen(); 54 54 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r26895 r26921 59 59 60 60 /* Prepare normal machine window: */ 61 prepareMachineWindow ();61 prepareMachineWindows(); 62 62 63 63 /* Initialization: */ … … 112 112 } 113 113 114 void UIMachineLogicNormal::prepareMachineWindow() 115 { 116 /* Do not prepare window if its ready: */ 117 if (machineWindowWrapper()) 114 void 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) 118 121 return; 122 123 /* List should not be filled partially: */ 124 AssertMsg(machineWindows().size() == 0, ("Windows list is filled partially, something broken!\n")); 119 125 120 126 #ifdef Q_WS_MAC … … 124 130 #endif /* Q_WS_MAC */ 125 131 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); 128 138 129 139 /* If we are not started yet: */ … … 141 151 if (uisession()->isFirstTimeStarted()) 142 152 { 143 UIFirstRunWzd wzd(ma chineWindowWrapper()->machineWindow(), machine);153 UIFirstRunWzd wzd(mainMachineWindow()->machineWindow(), machine); 144 154 wzd.exec(); 145 155 } … … 148 158 CProgress progress = vboxGlobal().isStartPausedEnabled() || vboxGlobal().isDebuggerAutoShowEnabled() ? 149 159 console.PowerUpPaused() : console.PowerUp(); 150 /* Check for an immediate failure */ 160 161 #if 0 // TODO: Check immediate failure! 162 /* Check for an immediate failure: */ 151 163 if (!console.isOk()) 152 164 { … … 158 170 /* Disable auto-closure because we want to have a chance to show the error dialog on startup failure: */ 159 171 setPreventAutoClose(true); 172 #endif 160 173 161 174 /* Show "Starting/Restoring" progress dialog: */ 162 175 if (uisession()->isSaved()) 163 vboxProblem().showModalProgressDialog(progress, machine.GetName(), ma chineWindowWrapper()->machineWindow(), 0);176 vboxProblem().showModalProgressDialog(progress, machine.GetName(), mainMachineWindow()->machineWindow(), 0); 164 177 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! 167 181 /* Check for an progress failure */ 168 182 if (progress.GetResultCode() != 0) … … 173 187 } 174 188 175 /* Process pending events: */176 qApp->processEvents();177 178 189 /* Enable auto-closure again: */ 179 190 setPreventAutoClose(false); … … 185 196 return; 186 197 } 198 #endif 187 199 188 200 #if 0 // TODO: Rework debugger logic! … … 219 231 { 220 232 /* Do not cleanup machine window if it is not present: */ 221 if (!machineWindow Wrapper())233 if (!machineWindowsCreated()) 222 234 return; 223 235 224 236 /* 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 53 53 /* Prepare helpers: */ 54 54 void prepareActionConnections(); 55 void prepareMachineWindow ();55 void prepareMachineWindows(); 56 56 57 57 /* Cleanup helpers: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r26889 r26921 43 43 , bool bAccelerate2DVideo 44 44 #endif 45 )45 , ulong uMonitor) 46 46 : UIMachineView( pMachineWindow 47 47 , renderMode … … 49 49 , bAccelerate2DVideo 50 50 #endif 51 )51 , uMonitor) 52 52 , m_bIsGuestAutoresizeEnabled(pMachineWindow->machineLogic()->actionsPool()->action(UIActionIndex_Toggle_GuestAutoresize)->isChecked()) 53 53 , m_fShouldWeDoResize(false) … … 126 126 127 127 /* 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()); 129 129 } 130 130 /* We had requested resize now, rejecting accident requests: */ … … 318 318 319 319 /* Report to the VM thread that we finished resizing */ 320 session().GetConsole().GetDisplay().ResizeCompleted( 0);320 session().GetConsole().GetDisplay().ResizeCompleted(screenId()); 321 321 322 322 setMachineWindowResizeIgnored(oldIgnoreMainwndResize); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h
r26889 r26921 44 44 , bool bAccelerate2DVideo 45 45 #endif 46 );46 , ulong uMonitor); 47 47 virtual ~UIMachineViewNormal(); 48 48 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r26919 r26921 42 42 #include "QIHotKeyEdit.h" 43 43 44 UIMachineWindowNormal::UIMachineWindowNormal(UIMachineLogic *pMachineLogic )44 UIMachineWindowNormal::UIMachineWindowNormal(UIMachineLogic *pMachineLogic, ulong uScreenId) 45 45 : QIWithRetranslateUI<QIMainDialog>(0) 46 , UIMachineWindow(pMachineLogic )46 , UIMachineWindow(pMachineLogic, uScreenId) 47 47 , m_pIndicatorsPool(new UIIndicatorsPool(pMachineLogic->uisession()->session(), this)) 48 48 , m_pIdleTimer(0) … … 447 447 , bAccelerate2DVideo 448 448 #endif 449 , machineLogic()->visualStateType()); 449 , machineLogic()->visualStateType() 450 , m_uScreenId); 450 451 451 452 /* Add machine view into layout: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
r26878 r26921 48 48 49 49 /* Normal machine window constructor/destructor: */ 50 UIMachineWindowNormal(UIMachineLogic *pMachineLogic );50 UIMachineWindowNormal(UIMachineLogic *pMachineLogic, ulong uScreenId); 51 51 virtual ~UIMachineWindowNormal(); 52 52 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.cpp
r26714 r26921 7 7 8 8 /* 9 * Copyright (C) 2008-20 09Sun Microsystems, Inc.9 * Copyright (C) 2008-2010 Sun Microsystems, Inc. 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 56 56 const uint MinVRAM = sys.GetMinGuestVRAM(); 57 57 const uint MaxVRAM = sys.GetMaxGuestVRAM(); 58 const uint MinMonitors = 1; 59 const uint MaxMonitors = sys.GetMaxGuestMonitors(); 58 60 59 61 /* Setup validators */ 60 62 mLeMemory->setValidator (new QIntValidator (MinVRAM, MaxVRAM, this)); 63 mLeMonitors->setValidator (new QIntValidator (MinMonitors, MaxMonitors, this)); 61 64 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)); 62 65 mLeVRDPTimeout->setValidator (new QIntValidator (this)); 63 66 64 67 /* Setup connections */ 65 connect (mSlMemory, SIGNAL (valueChanged (int)), 66 this, SLOT (valueChangedVRAM (int)));67 connect (m LeMemory, 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&))); 69 72 70 73 /* Setup initial values */ … … 72 75 mSlMemory->setSingleStep (mSlMemory->pageStep() / 4); 73 76 mSlMemory->setTickInterval (mSlMemory->pageStep()); 77 mSlMonitors->setPageStep (1); 78 mSlMonitors->setSingleStep (1); 79 mSlMonitors->setTickInterval (1); 74 80 /* Setup the scale so that ticks are at page step boundaries */ 75 81 mSlMemory->setMinimum ((MinVRAM / mSlMemory->pageStep()) * mSlMemory->pageStep()); … … 80 86 mSlMemory->setWarningHint (1, needMBytes); 81 87 mSlMemory->setOptimalHint (needMBytes, MaxVRAM); 88 mSlMonitors->setMinimum (MinMonitors); 89 mSlMonitors->setMaximum (MaxMonitors); 90 mSlMonitors->setSnappingEnabled (true); 82 91 /* Limit min/max. size of QLineEdit */ 83 92 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 */ 85 95 valueChangedVRAM (mSlMemory->value()); 96 valueChangedMonitors (mSlMonitors->value()); 86 97 /* Setup VRDP widget */ 87 98 mCbVRDPMethod->insertItem (0, ""); /* KVRDPAuthType_Null */ … … 115 126 mSlMemory->setValue (mMachine.GetVRAMSize()); 116 127 128 /* Monitors Count */ 129 mSlMonitors->setValue (mMachine.GetMonitorCount()); 130 117 131 /* 3D Acceleration */ 118 132 bool isAccelerationSupported = vboxGlobal().virtualBox().GetHost() … … 147 161 /* Memory Size */ 148 162 mMachine.SetVRAMSize (mSlMemory->value()); 163 164 /* Monitors Count */ 165 mMachine.SetMonitorCount (mSlMonitors->value()); 149 166 150 167 /* 3D Acceleration */ … … 223 240 setTabOrder (mTwDisplay->focusProxy(), mSlMemory); 224 241 setTabOrder (mSlMemory, mLeMemory); 225 setTabOrder (mLeMemory, mCb3D); 242 setTabOrder (mLeMemory, mSlMonitors); 243 setTabOrder (mSlMonitors, mLeMonitors); 244 setTabOrder (mLeMonitors, mCb3D); 226 245 #ifdef VBOX_WITH_VIDEOHWACCEL 227 246 setTabOrder (mCb3D, mCb2DVideo); … … 243 262 mLbMemoryMin->setText (tr ("<qt>%1 MB</qt>").arg (sys.GetMinGuestVRAM())); 244 263 mLbMemoryMax->setText (tr ("<qt>%1 MB</qt>").arg (sys.GetMaxGuestVRAM())); 264 mLbMonitorsMin->setText (tr ("<qt>%1</qt>").arg (1)); 265 mLbMonitorsMax->setText (tr ("<qt>%1</qt>").arg (sys.GetMaxGuestMonitors())); 245 266 246 267 mCbVRDPMethod->setItemText (0, … … 262 283 } 263 284 285 void VBoxVMSettingsDisplay::valueChangedMonitors (int aVal) 286 { 287 mLeMonitors->setText (QString().setNum (aVal)); 288 } 289 290 void VBoxVMSettingsDisplay::textChangedMonitors (const QString &aText) 291 { 292 mSlMonitors->setValue (aText.toInt()); 293 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.h
r26163 r26921 6 6 7 7 /* 8 * Copyright (C) 2008-20 09Sun Microsystems, Inc.8 * Copyright (C) 2008-2010 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 57 57 void valueChangedVRAM (int aVal); 58 58 void textChangedVRAM (const QString &aText); 59 void valueChangedMonitors (int aVal); 60 void textChangedMonitors (const QString &aText); 59 61 60 62 private: -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.ui
r26163 r26921 4 4 VBox frontends: Qt4 GUI ("VirtualBox"): 5 5 6 Copyright (C) 2008-20 09Sun Microsystems, Inc.6 Copyright (C) 2008-2010 Sun Microsystems, Inc. 7 7 8 8 This file is part of VirtualBox Open Source Edition (OSE), as … … 152 152 </item> 153 153 <item row="2" column="0"> 154 <widget class="QLabel" name="mLb Options">155 <property name="text"> 156 <string> Extended Features:</string>154 <widget class="QLabel" name="mLbMonitors"> 155 <property name="text"> 156 <string>Mo&nitor Count:</string> 157 157 </property> 158 158 <property name="alignment"> 159 159 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 160 160 </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"> 164 260 <widget class="QCheckBox" name="mCb3D"> 165 261 <property name="sizePolicy"> … … 177 273 </widget> 178 274 </item> 179 <item row=" 3" column="1" colspan="2">275 <item row="5" column="1" colspan="2"> 180 276 <widget class="QCheckBox" name="mCb2DVideo"> 181 277 <property name="sizePolicy"> … … 257 353 </property> 258 354 <item row="1" column="0" rowspan="3"> 259 <spacer name="mSpHor 2">355 <spacer name="mSpHor3"> 260 356 <property name="orientation"> 261 357 <enum>Qt::Horizontal</enum>
Note:
See TracChangeset
for help on using the changeset viewer.