VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h@ 2980

Last change on this file since 2980 was 2801, checked in by vboxsync, 18 years ago

1750: Add CDROM configuration to "Create VM" wizard:

CD/DVD Boot source selection Dialog implemented.

  1. This dialog shows only during each VM first time started.
  2. It allows to temporarily attach host CD/DVD drive into VM drive to load from it.
  3. It allows to temporarily attach CD/DVD image file into VM drive to load from it.
  4. User can invoke VDM Dialog (CD/DVD Filtered) from this dialog.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.6 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxConsoleWnd class declaration
5 */
6
7/*
8 * Copyright (C) 2006 InnoTek Systemberatung 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 as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * If you received this file as part of a commercial VirtualBox
19 * distribution, then only the terms of your commercial VirtualBox
20 * license agreement apply instead of the previous paragraph.
21 */
22
23#ifndef __VBoxConsoleWnd_h__
24#define __VBoxConsoleWnd_h__
25
26#include "COMDefs.h"
27
28#include <qmainwindow.h>
29
30#include <qmap.h>
31#include <qobjectlist.h>
32#include <qcolor.h>
33#include <qdialog.h>
34
35#ifdef VBOX_WITH_DEBUGGER_GUI
36# include <VBox/dbggui.h>
37#endif
38#ifdef Q_WS_MAC
39# undef PAGE_SIZE
40# undef PAGE_SHIFT
41# include <Carbon/Carbon.h>
42#endif
43
44class QAction;
45class QActionGroup;
46class QHBox;
47class QLabel;
48
49class VBoxConsoleView;
50class QIStateIndicator;
51
52class VBoxUSBMenu;
53class VBoxSwitchMenu;
54class VBoxUSBLedTip;
55class VBoxNetworkLedTip;
56
57class VBoxConsoleWnd : public QMainWindow
58{
59 Q_OBJECT
60
61public:
62
63 VBoxConsoleWnd (VBoxConsoleWnd **aSelf,
64 QWidget* aParent = 0, const char* aName = 0,
65 WFlags aFlags = WType_TopLevel);
66 virtual ~VBoxConsoleWnd();
67
68 bool openView (const CSession &session);
69 void closeView();
70
71 void refreshView();
72
73 bool isTrueFullscreen() const { return full_screen; }
74
75public slots:
76
77protected:
78
79 // events
80 bool event (QEvent *e);
81 void closeEvent (QCloseEvent *e);
82#if defined(Q_WS_X11)
83 bool x11Event (XEvent *event);
84#endif
85#ifdef VBOX_WITH_DEBUGGER_GUI
86 bool dbgCreated();
87 void dbgDestroy();
88 void dbgAdjustRelativePos();
89#endif
90
91protected slots:
92
93private:
94
95 enum /* Stuff */
96 {
97 FloppyStuff = 0x01,
98 DVDStuff = 0x02,
99 HardDiskStuff = 0x04,
100 PauseAction = 0x08,
101 NetworkStuff = 0x10,
102 DisableMouseIntegrAction = 0x20,
103 Caption = 0x40,
104 USBStuff = 0x80,
105 VRDPStuff = 0x100,
106 AllStuff = 0xFF,
107 };
108
109 void languageChange();
110
111 void updateAppearanceOf (int element);
112
113private slots:
114
115 void finalizeOpenView();
116
117 void loadGuiCustomizations();
118
119 void vmFullscreen (bool on);
120 void vmAutoresizeGuest (bool on);
121 void vmAdjustWindow();
122
123 void vmTypeCAD();
124 void vmTypeCABS();
125 void vmReset();
126 void vmPause(bool);
127 void vmACPIShutdown();
128 void vmClose();
129 void vmTakeSnapshot();
130 void vmDisableMouseIntegr (bool);
131
132 void devicesMountFloppyImage();
133 void devicesUnmountFloppy();
134 void devicesMountDVDImage();
135 void devicesUnmountDVD();
136 void devicesSwitchVrdp (bool);
137 void devicesToggleSFDialog (bool);
138 void devicesInstallGuestAdditions();
139
140 void prepareFloppyMenu();
141 void prepareDVDMenu();
142 void prepareNetworkMenu();
143
144 void setDynamicMenuItemStatusTip (int aId);
145
146 void captureFloppy (int aId);
147 void captureDVD (int aId);
148 void activateNetworkMenu (int aId);
149 void switchUSB (int aId);
150 void activateSFMenu();
151
152 void statusTipChanged (const QString &);
153 void clearStatusBar();
154
155 void showIndicatorContextMenu (QIStateIndicator *ind, QContextMenuEvent *e);
156
157 void updateDeviceLights();
158 void updateMachineState (CEnums::MachineState state);
159
160 void updateMouseState (int state);
161
162 void updateAdditionsState (const QString&, bool);
163
164 void tryClose();
165
166 void processGlobalSettingChange (const char *publicName, const char *name);
167
168 void dbgShowStatistics();
169 void dbgShowCommandLine();
170
171private:
172
173 QActionGroup *runningActions;
174
175 // VM actions
176 QAction *vmFullscreenAction;
177 QAction *vmAutoresizeGuestAction;
178 QAction *vmAdjustWindowAction;
179 QAction *vmTypeCADAction;
180#if defined(Q_WS_X11)
181 QAction *vmTypeCABSAction;
182#endif
183 QAction *vmResetAction;
184 QAction *vmPauseAction;
185 QAction *vmACPIShutdownAction;
186 QAction *vmCloseAction;
187 QAction *vmTakeSnapshotAction;
188 QAction *vmDisableMouseIntegrAction;
189
190 // VM popup menus
191 VBoxSwitchMenu *vmAutoresizeMenu;
192 VBoxSwitchMenu *vmDisMouseIntegrMenu;
193
194 // Devices actions
195 QAction *devicesMountFloppyImageAction;
196 QAction *devicesUnmountFloppyAction;
197 QAction *devicesMountDVDImageAction;
198 QAction *devicesUnmountDVDAction;
199 QAction *devicesSwitchVrdpAction;
200 QAction *devicesSFDialogAction;
201 QAction *devicesInstallGuestToolsAction;
202
203#ifdef VBOX_WITH_DEBUGGER_GUI
204 // Debugger actions
205 QAction *dbgStatisticsAction;
206 QAction *dbgCommandLineAction;
207#endif
208
209 // Help actions
210 QAction *helpWebAction;
211 QAction *helpAboutAction;
212 QAction *helpResetMessagesAction;
213
214 // Devices popup menus
215 QPopupMenu *devicesMenu;
216 QPopupMenu *devicesMountFloppyMenu;
217 QPopupMenu *devicesMountDVDMenu;
218 QPopupMenu *devicesSharedFolders;
219 QPopupMenu *devicesNetworkMenu;
220 VBoxUSBMenu *devicesUSBMenu;
221 VBoxSwitchMenu *devicesVRDPMenu;
222
223 int devicesUSBMenuSeparatorId;
224 int devicesVRDPMenuSeparatorId;
225 int devicesSFMenuSeparatorId;
226
227 bool waitForStatusBarChange;
228 bool statusBarChangedInside;
229
230#ifdef VBOX_WITH_DEBUGGER_GUI
231 // Debugger popup menu
232 QPopupMenu *dbgMenu;
233#endif
234
235 // Menu identifiers
236 enum {
237 vmMenuId = 1,
238 devicesMenuId,
239 devicesMountFloppyMenuId,
240 devicesMountDVDMenuId,
241 devicesUSBMenuId,
242 devicesNetworkMenuId,
243#ifdef VBOX_WITH_DEBUGGER_GUI
244 dbgMenuId,
245#endif
246 helpMenuId,
247 };
248
249 CSession csession;
250
251 // widgets
252 VBoxConsoleView *console;
253 QIStateIndicator *hd_light, *cd_light, *fd_light, *net_light, *usb_light;
254 QIStateIndicator *mouse_state, *hostkey_state;
255 QIStateIndicator *autoresize_state;
256 QIStateIndicator *vrdp_state;
257 QIStateIndicator *sf_state;
258 QHBox *hostkey_hbox;
259 QLabel *hostkey_name;
260
261 VBoxUSBLedTip *mUsbLedTip;
262 VBoxNetworkLedTip *mNetworkLedTip;
263
264 QTimer *idle_timer;
265 CEnums::MachineState machine_state;
266 QString caption_prefix;
267
268 bool no_auto_close : 1;
269
270 QMap <int, CHostDVDDrive> hostDVDMap;
271 QMap <int, CHostFloppyDrive> hostFloppyMap;
272
273 QPoint normal_pos;
274 QSize normal_size;
275 QSize prev_min_size;
276
277 // variables for dealing with true fullscreen
278 bool full_screen : 1;
279 int normal_wflags;
280 bool was_max : 1;
281 QObjectList hidden_children;
282 int console_style;
283 QColor erase_color;
284
285 bool mIsFirstTimeStarted : 1;
286
287#ifdef VBOX_WITH_DEBUGGER_GUI
288 // Debugger GUI
289 PDBGGUI dbg_gui;
290#endif
291
292#ifdef Q_WS_MAC
293 // Dock images.
294 CGImageRef dockImgStateRunning;
295 CGImageRef dockImgStatePaused;
296 CGImageRef dockImgStateSaving;
297 CGImageRef dockImgStateRestoring;
298 CGImageRef dockImgBack75x75;
299 CGImageRef dockImgBack100x75;
300 CGImageRef dockImgOS;
301#endif
302};
303
304
305class VBoxSharedFoldersSettings;
306class VBoxSFDialog : public QDialog
307{
308 Q_OBJECT
309
310public:
311
312 VBoxSFDialog (QWidget*, CSession&, QAction*);
313 ~VBoxSFDialog();
314
315protected slots:
316
317 virtual void accept();
318 virtual void suicide (bool);
319
320protected:
321
322 void showEvent (QShowEvent*);
323
324private:
325
326 VBoxSharedFoldersSettings *mSettings;
327 CSession &mSession;
328 QAction *mAction;
329};
330
331
332#endif // __VBoxConsoleWnd_h__
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette