UIMachineLogicNormal.cpp revision f7422473f089cb7f3b8be1c3fc223c441627d15c
/* $Id$ */
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* UIMachineLogicNormal class implementation
*/
/*
* Copyright (C) 2010 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
/* Global includes */
#include <QMenu>
/* Local includes */
#include "COMDefs.h"
#include "VBoxGlobal.h"
#include "VBoxProblemReporter.h"
#include "UISession.h"
#include "UIActionsPool.h"
#include "UIMachineLogicNormal.h"
#include "UIMachineWindow.h"
#include "UIMachineView.h"
#include "VBoxUtils.h"
UIMachineLogicNormal::UIMachineLogicNormal(QObject *pParent, UISession *pSession, UIActionsPool *pActionsPool)
{
}
{
/* Cleanup normal machine window: */
}
void UIMachineLogicNormal::initialize()
{
/* Check the status of required features: */
/* If required features are ready: */
if (!isPreventAutoStart())
{
/* Prepare console connections: */
/* Prepare action groups: */
/* Prepare action connections: */
/* Prepare normal machine window: */
#ifdef Q_WS_MAC
/* Prepare dock: */
prepareDock();
#endif /* Q_WS_MAC */
/* Initialization: */
}
}
{
}
{
}
{
}
{
/* Base class connections: */
/* This class connections: */
this, SLOT(sltPrepareNetworkAdaptersMenu()));
this, SLOT(sltPrepareSharedFoldersMenu()));
this, SLOT(sltPrepareMouseIntegrationMenu()));
}
{
/* Get monitor count: */
/* Do not create window(s) if created already: */
return;
/* List should not be filled partially: */
#ifdef Q_WS_MAC
/* 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 */
/* Create machine window(s): */
/* Order machine window(s): */
/* Notify others about machine window(s) created: */
setMachineWindowsCreated(true);
/* If we are not started yet: */
{
/* Start VM: */
CProgress progress = vboxGlobal().isStartPausedEnabled() || vboxGlobal().isDebuggerAutoShowEnabled() ?
#if 0 // TODO: Check immediate failure!
/* Check for an immediate failure: */
{
return;
}
/* Disable auto-closure because we want to have a chance to show the error dialog on startup failure: */
setPreventAutoClose(true);
#endif
vboxProblem().showModalProgressDialog(progress, machine.GetName(), defaultMachineWindow()->machineWindow(), 0);
else
vboxProblem().showModalProgressDialog(progress, machine.GetName(), defaultMachineWindow()->machineWindow());
#if 0 // TODO: Check immediate failure!
/* Check for an progress failure */
if (progress.GetResultCode() != 0)
{
return;
}
/* Enable auto-closure again: */
setPreventAutoClose(false);
/* Check if we missed a really quick termination after successful startup, and process it if we did: */
if (uisession()->isTurnedOff())
{
return;
}
#endif
#if 0 // TODO: Rework debugger logic!
# ifdef VBOX_WITH_DEBUGGER_GUI
/* Open the debugger in "full screen" mode requested by the user. */
else if (vboxGlobal().isDebuggerAutoShowEnabled())
{
/* console in upper left corner of the desktop. */
if (desktop)
if (!vboxGlobal().isStartPausedEnabled())
}
# endif
#endif
#ifdef VBOX_WITH_UPDATE_REQUEST
/* Check for updates if necessary: */
#endif
}
}
{
/* Do not cleanup machine window if it is not present: */
if (!isMachineWindowsCreated())
return;
/* Cleanup normal machine window: */
}