VBoxGlobalSettingsDlg.ui.h revision 1166d0a05ef1ba23dadb697b32674d6b07613cf4
/**
*
* VBox frontends: Qt GUI ("VirtualBox"):
* "Global settings" dialog UI include (Qt Designer)
*/
/*
* Copyright (C) 2006 InnoTek Systemberatung 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 wish to add, delete or rename functions or slots use
** Qt Designer which will update this file, preserving your code. Create an
** init() function in place of a constructor, and a destroy() function in
** place of a destructor.
*****************************************************************************/
/* defined in VBoxGlobal.cpp */
extern const char *gVBoxLangSubDir;
extern const char *gVBoxLangFileBase;
extern const char *gVBoxLangFileExt;
extern const char *gVBoxLangIDRegExp;
extern const char *gVBoxBuiltInLangName;
/**
* Returns the path to the item in the form of 'grandparent > parent > item'
* using the text of the first column of every item.
*/
{
QString p;
while (cur)
{
if (!p.isNull())
p = sep + p;
}
return p;
}
enum
{
// listView column numbers
listView_Category = 0,
listView_Id = 1,
listView_Link = 2,
};
{
, mId (-1) {}
int mId;
};
enum { lvUSBFilters_Name = 0 };
{
enum { TypeId = 1001 };
{
* used in VBoxGlobal::languageName() and friends (the latter are the
* source of information for the lupdate tool that generates
* translation files) */
"@@@", "English", "Native language name");
"@@@", "--", "Native language country name "
"(empty if this language is for all countries)");
"@@@", "English", "Language name, in English");
"@@@", "--", "Language country name, in English "
"(empty if native country name is empty)");
"@@@", "InnoTek", "Comma-separated list of translators");
if (!aBuiltIn)
{
if (nativeCountry != "--")
if (englishCountry != "--")
}
else
{
}
}
/* Constructs an item for an invalid language ID (i.e. when a language
* file is missing or corrupt). */
{
}
/* Constructs an item for the default language ID (column 1 will be set
* to QString::null) */
{
}
{
return -1;
return 1;
if (mBuiltIn)
return -1;
return 1;
}
{
if (mInvalid)
/* mark the effectively active language */
if (mBuiltIn)
{
int y = height() - 1;
}
}
{
if (mInvalid)
/* mark the effectively active language */
}
void setup ()
{
QListViewItem::setup();
if (mBuiltIn)
}
{
/* return the source text if no translation is found */
return msg;
}
bool mBuiltIn : 1;
bool mInvalid : 1;
};
void VBoxGlobalSettingsDlg::init()
{
polished = false;
/* all pages are initially valid */
valid = true;
buttonOk->setEnabled (true);
warningLabel->setHidden (true);
warningPixmap->setHidden (true);
/* disable unselecting items by clicking in the unused area of the list */
/* hide the header and internal columns */
/* sort by the id column (to have pages in the desired order) */
/* page title font is derived from the system font */
f.setBold( true );
titleLabel->setFont( f );
/* setup the what's this label */
QApplication::setGlobalMouseTracking (true);
6 /* seems that RichText adds some margin */ +
6 /* seems that RichText adds some margin */ +
/*
* create and layout non-standard widgets
* ----------------------------------------------------------------------
*/
tr ("Displays the key used as a Host Key in the VM window. Activate the "
"entry field and press a new Host Key. Note that alphanumeric, "
"cursor movement and editing keys cannot be used as a Host Key."));
/*
* setup connections and set validation for pages
* ----------------------------------------------------------------------
*/
/* General page */
/// @todo (dmik) remove
// leVDIFolder->setValidator (new QRegExpValidator (QRegExp (".+"), this));
// leMachineFolder->setValidator (new QRegExpValidator (QRegExp (".+"), this));
/* Keyboard page */
/* USB page */
/* disable sorting */
/* disable unselecting items by clicking in the unused area of the list */
/* create a default (disabled) filter settings widget at index 0 */
/* setup toolbutton icons */
"usb_new_disabled_16px.png"));
"usb_add_disabled_16px.png"));
"usb_remove_disabled_16px.png"));
"usb_moveup_disabled_16px.png"));
"usb_movedown_disabled_16px.png"));
/* create menu of existing usb-devices */
mLastUSBFilterNum = 0;
mUSBFilterListModified = false;
/*
* set initial values
* ----------------------------------------------------------------------
*/
/* General page */
/* keyboard page */
/* Language page */
lvLanguages->setSorting (0);
/* add the default language */
/* add the built-in language */
/* add all existing languages */
{
if (pos == -1)
continue;
if (!loadOk)
continue;
}
lvLanguages->adjustColumn (0);
/*
* update the Ok button state for pages with validation
* (validityChanged() connected to enableNext() will do the job)
*/
}
{
{
/* set the first item selected */
mLanguageChanged = false;
}
return result;
}
{
if (!object->isWidgetType())
{
{
else
break;
}
{
updateWhatsThis (true /* gotFocus */);
break;
}
default:
break;
}
}
{
/* one may think that QWidget::polish() is the right place to do things
* below, but apparently, by the time when QWidget::polish() is called,
* the widget style & layout are not fully done, at least the minimum
* size hint is not properly calculated. Since this is sometimes necessary,
* we provide our own "polish" implementation. */
if (polished)
return;
polished = true;
/* resize to the miminum possible size */
resize (minimumSize());
}
{
}
{
/* detect the overall validity */
bool newValid = true;
{
QObjectListIt it (*l);
{
++it;
}
delete l;
}
{
if (valid)
else
warningSpacer->changeSize (0, 0);
}
}
{
/* do individual validations for pages */
/* currently nothing */
}
/**
* Reads global settings from the given VMGlobalSettings instance
* and from the given CSystemProperties object.
*/
const VMGlobalSettings &gs)
{
/* default folders */
/* proprietary GUI settings */
/* usb filters page */
/// @todo currently, we always disable USB UI on XPCOM-based hosts because
/// QueryInterface on CUSBDeviceFilter doesn't return CHostUSBDeviceFilter
#ifdef Q_OS_WIN32
{
#endif
/* disable the USB host filters category if the USB is
* not available (i.e. in VirtualBox OSE) */
usbItem->setVisible (false);
/* disable validators if any */
pageUSB->setEnabled (false);
#ifdef Q_OS_WIN32
/* Show an error message (if there is any).
* This message box may be suppressed if the user wishes so. */
}
else
{
{
addUSBFilter (filter, false);
}
}
#endif
/* language properties */
if (!item)
{
/* add an item for an invalid language to represent it in the list */
lvLanguages->adjustColumn (0);
}
if (item)
{
}
}
/**
* Writes global settings to the given VMGlobalSettings instance
* and to the given CSystemProperties object.
*/
{
/* default folders */
if (leVDIFolder->isModified())
return;
/* proprietary GUI settings */
/* usb filter page */
/*
* first, remove all old filters (only if the list is changed,
* not only individual properties of filters)
*/
/* then add all new filters */
{
return;
}
mUSBFilterListModified = false;
/* language properties */
if (mLanguageChanged && selItem)
{
}
}
{
if (!gotFocus)
{
}
else
{
}
/* if the given widget lacks the whats'this text, look at its parent */
{
break;
}
}
{
if (!warningString.isEmpty())
else
updateWhatsThis (true);
}
{
/*
* do this instead of le->setText (QString::null) to cause
* isModified() return true
*/
}
{
return;
/* remove trailing slash if any */
/*
* do this instead of le->setText (folder) to cause
* isModified() return true
*/
}
// USB Filter stuff
////////////////////////////////////////////////////////////////////////////////
bool aIsNew)
{
? lvUSBFilters->currentItem()
: lvUSBFilters->lastItem();
/* fix the tab order so that main dialog's buttons are always the last */
if (aIsNew)
{
}
/* setup validation */
wval->revalidate();
}
{
if (item)
{
}
else
{
/* raise the disabled widget */
wstUSBFilters->raiseWidget (0);
}
}
{
}
{
addUSBFilter (filter, true);
mUSBFilterListModified = true;
}
{
}
{
// if null then some other item but a USB device is selected
return;
addUSBFilter (filter, true);
mUSBFilterListModified = true;
}
{
mUSBFilterListModified = true;
}
{
if (!itemAbove)
else
mUSBFilterListModified = true;
}
{
mUSBFilterListModified = true;
}
{
if (!aItem) return;
/* disable labels for the Default language item */
mLanguageChanged = true;
}