1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * UIMessageCenter class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2012 Oracle Corporation
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef __UIMessageCenter_h__
|
---|
20 | #define __UIMessageCenter_h__
|
---|
21 |
|
---|
22 | /* Qt includes: */
|
---|
23 | #include <QObject>
|
---|
24 | #include <QPointer>
|
---|
25 |
|
---|
26 | /* GUI includes: */
|
---|
27 | #include "QIMessageBox.h"
|
---|
28 | #include "UIMediumDefs.h"
|
---|
29 |
|
---|
30 | /* COM includes: */
|
---|
31 | #include "COMEnums.h"
|
---|
32 | #include "CProgress.h"
|
---|
33 |
|
---|
34 | /* Forward declarations: */
|
---|
35 | class UIMedium;
|
---|
36 | struct StorageSlot;
|
---|
37 | #ifdef VBOX_WITH_DRAG_AND_DROP
|
---|
38 | class CGuest;
|
---|
39 | #endif /* VBOX_WITH_DRAG_AND_DROP */
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * The UIMessageCenter class is a central place to handle all problem/error
|
---|
43 | * situations that happen during application runtime and require the user's
|
---|
44 | * attention.
|
---|
45 | *
|
---|
46 | * The role of this class is to describe the problem and/or the cause of the
|
---|
47 | * error to the user and give him the opportunity to select an action (when
|
---|
48 | * appropriate).
|
---|
49 | *
|
---|
50 | * Every problem situation has its own (correspondingly named) method in this
|
---|
51 | * class that takes a list of arguments necessary to describe the situation and
|
---|
52 | * to provide the appropriate actions. The method then returns the choice to the
|
---|
53 | * caller.
|
---|
54 | */
|
---|
55 | class UIMessageCenter: public QObject
|
---|
56 | {
|
---|
57 | Q_OBJECT;
|
---|
58 |
|
---|
59 | public:
|
---|
60 |
|
---|
61 | enum Type
|
---|
62 | {
|
---|
63 | Info = 1,
|
---|
64 | Question,
|
---|
65 | Warning,
|
---|
66 | Error,
|
---|
67 | Critical,
|
---|
68 | GuruMeditation
|
---|
69 | };
|
---|
70 |
|
---|
71 | enum
|
---|
72 | {
|
---|
73 | AutoConfirmed = 0x8000
|
---|
74 | };
|
---|
75 |
|
---|
76 | bool isAnyWarningShown();
|
---|
77 | bool isAlreadyShown(const QString &strGuardBlockName) const;
|
---|
78 | void setShownStatus(const QString &strGuardBlockName);
|
---|
79 | void clearShownStatus(const QString &strGuardBlockName);
|
---|
80 | void closeAllWarnings();
|
---|
81 |
|
---|
82 | int message(QWidget *pParent, Type type, const QString &strMessage,
|
---|
83 | const QString &strDetails = QString::null,
|
---|
84 | const char *pcszAutoConfirmId = 0,
|
---|
85 | int button1 = 0, int button2 = 0, int button3 = 0,
|
---|
86 | const QString &strText1 = QString::null,
|
---|
87 | const QString &strText2 = QString::null,
|
---|
88 | const QString &strText3 = QString::null) const;
|
---|
89 |
|
---|
90 | int message(QWidget *pParent, Type type, const QString &strMessage,
|
---|
91 | const char *pcszAutoConfirmId,
|
---|
92 | int button1 = 0, int button2 = 0, int button3 = 0,
|
---|
93 | const QString &strText1 = QString::null,
|
---|
94 | const QString &strText2 = QString::null,
|
---|
95 | const QString &strText3 = QString::null) const
|
---|
96 | {
|
---|
97 | return message(pParent, type, strMessage, QString::null, pcszAutoConfirmId,
|
---|
98 | button1, button2, button3, strText1, strText2, strText3);
|
---|
99 | }
|
---|
100 |
|
---|
101 | bool messageYesNo(QWidget *pParent, Type type, const QString &strMessage,
|
---|
102 | const QString &strDetails = QString::null,
|
---|
103 | const char *pcszAutoConfirmId = 0,
|
---|
104 | const QString &strYesText = QString::null,
|
---|
105 | const QString &strNoText = QString::null) const
|
---|
106 | {
|
---|
107 | return(message(pParent, type, strMessage, strDetails, pcszAutoConfirmId,
|
---|
108 | QIMessageBox::Yes | QIMessageBox::Default,
|
---|
109 | QIMessageBox::No | QIMessageBox::Escape,
|
---|
110 | 0,
|
---|
111 | strYesText, strNoText, QString::null) &
|
---|
112 | QIMessageBox::ButtonMask) == QIMessageBox::Yes;
|
---|
113 | }
|
---|
114 |
|
---|
115 | bool messageYesNo(QWidget *pParent, Type type, const QString &strMessage,
|
---|
116 | const char *pcszAutoConfirmId,
|
---|
117 | const QString &strYesText = QString::null,
|
---|
118 | const QString &strNoText = QString::null) const
|
---|
119 | {
|
---|
120 | return messageYesNo(pParent, type, strMessage, QString::null,
|
---|
121 | pcszAutoConfirmId, strYesText, strNoText);
|
---|
122 | }
|
---|
123 |
|
---|
124 | bool messageOkCancel(QWidget *pParent, Type type, const QString &strMessage,
|
---|
125 | const QString &strDetails = QString::null,
|
---|
126 | const char *pcszAutoConfirmId = 0,
|
---|
127 | const QString &strOkText = QString::null,
|
---|
128 | const QString &strCancelText = QString::null) const
|
---|
129 | {
|
---|
130 | return(message(pParent, type, strMessage, strDetails, pcszAutoConfirmId,
|
---|
131 | QIMessageBox::Ok | QIMessageBox::Default,
|
---|
132 | QIMessageBox::Cancel | QIMessageBox::Escape,
|
---|
133 | 0,
|
---|
134 | strOkText, strCancelText, QString::null) &
|
---|
135 | QIMessageBox::ButtonMask) == QIMessageBox::Ok;
|
---|
136 | }
|
---|
137 |
|
---|
138 | bool messageOkCancel(QWidget *pParent, Type type, const QString &strMessage,
|
---|
139 | const char *pcszAutoConfirmId,
|
---|
140 | const QString &strOkText = QString::null,
|
---|
141 | const QString &strCancelText = QString::null) const
|
---|
142 | {
|
---|
143 | return messageOkCancel(pParent, type, strMessage, QString::null,
|
---|
144 | pcszAutoConfirmId, strOkText, strCancelText);
|
---|
145 | }
|
---|
146 |
|
---|
147 | int messageWithOption(QWidget *pParent,
|
---|
148 | Type type,
|
---|
149 | const QString &strMessage,
|
---|
150 | const QString &strOptionText,
|
---|
151 | bool fDefaultOptionValue = true,
|
---|
152 | const QString &strDetails = QString::null,
|
---|
153 | int iButton1 = 0,
|
---|
154 | int iButton2 = 0,
|
---|
155 | int iButton3 = 0,
|
---|
156 | const QString &strButtonName1 = QString::null,
|
---|
157 | const QString &strButtonName2 = QString::null,
|
---|
158 | const QString &strButtonName3 = QString::null) const;
|
---|
159 |
|
---|
160 | bool showModalProgressDialog(CProgress &progress, const QString &strTitle,
|
---|
161 | const QString &strImage = "", QWidget *pParent = 0,
|
---|
162 | bool fSheetOnDarwin = false, int cMinDuration = 2000);
|
---|
163 |
|
---|
164 | QWidget* mainWindowShown() const;
|
---|
165 | QWidget* mainMachineWindowShown() const;
|
---|
166 | QWidget* networkManagerOrMainWindowShown() const;
|
---|
167 | QWidget* networkManagerOrMainMachineWindowShown() const;
|
---|
168 |
|
---|
169 | bool askForOverridingFile(const QString& strPath, QWidget *pParent = NULL);
|
---|
170 | bool askForOverridingFiles(const QVector<QString>& strPaths, QWidget *pParent = NULL);
|
---|
171 | bool askForOverridingFileIfExists(const QString& strPath, QWidget *pParent = NULL);
|
---|
172 | bool askForOverridingFilesIfExists(const QVector<QString>& strPaths, QWidget *pParent = NULL);
|
---|
173 |
|
---|
174 | void checkForMountedWrongUSB();
|
---|
175 |
|
---|
176 | void showBETAWarning();
|
---|
177 | void showBEBWarning();
|
---|
178 |
|
---|
179 | #ifdef Q_WS_X11
|
---|
180 | void cannotFindLicenseFiles(const QString &strPath);
|
---|
181 | #endif
|
---|
182 | void cannotOpenLicenseFile(QWidget *pParent, const QString &strPath);
|
---|
183 |
|
---|
184 | void cannotOpenURL(const QString &strUrl);
|
---|
185 |
|
---|
186 | void cannotFindLanguage(const QString &strLangId, const QString &strNlsPath);
|
---|
187 | void cannotLoadLanguage(const QString &strLangFile);
|
---|
188 |
|
---|
189 | void cannotInitCOM(HRESULT rc);
|
---|
190 | void cannotInitUserHome(const QString &strUserHome);
|
---|
191 | void cannotCreateVirtualBox(const CVirtualBox &vbox);
|
---|
192 |
|
---|
193 | void cannotLoadGlobalConfig(const CVirtualBox &vbox, const QString &strError);
|
---|
194 | void cannotSaveGlobalConfig(const CVirtualBox &vbox);
|
---|
195 | void cannotSetSystemProperties(const CSystemProperties &props);
|
---|
196 |
|
---|
197 | void cannotAccessUSB(const COMBaseWithEI &object);
|
---|
198 |
|
---|
199 | void cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent = 0);
|
---|
200 | void cannotCreateMachine(const CVirtualBox &vbox, const CMachine &machine, QWidget *pParent = 0);
|
---|
201 |
|
---|
202 | void cannotOpenMachine(QWidget *pParent, const QString &strMachinePath, const CVirtualBox &vbox);
|
---|
203 | void cannotRegisterMachine(const CVirtualBox &vbox, const CMachine &machine, QWidget *pParent);
|
---|
204 | void cannotReregisterMachine(QWidget *pParent, const QString &strMachinePath, const QString &strMachineName);
|
---|
205 | void cannotApplyMachineSettings(const CMachine &machine, const COMResult &res);
|
---|
206 | void cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent = 0);
|
---|
207 | void cannotLoadMachineSettings(const CMachine &machine, bool fStrict = true, QWidget *pParent = 0);
|
---|
208 |
|
---|
209 | bool confirmedSettingsReloading(QWidget *pParent);
|
---|
210 | void warnAboutStateChange(QWidget *pParent);
|
---|
211 |
|
---|
212 | void cannotStartMachine(const CConsole &console);
|
---|
213 | void cannotStartMachine(const CProgress &progress);
|
---|
214 | void cannotPauseMachine(const CConsole &console);
|
---|
215 | void cannotResumeMachine(const CConsole &console);
|
---|
216 | void cannotACPIShutdownMachine(const CConsole &console);
|
---|
217 | void cannotSaveMachineState(const CConsole &console);
|
---|
218 | void cannotSaveMachineState(const CProgress &progress);
|
---|
219 | void cannotCreateClone(const CMachine &machine, QWidget *pParent = 0);
|
---|
220 | void cannotCreateClone(const CMachine &machine, const CProgress &progress, QWidget *pParent = 0);
|
---|
221 | void cannotTakeSnapshot(const CConsole &console);
|
---|
222 | void cannotTakeSnapshot(const CProgress &progress);
|
---|
223 | void cannotStopMachine(const CConsole &console);
|
---|
224 | void cannotStopMachine(const CProgress &progress);
|
---|
225 | void cannotDeleteMachine(const CMachine &machine);
|
---|
226 | void cannotDeleteMachine(const CMachine &machine, const CProgress &progress);
|
---|
227 | void cannotDiscardSavedState(const CConsole &console);
|
---|
228 |
|
---|
229 | void cannotSendACPIToMachine();
|
---|
230 |
|
---|
231 | bool warnAboutVirtNotEnabled64BitsGuest(bool fHWVirtExSupported);
|
---|
232 | bool warnAboutVirtNotEnabledGuestRequired(bool fHWVirtExSupported);
|
---|
233 |
|
---|
234 | int askAboutSnapshotRestoring(const QString &strSnapshotName, bool fAlsoCreateNewSnapshot);
|
---|
235 | bool askAboutSnapshotDeleting(const QString &strSnapshotName);
|
---|
236 | bool askAboutSnapshotDeletingFreeSpace(const QString &strSnapshotName,
|
---|
237 | const QString &strTargetImageName,
|
---|
238 | const QString &strTargetImageMaxSize,
|
---|
239 | const QString &strTargetFileSystemFree);
|
---|
240 | void cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName);
|
---|
241 | void cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName);
|
---|
242 | void cannotDeleteSnapshot(const CConsole &console, const QString &strSnapshotName);
|
---|
243 | void cannotDeleteSnapshot(const CProgress &progress, const QString &strSnapshotName);
|
---|
244 | void cannotFindSnapshotByName(QWidget *pParent, const CMachine &machine, const QString &strMachine) const;
|
---|
245 |
|
---|
246 | void cannotFindMachineByName(const CVirtualBox &vbox, const QString &name);
|
---|
247 |
|
---|
248 | void cannotEnterSeamlessMode(ULONG uWidth, ULONG uHeight,
|
---|
249 | ULONG uBpp, ULONG64 uMinVRAM);
|
---|
250 | int cannotEnterFullscreenMode(ULONG uWidth, ULONG uHeight,
|
---|
251 | ULONG uBpp, ULONG64 uMinVRAM);
|
---|
252 | bool cannotStartWithoutNetworkIf(const QString &strMachineName, const QString &strIfNames);
|
---|
253 | void cannotSwitchScreenInSeamless(quint64 uMinVRAM);
|
---|
254 | int cannotSwitchScreenInFullscreen(quint64 uMinVRAM);
|
---|
255 | int cannotEnterFullscreenMode();
|
---|
256 | int cannotEnterSeamlessMode();
|
---|
257 |
|
---|
258 | void notifyAboutCollisionOnGroupRemovingCantBeResolved(const QString &strName, const QString &strGroupName);
|
---|
259 | int askAboutCollisionOnGroupRemoving(const QString &strName, const QString &strGroupName);
|
---|
260 | int confirmMachineItemRemoval(const QStringList &names);
|
---|
261 | int confirmMachineDeletion(const QList<CMachine> &machines);
|
---|
262 | bool confirmDiscardSavedState(const QString &strNames);
|
---|
263 |
|
---|
264 | void cannotSetGroups(const CMachine &machine);
|
---|
265 |
|
---|
266 | void cannotChangeMediumType(QWidget *pParent, const CMedium &medium, KMediumType oldMediumType, KMediumType newMediumType);
|
---|
267 |
|
---|
268 | bool confirmReleaseMedium(QWidget *pParent, const UIMedium &aMedium,
|
---|
269 | const QString &strUsage);
|
---|
270 |
|
---|
271 | bool confirmRemoveMedium(QWidget *pParent, const UIMedium &aMedium);
|
---|
272 |
|
---|
273 | void sayCannotOverwriteHardDiskStorage(QWidget *pParent,
|
---|
274 | const QString &strLocation);
|
---|
275 | int confirmDeleteHardDiskStorage(QWidget *pParent,
|
---|
276 | const QString &strLocation);
|
---|
277 | void cannotDeleteHardDiskStorage(QWidget *pParent, const CMedium &medium,
|
---|
278 | const CProgress &progress);
|
---|
279 |
|
---|
280 | int askAboutHardDiskAttachmentCreation(QWidget *pParent, const QString &strControllerName);
|
---|
281 | int askAboutOpticalAttachmentCreation(QWidget *pParent, const QString &strControllerName);
|
---|
282 | int askAboutFloppyAttachmentCreation(QWidget *pParent, const QString &strControllerName);
|
---|
283 |
|
---|
284 | int confirmRemovingOfLastDVDDevice() const;
|
---|
285 |
|
---|
286 | void cannotCreateHardDiskStorage(QWidget *pParent, const CVirtualBox &vbox,
|
---|
287 | const QString &strLocation,
|
---|
288 | const CMedium &medium,
|
---|
289 | const CProgress &progress);
|
---|
290 | void cannotDetachDevice(QWidget *pParent, const CMachine &machine,
|
---|
291 | UIMediumType type, const QString &strLocation, const StorageSlot &storageSlot);
|
---|
292 |
|
---|
293 | int cannotRemountMedium(QWidget *pParent, const CMachine &machine, const UIMedium &aMedium, bool fMount, bool fRetry);
|
---|
294 | void cannotOpenMedium(QWidget *pParent, const CVirtualBox &vbox,
|
---|
295 | UIMediumType type, const QString &strLocation);
|
---|
296 | void cannotCloseMedium(QWidget *pParent, const UIMedium &aMedium,
|
---|
297 | const COMResult &rc);
|
---|
298 |
|
---|
299 | void cannotOpenSession(const CSession &session);
|
---|
300 | void cannotOpenSession(const CVirtualBox &vbox, const CMachine &machine,
|
---|
301 | const CProgress &progress = CProgress());
|
---|
302 | void cannotOpenSession(const CMachine &machine);
|
---|
303 |
|
---|
304 | void cannotGetMediaAccessibility(const UIMedium &aMedium);
|
---|
305 |
|
---|
306 | int confirmDeletingHostInterface(const QString &strName, QWidget *pParent = 0);
|
---|
307 |
|
---|
308 | void cannotAttachUSBDevice(const CConsole &console, const QString &device);
|
---|
309 | void cannotAttachUSBDevice(const CConsole &console, const QString &device,
|
---|
310 | const CVirtualBoxErrorInfo &error);
|
---|
311 | void cannotDetachUSBDevice(const CConsole &console, const QString &device);
|
---|
312 | void cannotDetachUSBDevice(const CConsole &console, const QString &device,
|
---|
313 | const CVirtualBoxErrorInfo &error);
|
---|
314 |
|
---|
315 | void remindAboutGuestAdditionsAreNotActive(QWidget *pParent);
|
---|
316 | bool cannotFindGuestAdditions();
|
---|
317 | void cannotMountGuestAdditions(const QString &strMachineName);
|
---|
318 | bool confirmDownloadAdditions(const QString &strUrl, qulonglong uSize);
|
---|
319 | bool confirmMountAdditions(const QString &strUrl, const QString &strSrc);
|
---|
320 | void warnAboutAdditionsCantBeSaved(const QString &strTarget);
|
---|
321 |
|
---|
322 | bool askAboutUserManualDownload(const QString &strMissedLocation);
|
---|
323 | bool confirmUserManualDownload(const QString &strURL, qulonglong uSize);
|
---|
324 | void warnAboutUserManualDownloaded(const QString &strURL, const QString &strTarget);
|
---|
325 | void warnAboutUserManualCantBeSaved(const QString &strURL, const QString &strTarget);
|
---|
326 |
|
---|
327 | bool proposeDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion);
|
---|
328 | bool requestUserDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion);
|
---|
329 | bool confirmDownloadExtensionPack(const QString &strExtPackName, const QString &strURL, qulonglong uSize);
|
---|
330 | bool proposeInstallExtentionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo);
|
---|
331 | void warnAboutExtentionPackCantBeSaved(const QString &strExtPackName, const QString &strFrom, const QString &strTo);
|
---|
332 |
|
---|
333 | void cannotConnectRegister(QWidget *pParent,
|
---|
334 | const QString &strUrl,
|
---|
335 | const QString &strReason);
|
---|
336 | void showRegisterResult(QWidget *pParent,
|
---|
337 | const QString &strResult);
|
---|
338 |
|
---|
339 | void showUpdateSuccess(const QString &strVersion, const QString &strLink);
|
---|
340 | void showUpdateNotFound();
|
---|
341 |
|
---|
342 | bool askAboutCancelAllNetworkRequest(QWidget *pParent);
|
---|
343 |
|
---|
344 | bool confirmInputCapture(bool *pfAutoConfirmed = NULL);
|
---|
345 | void remindAboutAutoCapture();
|
---|
346 | void remindAboutMouseIntegration(bool fSupportsAbsolute);
|
---|
347 | bool remindAboutPausedVMInput();
|
---|
348 |
|
---|
349 | int warnAboutSettingsAutoConversion(const QString &strFileList, bool fAfterRefresh);
|
---|
350 |
|
---|
351 | bool remindAboutInaccessibleMedia();
|
---|
352 |
|
---|
353 | bool confirmGoingFullscreen(const QString &strHotKey);
|
---|
354 | bool confirmGoingSeamless(const QString &strHotKey);
|
---|
355 | bool confirmGoingScale(const QString &strHotKey);
|
---|
356 |
|
---|
357 | bool remindAboutGuruMeditation(const CConsole &console,
|
---|
358 | const QString &strLogFolder);
|
---|
359 |
|
---|
360 | bool confirmVMReset(const QString &strNames);
|
---|
361 | bool confirmVMACPIShutdown(const QString &strNames);
|
---|
362 | bool confirmVMPowerOff(const QString &strNames);
|
---|
363 |
|
---|
364 | void warnAboutCannotRemoveMachineFolder(QWidget *pParent, const QString &strFolderName);
|
---|
365 | void warnAboutCannotRewriteMachineFolder(QWidget *pParent, const QString &strFolderName);
|
---|
366 | void warnAboutCannotCreateMachineFolder(QWidget *pParent, const QString &strFolderName);
|
---|
367 | bool confirmHardDisklessMachine(QWidget *pParent);
|
---|
368 |
|
---|
369 | void cannotRunInSelectorMode();
|
---|
370 |
|
---|
371 | void cannotImportAppliance(CAppliance *pAppliance, QWidget *pParent = NULL) const;
|
---|
372 | void cannotImportAppliance(const CProgress &progress, CAppliance *pAppliance, QWidget *pParent = NULL) const;
|
---|
373 |
|
---|
374 | void cannotCheckFiles(const CProgress &progress, QWidget *pParent = NULL) const;
|
---|
375 | void cannotRemoveFiles(const CProgress &progress, QWidget *pParent = NULL) const;
|
---|
376 |
|
---|
377 | bool confirmExportMachinesInSaveState(const QStringList &strMachineNames, QWidget *pParent = NULL) const;
|
---|
378 | void cannotExportAppliance(CAppliance *pAppliance, QWidget *pParent = NULL) const;
|
---|
379 | void cannotExportAppliance(const CMachine &machine, CAppliance *pAppliance, QWidget *pParent = NULL) const;
|
---|
380 | void cannotExportAppliance(const CProgress &progress, CAppliance *pAppliance, QWidget *pParent = NULL) const;
|
---|
381 |
|
---|
382 | void cannotUpdateGuestAdditions(const CProgress &progress, QWidget *pParent /* = NULL */) const;
|
---|
383 |
|
---|
384 | void cannotOpenExtPack(const QString &strFilename, const CExtPackManager &extPackManager, QWidget *pParent);
|
---|
385 | void badExtPackFile(const QString &strFilename, const CExtPackFile &extPackFile, QWidget *pParent);
|
---|
386 | void cannotInstallExtPack(const QString &strFilename, const CExtPackFile &extPackFile, const CProgress &progress, QWidget *pParent);
|
---|
387 | void cannotUninstallExtPack(const QString &strPackName, const CExtPackManager &extPackManager, const CProgress &progress, QWidget *pParent);
|
---|
388 | bool confirmInstallingPackage(const QString &strPackName, const QString &strPackVersion, const QString &strPackDescription, QWidget *pParent);
|
---|
389 | bool confirmReplacePackage(const QString &strPackName, const QString &strPackVersionNew, const QString &strPackVersionOld,
|
---|
390 | const QString &strPackDescription, QWidget *pParent);
|
---|
391 | bool confirmRemovingPackage(const QString &strPackName, QWidget *pParent);
|
---|
392 | void notifyAboutExtPackInstalled(const QString &strPackName, QWidget *pParent);
|
---|
393 |
|
---|
394 | void warnAboutIncorrectPort(QWidget *pParent) const;
|
---|
395 | bool confirmCancelingPortForwardingDialog(QWidget *pParent) const;
|
---|
396 |
|
---|
397 | void showRuntimeError(const CConsole &console, bool fFatal,
|
---|
398 | const QString &strErrorId,
|
---|
399 | const QString &strErrorMsg) const;
|
---|
400 |
|
---|
401 | static QString mediumToAccusative(UIMediumType type, bool fIsHostDrive = false);
|
---|
402 |
|
---|
403 | static QString formatRC(HRESULT rc);
|
---|
404 |
|
---|
405 | static QString formatErrorInfo(const COMErrorInfo &info,
|
---|
406 | HRESULT wrapperRC = S_OK);
|
---|
407 |
|
---|
408 | static QString formatErrorInfo(const CVirtualBoxErrorInfo &info)
|
---|
409 | {
|
---|
410 | return formatErrorInfo(COMErrorInfo(info));
|
---|
411 | }
|
---|
412 |
|
---|
413 | static QString formatErrorInfo(const COMBaseWithEI &wrapper)
|
---|
414 | {
|
---|
415 | Assert(wrapper.lastRC() != S_OK);
|
---|
416 | return formatErrorInfo(wrapper.errorInfo(), wrapper.lastRC());
|
---|
417 | }
|
---|
418 |
|
---|
419 | static QString formatErrorInfo(const COMResult &rc)
|
---|
420 | {
|
---|
421 | Assert(rc.rc() != S_OK);
|
---|
422 | return formatErrorInfo(rc.errorInfo(), rc.rc());
|
---|
423 | }
|
---|
424 |
|
---|
425 | void showGenericError(COMBaseWithEI *object, QWidget *pParent = 0);
|
---|
426 |
|
---|
427 | /* Stuff supporting interthreading: */
|
---|
428 | void cannotCreateHostInterface(const CHost &host, QWidget *pParent = 0);
|
---|
429 | void cannotCreateHostInterface(const CProgress &progress, QWidget *pParent = 0);
|
---|
430 | void cannotRemoveHostInterface(const CHost &host, const CHostNetworkInterface &iface, QWidget *pParent = 0);
|
---|
431 | void cannotRemoveHostInterface(const CProgress &progress, const CHostNetworkInterface &iface, QWidget *pParent = 0);
|
---|
432 | void cannotAttachDevice(const CMachine &machine, UIMediumType type,
|
---|
433 | const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent = 0);
|
---|
434 | void cannotCreateSharedFolder(const CMachine &machine, const QString &strName,
|
---|
435 | const QString &strPath, QWidget *pParent = 0);
|
---|
436 | void cannotRemoveSharedFolder(const CMachine &machine, const QString &strName,
|
---|
437 | const QString &strPath, QWidget *pParent = 0);
|
---|
438 | void cannotCreateSharedFolder(const CConsole &console, const QString &strName,
|
---|
439 | const QString &strPath, QWidget *pParent = 0);
|
---|
440 | void cannotRemoveSharedFolder(const CConsole &console, const QString &strName,
|
---|
441 | const QString &strPath, QWidget *pParent = 0);
|
---|
442 | #ifdef VBOX_WITH_DRAG_AND_DROP
|
---|
443 | void cannotDropData(const CGuest &guest, QWidget *pParent = 0) const;
|
---|
444 | void cannotDropData(const CProgress &progress, QWidget *pParent = 0) const;
|
---|
445 | #endif /* VBOX_WITH_DRAG_AND_DROP */
|
---|
446 | void remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
|
---|
447 | void remindAboutUnsupportedUSB2(const QString &strExtPackName, QWidget *pParent = 0);
|
---|
448 |
|
---|
449 | signals:
|
---|
450 |
|
---|
451 | void sigToCloseAllWarnings();
|
---|
452 |
|
---|
453 | /* Stuff supporting interthreading: */
|
---|
454 | void sigCannotCreateHostInterface(const CHost &host, QWidget *pParent);
|
---|
455 | void sigCannotCreateHostInterface(const CProgress &progress, QWidget *pParent);
|
---|
456 | void sigCannotRemoveHostInterface(const CHost &host, const CHostNetworkInterface &iface, QWidget *pParent);
|
---|
457 | void sigCannotRemoveHostInterface(const CProgress &progress, const CHostNetworkInterface &iface, QWidget *pParent);
|
---|
458 | void sigCannotAttachDevice(const CMachine &machine, UIMediumType type,
|
---|
459 | const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent);
|
---|
460 | void sigCannotCreateSharedFolder(const CMachine &machine, const QString &strName,
|
---|
461 | const QString &strPath, QWidget *pParent);
|
---|
462 | void sigCannotRemoveSharedFolder(const CMachine &machine, const QString &strName,
|
---|
463 | const QString &strPath, QWidget *pParent);
|
---|
464 | void sigCannotCreateSharedFolder(const CConsole &console, const QString &strName,
|
---|
465 | const QString &strPath, QWidget *pParent);
|
---|
466 | void sigCannotRemoveSharedFolder(const CConsole &console, const QString &strName,
|
---|
467 | const QString &strPath, QWidget *pParent);
|
---|
468 | void sigRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
|
---|
469 | void sigRemindAboutUnsupportedUSB2(const QString &strExtPackName, QWidget *pParent);
|
---|
470 |
|
---|
471 | public slots:
|
---|
472 |
|
---|
473 | void sltShowHelpWebDialog();
|
---|
474 | void sltShowHelpAboutDialog();
|
---|
475 | void sltShowHelpHelpDialog();
|
---|
476 | void sltResetSuppressedMessages();
|
---|
477 | void sltShowUserManual(const QString &strLocation);
|
---|
478 |
|
---|
479 | private slots:
|
---|
480 |
|
---|
481 | /* Stuff supporting interthreading: */
|
---|
482 | void sltCannotCreateHostInterface(const CHost &host, QWidget *pParent);
|
---|
483 | void sltCannotCreateHostInterface(const CProgress &progress, QWidget *pParent);
|
---|
484 | void sltCannotRemoveHostInterface(const CHost &host, const CHostNetworkInterface &iface, QWidget *pParent);
|
---|
485 | void sltCannotRemoveHostInterface(const CProgress &progress, const CHostNetworkInterface &iface, QWidget *pParent);
|
---|
486 | void sltCannotAttachDevice(const CMachine &machine, UIMediumType type,
|
---|
487 | const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent);
|
---|
488 | void sltCannotCreateSharedFolder(const CMachine &machine, const QString &strName,
|
---|
489 | const QString &strPath, QWidget *pParent);
|
---|
490 | void sltCannotRemoveSharedFolder(const CMachine &machine, const QString &strName,
|
---|
491 | const QString &strPath, QWidget *pParent);
|
---|
492 | void sltCannotCreateSharedFolder(const CConsole &console, const QString &strName,
|
---|
493 | const QString &strPath, QWidget *pParent);
|
---|
494 | void sltCannotRemoveSharedFolder(const CConsole &console, const QString &strName,
|
---|
495 | const QString &strPath, QWidget *pParent);
|
---|
496 | void sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
|
---|
497 | void sltRemindAboutUnsupportedUSB2(const QString &strExtPackName, QWidget *pParent);
|
---|
498 |
|
---|
499 | private:
|
---|
500 |
|
---|
501 | UIMessageCenter();
|
---|
502 |
|
---|
503 | static UIMessageCenter &instance();
|
---|
504 |
|
---|
505 | friend UIMessageCenter &msgCenter();
|
---|
506 |
|
---|
507 | static QString errorInfoToString(const COMErrorInfo &info,
|
---|
508 | HRESULT wrapperRC = S_OK);
|
---|
509 |
|
---|
510 | QStringList m_strShownWarnings;
|
---|
511 | mutable QList<QPointer<QIMessageBox> > m_warnings;
|
---|
512 | };
|
---|
513 |
|
---|
514 | /* Shortcut to the static UIMessageCenter::instance() method, for convenience. */
|
---|
515 | inline UIMessageCenter &msgCenter() { return UIMessageCenter::instance(); }
|
---|
516 |
|
---|
517 | #endif // __UIMessageCenter_h__
|
---|
518 |
|
---|