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 "VBoxVMSettingsUSB.gen.h"
|
---|
27 | #include "QIWithRetranslateUI.h"
|
---|
28 | #include "COMDefs.h"
|
---|
29 |
|
---|
30 | class VBoxGlobalSettingsDlg;
|
---|
31 | class VBoxVMSettingsDlg;
|
---|
32 | class QIWidgetValidator;
|
---|
33 | class VBoxUSBMenu;
|
---|
34 |
|
---|
35 | class VBoxVMSettingsUSB : public QIWithRetranslateUI<QWidget>,
|
---|
36 | public Ui::VBoxVMSettingsUSB
|
---|
37 | {
|
---|
38 | Q_OBJECT;
|
---|
39 |
|
---|
40 | public:
|
---|
41 |
|
---|
42 | enum FilterType
|
---|
43 | {
|
---|
44 | WrongType = 0,
|
---|
45 | HostType = 1,
|
---|
46 | MachineType = 2
|
---|
47 | };
|
---|
48 |
|
---|
49 | static void getFrom (QWidget *aPage,
|
---|
50 | VBoxGlobalSettingsDlg *aDlg,
|
---|
51 | const QString &aPath);
|
---|
52 | static void getFrom (const CMachine &aMachine,
|
---|
53 | QWidget *aPage,
|
---|
54 | VBoxVMSettingsDlg *aDlg,
|
---|
55 | const QString &aPath);
|
---|
56 | static void putBackTo();
|
---|
57 |
|
---|
58 | protected:
|
---|
59 |
|
---|
60 | VBoxVMSettingsUSB (QWidget *aParent,
|
---|
61 | FilterType aType,
|
---|
62 | QWidget *aDlg,
|
---|
63 | const QString &aPath);
|
---|
64 |
|
---|
65 | void getFromHost();
|
---|
66 | void putBackToHost();
|
---|
67 |
|
---|
68 | void getFromMachine (const CMachine &aMachine);
|
---|
69 | void putBackToMachine();
|
---|
70 |
|
---|
71 | void retranslateUi();
|
---|
72 |
|
---|
73 | FilterType mType;
|
---|
74 |
|
---|
75 | private slots:
|
---|
76 |
|
---|
77 | void usbAdapterToggled (bool aOn);
|
---|
78 | void currentChanged (QTreeWidgetItem *aItem = 0,
|
---|
79 | QTreeWidgetItem *aPrev = 0);
|
---|
80 | void setCurrentText (const QString &aText);
|
---|
81 | void newClicked();
|
---|
82 | void addClicked();
|
---|
83 | void addConfirmed (QAction *aAction);
|
---|
84 | void delClicked();
|
---|
85 | void mupClicked();
|
---|
86 | void mdnClicked();
|
---|
87 | void showContextMenu (const QPoint &aPos);
|
---|
88 |
|
---|
89 | private:
|
---|
90 |
|
---|
91 | void addUSBFilter (const CUSBDeviceFilter &aFilter, bool isNew);
|
---|
92 |
|
---|
93 | static VBoxVMSettingsUSB *mSettings;
|
---|
94 |
|
---|
95 | CMachine mMachine;
|
---|
96 | QIWidgetValidator *mValidator;
|
---|
97 | QAction *mNewAction;
|
---|
98 | QAction *mAddAction;
|
---|
99 | QAction *mDelAction;
|
---|
100 | QAction *mMupAction;
|
---|
101 | QAction *mMdnAction;
|
---|
102 | QMenu *mMenu;
|
---|
103 | VBoxUSBMenu *mUSBDevicesMenu;
|
---|
104 | bool mUSBFilterListModified;
|
---|
105 | QList<CUSBDeviceFilter> mFilters;
|
---|
106 |
|
---|
107 | QString mUSBFilterName;
|
---|
108 | };
|
---|
109 |
|
---|
110 | #endif // __VBoxVMSettingsUSB_h__
|
---|
111 |
|
---|