VirtualBox

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

Last change on this file since 2889 was 2764, checked in by vboxsync, 18 years ago

FE/Qt: Fixed spelling; added proper console window restriction for SDL mode when no guest additions are active or when the auto-resize feature is turned off.

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

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