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 | #include <QUuid>
|
---|
39 |
|
---|
40 | class VBoxSnapshotsWgt;
|
---|
41 | class VBoxVMDetailsView;
|
---|
42 | class VBoxVMDescriptionPage;
|
---|
43 | class VBoxVMLogViewer;
|
---|
44 | class VBoxVMListView;
|
---|
45 | class VBoxVMModel;
|
---|
46 | class VBoxVMItem;
|
---|
47 |
|
---|
48 | class QTabWidget;
|
---|
49 | class QListView;
|
---|
50 | class QEvent;
|
---|
51 |
|
---|
52 | class VBoxSelectorWnd: public QIWithRetranslateUI2 <QMainWindow>
|
---|
53 | {
|
---|
54 | Q_OBJECT;
|
---|
55 |
|
---|
56 | public:
|
---|
57 |
|
---|
58 | VBoxSelectorWnd (VBoxSelectorWnd **aSelf,
|
---|
59 | QWidget* aParent = 0,
|
---|
60 | Qt::WindowFlags aFlags = Qt::Window);
|
---|
61 | virtual ~VBoxSelectorWnd();
|
---|
62 |
|
---|
63 | bool startMachine (const QUuid &aId);
|
---|
64 |
|
---|
65 | signals:
|
---|
66 |
|
---|
67 | void closing();
|
---|
68 |
|
---|
69 | public slots:
|
---|
70 |
|
---|
71 | void fileMediaMgr();
|
---|
72 | VBoxVMItem* getSelectedItem();
|
---|
73 | #ifdef VBOX_GUI_WITH_SYSTRAY
|
---|
74 | void iconActivated (QSystemTrayIcon::ActivationReason aReason);
|
---|
75 | void showWindow();
|
---|
76 | #endif
|
---|
77 | void fileSettings();
|
---|
78 | void fileExit();
|
---|
79 |
|
---|
80 | void vmNew();
|
---|
81 | void vmSettings (const QString &aCategory = QString::null,
|
---|
82 | const QString &aControl = QString::null,
|
---|
83 | const QUuid &aMachineId = QUuid());
|
---|
84 | void vmDelete (const QUuid &aMachineId = QUuid());
|
---|
85 | void vmStart (const QUuid &aMachineId = QUuid());
|
---|
86 | void vmDiscard (const QUuid &aMachineId = QUuid());
|
---|
87 | void vmPause (bool, const QUuid &aMachineId = QUuid());
|
---|
88 | void vmRefresh (const QUuid &aMachineId = QUuid());
|
---|
89 | void vmShowLogs (const QUuid &aMachineId = QUuid());
|
---|
90 |
|
---|
91 | #ifdef VBOX_GUI_WITH_SYSTRAY
|
---|
92 | void refreshSysTray();
|
---|
93 | #endif
|
---|
94 | void refreshVMList();
|
---|
95 | void refreshVMItem (const QUuid &aID, bool aDetails,
|
---|
96 | bool aSnapshots,
|
---|
97 | bool aDescription);
|
---|
98 |
|
---|
99 | void showContextMenu (const QPoint &aPoint);
|
---|
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 | #ifdef VBOX_GUI_WITH_SYSTRAY
|
---|
145 | QAction *trayShowWindowAction;
|
---|
146 | QAction *trayExitAction;
|
---|
147 | #endif
|
---|
148 | QAction *vmConfigAction;
|
---|
149 | QAction *vmDeleteAction;
|
---|
150 | QAction *vmStartAction;
|
---|
151 | QAction *vmDiscardAction;
|
---|
152 | QAction *vmPauseAction;
|
---|
153 | QAction *vmRefreshAction;
|
---|
154 | QAction *vmShowLogsAction;
|
---|
155 |
|
---|
156 | VBoxHelpActions mHelpActions;
|
---|
157 |
|
---|
158 | #ifdef VBOX_GUI_WITH_SYSTRAY
|
---|
159 | /* The systray icon */
|
---|
160 | QSystemTrayIcon *trayIcon;
|
---|
161 | QMenu *trayIconMenu;
|
---|
162 | #endif
|
---|
163 |
|
---|
164 | /* The vm list view/model */
|
---|
165 | VBoxVMListView *mVMListView;
|
---|
166 | VBoxVMModel *mVMModel;
|
---|
167 |
|
---|
168 | /* The right information widgets */
|
---|
169 | QTabWidget *vmTabWidget;
|
---|
170 | VBoxVMDetailsView *vmDetailsView;
|
---|
171 | VBoxSnapshotsWgt *vmSnapshotsWgt;
|
---|
172 | VBoxVMDescriptionPage *vmDescriptionPage;
|
---|
173 |
|
---|
174 | QPoint normal_pos;
|
---|
175 | QSize normal_size;
|
---|
176 |
|
---|
177 | bool doneInaccessibleWarningOnce : 1;
|
---|
178 | };
|
---|
179 |
|
---|
180 | #endif // __VBoxSelectorWnd_h__
|
---|