1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * VBoxSelectorWnd class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 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 "VBoxGlobal.h"
|
---|
29 |
|
---|
30 | #include <qapplication.h>
|
---|
31 | #include <qmainwindow.h>
|
---|
32 | #include <qlistbox.h>
|
---|
33 | #include <qgroupbox.h>
|
---|
34 | #include <qaction.h>
|
---|
35 |
|
---|
36 | #include <qvaluelist.h>
|
---|
37 |
|
---|
38 | class VBoxVMListBox;
|
---|
39 | class VBoxSnapshotsWgt;
|
---|
40 | class VBoxVMDetailsView;
|
---|
41 | class VBoxVMDescriptionPage;
|
---|
42 | class VBoxVMLogViewer;
|
---|
43 |
|
---|
44 | class QLabel;
|
---|
45 | class QTextBrowser;
|
---|
46 | class QTabWidget;
|
---|
47 | struct QUuid;
|
---|
48 |
|
---|
49 | class VBoxSelectorWnd : public QMainWindow
|
---|
50 | {
|
---|
51 | Q_OBJECT
|
---|
52 |
|
---|
53 | public:
|
---|
54 |
|
---|
55 | VBoxSelectorWnd (VBoxSelectorWnd **aSelf,
|
---|
56 | QWidget* aParent = 0, const char* aName = 0,
|
---|
57 | WFlags aFlags = WType_TopLevel);
|
---|
58 | virtual ~VBoxSelectorWnd();
|
---|
59 |
|
---|
60 | bool startMachine (const QUuid &id);
|
---|
61 |
|
---|
62 | public slots:
|
---|
63 |
|
---|
64 | void fileMediaMgr();
|
---|
65 | void fileSettings();
|
---|
66 | void fileExit();
|
---|
67 |
|
---|
68 | void vmNew();
|
---|
69 | void vmSettings (const QString &aCategory = QString::null,
|
---|
70 | const QString &aControl = QString::null);
|
---|
71 | void vmDelete();
|
---|
72 | void vmStart();
|
---|
73 | void vmDiscard();
|
---|
74 | void vmPause (bool);
|
---|
75 | void vmRefresh();
|
---|
76 | void vmShowLogs();
|
---|
77 |
|
---|
78 | void refreshVMList();
|
---|
79 | void refreshVMItem (const QUuid &aID, bool aDetails,
|
---|
80 | bool aSnapshots,
|
---|
81 | bool aDescription);
|
---|
82 |
|
---|
83 | void showContextMenu (QListBoxItem *, const QPoint &);
|
---|
84 |
|
---|
85 | protected:
|
---|
86 |
|
---|
87 | /* events */
|
---|
88 | bool event (QEvent *e);
|
---|
89 |
|
---|
90 | protected slots:
|
---|
91 |
|
---|
92 | private:
|
---|
93 |
|
---|
94 | void languageChange();
|
---|
95 |
|
---|
96 | private slots:
|
---|
97 |
|
---|
98 | void vmListBoxCurrentChanged (bool aRefreshDetails = true,
|
---|
99 | bool aRefreshSnapshots = true,
|
---|
100 | bool aRefreshDescription = true);
|
---|
101 |
|
---|
102 | void mediaEnumStarted();
|
---|
103 | void mediaEnumFinished (const VBoxMediaList &);
|
---|
104 |
|
---|
105 | /* VirtualBox callback events we're interested in */
|
---|
106 |
|
---|
107 | void machineStateChanged (const VBoxMachineStateChangeEvent &e);
|
---|
108 | void machineDataChanged (const VBoxMachineDataChangeEvent &e);
|
---|
109 | void machineRegistered (const VBoxMachineRegisteredEvent &e);
|
---|
110 | void sessionStateChanged (const VBoxSessionStateChangeEvent &e);
|
---|
111 | void snapshotChanged (const VBoxSnapshotEvent &e);
|
---|
112 |
|
---|
113 | private:
|
---|
114 |
|
---|
115 | /** VM list context menu */
|
---|
116 | QPopupMenu *mVMCtxtMenu;
|
---|
117 |
|
---|
118 | /* actions */
|
---|
119 | QAction *fileMediaMgrAction;
|
---|
120 | QAction *fileSettingsAction;
|
---|
121 | QAction *fileExitAction;
|
---|
122 | QAction *vmNewAction;
|
---|
123 | QAction *vmConfigAction;
|
---|
124 | QAction *vmDeleteAction;
|
---|
125 | QAction *vmStartAction;
|
---|
126 | QAction *vmDiscardAction;
|
---|
127 | QAction *vmPauseAction;
|
---|
128 | QAction *vmRefreshAction;
|
---|
129 | QAction *vmShowLogsAction;
|
---|
130 | QAction *helpContentsAction;
|
---|
131 | QAction *helpWebAction;
|
---|
132 | QAction *helpRegisterAction;
|
---|
133 | QAction *helpAboutAction;
|
---|
134 | QAction *helpResetMessagesAction;
|
---|
135 |
|
---|
136 | /* widgets */
|
---|
137 | VBoxVMListBox *vmListBox;
|
---|
138 | QTabWidget *vmTabWidget;
|
---|
139 | VBoxVMDetailsView *vmDetailsView;
|
---|
140 | VBoxSnapshotsWgt *vmSnapshotsWgt;
|
---|
141 | VBoxVMDescriptionPage *vmDescriptionPage;
|
---|
142 |
|
---|
143 | QValueList <CSession> sessions;
|
---|
144 |
|
---|
145 | QPoint normal_pos;
|
---|
146 | QSize normal_size;
|
---|
147 |
|
---|
148 | bool doneInaccessibleWarningOnce : 1;
|
---|
149 | };
|
---|
150 |
|
---|
151 | #endif // __VBoxSelectorWnd_h__
|
---|