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 |
|
---|
36 | class VBoxSnapshotsWgt;
|
---|
37 | class VBoxVMDetailsView;
|
---|
38 | class VBoxVMDescriptionPage;
|
---|
39 | class VBoxVMLogViewer;
|
---|
40 | class VBoxVMListView;
|
---|
41 | class VBoxVMModel;
|
---|
42 | class VBoxVMItem;
|
---|
43 |
|
---|
44 | class QTabWidget;
|
---|
45 | class QListView;
|
---|
46 | class QEvent;
|
---|
47 |
|
---|
48 | class VBoxSelectorWnd: public QIWithRetranslateUI2<QMainWindow>
|
---|
49 | {
|
---|
50 | Q_OBJECT;
|
---|
51 |
|
---|
52 | public:
|
---|
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 |
|
---|
61 | signals:
|
---|
62 |
|
---|
63 | void closing();
|
---|
64 |
|
---|
65 | public 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 |
|
---|
88 | protected:
|
---|
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 |
|
---|
99 | private 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 |
|
---|
116 | private:
|
---|
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__
|
---|