Changeset 41108 in vbox
- Timestamp:
- May 2, 2012 12:43:07 AM (13 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r41107 r41108 215 215 } 216 216 217 UIMachineWindow* UIMachineLogic:: defaultMachineWindow() const217 UIMachineWindow* UIMachineLogic::activeMachineWindow() const 218 218 { 219 219 /* Return null if windows are not created yet: */ … … 221 221 return 0; 222 222 223 /* Select main machine window by default: */ 224 UIMachineWindow *pWindowToPropose = mainMachineWindow(); 225 226 /* Check if there is active window present: */ 227 foreach (UIMachineWindow *pWindowToCheck, machineWindows()) 228 { 229 if (pWindowToCheck->isActiveWindow()) 230 { 231 pWindowToPropose = pWindowToCheck; 232 break; 233 } 234 } 235 236 /* Return default machine window: */ 237 return pWindowToPropose; 223 /* Check if there is an active window present: */ 224 for (int i = 0; i < machineWindows().size(); ++i) 225 { 226 UIMachineWindow *pIteratedWindow = machineWindows()[i]; 227 if (pIteratedWindow->isActiveWindow()) 228 return pIteratedWindow; 229 } 230 231 /* Return main machine window: */ 232 return mainMachineWindow(); 238 233 } 239 234 … … 409 404 void UIMachineLogic::sltShowWindows() 410 405 { 411 for (int i=0; i < m _machineWindowsList.size(); ++i)412 { 413 UIMachineWindow *pMachineWindow = m _machineWindowsList.at(i);406 for (int i=0; i < machineWindows().size(); ++i) 407 { 408 UIMachineWindow *pMachineWindow = machineWindows().at(i); 414 409 /* Dunno what Qt thinks a window that has minimized to the dock 415 410 * should be - it is not hidden, neither is it minimized. OTOH it is … … 721 716 /* Now the dock icon preview */ 722 717 QString osTypeId = session().GetConsole().GetGuest().GetOSTypeId(); 723 m_pDockIconPreview = new UIDockIconPreview( m_pSession, vboxGlobal().vmGuestOSTypeIcon(osTypeId));718 m_pDockIconPreview = new UIDockIconPreview(uisession(), vboxGlobal().vmGuestOSTypeIcon(osTypeId)); 724 719 725 720 QString strTest = session().GetMachine().GetExtraData(VBoxDefs::GUI_RealtimeDockIconUpdateEnabled).toLower(); … … 861 856 862 857 /* Disable/Enable mouse-integration for all view(s): */ 863 m _pMouseHandler->setMouseIntegrationEnabled(!fOff);858 mouseHandler()->setMouseIntegrationEnabled(!fOff); 864 859 } 865 860 … … 907 902 CMachine machine = session().GetMachine(); 908 903 909 VBoxTakeSnapshotDlg dlg( defaultMachineWindow(), machine);904 VBoxTakeSnapshotDlg dlg(activeMachineWindow(), machine); 910 905 911 906 QString strTypeId = machine.GetOSTypeId(); … … 978 973 QString strFilename = QIFileDialog::getSaveFileName(strStart, 979 974 filters.join(";;"), 980 defaultMachineWindow(),975 activeMachineWindow(), 981 976 tr("Select a filename for the screenshot ..."), 982 977 &strFilter, … … 1036 1031 return; 1037 1032 1038 /* Propose to close defaultmachine window: */1039 defaultMachineWindow()->sltTryClose();1033 /* Propose to close active machine window: */ 1034 activeMachineWindow()->sltTryClose(); 1040 1035 } 1041 1036 … … 1047 1042 1048 1043 /* Create and execute current VM settings dialog: */ 1049 UISettingsDialogMachine dlg(defaultMachineWindow(), 1050 session().GetMachine().GetId(), strCategory, QString()); 1044 UISettingsDialogMachine dlg(activeMachineWindow(), session().GetMachine().GetId(), strCategory, QString()); 1051 1045 dlg.execute(); 1052 1046 } … … 1062 1056 /* Do not process if additions are not loaded! */ 1063 1057 if (!uisession()->isGuestAdditionsActive()) 1064 msgCenter().remindAboutGuestAdditionsAreNotActive( defaultMachineWindow());1058 msgCenter().remindAboutGuestAdditionsAreNotActive(activeMachineWindow()); 1065 1059 1066 1060 /* Open VM settings : Shared folders page: */ … … 1315 1309 /* Call for file-open window: */ 1316 1310 QString strMachineFolder(QFileInfo(machine.GetSettingsFilePath()).absolutePath()); 1317 QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(target.type, defaultMachineWindow(),1311 QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(target.type, activeMachineWindow(), 1318 1312 strMachineFolder); 1319 defaultMachineWindow()->machineView()->setFocus();1313 activeMachineWindow()->machineView()->setFocus(); 1320 1314 if (!strMediumId.isNull()) 1321 1315 newId = strMediumId; … … 1611 1605 if (dbgCreated()) 1612 1606 { 1613 m_pKeyboardHandler->setDebuggerActive();1607 keyboardHandler()->setDebuggerActive(); 1614 1608 m_pDbgGuiVT->pfnShowStatistics(m_pDbgGui); 1615 1609 } … … 1620 1614 if (dbgCreated()) 1621 1615 { 1622 m_pKeyboardHandler->setDebuggerActive();1616 keyboardHandler()->setDebuggerActive(); 1623 1617 m_pDbgGuiVT->pfnShowCommandLine(m_pDbgGui); 1624 1618 } … … 1640 1634 { 1641 1635 /* Show VM Log Viewer: */ 1642 UIVMLogViewer::showLogViewerFor( mainMachineWindow(), session().GetMachine());1636 UIVMLogViewer::showLogViewerFor(activeMachineWindow(), session().GetMachine()); 1643 1637 } 1644 1638 … … 1648 1642 void UIMachineLogic::sltDockPreviewModeChanged(QAction *pAction) 1649 1643 { 1650 CMachine machine = m_pSession->session().GetMachine();1644 CMachine machine = session().GetMachine(); 1651 1645 if (!machine.isNull()) 1652 1646 { … … 1662 1656 void UIMachineLogic::sltDockPreviewMonitorChanged(QAction *pAction) 1663 1657 { 1664 CMachine machine = m_pSession->session().GetMachine();1658 CMachine machine = session().GetMachine(); 1665 1659 if (!machine.isNull()) 1666 1660 { … … 1777 1771 || m_pDbgGuiVT->u32EndVersion == m_pDbgGuiVT->u32Version) 1778 1772 { 1779 m_pDbgGuiVT->pfnSetParent(m_pDbgGui, defaultMachineWindow());1773 m_pDbgGuiVT->pfnSetParent(m_pDbgGui, activeMachineWindow()); 1780 1774 m_pDbgGuiVT->pfnSetMenu(m_pDbgGui, gActionPool->action(UIActionIndexRuntime_Menu_Debug)); 1781 1775 dbgAdjustRelativePos(); … … 1811 1805 if (m_pDbgGui) 1812 1806 { 1813 QRect rct = defaultMachineWindow()->frameGeometry();1807 QRect rct = activeMachineWindow()->frameGeometry(); 1814 1808 m_pDbgGuiVT->pfnAdjustRelativePos(m_pDbgGui, rct.x(), rct.y(), rct.width(), rct.height()); 1815 1809 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r41064 r41108 20 20 #define __UIMachineLogic_h__ 21 21 22 /* Local includes */22 /* Local includes: */ 23 23 #include "UIMachineDefs.h" 24 24 #include <QIWithRetranslateUI.h> … … 27 27 #endif /* VBOX_WITH_DEBUGGER_GUI */ 28 28 29 /* Global forwards*/29 /* Forward declarations: */ 30 30 class QAction; 31 31 class QActionGroup; 32 33 /* Local forwards */34 32 class CSession; 35 33 class CMachine; … … 70 68 UIMouseHandler* mouseHandler() const { return m_pMouseHandler; } 71 69 UIMachineWindow* mainMachineWindow() const; 72 UIMachineWindow* defaultMachineWindow() const;70 UIMachineWindow* activeMachineWindow() const; 73 71 74 72 /* Maintenance getters/setters: */
Note:
See TracChangeset
for help on using the changeset viewer.