VirtualBox

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

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

Fe/Qt4: Shared Folder VMSettings got it's toolbar & context menu, Fixed tab-order for VRDP VMSettings.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 4.6 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#include <QDialog>
30
31class VBoxVMSettingsDlg;
32class SFTreeViewItem;
33class QIDialogButtonBox;
34
35class QLineEdit;
36class QPushButton;
37class QCheckBox;
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 VBoxVMSettingsSF (QWidget *aParent = 0, int aType = WrongType);
57
58 static void getFromMachineEx (const CMachine &aMachine,
59 QWidget *aParent,
60 VBoxVMSettingsDlg *aDlg);
61 static void putBackToMachineEx();
62
63 int dialogType() { return mDialogType; }
64
65 void getFromGlobal();
66 void getFromMachine (const CMachine &aMachine);
67 void getFromConsole (const CConsole &aConsole);
68
69 void putBackToGlobal();
70 void putBackToMachine();
71 void putBackToConsole();
72
73protected:
74
75 void retranslateUi();
76
77private slots:
78
79 void addTriggered();
80 void edtTriggered();
81 void delTriggered();
82
83 void processCurrentChanged (QTreeWidgetItem *aCurrentItem,
84 QTreeWidgetItem *aPreviousItem = 0);
85 void processDoubleClick (QTreeWidgetItem *aItem, int aColumn);
86 void showContextMenu (const QPoint &aPos);
87
88 void adjustList();
89 void adjustFields();
90
91private:
92
93 void showEvent (QShowEvent *aEvent);
94
95 void removeSharedFolder (const QString &aName, const QString &aPath,
96 SFDialogType aType);
97 void createSharedFolder (const QString &aName, const QString &aPath,
98 bool aWritable,
99 SFDialogType aType);
100
101 void getFrom (const CSharedFolderEnumerator &aEn, SFTreeViewItem *aItem);
102 void putBackTo (CSharedFolderEnumerator &aEn, SFTreeViewItem *aItem);
103
104 SFTreeViewItem* searchRoot (bool aIsPermanent,
105 SFDialogType aType = WrongType);
106 bool isEditable (const QString &);
107 SFoldersNameList usedList (bool aIncludeSelected);
108
109 static VBoxVMSettingsSF *mSettings;
110
111 int mDialogType;
112 QMenu *mMenu;
113 QAction *mNewAction;
114 QAction *mEdtAction;
115 QAction *mDelAction;
116 bool mIsListViewChanged;
117 CMachine mMachine;
118 CConsole mConsole;
119 QString mTrFull;
120 QString mTrReadOnly;
121};
122
123class VBoxAddSFDialog : public QIWithRetranslateUI<QDialog>
124{
125 Q_OBJECT;
126
127public:
128
129 enum DialogType
130 {
131 AddDialogType,
132 EditDialogType
133 };
134
135 VBoxAddSFDialog (VBoxVMSettingsSF *aParent,
136 VBoxAddSFDialog::DialogType aType,
137 bool aEnableSelector /* for "permanent" checkbox */,
138 const SFoldersNameList &aUsedNames);
139 ~VBoxAddSFDialog() {}
140
141 QString getPath();
142 QString getName();
143 bool getPermanent();
144 bool getWritable();
145
146 void setPath (const QString &aPath);
147 void setName (const QString &aName);
148 void setPermanent (bool aPermanent);
149 void setWritable (bool aWritable);
150
151protected:
152
153 void retranslateUi();
154
155private slots:
156
157 void validate();
158 void showFileDialog();
159
160private:
161
162 void showEvent (QShowEvent *aEvent);
163
164 VBoxAddSFDialog::DialogType mType;
165 QIDialogButtonBox *mButtonBox;
166 QLabel *mLbPath;
167 QLineEdit *mLePath;
168 QToolButton *mTbPath;
169 QLabel *mLbName;
170 QLineEdit *mLeName;
171 QCheckBox *mCbPermanent;
172 QCheckBox *mCbReadonly;
173 SFoldersNameList mUsedNames;
174};
175
176#endif // __VBoxVMSettingsSF_h__
177
Note: See TracBrowser for help on using the repository browser.

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