UIMessageCenter.cpp revision 35568bc855b9ac11d922f73c9d49d363db3f4993
/* $Id$ */
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* UIMessageCenter class implementation
*/
/*
* Copyright (C) 2006-2011 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.
*/
/* Global includes */
#include <QDir>
#include <QDesktopWidget>
#include <QFileInfo>
#include <QLocale>
#include <QThread>
#ifdef Q_WS_MAC
# include <QPushButton>
#endif
/* Local includes */
#include "UIMessageCenter.h"
#include "VBoxGlobal.h"
#include "UISelectorWindow.h"
#include "UIProgressDialog.h"
#include "UINetworkManager.h"
#ifdef VBOX_OSE
# include "UIDownloaderUserManual.h"
#endif /* VBOX_OSE */
#include "UIMachine.h"
#include "VBoxAboutDlg.h"
#include "UIHotKeyEditor.h"
#ifdef Q_WS_MAC
# include "VBoxUtils-darwin.h"
#endif
#if defined (Q_WS_WIN32)
# include <Htmlhelp.h>
#endif
bool UIMessageCenter::isAnyWarningShown()
{
/* Check if at least one warning is alive!
* All warnings are stored in m_warnings list as live pointers,
* this is why if some warning was deleted from another place,
* its pointer here will equal NULL... */
for (int i = 0; i < m_warnings.size(); ++i)
if (m_warnings[i])
return true;
return false;
}
{
}
{
}
{
}
void UIMessageCenter::closeAllWarnings()
{
/* Broadcast signal to perform emergent
* closing + deleting all the opened warnings. */
}
/**
* Shows a message box of the given type with the given text and with buttons
* according to arguments b1, b2 and b3 (in the same way as QMessageBox does
* it), and returns the user's choice.
*
* When all button arguments are zero, a single 'Ok' button is shown.
*
* If pcszAutoConfirmId is not null, then the message box will contain a
* checkbox "Don't show this message again" below the message text and its
* state will be saved in the global config. When the checkbox is in the
* checked state, this method doesn't actually show the message box but
* returns immediately. The return value in this case is the same as if the
* user has pressed the Enter key or the default button, but with
* AutoConfirmed bit set (AutoConfirmed alone is returned when no default
* button is defined in button arguments).
*
* @param pParent
* Parent widget or 0 to use the desktop as the pParent. Also,
* #mainWindowShown can be used to determine the currently shown VBox
* main window (Selector or Console).
* @param type
* One of values of the Type enum, that defines the message box
* title and icon.
* @param strMessage
* Message text to display (can contain simple Qt-html tags).
* @param strDetails
* Detailed message description displayed under the main message text using
* QTextEdit (that provides rich text support and scrollbars when necessary).
* If equals to QString::null, no details text box is shown.
* @param pcszAutoConfirmId
* ID used to save the auto confirmation state across calls. If null,
* the auto confirmation feature is turned off (and no checkbox is shown)
* @param button1
* First button code or 0, see QIMessageBox for a list of codes.
* @param button2
* Second button code or 0, see QIMessageBox for a list of codes.
* @param button3
* Third button code or 0, see QIMessageBox for a list of codes.
* @param strText1
* Optional custom text for the first button.
* @param strText2
* Optional custom text for the second button.
* @param strText3
* Optional custom text for the third button.
*
* @return
* code of the button pressed by the user
*/
const char *pcszAutoConfirmId /* = 0 */,
int button1 /* = 0 */,
int button2 /* = 0 */,
int button3 /* = 0 */,
{
if (pcszAutoConfirmId)
{
{
int rc = AutoConfirmed;
return rc;
}
}
switch (type)
{
default:
case Info:
break;
case Question:
break;
case Warning:
break;
case Error:
break;
case Critical:
break;
case GuruMeditation:
break;
}
if (!strDetails.isEmpty())
if (pcszAutoConfirmId)
{
box->setFlagChecked(false);
}
m_warnings << box;
if (pcszAutoConfirmId)
{
{
}
}
if (box)
delete box;
return rc;
}
/** @fn message(QWidget *, Type, const QString &, const char *, int, int,
* int, const QString &, const QString &, const QString &)
*
* A shortcut to #message() that doesn't require to specify the details
* text(QString::null is assumed).
*/
/** @fn messageYesNo(QWidget *, Type, const QString &, const QString &, const char *)
*
* A shortcut to #message() that shows 'Yes' and 'No' buttons ('Yes' is the
* default) and returns true when the user selects Yes.
*/
/** @fn messageYesNo(QWidget *, Type, const QString &, const char *)
*
* A shortcut to #messageYesNo() that doesn't require to specify the details
* text(QString::null is assumed).
*/
const QString &strMessage,
const QString &strOptionText,
bool fDefaultOptionValue /* = true */,
int iButton1 /* = 0 */,
int iButton2 /* = 0 */,
int iButton3 /* = 0 */,
{
/* If no buttons are set, using single 'OK' button: */
/* Assign corresponding title and icon: */
switch (type)
{
default:
case Info:
break;
case Question:
break;
case Warning:
break;
case Error:
break;
case Critical:
break;
case GuruMeditation:
break;
}
/* Create message-box: */
{
/* Append the list of all warnings with current: */
m_warnings << pBox;
/* Setup message-box connections: */
/* Assign other text values: */
if (!strOptionText.isNull())
{
}
if (!strButtonName1.isNull())
if (!strButtonName2.isNull())
if (!strButtonName3.isNull())
if (!strDetails.isEmpty())
/* Show the message box: */
/* Its possible what message-box will be deleted during some event-processing procedure,
* in that case pBox will be null right after pBox->exec() returns from it's event-pool,
* so we have to check this too: */
if (pBox)
{
/* Cleanup the list of all warnings from current: */
/* Check if option was chosen: */
if (pBox->isFlagChecked())
/* Destroy message-box: */
if (pBox)
delete pBox;
/* Return final result: */
return iResultCode;
}
}
return 0;
}
/**
* Shows a modal progress dialog using a CProgress object passed as an
* argument to track the progress.
*
* @param progress progress object to track
* @param aTitle title prefix
* @param pParent pParent widget
* @param aMinDuration time (ms) that must pass before the dialog appears
*/
bool fSheetOnDarwin /* = false */,
int cMinDuration /* = 2000 */)
{
UIProgressDialog progressDlg(progress, strTitle, pPixmap, fSheetOnDarwin, cMinDuration, pParent ? pParent : mainWindowShown());
/* Run the dialog with the 350 ms refresh interval. */
if (pPixmap)
delete pPixmap;
return true;
}
/**
* Returns what main window (VM selector or main VM window) is now shown, or
* zero if none of them. Main VM window takes precedence.
*/
{
/* It may happen that this method is called during VBoxGlobal
* initialization or even after it failed (for example, to show some
* error message). Return no main window in this case: */
if (!vboxGlobal().isValid())
return 0;
if (vboxGlobal().isVMConsoleProcess())
{
}
else
{
}
return 0;
}
/**
* Returns main machine window is now shown, or zero if none of them.
*/
{
/* It may happen that this method is called during VBoxGlobal
* initialization or even after it failed (for example, to show some
* error message). Return no main window in this case: */
if (!vboxGlobal().isValid())
return 0;
return 0;
}
/**
* Returns network access manager window if visible
* and window returned by mainWindowShown() otherwise.
*/
{
}
/**
* Returns network access manager window if visible
* and window returned by mainMachineWindowShown() otherwise.
*/
{
return gNetworkManager->window()->isVisible() ? gNetworkManager->window() : mainMachineWindowShown();
}
{
return messageYesNo(pParent, Question, tr("A file named <b>%1</b> already exists. Are you sure you want to replace it?<br /><br />Replacing it will overwrite its contents.").arg(strPath));
}
bool UIMessageCenter::askForOverridingFiles(const QVector<QString>& strPaths, QWidget *pParent /* = NULL */)
{
/* If it is only one file use the single question versions above */
return messageYesNo(pParent, Question, tr("The following files already exist:<br /><br />%1<br /><br />Are you sure you want to replace them? Replacing them will overwrite their contents.").arg(QStringList(strPaths.toList()).join("<br />")));
else
return true;
}
bool UIMessageCenter::askForOverridingFileIfExists(const QString& strPath, QWidget *pParent /* = NULL */)
{
else
return true;
}
bool UIMessageCenter::askForOverridingFilesIfExists(const QVector<QString>& strPaths, QWidget *pParent /* = NULL */)
{
{
}
/* If it is only one file use the single question versions above */
else
return true;
}
{
#ifdef RT_OS_LINUX
{
for (;;)
{
break;
}
"We strongly recommend that you change this, as it is a severe mis-configuration of "
"your system which could cause USB devices to fail in unexpected ways."),
"checkForMountedWrongUSB");
}
#endif
}
void UIMessageCenter::showBETAWarning()
{
(0, Warning,
tr("You are running a prerelease version of VirtualBox. "
"This version is not suitable for production use."));
}
void UIMessageCenter::showBEBWarning()
{
(0, Warning,
tr("You are running an EXPERIMENTAL build of VirtualBox. "
"This version is not suitable for production use."));
}
#ifdef Q_WS_X11
{
(0, UIMessageCenter::Error,
tr("Failed to find license files in "
"<nobr><b>%1</b></nobr>.")
}
#endif
{
tr("Failed to open the license file <nobr><b>%1</b></nobr>. "
"Check file permissions.")
}
{
tr("Failed to open <tt>%1</tt>. Make sure your desktop environment "
"can properly handle URLs of this type.")
}
{
tr("<p>Could not find a language file for the language "
"<b>%1</b> in the directory <b><nobr>%2</nobr></b>.</p>"
"<p>The language will be temporarily reset to the system "
"default language. Please go to the <b>Preferences</b> "
"dialog which you can open from the <b>File</b> menu of the "
"main VirtualBox window, and select one of the existing "
"languages on the <b>Language</b> page.</p>")
}
{
tr("<p>Could not load the language file <b><nobr>%1</nobr></b>. "
"<p>The language will be temporarily reset to English (built-in). "
"Please go to the <b>Preferences</b> "
"dialog which you can open from the <b>File</b> menu of the "
"main VirtualBox window, and select one of the existing "
"languages on the <b>Language</b> page.</p>")
.arg(strLangFile));
}
{
tr("<p>Failed to initialize COM or to find the VirtualBox COM server. "
"Most likely, the VirtualBox server is not running "
"or failed to start.</p>"
"<p>The application will now terminate.</p>"),
}
{
tr("<p>Failed to initialize COM because the VirtualBox global "
"configuration directory <b><nobr>%1</nobr></b> is not accessible. "
"Please check the permissions of this directory and of its parent "
"directory.</p>"
}
{
tr("<p>Failed to create the VirtualBox COM object.</p>"
"<p>The application will now terminate.</p>"),
}
{
/* preserve the current error info before calling the object again */
tr("<p>Failed to load the global GUI configuration from "
"<b><nobr>%1</nobr></b>.</p>"
"<p>The application will now terminate.</p>")
}
{
/* preserve the current error info before calling the object again */
tr("<p>Failed to save the global GUI configuration to "
"<b><nobr>%1</nobr></b>.</p>"
"<p>The application will now terminate.</p>")
}
{
tr("Failed to set global VirtualBox properties."),
}
{
/* If IMachine::GetUSBController(), IHost::GetUSBDevices() etc. return
* E_NOTIMPL, it means the USB support is intentionally missing
* (as in the OSE version). Don't show the error message in this case. */
return;
tr("Failed to access the USB subsystem."),
"cannotAccessUSB");
}
{
tr("Failed to create a new virtual machine."),
);
}
{
tr("Failed to create a new virtual machine <b>%1</b>.")
);
}
void UIMessageCenter::cannotOpenMachine(QWidget *pParent, const QString &strMachinePath, const CVirtualBox &vbox)
{
tr("Failed to open virtual machine located in %1.")
}
{
tr("Failed to register the virtual machine <b>%1</b>.")
}
void UIMessageCenter::cannotReregisterMachine(QWidget *pParent, const QString &strMachinePath, const QString &strMachineName)
{
tr("Failed to add virtual machine <b>%1</b> located in <i>%2</i> because its already present.")
}
{
tr("Failed to apply the settings to the virtual machine <b>%1</b>.")
);
}
void UIMessageCenter::cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent /* = 0 */)
{
/* preserve the current error info before calling the object again */
tr("Failed to save the settings of the virtual machine "
"<b>%1</b> to <b><nobr>%2</nobr></b>.")
}
/**
* @param fStrict If |false|, this method will silently return if the COM
* result code is E_NOTIMPL.
*/
bool fStrict /* = true */,
{
/* If COM result code is E_NOTIMPL, it means the requested object or
* function is intentionally missing (as in the OSE version). Don't show
* the error message in this case. */
return;
tr("Failed to load the settings of the virtual machine "
"<b>%1</b> from <b><nobr>%2</nobr></b>.")
}
{
tr("<p>The machine settings were changed while you were editing them. "
"You currently have unsaved setting changes.</p>"
"<p>Would you like to reload the changed settings or to keep your own changes?</p>"), 0,
}
{
if (isAlreadyShown("warnAboutStateChange"))
return;
setShownStatus("warnAboutStateChange");
tr("The virtual machine that you are changing has been started. "
"Only certain settings can be changed while a machine is running. "
"All other changes will be lost if you close this window now."));
clearShownStatus("warnAboutStateChange");
}
{
/* preserve the current error info before calling the object again */
tr("Failed to start the virtual machine <b>%1</b>.")
}
{
tr("Failed to start the virtual machine <b>%1</b>.")
);
}
{
/* preserve the current error info before calling the object again */
tr("Failed to pause the execution of the virtual machine <b>%1</b>.")
}
{
/* preserve the current error info before calling the object again */
tr("Failed to resume the execution of the virtual machine <b>%1</b>.")
}
{
/* preserve the current error info before calling the object again */
tr("Failed to send the ACPI Power Button press event to the "
"virtual machine <b>%1</b>.")
}
{
/* preserve the current error info before calling the object again */
tr("Failed to save the state of the virtual machine <b>%1</b>.")
}
{
tr("Failed to save the state of the virtual machine <b>%1</b>.")
);
}
{
tr("Failed to clone the virtual machine <b>%1</b>.")
);
}
{
tr("Failed to clone the virtual machine <b>%1</b>.")
);
}
{
/* preserve the current error info before calling the object again */
tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
}
{
tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
);
}
{
/* preserve the current error info before calling the object again */
tr("Failed to stop the virtual machine <b>%1</b>.")
}
{
tr("Failed to stop the virtual machine <b>%1</b>.")
}
{
/* preserve the current error info before calling the object again */
}
{
}
{
/* preserve the current error info before calling the object again */
tr("Failed to discard the saved state of the virtual machine <b>%1</b>.")
}
{
tr("You are trying to shut down the guest with the ACPI power "
"button. This is currently not possible because the guest "
"does not support software shutdown."));
}
{
if (fHWVirtExSupported)
"not operational. Your 64-bit guest will fail to detect a "
"64-bit CPU and will not be able to boot.</p><p>Please ensure "
"host computer.</p>"),
0 /* pcszAutoConfirmId */,
else
"Your 64-bit guest will fail to detect a 64-bit CPU and will "
"not be able to boot."),
0 /* pcszAutoConfirmId */,
}
{
if (fHWVirtExSupported)
"not operational. Certain guests (e.g. OS/2 and QNX) require "
"this feature.</p><p>Please ensure "
"host computer.</p>"),
0 /* pcszAutoConfirmId */,
else
"Certain guests (e.g. OS/2 and QNX) require this feature and will "
"fail to boot without it.</p>"),
0 /* pcszAutoConfirmId */,
}
int UIMessageCenter::askAboutSnapshotRestoring(const QString &strSnapshotName, bool fAlsoCreateNewSnapshot)
{
return fAlsoCreateNewSnapshot ?
tr("<p>You are about to restore snapshot <b>%1</b>.</p>"
"<p>You can create a snapshot of the current state of the virtual machine first by checking the box below; "
"if you do not do this the current state will be permanently lost. Do you wish to proceed?</p>")
tr("Create a snapshot of the current machine state"),
!vboxGlobal().virtualBox().GetExtraDataStringList(VBoxDefs::GUI_InvertMessageOption).contains("askAboutSnapshotRestoring"),
0 /* auto-confirmation token */,
}
{
tr("<p>Deleting the snapshot will cause the state information saved in it to be lost, and disk data spread over "
"several image files that VirtualBox has created together with the snapshot will be merged into one file. This can be a lengthy process, and the information "
"in the snapshot cannot be recovered.</p></p>Are you sure you want to delete the selected snapshot <b>%1</b>?</p>")
/* Do NOT allow this message to be disabled! */
NULL /* pcszAutoConfirmId */,
}
const QString &strTargetImageName,
const QString &strTargetImageMaxSize,
const QString &strTargetFileSystemFree)
{
tr("<p>Deleting the snapshot %1 will temporarily need more disk space. In the worst case the size of image %2 will grow by %3, "
"however on this filesystem there is only %4 free.</p><p>Running out of disk space during the merge operation can result in "
"corruption of the image and the VM configuration, i.e. loss of the VM and its data.</p><p>You may continue with deleting "
"the snapshot at your own risk.</p>")
/* Do NOT allow this message to be disabled! */
NULL /* pcszAutoConfirmId */,
}
const QString &strSnapshotName)
{
tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
}
const QString &strSnapshotName)
{
tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
}
const QString &strSnapshotName)
{
tr("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
}
const QString &strSnapshotName)
{
tr("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
}
{
tr("Can't find snapshot named <b>%1</b>.")
);
}
{
tr("There is no virtual machine named <b>%1</b>.")
);
}
ULONG /* uHeight */,
ULONG /* uBpp */,
{
tr("<p>Could not enter seamless mode due to insufficient guest "
"video memory.</p>"
"<p>You should configure the virtual machine to have at "
"least <b>%1</b> of video memory.</p>")
}
ULONG /* uHeight */,
ULONG /* uBpp */,
{
tr("<p>Could not switch the guest display to fullscreen mode due "
"to insufficient guest video memory.</p>"
"<p>You should configure the virtual machine to have at "
"least <b>%1</b> of video memory.</p>"
"<p>Press <b>Ignore</b> to switch to fullscreen mode anyway "
"or press <b>Cancel</b> to cancel the operation.</p>")
0, /* pcszAutoConfirmId */
}
{
tr("<p>Could not change the guest screen to this host screen "
"due to insufficient guest video memory.</p>"
"<p>You should configure the virtual machine to have at "
"least <b>%1</b> of video memory.</p>")
}
{
tr("<p>Could not change the guest screen to this host screen "
"due to insufficient guest video memory.</p>"
"<p>You should configure the virtual machine to have at "
"least <b>%1</b> of video memory.</p>"
"<p>Press <b>Ignore</b> to switch the screen anyway "
"or press <b>Cancel</b> to cancel the operation.</p>")
0, /* pcszAutoConfirmId */
}
{
tr("<p>Can not switch the guest display to fullscreen mode. You "
"have more virtual screens configured than physical screens are "
"attached to your host.</p><p>Please either lower the virtual "
"screens in your VM configuration or attach additional screens "
"to your host.</p>"),
0, /* pcszAutoConfirmId */
}
{
tr("<p>Can not switch the guest display to seamless mode. You "
"have more virtual screens configured than physical screens are "
"attached to your host.</p><p>Please either lower the virtual "
"screens in your VM configuration or attach additional screens "
"to your host.</p>"),
0, /* pcszAutoConfirmId */
}
{
/* Enumerate VMs: */
int cInacessibleVMCount = 0;
bool fVMWithHDPresent = false;
{
/* Get iterated VM: */
/* Prepare VM name: */
if (machine.GetAccessible())
{
/* Get VM name: */
/* Enumerate attachments: */
{
/* Get current attachment: */
/* Check if the medium is a hard disk: */
{
/* Check if that hard disk isn't shared.
* If hard disk is shared, it will *never* be deleted: */
{
fVMWithHDPresent = true;
break;
}
}
}
}
else
{
/* Get VM name: */
strMachineName = VBoxGlobal::hasAllowedExtension(fi.completeSuffix(), VBoxDefs::VBoxFileExts) ? fi.completeBaseName() : fi.fileName();
/* Increment inacessible VM count: */
}
/* Compose VM name list: */
}
/* Prepare message text: */
tr("<p>You are about to remove following inaccessible virtual machines from the machine list:</p>"
"<p>%1</p>"
"<p>Do you wish to proceed?</p>")
.arg(strVMNames) :
tr("<p>You are about to remove following virtual machines from the machine list:</p>"
"<p>%1</p>"
"<p>Would you like to delete the files containing the virtual machine from your hard disk as well? "
"Doing this will also remove the files containing the machine's virtual hard disks "
"if they are not in use by another machine.</p>")
.arg(strVMNames) :
tr("<p>You are about to remove following virtual machines from the machine list:</p>"
"<p>%1</p>"
"<p>Would you like to delete the files containing the virtual machine from your hard disk as well?</p>")
.arg(strVMNames);
/* Prepare message itself: */
0, /* auto-confirm id */
0,
tr("Remove")) :
0, /* auto-confirm id */
tr("Delete all files"),
tr("Remove only"));
}
{
tr("<p>Are you sure you want to discard the saved state of "
"the virtual machine <b>%1</b>?</p>"
"<p>This operation is equivalent to resetting or powering off "
"the machine without doing a proper shutdown of the "
"guest OS.</p>")
0 /* pcszAutoConfirmId */,
}
{
tr("<p>Error changing medium type from <b>%1</b> to <b>%2</b>.</p>")
}
const VBoxMedium &aMedium,
{
/** @todo (translation-related): the gender of "the" in translations
* will depend on the gender of aMedium.type(). */
tr("<p>Are you sure you want to release the %1 "
"<nobr><b>%2</b></nobr>?</p>"
"<p>This will detach it from the "
"following virtual machine(s): <b>%3</b>.</p>")
0 /* pcszAutoConfirmId */,
}
const VBoxMedium &aMedium)
{
/** @todo (translation-related): the gender of "the" in translations
* will depend on the gender of aMedium.type(). */
tr("<p>Are you sure you want to remove the %1 "
"<nobr><b>%2</b></nobr> from the list of known media?</p>")
{
msg +=
tr("Note that as this hard disk is inaccessible its "
"storage unit cannot be deleted right now.");
else
msg +=
tr("The next dialog will let you choose whether you also "
"want to delete the storage unit of this hard disk or "
"keep it for later usage.");
}
else
msg +=
tr("<p>Note that the storage unit of this medium will not be "
"deleted and that it will be possible to use it later again.</p>");
"confirmRemoveMedium", /* pcszAutoConfirmId */
}
const QString &strLocation)
{
tr("<p>The hard disk storage unit at location <b>%1</b> already "
"exists. You cannot create a new virtual hard disk that uses this "
"location because it can be already used by another virtual hard "
"disk.</p>"
"<p>Please specify a different location.</p>")
.arg(strLocation));
}
{
tr("<p>Do you want to delete the storage unit of the hard disk "
"<nobr><b>%1</b></nobr>?</p>"
"<p>If you select <b>Delete</b> then the specified storage unit "
"will be permanently deleted. This operation <b>cannot be "
"undone</b>.</p>"
"<p>If you select <b>Keep</b> then the hard disk will be only "
"removed from the list of known hard disks, but the storage unit "
"will be left untouched which makes it possible to add this hard "
"disk to the list later again.</p>")
.arg(strLocation),
0, /* pcszAutoConfirmId */
}
{
/* below, we use CMedium (medium) to preserve current error info
* for formatErrorInfo() */
tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
}
const QString &strControllerName)
{
tr("<p>You are about to add a virtual hard disk to controller <b>%1</b>.</p>"
"<p>Would you like to create a new, empty file to hold the disk contents or select an existing one?</p>")
0, /* pcszAutoConfirmId */
}
const QString &strControllerName)
{
"or to leave it empty for now?</p>")
0, /* pcszAutoConfirmId */
}
const QString &strControllerName)
{
tr("<p>You are about to add a new floppy drive to controller <b>%1</b>.</p>"
"<p>Would you like to choose a virtual floppy disk to put in the drive "
"or to leave it empty for now?</p>")
0, /* pcszAutoConfirmId */
}
int UIMessageCenter::confirmRemovingOfLastDVDDevice() const
{
"<p>You will not be able to mount any CDs or ISO images "
"or install the Guest Additions without it!</p>"),
0, /* pcszAutoConfirmId */
}
const CVirtualBox &vbox,
const QString &strLocation,
{
tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
.arg(strLocation),
}
const QString &strLocation,
const StorageSlot &storageSlot)
{
switch (type)
{
case VBoxDefs::MediumType_HardDisk:
{
strMessage = tr("Failed to detach the hard disk (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.")
break;
}
case VBoxDefs::MediumType_DVD:
{
strMessage = tr("Failed to detach the CD/DVD device (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.")
break;
}
case VBoxDefs::MediumType_Floppy:
{
strMessage = tr("Failed to detach the floppy device (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.")
break;
}
default:
break;
}
}
const VBoxMedium &aMedium,
bool fMount,
bool fRetry)
{
/** @todo (translation-related): the gender of "the" in translations
* will depend on the gender of aMedium.type(). */
if (fMount)
{
}
else
{
}
if (fRetry)
{
0 /* Auto Confirm ID */,
tr("Force Unmount"));
}
else
{
}
}
const CVirtualBox &vbox,
const QString &strLocation)
{
/** @todo (translation-related): the gender of "the" in translations
* will depend on the gender of aMedium.type(). */
tr("Failed to open the %1 <nobr><b>%2</b></nobr>.")
.arg(strLocation),
}
const VBoxMedium &aMedium,
{
/** @todo (translation-related): the gender of "the" in translations
* will depend on the gender of aMedium.type(). */
tr("Failed to close the %1 <nobr><b>%2</b></nobr>.")
}
{
tr("Failed to create a new session."),
);
}
{
tr("Failed to open a session for the virtual machine <b>%1</b>.")
);
}
{
tr("Failed to determine the accessibility state of the medium "
"<nobr><b>%1</b></nobr>.")
}
{
tr("<p>Deleting this host-only network will remove "
"the host-only interface this network is based on. Do you want to "
"remove the (host-only network) interface <nobr><b>%1</b>?</nobr></p>"
"<p><b>Note:</b> this interface may be in use by one or more "
"virtual network adapters belonging to one of your VMs. "
"After it is removed, these adapters will no longer be usable until "
"you correct their settings by either choosing a different interface "
0, /* pcszAutoConfirmId */
}
{
/* preserve the current error info before calling the object again */
tr("Failed to attach the USB device <b>%1</b> "
"to the virtual machine <b>%2</b>.")
}
const CVirtualBoxErrorInfo &error)
{
tr("Failed to attach the USB device <b>%1</b> "
"to the virtual machine <b>%2</b>.")
}
{
/* preserve the current error info before calling the object again */
tr("Failed to detach the USB device <b>%1</b> "
"from the virtual machine <b>%2</b>.")
}
const CVirtualBoxErrorInfo &error)
{
tr("Failed to detach the USB device <b>%1</b> "
"from the virtual machine <b>%2</b>.")
}
{
tr("<p>The VirtualBox Guest Additions do not appear to be "
"available on this virtual machine, and shared folders "
"cannot be used without them. To use shared folders inside "
"the virtual machine, please install the Guest Additions "
"if they are not installed, or re-install them if they are "
"not working correctly, by selecting <b>Install Guest Additions</b> "
"from the <b>Devices</b> menu. "
"If they are installed but the machine is not yet fully started "
"then shared folders will be available once it is.</p>"),
"remindAboutGuestAdditionsAreNotActive");
}
{
tr("<p>Could not find the VirtualBox Guest Additions "
"CD image file <nobr><b>%1</b></nobr> or "
"<nobr><b>%2</b>.</nobr></p><p>Do you wish to "
"download this CD image from the Internet?</p>")
}
{
tr("<p>Could not insert the VirtualBox Guest Additions "
"installer CD image into the virtual machine <b>%1</b>, as the machine "
"storage page of the virtual machine settings dialog.</p>")
.arg(strMachineName));
}
{
tr("<p>Are you sure you want to download the VirtualBox "
"Guest Additions CD image from "
"<nobr><a href=\"%1\">%2</a></nobr> "
0, /* pcszAutoConfirmId */
}
{
tr("<p>The VirtualBox Guest Additions CD image has been "
"successfully downloaded from "
"<nobr><a href=\"%1\">%2</a></nobr> "
"and saved locally as <nobr><b>%3</b>.</nobr></p>"
"<p>Do you wish to register this CD image and mount it "
0, /* pcszAutoConfirmId */
}
{
tr("<p>Failed to save the downloaded file as <nobr><b>%1</b>.</nobr></p>")
}
{
tr("<p>Could not find the VirtualBox User Manual "
"<nobr><b>%1</b>.</nobr></p><p>Do you wish to "
"download this file from the Internet?</p>")
0, /* Auto-confirm Id */
}
{
tr("<p>Are you sure you want to download the VirtualBox "
"User Manual from "
"<nobr><a href=\"%1\">%2</a></nobr> "
0, /* Auto-confirm Id */
}
void UIMessageCenter::warnAboutUserManualDownloaded(const QString &strURL, const QString &strTarget)
{
tr("<p>The VirtualBox User Manual has been "
"successfully downloaded from "
"<nobr><a href=\"%1\">%2</a></nobr> "
"and saved locally as <nobr><b>%3</b>.</nobr></p>")
}
void UIMessageCenter::warnAboutUserManualCantBeSaved(const QString &strURL, const QString &strTarget)
{
tr("<p>The VirtualBox User Manual has been "
"successfully downloaded from "
"<nobr><a href=\"%1\">%2</a></nobr> "
"but can't be saved locally as <nobr><b>%3</b>.</nobr></p>"
"<p>Please choose another location for that file.</p>")
}
bool UIMessageCenter::proposeDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion)
{
return messageOkCancel(mainWindowShown(),
tr("<p>You have an old version (%1) of the <b><nobr>%2</nobr></b> installed.</p>"
"<p>Do you wish to download latest one from the Internet?</p>")
0, /* Auto-confirm Id */
}
bool UIMessageCenter::requestUserDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion)
{
tr("<p>You have version %1 of the <b><nobr>%2</nobr></b> installed.</p>"
"<p>You should download and install version %3 of this extension pack from Oracle!</p>")
0, /* Auto-confirm Id */
0,
0,
}
bool UIMessageCenter::confirmDownloadExtensionPack(const QString &strExtPackName, const QString &strURL, qulonglong uSize)
{
tr("<p>Are you sure you want to download the <b><nobr>%1</nobr></b> "
"from <nobr><a href=\"%2\">%2</a></nobr> (size %3 bytes)?</p>")
0, /* Auto-confirm Id */
}
bool UIMessageCenter::proposeInstallExtentionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo)
{
tr("<p>The <b><nobr>%1</nobr></b> has been "
"successfully downloaded from <nobr><a href=\"%2\">%2</a></nobr> "
"and saved locally as <nobr><b>%3</b>.</nobr></p>"
"<p>Do you wish to install this extension pack?</p>")
0, /* Auto-confirm Id */
}
void UIMessageCenter::warnAboutExtentionPackCantBeSaved(const QString &strExtPackName, const QString &strFrom, const QString &strTo)
{
tr("<p>The <b><nobr>%1</nobr></b> has been "
"successfully downloaded from <nobr><a href=\"%2\">%2</a></nobr> "
"but can't be saved locally as <nobr><b>%3</b>.</nobr></p>"
"<p>Please choose another location for that file.</p>")
}
{
/* we don't want to expose the registration script URL to the user
* if he simply doesn't have an internet connection */
tr("<p>Failed to connect to the VirtualBox online "
"registration service due to the following error:</p><p><b>%1</b></p>")
}
{
if (strResult == "OK")
{
/* On successful registration attempt */
tr("<p>Congratulations! You have been successfully registered "
"as a user of VirtualBox.</p>"
"<p>Thank you for finding time to fill out the "
"registration form!</p>"));
}
else
{
/* Else parse and translate special key-words */
if (strResult == "AUTHFAILED")
tr("<p>Failed to register the VirtualBox product.</p><p>%1</p>")
}
}
{
tr("<p>A new version of VirtualBox has been released! Version <b>%1</b> is available at <a href=\"http://www.virtualbox.org/\">virtualbox.org</a>.</p>"
"<p>You can download this version using the link:</p>"
"<p><a href=%2>%3</a></p>")
}
void UIMessageCenter::showUpdateNotFound()
{
tr("You are already running the most recent version of VirtualBox."));
}
{
return messageOkCancel(pParent, Question, tr("Do you wish to cancel all current network operations?"));
}
/**
* @return @c true if the user has confirmed input capture (this is always
* the case if the dialog was autoconfirmed). @a pfAutoConfirmed, when not
* NULL, will receive @c true if the dialog wasn't actually shown.
*/
{
tr("<p>You have <b>clicked the mouse</b> inside the Virtual Machine display "
"or pressed the <b>host key</b>. This will cause the Virtual Machine to "
"<b>capture</b> the host mouse pointer (only if the mouse pointer "
"integration is not currently supported by the guest OS) and the "
"keyboard, which will make them unavailable to other applications "
"running on your host machine."
"</p>"
"<p>You can press the <b>host key</b> at any time to <b>uncapture</b> the "
"keyboard and mouse (if it is captured) and return them to normal "
"operation. The currently assigned host key is shown on the status bar "
"at the bottom of the Virtual Machine window, next to the "
"<img src=:/hostkey_16px.png/> icon. This icon, together "
"with the mouse icon placed nearby, indicate the current keyboard "
"and mouse capture state."
"</p>") +
tr("<p>The host key is currently defined as <b>%1</b>.</p>",
"additional message box paragraph")
"confirmInputCapture",
0,
if (pfAutoConfirmed)
}
{
tr("<p>You have the <b>Auto capture keyboard</b> option turned on. "
"This will cause the Virtual Machine to automatically <b>capture</b> "
"the keyboard every time the VM window is activated and make it "
"unavailable to other applications running on your host machine: "
"when the keyboard is captured, all keystrokes (including system ones "
"like Alt-Tab) will be directed to the VM."
"</p>"
"<p>You can press the <b>host key</b> at any time to <b>uncapture</b> the "
"keyboard and mouse (if it is captured) and return them to normal "
"operation. The currently assigned host key is shown on the status bar "
"at the bottom of the Virtual Machine window, next to the "
"<img src=:/hostkey_16px.png/> icon. This icon, together "
"with the mouse icon placed nearby, indicate the current keyboard "
"and mouse capture state."
"</p>") +
tr("<p>The host key is currently defined as <b>%1</b>.</p>",
"additional message box paragraph")
"remindAboutAutoCapture");
}
{
if (isAlreadyShown("remindAboutMouseIntegration"))
return;
setShownStatus("remindAboutMouseIntegration");
static const char *kNames [2] =
{
"remindAboutMouseIntegrationOff",
"remindAboutMouseIntegrationOn"
};
/* Close the previous (outdated) window if any. We use kName as
* pcszAutoConfirmId which is also used as the widget name by default. */
{
"QIMessageBox");
if (outdated)
}
if (fSupportsAbsolute)
{
tr("<p>The Virtual Machine reports that the guest OS supports "
"<b>mouse pointer integration</b>. This means that you do not "
"need to <i>capture</i> the mouse pointer to be able to use it "
"in your guest OS -- all "
"mouse actions you perform when the mouse pointer is over the "
"Virtual Machine's display are directly sent to the guest OS. "
"If the mouse is currently captured, it will be automatically "
"uncaptured."
"</p>"
"<p>The mouse icon on the status bar will look like "
"<img src=:/mouse_seamless_16px.png/> to inform you that mouse "
"pointer integration is supported by the guest OS and is "
"currently turned on."
"</p>"
"<p><b>Note</b>: Some applications may behave incorrectly in "
"mouse pointer integration mode. You can always disable it for "
"the current session (and enable it again) by selecting the "
"corresponding action from the menu bar."
"</p>"),
}
else
{
tr("<p>The Virtual Machine reports that the guest OS does not "
"support <b>mouse pointer integration</b> in the current video "
"mode. You need to capture the mouse (by clicking over the VM "
"display or pressing the host key) in order to use the "
"mouse inside the guest OS.</p>"),
kNames [0] /* pcszAutoConfirmId */);
}
clearShownStatus("remindAboutMouseIntegration");
}
/**
* @return @c false if the dialog wasn't actually shown (i.e. it was
* autoconfirmed).
*/
{
Info,
tr("<p>The Virtual Machine is currently in the <b>Paused</b> state and "
"not able to see any keyboard or mouse input. If you want to "
"continue to work inside the VM, you need to resume it by selecting the "
"corresponding action from the menu bar.</p>"),
"remindAboutPausedVMInput"
);
return !(rc & AutoConfirmed);
}
/** @return true if the user has chosen to show the Disk Manager Window */
{
"floppy media are not currently accessible. As a result, you will "
"not be able to operate virtual machines that use these media until "
"they become accessible later.</p>"
"<p>Press <b>Check</b> to open the Virtual Media Manager window and "
"see what media are inaccessible, or press <b>Ignore</b> to "
"ignore this message.</p>"),
"remindAboutInaccessibleMedia",
0,
}
/**
* Shows user a proposal to either convert configuration files or
* Exit the application leaving all as already is.
*
* @param strFileList List of files for auto-conversion (may use Qt HTML).
* @param fAfterRefresh @true when called after the VM refresh.
*
* @return QIMessageBox::Ok (Save + Backup), QIMessageBox::Cancel (Exit)
*/
bool fAfterRefresh)
{
if (!fAfterRefresh)
{
/* Common variant for all VMs */
tr("<p>Your existing VirtualBox settings files will be automatically "
"converted from the old format to a new format required by the "
"new version of VirtualBox.</p>"
"<p>Press <b>OK</b> to start VirtualBox now or press <b>Exit</b> if "
"you want to terminate the VirtualBox "
"application without any further actions.</p>"),
NULL /* pcszAutoConfirmId */,
0,
0,
}
else
{
/* Particular VM variant */
tr("<p>The following VirtualBox settings files will be automatically "
"converted from the old format to a new format required by the "
"new version of VirtualBox.</p>"
"<p>Press <b>OK</b> to start VirtualBox now or press <b>Exit</b> if "
"you want to terminate the VirtualBox "
"application without any further actions.</p>"),
NULL /* pcszAutoConfirmId */,
0,
0,
}
}
/**
* @param strHotKey Fullscreen hot key as defined in the menu.
*
* @return @c true if the user has chosen to go fullscreen (this is always
* the case if the dialog was autoconfirmed).
*/
{
tr("<p>The virtual machine window will be now switched to <b>fullscreen</b> mode. "
"You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
"<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>"
"<p>Note that the main menu bar is hidden in fullscreen mode. "
"You can access it by pressing <b>Host+Home</b>.</p>")
"confirmGoingFullscreen",
}
/**
* @param strHotKey Seamless hot key as defined in the menu.
*
* @return @c true if the user has chosen to go seamless (this is always
* the case if the dialog was autoconfirmed).
*/
{
tr("<p>The virtual machine window will be now switched to <b>Seamless</b> mode. "
"You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
"<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>"
"<p>Note that the main menu bar is hidden in seamless mode. "
"You can access it by pressing <b>Host+Home</b>.</p>")
"confirmGoingSeamless",
}
/**
* @param strHotKey Scale hot key as defined in the menu.
*
* @return @c true if the user has chosen to go scale (this is always
* the case if the dialog was autoconfirmed).
*/
{
tr("<p>The virtual machine window will be now switched to <b>Scale</b> mode. "
"You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
"<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>"
"<p>Note that the main menu bar is hidden in scale mode. "
"You can access it by pressing <b>Host+Home</b>.</p>")
"confirmGoingScale",
}
/**
* Returns @c true if the user has selected to power off the machine.
*/
const QString &strLogFolder)
{
tr("<p>A critical error has occurred while running the virtual "
"machine and the machine execution has been stopped.</p>"
""
"<p>For help, please see the Community section on "
"<a href=http://www.virtualbox.org>http://www.virtualbox.org</a> "
"or your support contract. Please provide the contents of the "
"log file <tt>VBox.log</tt> and the image file <tt>VBox.png</tt>, "
"which you can find in the <nobr><b>%1</b></nobr> directory, "
"as well as a description of what you were doing when this error "
"happened. "
""
"Note that you can also access the above files by selecting "
"<b>Show Log</b> from the <b>Machine</b> menu of the main "
"VirtualBox window.</p>"
""
"<p>Press <b>OK</b> if you want to power off the machine "
"or press <b>Ignore</b> if you want to leave it as is for debugging. "
"Please note that debugging requires special knowledge and tools, so "
"it is recommended to press <b>OK</b> now.</p>")
.arg(strLogFolder),
0, /* pcszAutoConfirmId */
}
/**
* @return @c true if the user has selected to reset the machine.
*/
{
tr("<p>Do you really want to reset the virtual machine?</p>"
"<p>This will cause any unsaved data in applications running inside "
"it to be lost.</p>"),
"confirmVMReset" /* pcszAutoConfirmId */,
}
{
tr("<p>Do you really want to send an ACPI shutdown signal to the virtual machine?</p>"),
"confirmVMACPIShutdown" /* pcszAutoConfirmId */,
}
{
tr("<p>Do you really want to power off the virtual machine?</p>"
"<p>This will cause any unsaved data in applications running inside "
"it to be lost.</p>"),
"confirmVMPowerOff" /* pcszAutoConfirmId */,
}
void UIMessageCenter::warnAboutCannotRemoveMachineFolder(QWidget *pParent, const QString &strFolderName)
{
tr("<p>Cannot remove the machine folder <nobr><b>%1</b>.</nobr></p>"
"<p>Please check that this folder really exists and that you have permissions to remove it.</p>")
}
void UIMessageCenter::warnAboutCannotRewriteMachineFolder(QWidget *pParent, const QString &strFolderName)
{
tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
"<p>This folder already exists and possibly belongs to another machine.</p>")
}
void UIMessageCenter::warnAboutCannotCreateMachineFolder(QWidget *pParent, const QString &strFolderName)
{
tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
"<p>Please check that the parent really exists and that you have permissions to create the machine folder.</p>")
}
/**
* @return @c true if the user has selected to continue without attaching a
* hard disk.
*/
{
tr("<p>You didn't attach a hard disk to the new virtual machine. "
"The machine will not be able to boot unless you attach "
"a hard disk with a guest operating system or some other bootable "
"media to it later using the machine settings dialog or the First "
"Run Wizard.</p><p>Do you wish to continue?</p>"),
0, /* pcszAutoConfirmId */
0,
}
{
tr("<p>Cannot run VirtualBox in <i>VM Selector</i> "
"mode due to local restrictions.</p>"
"<p>The application will now terminate.</p>"));
}
{
if (pAppliance->isNull())
{
tr("Failed to open appliance."));
}else
{
/* Preserve the current error info before calling the object again */
/* Add the warnings in the case of an early error */
wstr +
}
}
{
}
{
tr("Failed to check files."),
}
{
tr("Failed to remove file."),
}
{
tr("<p>The %n following virtual machine(s) are currently in a saved state: <b>%1</b></p>"
"<p>If you continue the runtime state of the exported machine(s) "
"will be discarded. The other machine(s) will not be changed.</p>", "This text is never used with n == 0. Feel free to drop the %n where possible, we only included it because of problems with Qt Linguist (but the user can see how many machines are in the list and doesn't need to be told).",
0 /* pcszAutoConfirmId */,
}
{
if (pAppliance->isNull())
{
tr("Failed to create appliance."));
}else
{
/* Preserve the current error info before calling the object again */
}
}
{
if (pAppliance->isNull() ||
{
tr("Failed to create an appliance."));
}else
{
}
}
{
}
{
tr("Failed to update Guest Additions. The Guest Additions installation image will be mounted to provide a manual installation."),
}
const CExtPackManager &extPackManager,
{
}
const CExtPackFile &extPackFile,
{
}
const CExtPackFile &extPackFile,
{
if (!pParent)
pParent = mainWindowShown();
}
void UIMessageCenter::cannotUninstallExtPack(const QString &strPackName, const CExtPackManager &extPackManager,
{
if (!pParent)
pParent = mainWindowShown();
}
bool UIMessageCenter::confirmInstallingPackage(const QString &strPackName, const QString &strPackVersion,
{
tr("<p>You are about to install a VirtualBox extension pack. "
"Extension packs complement the functionality of VirtualBox and can contain system level software "
"that could be potentially harmful to your system. Please review the description below and only proceed "
"if you have obtained the extension pack from a trusted source.</p>"
"<p><table cellpadding=0 cellspacing=0>"
"<tr><td><b>Name: </b></td><td>%1</td></tr>"
"<tr><td><b>Version: </b></td><td>%2</td></tr>"
"<tr><td><b>Description: </b></td><td>%3</td></tr>"
"</table></p>")
0,
tr("&Install"));
}
bool UIMessageCenter::confirmReplacePackage(const QString &strPackName, const QString &strPackVersionNew,
{
if (!pParent)
pParent = pParent ? pParent : mainWindowShown(); /* this is boring stuff that messageOkCancel should do! */
QString strBelehrung = tr("Extension packs complement the functionality of VirtualBox and can contain "
"system level software that could be potentially harmful to your system. "
"Please review the description below and only proceed if you have obtained "
"the extension pack from a trusted source.");
bool fRc;
if (iVerCmp > 0)
tr("<p>An older version of the extension pack is already installed, would you like to upgrade? "
"<p>%1</p>"
"<p><table cellpadding=0 cellspacing=0>"
"<tr><td><b>Name: </b></td><td>%2</td></tr>"
"<tr><td><b>New Version: </b></td><td>%3</td></tr>"
"<tr><td><b>Current Version: </b></td><td>%4</td></tr>"
"<tr><td><b>Description: </b></td><td>%5</td></tr>"
"</table></p>")
.arg(strBelehrung).arg(strPackName).arg(strPackVersionNew).arg(strPackVersionOld).arg(strPackDescription),
0,
tr("&Upgrade"));
else if (iVerCmp < 0)
tr("<p>An newer version of the extension pack is already installed, would you like to downgrade? "
"<p>%1</p>"
"<p><table cellpadding=0 cellspacing=0>"
"<tr><td><b>Name: </b></td><td>%2</td></tr>"
"<tr><td><b>New Version: </b></td><td>%3</td></tr>"
"<tr><td><b>Current Version: </b></td><td>%4</td></tr>"
"<tr><td><b>Description: </b></td><td>%5</td></tr>"
"</table></p>")
.arg(strBelehrung).arg(strPackName).arg(strPackVersionNew).arg(strPackVersionOld).arg(strPackDescription),
0,
tr("&Downgrade"));
else
tr("<p>The extension pack is already installed with the same version, would you like reinstall it? "
"<p>%1</p>"
"<p><table cellpadding=0 cellspacing=0>"
"<tr><td><b>Name: </b></td><td>%2</td></tr>"
"<tr><td><b>Version: </b></td><td>%3</td></tr>"
"<tr><td><b>Description: </b></td><td>%4</td></tr>"
"</table></p>")
0,
tr("&Reinstall"));
return fRc;
}
{
tr("<p>You are about to remove the VirtualBox extension pack <b>%1</b>.</p>"
0,
tr("&Remove"));
}
{
Info,
tr("The extension pack <br><nobr><b>%1</b><nobr><br> was installed successfully.").arg(strPackName));
}
{
tr("The current port forwarding rules are not valid. "
"None of the host or guest port values may be set to zero."));
}
{
tr("<p>There are unsaved changes in the port forwarding configuration.</p>"
"<p>If you proceed your changes will be discarded.</p>"));
}
const QString &strErrorId,
const QString &strErrorMsg) const
{
/// @todo (r=dmik) it's just a preliminary box. We need to:
// - for fFatal errors and non-fFatal with-retry errors, listen for a
// VM state signal to automatically close the message if the VM
// (externally) leaves the Paused state while it is shown.
// - make warning messages modeless
if (fFatal)
{
/* the machine must be paused on fFatal errors */
if (state != KMachineState_Paused)
autoConfimId += "fatal.";
}
else if (state == KMachineState_Paused)
{
autoConfimId += "error.";
}
else
{
autoConfimId += "warning.";
}
if (!strErrorMsg.isEmpty())
if (!strErrorId.isEmpty())
"cellpadding=0 width=100%>"
"<tr><td>%1</td><td>%2</td></tr>"
"<tr><td>%3</td><td>%4</td></tr>"
"</table>")
severity);
int rc = 0;
{
tr("<p>A fatal error has occurred during virtual machine execution! "
"The virtual machine will be powered off. Please copy the "
"following error message using the clipboard to help diagnose "
"the problem:</p>"),
/* always power down after a fFatal error */
}
{
tr("<p>An error has occurred during virtual machine execution! "
"The error details are shown below. You may try to correct "
"the error and resume the virtual machine "
"execution.</p>"),
}
else
{
tr("<p>The virtual machine execution may run into an error "
"condition as described below. "
"We suggest that you take "
"an appropriate action to avert the error."
"</p>"),
}
}
/* static */
QString UIMessageCenter::mediumToAccusative(VBoxDefs::MediumType type, bool fIsHostDrive /* = false */)
{
return strType;
}
/**
* Formats the given COM result code as a human-readable string.
*
* If a mnemonic name for the given result code is found, a string in format
* "MNEMONIC_NAME (0x12345678)" is returned where the hex number is the result
* code as is. If no mnemonic name is found, then the raw hex number only is
* returned (w/o pParenthesis).
*
* @param rc COM result code to format.
*/
/* static */
{
/* first, try as is (only set bit 31 bit for warnings) */
if (SUCCEEDED_WARNING(rc))
else
#if defined (Q_WS_WIN)
/* if not found, try again using RTErrWinGet with masked off top 16bit */
{
}
#endif
else
return str;
}
/* static */
{
}
{
else
}
void UIMessageCenter::cannotCreateHostInterface(const CProgress &progress, QWidget *pParent /* = 0 */)
{
else
}
void UIMessageCenter::cannotRemoveHostInterface(const CHost &host, const CHostNetworkInterface &iface,
{
else
}
void UIMessageCenter::cannotRemoveHostInterface(const CProgress &progress, const CHostNetworkInterface &iface,
{
else
}
{
else
}
{
else
}
{
else
}
{
else
}
{
else
}
#ifdef VBOX_WITH_DRAG_AND_DROP
{
tr("Failed to drop data."),
}
{
tr("Failed to drop data."),
}
#endif /* VBOX_WITH_DRAG_AND_DROP */
{
}
{
if ( !object
return;
tr("Sorry, some generic error happens."),
}
// Public slots
/////////////////////////////////////////////////////////////////////////////
{
}
void UIMessageCenter::sltShowHelpWebDialog()
{
}
{
if (vboxGlobal().brandingIsActive())
{
}
else
{
}
}
void UIMessageCenter::sltShowHelpHelpDialog()
{
#ifndef VBOX_OSE
/* For non-OSE version we just open it: */
#else /* #ifndef VBOX_OSE */
/* For OSE version we have to check if it present first: */
QString strUserManualFileName2 = QDir(vboxGlobal().virtualBox().GetHomeFolder()).absoluteFilePath(strShortFileName);
/* Show if user manual already present: */
/* If downloader is running already: */
else if (UIDownloaderUserManual::current())
{
/* Just show network access manager: */
gNetworkManager->show();
}
/* Else propose to download user manual: */
else if (askAboutUserManualDownload(strUserManualFileName1))
{
/* Create User Manual downloader: */
/* After downloading finished => show User Manual: */
connect(pDl, SIGNAL(sigDownloadFinished(const QString&)), this, SLOT(sltShowUserManual(const QString&)));
/* Start downloading: */
}
#endif /* #ifdef VBOX_OSE */
}
{
}
{
#if defined (Q_WS_WIN32)
# ifndef VBOX_OSE
char szViewerPath[RTPATH_MAX];
int rc;
# else /* #ifndef VBOX_OSE */
# endif /* #ifdef VBOX_OSE */
#endif
}
{
tr("Failed to create the host-only network interface."),
}
{
tr("Failed to create the host-only network interface."),
}
void UIMessageCenter::sltCannotRemoveHostInterface(const CHost &host, const CHostNetworkInterface &iface, QWidget *pParent)
{
tr("Failed to remove the host network interface <b>%1</b>.")
}
void UIMessageCenter::sltCannotRemoveHostInterface(const CProgress &progress, const CHostNetworkInterface &iface, QWidget *pParent)
{
tr("Failed to remove the host network interface <b>%1</b>.")
}
{
switch (type)
{
case VBoxDefs::MediumType_HardDisk:
{
strMessage = tr("Failed to attach the hard disk (<nobr><b>%1</b></nobr>) to the slot <i>%2</i> of the machine <b>%3</b>.")
break;
}
case VBoxDefs::MediumType_DVD:
{
strMessage = tr("Failed to attach the CD/DVD device (<nobr><b>%1</b></nobr>) to the slot <i>%2</i> of the machine <b>%3</b>.")
break;
}
case VBoxDefs::MediumType_Floppy:
{
strMessage = tr("Failed to attach the floppy device (<nobr><b>%1</b></nobr>) to the slot <i>%2</i> of the machine <b>%3</b>.")
break;
}
default:
break;
}
}
{
tr("Failed to create the shared folder <b>%1</b> "
"(pointing to <nobr><b>%2</b></nobr>) "
"for the virtual machine <b>%3</b>.")
}
{
tr("Failed to remove the shared folder <b>%1</b> "
"(pointing to <nobr><b>%2</b></nobr>) "
"from the virtual machine <b>%3</b>.")
}
{
tr("Failed to create the shared folder <b>%1</b> "
"(pointing to <nobr><b>%2</b></nobr>) "
"for the virtual machine <b>%3</b>.")
}
{
tr("<p>Failed to remove the shared folder <b>%1</b> "
"(pointing to <nobr><b>%2</b></nobr>) "
"from the virtual machine <b>%3</b>.</p>"
"<p>Please close all programs in the guest OS that "
"may be using this shared folder and try again.</p>")
}
{
const char *kName = "remindAboutWrongColorDepth";
/* Close the previous (outdated) window if any. We use kName as
* pcszAutoConfirmId which is also used as the widget name by default. */
{
if (outdated)
}
tr("<p>The virtual machine window is optimized to work in "
"<b>%1 bit</b> color mode but the "
"virtual display is currently set to <b>%2 bit</b>.</p>"
"<p>Please open the display properties dialog of the guest OS and "
"select a <b>%3 bit</b> color mode, if it is available, for "
"best possible performance of the virtual video subsystem.</p>"
"<p><b>Note</b>. Some operating systems, like OS/2, may actually "
"work in 32 bit mode but report it as 24 bit "
"(16 million colors). You may try to select a different color "
"mode to see if this message disappears or you can simply "
"disable the message now if you are sure the required color "
"mode (%4 bit) is not available in the guest OS.</p>")
kName);
}
void UIMessageCenter::sltRemindAboutUnsupportedUSB2(const QString &strExtPackName, QWidget *pParent)
{
if (isAlreadyShown("sltRemindAboutUnsupportedUSB2"))
return;
setShownStatus("sltRemindAboutUnsupportedUSB2");
tr("<p>USB 2.0 is currently enabled for this virtual machine. "
"However, this requires the <b><nobr>%1</nobr></b> to be installed.</p>"
"<p>Please install the Extension Pack from the VirtualBox download site. "
"After this you will be able to re-enable USB 2.0. "
"It will be disabled in the meantime unless you cancel the current settings changes.</p>")
.arg(strExtPackName));
clearShownStatus("sltRemindAboutUnsupportedUSB2");
}
{
/* Register required objects as meta-types: */
/* Prepare required connections: */
connect(this, SIGNAL(sigCannotRemoveHostInterface(const CHost&, const CHostNetworkInterface&, QWidget*)),
connect(this, SIGNAL(sigCannotRemoveHostInterface(const CProgress&, const CHostNetworkInterface&, QWidget*)),
connect(this, SIGNAL(sigCannotAttachDevice(const CMachine&, VBoxDefs::MediumType, const QString&, const StorageSlot&, QWidget*)),
this, SLOT(sltCannotAttachDevice(const CMachine&, VBoxDefs::MediumType, const QString&, const StorageSlot&, QWidget*)),
connect(this, SIGNAL(sigCannotCreateSharedFolder(const CMachine&, const QString&, const QString&, QWidget*)),
connect(this, SIGNAL(sigCannotRemoveSharedFolder(const CMachine&, const QString&, const QString&, QWidget*)),
connect(this, SIGNAL(sigCannotCreateSharedFolder(const CConsole&, const QString&, const QString&, QWidget*)),
connect(this, SIGNAL(sigCannotRemoveSharedFolder(const CConsole&, const QString&, const QString&, QWidget*)),
/* Translations for Main.
* Please make sure they corresponds to the strings coming from Main one-by-one symbol! */
tr("Could not load the Host USB Proxy Service (VERR_FILE_NOT_FOUND). The service might not be installed on the host computer");
tr("VirtualBox is not currently allowed to access USB devices. You can change this by adding your user to the 'vboxusers' group. Please see the user manual for a more detailed explanation");
tr("VirtualBox is not currently allowed to access USB devices. You can change this by allowing your user to access the 'usbfs' folder and files. Please see the user manual for a more detailed explanation");
tr("The USB Proxy Service has not yet been ported to this host");
tr("Could not load the Host USB Proxy service");
}
/* Returns a reference to the global VirtualBox message center instance: */
{
static UIMessageCenter global_instance;
return global_instance;
}
{
/* Compose complex details string with internal <!--EOM--> delimiter to
* make it possible to split string into info & details parts which will
* be used separately in QIMessageBox */
/* Check if details text is NOT empty: */
if (!strDetailsInfo.isEmpty())
{
/* Check if details text written in English (latin1) and translated: */
formatted += QString("<p>%1.</p>").arg(vboxGlobal().emphasize(tr(strDetailsInfo.toLatin1().constData())));
else
}
formatted += "<!--EOM--><table bgcolor=#EEEEEE border=0 cellspacing=0 "
"cellpadding=0 width=100%>";
bool haveResultCode = false;
if (info.isBasicAvailable())
{
#if defined (Q_WS_WIN)
bool haveComponent = true;
bool haveInterfaceID = true;
#else /* defined (Q_WS_WIN) */
haveResultCode = true;
#endif
if (haveResultCode)
{
}
if (haveComponent)
if (haveInterfaceID)
{
}
{
}
}
{
}
formatted += "</table>";
return formatted;
}