VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h@ 71367

Last change on this file since 71367 was 71367, checked in by vboxsync, 7 years ago

FE/Qt: bugref:9049: Detach VBoxGlobal dependencies from Global settings / Language page.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 24.1 KB
Line 
1/* $Id: VBoxGlobal.h 71367 2018-03-16 13:51:58Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - VBoxGlobal class declaration.
4 */
5
6/*
7 * Copyright (C) 2006-2018 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ___VBoxGlobal_h___
19#define ___VBoxGlobal_h___
20
21/* Qt includes: */
22#include <QFileIconProvider>
23#include <QReadWriteLock>
24
25/* GUI includes: */
26#include "UIDefs.h"
27#include "UIMediumDefs.h"
28#ifdef VBOX_WS_X11
29# include "VBoxX11Helper.h"
30#endif
31
32/* COM includes: */
33#include "VBox/com/Guid.h"
34#include "CHost.h"
35#include "CVirtualBoxClient.h"
36#include "CVirtualBox.h"
37#include "CSession.h"
38#include "CGuestOSType.h"
39
40/* Other includes: */
41#ifdef VBOX_WS_X11
42# include <X11/Xdefs.h>
43#endif
44
45/* Forward declarations: */
46class QMenu;
47class QToolButton;
48class QSessionManager;
49class QSpinBox;
50class CHostVideoInputDevice;
51class CMachine;
52class CMedium;
53class CUSBDevice;
54class UIMedium;
55class UIMediumEnumerator;
56class UIIconPoolGeneral;
57class UIThreadPool;
58
59/** QObject subclass containing common GUI functionality. */
60class VBoxGlobal : public QObject
61{
62 Q_OBJECT
63
64public:
65
66 /** VM launch modes. */
67 enum LaunchMode
68 {
69 LaunchMode_Invalid,
70 LaunchMode_Default,
71 LaunchMode_Headless,
72 LaunchMode_Separate
73 };
74
75 /** Whether to start the VM running. */
76 enum StartRunning
77 {
78 StartRunning_Default, /**< Default (depends on debug settings). */
79 StartRunning_No, /**< Start the VM paused. */
80 StartRunning_Yes /**< Start the VM running. */
81 };
82
83 /* Static API: Create/destroy stuff: */
84 static VBoxGlobal *instance() { return s_pInstance; }
85 static void create();
86 static void destroy();
87
88 bool isValid() { return mValid; }
89 bool isCleaningUp() { return s_fCleanupInProgress; }
90
91 static QString qtRTVersionString();
92 static uint qtRTVersion();
93 static QString qtCTVersionString();
94 static uint qtCTVersion();
95
96 QString vboxVersionString() const;
97 QString vboxVersionStringNormalized() const;
98
99 QString versionString() const { return mVerString; }
100 bool isBeta() const;
101
102 /** Returns whether GUI is separate (from VM) process. */
103 bool isSeparateProcess() const { return m_fSeparateProcess; }
104
105#ifdef VBOX_WS_MAC
106 /** Mac OS X: Returns #MacOSXRelease determined using <i>uname</i> call. */
107 static MacOSXRelease determineOsRelease();
108 /** Mac OS X: Returns #MacOSXRelease determined during VBoxGlobal prepare routine. */
109 MacOSXRelease osRelease() const { return m_osRelease; }
110#endif /* VBOX_WS_MAC */
111
112 /** Try to acquire COM cleanup protection token for reading. */
113 bool comTokenTryLockForRead() { return m_comCleanupProtectionToken.tryLockForRead(); }
114 /** Unlock previously acquired COM cleanup protection token. */
115 void comTokenUnlock() { return m_comCleanupProtectionToken.unlock(); }
116
117 /** Returns the copy of VirtualBox client wrapper. */
118 CVirtualBoxClient virtualBoxClient() const { return m_client; }
119 /** Returns the copy of VirtualBox object wrapper. */
120 CVirtualBox virtualBox() const { return m_vbox; }
121 /** Returns the copy of VirtualBox host-object wrapper. */
122 CHost host() const { return m_host; }
123 /** Returns the symbolic VirtualBox home-folder representation. */
124 QString homeFolder() const { return m_strHomeFolder; }
125
126 /** Returns the VBoxSVC availability value. */
127 bool isVBoxSVCAvailable() const { return m_fVBoxSVCAvailable; }
128
129 /** Returns the thread-pool instance. */
130 UIThreadPool* threadPool() const { return m_pThreadPool; }
131
132 /** Returns currently active virtual machine window. */
133 QWidget* activeMachineWindow() const;
134
135 bool is3DAvailableWorker() const;
136 bool is3DAvailable() const { if (m3DAvailable < 0) return is3DAvailableWorker(); return m3DAvailable != 0; }
137
138#ifdef VBOX_GUI_WITH_PIDFILE
139 void createPidfile();
140 void deletePidfile();
141#endif
142
143 /* branding */
144 bool brandingIsActive (bool aForce = false);
145 QString brandingGetKey (QString aKey);
146
147 bool processArgs();
148
149 bool switchToMachine(CMachine &machine);
150
151 bool launchMachine(CMachine &machine, LaunchMode enmLaunchMode = LaunchMode_Default);
152
153 bool isVMConsoleProcess() const { return !vmUuid.isNull(); }
154 bool showStartVMErrors() const { return mShowStartVMErrors; }
155 QString managedVMUuid() const { return vmUuid; }
156 QList<QUrl> &argUrlList() { return m_ArgUrlList; }
157
158 /** Returns whether the Extension Pack installation was requested at startup. */
159 bool isEPInstallationRequested() const { return m_fEPInstallationRequested; }
160 /** Defines whether the Extension Pack installation was @a fRequested at startup. */
161 void setEPInstallationRequested(bool fRequested) { m_fEPInstallationRequested = fRequested; }
162
163#ifdef VBOX_WS_X11
164 /** X11: Returns whether the Window Manager we are running at is composition one. */
165 bool isCompositingManagerRunning() const { return m_fCompositingManagerRunning; }
166 /** X11: Returns the type of the Window Manager we are running under. */
167 X11WMType typeOfWindowManager() const { return m_enmWindowManagerType; }
168#endif /* VBOX_WS_X11 */
169
170 /** Returns whether we should restore current snapshot before VM started. */
171 bool shouldRestoreCurrentSnapshot() const { return mRestoreCurrentSnapshot; }
172 /** Defines whether we should fRestore current snapshot before VM started. */
173 void setShouldRestoreCurrentSnapshot(bool fRestore) { mRestoreCurrentSnapshot = fRestore; }
174
175 bool hasFloppyImageToMount() const { return !m_strFloppyImage.isEmpty(); }
176 bool hasDvdImageToMount() const { return !m_strDvdImage.isEmpty(); }
177 QString const &getFloppyImage() const { return m_strFloppyImage; }
178 QString const &getDvdImage() const { return m_strDvdImage; }
179
180 bool isPatmDisabled() const { return mDisablePatm; }
181 bool isCsamDisabled() const { return mDisableCsam; }
182 bool isSupervisorCodeExecedRecompiled() const { return mRecompileSupervisor; }
183 bool isUserCodeExecedRecompiled() const { return mRecompileUser; }
184 bool areWeToExecuteAllInIem() const { return mExecuteAllInIem; }
185 bool isDefaultWarpPct() const { return mWarpPct == 100; }
186 uint32_t getWarpPct() const { return mWarpPct; }
187
188#ifdef VBOX_WITH_DEBUGGER_GUI
189 bool isDebuggerEnabled() const;
190 bool isDebuggerAutoShowEnabled() const;
191 bool isDebuggerAutoShowCommandLineEnabled() const;
192 bool isDebuggerAutoShowStatisticsEnabled() const;
193
194 RTLDRMOD getDebuggerModule() const { return m_hVBoxDbg; }
195#endif /* VBOX_WITH_DEBUGGER_GUI */
196
197 bool shouldStartPaused() const
198 {
199#ifdef VBOX_WITH_DEBUGGER_GUI
200 return m_enmStartRunning == StartRunning_Default ? isDebuggerAutoShowEnabled() : m_enmStartRunning == StartRunning_No;
201#else
202 return false;
203#endif
204 }
205
206 /* VBox enum to/from string/icon/color convertors */
207
208 QList <CGuestOSType> vmGuestOSFamilyList() const;
209 QList <CGuestOSType> vmGuestOSTypeList (const QString &aFamilyId) const;
210
211 /** Returns icon defined for a passed @a comMachine. */
212 QIcon vmUserIcon(const CMachine &comMachine) const;
213 /** Returns pixmap of a passed @a size defined for a passed @a comMachine. */
214 QPixmap vmUserPixmap(const CMachine &comMachine, const QSize &size) const;
215 /** Returns pixmap defined for a passed @a comMachine.
216 * In case if non-null @a pLogicalSize pointer provided, it will be updated properly. */
217 QPixmap vmUserPixmapDefault(const CMachine &comMachine, QSize *pLogicalSize = 0) const;
218
219 /** Returns pixmap corresponding to passed @a strOSTypeID. */
220 QIcon vmGuestOSTypeIcon(const QString &strOSTypeID) const;
221 /** Returns pixmap corresponding to passed @a strOSTypeID and @a size. */
222 QPixmap vmGuestOSTypePixmap(const QString &strOSTypeID, const QSize &size) const;
223 /** Returns pixmap corresponding to passed @a strOSTypeID.
224 * In case if non-null @a pLogicalSize pointer provided, it will be updated properly. */
225 QPixmap vmGuestOSTypePixmapDefault(const QString &strOSTypeID, QSize *pLogicalSize = 0) const;
226
227 CGuestOSType vmGuestOSType (const QString &aTypeId,
228 const QString &aFamilyId = QString::null) const;
229 QString vmGuestOSTypeDescription (const QString &aTypeId) const;
230
231 static inline QString yearsToString (uint32_t cVal)
232 {
233 return tr("%n year(s)", "", cVal);
234 }
235
236 static inline QString monthsToString (uint32_t cVal)
237 {
238 return tr("%n month(s)", "", cVal);
239 }
240
241 static inline QString daysToString (uint32_t cVal)
242 {
243 return tr("%n day(s)", "", cVal);
244 }
245
246 static inline QString hoursToString (uint32_t cVal)
247 {
248 return tr("%n hour(s)", "", cVal);
249 }
250
251 static inline QString minutesToString (uint32_t cVal)
252 {
253 return tr("%n minute(s)", "", cVal);
254 }
255
256 static inline QString secondsToString (uint32_t cVal)
257 {
258 return tr("%n second(s)", "", cVal);
259 }
260
261 QStringList COMPortNames() const;
262 QString toCOMPortName (ulong aIRQ, ulong aIOBase) const;
263 bool toCOMPortNumbers (const QString &aName, ulong &aIRQ, ulong &aIOBase) const;
264
265 QStringList LPTPortNames() const;
266 QString toLPTPortName (ulong aIRQ, ulong aIOBase) const;
267 bool toLPTPortNumbers (const QString &aName, ulong &aIRQ, ulong &aIOBase) const;
268
269 static bool hasAllowedExtension(const QString &strExt, const QStringList &extList)
270 {
271 for (int i = 0; i < extList.size(); ++i)
272 if (strExt.endsWith(extList.at(i), Qt::CaseInsensitive))
273 return true;
274 return false;
275 }
276
277 QIcon icon(QFileIconProvider::IconType type) { return m_globalIconProvider.icon(type); }
278 QIcon icon(const QFileInfo &info) { return m_globalIconProvider.icon(info); }
279
280 QPixmap warningIcon() const { return mWarningIcon; }
281 QPixmap errorIcon() const { return mErrorIcon; }
282
283 /* details generators */
284
285 QString details(const CMedium &medium, bool fPredictDiff, bool fUseHtml = true);
286
287 QString details (const CUSBDevice &aDevice) const;
288 QString toolTip (const CUSBDevice &aDevice) const;
289 QString toolTip (const CUSBDeviceFilter &aFilter) const;
290 QString toolTip(const CHostVideoInputDevice &webcam) const;
291
292 /* VirtualBox helpers */
293
294 CSession openSession(const QString &aId, KLockType aLockType = KLockType_Write);
295
296 /** Shortcut to openSession (aId, true). */
297 CSession openExistingSession(const QString &aId) { return openSession(aId, KLockType_Shared); }
298
299 /* API: Medium-processing stuff: */
300 void createMedium(const UIMedium &medium);
301 void deleteMedium(const QString &strMediumID);
302 QString createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strMachineFolder);
303 QString openMediumWithFileOpenDialog(UIMediumType mediumType, QWidget *pParent = 0,
304 const QString &strDefaultFolder = QString(), bool fUseLastFolder = true);
305 QString openMedium(UIMediumType mediumType, QString strMediumLocation, QWidget *pParent = 0);
306
307 /* API: Medium-enumeration stuff: */
308 void startMediumEnumeration();
309 bool agressiveCaching() const { return mAgressiveCaching; }
310 bool isMediumEnumerationInProgress() const;
311 UIMedium medium(const QString &strMediumID) const;
312 QList<QString> mediumIDs() const;
313
314 /** Prepares storage menu according passed parameters.
315 * @param menu QMenu being prepared.
316 * @param pListener Listener QObject, this menu being prepared for.
317 * @param pszSlotName SLOT in the @a pListener above, this menu will be handled with.
318 * @param machine CMachine object, this menu being prepared for.
319 * @param strControllerName The name of the CStorageController in the @a machine above.
320 * @param storageSlot The StorageSlot of the CStorageController called @a strControllerName above. */
321 void prepareStorageMenu(QMenu &menu,
322 QObject *pListener, const char *pszSlotName,
323 const CMachine &machine, const QString &strControllerName, const StorageSlot &storageSlot);
324 /** Updates @a constMachine storage with data described by @a target. */
325 void updateMachineStorage(const CMachine &constMachine, const UIMediumTarget &target);
326
327 /* various helpers */
328
329 QString languageName() const;
330 QString languageCountry() const;
331 QString languageNameEnglish() const;
332 QString languageCountryEnglish() const;
333 QString languageTranslators() const;
334
335 void retranslateUi();
336
337 /* public static stuff */
338
339 static bool isDOSType (const QString &aOSTypeId);
340
341 /** Returns VBox language sub-directory. */
342 static QString vboxLanguageSubDirectory();
343 /** Returns VBox language file-base. */
344 static QString vboxLanguageFileBase();
345 /** Returns VBox language file-extension. */
346 static QString vboxLanguageFileExtension();
347 /** Returns VBox language ID reg-exp. */
348 static QString vboxLanguageIdRegExp();
349 /** Returns built in language name. */
350 static QString vboxBuiltInLanguageName();
351 static QString languageId();
352 static void loadLanguage (const QString &aLangId = QString::null);
353 QString helpFile() const;
354
355 static void setTextLabel (QToolButton *aToolButton, const QString &aTextLabel);
356
357 static QRect normalizeGeometry (const QRect &aRectangle, const QRegion &aBoundRegion,
358 bool aCanResize = true);
359 static QRect getNormalized (const QRect &aRectangle, const QRegion &aBoundRegion,
360 bool aCanResize = true);
361 static QRegion flip (const QRegion &aRegion);
362
363 static void centerWidget (QWidget *aWidget, QWidget *aRelative,
364 bool aCanResize = true);
365
366 static QChar decimalSep();
367 static QString sizeRegexp();
368
369 static quint64 parseSize (const QString &);
370 static QString formatSize (quint64 aSize, uint aDecimal = 2, FormatSize aMode = FormatSize_Round);
371
372 static quint64 requiredVideoMemory(const QString &strGuestOSTypeId, int cMonitors = 1);
373
374 static QString locationForHTML (const QString &aFileName);
375
376 static QString highlight (const QString &aStr, bool aToolTip = false);
377
378 static QString replaceHtmlEntities(QString strText);
379 static QString emphasize (const QString &aStr);
380
381 static QString systemLanguageId();
382
383 static bool activateWindow (WId aWId, bool aSwitchDesktop = true);
384
385#ifdef VBOX_WS_X11
386 /** X11: Test whether the current window manager supports full screen mode. */
387 static bool supportsFullScreenMonitorsProtocolX11();
388 /** X11: Performs mapping of the passed @a pWidget to host-screen with passed @a uScreenId. */
389 static bool setFullScreenMonitorX11(QWidget *pWidget, ulong uScreenId);
390
391 /** X11: Returns a list of current _NET_WM_STATE flags for passed @a pWidget. */
392 static QVector<Atom> flagsNetWmState(QWidget *pWidget);
393 /** X11: Check whether _NET_WM_STATE_FULLSCREEN flag is set for passed @a pWidget. */
394 static bool isFullScreenFlagSet(QWidget *pWidget);
395 /** X11: Sets _NET_WM_STATE_FULLSCREEN flag for passed @a pWidget. */
396 static void setFullScreenFlag(QWidget *pWidget);
397 /** X11: Sets _NET_WM_STATE_SKIP_TASKBAR flag for passed @a pWidget. */
398 static void setSkipTaskBarFlag(QWidget *pWidget);
399 /** X11: Sets _NET_WM_STATE_SKIP_PAGER flag for passed @a pWidget. */
400 static void setSkipPagerFlag(QWidget *pWidget);
401#endif /* VBOX_WS_X11 */
402
403 static QString removeAccelMark (const QString &aText);
404
405 static QString insertKeyToActionText (const QString &aText, const QString &aKey);
406
407 static QPixmap joinPixmaps (const QPixmap &aPM1, const QPixmap &aPM2);
408
409 static QWidget *findWidget (QWidget *aParent, const char *aName,
410 const char *aClassName = NULL,
411 bool aRecursive = false);
412
413 static QList <QPair <QString, QString> > MediumBackends(KDeviceType enmDeviceType);
414 static QList <QPair <QString, QString> > HDDBackends();
415 static QList <QPair <QString, QString> > DVDBackends();
416 static QList <QPair <QString, QString> > FloppyBackends();
417
418 static QString documentsPath();
419
420#ifdef VBOX_WITH_VIDEOHWACCEL
421 static bool isAcceleration2DVideoAvailable();
422
423 /** additional video memory required for the best 2D support performance
424 * total amount of VRAM required is thus calculated as requiredVideoMemory + required2DOffscreenVideoMemory */
425 static quint64 required2DOffscreenVideoMemory();
426#endif
427
428#ifdef VBOX_WITH_CRHGSMI
429 static bool isWddmCompatibleOsType(const QString &strGuestOSTypeId);
430#endif /* VBOX_WITH_CRHGSMI */
431
432 /* Returns full medium-format name for the given base medium-format name: */
433 static QString fullMediumFormatName(const QString &strBaseMediumFormatName);
434
435
436#ifdef RT_OS_LINUX
437 static void checkForWrongUSBMounted();
438#endif /* RT_OS_LINUX */
439
440 /* Shame on Qt it hasn't stuff for tuning
441 * widget size suitable for reflecting content of desired size.
442 * For example QLineEdit, QSpinBox and similar widgets should have a methods
443 * to strict the minimum width to reflect at least [n] symbols. */
444 static void setMinimumWidthAccordingSymbolCount(QSpinBox *pSpinBox, int cCount);
445
446 /** Assigns top-level @a pWidget geometry passed as QRect coordinates.
447 * @note Take into account that this request may fail on X11. */
448 static void setTopLevelGeometry(QWidget *pWidget, int x, int y, int w, int h);
449 /** Assigns top-level @a pWidget geometry passed as @a rect.
450 * @note Take into account that this request may fail on X11. */
451 static void setTopLevelGeometry(QWidget *pWidget, const QRect &rect);
452
453#ifdef VBOX_WS_X11
454 /** Assigns WM_CLASS property for passed @a pWidget. */
455 static void setWMClass(QWidget *pWidget, const QString &strNameString, const QString &strClassString);
456#endif
457
458signals:
459
460 /** Asks listener to recreate UI. */
461 void sigAskToRestartUI();
462 /** Ask listener to open URLs. */
463 void sigAskToOpenURLs();
464
465 /** Notifies listeners about the VBoxSVC availability change. */
466 void sigVBoxSVCAvailabilityChange();
467
468 /* Notifiers: Medium-processing stuff: */
469 void sigMediumCreated(const QString &strMediumID);
470 void sigMediumDeleted(const QString &strMediumID);
471
472 /* Notifiers: Medium-enumeration stuff: */
473 void sigMediumEnumerationStarted();
474 void sigMediumEnumerated(const QString &strMediumID);
475 void sigMediumEnumerationFinished();
476
477public slots:
478
479 bool openURL (const QString &aURL);
480
481 void sltGUILanguageChange(QString strLang);
482
483protected slots:
484
485 /* Handlers: Prepare/cleanup stuff: */
486 void prepare();
487 void cleanup();
488
489 /** Handles @a manager request for emergency session shutdown. */
490 void sltHandleCommitDataRequest(QSessionManager &manager);
491
492 /** Handles the VBoxSVC availability change. */
493 void sltHandleVBoxSVCAvailabilityChange(bool fAvailable);
494
495protected:
496
497 bool eventFilter (QObject *, QEvent *);
498
499private:
500
501 /* Constructor/destructor: */
502 VBoxGlobal();
503 ~VBoxGlobal();
504
505 /** Re-initializes COM wrappers and containers. */
506 void comWrappersReinit();
507
508#ifdef VBOX_WS_WIN
509 /** Wraps WinAPI ShutdownBlockReasonCreate function.
510 * @remark This function defined starting from Vista only. */
511 static BOOL ShutdownBlockReasonCreateAPI(HWND hWnd, LPCWSTR pwszReason);
512#endif
513
514#ifdef VBOX_WITH_DEBUGGER_GUI
515 void initDebuggerVar(int *piDbgCfgVar, const char *pszEnvVar, const char *pszExtraDataName, bool fDefault = false);
516 void setDebuggerVar(int *piDbgCfgVar, bool fState);
517 bool isDebuggerWorker(int *piDbgCfgVar, const char *pszExtraDataName) const;
518#endif
519
520 bool mValid;
521
522#ifdef VBOX_WS_MAC
523 /** Mac OS X: Holds the #MacOSXRelease determined using <i>uname</i> call. */
524 MacOSXRelease m_osRelease;
525#endif /* VBOX_WS_MAC */
526
527 /** COM cleanup protection token. */
528 QReadWriteLock m_comCleanupProtectionToken;
529
530 /** Holds the instance of VirtualBox client wrapper. */
531 CVirtualBoxClient m_client;
532 /** Holds the copy of VirtualBox object wrapper. */
533 CVirtualBox m_vbox;
534 /** Holds the copy of VirtualBox host-object wrapper. */
535 CHost m_host;
536 /** Holds the symbolic VirtualBox home-folder representation. */
537 QString m_strHomeFolder;
538 /** Holds the guest OS family IDs. */
539 QList<QString> m_guestOSFamilyIDs;
540 /** Holds the guest OS types for each family ID. */
541 QList<QList<CGuestOSType> > m_guestOSTypes;
542
543 /** Holds whether acquired COM wrappers are currently valid. */
544 bool m_fWrappersValid;
545 /** Holds whether VBoxSVC is currently available. */
546 bool m_fVBoxSVCAvailable;
547
548 /** Holds whether GUI is separate (from VM) process. */
549 bool m_fSeparateProcess;
550
551 QString vmUuid;
552 QList<QUrl> m_ArgUrlList;
553
554 /** Whether to show error message boxes for VM start errors. */
555 bool mShowStartVMErrors;
556
557 /* Variable: Medium-enumeration stuff: */
558 UIMediumEnumerator *m_pMediumEnumerator;
559 mutable QReadWriteLock m_mediumEnumeratorDtorRwLock;
560
561 /** Holds whether the Extension Pack installation was requested at startup. */
562 bool m_fEPInstallationRequested;
563
564#ifdef VBOX_WS_X11
565 /** X11: Holds whether the Window Manager we are running at is composition one. */
566 bool m_fCompositingManagerRunning;
567 /** X11: Holds the type of the Window Manager we are running under. */
568 X11WMType m_enmWindowManagerType;
569#endif /* VBOX_WS_X11 */
570
571 /** The --aggressive-caching / --no-aggressive-caching option. */
572 bool mAgressiveCaching;
573 /** The --restore-current option. */
574 bool mRestoreCurrentSnapshot;
575
576 /** @name Ad-hoc VM reconfiguration.
577 * @{ */
578 /** Floppy image. */
579 QString m_strFloppyImage;
580 /** DVD image. */
581 QString m_strDvdImage;
582 /** @} */
583
584 /** @name VMM options
585 * @{ */
586 /** The --disable-patm option. */
587 bool mDisablePatm;
588 /** The --disable-csam option. */
589 bool mDisableCsam;
590 /** The --recompile-supervisor option. */
591 bool mRecompileSupervisor;
592 /** The --recompile-user option. */
593 bool mRecompileUser;
594 /** The --execute-all-in-iem option. */
595 bool mExecuteAllInIem;
596 /** The --warp-factor option value. */
597 uint32_t mWarpPct;
598 /** @} */
599
600#ifdef VBOX_WITH_DEBUGGER_GUI
601 /** Whether the debugger should be accessible or not.
602 * Use --dbg, the env.var. VBOX_GUI_DBG_ENABLED,
603 * --debug or the env.var. VBOX_GUI_DBG_AUTO_SHOW to enable. */
604 mutable int m_fDbgEnabled;
605 /** Whether to show the debugger automatically with the console.
606 * Use --debug or the env.var. VBOX_GUI_DBG_AUTO_SHOW to enable. */
607 mutable int m_fDbgAutoShow;
608 /** Whether to show the command line window when m_fDbgAutoShow is set. */
609 mutable int m_fDbgAutoShowCommandLine;
610 /** Whether to show the statistics window when m_fDbgAutoShow is set. */
611 mutable int m_fDbgAutoShowStatistics;
612 /** VBoxDbg module handle. */
613 RTLDRMOD m_hVBoxDbg;
614
615 /** Whether --start-running, --start-paused or nothing was given. */
616 enum StartRunning m_enmStartRunning;
617#endif
618
619#if defined (VBOX_WS_WIN)
620 DWORD dwHTMLHelpCookie;
621#endif
622
623 QString mVerString;
624 QString mBrandingConfig;
625
626 int m3DAvailable;
627
628 QString mUserDefinedPortName;
629
630 QPixmap mWarningIcon, mErrorIcon;
631
632 QFileIconProvider m_globalIconProvider;
633
634#ifdef VBOX_GUI_WITH_PIDFILE
635 QString m_strPidfile;
636#endif
637
638 char mSettingsPw[256];
639 bool mSettingsPwSet;
640
641 /** General icon-pool. */
642 UIIconPoolGeneral *m_pIconPool;
643 /** Holds the thread-pool instance. */
644 UIThreadPool *m_pThreadPool;
645
646 /** Holds the singleton VBoxGlobal instance. */
647 static VBoxGlobal *s_pInstance;
648 /** Holds whether VBoxGlobal cleanup is in progress. */
649 static bool s_fCleanupInProgress;
650 /** Holds the currently loaded language ID. */
651 static QString s_strLoadedLanguageId;
652
653 /** Allows for shortcut access. */
654 friend VBoxGlobal &vboxGlobal();
655};
656
657/** Singleton VBoxGlobal 'official' name. */
658inline VBoxGlobal &vboxGlobal() { return *VBoxGlobal::instance(); }
659
660#endif /* !___VBoxGlobal_h___ */
661
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