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