1 | /* $Id: UIMessageCenter.h 103803 2024-03-12 11:15:18Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIMessageCenter class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef FEQT_INCLUDED_SRC_globals_UIMessageCenter_h
|
---|
29 | #define FEQT_INCLUDED_SRC_globals_UIMessageCenter_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QObject>
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "UILibraryDefs.h"
|
---|
39 | #include "UIMediumDefs.h"
|
---|
40 |
|
---|
41 | /* COM includes: */
|
---|
42 | #include "CProgress.h"
|
---|
43 |
|
---|
44 | /* Forward declarations: */
|
---|
45 | class UIMedium;
|
---|
46 | struct StorageSlot;
|
---|
47 | #ifdef VBOX_WITH_DRAG_AND_DROP
|
---|
48 | class CGuest;
|
---|
49 | #endif
|
---|
50 |
|
---|
51 |
|
---|
52 | /** Possible message types. */
|
---|
53 | enum MessageType
|
---|
54 | {
|
---|
55 | MessageType_Info = 1,
|
---|
56 | MessageType_Question,
|
---|
57 | MessageType_Warning,
|
---|
58 | MessageType_Error,
|
---|
59 | MessageType_Critical,
|
---|
60 | MessageType_GuruMeditation
|
---|
61 | };
|
---|
62 | Q_DECLARE_METATYPE(MessageType);
|
---|
63 |
|
---|
64 |
|
---|
65 | /** Singleton QObject extension
|
---|
66 | * providing GUI with corresponding messages. */
|
---|
67 | class SHARED_LIBRARY_STUFF UIMessageCenter : public QObject
|
---|
68 | {
|
---|
69 | Q_OBJECT;
|
---|
70 |
|
---|
71 | signals:
|
---|
72 |
|
---|
73 | /** Asks to show message-box.
|
---|
74 | * @param pParent Brings the message-box parent.
|
---|
75 | * @param enmType Brings the message-box type.
|
---|
76 | * @param strMessage Brings the message.
|
---|
77 | * @param strDetails Brings the details.
|
---|
78 | * @param iButton1 Brings the button 1 type.
|
---|
79 | * @param iButton2 Brings the button 2 type.
|
---|
80 | * @param iButton3 Brings the button 3 type.
|
---|
81 | * @param strButtonText1 Brings the button 1 text.
|
---|
82 | * @param strButtonText2 Brings the button 2 text.
|
---|
83 | * @param strButtonText3 Brings the button 3 text.
|
---|
84 | * @param strAutoConfirmId Brings whether this message can be auto-confirmed. */
|
---|
85 | void sigToShowMessageBox(QWidget *pParent, MessageType enmType,
|
---|
86 | const QString &strMessage, const QString &strDetails,
|
---|
87 | int iButton1, int iButton2, int iButton3,
|
---|
88 | const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3,
|
---|
89 | const QString &strAutoConfirmId, const QString &strHelpKeyword) const;
|
---|
90 |
|
---|
91 | public:
|
---|
92 |
|
---|
93 | /** Creates message-center singleton. */
|
---|
94 | static void create();
|
---|
95 | /** Destroys message-center singleton. */
|
---|
96 | static void destroy();
|
---|
97 |
|
---|
98 | /** Defines whether warning with particular @a strWarningName is @a fShown. */
|
---|
99 | void setWarningShown(const QString &strWarningName, bool fShown) const;
|
---|
100 | /** Returns whether warning with particular @a strWarningName is shown. */
|
---|
101 | bool warningShown(const QString &strWarningName) const;
|
---|
102 |
|
---|
103 | /** Shows a general type of 'Message'.
|
---|
104 | * @param pParent Brings the message-box parent.
|
---|
105 | * @param enmType Brings the message-box type.
|
---|
106 | * @param strMessage Brings the message.
|
---|
107 | * @param strDetails Brings the details.
|
---|
108 | * @param pcszAutoConfirmId Brings the auto-confirm ID.
|
---|
109 | * @param iButton1 Brings the button 1 type.
|
---|
110 | * @param iButton2 Brings the button 2 type.
|
---|
111 | * @param iButton3 Brings the button 3 type.
|
---|
112 | * @param strButtonText1 Brings the button 1 text.
|
---|
113 | * @param strButtonText2 Brings the button 2 text.
|
---|
114 | * @param strButtonText3 Brings the button 3 text.
|
---|
115 | * @param strHelpKeyword Brings the help keyword string. */
|
---|
116 | int message(QWidget *pParent, MessageType enmType,
|
---|
117 | const QString &strMessage, const QString &strDetails,
|
---|
118 | const char *pcszAutoConfirmId = 0,
|
---|
119 | int iButton1 = 0, int iButton2 = 0, int iButton3 = 0,
|
---|
120 | const QString &strButtonText1 = QString(),
|
---|
121 | const QString &strButtonText2 = QString(),
|
---|
122 | const QString &strButtonText3 = QString(),
|
---|
123 | const QString &strHelpKeyword = QString()) const;
|
---|
124 |
|
---|
125 | /** Shows an 'Error' type of 'Message'.
|
---|
126 | * Provides single Ok button.
|
---|
127 | * @param pParent Brings the message-box parent.
|
---|
128 | * @param enmType Brings the message-box type.
|
---|
129 | * @param strMessage Brings the message.
|
---|
130 | * @param strDetails Brings the details.
|
---|
131 | * @param pcszAutoConfirmId Brings the auto-confirm ID.
|
---|
132 | * @param strHelpKeyword Brings the help keyword string. */
|
---|
133 | void error(QWidget *pParent, MessageType enmType,
|
---|
134 | const QString &strMessage,
|
---|
135 | const QString &strDetails,
|
---|
136 | const char *pcszAutoConfirmId = 0,
|
---|
137 | const QString &strHelpKeyword = QString()) const;
|
---|
138 |
|
---|
139 | /** Shows an 'Error with Question' type of 'Message'.
|
---|
140 | * Provides Ok and Cancel buttons (called same way by default).
|
---|
141 | * @param pParent Brings the message-box parent.
|
---|
142 | * @param enmType Brings the message-box type.
|
---|
143 | * @param strMessage Brings the message.
|
---|
144 | * @param strDetails Brings the details.
|
---|
145 | * @param pcszAutoConfirmId Brings the auto-confirm ID.
|
---|
146 | * @param strOkButtonText Brings the Ok button text.
|
---|
147 | * @param strCancelButtonText Brings the Cancel button text.
|
---|
148 | * @param strHelpKeyword Brings the help keyword string. */
|
---|
149 | bool errorWithQuestion(QWidget *pParent, MessageType enmType,
|
---|
150 | const QString &strMessage,
|
---|
151 | const QString &strDetails,
|
---|
152 | const char *pcszAutoConfirmId = 0,
|
---|
153 | const QString &strOkButtonText = QString(),
|
---|
154 | const QString &strCancelButtonText = QString(),
|
---|
155 | const QString &strHelpKeyword = QString()) const;
|
---|
156 |
|
---|
157 | /** Shows an 'Alert' type of 'Error'.
|
---|
158 | * Omit details.
|
---|
159 | * @param pParent Brings the message-box parent.
|
---|
160 | * @param enmType Brings the message-box type.
|
---|
161 | * @param strMessage Brings the message.
|
---|
162 | * @param pcszAutoConfirmId Brings the auto-confirm ID.
|
---|
163 | * @param strHelpKeyword Brings the help keyword string. */
|
---|
164 | void alert(QWidget *pParent, MessageType enmType,
|
---|
165 | const QString &strMessage,
|
---|
166 | const char *pcszAutoConfirmId = 0,
|
---|
167 | const QString &strHelpKeyword = QString()) const;
|
---|
168 |
|
---|
169 | /** Shows a 'Question' type of 'Message'.
|
---|
170 | * Omit details.
|
---|
171 | * @param pParent Brings the message-box parent.
|
---|
172 | * @param enmType Brings the message-box type.
|
---|
173 | * @param strMessage Brings the message.
|
---|
174 | * @param pcszAutoConfirmId Brings the auto-confirm ID.
|
---|
175 | * @param iButton1 Brings the button 1 type.
|
---|
176 | * @param iButton2 Brings the button 2 type.
|
---|
177 | * @param iButton3 Brings the button 3 type.
|
---|
178 | * @param strButtonText1 Brings the button 1 text.
|
---|
179 | * @param strButtonText2 Brings the button 2 text.
|
---|
180 | * @param strButtonText3 Brings the button 3 text. */
|
---|
181 | int question(QWidget *pParent, MessageType enmType,
|
---|
182 | const QString &strMessage,
|
---|
183 | const char *pcszAutoConfirmId = 0,
|
---|
184 | int iButton1 = 0, int iButton2 = 0, int iButton3 = 0,
|
---|
185 | const QString &strButtonText1 = QString(),
|
---|
186 | const QString &strButtonText2 = QString(),
|
---|
187 | const QString &strButtonText3 = QString()) const;
|
---|
188 |
|
---|
189 | /** Shows a 'Binary' type of 'Question'.
|
---|
190 | * Omit details. Provides Ok and Cancel buttons (called same way by default).
|
---|
191 | * @param pParent Brings the message-box parent.
|
---|
192 | * @param enmType Brings the message-box type.
|
---|
193 | * @param strMessage Brings the message.
|
---|
194 | * @param pcszAutoConfirmId Brings the auto-confirm ID.
|
---|
195 | * @param strOkButtonText Brings the button 1 text.
|
---|
196 | * @param strCancelButtonText Brings the button 2 text.
|
---|
197 | * @param fDefaultFocusForOk Brings whether Ok button should be focused initially. */
|
---|
198 | bool questionBinary(QWidget *pParent, MessageType enmType,
|
---|
199 | const QString &strMessage,
|
---|
200 | const char *pcszAutoConfirmId = 0,
|
---|
201 | const QString &strOkButtonText = QString(),
|
---|
202 | const QString &strCancelButtonText = QString(),
|
---|
203 | bool fDefaultFocusForOk = true) const;
|
---|
204 |
|
---|
205 | /** Shows a 'Trinary' type of 'Question'.
|
---|
206 | * Omit details. Provides Yes, No and Cancel buttons (called same way by default).
|
---|
207 | * @param pParent Brings the message-box parent.
|
---|
208 | * @param enmType Brings the message-box type.
|
---|
209 | * @param strMessage Brings the message.
|
---|
210 | * @param pcszAutoConfirmId Brings the auto-confirm ID.
|
---|
211 | * @param strChoice1ButtonText Brings the button 1 text.
|
---|
212 | * @param strChoice2ButtonText Brings the button 2 text.
|
---|
213 | * @param strCancelButtonText Brings the button 3 text. */
|
---|
214 | int questionTrinary(QWidget *pParent, MessageType enmType,
|
---|
215 | const QString &strMessage,
|
---|
216 | const char *pcszAutoConfirmId = 0,
|
---|
217 | const QString &strChoice1ButtonText = QString(),
|
---|
218 | const QString &strChoice2ButtonText = QString(),
|
---|
219 | const QString &strCancelButtonText = QString()) const;
|
---|
220 |
|
---|
221 | /** Shows a general type of 'Message with Option'.
|
---|
222 | * @param pParent Brings the message-box parent.
|
---|
223 | * @param enmType Brings the message-box type.
|
---|
224 | * @param strMessage Brings the message.
|
---|
225 | * @param strOptionText Brings the option text.
|
---|
226 | * @param fDefaultOptionValue Brings the default option value.
|
---|
227 | * @param iButton1 Brings the button 1 type.
|
---|
228 | * @param iButton2 Brings the button 2 type.
|
---|
229 | * @param iButton3 Brings the button 3 type.
|
---|
230 | * @param strButtonText1 Brings the button 1 text.
|
---|
231 | * @param strButtonText2 Brings the button 2 text.
|
---|
232 | * @param strButtonText3 Brings the button 3 text. */
|
---|
233 | int messageWithOption(QWidget *pParent, MessageType enmType,
|
---|
234 | const QString &strMessage,
|
---|
235 | const QString &strOptionText,
|
---|
236 | bool fDefaultOptionValue = true,
|
---|
237 | int iButton1 = 0, int iButton2 = 0, int iButton3 = 0,
|
---|
238 | const QString &strButtonText1 = QString(),
|
---|
239 | const QString &strButtonText2 = QString(),
|
---|
240 | const QString &strButtonText3 = QString()) const;
|
---|
241 |
|
---|
242 | /** Shows modal progress-dialog.
|
---|
243 | * @param comProgress Brings the progress this dialog is based on.
|
---|
244 | * @param strTitle Brings the title.
|
---|
245 | * @param strImage Brings the image.
|
---|
246 | * @param pParent Brings the parent.
|
---|
247 | * @param cMinDuration Brings the minimum diration to show this dialog after expiring it. */
|
---|
248 | bool showModalProgressDialog(CProgress &comProgress, const QString &strTitle,
|
---|
249 | const QString &strImage = "", QWidget *pParent = 0,
|
---|
250 | int cMinDuration = 2000);
|
---|
251 |
|
---|
252 | /** @name Startup warnings.
|
---|
253 | * @{ */
|
---|
254 | void cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const;
|
---|
255 | void cannotLoadLanguage(const QString &strLangFile) const;
|
---|
256 |
|
---|
257 | void cannotInitUserHome(const QString &strUserHome) const;
|
---|
258 | void cannotInitCOM(HRESULT rc) const;
|
---|
259 |
|
---|
260 | void cannotHandleRuntimeOption(const QString &strOption) const;
|
---|
261 |
|
---|
262 | #ifdef RT_OS_LINUX
|
---|
263 | void warnAboutWrongUSBMounted() const;
|
---|
264 | #endif
|
---|
265 |
|
---|
266 | void cannotStartSelector() const;
|
---|
267 | void cannotStartRuntime() const;
|
---|
268 | /** @} */
|
---|
269 |
|
---|
270 | /** @name General COM warnings.
|
---|
271 | * @{ */
|
---|
272 | void cannotCreateVirtualBoxClient(const CVirtualBoxClient &comClient) const;
|
---|
273 | void cannotAcquireVirtualBox(const CVirtualBoxClient &comClient) const;
|
---|
274 |
|
---|
275 | void cannotFindMachineByName(const CVirtualBox &comVBox, const QString &strName) const;
|
---|
276 | void cannotFindMachineById(const CVirtualBox &comVBox, const QUuid &uId) const;
|
---|
277 | void cannotSetExtraData(const CVirtualBox &comVBox, const QString &strKey, const QString &strValue);
|
---|
278 | void cannotOpenMedium(const CVirtualBox &comVBox, const QString &strLocation, QWidget *pParent = 0) const;
|
---|
279 |
|
---|
280 | void cannotOpenSession(const CSession &comSession) const;
|
---|
281 | void cannotOpenSession(const CMachine &comMachine) const;
|
---|
282 | void cannotOpenSession(const CProgress &comProgress, const QString &strMachineName) const;
|
---|
283 |
|
---|
284 | void cannotSetExtraData(const CMachine &machine, const QString &strKey, const QString &strValue);
|
---|
285 |
|
---|
286 | void cannotAttachDevice(const CMachine &machine, UIMediumDeviceType type, const QString &strLocation,
|
---|
287 | const StorageSlot &storageSlot, QWidget *pParent = 0);
|
---|
288 | void cannotDetachDevice(const CMachine &machine, UIMediumDeviceType type, const QString &strLocation,
|
---|
289 | const StorageSlot &storageSlot, QWidget *pParent = 0) const;
|
---|
290 | bool cannotRemountMedium(const CMachine &machine, const UIMedium &medium,
|
---|
291 | bool fMount, bool fRetry, QWidget *pParent = 0) const;
|
---|
292 |
|
---|
293 | void cannotSetHostSettings(const CHost &comHost, QWidget *pParent = 0) const;
|
---|
294 | void cannotSetSystemProperties(const CSystemProperties &properties, QWidget *pParent = 0) const;
|
---|
295 | void cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent = 0) const;
|
---|
296 |
|
---|
297 | void cannotAddDiskEncryptionPassword(const CConsole &console);
|
---|
298 | /** @} */
|
---|
299 |
|
---|
300 | /** @name Common warnings.
|
---|
301 | * @{ */
|
---|
302 | bool confirmResetMachine(const QString &strNames) const;
|
---|
303 |
|
---|
304 | void cannotSaveSettings(const QString strDetails, QWidget *pParent = 0) const;
|
---|
305 | void warnAboutUnaccessibleUSB(const COMBaseWithEI &object, QWidget *pParent = 0) const;
|
---|
306 | void warnAboutStateChange(QWidget *pParent = 0) const;
|
---|
307 | bool confirmSettingsDiscarding(QWidget *pParent = 0) const;
|
---|
308 | bool confirmSettingsReloading(QWidget *pParent = 0) const;
|
---|
309 | int confirmRemovingOfLastDVDDevice(QWidget *pParent = 0) const;
|
---|
310 | bool confirmStorageBusChangeWithOpticalRemoval(QWidget *pParent = 0) const;
|
---|
311 | bool confirmStorageBusChangeWithExcessiveRemoval(QWidget *pParent = 0) const;
|
---|
312 | bool warnAboutIncorrectPort(QWidget *pParent = 0) const;
|
---|
313 | bool warnAboutIncorrectAddress(QWidget *pParent = 0) const;
|
---|
314 | bool warnAboutEmptyGuestAddress(QWidget *pParent = 0) const;
|
---|
315 | bool warnAboutNameShouldBeUnique(QWidget *pParent = 0) const;
|
---|
316 | bool warnAboutRulesConflict(QWidget *pParent = 0) const;
|
---|
317 | bool confirmCancelingPortForwardingDialog(QWidget *pParent = 0) const;
|
---|
318 | bool confirmRestoringDefaultKeys(QWidget *pParent = 0) const;
|
---|
319 | /** @} */
|
---|
320 |
|
---|
321 | /** @name VirtualBox Manager warnings.
|
---|
322 | * @{ */
|
---|
323 | bool warnAboutInaccessibleMedia() const;
|
---|
324 |
|
---|
325 | bool confirmDiscardSavedState(const QString &strNames) const;
|
---|
326 | bool confirmTerminateCloudInstance(const QString &strNames) const;
|
---|
327 | bool confirmACPIShutdownMachine(const QString &strNames) const;
|
---|
328 | bool confirmPowerOffMachine(const QString &strNames) const;
|
---|
329 | bool confirmStartMultipleMachines(const QString &strNames) const;
|
---|
330 | /** @} */
|
---|
331 |
|
---|
332 | /** @name VirtualBox Manager / Chooser Pane warnings.
|
---|
333 | * @{ */
|
---|
334 | bool confirmAutomaticCollisionResolve(const QString &strName, const QString &strGroupName) const;
|
---|
335 | /// @todo move after fixing thread stuff
|
---|
336 | void cannotSetGroups(const CMachine &machine) const;
|
---|
337 | bool confirmMachineItemRemoval(const QStringList &names) const;
|
---|
338 | int confirmMachineRemoval(const QList<CMachine> &machines) const;
|
---|
339 | int confirmCloudMachineRemoval(const QList<CCloudMachine> &machines) const;
|
---|
340 | /** @} */
|
---|
341 |
|
---|
342 | /** @name VirtualBox Manager / Snapshot Pane warnings.
|
---|
343 | * @{ */
|
---|
344 | int confirmSnapshotRestoring(const QString &strSnapshotName, bool fAlsoCreateNewSnapshot) const;
|
---|
345 | bool confirmSnapshotRemoval(const QString &strSnapshotName) const;
|
---|
346 | bool warnAboutSnapshotRemovalFreeSpace(const QString &strSnapshotName, const QString &strTargetImageName,
|
---|
347 | const QString &strTargetImageMaxSize, const QString &strTargetFileSystemFree) const;
|
---|
348 | /** @} */
|
---|
349 |
|
---|
350 | /** @name VirtualBox Manager / Extension Manager warnings.
|
---|
351 | * @{ */
|
---|
352 | bool confirmInstallExtensionPack(const QString &strPackName, const QString &strPackVersion,
|
---|
353 | const QString &strPackDescription, QWidget *pParent = 0) const;
|
---|
354 | bool confirmReplaceExtensionPack(const QString &strPackName, const QString &strPackVersionNew,
|
---|
355 | const QString &strPackVersionOld, const QString &strPackDescription,
|
---|
356 | QWidget *pParent = 0) const;
|
---|
357 | bool confirmRemoveExtensionPack(const QString &strPackName, QWidget *pParent = 0) const;
|
---|
358 | /** @} */
|
---|
359 |
|
---|
360 | /** @name VirtualBox Manager / Media Manager warnings.
|
---|
361 | * @{ */
|
---|
362 | bool confirmMediumRelease(const UIMedium &medium, bool fInduced, QWidget *pParent = 0) const;
|
---|
363 | bool confirmMediumRemoval(const UIMedium &medium, QWidget *pParent = 0) const;
|
---|
364 | int confirmDeleteHardDiskStorage(const QString &strLocation, QWidget *pParent = 0) const;
|
---|
365 | bool confirmInaccesibleMediaClear(const QStringList &mediaNameList, UIMediumDeviceType enmType, QWidget *pParent = 0);
|
---|
366 | bool confirmVisoDiscard(QWidget *pParent = 0) const;
|
---|
367 | /** @} */
|
---|
368 |
|
---|
369 | /** @name VirtualBox Manager / Network Manager warnings.
|
---|
370 | * @{ */
|
---|
371 | bool confirmCloudNetworkRemoval(const QString &strName, QWidget *pParent = 0) const;
|
---|
372 | bool confirmHostNetworkInterfaceRemoval(const QString &strName, QWidget *pParent = 0) const;
|
---|
373 | bool confirmHostOnlyNetworkRemoval(const QString &strName, QWidget *pParent = 0) const;
|
---|
374 | bool confirmNATNetworkRemoval(const QString &strName, QWidget *pParent = 0) const;
|
---|
375 | /** @} */
|
---|
376 |
|
---|
377 | /** @name VirtualBox Manager / Cloud Profile Manager warnings.
|
---|
378 | * @{ */
|
---|
379 | bool confirmCloudProfileRemoval(const QString &strName, QWidget *pParent = 0) const;
|
---|
380 | bool confirmCloudProfilesImport(QWidget *pParent = 0) const;
|
---|
381 | int confirmCloudProfileManagerClosing(QWidget *pParent = 0) const;
|
---|
382 | /** @} */
|
---|
383 |
|
---|
384 | /** @name VirtualBox Manager / Cloud Console Manager warnings.
|
---|
385 | * @{ */
|
---|
386 | bool confirmCloudConsoleApplicationRemoval(const QString &strName, QWidget *pParent = 0) const;
|
---|
387 | bool confirmCloudConsoleProfileRemoval(const QString &strName, QWidget *pParent = 0) const;
|
---|
388 | /** @} */
|
---|
389 |
|
---|
390 | /** @name VirtualBox Manager / Downloading warnings.
|
---|
391 | * @{ */
|
---|
392 | #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
|
---|
393 | bool confirmLookingForGuestAdditions() const;
|
---|
394 | bool confirmDownloadGuestAdditions(const QString &strUrl, qulonglong uSize) const;
|
---|
395 | void cannotSaveGuestAdditions(const QString &strURL, const QString &strTarget) const;
|
---|
396 | bool proposeMountGuestAdditions(const QString &strUrl, const QString &strSrc) const;
|
---|
397 |
|
---|
398 | bool confirmLookingForUserManual(const QString &strMissedLocation) const;
|
---|
399 | bool confirmDownloadUserManual(const QString &strURL, qulonglong uSize) const;
|
---|
400 | void cannotSaveUserManual(const QString &strURL, const QString &strTarget) const;
|
---|
401 |
|
---|
402 | bool confirmLookingForExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion) const;
|
---|
403 | bool confirmDownloadExtensionPack(const QString &strExtPackName, const QString &strURL, qulonglong uSize) const;
|
---|
404 | void cannotSaveExtensionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo) const;
|
---|
405 | bool proposeInstallExtentionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo) const;
|
---|
406 | bool proposeDeleteExtentionPack(const QString &strTo) const;
|
---|
407 | bool proposeDeleteOldExtentionPacks(const QStringList &strFiles) const;
|
---|
408 | #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
|
---|
409 | /** @} */
|
---|
410 |
|
---|
411 | /** @name Runtime UI warnings.
|
---|
412 | * @{ */
|
---|
413 | bool cannotRestoreSnapshot(const CMachine &machine, const QString &strSnapshotName, const QString &strMachineName) const;
|
---|
414 | bool cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName) const;
|
---|
415 | void cannotStartMachine(const CConsole &console, const QString &strName) const;
|
---|
416 | void cannotStartMachine(const CProgress &progress, const QString &strName) const;
|
---|
417 |
|
---|
418 | bool warnAboutNetworkInterfaceNotFound(const QString &strMachineName, const QString &strIfNames) const;
|
---|
419 |
|
---|
420 | void warnAboutVBoxSVCUnavailable() const;
|
---|
421 | bool warnAboutGuruMeditation(const QString &strLogFolder);
|
---|
422 | void showRuntimeError(MessageType emnMessageType, const QString &strErrorId, const QString &strErrorMsg) const;
|
---|
423 |
|
---|
424 | bool confirmInputCapture(bool &fAutoConfirmed) const;
|
---|
425 | bool confirmGoingFullscreen(const QString &strHotKey) const;
|
---|
426 | bool confirmGoingSeamless(const QString &strHotKey) const;
|
---|
427 | bool confirmGoingScale(const QString &strHotKey) const;
|
---|
428 |
|
---|
429 | bool cannotEnterFullscreenMode(ULONG uWidth, ULONG uHeight, ULONG uBpp, ULONG64 uMinVRAM) const;
|
---|
430 | void cannotEnterSeamlessMode(ULONG uWidth, ULONG uHeight, ULONG uBpp, ULONG64 uMinVRAM) const;
|
---|
431 | bool cannotSwitchScreenInFullscreen(quint64 uMinVRAM) const;
|
---|
432 | void cannotSwitchScreenInSeamless(quint64 uMinVRAM) const;
|
---|
433 |
|
---|
434 | #ifdef VBOX_WITH_DRAG_AND_DROP
|
---|
435 | /// @todo move to notification-center as progress notification .. one day :)
|
---|
436 | void cannotDropDataToGuest(const CDnDTarget &dndTarget, QWidget *pParent = 0) const;
|
---|
437 | void cannotDropDataToGuest(const CProgress &progress, QWidget *pParent = 0) const;
|
---|
438 | void cannotDropDataToHost(const CDnDSource &dndSource, QWidget *pParent = 0) const;
|
---|
439 | void cannotDropDataToHost(const CProgress &progress, QWidget *pParent = 0) const;
|
---|
440 | #endif /* VBOX_WITH_DRAG_AND_DROP */
|
---|
441 | /** @} */
|
---|
442 |
|
---|
443 | /** @name VirtualBox Manager / Wizard warnings.
|
---|
444 | * @{ */
|
---|
445 | /// @todo move to notification-center after wizards get theirs.. :)
|
---|
446 | bool confirmHardDisklessMachine(QWidget *pParent = 0) const;
|
---|
447 | bool confirmExportMachinesInSaveState(const QStringList &machineNames, QWidget *pParent = 0) const;
|
---|
448 | bool confirmOverridingFile(const QString &strPath, QWidget *pParent = 0) const;
|
---|
449 | bool confirmOverridingFiles(const QVector<QString> &strPaths, QWidget *pParent = 0) const;
|
---|
450 | /** @} */
|
---|
451 |
|
---|
452 | /** @name VirtualBox Manager / FD Creation Dialog warnings.
|
---|
453 | * @{ */
|
---|
454 | void cannotCreateMediumStorage(const CVirtualBox &comVBox, const QString &strLocation, QWidget *pParent = 0) const;
|
---|
455 | /** @} */
|
---|
456 |
|
---|
457 | public slots:
|
---|
458 |
|
---|
459 | /* Handlers: Help menu stuff: */
|
---|
460 | void sltShowHelpWebDialog();
|
---|
461 | void sltShowBugTracker();
|
---|
462 | void sltShowForums();
|
---|
463 | void sltShowOracle();
|
---|
464 | void sltShowOnlineDocumentation();
|
---|
465 | void sltShowHelpAboutDialog();
|
---|
466 | void sltResetSuppressedMessages();
|
---|
467 |
|
---|
468 | private slots:
|
---|
469 |
|
---|
470 | /** Shows message-box.
|
---|
471 | * @param pParent Brings the message-box parent.
|
---|
472 | * @param enmType Brings the message-box type.
|
---|
473 | * @param strMessage Brings the message.
|
---|
474 | * @param strDetails Brings the details.
|
---|
475 | * @param iButton1 Brings the button 1 type.
|
---|
476 | * @param iButton2 Brings the button 2 type.
|
---|
477 | * @param iButton3 Brings the button 3 type.
|
---|
478 | * @param strButtonText1 Brings the button 1 text.
|
---|
479 | * @param strButtonText2 Brings the button 2 text.
|
---|
480 | * @param strButtonText3 Brings the button 3 text.
|
---|
481 | * @param strAutoConfirmId Brings whether this message can be auto-confirmed.
|
---|
482 | * @param strHelpKeyword Brings the help keyword string. */
|
---|
483 | void sltShowMessageBox(QWidget *pParent, MessageType enmType,
|
---|
484 | const QString &strMessage, const QString &strDetails,
|
---|
485 | int iButton1, int iButton2, int iButton3,
|
---|
486 | const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3,
|
---|
487 | const QString &strAutoConfirmId, const QString &strHelpKeyword) const;
|
---|
488 |
|
---|
489 | private:
|
---|
490 |
|
---|
491 | /** Constructs message-center. */
|
---|
492 | UIMessageCenter();
|
---|
493 | /** Destructs message-center. */
|
---|
494 | ~UIMessageCenter();
|
---|
495 |
|
---|
496 | /** Prepares all. */
|
---|
497 | void prepare();
|
---|
498 | /** Cleanups all. */
|
---|
499 | void cleanup();
|
---|
500 |
|
---|
501 | /** Shows message-box.
|
---|
502 | * @param pParent Brings the message-box parent.
|
---|
503 | * @param enmType Brings the message-box type.
|
---|
504 | * @param strMessage Brings the message.
|
---|
505 | * @param strDetails Brings the details.
|
---|
506 | * @param iButton1 Brings the button 1 type.
|
---|
507 | * @param iButton2 Brings the button 2 type.
|
---|
508 | * @param iButton3 Brings the button 3 type.
|
---|
509 | * @param strButtonText1 Brings the button 1 text.
|
---|
510 | * @param strButtonText2 Brings the button 2 text.
|
---|
511 | * @param strButtonText3 Brings the button 3 text.
|
---|
512 | * @param strAutoConfirmId Brings whether this message can be auto-confirmed.
|
---|
513 | * @param strHelpKeyword Brings the help keyowrd. */
|
---|
514 | int showMessageBox(QWidget *pParent, MessageType type,
|
---|
515 | const QString &strMessage, const QString &strDetails,
|
---|
516 | int iButton1, int iButton2, int iButton3,
|
---|
517 | const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3,
|
---|
518 | const QString &strAutoConfirmId, const QString &strHelpKeyword) const;
|
---|
519 |
|
---|
520 | /** Holds the list of shown warnings. */
|
---|
521 | mutable QStringList m_warnings;
|
---|
522 |
|
---|
523 | /** Holds the singleton message-center instance. */
|
---|
524 | static UIMessageCenter *s_pInstance;
|
---|
525 | /** Returns the singleton message-center instance. */
|
---|
526 | static UIMessageCenter *instance();
|
---|
527 | /** Allows for shortcut access. */
|
---|
528 | friend UIMessageCenter &msgCenter();
|
---|
529 | };
|
---|
530 |
|
---|
531 | /** Singleton Message Center 'official' name. */
|
---|
532 | inline UIMessageCenter &msgCenter() { return *UIMessageCenter::instance(); }
|
---|
533 |
|
---|
534 |
|
---|
535 | #endif /* !FEQT_INCLUDED_SRC_globals_UIMessageCenter_h */
|
---|