VirtualBox

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

Last change on this file since 831 was 815, checked in by vboxsync, 18 years ago

Main:

  • Return E_NOTIMPL for global USB filters and all other stuff when no VBOX_WITH_USB is defined (as in OSE).
  • Moved the USB Proxy Service check to Host to make it reusable both for global-related USB methods and for VM-related methods.

FE/Qt:

  • Don't show Global USB UI when USB is not available.
  • Show the "USB Proxy Service is unavailable" message box when opening both global and VM settings.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 8.4 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 cannotInitCOM (HRESULT rc);
99 void cannotCreateVirtualBox (const CVirtualBox &vbox);
100
101 void cannotLoadGlobalConfig (const CVirtualBox &vbox, const QString &error);
102 void cannotSaveGlobalConfig (const CVirtualBox &vbox);
103 void cannotSetSystemProperties (const CSystemProperties &props);
104 void cannotAccessUSB (const COMBase &obj);
105
106 void cannotCreateMachine (const CVirtualBox &vbox,
107 QWidget *parent = 0);
108 void cannotCreateMachine (const CVirtualBox &vbox, const CMachine &machine,
109 QWidget *parent = 0);
110 void cannotApplyMachineSettings (const CMachine &machine, const COMResult &res);
111 void cannotSaveMachineSettings (const CMachine &machine,
112 QWidget *parent = 0);
113 void cannotLoadMachineSettings (const CMachine &machine,
114 bool strict = true,
115 QWidget *parent = 0);
116
117 void cannotStartMachine (const CConsole &console);
118 void cannotStartMachine (const CProgress &progress);
119 void cannotPauseMachine (const CConsole &console);
120 void cannotResumeMachine (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 cannotDiscardSnapshot (const CConsole &console, const CSnapshot &snapshot);
130 void cannotDiscardSnapshot (const CProgress &progress, const CSnapshot &snapshot);
131 void cannotDiscardCurrentState (const CConsole &console);
132 void cannotDiscardCurrentState (const CProgress &progress);
133 void cannotDiscardCurrentSnapshotAndState (const CConsole &console);
134 void cannotDiscardCurrentSnapshotAndState (const CProgress &progress);
135
136 void cannotFindMachineByName (const CVirtualBox &vbox, const QString &name);
137
138 bool confirmMachineDeletion (const CMachine &machine);
139 bool confirmDiscardSavedState (const CMachine &machine);
140
141 void sayCannotOverwriteHardDiskImage (QWidget *parent, const QString &src);
142 int confirmHardDiskImageDeletion (QWidget *parent, const QString &src);
143 void cannotDeleteHardDiskImage (QWidget *parent, const CVirtualDiskImage &vdi);
144
145 int confirmHardDiskUnregister (QWidget *parent, const QString &src);
146
147 void cannotCreateHardDiskImage (
148 QWidget *parent, const CVirtualBox &vbox, const QString &src,
149 const CVirtualDiskImage &vdi, const CProgress &progress);
150 void cannotAttachHardDisk (QWidget *parent, const CMachine &m, const QUuid &id,
151 CEnums::DiskControllerType ctl, LONG dev);
152 void cannotDetachHardDisk (QWidget *parent, const CMachine &m,
153 CEnums::DiskControllerType ctl, LONG dev);
154 void cannotRegisterMedia (QWidget *parent, const CVirtualBox &vbox,
155 VBoxDefs::DiskType type, const QString &src);
156 void cannotUnregisterMedia (QWidget *parent, const CVirtualBox &vbox,
157 VBoxDefs::DiskType type, const QString &src);
158
159 void cannotOpenSession (const CSession &session);
160 void cannotOpenSession (const CVirtualBox &vbox, const QUuid &id);
161 void cannotOpenSession (const CVirtualBox &vbox, const CMachine &machine,
162 const CProgress &progress = CProgress());
163
164 void cannotGetMediaAccessibility (const CUnknown &unk);
165
166/// @todo (r=dmik) later
167// void cannotMountMedia (const CUnknown &unk);
168// void cannotUnmountMedia (const CUnknown &unk);
169
170#if defined Q_WS_WIN
171 void cannotCreateHostInterface (const CHost &host, const QString &name,
172 QWidget *parent = 0);
173 void cannotCreateHostInterface (const CProgress &progress, const QString &name,
174 QWidget *parent = 0);
175 void cannotRemoveHostInterface (const CHost &host,
176 const CHostNetworkInterface &iface,
177 QWidget *parent = 0);
178 void cannotRemoveHostInterface (const CProgress &progress,
179 const CHostNetworkInterface &iface,
180 QWidget *parent = 0);
181#endif
182
183 void cannotAttachUSBDevice (const CConsole &console, const QString &device);
184 void cannotDetachUSBDevice (const CConsole &console, const QString &device);
185
186 bool confirmReleaseImage (QWidget*, QString);
187
188 bool remindAboutInputCapture();
189 bool remindAboutAutoCapture();
190 bool remindAboutMouseIntegration (bool supportsAbsolute);
191 bool remindAboutPausedVMInput();
192
193 bool remindAboutInaccessibleMedia();
194
195 void remindAboutGoingFullscreen (const QString &hotKey,
196 const QString &hostKey);
197
198 void showRuntimeError (const CConsole &console, bool fatal,
199 const QString &errorID,
200 const QString &errorMsg);
201
202 static QString formatErrorInfo (const COMErrorInfo &info,
203 HRESULT wrapperRC = S_OK);
204 static QString formatErrorInfo (const CVirtualBoxErrorInfo &info) {
205 return formatErrorInfo (COMErrorInfo (info));
206 }
207 static QString formatErrorInfo (const COMBase &wrapper) {
208 Assert (FAILED (wrapper.lastRC()));
209 return formatErrorInfo (wrapper.errorInfo(), wrapper.lastRC());
210 }
211 static QString formatErrorInfo (const COMResult &rc) {
212 Assert (FAILED (rc.rc()));
213 return formatErrorInfo (rc.errorInfo(), rc.rc());
214 }
215
216public slots:
217
218 void showHelpWebDialog();
219 void showHelpAboutDialog();
220 void resetSuppressedMessages();
221
222private:
223
224 friend VBoxProblemReporter &vboxProblem();
225};
226
227inline VBoxProblemReporter &vboxProblem() { return VBoxProblemReporter::instance(); }
228
229#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