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 | #ifdef VBOX_GUI_WITH_SYSTRAY
|
---|
36 | #include <QSystemTrayIcon>
|
---|
37 | #endif
|
---|
38 |
|
---|
39 | class VBoxSnapshotsWgt;
|
---|
40 | class VBoxVMDetailsView;
|
---|
41 | class VBoxVMDescriptionPage;
|
---|
42 | class VBoxVMLogViewer;
|
---|
43 | class VBoxVMListView;
|
---|
44 | class VBoxVMModel;
|
---|
45 | class VBoxVMItem;
|
---|
46 |
|
---|
47 | class QTabWidget;
|
---|
48 | class QListView;
|
---|
49 | class QEvent;
|
---|
50 |
|
---|
51 | class VBoxSelectorWnd: public QIWithRetranslateUI2 <QMainWindow>
|
---|
52 | {
|
---|
53 | Q_OBJECT;
|
---|
54 |
|
---|
55 | public:
|
---|
56 |
|
---|
57 | VBoxSelectorWnd (VBoxSelectorWnd **aSelf,
|
---|
58 | QWidget* aParent = 0,
|
---|
59 | Qt::WindowFlags aFlags = Qt::Window);
|
---|
60 | virtual ~VBoxSelectorWnd();
|
---|
61 |
|
---|
62 | bool startMachine (const QUuid &aId);
|
---|
63 |
|
---|
64 | signals:
|
---|
65 |
|
---|
66 | void closing();
|
---|
67 |
|
---|
68 | public slots:
|
---|
69 |
|
---|
70 | void fileMediaMgr();
|
---|
71 | void fileSettings();
|
---|
72 | void fileExit();
|
---|
73 |
|
---|
74 | void vmNew();
|
---|
75 | void vmSettings (const QString &aCategory = QString::null,
|
---|
76 | const QString &aControl = QString::null,
|
---|
77 | const QUuid & = QUuid_null);
|
---|
78 | void vmDelete (const QUuid & = QUuid_null);
|
---|
79 | void vmStart (const QUuid & = QUuid_null);
|
---|
80 | void vmDiscard (const QUuid & = QUuid_null);
|
---|
81 | void vmPause (bool, const QUuid & = QUuid_null);
|
---|
82 | void vmRefresh (const QUuid & = QUuid_null);
|
---|
83 | void vmShowLogs (const QUuid & = QUuid_null);
|
---|
84 |
|
---|
85 | #ifdef VBOX_GUI_WITH_SYSTRAY
|
---|
86 | void refreshSysTray (bool aRetranslate = false);
|
---|
87 | #endif
|
---|
88 |
|
---|
89 | void refreshVMList();
|
---|
90 | void refreshVMItem (const QUuid &aID, bool aDetails,
|
---|
91 | bool aSnapshots,
|
---|
92 | bool aDescription);
|
---|
93 |
|
---|
94 | void showContextMenu (const QPoint &aPoint);
|
---|
95 |
|
---|
96 | #ifdef VBOX_GUI_WITH_SYSTRAY
|
---|
97 | void trayIconActivated (QSystemTrayIcon::ActivationReason aReason);
|
---|
98 | void showWindow();
|
---|
99 | #endif
|
---|
100 |
|
---|
101 | protected:
|
---|
102 |
|
---|
103 | /* Events */
|
---|
104 | bool event (QEvent *aEvent);
|
---|
105 | void closeEvent (QCloseEvent *aEvent);
|
---|
106 | #if defined (Q_WS_MAC) && (QT_VERSION < 0x040402)
|
---|
107 | bool eventFilter (QObject *aObject, QEvent *aEvent);
|
---|
108 | #endif /* defined (Q_WS_MAC) && (QT_VERSION < 0x040402) */
|
---|
109 |
|
---|
110 | void retranslateUi();
|
---|
111 |
|
---|
112 | private slots:
|
---|
113 |
|
---|
114 | void vmListViewCurrentChanged (bool aRefreshDetails = true,
|
---|
115 | bool aRefreshSnapshots = true,
|
---|
116 | bool aRefreshDescription = true);
|
---|
117 |
|
---|
118 | void mediumEnumStarted();
|
---|
119 | void mediumEnumFinished (const VBoxMediaList &);
|
---|
120 |
|
---|
121 | /* VirtualBox callback events we're interested in */
|
---|
122 |
|
---|
123 | void machineStateChanged (const VBoxMachineStateChangeEvent &e);
|
---|
124 | void machineDataChanged (const VBoxMachineDataChangeEvent &e);
|
---|
125 | void machineRegistered (const VBoxMachineRegisteredEvent &e);
|
---|
126 | void sessionStateChanged (const VBoxSessionStateChangeEvent &e);
|
---|
127 | void snapshotChanged (const VBoxSnapshotEvent &e);
|
---|
128 |
|
---|
129 | private:
|
---|
130 |
|
---|
131 | /* Main menus */
|
---|
132 | QMenu *mFileMenu;
|
---|
133 | QMenu *mVMMenu;
|
---|
134 | QMenu *mHelpMenu;
|
---|
135 |
|
---|
136 | /* VM list context menu */
|
---|
137 | QMenu *mVMCtxtMenu;
|
---|
138 |
|
---|
139 | /* Actions */
|
---|
140 | QAction *fileMediaMgrAction;
|
---|
141 | QAction *fileSettingsAction;
|
---|
142 | QAction *fileExitAction;
|
---|
143 | QAction *vmNewAction;
|
---|
144 | QAction *vmConfigAction;
|
---|
145 | QAction *vmDeleteAction;
|
---|
146 | QAction *vmStartAction;
|
---|
147 | QAction *vmDiscardAction;
|
---|
148 | QAction *vmPauseAction;
|
---|
149 | QAction *vmRefreshAction;
|
---|
150 | QAction *vmShowLogsAction;
|
---|
151 |
|
---|
152 | #ifdef VBOX_GUI_WITH_SYSTRAY
|
---|
153 | QAction *mTrayShowWindowAction;
|
---|
154 | QAction *mTrayExitAction;
|
---|
155 | #endif
|
---|
156 |
|
---|
157 | VBoxHelpActions mHelpActions;
|
---|
158 |
|
---|
159 | #ifdef VBOX_GUI_WITH_SYSTRAY
|
---|
160 | /* The systray icon */
|
---|
161 | QSystemTrayIcon *mTrayIcon;
|
---|
162 | QMenu *mTrayIconMenu;
|
---|
163 | #endif
|
---|
164 |
|
---|
165 | /* The vm list view/model */
|
---|
166 | VBoxVMListView *mVMListView;
|
---|
167 | VBoxVMModel *mVMModel;
|
---|
168 |
|
---|
169 | /* The right information widgets */
|
---|
170 | QTabWidget *vmTabWidget;
|
---|
171 | VBoxVMDetailsView *vmDetailsView;
|
---|
172 | VBoxSnapshotsWgt *vmSnapshotsWgt;
|
---|
173 | VBoxVMDescriptionPage *vmDescriptionPage;
|
---|
174 |
|
---|
175 | QPoint normal_pos;
|
---|
176 | QSize normal_size;
|
---|
177 |
|
---|
178 | bool doneInaccessibleWarningOnce : 1;
|
---|
179 | };
|
---|
180 |
|
---|
181 | #endif // __VBoxSelectorWnd_h__
|
---|