Changeset 53030 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 10, 2014 2:45:53 PM (10 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
r52993 r53030 251 251 } 252 252 253 CMachine& UIMachineLogic::machine() const 254 { 255 return uisession()->machine(); 256 } 257 258 CConsole& UIMachineLogic::console() const 259 { 260 return uisession()->console(); 261 } 262 263 CDisplay& UIMachineLogic::display() const 264 { 265 return uisession()->display(); 266 } 267 268 CGuest& UIMachineLogic::guest() const 269 { 270 return uisession()->guest(); 271 } 272 273 CMouse& UIMachineLogic::mouse() const 274 { 275 return uisession()->mouse(); 276 } 277 278 CKeyboard& UIMachineLogic::keyboard() const 279 { 280 return uisession()->keyboard(); 281 } 282 283 CMachineDebugger& UIMachineLogic::debugger() const 284 { 285 return uisession()->debugger(); 286 } 287 288 const QString& UIMachineLogic::machineName() const 289 { 290 return uisession()->machineName(); 291 } 292 253 293 UIMachineWindow* UIMachineLogic::mainMachineWindow() const 254 294 { … … 348 388 { 349 389 /* Warn the user about ACPI is not available if so: */ 350 CConsole console = session().GetConsole(); 351 if (!console.GetGuestEnteredACPIMode()) 390 if (!console().GetGuestEnteredACPIMode()) 352 391 return popupCenter().cannotSendACPIToMachine(activeMachineWindow()); 353 392 … … 431 470 uisession()->setGuestResizeIgnored(true); 432 471 /* Get log-folder: */ 433 QString strLogFolder = session().GetMachine().GetLogFolder();472 QString strLogFolder = machine().GetLogFolder(); 434 473 /* Take the screenshot for debugging purposes: */ 435 474 takeScreenshot(strLogFolder + "/VBox.png", "png"); … … 581 620 { 582 621 if (fIsAttached) 583 msgCenter().cannotAttachUSBDevice(error, vboxGlobal().details(device), session().GetMachine().GetName());622 msgCenter().cannotAttachUSBDevice(error, vboxGlobal().details(device), machineName()); 584 623 else 585 msgCenter().cannotDetachUSBDevice(error, vboxGlobal().details(device), session().GetMachine().GetName());624 msgCenter().cannotDetachUSBDevice(error, vboxGlobal().details(device), machineName()); 586 625 } 587 626 } … … 589 628 void UIMachineLogic::sltRuntimeError(bool fIsFatal, const QString &strErrorId, const QString &strMessage) 590 629 { 591 msgCenter().showRuntimeError( session().GetConsole(), fIsFatal, strErrorId, strMessage);630 msgCenter().showRuntimeError(console(), fIsFatal, strErrorId, strMessage); 592 631 } 593 632 … … 1052 1091 1053 1092 /* Monitor selection if there are more than one monitor */ 1054 int cGuestScreens = uisession()->session().GetMachine().GetMonitorCount();1093 int cGuestScreens = machine().GetMonitorCount(); 1055 1094 if (cGuestScreens > 1) 1056 1095 { … … 1078 1117 1079 1118 /* Now the dock icon preview */ 1080 QString osTypeId = session().GetConsole().GetGuest().GetOSTypeId();1119 QString osTypeId = guest().GetOSTypeId(); 1081 1120 m_pDockIconPreview = new UIDockIconPreview(uisession(), vboxGlobal().vmGuestOSTypeIcon(osTypeId)); 1082 1121 … … 1266 1305 void UIMachineLogic::sltTypeCAD() 1267 1306 { 1268 CKeyboard keyboard = session().GetConsole().GetKeyboard(); 1269 Assert(!keyboard.isNull()); 1270 keyboard.PutCAD(); 1271 AssertWrapperOk(keyboard); 1307 keyboard().PutCAD(); 1308 AssertWrapperOk(keyboard()); 1272 1309 } 1273 1310 … … 1275 1312 void UIMachineLogic::sltTypeCABS() 1276 1313 { 1277 CKeyboard keyboard = session().GetConsole().GetKeyboard(); 1278 Assert(!keyboard.isNull()); 1279 static QVector<LONG> aSequence(6); 1280 aSequence[0] = 0x1d; /* Ctrl down */ 1281 aSequence[1] = 0x38; /* Alt down */ 1282 aSequence[2] = 0x0E; /* Backspace down */ 1283 aSequence[3] = 0x8E; /* Backspace up */ 1284 aSequence[4] = 0xb8; /* Alt up */ 1285 aSequence[5] = 0x9d; /* Ctrl up */ 1286 keyboard.PutScancodes(aSequence); 1287 AssertWrapperOk(keyboard); 1314 static QVector<LONG> sequence(6); 1315 sequence[0] = 0x1d; /* Ctrl down */ 1316 sequence[1] = 0x38; /* Alt down */ 1317 sequence[2] = 0x0E; /* Backspace down */ 1318 sequence[3] = 0x8E; /* Backspace up */ 1319 sequence[4] = 0xb8; /* Alt up */ 1320 sequence[5] = 0x9d; /* Ctrl up */ 1321 keyboard().PutScancodes(sequence); 1322 AssertWrapperOk(keyboard()); 1288 1323 } 1289 1324 #endif /* Q_WS_X11 */ … … 1305 1340 } 1306 1341 1307 /* Get current machine: */1308 CMachine machine = session().GetMachine();1309 1310 1342 /* Create take-snapshot dialog: */ 1311 1343 QWidget *pDlgParent = windowManager().realParentWindow(activeMachineWindow()); 1312 QPointer<VBoxTakeSnapshotDlg> pDlg = new VBoxTakeSnapshotDlg(pDlgParent, machine );1344 QPointer<VBoxTakeSnapshotDlg> pDlg = new VBoxTakeSnapshotDlg(pDlgParent, machine()); 1313 1345 windowManager().registerNewParent(pDlg, pDlgParent); 1314 1346 1315 1347 /* Assign corresponding icon: */ 1316 QString strTypeId = machine .GetOSTypeId();1348 QString strTypeId = machine().GetOSTypeId(); 1317 1349 pDlg->mLbIcon->setPixmap(vboxGlobal().vmGuestOSTypeIcon(strTypeId)); 1318 1350 1319 1351 /* Search for the max available filter index: */ 1320 1352 QString strNameTemplate = QApplication::translate("UIMachineLogic", "Snapshot %1"); 1321 int iMaxSnapshotIndex = searchMaxSnapshotIndex(machine , machine.FindSnapshot(QString()), strNameTemplate);1353 int iMaxSnapshotIndex = searchMaxSnapshotIndex(machine(), machine().FindSnapshot(QString()), strNameTemplate); 1322 1354 pDlg->mLeName->setText(strNameTemplate.arg(++ iMaxSnapshotIndex)); 1323 1355 … … 1340 1372 { 1341 1373 /* Prepare the take-snapshot progress: */ 1342 CConsole console = session().GetConsole(); 1343 CProgress progress = console.TakeSnapshot(strSnapshotName, strSnapshotDescription); 1344 if (console.isOk()) 1374 CProgress progress = console().TakeSnapshot(strSnapshotName, strSnapshotDescription); 1375 if (console().isOk()) 1345 1376 { 1346 1377 /* Show the take-snapshot progress: */ 1347 msgCenter().showModalProgressDialog(progress, machine .GetName(), ":/progress_snapshot_create_90px.png");1378 msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_snapshot_create_90px.png"); 1348 1379 if (!progress.isOk() || progress.GetResultCode() != 0) 1349 msgCenter().cannotTakeSnapshot(progress, machine .GetName());1380 msgCenter().cannotTakeSnapshot(progress, machineName()); 1350 1381 } 1351 1382 else 1352 msgCenter().cannotTakeSnapshot(console , machine.GetName());1383 msgCenter().cannotTakeSnapshot(console(), machineName()); 1353 1384 } 1354 1385 … … 1405 1436 1406 1437 /* Request the filename from the user. */ 1407 const CMachine &machine = session().GetMachine(); 1408 QFileInfo fi(machine.GetSettingsFilePath()); 1438 QFileInfo fi(machine().GetSettingsFilePath()); 1409 1439 QString strAbsolutePath(fi.absolutePath()); 1410 1440 QString strCompleteBaseName(fi.completeBaseName()); … … 1446 1476 { 1447 1477 /* Confirm/Reset current console: */ 1448 CMachine machine = session().GetMachine(); 1449 if (msgCenter().confirmResetMachine(machine.GetName())) 1450 session().GetConsole().Reset(); 1478 if (msgCenter().confirmResetMachine(machineName())) 1479 console().Reset(); 1451 1480 1452 1481 /* TODO_NEW_CORE: On reset the additional screens didn't get a display 1453 1482 update. Emulate this for now until it get fixed. */ 1454 ulong uMonitorCount = machine .GetMonitorCount();1483 ulong uMonitorCount = machine().GetMonitorCount(); 1455 1484 for (ulong uScreenId = 1; uScreenId < uMonitorCount; ++uScreenId) 1456 1485 machineWindows().at(uScreenId)->update(); … … 1495 1524 } 1496 1525 1497 powerOff( session().GetMachine().GetSnapshotCount() > 0);1526 powerOff(machine().GetSnapshotCount() > 0); 1498 1527 } 1499 1528 … … 1538 1567 * Its necessary to allow QObject hierarchy cleanup to delete this dialog if necessary: */ 1539 1568 QPointer<UISettingsDialogMachine> pDialog = new UISettingsDialogMachine(activeMachineWindow(), 1540 session().GetMachine().GetId(),1569 machine().GetId(), 1541 1570 strCategory, strControl); 1542 1571 /* Executing VM settings window. … … 1591 1620 AssertMsgReturnVoid(pAction, ("This slot should only be called by menu action!\n")); 1592 1621 1593 /* Current machine: */1594 const CMachine machine = session().GetMachine();1595 1622 /* Current mount-target: */ 1596 1623 const UIMediumTarget target = pAction->data().value<UIMediumTarget>(); 1597 1624 1598 1625 /* Update current machine mount-target: */ 1599 vboxGlobal().updateMachineStorage(machine , target);1626 vboxGlobal().updateMachineStorage(machine(), target); 1600 1627 } 1601 1628 … … 1609 1636 USBTarget target = pAction->data().value<USBTarget>(); 1610 1637 1611 /* Get current console: */1612 CConsole console = session().GetConsole();1613 1614 1638 /* Attach USB device: */ 1615 1639 if (target.attach) 1616 1640 { 1617 1641 /* Try to attach corresponding device: */ 1618 console .AttachUSBDevice(target.id);1642 console().AttachUSBDevice(target.id); 1619 1643 /* Check if console is OK: */ 1620 if (!console .isOk())1644 if (!console().isOk()) 1621 1645 { 1622 1646 /* Get current host: */ … … 1627 1651 CUSBDevice device(hostDevice); 1628 1652 /* Show a message about procedure failure: */ 1629 msgCenter().cannotAttachUSBDevice(console , vboxGlobal().details(device));1653 msgCenter().cannotAttachUSBDevice(console(), vboxGlobal().details(device)); 1630 1654 } 1631 1655 } … … 1634 1658 { 1635 1659 /* Search the console for the corresponding USB device: */ 1636 CUSBDevice device = console .FindUSBDeviceById(target.id);1660 CUSBDevice device = console().FindUSBDeviceById(target.id); 1637 1661 /* Try to detach corresponding device: */ 1638 console .DetachUSBDevice(target.id);1662 console().DetachUSBDevice(target.id); 1639 1663 /* Check if console is OK: */ 1640 if (!console .isOk())1664 if (!console().isOk()) 1641 1665 { 1642 1666 /* Show a message about procedure failure: */ 1643 msgCenter().cannotDetachUSBDevice(console , vboxGlobal().details(device));1667 msgCenter().cannotDetachUSBDevice(console(), vboxGlobal().details(device)); 1644 1668 } 1645 1669 } … … 1656 1680 1657 1681 /* Get current emulated USB: */ 1658 const CConsole &console = session().GetConsole(); 1659 CEmulatedUSB dispatcher = console.GetEmulatedUSB(); 1682 CEmulatedUSB dispatcher = console().GetEmulatedUSB(); 1660 1683 1661 1684 /* Attach webcam device: */ … … 1666 1689 /* Check if dispatcher is OK: */ 1667 1690 if (!dispatcher.isOk()) 1668 msgCenter().cannotAttachWebCam(dispatcher, target.name, console.GetMachine().GetName());1691 msgCenter().cannotAttachWebCam(dispatcher, target.name, machineName()); 1669 1692 } 1670 1693 /* Detach webcam device: */ … … 1675 1698 /* Check if dispatcher is OK: */ 1676 1699 if (!dispatcher.isOk()) 1677 msgCenter().cannotDetachWebCam(dispatcher, target.name, console.GetMachine().GetName());1700 msgCenter().cannotDetachWebCam(dispatcher, target.name, machineName()); 1678 1701 } 1679 1702 } … … 1683 1706 /* Assign new mode (without save): */ 1684 1707 KClipboardMode mode = pAction->data().value<KClipboardMode>(); 1685 session().GetMachine().SetClipboardMode(mode);1708 machine().SetClipboardMode(mode); 1686 1709 } 1687 1710 … … 1693 1716 AssertReturnVoid(pAction); 1694 1717 1695 /* Get and check current machine: */1696 CMachine machine = session().GetMachine();1697 AssertReturnVoid(!machine.isNull());1698 1699 1718 /* Get operation target: */ 1700 CNetworkAdapter adapter = machine .GetNetworkAdapter((ULONG)pAction->property("slot").toInt());1701 AssertReturnVoid(machine .isOk() && !adapter.isNull());1719 CNetworkAdapter adapter = machine().GetNetworkAdapter((ULONG)pAction->property("slot").toInt()); 1720 AssertReturnVoid(machine().isOk() && !adapter.isNull()); 1702 1721 1703 1722 /* Connect/disconnect cable to/from target: */ 1704 1723 adapter.SetCableConnected(!adapter.GetCableConnected()); 1705 machine .SaveSettings();1706 if (!machine .isOk())1707 msgCenter().cannotSaveMachineSettings(machine );1724 machine().SaveSettings(); 1725 if (!machine().isOk()) 1726 msgCenter().cannotSaveMachineSettings(machine()); 1708 1727 } 1709 1728 … … 1712 1731 /* Assign new mode (without save): */ 1713 1732 KDnDMode mode = pAction->data().value<KDnDMode>(); 1714 session().GetMachine().SetDnDMode(mode);1733 machine().SetDnDMode(mode); 1715 1734 } 1716 1735 … … 1722 1741 1723 1742 /* Access VRDE server: */ 1724 CMachine machine = session().GetMachine(); 1725 CVRDEServer server = machine.GetVRDEServer(); 1743 CVRDEServer server = machine().GetVRDEServer(); 1726 1744 AssertMsg(!server.isNull(), ("VRDE server should NOT be null!\n")); 1727 if (!machine .isOk() || server.isNull())1745 if (!machine().isOk() || server.isNull()) 1728 1746 return; 1729 1747 … … 1741 1759 { 1742 1760 /* Save machine-settings: */ 1743 machine .SaveSettings();1761 machine().SaveSettings(); 1744 1762 /* Machine still OK? */ 1745 if (!machine .isOk())1763 if (!machine().isOk()) 1746 1764 { 1747 1765 /* Notify about the error: */ 1748 msgCenter().cannotSaveMachineSettings(machine );1766 msgCenter().cannotSaveMachineSettings(machine()); 1749 1767 /* Make sure action is updated! */ 1750 1768 uisession()->updateStatusVRDE(); … … 1754 1772 { 1755 1773 /* Notify about the error: */ 1756 msgCenter().cannotToggleVRDEServer(server, machine .GetName(), fEnabled);1774 msgCenter().cannotToggleVRDEServer(server, machineName(), fEnabled); 1757 1775 /* Make sure action is updated! */ 1758 1776 uisession()->updateStatusVRDE(); … … 1767 1785 return; 1768 1786 1769 /* Access machine: */1770 CMachine machine = session().GetMachine();1771 AssertMsg(!machine.isNull(), ("Machine should NOT be null!\n"));1772 if (machine.isNull())1773 return;1774 1775 1787 /* Make sure something had changed: */ 1776 if (machine .GetVideoCaptureEnabled() == static_cast<BOOL>(fEnabled))1788 if (machine().GetVideoCaptureEnabled() == static_cast<BOOL>(fEnabled)) 1777 1789 return; 1778 1790 1779 1791 /* Update Video Capture state: */ 1780 AssertMsg(machine .isOk(), ("Machine should be OK!\n"));1781 machine .SetVideoCaptureEnabled(fEnabled);1792 AssertMsg(machine().isOk(), ("Machine should be OK!\n")); 1793 machine().SetVideoCaptureEnabled(fEnabled); 1782 1794 /* Machine is not OK? */ 1783 if (!machine .isOk())1795 if (!machine().isOk()) 1784 1796 { 1785 1797 /* Notify about the error: */ 1786 msgCenter().cannotToggleVideoCapture(machine , fEnabled);1798 msgCenter().cannotToggleVideoCapture(machine(), fEnabled); 1787 1799 /* Make sure action is updated! */ 1788 1800 uisession()->updateStatusVideoCapture(); … … 1792 1804 { 1793 1805 /* Save machine-settings: */ 1794 machine .SaveSettings();1806 machine().SaveSettings(); 1795 1807 /* Machine is not OK? */ 1796 if (!machine .isOk())1808 if (!machine().isOk()) 1797 1809 { 1798 1810 /* Notify about the error: */ 1799 msgCenter().cannotSaveMachineSettings(machine );1811 msgCenter().cannotSaveMachineSettings(machine()); 1800 1812 /* Make sure action is updated! */ 1801 1813 uisession()->updateStatusVideoCapture(); … … 1878 1890 { 1879 1891 NOREF(fState); 1880 CConsole console = session().GetConsole(); 1881 if (console.isOk()) 1882 { 1883 CMachineDebugger cdebugger = console.GetDebugger(); 1884 if (console.isOk()) 1885 cdebugger.SetLogEnabled(fState); 1886 } 1892 if (!debugger().isNull() && debugger().isOk()) 1893 debugger().SetLogEnabled(fState); 1887 1894 } 1888 1895 … … 1890 1897 { 1891 1898 /* Show VM Log Viewer: */ 1892 UIVMLogViewer::showLogViewerFor(activeMachineWindow(), session().GetMachine());1899 UIVMLogViewer::showLogViewerFor(activeMachineWindow(), machine()); 1893 1900 } 1894 1901 … … 1898 1905 void UIMachineLogic::sltDockPreviewModeChanged(QAction *pAction) 1899 1906 { 1900 CMachine machine = session().GetMachine(); 1901 if (!machine.isNull()) 1902 { 1903 bool fEnabled = pAction != actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_DisableMonitor); 1904 gEDataManager->setRealtimeDockIconUpdateEnabled(fEnabled, vboxGlobal().managedVMUuid()); 1905 updateDockOverlay(); 1906 } 1907 bool fEnabled = pAction != actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_DisableMonitor); 1908 gEDataManager->setRealtimeDockIconUpdateEnabled(fEnabled, vboxGlobal().managedVMUuid()); 1909 updateDockOverlay(); 1907 1910 } 1908 1911 1909 1912 void UIMachineLogic::sltDockPreviewMonitorChanged(QAction *pAction) 1910 1913 { 1911 CMachine machine = session().GetMachine(); 1912 if (!machine.isNull()) 1913 { 1914 gEDataManager->setRealtimeDockIconUpdateMonitor(pAction->data().toInt(), vboxGlobal().managedVMUuid()); 1915 updateDockOverlay(); 1916 } 1914 gEDataManager->setRealtimeDockIconUpdateMonitor(pAction->data().toInt(), vboxGlobal().managedVMUuid()); 1915 updateDockOverlay(); 1917 1916 } 1918 1917 … … 1925 1924 { 1926 1925 m_pDockPreviewSelectMonitorGroup->setEnabled(fEnabled); 1927 CMachine machine = session().GetMachine();1928 1926 m_DockIconPreviewMonitor = qMin(gEDataManager->realtimeDockIconUpdateMonitor(vboxGlobal().managedVMUuid()), 1929 (int)machine .GetMonitorCount() - 1);1927 (int)machine().GetMonitorCount() - 1); 1930 1928 } 1931 1929 /* Resize the dock icon in the case the preview monitor has changed. */ … … 1943 1941 // printf("%s: UIMachineLogic: sltSwitchKeyboardLedsToGuestLeds called, machine name is {%s}\n", 1944 1942 // strDt.toAscii().constData(), 1945 // session().GetMachine().GetName().toAscii().constData());1943 // machineName().toAscii().constData()); 1946 1944 1947 1945 /* Here we have to store host LED lock states. */ … … 1974 1972 // printf("%s: UIMachineLogic: sltSwitchKeyboardLedsToPreviousLeds called, machine name is {%s}\n", 1975 1973 // strDt.toAscii().constData(), 1976 // session().GetMachine().GetName().toAscii().constData());1974 // machineName().toAscii().constData()); 1977 1975 1978 1976 if (!isHidLedsSyncEnabled()) … … 2019 2017 2020 2018 /* Prepare/fill all storage menus: */ 2021 const CMachine machine = session().GetMachine(); 2022 foreach (const CMediumAttachment &attachment, machine.GetMediumAttachments()) 2019 foreach (const CMediumAttachment &attachment, machine().GetMediumAttachments()) 2023 2020 { 2024 2021 /* Current controller: */ 2025 const CStorageController controller = machine .GetStorageControllerByName(attachment.GetController());2022 const CStorageController controller = machine().GetStorageControllerByName(attachment.GetController()); 2026 2023 /* If controller present and device-type correct: */ 2027 2024 if (!controller.isNull() && attachment.GetType() == deviceType) … … 2056 2053 vboxGlobal().prepareStorageMenu(*pStorageMenu, 2057 2054 this, SLOT(sltMountStorageMedium()), 2058 machine , strControllerName, storageSlot);2055 machine(), strControllerName, storageSlot); 2059 2056 } 2060 2057 } … … 2063 2060 void UIMachineLogic::updateMenuDevicesNetwork(QMenu *pMenu) 2064 2061 { 2065 /* Get and check current machine: */2066 const CMachine machine = session().GetMachine();2067 AssertReturnVoid(!machine.isNull());2068 2069 2062 /* Determine how many adapters we should display: */ 2070 const KChipsetType chipsetType = machine .GetChipsetType();2063 const KChipsetType chipsetType = machine().GetChipsetType(); 2071 2064 const ULONG uCount = qMin((ULONG)4, vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(chipsetType)); 2072 2065 … … 2076 2069 { 2077 2070 /* Get and check iterated adapter: */ 2078 const CNetworkAdapter adapter = machine .GetNetworkAdapter(uSlot);2079 AssertReturnVoid(machine .isOk() && !adapter.isNull());2071 const CNetworkAdapter adapter = machine().GetNetworkAdapter(uSlot); 2072 AssertReturnVoid(machine().isOk() && !adapter.isNull()); 2080 2073 2081 2074 /* Skip disabled adapters: */ … … 2136 2129 2137 2130 /* Check if that USB device was already attached to this session: */ 2138 CConsole console = session().GetConsole(); 2139 const CUSBDevice attachedDevice = console.FindUSBDeviceById(device.GetId()); 2131 const CUSBDevice attachedDevice = console().FindUSBDeviceById(device.GetId()); 2140 2132 pAttachUSBAction->setChecked(!attachedDevice.isNull()); 2141 2133 pAttachUSBAction->setEnabled(hostDevice.GetState() != KUSBDeviceState_Unavailable); … … 2171 2163 { 2172 2164 /* Populate menu with host webcams: */ 2173 const QVector<QString> attachedWebcamPaths = session().GetConsole().GetEmulatedUSB().GetWebcams();2165 const QVector<QString> attachedWebcamPaths = console().GetEmulatedUSB().GetWebcams(); 2174 2166 foreach (const CHostVideoInputDevice &webcam, webcams) 2175 2167 { … … 2206 2198 pAction->setData(QVariant::fromValue(mode)); 2207 2199 pAction->setCheckable(true); 2208 pAction->setChecked( session().GetMachine().GetClipboardMode() == mode);2200 pAction->setChecked(machine().GetClipboardMode() == mode); 2209 2201 } 2210 2202 connect(m_pSharedClipboardActions, SIGNAL(triggered(QAction*)), … … 2214 2206 else 2215 2207 foreach (QAction *pAction, m_pSharedClipboardActions->actions()) 2216 if (pAction->data().value<KClipboardMode>() == session().GetMachine().GetClipboardMode())2208 if (pAction->data().value<KClipboardMode>() == machine().GetClipboardMode()) 2217 2209 pAction->setChecked(true); 2218 2210 } … … 2231 2223 pAction->setData(QVariant::fromValue(mode)); 2232 2224 pAction->setCheckable(true); 2233 pAction->setChecked( session().GetMachine().GetDnDMode() == mode);2225 pAction->setChecked(machine().GetDnDMode() == mode); 2234 2226 } 2235 2227 connect(m_pDragAndDropActions, SIGNAL(triggered(QAction*)), … … 2239 2231 else 2240 2232 foreach (QAction *pAction, m_pDragAndDropActions->actions()) 2241 if (pAction->data().value<KDnDMode>() == session().GetMachine().GetDnDMode())2233 if (pAction->data().value<KDnDMode>() == machine().GetDnDMode()) 2242 2234 pAction->setChecked(true); 2243 2235 } … … 2249 2241 bool fEnabled = false; 2250 2242 bool fChecked = false; 2251 const CConsole console = session().GetConsole(); 2252 if (console.isOk()) 2253 { 2254 const CMachineDebugger cdebugger = console.GetDebugger(); 2255 if (console.isOk()) 2256 { 2257 fEnabled = true; 2258 fChecked = cdebugger.GetLogEnabled() != FALSE; 2259 } 2243 if (!debugger().isNull() && debugger().isOk()) 2244 { 2245 fEnabled = true; 2246 fChecked = debugger().GetLogEnabled() != FALSE; 2260 2247 } 2261 2248 if (fEnabled != actionPool()->action(UIActionIndexRT_M_Debug_T_Logging)->isEnabled()) … … 2328 2315 { 2329 2316 /* Get console: */ 2330 const CConsole &console = session().GetConsole(); 2331 CDisplay display = console.GetDisplay(); 2332 const int cGuestScreens = uisession()->session().GetMachine().GetMonitorCount(); 2317 const int cGuestScreens = machine().GetMonitorCount(); 2333 2318 QList<QImage> images; 2334 2319 ULONG uMaxWidth = 0; … … 2344 2329 LONG yOrigin = 0; 2345 2330 KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled; 2346 display .GetScreenResolution(i, width, height, bpp, xOrigin, yOrigin, monitorStatus);2331 display().GetScreenResolution(i, width, height, bpp, xOrigin, yOrigin, monitorStatus); 2347 2332 uMaxWidth += width; 2348 2333 uMaxHeight = RT_MAX(uMaxHeight, height); 2349 2334 QImage shot = QImage(width, height, QImage::Format_RGB32); 2350 display .TakeScreenShot(i, shot.bits(), shot.width(), shot.height(), KBitmapFormat_BGR0);2335 display().TakeScreenShot(i, shot.bits(), shot.width(), shot.height(), KBitmapFormat_BGR0); 2351 2336 images << shot; 2352 2337 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r52894 r53030 40 40 class CSession; 41 41 class CMachine; 42 class CConsole; 43 class CDisplay; 44 class CGuest; 45 class CMouse; 46 class CKeyboard; 47 class CMachineDebugger; 42 48 class CSnapshot; 43 49 class CUSBDevice; … … 81 87 UISession* uisession() const { return m_pSession; } 82 88 UIActionPool* actionPool() const; 89 90 /** Returns the session reference. */ 83 91 CSession& session() const; 92 /** Returns the session's machine reference. */ 93 CMachine& machine() const; 94 /** Returns the session's console reference. */ 95 CConsole& console() const; 96 /** Returns the console's display reference. */ 97 CDisplay& display() const; 98 /** Returns the console's guest reference. */ 99 CGuest& guest() const; 100 /** Returns the console's mouse reference. */ 101 CMouse& mouse() const; 102 /** Returns the console's keyboard reference. */ 103 CKeyboard& keyboard() const; 104 /** Returns the console's debugger reference. */ 105 CMachineDebugger& debugger() const; 106 107 /** Returns the machine name. */ 108 const QString& machineName() const; 109 84 110 UIVisualStateType visualStateType() const { return m_visualStateType; } 85 111 const QList<UIMachineWindow*>& machineWindows() const { return m_machineWindowsList; }
Note:
See TracChangeset
for help on using the changeset viewer.