1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt4 GUI ("VirtualBox"):
|
---|
4 | * VBoxVMSettingsUSB 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 __VBoxVMSettingsUSB_h__
|
---|
24 | #define __VBoxVMSettingsUSB_h__
|
---|
25 |
|
---|
26 | #include "VBoxSettingsPage.h"
|
---|
27 | #include "VBoxVMSettingsUSB.gen.h"
|
---|
28 | #include "COMDefs.h"
|
---|
29 |
|
---|
30 | class VBoxUSBMenu;
|
---|
31 |
|
---|
32 | class VBoxVMSettingsUSB : public VBoxSettingsPage,
|
---|
33 | public Ui::VBoxVMSettingsUSB
|
---|
34 | {
|
---|
35 | Q_OBJECT;
|
---|
36 |
|
---|
37 | public:
|
---|
38 |
|
---|
39 | enum FilterType
|
---|
40 | {
|
---|
41 | WrongType = 0,
|
---|
42 | HostType = 1,
|
---|
43 | MachineType = 2
|
---|
44 | };
|
---|
45 |
|
---|
46 | VBoxVMSettingsUSB (FilterType aType);
|
---|
47 |
|
---|
48 | protected:
|
---|
49 |
|
---|
50 | void getFrom (const CSystemProperties &aProps,
|
---|
51 | const VBoxGlobalSettings &aGs);
|
---|
52 | void putBackTo (CSystemProperties &aProps,
|
---|
53 | VBoxGlobalSettings &aGs);
|
---|
54 |
|
---|
55 | void getFrom (const CMachine &aMachine);
|
---|
56 | void putBackTo();
|
---|
57 |
|
---|
58 | void setValidator (QIWidgetValidator *aVal);
|
---|
59 |
|
---|
60 | void setOrderAfter (QWidget *aWidget);
|
---|
61 |
|
---|
62 | void retranslateUi();
|
---|
63 |
|
---|
64 | private slots:
|
---|
65 |
|
---|
66 | void usbAdapterToggled (bool aOn);
|
---|
67 | void currentChanged (QTreeWidgetItem *aItem = 0,
|
---|
68 | QTreeWidgetItem *aPrev = 0);
|
---|
69 | void setCurrentText (const QString &aText);
|
---|
70 | void newClicked();
|
---|
71 | void addClicked();
|
---|
72 | void addConfirmed (QAction *aAction);
|
---|
73 | void delClicked();
|
---|
74 | void mupClicked();
|
---|
75 | void mdnClicked();
|
---|
76 | void showContextMenu (const QPoint &aPos);
|
---|
77 |
|
---|
78 | private:
|
---|
79 |
|
---|
80 | void addUSBFilter (const CUSBDeviceFilter &aFilter, bool isNew);
|
---|
81 |
|
---|
82 | CMachine mMachine;
|
---|
83 | QIWidgetValidator *mValidator;
|
---|
84 | FilterType mType;
|
---|
85 | QAction *mNewAction;
|
---|
86 | QAction *mAddAction;
|
---|
87 | QAction *mDelAction;
|
---|
88 | QAction *mMupAction;
|
---|
89 | QAction *mMdnAction;
|
---|
90 | QMenu *mMenu;
|
---|
91 | VBoxUSBMenu *mUSBDevicesMenu;
|
---|
92 | bool mUSBFilterListModified;
|
---|
93 | QList<CUSBDeviceFilter> mFilters;
|
---|
94 |
|
---|
95 | QString mUSBFilterName;
|
---|
96 | };
|
---|
97 |
|
---|
98 | #endif // __VBoxVMSettingsUSB_h__
|
---|
99 |
|
---|