VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h@ 13224

Last change on this file since 13224 was 12764, checked in by vboxsync, 16 years ago

FE/Qt4-OSX: Don't send key events to the current window if a menu is open & has
the focus (public #2321).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.1 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxSelectorWnd class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19 * Clara, CA 95054 USA or visit http://www.sun.com if you need
20 * additional information or have any questions.
21 */
22
23#ifndef __VBoxSelectorWnd_h__
24#define __VBoxSelectorWnd_h__
25
26#include "COMDefs.h"
27
28#include "QIWithRetranslateUI.h"
29
30#include "VBoxGlobal.h"
31#include "VBoxProblemReporter.h"
32
33/* Qt includes */
34#include <QMainWindow>
35
36class VBoxSnapshotsWgt;
37class VBoxVMDetailsView;
38class VBoxVMDescriptionPage;
39class VBoxVMLogViewer;
40class VBoxVMListView;
41class VBoxVMModel;
42class VBoxVMItem;
43
44class QTabWidget;
45class QListView;
46class QEvent;
47
48class VBoxSelectorWnd: public QIWithRetranslateUI2<QMainWindow>
49{
50 Q_OBJECT;
51
52public:
53
54 VBoxSelectorWnd (VBoxSelectorWnd **aSelf,
55 QWidget* aParent = 0,
56 Qt::WindowFlags aFlags = Qt::Window);
57 virtual ~VBoxSelectorWnd();
58
59 bool startMachine (const QUuid &aId);
60
61signals:
62
63 void closing();
64
65public slots:
66
67 void fileDiskMgr();
68 void fileSettings();
69 void fileExit();
70
71 void vmNew();
72 void vmSettings (const QString &aCategory = QString::null,
73 const QString &aControl = QString::null);
74 void vmDelete();
75 void vmStart();
76 void vmDiscard();
77 void vmPause (bool);
78 void vmRefresh();
79 void vmShowLogs();
80
81 void refreshVMList();
82 void refreshVMItem (const QUuid &aID, bool aDetails,
83 bool aSnapshots,
84 bool aDescription);
85
86 void showContextMenu (VBoxVMItem *aItem, const QPoint &aPoint);
87
88protected:
89
90 /* Events */
91 bool event (QEvent *aEvent);
92 void closeEvent (QCloseEvent *aEvent);
93#if defined (Q_WS_MAC) && (QT_VERSION < 0x040402)
94 bool eventFilter (QObject *aObject, QEvent *aEvent);
95#endif /* defined (Q_WS_MAC) && (QT_VERSION < 0x040402) */
96
97 void retranslateUi();
98
99private slots:
100
101 void vmListViewCurrentChanged (bool aRefreshDetails = true,
102 bool aRefreshSnapshots = true,
103 bool aRefreshDescription = true);
104
105 void mediaEnumStarted();
106 void mediaEnumFinished (const VBoxMediaList &);
107
108 /* VirtualBox callback events we're interested in */
109
110 void machineStateChanged (const VBoxMachineStateChangeEvent &e);
111 void machineDataChanged (const VBoxMachineDataChangeEvent &e);
112 void machineRegistered (const VBoxMachineRegisteredEvent &e);
113 void sessionStateChanged (const VBoxSessionStateChangeEvent &e);
114 void snapshotChanged (const VBoxSnapshotEvent &e);
115
116private:
117
118 /* Main menus */
119 QMenu *mFileMenu;
120 QMenu *mVMMenu;
121 QMenu *mHelpMenu;
122
123 /* VM list context menu */
124 QMenu *mVMCtxtMenu;
125
126 /* Actions */
127 QAction *fileDiskMgrAction;
128 QAction *fileSettingsAction;
129 QAction *fileExitAction;
130 QAction *vmNewAction;
131 QAction *vmConfigAction;
132 QAction *vmDeleteAction;
133 QAction *vmStartAction;
134 QAction *vmDiscardAction;
135 QAction *vmPauseAction;
136 QAction *vmRefreshAction;
137 QAction *vmShowLogsAction;
138
139 VBoxHelpActions mHelpActions;
140
141 /* The vm list view/model */
142 VBoxVMListView *mVMListView;
143 VBoxVMModel *mVMModel;
144
145 /* The right information widgets */
146 QTabWidget *vmTabWidget;
147 VBoxVMDetailsView *vmDetailsView;
148 VBoxSnapshotsWgt *vmSnapshotsWgt;
149 VBoxVMDescriptionPage *vmDescriptionPage;
150
151 QPoint normal_pos;
152 QSize normal_size;
153
154 bool doneInaccessibleWarningOnce : 1;
155};
156
157#endif // __VBoxSelectorWnd_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