VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h@ 7442

Last change on this file since 7442 was 7442, checked in by vboxsync, 17 years ago

Main: Applied SATA changes from #2406. Increased XML settings version format from 1.2 to 1.3.pre.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 22.0 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxGlobal 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 (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef __VBoxGlobal_h__
20#define __VBoxGlobal_h__
21
22#include "COMDefs.h"
23
24#include "VBoxGlobalSettings.h"
25
26#include <qapplication.h>
27#include <qpixmap.h>
28#include <qiconset.h>
29#include <qcolor.h>
30#include <quuid.h>
31#include <qthread.h>
32#include <qpopupmenu.h>
33#include <qtooltip.h>
34
35#include <qptrvector.h>
36#include <qvaluevector.h>
37#include <qvaluelist.h>
38#include <qdict.h>
39#include <qintdict.h>
40
41class QAction;
42class QLabel;
43class QToolButton;
44
45// Auxiliary types
46////////////////////////////////////////////////////////////////////////////////
47
48/** Simple media descriptor type. */
49struct VBoxMedia
50{
51 enum Status { Unknown, Ok, Error, Inaccessible };
52
53 VBoxMedia() : type (VBoxDefs::InvalidType), status (Ok) {}
54
55 VBoxMedia (const CUnknown &d, VBoxDefs::DiskType t, Status s)
56 : disk (d), type (t), status (s) {}
57
58 CUnknown disk;
59 VBoxDefs::DiskType type;
60 Status status;
61};
62
63typedef QValueList <VBoxMedia> VBoxMediaList;
64
65// VirtualBox callback events
66////////////////////////////////////////////////////////////////////////////////
67
68class VBoxMachineStateChangeEvent : public QEvent
69{
70public:
71 VBoxMachineStateChangeEvent (const QUuid &aId, KMachineState aState)
72 : QEvent ((QEvent::Type) VBoxDefs::MachineStateChangeEventType)
73 , id (aId), state (aState)
74 {}
75
76 const QUuid id;
77 const KMachineState state;
78};
79
80class VBoxMachineDataChangeEvent : public QEvent
81{
82public:
83 VBoxMachineDataChangeEvent (const QUuid &aId)
84 : QEvent ((QEvent::Type) VBoxDefs::MachineDataChangeEventType)
85 , id (aId)
86 {}
87
88 const QUuid id;
89};
90
91class VBoxMachineRegisteredEvent : public QEvent
92{
93public:
94 VBoxMachineRegisteredEvent (const QUuid &aId, bool aRegistered)
95 : QEvent ((QEvent::Type) VBoxDefs::MachineRegisteredEventType)
96 , id (aId), registered (aRegistered)
97 {}
98
99 const QUuid id;
100 const bool registered;
101};
102
103class VBoxSessionStateChangeEvent : public QEvent
104{
105public:
106 VBoxSessionStateChangeEvent (const QUuid &aId, KSessionState aState)
107 : QEvent ((QEvent::Type) VBoxDefs::SessionStateChangeEventType)
108 , id (aId), state (aState)
109 {}
110
111 const QUuid id;
112 const KSessionState state;
113};
114
115class VBoxSnapshotEvent : public QEvent
116{
117public:
118
119 enum What { Taken, Discarded, Changed };
120
121 VBoxSnapshotEvent (const QUuid &aMachineId, const QUuid &aSnapshotId,
122 What aWhat)
123 : QEvent ((QEvent::Type) VBoxDefs::SnapshotEventType)
124 , what (aWhat)
125 , machineId (aMachineId), snapshotId (aSnapshotId)
126 {}
127
128 const What what;
129
130 const QUuid machineId;
131 const QUuid snapshotId;
132};
133
134class VBoxCanShowRegDlgEvent : public QEvent
135{
136public:
137 VBoxCanShowRegDlgEvent (bool aCanShow)
138 : QEvent ((QEvent::Type) VBoxDefs::CanShowRegDlgEventType)
139 , mCanShow (aCanShow)
140 {}
141
142 const bool mCanShow;
143};
144
145// VBoxGlobal
146////////////////////////////////////////////////////////////////////////////////
147
148class VBoxSelectorWnd;
149class VBoxConsoleWnd;
150class VBoxRegistrationDlg;
151
152class VBoxGlobal : public QObject
153{
154 Q_OBJECT
155
156public:
157
158 static VBoxGlobal &instance();
159
160 bool isValid() { return mValid; }
161
162 QString versionString() { return verString; }
163
164 CVirtualBox virtualBox() const { return mVBox; }
165
166 const VBoxGlobalSettings &settings() const { return gset; }
167 bool setSettings (const VBoxGlobalSettings &gs);
168
169 VBoxSelectorWnd &selectorWnd();
170 VBoxConsoleWnd &consoleWnd();
171
172 bool isVMConsoleProcess() const { return !vmUuid.isNull(); }
173 QUuid managedVMUuid() const { return vmUuid; }
174
175 VBoxDefs::RenderMode vmRenderMode() const { return vm_render_mode; }
176 const char *vmRenderModeStr() const { return vm_render_mode_str; }
177
178#ifdef VBOX_WITH_DEBUGGER_GUI
179 bool isDebuggerEnabled() const { return dbg_enabled; }
180 bool isDebuggerVisibleAtStartup() const { return dbg_visible_at_startup; }
181#endif
182
183 /* VBox enum to/from string/icon/color convertors */
184
185 QStringList vmGuestOSTypeDescriptions() const;
186 CGuestOSType vmGuestOSType (int aIndex) const;
187 int vmGuestOSTypeIndex (const QString &aId) const;
188 QPixmap vmGuestOSTypeIcon (const QString &aId) const;
189 QString vmGuestOSTypeDescription (const QString &aId) const;
190
191 QPixmap toIcon (KMachineState s) const
192 {
193 QPixmap *pm = mStateIcons [s];
194 AssertMsg (pm, ("Icon for VM state %d must be defined", s));
195 return pm ? *pm : QPixmap();
196 }
197
198 const QColor &toColor (KMachineState s) const
199 {
200 static const QColor none;
201 AssertMsg (vm_state_color [s], ("No color for %d", s));
202 return vm_state_color [s] ? *vm_state_color [s] : none;
203 }
204
205 QString toString (KMachineState s) const
206 {
207 AssertMsg (!machineStates [s].isNull(), ("No text for %d", s));
208 return machineStates [s];
209 }
210
211 QString toString (KSessionState s) const
212 {
213 AssertMsg (!sessionStates [s].isNull(), ("No text for %d", s));
214 return sessionStates [s];
215 }
216
217 QString toString (KStorageBus t) const
218 {
219 AssertMsg (!storageBuses [t].isNull(), ("No text for %d", t));
220 return storageBuses [t];
221 }
222
223 QString toString (KStorageBus t, LONG c) const;
224 QString toString (KStorageBus t, LONG c, LONG d) const;
225
226 QString toString (KHardDiskType t) const
227 {
228 AssertMsg (!diskTypes [t].isNull(), ("No text for %d", t));
229 return diskTypes [t];
230 }
231
232 QString toString (KHardDiskStorageType t) const
233 {
234 AssertMsg (!diskStorageTypes [t].isNull(), ("No text for %d", t));
235 return diskStorageTypes [t];
236 }
237
238 QString toString (KVRDPAuthType t) const
239 {
240 AssertMsg (!vrdpAuthTypes [t].isNull(), ("No text for %d", t));
241 return vrdpAuthTypes [t];
242 }
243
244 QString toString (KPortMode t) const
245 {
246 AssertMsg (!portModeTypes [t].isNull(), ("No text for %d", t));
247 return portModeTypes [t];
248 }
249
250 QString toString (KUSBDeviceFilterAction t) const
251 {
252 AssertMsg (!usbFilterActionTypes [t].isNull(), ("No text for %d", t));
253 return usbFilterActionTypes [t];
254 }
255
256 QString toString (KClipboardMode t) const
257 {
258 AssertMsg (!clipboardTypes [t].isNull(), ("No text for %d", t));
259 return clipboardTypes [t];
260 }
261
262 KClipboardMode toClipboardModeType (const QString &s) const
263 {
264 QStringVector::const_iterator it =
265 qFind (clipboardTypes.begin(), clipboardTypes.end(), s);
266 AssertMsg (it != clipboardTypes.end(), ("No value for {%s}", s.latin1()));
267 return KClipboardMode (it - clipboardTypes.begin());
268 }
269
270 QString toString (KIDEControllerType t) const
271 {
272 AssertMsg (!ideControllerTypes [t].isNull(), ("No text for %d", t));
273 return ideControllerTypes [t];
274 }
275
276 KIDEControllerType toIDEControllerType (const QString &s) const
277 {
278 QStringVector::const_iterator it =
279 qFind (ideControllerTypes.begin(), ideControllerTypes.end(), s);
280 AssertMsg (it != ideControllerTypes.end(), ("No value for {%s}", s.latin1()));
281 return KIDEControllerType (it - ideControllerTypes.begin());
282 }
283
284 KVRDPAuthType toVRDPAuthType (const QString &s) const
285 {
286 QStringVector::const_iterator it =
287 qFind (vrdpAuthTypes.begin(), vrdpAuthTypes.end(), s);
288 AssertMsg (it != vrdpAuthTypes.end(), ("No value for {%s}", s.latin1()));
289 return KVRDPAuthType (it - vrdpAuthTypes.begin());
290 }
291
292 KPortMode toPortMode (const QString &s) const
293 {
294 QStringVector::const_iterator it =
295 qFind (portModeTypes.begin(), portModeTypes.end(), s);
296 AssertMsg (it != portModeTypes.end(), ("No value for {%s}", s.latin1()));
297 return KPortMode (it - portModeTypes.begin());
298 }
299
300 KUSBDeviceFilterAction toUSBDevFilterAction (const QString &s) const
301 {
302 QStringVector::const_iterator it =
303 qFind (usbFilterActionTypes.begin(), usbFilterActionTypes.end(), s);
304 AssertMsg (it != usbFilterActionTypes.end(), ("No value for {%s}", s.latin1()));
305 return KUSBDeviceFilterAction (it - usbFilterActionTypes.begin());
306 }
307
308 /**
309 * Similar to toString (KHardDiskType), but returns 'Differencing'
310 * for normal hard disks that have a parent hard disk.
311 */
312 QString hardDiskTypeString (const CHardDisk &aHD) const
313 {
314 if (!aHD.GetParent().isNull())
315 {
316 Assert (aHD.GetType() == KHardDiskType_Normal);
317 return tr ("Differencing", "hard disk");
318 }
319 return toString (aHD.GetType());
320 }
321
322 QString toString (KDeviceType t) const
323 {
324 AssertMsg (!deviceTypes [t].isNull(), ("No text for %d", t));
325 return deviceTypes [t];
326 }
327
328 KDeviceType toDeviceType (const QString &s) const
329 {
330 QStringVector::const_iterator it =
331 qFind (deviceTypes.begin(), deviceTypes.end(), s);
332 AssertMsg (it != deviceTypes.end(), ("No value for {%s}", s.latin1()));
333 return KDeviceType (it - deviceTypes.begin());
334 }
335
336 QStringList deviceTypeStrings() const;
337
338 QString toString (KAudioDriverType t) const
339 {
340 AssertMsg (!audioDriverTypes [t].isNull(), ("No text for %d", t));
341 return audioDriverTypes [t];
342 }
343
344 KAudioDriverType toAudioDriverType (const QString &s) const
345 {
346 QStringVector::const_iterator it =
347 qFind (audioDriverTypes.begin(), audioDriverTypes.end(), s);
348 AssertMsg (it != audioDriverTypes.end(), ("No value for {%s}", s.latin1()));
349 return KAudioDriverType (it - audioDriverTypes.begin());
350 }
351
352 QString toString (KAudioControllerType t) const
353 {
354 AssertMsg (!audioControllerTypes [t].isNull(), ("No text for %d", t));
355 return audioControllerTypes [t];
356 }
357
358 KAudioControllerType toAudioControllerType (const QString &s) const
359 {
360 QStringVector::const_iterator it =
361 qFind (audioControllerTypes.begin(), audioControllerTypes.end(), s);
362 AssertMsg (it != audioControllerTypes.end(), ("No value for {%s}", s.latin1()));
363 return KAudioControllerType (it - audioControllerTypes.begin());
364 }
365
366 QString toString (KNetworkAdapterType t) const
367 {
368 AssertMsg (!networkAdapterTypes [t].isNull(), ("No text for %d", t));
369 return networkAdapterTypes [t];
370 }
371
372 KNetworkAdapterType toNetworkAdapterType (const QString &s) const
373 {
374 QStringVector::const_iterator it =
375 qFind (networkAdapterTypes.begin(), networkAdapterTypes.end(), s);
376 AssertMsg (it != networkAdapterTypes.end(), ("No value for {%s}", s.latin1()));
377 return KNetworkAdapterType (it - networkAdapterTypes.begin());
378 }
379
380 QString toString (KNetworkAttachmentType t) const
381 {
382 AssertMsg (!networkAttachmentTypes [t].isNull(), ("No text for %d", t));
383 return networkAttachmentTypes [t];
384 }
385
386 KNetworkAttachmentType toNetworkAttachmentType (const QString &s) const
387 {
388 QStringVector::const_iterator it =
389 qFind (networkAttachmentTypes.begin(), networkAttachmentTypes.end(), s);
390 AssertMsg (it != networkAttachmentTypes.end(), ("No value for {%s}", s.latin1()));
391 return KNetworkAttachmentType (it - networkAttachmentTypes.begin());
392 }
393
394 QString toString (KUSBDeviceState aState) const
395 {
396 AssertMsg (!USBDeviceStates [aState].isNull(), ("No text for %d", aState));
397 return USBDeviceStates [aState];
398 }
399
400 QStringList COMPortNames() const;
401 QString toCOMPortName (ulong aIRQ, ulong aIOBase) const;
402 bool toCOMPortNumbers (const QString &aName, ulong &aIRQ, ulong &aIOBase) const;
403
404 QStringList LPTPortNames() const;
405 QString toLPTPortName (ulong aIRQ, ulong aIOBase) const;
406 bool toLPTPortNumbers (const QString &aName, ulong &aIRQ, ulong &aIOBase) const;
407
408 QPixmap snapshotIcon (bool online) const
409 {
410 return online ? mOnlineSnapshotIcon : mOfflineSnapshotIcon;
411 }
412
413 /* details generators */
414
415 QString details (const CHardDisk &aHD, bool aPredict = false,
416 bool aDoRefresh = true);
417
418 QString details (const CUSBDevice &aDevice) const;
419 QString toolTip (const CUSBDevice &aDevice) const;
420
421 QString prepareFileNameForHTML (const QString &fn) const;
422
423 QString detailsReport (const CMachine &m, bool isNewVM, bool withLinks,
424 bool aDoRefresh = true);
425
426 /* VirtualBox helpers */
427
428#ifdef Q_WS_X11
429 bool showVirtualBoxLicense();
430#endif
431
432 void checkForAutoConvertedSettings();
433
434 CSession openSession (const QUuid &aId, bool aExisting = false);
435
436 /** Shortcut to openSession (aId, true). */
437 CSession openExistingSession (const QUuid &aId) { return openSession (aId, true); }
438
439 bool startMachine (const QUuid &id);
440
441 void startEnumeratingMedia();
442
443 /**
444 * Returns a list of all currently registered media. This list is used
445 * to globally track the accessiblity state of all media on a dedicated
446 * thread. This the list is initially empty (before the first enumeration
447 * process is started using #startEnumeratingMedia()).
448 */
449 const VBoxMediaList &currentMediaList() const { return media_list; }
450
451 /** Returns true if the media enumeration is in progress. */
452 bool isMediaEnumerationStarted() const { return media_enum_thread != NULL; }
453
454 void addMedia (const VBoxMedia &);
455 void updateMedia (const VBoxMedia &);
456 void removeMedia (VBoxDefs::DiskType, const QUuid &);
457
458 bool findMedia (const CUnknown &, VBoxMedia &) const;
459
460 /* various helpers */
461
462 QString languageName() const;
463 QString languageCountry() const;
464 QString languageNameEnglish() const;
465 QString languageCountryEnglish() const;
466 QString languageTranslators() const;
467
468 void languageChange();
469
470 /** @internal made public for internal purposes */
471 void cleanup();
472
473 /* public static stuff */
474
475 static bool isDOSType (const QString &aOSTypeId);
476
477 static void adoptLabelPixmap (QLabel *);
478
479 static QString languageId();
480 static void loadLanguage (const QString &aLangId = QString::null);
481
482 static QIconSet iconSet (const char *aNormal,
483 const char *aDisabled = 0,
484 const char *aActive = 0);
485 static QIconSet iconSetEx (const char *aNormal, const char *aSmallNormal,
486 const char *aDisabled = 0, const char *aSmallDisabled = 0,
487 const char *aActive = 0, const char *aSmallActive = 0);
488
489 static void setTextLabel (QToolButton *aToolButton, const QString &aTextLabel);
490
491 static QRect normalizeGeometry (const QRect &aRect, const QRect &aBoundRect,
492 bool aCanResize = true);
493
494 static void centerWidget (QWidget *aWidget, QWidget *aRelative,
495 bool aCanResize = true);
496
497 static QChar decimalSep();
498 static QString sizeRegexp();
499
500 static Q_UINT64 parseSize (const QString &);
501 static QString formatSize (Q_UINT64, int aMode = 0);
502
503 static QString highlight (const QString &aStr, bool aToolTip = false);
504
505 static QString systemLanguageId();
506
507 static QString getExistingDirectory (const QString &aDir, QWidget *aParent,
508 const char *aName = 0,
509 const QString &aCaption = QString::null,
510 bool aDirOnly = TRUE,
511 bool resolveSymlinks = TRUE);
512
513 static QString getOpenFileName (const QString &, const QString &, QWidget*,
514 const char*, const QString &,
515 QString *defaultFilter = 0,
516 bool resolveSymLinks = true);
517
518 static QString getFirstExistingDir (const QString &);
519
520 static bool activateWindow (WId aWId, bool aSwitchDesktop = true);
521
522 static QString removeAccelMark (const QString &aText);
523
524 static QWidget *findWidget (QWidget *aParent, const char *aName,
525 const char *aClassName = NULL,
526 bool aRecursive = false);
527
528signals:
529
530 /**
531 * Emitted at the beginning of the enumeration process started
532 * by #startEnumeratingMedia().
533 */
534 void mediaEnumStarted();
535
536 /**
537 * Emitted when a new media item from the list has updated
538 * its accessibility state.
539 */
540 void mediaEnumerated (const VBoxMedia &aMedia, int aIndex);
541
542 /**
543 * Emitted at the end of the enumeration process started
544 * by #startEnumeratingMedia(). The @a aList argument is passed for
545 * convenience, it is exactly the same as returned by #currentMediaList().
546 */
547 void mediaEnumFinished (const VBoxMediaList &aList);
548
549 /** Emitted when a new media is added using #addMedia(). */
550 void mediaAdded (const VBoxMedia &);
551
552 /** Emitted when the media is updated using #updateMedia(). */
553 void mediaUpdated (const VBoxMedia &);
554
555 /** Emitted when the media is removed using #removeMedia(). */
556 void mediaRemoved (VBoxDefs::DiskType, const QUuid &);
557
558 /* signals emitted when the VirtualBox callback is called by the server
559 * (not that currently these signals are emitted only when the application
560 * is the in the VM selector mode) */
561
562 void machineStateChanged (const VBoxMachineStateChangeEvent &e);
563 void machineDataChanged (const VBoxMachineDataChangeEvent &e);
564 void machineRegistered (const VBoxMachineRegisteredEvent &e);
565 void sessionStateChanged (const VBoxSessionStateChangeEvent &e);
566 void snapshotChanged (const VBoxSnapshotEvent &e);
567
568 void canShowRegDlg (bool aCanShow);
569
570public slots:
571
572 bool openURL (const QString &aURL);
573
574 void showRegistrationDialog (bool aForce = true);
575
576protected:
577
578 bool event (QEvent *e);
579 bool eventFilter (QObject *, QEvent *);
580
581private:
582
583 VBoxGlobal();
584 ~VBoxGlobal() {}
585
586 void init();
587
588 bool mValid;
589
590 CVirtualBox mVBox;
591
592 VBoxGlobalSettings gset;
593
594 VBoxSelectorWnd *mSelectorWnd;
595 VBoxConsoleWnd *mConsoleWnd;
596
597#ifdef VBOX_WITH_REGISTRATION
598 VBoxRegistrationDlg *mRegDlg;
599#endif
600
601 QUuid vmUuid;
602
603 QThread *media_enum_thread;
604 VBoxMediaList media_list;
605
606 VBoxDefs::RenderMode vm_render_mode;
607 const char * vm_render_mode_str;
608
609#ifdef VBOX_WITH_DEBUGGER_GUI
610 bool dbg_enabled;
611 bool dbg_visible_at_startup;
612#endif
613
614#if defined (Q_WS_WIN32)
615 DWORD dwHTMLHelpCookie;
616#endif
617
618 CVirtualBoxCallback callback;
619
620 typedef QValueVector <QString> QStringVector;
621
622 QString verString;
623
624 QValueVector <CGuestOSType> vm_os_types;
625 QDict <QPixmap> vm_os_type_icons;
626 QPtrVector <QColor> vm_state_color;
627
628 QIntDict <QPixmap> mStateIcons;
629 QPixmap mOfflineSnapshotIcon, mOnlineSnapshotIcon;
630
631 QStringVector machineStates;
632 QStringVector sessionStates;
633 QStringVector deviceTypes;
634 QStringVector storageBuses;
635 QStringVector storageBusDevices;
636 QStringVector storageBusChannels;
637 QStringVector diskTypes;
638 QStringVector diskStorageTypes;
639 QStringVector vrdpAuthTypes;
640 QStringVector portModeTypes;
641 QStringVector usbFilterActionTypes;
642 QStringVector audioDriverTypes;
643 QStringVector audioControllerTypes;
644 QStringVector networkAdapterTypes;
645 QStringVector networkAttachmentTypes;
646 QStringVector clipboardTypes;
647 QStringVector ideControllerTypes;
648 QStringVector USBDeviceStates;
649
650 QString mUserDefinedPortName;
651
652 mutable bool detailReportTemplatesReady;
653
654 friend VBoxGlobal &vboxGlobal();
655 friend class VBoxCallback;
656};
657
658inline VBoxGlobal &vboxGlobal() { return VBoxGlobal::instance(); }
659
660// Helper classes
661////////////////////////////////////////////////////////////////////////////////
662
663/**
664 * Generic asyncronous event.
665 *
666 * This abstract class is intended to provide a conveinent way to execute
667 * code on the main GUI thread asynchronously to the calling party. This is
668 * done by putting necessary actions to the #handle() function in a subclass
669 * and then posting an instance of the subclass using #post(). The instance
670 * must be allocated on the heap using the <tt>new</tt> operation and will be
671 * automatically deleted after processing. Note that if you don't call #post()
672 * on the created instance, you have to delete it yourself.
673 */
674class VBoxAsyncEvent : public QEvent
675{
676public:
677
678 VBoxAsyncEvent() : QEvent ((QEvent::Type) VBoxDefs::AsyncEventType) {}
679
680 /**
681 * Worker function. Gets executed on the GUI thread when the posted event
682 * is processed by the main event loop.
683 */
684 virtual void handle() = 0;
685
686 /**
687 * Posts this event to the main event loop.
688 * The caller loses ownership of this object after this method returns
689 * and must not delete the object.
690 */
691 void post()
692 {
693 QApplication::postEvent (&vboxGlobal(), this);
694 }
695};
696
697/**
698 * USB Popup Menu class.
699 * This class provides the list of USB devices attached to the host.
700 */
701class VBoxUSBMenu : public QPopupMenu
702{
703 Q_OBJECT
704
705public:
706
707 enum { USBDevicesMenuNoDevicesId = 1 };
708
709 VBoxUSBMenu (QWidget *);
710
711 const CUSBDevice& getUSB (int);
712
713 void setConsole (const CConsole &);
714
715private slots:
716
717 void processAboutToShow();
718
719 void processHighlighted (int);
720
721private:
722
723 QMap <int, CUSBDevice> mUSBDevicesMap;
724 CConsole mConsole;
725};
726
727
728/**
729 * Enable/Disable Menu class.
730 * This class provides enable/disable menu items.
731 */
732class VBoxSwitchMenu : public QPopupMenu
733{
734 Q_OBJECT
735
736public:
737
738 VBoxSwitchMenu (QWidget *, QAction *, bool aInverted = false);
739
740 void setToolTip (const QString &);
741
742private slots:
743
744 void processAboutToShow();
745
746 void processActivated (int);
747
748private:
749
750 QAction *mAction;
751 QString mTip;
752 bool mInverted;
753};
754
755#endif /* __VBoxGlobal_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