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 | #include "VBoxGlobal.h"
|
---|
30 |
|
---|
31 | /* Qt includes */
|
---|
32 | #include <QMainWindow>
|
---|
33 |
|
---|
34 | class VBoxSnapshotsWgt;
|
---|
35 | class VBoxVMDetailsView;
|
---|
36 | class VBoxVMDescriptionPage;
|
---|
37 | class VBoxVMLogViewer;
|
---|
38 | class VBoxVMListView;
|
---|
39 | class VBoxVMModel;
|
---|
40 | class VBoxVMItem;
|
---|
41 |
|
---|
42 | class QTabWidget;
|
---|
43 | class QListView;
|
---|
44 | class QEvent;
|
---|
45 |
|
---|
46 | class VBoxSelectorWnd: public QIWithRetranslateUI2<QMainWindow>
|
---|
47 | {
|
---|
48 | Q_OBJECT;
|
---|
49 |
|
---|
50 | public:
|
---|
51 |
|
---|
52 | VBoxSelectorWnd (VBoxSelectorWnd **aSelf,
|
---|
53 | QWidget* aParent = 0,
|
---|
54 | Qt::WindowFlags aFlags = Qt::Window);
|
---|
55 | virtual ~VBoxSelectorWnd();
|
---|
56 |
|
---|
57 | bool startMachine (const QUuid &aId);
|
---|
58 |
|
---|
59 | public slots:
|
---|
60 |
|
---|
61 | void fileDiskMgr();
|
---|
62 | void fileSettings();
|
---|
63 | void fileExit();
|
---|
64 |
|
---|
65 | void vmNew();
|
---|
66 | void vmSettings (const QString &aCategory = QString::null,
|
---|
67 | const QString &aControl = QString::null);
|
---|
68 | void vmDelete();
|
---|
69 | void vmStart();
|
---|
70 | void vmDiscard();
|
---|
71 | void vmPause (bool);
|
---|
72 | void vmRefresh();
|
---|
73 | void vmShowLogs();
|
---|
74 |
|
---|
75 | void refreshVMList();
|
---|
76 | void refreshVMItem (const QUuid &aID, bool aDetails,
|
---|
77 | bool aSnapshots,
|
---|
78 | bool aDescription);
|
---|
79 |
|
---|
80 | void showContextMenu (VBoxVMItem *aItem, const QPoint &aPoint);
|
---|
81 |
|
---|
82 | protected:
|
---|
83 |
|
---|
84 | /* Events */
|
---|
85 | bool event (QEvent *aEvent);
|
---|
86 |
|
---|
87 | void retranslateUi();
|
---|
88 |
|
---|
89 | private slots:
|
---|
90 |
|
---|
91 | void vmListViewCurrentChanged (bool aRefreshDetails = true,
|
---|
92 | bool aRefreshSnapshots = true,
|
---|
93 | bool aRefreshDescription = true);
|
---|
94 |
|
---|
95 | void mediaEnumStarted();
|
---|
96 | void mediaEnumFinished (const VBoxMediaList &);
|
---|
97 |
|
---|
98 | /* VirtualBox callback events we're interested in */
|
---|
99 |
|
---|
100 | void machineStateChanged (const VBoxMachineStateChangeEvent &e);
|
---|
101 | void machineDataChanged (const VBoxMachineDataChangeEvent &e);
|
---|
102 | void machineRegistered (const VBoxMachineRegisteredEvent &e);
|
---|
103 | void sessionStateChanged (const VBoxSessionStateChangeEvent &e);
|
---|
104 | void snapshotChanged (const VBoxSnapshotEvent &e);
|
---|
105 |
|
---|
106 | private:
|
---|
107 |
|
---|
108 | /* Main menus */
|
---|
109 | QMenu *mFileMenu;
|
---|
110 | QMenu *mVMMenu;
|
---|
111 | QMenu *mHelpMenu;
|
---|
112 |
|
---|
113 | /* VM list context menu */
|
---|
114 | QMenu *mVMCtxtMenu;
|
---|
115 |
|
---|
116 | /* Actions */
|
---|
117 | QAction *fileDiskMgrAction;
|
---|
118 | QAction *fileSettingsAction;
|
---|
119 | QAction *fileExitAction;
|
---|
120 | QAction *vmNewAction;
|
---|
121 | QAction *vmConfigAction;
|
---|
122 | QAction *vmDeleteAction;
|
---|
123 | QAction *vmStartAction;
|
---|
124 | QAction *vmDiscardAction;
|
---|
125 | QAction *vmPauseAction;
|
---|
126 | QAction *vmRefreshAction;
|
---|
127 | QAction *vmShowLogsAction;
|
---|
128 | QAction *helpContentsAction;
|
---|
129 | QAction *helpWebAction;
|
---|
130 | QAction *helpRegisterAction;
|
---|
131 | QAction *helpUpdateAction;
|
---|
132 | QAction *helpAboutAction;
|
---|
133 | QAction *helpResetMessagesAction;
|
---|
134 |
|
---|
135 | /* The vm list view/model */
|
---|
136 | VBoxVMListView *mVMListView;
|
---|
137 | VBoxVMModel *mVMModel;
|
---|
138 |
|
---|
139 | /* The right information widgets */
|
---|
140 | QTabWidget *vmTabWidget;
|
---|
141 | VBoxVMDetailsView *vmDetailsView;
|
---|
142 | VBoxSnapshotsWgt *vmSnapshotsWgt;
|
---|
143 | VBoxVMDescriptionPage *vmDescriptionPage;
|
---|
144 |
|
---|
145 | QPoint normal_pos;
|
---|
146 | QSize normal_size;
|
---|
147 |
|
---|
148 | bool doneInaccessibleWarningOnce : 1;
|
---|
149 | };
|
---|
150 |
|
---|
151 | #endif // __VBoxSelectorWnd_h__
|
---|