VirtualBox

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

Last change on this file since 4225 was 4166, checked in by vboxsync, 18 years ago

FE/Qt: More arguments to VBoxProblemReporter::cannotSetSnapshotFolder().

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.5 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 };
42 enum {
43 AutoConfirmed = 0x8000
44 };
45
46 static VBoxProblemReporter &instance();
47
48 bool isValid();
49
50 // helpers
51
52 int message (QWidget *parent, Type type, const QString &msg,
53 const QString &details = QString::null,
54 const char *autoConfirmId = NULL,
55 int b1 = 0, int b2 = 0, int b3 = 0,
56 const char *name = 0);
57
58 int message (QWidget *parent, Type type, const QString &msg,
59 const char *autoConfirmId,
60 int b1 = 0, int b2 = 0, int b3 = 0,
61 const char *name = 0)
62 {
63 return message (parent, type, msg, QString::null, autoConfirmId,
64 b1, b2, b3, name);
65 }
66
67 bool messageYesNo (QWidget *parent, Type type, const QString &msg,
68 const QString &details = QString::null,
69 const char *autoConfirmId = 0,
70 const char *name = 0);
71
72 bool messageYesNo (QWidget *parent, Type type, const QString &msg,
73 const char *autoConfirmId,
74 const char *name = 0)
75 {
76 return messageYesNo (parent, type, msg, QString::null, autoConfirmId, name);
77 }
78
79 bool showModalProgressDialog (CProgress &aProgress, const QString &aTitle,
80 QWidget *aParent, int aMinDuration = 2000);
81
82 QWidget *mainWindowShown();
83
84 // problem handlers
85
86 void cannotOpenURL (const QString &aURL);
87
88 void cannotFindLanguage (const QString &aLangID, const QString &aNlsPath);
89 void cannotLoadLanguage (const QString &aLangFile);
90
91 void cannotInitCOM (HRESULT rc);
92 void cannotCreateVirtualBox (const CVirtualBox &vbox);
93
94 void cannotLoadGlobalConfig (const CVirtualBox &vbox, const QString &error);
95 void cannotSaveGlobalConfig (const CVirtualBox &vbox);
96 void cannotSetSystemProperties (const CSystemProperties &props);
97 void cannotAccessUSB (const COMBase &obj);
98
99 void cannotCreateMachine (const CVirtualBox &vbox,
100 QWidget *parent = 0);
101 void cannotCreateMachine (const CVirtualBox &vbox, const CMachine &machine,
102 QWidget *parent = 0);
103 void cannotApplyMachineSettings (const CMachine &machine, const COMResult &res);
104 void cannotSaveMachineSettings (const CMachine &machine,
105 QWidget *parent = 0);
106 void cannotLoadMachineSettings (const CMachine &machine,
107 bool strict = true,
108 QWidget *parent = 0);
109
110 void cannotStartMachine (const CConsole &console);
111 void cannotStartMachine (const CProgress &progress);
112 void cannotPauseMachine (const CConsole &console);
113 void cannotResumeMachine (const CConsole &console);
114 void cannotSaveMachineState (const CConsole &console);
115 void cannotSaveMachineState (const CProgress &progress);
116 void cannotTakeSnapshot (const CConsole &console);
117 void cannotTakeSnapshot (const CProgress &progress);
118 void cannotStopMachine (const CConsole &console);
119 void cannotDeleteMachine (const CVirtualBox &vbox, const CMachine &machine);
120 void cannotDiscardSavedState (const CConsole &console);
121
122 void cannotSetSnapshotFolder (const CMachine &aMachine, const QString &aPath);
123 void cannotDiscardSnapshot (const CConsole &console, const CSnapshot &snapshot);
124 void cannotDiscardSnapshot (const CProgress &progress, const CSnapshot &snapshot);
125 void cannotDiscardCurrentState (const CConsole &console);
126 void cannotDiscardCurrentState (const CProgress &progress);
127 void cannotDiscardCurrentSnapshotAndState (const CConsole &console);
128 void cannotDiscardCurrentSnapshotAndState (const CProgress &progress);
129
130 void cannotFindMachineByName (const CVirtualBox &vbox, const QString &name);
131
132 void cannotEnterSeamlessMode (ULONG aWidth, ULONG aHeight, ULONG aBpp);
133
134 bool confirmMachineDeletion (const CMachine &machine);
135 bool confirmDiscardSavedState (const CMachine &machine);
136
137 bool confirmReleaseImage (QWidget *parent, const QString &usage);
138
139 void sayCannotOverwriteHardDiskImage (QWidget *parent, const QString &src);
140 int confirmHardDiskImageDeletion (QWidget *parent, const QString &src);
141 void cannotDeleteHardDiskImage (QWidget *parent, const CVirtualDiskImage &vdi);
142
143 int confirmHardDiskUnregister (QWidget *parent, const QString &src);
144
145 void cannotCreateHardDiskImage (
146 QWidget *parent, const CVirtualBox &vbox, const QString &src,
147 const CVirtualDiskImage &vdi, const CProgress &progress);
148 void cannotAttachHardDisk (QWidget *parent, const CMachine &m, const QUuid &id,
149 CEnums::DiskControllerType ctl, LONG dev);
150 void cannotDetachHardDisk (QWidget *parent, const CMachine &m,
151 CEnums::DiskControllerType ctl, LONG dev);
152 void cannotRegisterMedia (QWidget *parent, const CVirtualBox &vbox,
153 VBoxDefs::DiskType type, const QString &src);
154 void cannotUnregisterMedia (QWidget *parent, const CVirtualBox &vbox,
155 VBoxDefs::DiskType type, const QString &src);
156
157 void cannotOpenSession (const CSession &session);
158 void cannotOpenSession (const CVirtualBox &vbox, const CMachine &machine,
159 const CProgress &progress = CProgress());
160
161 void cannotGetMediaAccessibility (const CUnknown &unk);
162
163/// @todo (r=dmik) later
164// void cannotMountMedia (const CUnknown &unk);
165// void cannotUnmountMedia (const CUnknown &unk);
166
167#if defined Q_WS_WIN
168 void cannotCreateHostInterface (const CHost &host, const QString &name,
169 QWidget *parent = 0);
170 void cannotCreateHostInterface (const CProgress &progress, const QString &name,
171 QWidget *parent = 0);
172 void cannotRemoveHostInterface (const CHost &host,
173 const CHostNetworkInterface &iface,
174 QWidget *parent = 0);
175 void cannotRemoveHostInterface (const CProgress &progress,
176 const CHostNetworkInterface &iface,
177 QWidget *parent = 0);
178#endif
179
180 void cannotAttachUSBDevice (const CConsole &console, const QString &device);
181 void cannotAttachUSBDevice (const CConsole &console, const QString &device,
182 const CVirtualBoxErrorInfo &error);
183 void cannotDetachUSBDevice (const CConsole &console, const QString &device);
184 void cannotDetachUSBDevice (const CConsole &console, const QString &device,
185 const CVirtualBoxErrorInfo &error);
186
187 void cannotCreateSharedFolder (QWidget *, const CMachine &,
188 const QString &, const QString &);
189 void cannotRemoveSharedFolder (QWidget *, const CMachine &,
190 const QString &, const QString &);
191 void cannotCreateSharedFolder (QWidget *, const CConsole &,
192 const QString &, const QString &);
193 void cannotRemoveSharedFolder (QWidget *, const CConsole &,
194 const QString &, const QString &);
195
196 int cannotFindGuestAdditions (const QString &aSrc1, const QString &aSrc2);
197 void cannotDownloadGuestAdditions (const QString &aURL,
198 const QString &aReason);
199 int confirmDownloadAdditions (const QString &aURL, ulong aSize);
200 int confirmMountAdditions (const QString &aURL, const QString &aSrc);
201 void warnAboutTooOldAdditions (QWidget *, const QString &, const QString &);
202 void warnAboutOldAdditions (QWidget *, const QString &, const QString &);
203 void warnAboutNewAdditions (QWidget *, const QString &, const QString &);
204
205 bool remindAboutInputCapture();
206 bool remindAboutAutoCapture();
207 bool remindAboutMouseIntegration (bool supportsAbsolute);
208 bool remindAboutPausedVMInput();
209
210 bool remindAboutInaccessibleMedia();
211
212 void remindAboutGoingFullscreen (const QString &hotKey,
213 const QString &hostKey);
214 void remindAboutGoingSeamless (const QString &hotKey,
215 const QString &hostKey);
216
217 void remindAboutWrongColorDepth (ulong aRealBPP, ulong aWantedBPP);
218
219 int remindAboutUnsetHD (QWidget *aParent);
220
221 void cannotRunInSelectorMode();
222
223 void showRuntimeError (const CConsole &console, bool fatal,
224 const QString &errorID,
225 const QString &errorMsg);
226
227 static QString formatErrorInfo (const COMErrorInfo &aInfo,
228 HRESULT aWrapperRC = S_OK);
229
230 static QString formatErrorInfo (const CVirtualBoxErrorInfo &aInfo)
231 {
232 return formatErrorInfo (COMErrorInfo (aInfo));
233 }
234
235 static QString formatErrorInfo (const COMBase &aWrapper)
236 {
237 Assert (FAILED (aWrapper.lastRC()));
238 return formatErrorInfo (aWrapper.errorInfo(), aWrapper.lastRC());
239 }
240
241 static QString formatErrorInfo (const COMResult &aRC)
242 {
243 Assert (FAILED (aRC.rc()));
244 return formatErrorInfo (aRC.errorInfo(), aRC.rc());
245 }
246
247public slots:
248
249 void showHelpWebDialog();
250 void showHelpAboutDialog();
251 void showHelpHelpDialog();
252 void resetSuppressedMessages();
253
254private:
255
256 friend VBoxProblemReporter &vboxProblem();
257
258 static QString doFormatErrorInfo (const COMErrorInfo &aInfo,
259 HRESULT aWrapperRC = S_OK);
260};
261
262inline VBoxProblemReporter &vboxProblem() { return VBoxProblemReporter::instance(); }
263
264#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