VBoxSharedFoldersSettings.ui.h revision 40f816668d362e859601b6e450ffea01a6f0e5e5
/**
*
* VBox frontends: Qt GUI ("VirtualBox"):
* "Shared Folders" settings dialog UI include (Qt Designer)
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
{
enum { QIRichListItemId = 1010 };
enum FormatType
{
IncorrectFormat = 0,
EllipsisStart = 1,
EllipsisMiddle = 2,
EllipsisEnd = 3,
EllipsisFile = 4
};
{
}
{
}
int rtti() const { return QIRichListItemId; }
{
}
{
}
{
}
{
return;
/* compress text */
int start = 0;
int finish = 0;
int position = 0;
int textWidth = 0;
do {
{
start = 0;
/* selecting remove position */
switch (mFormat)
{
case EllipsisStart:
break;
case EllipsisMiddle:
break;
case EllipsisEnd:
break;
case EllipsisFile:
{
if (newFinish != -1)
break;
}
default:
AssertMsgFailed (("Invalid format type\n"));
}
break;
}
}
};
{
bool aEnableSelector /* for "permanent" checkbox */) :
{
switch (aType)
{
case AddDialogType:
break;
case EditDialogType:
break;
default:
AssertMsgFailed (("Incorrect SF Dialog type\n"));
}
/* Setup Input layout */
"select_file_dis_16px.png"));
"(as it will be seen by the guest OS)."));
if (aEnableSelector)
{
mCbPermanent->setChecked (true);
}
/* Setup Button layout */
/* Validate fields */
validate();
}
~VBoxAddSFDialog() {}
bool getPermanent()
{
}
void setPermanent (bool aPermanent)
{
if (mCbPermanent)
{
}
}
void validate()
{
}
void showFileDialog()
{
this, "addSharedFolderDialog",
tr ("Select a folder to share"));
return;
{
/* processing non-root folder */
}
{
/* processing root folder */
#if defined(Q_WS_WIN32)
#endif
}
else
return; /* hm, what type of folder it was? */
}
{
setFixedHeight (height());
}
};
void VBoxSharedFoldersSettings::init()
{
listView->setShowToolTips (false);
listView->setRootIsDecorated (true);
"add_shared_folder_disabled_16px.png"));
"edit_shared_folder_disabled_16px.png"));
"revome_shared_folder_disabled_16px.png"));
mIsListViewChanged = false;
}
{
mDialogType = aType;
}
{
switch (aType)
{
case GlobalType:
{
/* This feature is not implemented yet */
AssertMsgFailed (("Global shared folders are not implemented yet\n"));
break;
}
case MachineType:
{
break;
}
case ConsoleType:
{
break;
}
default:
{
AssertMsgFailed (("Incorrect shared folder type\n"));
}
}
}
{
switch (aType)
{
case GlobalType:
{
/* This feature is not implemented yet */
AssertMsgFailed (("Global shared folders are not implemented yet\n"));
break;
}
case MachineType:
{
break;
}
case ConsoleType:
{
break;
}
default:
{
AssertMsgFailed (("Incorrect shared folder type\n"));
}
}
}
{
/* This feature is not implemented yet */
AssertMsgFailed (("Global shared folders are not implemented yet\n"));
/*
QString name = tr (" Global Folders");
QString key (QString::number (GlobalType));
VBoxRichListItem *root = new VBoxRichListItem (VBoxRichListItem::EllipsisEnd,
listView, name, QString::null, key);
getFrom (vboxGlobal().virtualBox().GetSharedFolders().Enumerate(), root);
*/
}
{
}
{
}
{
aRoot->setSelectable (false);
{
}
}
{
/* This feature is not implemented yet */
AssertMsgFailed (("Global shared folders are not implemented yet\n"));
/*
if (!mIsListViewChanged) return;
// This function is only available for GlobalType dialog
Assert (mDialogType == GlobalType);
// Searching for GlobalType item's root
QListViewItem *root = listView->findItem (QString::number (GlobalType), 2);
Assert (root);
CSharedFolderEnumerator en = vboxGlobal().virtualBox().GetSharedFolders().Enumerate();
putBackTo (en, root);
*/
}
{
if (!mIsListViewChanged)
return;
/* This function is only available for MachineType dialog */
/* Searching for MachineType item's root */
}
{
if (!mIsListViewChanged)
return;
/* This function is only available for ConsoleType dialog */
/* Searching for ConsoleType item's root */
}
{
/* deleting all existing folders if the list */
{
}
/* saving all machine related list view items */
while (iterator)
{
VBoxRichListItem *item = 0;
else
AssertMsgFailed (("Incorrect listview item type\n"));
}
}
{
if (!aIsPermanent)
else if (mDialogType & MachineType)
else
}
{
/* Invoke Add-Box Dialog */
return;
/* Shared folder's name & path could not be empty */
/* Searching root for the new listview item */
/* Appending a new listview item to the root */
/* Make the created item selected */
mIsListViewChanged = true;
}
{
/* Check selected item */
/* Invoke Edit-Box Dialog */
!= ConsoleType);
return;
/* Shared folder's name & path could not be empty */
/* Searching new root for the selected listview item */
/* Updating an edited listview item */
{
/* Move the selected item into new location */
/* Make the created item selected */
}
mIsListViewChanged = true;
}
{
mIsListViewChanged = true;
}
{
VBoxRichListItem *item = 0;
"<nobr>Path: %2</nobr>")
else
}
{
bool addEnabled = aItem &&
}
{
if (editEnabled)
}
{
/* mDialogType should be sutup already */
/* simple item has no key information */
return false;
if (!type)
AssertMsgFailed (("Incorrect listview item key value\n"));
return mDialogType & type;
}
#include "VBoxSharedFoldersSettings.ui.moc"