~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsUSBFilterDetails.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-30 23:27:25 UTC
  • mfrom: (0.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130232725-2ouajjd2ggdet0zd
Tags: 4.0.2-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Drop ubuntu-01-fix-build-gcc45.patch, fixed upstream.
* Drop ubuntu-02-as-needed.patch, added to the Debian package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: VBoxVMSettingsUSBFilterDetails.cpp $ */
2
 
/** @file
3
 
 *
4
 
 * VBox frontends: Qt4 GUI ("VirtualBox"):
5
 
 * VBoxVMSettingsUSBFilterDetails class implementation
6
 
 */
7
 
 
8
 
/*
9
 
 * Copyright (C) 2008 Oracle Corporation
10
 
 *
11
 
 * This file is part of VirtualBox Open Source Edition (OSE), as
12
 
 * available from http://www.virtualbox.org. This file is free software;
13
 
 * you can redistribute it and/or modify it under the terms of the GNU
14
 
 * General Public License (GPL) as published by the Free Software
15
 
 * Foundation, in version 2 as it comes in the "COPYING" file of the
16
 
 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17
 
 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18
 
 */
19
 
 
20
 
#include "VBoxVMSettingsUSBFilterDetails.h"
21
 
#include "VBoxGlobal.h"
22
 
 
23
 
VBoxVMSettingsUSBFilterDetails::VBoxVMSettingsUSBFilterDetails (VBoxVMSettingsUSB::FilterType aType, QWidget *aParent /* = NULL */)
24
 
    : QIWithRetranslateUI2<QIDialog> (aParent, Qt::Sheet)
25
 
    , mType (aType)
26
 
{
27
 
    /* Apply UI decorations */
28
 
    Ui::VBoxVMSettingsUSBFilterDetails::setupUi (this);
29
 
 
30
 
    mCbRemote->insertItem (VBoxVMSettingsUSB::ModeAny, ""); /* Any */
31
 
    mCbRemote->insertItem (VBoxVMSettingsUSB::ModeOn,  ""); /* Yes */
32
 
    mCbRemote->insertItem (VBoxVMSettingsUSB::ModeOff, ""); /* No */
33
 
    mLbRemote->setHidden (mType != VBoxVMSettingsUSB::MachineType);
34
 
    mCbRemote->setHidden (mType != VBoxVMSettingsUSB::MachineType);
35
 
 
36
 
    mCbAction->insertItem (0, ""); /* KUSBDeviceFilterAction_Ignore */
37
 
    mCbAction->insertItem (1, ""); /* KUSBDeviceFilterAction_Hold */
38
 
    mLbAction->setHidden (mType != VBoxVMSettingsUSB::HostType);
39
 
    mCbAction->setHidden (mType != VBoxVMSettingsUSB::HostType);
40
 
 
41
 
    mLeName->setValidator (new QRegExpValidator (QRegExp (".+"), this));
42
 
    mLeVendorID->setValidator (new QRegExpValidator (QRegExp ("[0-9a-fA-F]{0,4}"), this));
43
 
    mLeProductID->setValidator (new QRegExpValidator (QRegExp ("[0-9a-fA-F]{0,4}"), this));
44
 
    mLeRevision->setValidator (new QRegExpValidator (QRegExp ("[0-9]{0,4}"), this));
45
 
    mLePort->setValidator (new QRegExpValidator (QRegExp ("[0-9]*"), this));
46
 
 
47
 
    /* Applying language settings */
48
 
    retranslateUi();
49
 
 
50
 
    resize (minimumSize());
51
 
    setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
52
 
}
53
 
 
54
 
void VBoxVMSettingsUSBFilterDetails::retranslateUi()
55
 
{
56
 
    /* Translate uic generated strings */
57
 
    Ui::VBoxVMSettingsUSBFilterDetails::retranslateUi (this);
58
 
 
59
 
    mCbRemote->setItemText (VBoxVMSettingsUSB::ModeAny, tr ("Any", "remote"));
60
 
    mCbRemote->setItemText (VBoxVMSettingsUSB::ModeOn,  tr ("Yes", "remote"));
61
 
    mCbRemote->setItemText (VBoxVMSettingsUSB::ModeOff, tr ("No",  "remote"));
62
 
 
63
 
    mCbAction->setItemText (0,
64
 
        vboxGlobal().toString (KUSBDeviceFilterAction_Ignore));
65
 
    mCbAction->setItemText (1,
66
 
        vboxGlobal().toString (KUSBDeviceFilterAction_Hold));
67
 
}
68