VirtualBox

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

Last change on this file since 1 was 1, checked in by vboxsync, 55 years ago

import

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.8 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.215389.xyz. 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
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 cannotStartMachine (const CConsole &console);
113 void cannotStartMachine (const CProgress &progress);
114 void cannotPauseMachine (const CConsole &console);
115 void cannotResumeMachine (const CConsole &console);
116 void cannotSaveMachineState (const CConsole &console);
117 void cannotSaveMachineState (const CProgress &progress);
118 void cannotTakeSnapshot (const CConsole &console);
119 void cannotTakeSnapshot (const CProgress &progress);
120 void cannotStopMachine (const CConsole &console);
121 void cannotDeleteMachine (const CVirtualBox &vbox, const CMachine &machine);
122 void cannotDiscardSavedState (const CConsole &console);
123
124 void cannotDiscardSnapshot (const CConsole &console, const CSnapshot &snapshot);
125 void cannotDiscardSnapshot (const CProgress &progress, const CSnapshot &snapshot);
126 void cannotDiscardCurrentState (const CConsole &console);
127 void cannotDiscardCurrentState (const CProgress &progress);
128 void cannotDiscardCurrentSnapshotAndState (const CConsole &console);
129 void cannotDiscardCurrentSnapshotAndState (const CProgress &progress);
130
131 void cannotFindMachineByName (const CVirtualBox &vbox, const QString &name);
132
133 bool confirmMachineDeletion (const CMachine &machine);
134 bool confirmDiscardSavedState (const CMachine &machine);
135
136 void sayCannotOverwriteHardDiskImage (QWidget *parent, const QString &src);
137 int confirmHardDiskImageDeletion (QWidget *parent, const QString &src);
138 void cannotDeleteHardDiskImage (QWidget *parent, const CVirtualDiskImage &vdi);
139
140 int confirmHardDiskUnregister (QWidget *parent, const QString &src);
141
142 void cannotCreateHardDiskImage (
143 QWidget *parent, const CVirtualBox &vbox, const QString &src,
144 const CVirtualDiskImage &vdi, const CProgress &progress);
145 void cannotAttachHardDisk (QWidget *parent, const CMachine &m, const QUuid &id,
146 CEnums::DiskControllerType ctl, LONG dev);
147 void cannotDetachHardDisk (QWidget *parent, const CMachine &m,
148 CEnums::DiskControllerType ctl, LONG dev);
149 void cannotRegisterMedia (QWidget *parent, const CVirtualBox &vbox,
150 VBoxDefs::DiskType type, const QString &src);
151 void cannotUnregisterMedia (QWidget *parent, const CVirtualBox &vbox,
152 VBoxDefs::DiskType type, const QString &src);
153
154 void cannotOpenSession (const CSession &session);
155 void cannotOpenSession (const CVirtualBox &vbox, const QUuid &id);
156 void cannotOpenSession (const CVirtualBox &vbox, const CMachine &machine,
157 const CProgress &progress = CProgress());
158
159 void cannotGetMediaAccessibility (const CUnknown &unk);
160
161/// @todo (r=dmik) later
162// void cannotMountMedia (const CUnknown &unk);
163// void cannotUnmountMedia (const CUnknown &unk);
164
165#if defined Q_WS_WIN
166 void cannotCreateHostInterface (const CHost &host, const QString &name,
167 QWidget *parent = 0);
168 void cannotCreateHostInterface (const CProgress &progress, const QString &name,
169 QWidget *parent = 0);
170 void cannotRemoveHostInterface (const CHost &host,
171 const CHostNetworkInterface &iface,
172 QWidget *parent = 0);
173 void cannotRemoveHostInterface (const CProgress &progress,
174 const CHostNetworkInterface &iface,
175 QWidget *parent = 0);
176#endif
177
178 bool confirmReleaseImage (QWidget*, QString);
179
180 bool remindAboutInputCapture();
181 bool remindAboutAutoCapture();
182 bool remindAboutMouseIntegration (bool supportsAbsolute);
183 bool remindAboutPausedVMInput();
184
185 bool remindAboutInaccessibleMedia();
186
187 static QString highlight (const QString &str);
188 static QString formatErrorInfo (const COMErrorInfo &info,
189 HRESULT wrapperRC = S_OK);
190 static QString formatErrorInfo (const CVirtualBoxErrorInfo &info) {
191 return formatErrorInfo (COMErrorInfo (info));
192 }
193 static QString formatErrorInfo (const COMBase &wrapper) {
194 Assert (FAILED (wrapper.lastRC()));
195 return formatErrorInfo (wrapper.errorInfo(), wrapper.lastRC());
196 }
197 static QString formatErrorInfo (const COMResult &rc) {
198 Assert (FAILED (rc.rc()));
199 return formatErrorInfo (rc.errorInfo(), rc.rc());
200 }
201
202public slots:
203
204 void showHelpWebDialog();
205 void showHelpAboutDialog();
206 void resetSuppressedMessages();
207
208private:
209
210 friend VBoxProblemReporter &vboxProblem();
211};
212
213inline VBoxProblemReporter &vboxProblem() { return VBoxProblemReporter::instance(); }
214
215#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