VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxVMSettingsSF.h@ 18553

Last change on this file since 18553 was 16966, checked in by vboxsync, 16 years ago

#3551: “Main: Replace remaining collections with safe arrays”
Converted SharedFolderCollection. Approved by dmik. Tested with GUI.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 3.1 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 "VBoxSettingsPage.h"
27#include "VBoxVMSettingsSF.gen.h"
28
29class SFTreeViewItem;
30
31enum SFDialogType
32{
33 WrongType = 0x00,
34 GlobalType = 0x01,
35 MachineType = 0x02,
36 ConsoleType = 0x04
37};
38typedef QPair<QString, SFDialogType> SFolderName;
39typedef QList<SFolderName> SFoldersNameList;
40
41class VBoxVMSettingsSF : public VBoxSettingsPage,
42 public Ui::VBoxVMSettingsSF
43{
44 Q_OBJECT;
45
46public:
47
48 VBoxVMSettingsSF (int aType = WrongType, QWidget *aParent = 0);
49
50 void getFromGlobal();
51 void getFromMachine (const CMachine &aMachine);
52 void getFromConsole (const CConsole &aConsole);
53
54 void putBackToGlobal();
55 void putBackToMachine();
56 void putBackToConsole();
57
58 int dialogType() { return mDialogType; }
59
60protected:
61
62 void getFrom (const CMachine &aMachine);
63 void putBackTo();
64
65 void setOrderAfter (QWidget *aWidget);
66
67 void retranslateUi();
68
69private slots:
70
71 void addTriggered();
72 void edtTriggered();
73 void delTriggered();
74
75 void processCurrentChanged (QTreeWidgetItem *aCurrentItem,
76 QTreeWidgetItem *aPreviousItem = 0);
77 void processDoubleClick (QTreeWidgetItem *aItem, int aColumn);
78 void showContextMenu (const QPoint &aPos);
79
80 void adjustList();
81 void adjustFields();
82
83private:
84
85 void showEvent (QShowEvent *aEvent);
86
87 void removeSharedFolder (const QString &aName, const QString &aPath,
88 SFDialogType aType);
89 void createSharedFolder (const QString &aName, const QString &aPath,
90 bool aWritable,
91 SFDialogType aType);
92
93 void getFrom (const CSharedFolderVector &aVec, SFTreeViewItem *aItem);
94 void putBackTo (CSharedFolderVector &aVec, SFTreeViewItem *aItem);
95
96 SFTreeViewItem* searchRoot (bool aIsPermanent,
97 SFDialogType aType = WrongType);
98 bool isEditable (const QString &);
99 SFoldersNameList usedList (bool aIncludeSelected);
100
101 int mDialogType;
102 QMenu *mMenu;
103 QAction *mNewAction;
104 QAction *mEdtAction;
105 QAction *mDelAction;
106 bool mIsListViewChanged;
107 CMachine mMachine;
108 CConsole mConsole;
109 QString mTrFull;
110 QString mTrReadOnly;
111};
112
113#endif // __VBoxVMSettingsSF_h__
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