3
* VBox frontends: Qt4 GUI ("VirtualBox"):
4
* UIMachineSettingsSF class declaration
8
* Copyright (C) 2008-2010 Oracle Corporation
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.
19
#ifndef __UIMachineSettingsSF_h__
20
#define __UIMachineSettingsSF_h__
23
#include "UISettingsPage.h"
24
#include "UIMachineSettingsSF.gen.h"
29
enum UISharedFolderType
35
typedef QPair <QString, UISharedFolderType> SFolderName;
36
typedef QList <SFolderName> SFoldersNameList;
38
/* Machine settings / Shared Folders page / Folder data: */
39
struct UISharedFolderData
41
UISharedFolderType m_type;
43
QString m_strHostPath;
49
/* Machine settings / Shared Folders page / Cache: */
50
struct UISettingsCacheMachineSFolders
52
QList<UISharedFolderData> m_items;
55
class UIMachineSettingsSF : public UISettingsPageMachine,
56
public Ui::UIMachineSettingsSF
62
UIMachineSettingsSF();
64
void loadDirectlyFrom(const CConsole &console);
65
void saveDirectlyTo(CConsole &console);
69
/* Load data to cashe from corresponding external object(s),
70
* this task COULD be performed in other than GUI thread: */
71
void loadToCacheFrom(QVariant &data);
72
void loadToCacheFromMachine(const CMachine &machine);
73
void loadToCacheFromConsole(const CConsole &console);
74
void loadToCacheFromVector(const CSharedFolderVector &vector, UISharedFolderType type);
75
/* Load data to corresponding widgets from cache,
76
* this task SHOULD be performed in GUI thread only: */
79
/* Save data from corresponding widgets to cache,
80
* this task SHOULD be performed in GUI thread only: */
82
/* Save data from cache to corresponding external object(s),
83
* this task COULD be performed in other than GUI thread: */
84
void saveFromCacheTo(QVariant &data);
85
void saveFromCacheToMachine(CMachine &machine);
86
void saveFromCacheToConsole(CConsole &console);
88
void setOrderAfter (QWidget *aWidget);
98
void processCurrentChanged (QTreeWidgetItem *aCurrentItem);
99
void processDoubleClick (QTreeWidgetItem *aItem);
100
void showContextMenu (const QPoint &aPos);
107
void resizeEvent (QResizeEvent *aEvent);
109
void showEvent (QShowEvent *aEvent);
111
SFTreeViewItem* root(UISharedFolderType type);
112
SFoldersNameList usedList (bool aIncludeSelected);
114
UISharedFolderType m_type;
119
bool mIsListViewChanged;
125
UISettingsCacheMachineSFolders m_cache;
128
#endif // __UIMachineSettingsSF_h__