VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h@ 5656

Last change on this file since 5656 was 5656, checked in by vboxsync, 17 years ago

FE/Qt: Wording.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.1 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxProblemReporter class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2007 innotek GmbH
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 as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef __VBoxProblemReporter_h__
20#define __VBoxProblemReporter_h__
21
22#include "COMDefs.h"
23#include "QIMessageBox.h"
24
25#include <qobject.h>
26
27class QProcess;
28
29class VBoxProblemReporter : public QObject
30{
31 Q_OBJECT
32
33public:
34
35 enum Type {
36 Info = 1,
37 Question,
38 Warning,
39 Error,
40 Critical,
41 GuruMeditation
42 };
43 enum {
44 AutoConfirmed = 0x8000
45 };
46
47 static VBoxProblemReporter &instance();
48
49 bool isValid();
50
51 // helpers
52
53 int message (QWidget *parent, Type type, const QString &msg,
54 const QString &details = QString::null,
55 const char *autoConfirmId = NULL,
56 int b1 = 0, int b2 = 0, int b3 = 0,
57 const char *name = 0);
58
59 int message (QWidget *parent, Type type, const QString &msg,
60 const char *autoConfirmId,
61 int b1 = 0, int b2 = 0, int b3 = 0,
62 const char *name = 0)
63 {
64 return message (parent, type, msg, QString::null, autoConfirmId,
65 b1, b2, b3, name);
66 }
67
68 bool messageYesNo (QWidget *parent, Type type, const QString &msg,
69 const QString &details = QString::null,
70 const char *autoConfirmId = 0,
71 const char *name = 0);
72
73 bool messageYesNo (QWidget *parent, Type type, const QString &msg,
74 const char *autoConfirmId,
75 const char *name = 0)
76 {
77 return messageYesNo (parent, type, msg, QString::null, autoConfirmId, name);
78 }
79
80 bool showModalProgressDialog (CProgress &aProgress, const QString &aTitle,
81 QWidget *aParent, int aMinDuration = 2000);
82
83 QWidget *mainWindowShown();
84
85 // problem handlers
86
87#ifdef Q_WS_X11
88 void cannotFindLicenseFiles (const QString &aPath);
89 void cannotOpenLicenseFile (QWidget *aParent, const QString &aPath);
90#endif
91
92 void cannotOpenURL (const QString &aURL);
93
94 void cannotFindLanguage (const QString &aLangID, const QString &aNlsPath);
95 void cannotLoadLanguage (const QString &aLangFile);
96
97 void cannotInitCOM (HRESULT rc);
98 void cannotCreateVirtualBox (const CVirtualBox &vbox);
99
100 void cannotLoadGlobalConfig (const CVirtualBox &vbox, const QString &error);
101 void cannotSaveGlobalConfig (const CVirtualBox &vbox);
102 void cannotSetSystemProperties (const CSystemProperties &props);
103 void cannotAccessUSB (const COMBase &obj);
104
105 void cannotCreateMachine (const CVirtualBox &vbox,
106 QWidget *parent = 0);
107 void cannotCreateMachine (const CVirtualBox &vbox, const CMachine &machine,
108 QWidget *parent = 0);
109 void cannotApplyMachineSettings (const CMachine &machine, const COMResult &res);
110 void cannotSaveMachineSettings (const CMachine &machine,
111 QWidget *parent = 0);
112 void cannotLoadMachineSettings (const CMachine &machine,
113 bool strict = true,
114 QWidget *parent = 0);
115
116 void cannotStartMachine (const CConsole &console);
117 void cannotStartMachine (const CProgress &progress);
118 void cannotPauseMachine (const CConsole &console);
119 void cannotResumeMachine (const CConsole &console);
120 void cannotACPIShutdownMachine (const CConsole &console);
121 void cannotSaveMachineState (const CConsole &console);
122 void cannotSaveMachineState (const CProgress &progress);
123 void cannotTakeSnapshot (const CConsole &console);
124 void cannotTakeSnapshot (const CProgress &progress);
125 void cannotStopMachine (const CConsole &console);
126 void cannotDeleteMachine (const CVirtualBox &vbox, const CMachine &machine);
127 void cannotDiscardSavedState (const CConsole &console);
128
129 void cannotSetSnapshotFolder (const CMachine &aMachine, const QString &aPath);
130 void cannotDiscardSnapshot (const CConsole &console, const CSnapshot &snapshot);
131 void cannotDiscardSnapshot (const CProgress &progress, const CSnapshot &snapshot);
132 void cannotDiscardCurrentState (const CConsole &console);
133 void cannotDiscardCurrentState (const CProgress &progress);
134 void cannotDiscardCurrentSnapshotAndState (const CConsole &console);
135 void cannotDiscardCurrentSnapshotAndState (const CProgress &progress);
136
137 void cannotFindMachineByName (const CVirtualBox &vbox, const QString &name);
138
139 void cannotEnterSeamlessMode (ULONG aWidth, ULONG aHeight, ULONG aBpp);
140
141 bool confirmMachineDeletion (const CMachine &machine);
142 bool confirmDiscardSavedState (const CMachine &machine);
143
144 bool confirmReleaseImage (QWidget *parent, const QString &usage);
145
146 void sayCannotOverwriteHardDiskImage (QWidget *parent, const QString &src);
147 int confirmHardDiskImageDeletion (QWidget *parent, const QString &src);
148 void cannotDeleteHardDiskImage (QWidget *parent, const CVirtualDiskImage &vdi);
149
150 int confirmHardDiskUnregister (QWidget *parent, const QString &src);
151
152 void cannotCreateHardDiskImage (
153 QWidget *parent, const CVirtualBox &vbox, const QString &src,
154 const CVirtualDiskImage &vdi, const CProgress &progress);
155 void cannotAttachHardDisk (QWidget *parent, const CMachine &m, const QUuid &id,
156 CEnums::DiskControllerType ctl, LONG dev);
157 void cannotDetachHardDisk (QWidget *parent, const CMachine &m,
158 CEnums::DiskControllerType ctl, LONG dev);
159 void cannotRegisterMedia (QWidget *parent, const CVirtualBox &vbox,
160 VBoxDefs::DiskType type, const QString &src);
161 void cannotUnregisterMedia (QWidget *parent, const CVirtualBox &vbox,
162 VBoxDefs::DiskType type, const QString &src);
163
164 void cannotOpenSession (const CSession &session);
165 void cannotOpenSession (const CVirtualBox &vbox, const CMachine &machine,
166 const CProgress &progress = CProgress());
167
168 void cannotGetMediaAccessibility (const CUnknown &unk);
169
170/// @todo (r=dmik) later
171// void cannotMountMedia (const CUnknown &unk);
172// void cannotUnmountMedia (const CUnknown &unk);
173
174#if defined Q_WS_WIN
175 void cannotCreateHostInterface (const CHost &host, const QString &name,
176 QWidget *parent = 0);
177 void cannotCreateHostInterface (const CProgress &progress, const QString &name,
178 QWidget *parent = 0);
179 void cannotRemoveHostInterface (const CHost &host,
180 const CHostNetworkInterface &iface,
181 QWidget *parent = 0);
182 void cannotRemoveHostInterface (const CProgress &progress,
183 const CHostNetworkInterface &iface,
184 QWidget *parent = 0);
185#endif
186
187 void cannotAttachUSBDevice (const CConsole &console, const QString &device);
188 void cannotAttachUSBDevice (const CConsole &console, const QString &device,
189 const CVirtualBoxErrorInfo &error);
190 void cannotDetachUSBDevice (const CConsole &console, const QString &device);
191 void cannotDetachUSBDevice (const CConsole &console, const QString &device,
192 const CVirtualBoxErrorInfo &error);
193
194 void cannotCreateSharedFolder (QWidget *, const CMachine &,
195 const QString &, const QString &);
196 void cannotRemoveSharedFolder (QWidget *, const CMachine &,
197 const QString &, const QString &);
198 void cannotCreateSharedFolder (QWidget *, const CConsole &,
199 const QString &, const QString &);
200 void cannotRemoveSharedFolder (QWidget *, const CConsole &,
201 const QString &, const QString &);
202
203 int cannotFindGuestAdditions (const QString &aSrc1, const QString &aSrc2);
204 void cannotDownloadGuestAdditions (const QString &aURL,
205 const QString &aReason);
206 int confirmDownloadAdditions (const QString &aURL, ulong aSize);
207 int confirmMountAdditions (const QString &aURL, const QString &aSrc);
208 void warnAboutTooOldAdditions (QWidget *, const QString &, const QString &);
209 void warnAboutOldAdditions (QWidget *, const QString &, const QString &);
210 void warnAboutNewAdditions (QWidget *, const QString &, const QString &);
211
212 void cannotConnectRegister (QWidget *aParent,
213 const QString &aURL,
214 const QString &aReason);
215 void showRegisterResult (QWidget *aParent,
216 const QString &aResult);
217
218 bool remindAboutInputCapture();
219 bool remindAboutAutoCapture();
220 bool remindAboutMouseIntegration (bool supportsAbsolute);
221 bool remindAboutPausedVMInput();
222
223 bool remindAboutInaccessibleMedia();
224
225 void remindAboutGoingFullscreen (const QString &hotKey,
226 const QString &hostKey);
227 void remindAboutGoingSeamless (const QString &hotKey,
228 const QString &hostKey);
229
230 void remindAboutWrongColorDepth (ulong aRealBPP, ulong aWantedBPP);
231
232 bool remindAboutGuruMeditation (const CConsole &aConsole,
233 const QString &aLogFolder);
234
235 bool confirmVMReset (QWidget *aParent);
236
237 int remindAboutUnsetHD (QWidget *aParent);
238
239 void cannotRunInSelectorMode();
240
241 void showRuntimeError (const CConsole &console, bool fatal,
242 const QString &errorID,
243 const QString &errorMsg);
244
245 static QString formatErrorInfo (const COMErrorInfo &aInfo,
246 HRESULT aWrapperRC = S_OK);
247
248 static QString formatErrorInfo (const CVirtualBoxErrorInfo &aInfo)
249 {
250 return formatErrorInfo (COMErrorInfo (aInfo));
251 }
252
253 static QString formatErrorInfo (const COMBase &aWrapper)
254 {
255 Assert (FAILED (aWrapper.lastRC()));
256 return formatErrorInfo (aWrapper.errorInfo(), aWrapper.lastRC());
257 }
258
259 static QString formatErrorInfo (const COMResult &aRC)
260 {
261 Assert (FAILED (aRC.rc()));
262 return formatErrorInfo (aRC.errorInfo(), aRC.rc());
263 }
264
265public slots:
266
267 void showHelpWebDialog();
268 void showHelpAboutDialog();
269 void showHelpHelpDialog();
270 void resetSuppressedMessages();
271
272private:
273
274 friend VBoxProblemReporter &vboxProblem();
275
276 static QString doFormatErrorInfo (const COMErrorInfo &aInfo,
277 HRESULT aWrapperRC = S_OK);
278};
279
280inline VBoxProblemReporter &vboxProblem() { return VBoxProblemReporter::instance(); }
281
282#endif // __VBoxProblemReporter_h__
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette