VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsSF.h@ 9253

Last change on this file since 9253 was 9253, checked in by vboxsync, 17 years ago

Fe/Qt4: Shared Folders VMSettings renamed according other settings pages and formed into the same order as other settings pages.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 4.4 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt4 GUI ("VirtualBox"):
4 * VBoxVMSettingsSF 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 __VBoxVMSettingsSF_h__
24#define __VBoxVMSettingsSF_h__
25
26#include "VBoxVMSettingsSF.gen.h"
27#include "QIWithRetranslateUI.h"
28
29/* Qt includes */
30#include <QDialog>
31
32class QLineEdit;
33class QPushButton;
34class QCheckBox;
35class SFTreeViewItem;
36
37class QIDialogButtonBox;
38
39enum SFDialogType
40{
41 WrongType = 0x00,
42 GlobalType = 0x01,
43 MachineType = 0x02,
44 ConsoleType = 0x04
45};
46typedef QPair<QString, SFDialogType> SFolderName;
47typedef QList<SFolderName> SFoldersNameList;
48
49class VBoxVMSettingsSF : public QIWithRetranslateUI<QWidget>,
50 public Ui::VBoxVMSettingsSF
51{
52 Q_OBJECT;
53
54public:
55
56 static void getFromMachineEx (const CMachine &aMachine,
57 QWidget *aParent);
58 static void putBackToMachineEx();
59
60 VBoxVMSettingsSF (QWidget *aParent = 0, int aType = WrongType);
61
62 int dialogType() { return mDialogType; }
63
64 void getFromGlobal();
65 void getFromMachine (const CMachine &aMachine);
66 void getFromConsole (const CConsole &aConsole);
67
68 void putBackToGlobal();
69 void putBackToMachine();
70 void putBackToConsole();
71
72protected:
73
74 void retranslateUi();
75
76private slots:
77
78 void tbAddPressed();
79 void tbEditPressed();
80 void tbRemovePressed();
81
82 void processCurrentChanged (QTreeWidgetItem *aCurrentItem,
83 QTreeWidgetItem *aPreviousItem = 0);
84 void processDoubleClick (QTreeWidgetItem *aItem, int aColumn);
85
86 void adjustList();
87 void adjustFields();
88
89private:
90
91 void showEvent (QShowEvent *aEvent);
92
93 void removeSharedFolder (const QString &aName, const QString &aPath,
94 SFDialogType aType);
95 void createSharedFolder (const QString &aName, const QString &aPath,
96 bool aWritable,
97 SFDialogType aType);
98
99 void getFrom (const CSharedFolderEnumerator &aEn, SFTreeViewItem *aItem);
100 void putBackTo (CSharedFolderEnumerator &aEn, SFTreeViewItem *aItem);
101
102 SFTreeViewItem* searchRoot (bool aIsPermanent,
103 SFDialogType aType = WrongType);
104 bool isEditable (const QString &);
105 SFoldersNameList usedList (bool aIncludeSelected);
106
107 static VBoxVMSettingsSF *mSettings;
108
109 int mDialogType;
110 bool mIsListViewChanged;
111 CMachine mMachine;
112 CConsole mConsole;
113 QString mTrFull;
114 QString mTrReadOnly;
115};
116
117class VBoxAddSFDialog : public QIWithRetranslateUI<QDialog>
118{
119 Q_OBJECT;
120
121public:
122
123 enum DialogType
124 {
125 AddDialogType,
126 EditDialogType
127 };
128
129 VBoxAddSFDialog (VBoxVMSettingsSF *aParent,
130 VBoxAddSFDialog::DialogType aType,
131 bool aEnableSelector /* for "permanent" checkbox */,
132 const SFoldersNameList &aUsedNames);
133 ~VBoxAddSFDialog() {}
134
135 QString getPath();
136 QString getName();
137 bool getPermanent();
138 bool getWritable();
139
140 void setPath (const QString &aPath);
141 void setName (const QString &aName);
142 void setPermanent (bool aPermanent);
143 void setWritable (bool aWritable);
144
145protected:
146
147 void retranslateUi();
148
149private slots:
150
151 void validate();
152 void showFileDialog();
153
154private:
155
156 void showEvent (QShowEvent *aEvent);
157
158 VBoxAddSFDialog::DialogType mType;
159 QIDialogButtonBox *mButtonBox;
160 QLabel *mLbPath;
161 QLineEdit *mLePath;
162 QToolButton *mTbPath;
163 QLabel *mLbName;
164 QLineEdit *mLeName;
165 QCheckBox *mCbPermanent;
166 QCheckBox *mCbReadonly;
167 SFoldersNameList mUsedNames;
168};
169
170#endif // __VBoxVMSettingsSF_h__
171
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