1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt4 GUI ("VirtualBox"):
|
---|
4 | * VBoxVMSettingsSF class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2008-2009 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 __VBoxVMSettingsSF_h__
|
---|
24 | #define __VBoxVMSettingsSF_h__
|
---|
25 |
|
---|
26 | /* Local includes */
|
---|
27 | #include "VBoxSettingsPage.h"
|
---|
28 | #include "VBoxVMSettingsSF.gen.h"
|
---|
29 |
|
---|
30 | /* Local forwards */
|
---|
31 | class SFTreeViewItem;
|
---|
32 |
|
---|
33 | enum SFDialogType
|
---|
34 | {
|
---|
35 | WrongType = 0x00,
|
---|
36 | GlobalType = 0x01,
|
---|
37 | MachineType = 0x02,
|
---|
38 | ConsoleType = 0x04
|
---|
39 | };
|
---|
40 | typedef QPair <QString, SFDialogType> SFolderName;
|
---|
41 | typedef QList <SFolderName> SFoldersNameList;
|
---|
42 |
|
---|
43 | class VBoxVMSettingsSF : public VBoxSettingsPage, public Ui::VBoxVMSettingsSF
|
---|
44 | {
|
---|
45 | Q_OBJECT;
|
---|
46 |
|
---|
47 | public:
|
---|
48 |
|
---|
49 | VBoxVMSettingsSF (int aType = WrongType, QWidget *aParent = 0);
|
---|
50 |
|
---|
51 | void getFromGlobal();
|
---|
52 | void getFromMachine (const CMachine &aMachine);
|
---|
53 | void getFromConsole (const CConsole &aConsole);
|
---|
54 |
|
---|
55 | void putBackToGlobal();
|
---|
56 | void putBackToMachine();
|
---|
57 | void putBackToConsole();
|
---|
58 |
|
---|
59 | int dialogType() const;
|
---|
60 |
|
---|
61 | protected:
|
---|
62 |
|
---|
63 | void getFrom (const CMachine &aMachine);
|
---|
64 | void putBackTo();
|
---|
65 |
|
---|
66 | void setOrderAfter (QWidget *aWidget);
|
---|
67 |
|
---|
68 | void retranslateUi();
|
---|
69 |
|
---|
70 | private slots:
|
---|
71 |
|
---|
72 | void addTriggered();
|
---|
73 | void edtTriggered();
|
---|
74 | void delTriggered();
|
---|
75 |
|
---|
76 | void processCurrentChanged (QTreeWidgetItem *aCurrentItem);
|
---|
77 | void processDoubleClick (QTreeWidgetItem *aItem);
|
---|
78 | void showContextMenu (const QPoint &aPos);
|
---|
79 |
|
---|
80 | void adjustList();
|
---|
81 | void adjustFields();
|
---|
82 |
|
---|
83 | private:
|
---|
84 |
|
---|
85 | void showEvent (QShowEvent *aEvent);
|
---|
86 |
|
---|
87 | void createSharedFolder (const QString &aName, const QString &aPath, bool aWritable, SFDialogType aType);
|
---|
88 | void removeSharedFolder (const QString &aName, const QString &aPath, SFDialogType aType);
|
---|
89 |
|
---|
90 | void getFrom (const CSharedFolderVector &aVec, SFTreeViewItem *aItem);
|
---|
91 | void putBackTo (CSharedFolderVector &aVec, SFTreeViewItem *aItem);
|
---|
92 |
|
---|
93 | SFTreeViewItem* searchRoot (bool aIsPermanent, SFDialogType aType = WrongType);
|
---|
94 | bool isEditable (const QString &aKey);
|
---|
95 | SFoldersNameList usedList (bool aIncludeSelected);
|
---|
96 |
|
---|
97 | int mDialogType;
|
---|
98 | QAction *mNewAction;
|
---|
99 | QAction *mEdtAction;
|
---|
100 | QAction *mDelAction;
|
---|
101 | bool mIsListViewChanged;
|
---|
102 | CMachine mMachine;
|
---|
103 | CConsole mConsole;
|
---|
104 | QString mTrFull;
|
---|
105 | QString mTrReadOnly;
|
---|
106 | };
|
---|
107 |
|
---|
108 | #endif // __VBoxVMSettingsSF_h__
|
---|