UIMachineLogicScale.cpp revision f36543a0783c9fadf211ea3e98ef6578f5736ccd
/* $Id$ */
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* UIMachineLogicScale class implementation
*/
/*
* Copyright (C) 2010 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.
*/
/* Local includes */
#include "COMDefs.h"
#include "VBoxGlobal.h"
#include "UIMessageCenter.h"
#include "UISession.h"
#include "UIActionPoolRuntime.h"
#include "UIMachineLogicScale.h"
#include "UIMachineWindow.h"
#include "UIDownloaderAdditions.h"
#include "UIDownloaderExtensionPack.h"
#ifdef Q_WS_MAC
#include "VBoxUtils.h"
#endif /* Q_WS_MAC */
{
}
{
#ifdef Q_WS_MAC
/* Cleanup the dock stuff before the machine window(s): */
cleanupDock();
#endif /* Q_WS_MAC */
/* Cleanup machine window(s): */
/* Cleanup handlers: */
/* Cleanup actions groups: */
}
bool UIMachineLogicScale::checkAvailability()
{
/* Base class availability: */
if (!UIMachineLogic::checkAvailability())
return false;
/* Take the toggle hot key from the menu item. Since
* VBoxGlobal::extractKeyFromActionText gets exactly the
* linked key without the 'Host+' part we are adding it here. */
.arg(VBoxGlobal::extractKeyFromActionText(gActionPool->action(UIActionIndexRuntime_Toggle_Scale)->text()));
/* Show the info message. */
return false;
return true;
}
void UIMachineLogicScale::initialize()
{
/* Prepare required features: */
/* Prepare session connections: */
/* Prepare action groups:
* Note: This has to be done before prepareActionConnections
/* Prepare action connections: */
/* Prepare handlers: */
/* Prepare scale machine window: */
#ifdef Q_WS_MAC
/* Prepare dock: */
prepareDock();
#endif /* Q_WS_MAC */
/* Power up machine: */
/* Initialization: */
#ifdef VBOX_WITH_DEBUGGER_GUI
#endif /* VBOX_WITH_DEBUGGER_GUI */
/* Retranslate logic part: */
}
{
/* Base class action groups: */
/* Guest auto-resize isn't allowed in scale-mode: */
/* Adjust-window isn't allowed in scale-mode: */
}
{
/* Do not create window(s) if they created already: */
if (isMachineWindowsCreated())
return;
#ifdef Q_WS_MAC // TODO: Is that really need here?
/* We have to make sure that we are getting the front most process.
* This is necessary for Qt versions > 4.3.3: */
#endif /* Q_WS_MAC */
/* Get monitors count: */
/* Create machine window(s): */
/* Order machine window(s): */
/* Remember what machine window(s) created: */
setMachineWindowsCreated(true);
}
{
/* Do not cleanup machine window(s) if not present: */
if (!isMachineWindowsCreated())
return;
/* Cleanup machine window(s): */
}
{
/* Reenable guest-autoresize action: */
/* Reenable adjust-window action: */
}