UIMachineLogic.cpp revision ef1aeb661bb788d96960da3d44b59024616ab15f
/* $Id$ */
/** @file
* VBox Qt GUI - UIMachineLogic class implementation.
*/
/*
* Copyright (C) 2010-2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
# include <precomp.h>
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
# include <QDesktopWidget>
# include <QDir>
# include <QFileInfo>
# include <QPainter>
# include <QTimer>
# include <QDateTime>
# include <QImageWriter>
# ifdef Q_WS_MAC
# include <QMenuBar>
# endif /* Q_WS_MAC */
# ifdef Q_WS_X11
# include <QX11Info>
# endif /* Q_WS_X11 */
/* GUI includes: */
# include "QIFileDialog.h"
# include "UIActionPoolRuntime.h"
# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
# include "UINetworkManager.h"
# include "UIDownloaderAdditions.h"
# endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
# include "UIIconPool.h"
# include "UIKeyboardHandler.h"
# include "UIMouseHandler.h"
# include "UIMachineLogic.h"
# include "UIMachineLogicFullscreen.h"
# include "UIMachineLogicNormal.h"
# include "UIMachineLogicSeamless.h"
# include "UIMachineLogicScale.h"
# include "UIFrameBuffer.h"
# include "UIMachineView.h"
# include "UIMachineWindow.h"
# include "UISession.h"
# include "VBoxGlobal.h"
# include "UIMessageCenter.h"
# include "UIPopupCenter.h"
# include "VBoxTakeSnapshotDlg.h"
# include "UIVMInfoDialog.h"
# include "UISettingsDialogSpecific.h"
# include "UIVMLogViewer.h"
# include "UIConverter.h"
# include "UIModalWindowManager.h"
# include "UIMedium.h"
# include "UIExtraDataManager.h"
# ifdef Q_WS_MAC
# include "DockIconPreview.h"
# include "UIExtraDataManager.h"
# endif /* Q_WS_MAC */
/* COM includes: */
# include "CVirtualBoxErrorInfo.h"
# include "CMachineDebugger.h"
# include "CSnapshot.h"
# include "CDisplay.h"
# include "CStorageController.h"
# include "CMediumAttachment.h"
# include "CHostUSBDevice.h"
# include "CUSBDevice.h"
# include "CVRDEServer.h"
# include "CSystemProperties.h"
# include "CHostVideoInputDevice.h"
# include "CEmulatedUSB.h"
# include "CNetworkAdapter.h"
# ifdef Q_WS_MAC
# include "CGuest.h"
# endif /* Q_WS_MAC */
/* Other VBox includes: */
# ifdef VBOX_WITH_DEBUGGER_GUI
# endif /* VBOX_WITH_DEBUGGER_GUI */
#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* VirtualBox interface declarations: */
#ifndef VBOX_WITH_XPCOM
# include "VirtualBox.h"
#else /* !VBOX_WITH_XPCOM */
# include "VirtualBox_XPCOM.h"
#endif /* VBOX_WITH_XPCOM */
#ifdef Q_WS_MAC
# include "DarwinKeyboard.h"
#endif /* Q_WS_MAC */
#ifdef Q_WS_WIN
# include "WinKeyboard.h"
#endif /* Q_WS_WIN */
#ifdef Q_WS_X11
# include <XKeyboard.h>
#endif /* Q_WS_X11 */
struct USBTarget
{
bool attach;
};
/** Describes enumerated webcam item. */
struct WebCamTarget
{
bool attach;
};
/* static */
{
UIMachineLogic *pLogic = 0;
switch (visualStateType)
{
case UIVisualStateType_Normal:
break;
break;
break;
case UIVisualStateType_Scale:
break;
}
return pLogic;
}
/* static */
{
delete pWhichLogic;
}
void UIMachineLogic::prepare()
{
/* Prepare required features: */
/* Prepare session connections: */
/* Prepare action groups:
* Note: This has to be done before prepareActionConnections
/* Prepare action connections: */
/* Prepare other connections: */
/* Prepare handlers: */
/* Prepare menu: */
prepareMenu();
/* Prepare machine window(s): */
#ifdef Q_WS_MAC
/* Prepare dock: */
prepareDock();
#endif /* Q_WS_MAC */
#if 0 /* To early! The debugger needs a VM handle to work. So, must be done after power on. Moved to initializePostPowerUp. */
#ifdef VBOX_WITH_DEBUGGER_GUI
/* Prepare debugger: */
#endif /* VBOX_WITH_DEBUGGER_GUI */
#endif
/* Load settings: */
loadSettings();
/* Retranslate logic part: */
}
void UIMachineLogic::cleanup()
{
/* Save settings: */
saveSettings();
#ifdef VBOX_WITH_DEBUGGER_GUI
/* Cleanup debugger: */
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef Q_WS_MAC
/* Cleanup dock: */
cleanupDock();
#endif /* Q_WS_MAC */
/* Cleanup menu: */
cleanupMenu();
/* Cleanup machine window(s): */
/* Cleanup handlers: */
/* Cleanup action connections: */
/* Cleanup action groups: */
}
void UIMachineLogic::initializePostPowerUp()
{
#ifdef VBOX_WITH_DEBUGGER_GUI
#endif
}
{
return uisession()->actionPool();
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
return uisession()->machineName();
}
{
/* Null if machine-window(s) not yet created: */
if (!isMachineWindowsCreated())
return 0;
/* First machine-window otherwise: */
return machineWindows().first();
}
{
/* Return null if windows are not created yet: */
if (!isMachineWindowsCreated())
return 0;
/* Check if there is an active window present: */
for (int i = 0; i < machineWindows().size(); ++i)
{
if (pIteratedWindow->isActiveWindow())
return pIteratedWindow;
}
/* Return main machine window: */
return mainMachineWindow();
}
{
/* By default, the only thing we need is to
* adjust machine-view size(s) if necessary: */
}
#ifdef Q_WS_MAC
void UIMachineLogic::updateDockIcon()
{
if (!isMachineWindowsCreated())
return;
if ( m_fIsDockIconEnabled
{
}
}
{
if (!isMachineWindowsCreated())
return;
if ( m_fIsDockIconEnabled
&& m_DockIconPreviewMonitor == screenId)
}
{
if ( m_fIsDockIconEnabled
return 0;
}
#endif /* Q_WS_MAC */
void UIMachineLogic::saveState()
{
/* Prevent auto-closure: */
setPreventAutoClose(true);
/* Was the step successful? */
bool fSuccess = true;
/* If VM is not paused, we should pause it: */
if (fSuccess && !fWasPaused)
/* Save-state: */
if (fSuccess)
/* Allow auto-closure: */
setPreventAutoClose(false);
/* Manually close Runtime UI: */
if (fSuccess)
uisession()->closeRuntimeUI();
}
void UIMachineLogic::shutdown()
{
/* Warn the user about ACPI is not available if so: */
if (!console().GetGuestEnteredACPIMode())
/* Shutdown: */
}
{
/* Prevent auto-closure: */
setPreventAutoClose(true);
/* Was the step successful? */
bool fSuccess = true;
/* Power-off: */
bool fServerCrashed = false;
/* Allow auto-closure: */
setPreventAutoClose(false);
/* Manually close Runtime UI: */
if (fSuccess)
uisession()->closeRuntimeUI();
}
{
/* If active machine-window is defined now: */
if (activeMachineWindow())
{
/* Reinstall corresponding popup-stack according 3D overlay visibility status: */
popupCenter().setPopupStackType(activeMachineWindow(), fVisible ? UIPopupStackType_Separate : UIPopupStackType_Embedded);
}
/* Notify other listeners: */
}
{
/* Do nothing if VBoxSVC still availabile: */
if (vboxGlobal().isVBoxSVCAvailable())
return;
/* Warn user about that: */
/* Power VM off: */
powerOff(false);
}
{
}
{
}
{
}
{
}
void UIMachineLogic::sltMachineStateChanged()
{
/* Get machine state: */
/* Update action groups: */
m_pRunningOrPausedOrStackedActions->setEnabled(uisession()->isRunning() || uisession()->isPaused() || uisession()->isStuck());
switch (state)
{
case KMachineState_Stuck:
{
/* Prevent machine-view from resizing: */
uisession()->setGuestResizeIgnored(true);
/* Get log-folder: */
/* Take the screenshot for debugging purposes: */
/* How should we handle Guru Meditation? */
switch (uisession()->guruMeditationHandlerType())
{
/* Ask how to proceed; Power off VM if proposal accepted: */
{
powerOff(false /* do NOT restore current snapshot */);
break;
}
/* Power off VM silently: */
{
powerOff(false /* do NOT restore current snapshot */);
break;
}
/* Just ignore it: */
default:
break;
}
break;
}
case KMachineState_Paused:
{
if (!pPauseAction->isChecked())
{
/* Was paused from CSession side: */
pPauseAction->blockSignals(true);
pPauseAction->setChecked(true);
pPauseAction->blockSignals(false);
}
break;
}
case KMachineState_Running:
{
if (pPauseAction->isChecked())
{
/* Was resumed from CSession side: */
pPauseAction->blockSignals(true);
pPauseAction->setChecked(false);
pPauseAction->blockSignals(false);
}
break;
}
case KMachineState_PoweredOff:
case KMachineState_Saved:
case KMachineState_Teleported:
case KMachineState_Aborted:
{
/* Is it allowed to close Runtime UI? */
if (!isPreventAutoClose())
{
/* VM has been powered off, saved, teleported or aborted.
* We must close Runtime UI: */
uisession()->closeRuntimeUI();
return;
}
break;
}
#ifdef Q_WS_X11
case KMachineState_Starting:
case KMachineState_Restoring:
{
/* The keyboard handler may wish to do some release logging on startup.
* Tell it that the logger is now active. */
break;
}
#endif
default:
break;
}
#ifdef Q_WS_MAC
/* Update Dock Overlay: */
#endif /* Q_WS_MAC */
}
{
/* Update action states: */
actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize)->setEnabled(uisession()->isGuestSupportsGraphics());
actionPool()->action(UIActionIndexRT_M_View_T_Seamless)->setEnabled(uisession()->isVisualStateAllowed(UIVisualStateType_Seamless) &&
uisession()->isGuestSupportsSeamless());
}
{
/* Variable falgs: */
/* For now MT stuff is not important for MI action: */
/* Update action state: */
pAction->setEnabled(fIsMouseSupportsAbsolute && fIsMouseSupportsRelative && !fIsMouseHostCursorNeeded);
pAction->setChecked(true);
}
{
}
void UIMachineLogic::sltKeyboardLedsChanged()
{
/* Here we have to update host LED lock states using values provided by UISession:
* [bool] uisession() -> isNumLock(), isCapsLock(), isScrollLock() can be used for that. */
if (!isHidLedsSyncEnabled())
return;
#if defined(Q_WS_MAC)
DarwinHidDevicesBroadcastLeds(m_pHostLedsState, uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock());
if (!winHidLedsInSync(uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock()))
{
keyboardHandler()->winSkipKeyboardEvents(true);
WinHidDevicesBroadcastLeds(uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock());
keyboardHandler()->winSkipKeyboardEvents(false);
}
else
LogRel2(("HID LEDs Sync: already in sync\n"));
#else
LogRelFlow(("UIMachineLogic::sltKeyboardLedsChanged: Updating host LED lock states does not supported on this platform.\n"));
#endif
}
void UIMachineLogic::sltUSBDeviceStateChange(const CUSBDevice &device, bool fIsAttached, const CVirtualBoxErrorInfo &error)
{
/* Check if USB device have anything to tell us: */
{
if (fIsAttached)
else
}
}
void UIMachineLogic::sltRuntimeError(bool fIsFatal, const QString &strErrorId, const QString &strMessage)
{
}
#ifdef Q_WS_MAC
void UIMachineLogic::sltShowWindows()
{
for (int i=0; i < machineWindows().size(); ++i)
{
/* Dunno what Qt thinks a window that has minimized to the dock
* should be - it is not hidden, neither is it minimized. OTOH it is
* marked shown and visible, but not activated. This latter isn't of
* much help though, since at this point nothing is marked activated.
* I might have overlooked something, but I'm buggered what if I know
* what. So, I'll just always show & activate the stupid window to
* make it get out of the dock when the user wishes to show a VM. */
pMachineWindow->raise();
}
}
#endif /* Q_WS_MAC */
{
LogRel(("UIMachineLogic: Guest-screen count changed.\n"));
/* Make sure all machine-window(s) have proper geometry: */
}
{
LogRel(("UIMachineLogic: Host-screen count changed.\n"));
/* Make sure all machine-window(s) have proper geometry: */
}
{
LogRel(("UIMachineLogic: Host-screen geometry changed.\n"));
/* Make sure all machine-window(s) have proper geometry: */
}
{
LogRel(("UIMachineLogic: Host-screen available-area changed.\n"));
/* Make sure all machine-window(s) have proper geometry: */
}
UIMachineLogic::UIMachineLogic(QObject *pParent, UISession *pSession, UIVisualStateType visualStateType)
, m_pKeyboardHandler(0)
, m_pMouseHandler(0)
, m_pRunningActions(0)
, m_fIsWindowsCreated(false)
, m_fIsPreventAutoClose(false)
#ifdef VBOX_WITH_DEBUGGER_GUI
, m_pDbgGui(0)
, m_pDbgGuiVT(0)
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef Q_WS_MAC
, m_fIsDockIconEnabled(true)
, m_pDockIconPreview(0)
#endif /* Q_WS_MAC */
, m_fIsHidLedsSyncEnabled(false)
{
}
{
/* Make sure something changed: */
if (m_fIsWindowsCreated == fIsWindowsCreated)
return;
/* Special handling for 'destroyed' case: */
if (!fIsWindowsCreated)
{
/* We ask popup-center to hide corresponding popup-stack *before* the remembering new value
* because we want UIMachineLogic::activeMachineWindow() to be yet alive. */
}
/* Remember new value: */
/* Special handling for 'created' case: */
if (fIsWindowsCreated)
{
/* We ask popup-center to show corresponding popup-stack *after* the remembering new value
* because we want UIMachineLogic::activeMachineWindow() to be already alive. */
}
}
{
}
{
/* Set new handler: */
/* Connect to session: */
}
{
/* Set new handler: */
/* Connect to session: */
}
void UIMachineLogic::retranslateUi()
{
#ifdef Q_WS_MAC
{
{
pAction->setText(QApplication::translate("UIMachineLogic", "Preview Monitor %1").arg(pAction->data().toInt() + 1));
}
}
#endif /* Q_WS_MAC */
/* Shared Clipboard actions: */
{
}
{
}
}
#ifdef Q_WS_MAC
void UIMachineLogic::updateDockOverlay()
{
/* Only to an update to the realtime preview if this is enabled by the user
* & we are in an state where the framebuffer is likely valid. Otherwise to
* the overlay stuff only. */
if (m_fIsDockIconEnabled &&
(state == KMachineState_Running ||
state == KMachineState_Paused ||
state == KMachineState_Restoring ||
state == KMachineState_Saving ||
else if (m_pDockIconPreview)
}
#endif /* Q_WS_MAC */
{
#ifdef Q_WS_MAC
# ifdef VBOX_WITH_ICHAT_THEATER
/* Init shared AV manager: */
# endif /* VBOX_WITH_ICHAT_THEATER */
#endif /* Q_WS_MAC */
}
{
/* We should watch for the VBoxSVC availability changes: */
this, SLOT(sltHandleVBoxSVCAvailabilityChange()));
connect(uisession(), SIGNAL(sigAdditionsStateChange()), this, SLOT(sltCheckForRequestedVisualStateType()));
/* Machine state-change updater: */
/* Guest additions state-change updater: */
connect(uisession(), SIGNAL(sigAdditionsStateActualChange()), this, SLOT(sltAdditionsStateChanged()));
/* Mouse capability state-change updater: */
/* Keyboard LEDs state-change updater: */
/* USB devices state-change updater: */
connect(uisession(), SIGNAL(sigUSBDeviceStateChange(const CUSBDevice &, bool, const CVirtualBoxErrorInfo &)),
/* Runtime errors notifier: */
#ifdef Q_WS_MAC
/* Show windows: */
#endif /* Q_WS_MAC */
/* Guest-monitor-change updater: */
/* Host-screen-change updaters: */
connect(uisession(), SIGNAL(sigHostScreenGeometryChange()), this, SLOT(sltHostScreenGeometryChange()));
connect(uisession(), SIGNAL(sigHostScreenAvailableAreaChange()), this, SLOT(sltHostScreenAvailableAreaChange()));
/* Frame-buffer connections: */
}
void UIMachineLogic::prepareActionGroups()
{
/* Create group for all actions that are enabled only when the VM is running.
* Note that only actions whose enabled state depends exclusively on the
* execution state of the VM are added to this group. */
m_pRunningActions = new QActionGroup(this);
m_pRunningActions->setExclusive(false);
/* Create group for all actions that are enabled when the VM is running or paused.
* Note that only actions whose enabled state depends exclusively on the
* execution state of the VM are added to this group. */
m_pRunningOrPausedActions = new QActionGroup(this);
m_pRunningOrPausedActions->setExclusive(false);
/* Create group for all actions that are enabled when the VM is running or paused or stucked.
* Note that only actions whose enabled state depends exclusively on the
* execution state of the VM are added to this group. */
m_pRunningOrPausedOrStackedActions = new QActionGroup(this);
/* Move actions into running actions group: */
#ifdef Q_WS_X11
#endif /* Q_WS_X11 */
m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCtrlBreak));
m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeInsert));
/* Move actions into running-n-paused actions group: */
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_S_TakeSnapshot));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_S_ShowInformation));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_S_TakeScreenshot));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_VideoCapture_S_Settings));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_VideoCapture_T_Start));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_MenuBar_S_Settings));
#ifndef Q_WS_MAC
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_MenuBar_T_Visibility));
#endif /* !Q_WS_MAC */
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_StatusBar_S_Settings));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_StatusBar_T_Visibility));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_Settings));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Mouse_T_Integration));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_HardDrives_S_Settings));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_OpticalDevices));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_FloppyDevices));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_Network_S_Settings));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_SharedClipboard));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_DragAndDrop));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_SharedFolders));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_SharedFolders_S_Settings));
m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_S_InstallGuestTools));
#ifdef Q_WS_MAC
#endif /* Q_WS_MAC */
/* Move actions into running-n-paused-n-stucked actions group: */
m_pRunningOrPausedOrStackedActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_S_PowerOff));
}
{
/* 'Machine' actions connections: */
this, SLOT(sltOpenVMSettingsDialog()));
this, SLOT(sltTakeSnapshot()));
this, SLOT(sltShowInformationDialog()));
this, SLOT(sltShutdown()));
#ifdef RT_OS_DARWIN
#else /* !RT_OS_DARWIN */
#endif /* !RT_OS_DARWIN */
/* 'View' actions connections: */
this, SLOT(sltToggleGuestAutoresize(bool)));
this, SLOT(sltAdjustWindow()));
this, SLOT(sltTakeScreenshot()));
connect(actionPool()->action(UIActionIndexRT_M_View_M_VideoCapture_S_Settings), SIGNAL(triggered()),
this, SLOT(sltOpenVideoCaptureOptions()));
this, SLOT(sltToggleVideoCapture(bool)));
this, SLOT(sltToggleVRDE(bool)));
/* 'Input' actions connections: */
this, SLOT(sltShowKeyboardSettings()));
this, SLOT(sltTypeCAD()));
#ifdef Q_WS_X11
this, SLOT(sltTypeCABS()));
#endif /* Q_WS_X11 */
connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCtrlBreak), SIGNAL(triggered()),
this, SLOT(sltTypeCtrlBreak()));
this, SLOT(sltTypeInsert()));
this, SLOT(sltToggleMouseIntegration(bool)));
/* 'Devices' actions connections: */
connect(actionPool(), SIGNAL(sigNotifyAboutMenuPrepare(int, QMenu*)), this, SLOT(sltHandleMenuPrepare(int, QMenu*)));
connect(actionPool()->action(UIActionIndexRT_M_Devices_M_HardDrives_S_Settings), SIGNAL(triggered()),
this, SLOT(sltOpenStorageSettingsDialog()));
this, SLOT(sltOpenNetworkSettingsDialog()));
connect(actionPool()->action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings), SIGNAL(triggered()),
this, SLOT(sltOpenUSBDevicesSettingsDialog()));
connect(actionPool()->action(UIActionIndexRT_M_Devices_M_SharedFolders_S_Settings), SIGNAL(triggered()),
this, SLOT(sltOpenSharedFoldersSettingsDialog()));
this, SLOT(sltInstallGuestAdditions()));
#ifdef VBOX_WITH_DEBUGGER_GUI
/* 'Debug' actions connections: */
this, SLOT(sltShowDebugStatistics()));
this, SLOT(sltShowDebugCommandLine()));
this, SLOT(sltLoggingToggled(bool)));
this, SLOT(sltShowLogDialog()));
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef Q_WS_MAC
/* 'Window' action connections: */
this, SLOT(sltMinimizeActiveMachineWindow()));
#endif /* Q_WS_MAC */
/* 'Help' actions connections: */
#ifdef RT_OS_DARWIN
#else /* !RT_OS_DARWIN */
#endif /* !RT_OS_DARWIN */
}
void UIMachineLogic::prepareHandlers()
{
/* Prepare menu update-handlers: */
m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_OpticalDevices] = &UIMachineLogic::updateMenuDevicesStorage;
m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_FloppyDevices] = &UIMachineLogic::updateMenuDevicesStorage;
m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_Network] = &UIMachineLogic::updateMenuDevicesNetwork;
m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_USBDevices] = &UIMachineLogic::updateMenuDevicesUSB;
m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_WebCams] = &UIMachineLogic::updateMenuDevicesWebCams;
m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_SharedClipboard] = &UIMachineLogic::updateMenuDevicesSharedClipboard;
m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_DragAndDrop] = &UIMachineLogic::updateMenuDevicesDragAndDrop;
#ifdef VBOX_WITH_DEBUGGER_GUI
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef Q_WS_MAC
#endif /* Q_WS_MAC */
/* Update UI session values with current: */
}
#ifdef Q_WS_MAC
void UIMachineLogic::prepareDock()
{
/* Add all the 'Machine' menu entries to the 'Dock' menu: */
{
/* Check if we really have correct action: */
/* Skip incorrect actions: */
if (!pAction)
continue;
/* Skip actions which have 'role' (to prevent consuming): */
continue;
/* Skip actions which have menu (to prevent consuming): */
continue;
}
QAction *pDockDisablePreview = actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_DisableMonitor);
QAction *pDockEnablePreviewMonitor = actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_PreviewMonitor);
this, SLOT(sltChangeDockIconUpdate(bool)));
/* Monitor selection if there are more than one monitor */
if (cGuestScreens > 1)
{
m_DockIconPreviewMonitor = qMin(gEDataManager->realtimeDockIconUpdateMonitor(vboxGlobal().managedVMUuid()),
cGuestScreens - 1);
m_pDockPreviewSelectMonitorGroup = new QActionGroup(this);
for (int i = 0; i < cGuestScreens; ++i)
{
pAction->setCheckable(true);
if (m_DockIconPreviewMonitor == i)
pAction->setChecked(true);
}
}
/* Add it to the dock. */
/* Now the dock icon preview */
/* Should the dock-icon be updated at runtime? */
if (fEnabled)
pDockEnablePreviewMonitor->setChecked(true);
else
{
pDockDisablePreview->setChecked(true);
}
}
#endif /* Q_WS_MAC */
#ifdef VBOX_WITH_DEBUGGER_GUI
void UIMachineLogic::prepareDebugger()
{
if (vboxGlobal().isDebuggerAutoShowEnabled())
{
}
}
#endif /* VBOX_WITH_DEBUGGER_GUI */
void UIMachineLogic::loadSettings()
{
/* Read cached extra-data value: */
connect(gEDataManager, SIGNAL(sigHidLedsSyncStateChange(bool)), this, SLOT(sltHidLedsSyncStateChanged(bool)));
#endif /* Q_WS_MAC || Q_WS_WIN */
/* HID LEDs sync initialization: */
}
void UIMachineLogic::saveSettings()
{
/* HID LEDs sync deinitialization: */
}
#ifdef VBOX_WITH_DEBUGGER_GUI
void UIMachineLogic::cleanupDebugger()
{
/* Close debugger: */
dbgDestroy();
}
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef Q_WS_MAC
void UIMachineLogic::cleanupDock()
{
if (m_pDockIconPreview)
{
delete m_pDockIconPreview;
m_pDockIconPreview = 0;
}
}
#endif /* Q_WS_MAC */
void UIMachineLogic::cleanupHandlers()
{
/* Cleanup mouse-handler: */
/* Cleanup keyboard-handler: */
}
{
/* Handle machine-window events: */
{
/* Make sure this window still registered: */
{
{
/* Handle *window activated* event: */
case QEvent::WindowActivate:
{
#ifdef Q_WS_WIN
/* We should save current lock states as *previous* and
* set current lock states to guest values we have,
* As we have no ipc between threads of different VMs
* we are using 100ms timer as lazy sync timout: */
/* On Windows host we should do that only in case if sync
* is enabled. Otherwise, keyboardHandler()->winSkipKeyboardEvents(false)
* won't be called in sltSwitchKeyboardLedsToGuestLeds() and guest
* will loose keyboard input forever. */
if (isHidLedsSyncEnabled())
{
keyboardHandler()->winSkipKeyboardEvents(true);
}
#else /* Q_WS_WIN */
/* Trigger callback synchronously for now! */
#endif /* !Q_WS_WIN */
break;
}
/* Handle *window deactivated* event: */
case QEvent::WindowDeactivate:
{
/* We should restore lock states to *previous* known: */
break;
}
/* Default: */
default: break;
}
}
}
/* Call to base-class: */
}
{
/* Update if there is update-handler: */
}
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Open Global Preferences: Input page: */
}
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
}
void UIMachineLogic::sltTypeCAD()
{
}
#ifdef Q_WS_X11
void UIMachineLogic::sltTypeCABS()
{
}
#endif /* Q_WS_X11 */
void UIMachineLogic::sltTypeCtrlBreak()
{
}
void UIMachineLogic::sltTypeInsert()
{
}
void UIMachineLogic::sltTakeSnapshot()
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Remember the paused state: */
if (!fWasPaused)
{
/* Suspend the VM and ignore the close event if failed to do so.
* pause() will show the error message to the user. */
return;
}
/* Create take-snapshot dialog: */
/* Assign corresponding icon: */
/* Search for the max available filter index: */
int iMaxSnapshotIndex = searchMaxSnapshotIndex(machine(), machine().FindSnapshot(QString()), strNameTemplate);
/* Exec the dialog: */
/* Make sure dialog still valid: */
if (!pDlg)
return;
/* Acquire variables: */
/* Destroy dialog early: */
delete pDlg;
/* Was the dialog accepted? */
if (fDialogAccepted)
{
/* Prepare the take-snapshot progress: */
{
/* Show the take-snapshot progress: */
msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_snapshot_create_90px.png");
}
else
}
/* Restore the running state if needed: */
if (!fWasPaused)
{
/* Make sure machine-state-change callback is processed: */
/* Unpause VM: */
}
}
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Invoke VM information dialog: */
}
void UIMachineLogic::sltReset()
{
/* TODO_NEW_CORE: On reset the additional screens didn't get a display
update. Emulate this for now until it get fixed. */
}
{
}
void UIMachineLogic::sltSaveState()
{
/* Make sure machine is in one of the allowed states: */
{
AssertMsgFailed(("Invalid machine-state. Action should be prohibited!"));
return;
}
saveState();
}
void UIMachineLogic::sltShutdown()
{
/* Make sure machine is in one of the allowed states: */
{
AssertMsgFailed(("Invalid machine-state. Action should be prohibited!"));
return;
}
shutdown();
}
void UIMachineLogic::sltPowerOff()
{
/* Make sure machine is in one of the allowed states: */
{
AssertMsgFailed(("Invalid machine-state. Action should be prohibited!"));
return;
}
}
void UIMachineLogic::sltClose()
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Do not try to close machine-window if restricted: */
if (isPreventAutoClose())
return;
* We have to make sure such window is hidden even if close-event was rejected.
* We are re-throwing this slot if any widget present to test again.
if (pWidget)
{
return;
}
/* Try to close active machine-window: */
activeMachineWindow()->close();
}
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Toggle guest-autoresize feature for all view(s)! */
}
void UIMachineLogic::sltAdjustWindow()
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Adjust all window(s)! */
{
/* Exit maximized window state if actual: */
if (pMachineWindow->isMaximized())
/* Normalize window geometry: */
}
}
void UIMachineLogic::sltTakeScreenshot()
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Which image formats for writing does this Qt version know of? */
/* Build a filters list out of it. */
{
/* Check there isn't an entry already (even if it just uses another capitalization) */
filters << s;
}
/* Try to select some common defaults. */
if (i == -1)
{
if (i == -1)
}
if (i != -1)
{
}
#ifdef Q_WS_WIN
/* Due to Qt bug, modal QFileDialog appeared above the active machine-window
* does not retreive the focus from the currently focused machine-view,
* as the result guest keyboard remains captured, so we should
* clear the focus from this machine-view initially: */
if (activeMachineWindow())
#endif /* Q_WS_WIN */
/* Request the filename from the user. */
tr("Select a filename for the screenshot ..."),
true /* resolve symlinks */,
true /* confirm overwrite */);
#ifdef Q_WS_WIN
/* Due to Qt bug, modal QFileDialog appeared above the active machine-window
* does not retreive the focus from the currently focused machine-view,
* as the result guest keyboard remains captured, so we already
* cleared the focus from this machine-view and should return
* that focus finally: */
if (activeMachineWindow())
#endif /* Q_WS_WIN */
/* Do the screenshot. */
if (!strFilename.isEmpty())
}
{
/* Open VM settings : Display page : Video Capture tab: */
}
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Make sure something had changed: */
return;
/* Update Video Capture state: */
{
/* Make sure action is updated: */
/* Notify about the error: */
}
/* Save machine-settings: */
machine().SaveSettings();
{
/* Make sure action is updated: */
/* Notify about the error: */
}
}
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Access VRDE server: */
("VRDE server should NOT be null!\n"));
/* Make sure something had changed: */
return;
/* Update VRDE server state: */
{
/* Make sure action is updated: */
uisession()->updateStatusVRDE();
/* Notify about the error: */
}
/* Save machine-settings: */
machine().SaveSettings();
{
/* Make sure action is updated: */
uisession()->updateStatusVRDE();
/* Notify about the error: */
}
}
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Create VM settings window on the heap!
* Its necessary to allow QObject hierarchy cleanup to delete this dialog if necessary: */
/* Executing VM settings window.
* This blocking function calls for the internal event-loop to process all further events,
* including event which can delete the dialog itself. */
/* Delete dialog if its still valid: */
if (pDialog)
delete pDialog;
/* We can't rely on MediumChange events as they are not yet properly implemented within Main.
* We can't watch for MachineData change events as well as they are of broadcast type
* and console event-handler do not processing broadcast events.
* But we still want to be updated after possible medium changes at least if they were
* originated from our side. */
pMachineWindow->updateAppearanceOf(UIVisualElement_HDStuff | UIVisualElement_CDStuff | UIVisualElement_FDStuff);
}
{
/* Machine settings: Storage page: */
sltOpenVMSettingsDialog("#storage");
}
{
/* Open VM settings : Network page: */
sltOpenVMSettingsDialog("#network");
}
{
/* Machine settings: Storage page: */
sltOpenVMSettingsDialog("#usb");
}
{
/* Do not process if additions are not loaded! */
if (!uisession()->isGuestAdditionsActive())
/* Open VM settings : Shared folders page: */
sltOpenVMSettingsDialog("#sharedFolders");
}
void UIMachineLogic::sltMountStorageMedium()
{
/* Sender action: */
/* Current mount-target: */
/* Update current machine mount-target: */
}
void UIMachineLogic::sltAttachUSBDevice()
{
/* Get and check sender action object: */
/* Get operation target: */
/* Attach USB device: */
{
/* Try to attach corresponding device: */
/* Check if console is OK: */
{
/* Get current host: */
/* Search the host for the corresponding USB device: */
/* Get USB device from host USB device: */
/* Show a message about procedure failure: */
}
}
/* Detach USB device: */
else
{
/* Search the console for the corresponding USB device: */
/* Try to detach corresponding device: */
/* Check if console is OK: */
{
/* Show a message about procedure failure: */
}
}
}
void UIMachineLogic::sltAttachWebCamDevice()
{
/* Get and check sender action object: */
/* Get operation target: */
/* Get current emulated USB: */
/* Attach webcam device: */
{
/* Try to attach corresponding device: */
/* Check if dispatcher is OK: */
if (!dispatcher.isOk())
}
/* Detach webcam device: */
else
{
/* Try to detach corresponding device: */
/* Check if dispatcher is OK: */
if (!dispatcher.isOk())
}
}
{
/* Assign new mode (without save): */
}
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Get and check 'the sender' action object: */
/* Get operation target: */
("Network adapter should NOT be null!\n"));
/* Connect/disconnect cable to/from target: */
/* Save machine-settings: */
machine().SaveSettings();
}
{
/* Assign new mode (without save): */
}
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Check for the already registered image */
const QString &name = QString("VBoxGuestAdditions_%1.iso").arg(vboxGlobal().vboxVersionStringNormalized());
{
/* Compare the name part ignoring the file case */
}
/* If downloader is running already: */
if (UIDownloaderAdditions::current())
{
/* Just show network access manager: */
gNetworkManager->show();
}
/* Else propose to download additions: */
else if (msgCenter().cannotFindGuestAdditions())
{
/* Create Additions downloader: */
/* After downloading finished => propose to install the Additions: */
connect(pDl, SIGNAL(sigDownloadFinished(const QString&)), uisession(), SLOT(sltInstallGuestAdditionsFrom(const QString&)));
/* Start downloading: */
}
#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
}
#ifdef VBOX_WITH_DEBUGGER_GUI
void UIMachineLogic::sltShowDebugStatistics()
{
if (dbgCreated())
{
}
}
{
if (dbgCreated())
{
}
}
{
}
void UIMachineLogic::sltShowLogDialog()
{
/* Show VM Log Viewer: */
}
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef Q_WS_MAC
{
/* Minimize active machine-window: */
}
{
/* Acquire appropriate sender action: */
{
/* Determine sender action index: */
{
/* Raise appropriate machine-window: */
{
pMachineWindow->show();
pMachineWindow->raise();
}
}
}
}
{
bool fEnabled = pAction != actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_DisableMonitor);
}
{
gEDataManager->setRealtimeDockIconUpdateMonitor(pAction->data().toInt(), vboxGlobal().managedVMUuid());
}
{
if (isMachineWindowsCreated())
{
{
m_DockIconPreviewMonitor = qMin(gEDataManager->realtimeDockIconUpdateMonitor(vboxGlobal().managedVMUuid()),
}
/* Resize the dock icon in the case the preview monitor has changed. */
}
}
#endif /* Q_WS_MAC */
{
// /* Log statement (printf): */
// QString strDt = QDateTime::currentDateTime().toString("HH:mm:ss:zzz");
// printf("%s: UIMachineLogic: sltSwitchKeyboardLedsToGuestLeds called, machine name is {%s}\n",
// strDt.toAscii().constData(),
// machineName().toAscii().constData());
/* Here we have to store host LED lock states. */
/* Here we have to update host LED lock states using values provided by UISession registry.
* [bool] uisession() -> isNumLock(), isCapsLock(), isScrollLock() can be used for that. */
if (!isHidLedsSyncEnabled())
return;
#if defined(Q_WS_MAC)
if (m_pHostLedsState == NULL)
DarwinHidDevicesBroadcastLeds(m_pHostLedsState, uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock());
if (m_pHostLedsState == NULL)
keyboardHandler()->winSkipKeyboardEvents(true);
WinHidDevicesBroadcastLeds(uisession()->isNumLock(), uisession()->isCapsLock(), uisession()->isScrollLock());
keyboardHandler()->winSkipKeyboardEvents(false);
#else
LogRelFlow(("UIMachineLogic::sltSwitchKeyboardLedsToGuestLeds: keep host LED lock states and broadcast guest's ones does not supported on this platform.\n"));
#endif
}
{
// /* Log statement (printf): */
// QString strDt = QDateTime::currentDateTime().toString("HH:mm:ss:zzz");
// printf("%s: UIMachineLogic: sltSwitchKeyboardLedsToPreviousLeds called, machine name is {%s}\n",
// strDt.toAscii().constData(),
// machineName().toAscii().constData());
if (!isHidLedsSyncEnabled())
return;
/* Here we have to restore host LED lock states. */
if (m_pHostLedsState)
{
#if defined(Q_WS_MAC)
keyboardHandler()->winSkipKeyboardEvents(true);
keyboardHandler()->winSkipKeyboardEvents(false);
#else
LogRelFlow(("UIMachineLogic::sltSwitchKeyboardLedsToPreviousLeds: restore host LED lock states does not supported on this platform.\n"));
#endif
}
}
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
/* Just show Global Preferences: */
}
{
/* Clear contents: */
/* Determine device-type: */
const QMenu *pOpticalDevicesMenu = actionPool()->action(UIActionIndexRT_M_Devices_M_OpticalDevices)->menu();
const QMenu *pFloppyDevicesMenu = actionPool()->action(UIActionIndexRT_M_Devices_M_FloppyDevices)->menu();
{
/* Current controller: */
const CStorageController controller = machine().GetStorageControllerByName(attachment.GetController());
/* If controller present and device-type correct: */
{
/* Current controller/attachment attributes: */
/* Prepare current storage menu: */
QMenu *pStorageMenu = 0;
/* If it will be more than one storage menu: */
{
/* We have to create sub-menu for each of them: */
pStorageMenu = new QMenu(QString("%1 (%2)").arg(strControllerName).arg(gpConverter->toString(storageSlot)), pMenu);
switch (controller.GetBus())
{
default: break;
}
}
/* Otherwise just use existing one: */
else pStorageMenu = pMenu;
/* Fill current storage menu: */
this, SLOT(sltMountStorageMedium()),
}
}
}
{
/* Determine how many adapters we should display: */
const ULONG uCount = qMin((ULONG)4, vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(chipsetType));
/* Enumerate existing network adapters: */
QMap<int, bool> adapterData;
{
/* Get and check iterated adapter: */
/* Skip disabled adapters: */
if (!adapter.GetEnabled())
continue;
/* Remember adapter data: */
}
/* Make sure at least one adapter was enabled: */
if (adapterData.isEmpty())
return;
/* Add new actions: */
{
QAction *pAction = pMenu->addAction(UIIconPool::iconSet(adapterData[iSlot] ? ":/connect_16px.png": ":/disconnect_16px.png"),
adapterData.size() == 1 ? tr("Connect Network Adapter") : tr("Connect Network Adapter %1").arg(iSlot + 1),
this, SLOT(sltToggleNetworkAdapterConnection()));
pAction->setCheckable(true);
}
}
{
/* Get current host: */
/* Get host USB device list: */
/* If device list is empty: */
{
/* Add only one - "empty" action: */
":/usb_unavailable_disabled_16px.png"),
tr("No USB Devices Connected"));
pEmptyMenuAction->setEnabled(false);
}
/* If device list is NOT empty: */
else
{
/* Populate menu with host USB devices: */
{
/* Get USB device from current host USB device: */
/* Create USB device action: */
this, SLOT(sltAttachUSBDevice()));
pAttachUSBAction->setCheckable(true);
/* Check if that USB device was already attached to this session: */
/* Set USB attach data: */
pAttachUSBAction->setData(QVariant::fromValue(USBTarget(!pAttachUSBAction->isChecked(), device.GetId())));
}
}
}
{
/* Clear contents: */
/* Get current host: */
/* Get host webcam list: */
/* If webcam list is empty: */
{
/* Add only one - "empty" action: */
QAction *pEmptyMenuAction = pMenu->addAction(UIIconPool::iconSet(":/web_camera_unavailable_16px.png",
":/web_camera_unavailable_disabled_16px.png"),
tr("No Webcams Connected"));
pEmptyMenuAction->setEnabled(false);
}
/* If webcam list is NOT empty: */
else
{
/* Populate menu with host webcams: */
{
/* Get webcam data: */
this, SLOT(sltAttachWebCamDevice()));
pAttachWebcamAction->setCheckable(true);
/* Check if that webcam was already attached to this session: */
/* Set USB attach data: */
pAttachWebcamAction->setData(QVariant::fromValue(WebCamTarget(!pAttachWebcamAction->isChecked(), strWebcamName, strWebcamPath)));
}
}
}
{
/* First run: */
{
m_pSharedClipboardActions = new QActionGroup(this);
for (int i = KClipboardMode_Disabled; i < KClipboardMode_Max; ++i)
{
pAction->setCheckable(true);
}
}
/* Subsequent runs: */
else
pAction->setChecked(true);
}
{
/* First run: */
if (!m_pDragAndDropActions)
{
m_pDragAndDropActions = new QActionGroup(this);
for (int i = KDnDMode_Disabled; i < KDnDMode_Max; ++i)
{
pAction->setCheckable(true);
}
}
/* Subsequent runs: */
else
pAction->setChecked(true);
}
#ifdef VBOX_WITH_DEBUGGER_GUI
{
/* The "Logging" item. */
bool fEnabled = false;
bool fChecked = false;
{
fEnabled = true;
}
}
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef Q_WS_MAC
{
/* Make sure 'Switch' action(s) are allowed: */
{
/* Append menu with actions to switch to machine-window(s): */
{
/* Create machine-window action: */
this, SLOT(sltSwitchToMachineWindow()));
{
pMachineWindowAction->setCheckable(true);
}
}
}
}
#endif /* Q_WS_MAC */
void UIMachineLogic::showGlobalPreferences(const QString &strCategory /* = QString() */, const QString &strControl /* = QString() */)
{
/* Do not process if window(s) missed! */
if (!isMachineWindowsCreated())
return;
#ifdef RT_OS_DARWIN
/* Check that we do NOT handling that already: */
return;
/* Remember that we handling that already: */
#else /* !RT_OS_DARWIN */
/* Check that we do NOT handling that already: */
return;
/* Remember that we handling that already: */
#endif /* !RT_OS_DARWIN */
/* Create and execute global settings window: */
if (pDialog)
delete pDialog;
#ifdef RT_OS_DARWIN
/* Remember that we do NOT handling that already: */
#else /* !RT_OS_DARWIN */
/* Remember that we do NOT handling that already: */
#endif /* !RT_OS_DARWIN */
}
const QString &strNameTemplate)
{
int iMaxIndex = 0;
{
/* Check the current snapshot name */
if (iPos != -1)
/* Traversing all the snapshot children */
{
}
}
return iMaxIndex;
}
void UIMachineLogic::takeScreenshot(const QString &strFile, const QString &strFormat /* = "png" */) const
{
/* Get console: */
ULONG uMaxHeight = 0;
/* First create screenshots of all guest screens and save them in a list.
* Also sum the width of all images and search for the biggest image height. */
for (int i = 0; i < cGuestScreens; ++i)
{
}
/* Create a image which will hold all sub images vertically. */
ULONG w = 0;
/* Paint them. */
{
}
p.end();
/* Save the big image in the requested format: */
bigImg.save(QDir::toNativeSeparators(QFile::encodeName(QString("%1.%2").arg(strPathWithoutSuffix, strSuffix))),
}
#ifdef VBOX_WITH_DEBUGGER_GUI
bool UIMachineLogic::dbgCreated()
{
if (m_pDbgGui)
return true;
if (hLdrMod == NIL_RTLDRMOD)
return false;
if (RT_SUCCESS(rc))
{
if (RT_SUCCESS(rc))
{
{
return true;
}
LogRel(("DBGGuiCreate failed, incompatible versions (loaded %#x/%#x, expected %#x)\n",
}
else
}
else
m_pDbgGui = 0;
m_pDbgGuiVT = 0;
return false;
}
void UIMachineLogic::dbgDestroy()
{
if (m_pDbgGui)
{
m_pDbgGui = 0;
m_pDbgGuiVT = 0;
}
}
void UIMachineLogic::dbgAdjustRelativePos()
{
if (m_pDbgGui)
{
}
}
#endif