Changeset 26926 in vbox
- Timestamp:
- Mar 1, 2010 10:19:43 PM (15 years ago)
- 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 363 363 } 364 364 365 UIMachineWindow* 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 374 UIMachineWindow* 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 365 397 UIMachineLogic::UIMachineLogic(QObject *pParent, 366 398 UISession *pSession, … … 703 735 /* Variable falgs: */ 704 736 bool fIsMouseSupportsAbsolute = uisession()->isMouseSupportsAbsolute(); 705 /* bool fIsMouseSupportsRelative = uisession()->isMouseSupportsRelative(); */737 bool fIsMouseSupportsRelative = uisession()->isMouseSupportsRelative(); 706 738 bool fIsMouseHostCursorNeeded = uisession()->isMouseHostCursorNeeded(); 707 739 708 740 /* Update action state: */ 709 741 QAction *pAction = actionsPool()->action(UIActionIndex_Toggle_MouseIntegration); 710 pAction->setEnabled(fIsMouseSupportsAbsolute /* && fIsMouseSupportsRelative */&& !fIsMouseHostCursorNeeded);742 pAction->setEnabled(fIsMouseSupportsAbsolute && fIsMouseSupportsRelative && !fIsMouseHostCursorNeeded); 711 743 pAction->setChecked(fIsMouseHostCursorNeeded || pAction->isChecked()); 712 744 } … … 733 765 { 734 766 /* Do not process if window(s) missed! */ 735 if (! machineWindowsCreated())767 if (!isMachineWindowsCreated()) 736 768 return; 737 769 … … 744 776 { 745 777 /* Do not process if window(s) missed! */ 746 if (! machineWindowsCreated())778 if (!isMachineWindowsCreated()) 747 779 return; 748 780 … … 762 794 { 763 795 /* Do not process if window(s) missed! */ 764 if (! machineWindowsCreated())796 if (!isMachineWindowsCreated()) 765 797 return; 766 798 … … 798 830 { 799 831 /* Do not process if window(s) missed! */ 800 if (! machineWindowsCreated())832 if (!isMachineWindowsCreated()) 801 833 return; 802 834 … … 813 845 CMachine machine = session().GetMachine(); 814 846 815 VBoxTakeSnapshotDlg dlg( mainMachineWindow()->machineWindow(), machine);847 VBoxTakeSnapshotDlg dlg(defaultMachineWindow()->machineWindow(), machine); 816 848 817 849 QString strTypeId = machine.GetOSTypeId(); … … 848 880 void UIMachineLogic::sltShowInformationDialog() 849 881 { 850 /* Do not process if window(s) missed! */851 if (!machineWindowsCreated())852 return;853 854 882 // TODO: Call for singleton information dialog for this machine! 855 //VBoxVMInformationDlg::createInformationDlg(session() , mainMachineWindow()->machineWindow());883 //VBoxVMInformationDlg::createInformationDlg(session()); 856 884 } 857 885 … … 886 914 { 887 915 /* Do not process if window(s) missed! */ 888 if (! machineWindowsCreated())916 if (!isMachineWindowsCreated()) 889 917 return; 890 918 891 /* Closemachine window: */892 mainMachineWindow()->sltTryClose();919 /* Propose to close default machine window: */ 920 defaultMachineWindow()->sltTryClose(); 893 921 } 894 922 … … 1110 1138 } 1111 1139 /* Open VMM Dialog: */ 1112 VBoxMediaManagerDlg dlg( mainMachineWindow()->machineWindow());1140 VBoxMediaManagerDlg dlg(defaultMachineWindow()->machineWindow()); 1113 1141 dlg.setup(target.type, true /* select? */, true /* refresh? */, machine, currentId, true, usedImages); 1114 1142 if (dlg.exec() == QDialog::Accepted) … … 1231 1259 { 1232 1260 /* Do not process if window(s) missed! */ 1233 if (! machineWindowsCreated())1261 if (!isMachineWindowsCreated()) 1234 1262 return; 1235 1263 1236 1264 /* Show network settings dialog: */ 1237 UINetworkAdaptersDialog dlg( mainMachineWindow()->machineWindow(), session());1265 UINetworkAdaptersDialog dlg(defaultMachineWindow()->machineWindow(), session()); 1238 1266 dlg.exec(); 1239 1267 } … … 1242 1270 { 1243 1271 /* Do not process if window(s) missed! */ 1244 if (! machineWindowsCreated())1272 if (!isMachineWindowsCreated()) 1245 1273 return; 1246 1274 1247 1275 /* Show shared folders settings dialog: */ 1248 UISharedFoldersDialog dlg( mainMachineWindow()->machineWindow(), session());1276 UISharedFoldersDialog dlg(defaultMachineWindow()->machineWindow(), session()); 1249 1277 dlg.exec(); 1250 1278 } … … 1261 1289 { 1262 1290 /* Do not process if window(s) missed! */ 1263 if (! machineWindowsCreated())1291 if (!isMachineWindowsCreated()) 1264 1292 return; 1265 1293 … … 1475 1503 m_dbgGuiVT->u32EndVersion == m_dbgGuiVT->u32Version) 1476 1504 { 1477 m_dbgGuiVT->pfnSetParent(m_dbgGui, (QWidget*) mainMachineWindow());1505 m_dbgGuiVT->pfnSetParent(m_dbgGui, (QWidget*)defaultMachineWindow()); 1478 1506 m_dbgGuiVT->pfnSetMenu(m_dbgGui, (QMenu*)actionsPool()->action(UIActionIndex_Menu_Debug)); 1479 1507 dbgAdjustRelativePos(); … … 1509 1537 if (m_dbgGui) 1510 1538 { 1511 QRect rct = mainMachineWindow()->machineWindow()->frameGeometry();1539 QRect rct = defaultMachineWindow()->machineWindow()->frameGeometry(); 1512 1540 m_dbgGuiVT->pfnAdjustRelativePos(m_dbgGui, rct.x(), rct.y(), rct.width(), rct.height()); 1513 1541 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r26921 r26926 63 63 UIVisualStateType visualStateType() const { return m_visualStateType; } 64 64 QList<UIMachineWindow*>& machineWindows() { return m_machineWindowsList; } 65 UIMachineWindow* mainMachineWindow() { return machineWindows().size() > 0 ? machineWindows()[0] : 0; } 65 UIMachineWindow* mainMachineWindow(); 66 UIMachineWindow* defaultMachineWindow(); 66 67 67 68 /* Maintenance getters/setters: */ … … 81 82 82 83 /* Protected getters/setters: */ 83 bool machineWindowsCreated() const { return m_fIsWindowsCreated; }84 bool isMachineWindowsCreated() const { return m_fIsWindowsCreated; } 84 85 void setMachineWindowsCreated(bool fIsWindowsCreated) { m_fIsWindowsCreated = fIsWindowsCreated; } 85 86 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r26921 r26926 402 402 strMachineName += " [" + vboxGlobal().toString(state) + "] - "; 403 403 strMachineName += m_strWindowTitlePrefix; 404 if (machine.GetMonitorCount() > 1) 405 strMachineName += QString(" : %1").arg(m_uScreenId); 404 406 machineWindow()->setWindowTitle(strMachineName); 405 407 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r26921 r26926 133 133 for (ulong uScreenId = 0; uScreenId < uMonitorCount; ++ uScreenId) 134 134 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(); 135 138 136 139 /* Notify others about machine window(s) created: */ … … 151 154 if (uisession()->isFirstTimeStarted()) 152 155 { 153 UIFirstRunWzd wzd( mainMachineWindow()->machineWindow(), machine);156 UIFirstRunWzd wzd(defaultMachineWindow()->machineWindow(), machine); 154 157 wzd.exec(); 155 158 } … … 174 177 /* Show "Starting/Restoring" progress dialog: */ 175 178 if (uisession()->isSaved()) 176 vboxProblem().showModalProgressDialog(progress, machine.GetName(), mainMachineWindow()->machineWindow(), 0);179 vboxProblem().showModalProgressDialog(progress, machine.GetName(), defaultMachineWindow()->machineWindow(), 0); 177 180 else 178 vboxProblem().showModalProgressDialog(progress, machine.GetName(), mainMachineWindow()->machineWindow());181 vboxProblem().showModalProgressDialog(progress, machine.GetName(), defaultMachineWindow()->machineWindow()); 179 182 180 183 #if 0 // TODO: Check immediate failure! … … 231 234 { 232 235 /* Do not cleanup machine window if it is not present: */ 233 if (! machineWindowsCreated())236 if (!isMachineWindowsCreated()) 234 237 return; 235 238
Note:
See TracChangeset
for help on using the changeset viewer.