VirtualBox

Changeset 34329 in vbox for trunk


Ignore:
Timestamp:
Nov 24, 2010 3:18:40 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: Machine settings / Storage page: Rework for 5370.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r34275 r34329  
    381381        src/selector/UIVMDesktop.cpp \
    382382        src/settings/UISettingsDialogSpecific.cpp \
     383        src/settings/machine/UIMachineSettingsStorage.cpp \
    383384        src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp \
    384385        src/runtime/UIActionsPool.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp

    r34132 r34329  
    12861286}
    12871287
    1288 int VBoxProblemReporter::confirmRunNewHDWzdOrOFD (KDeviceType aDeviceType)
    1289 {
    1290     switch (aDeviceType)
    1291     {
    1292         case KDeviceType_HardDisk:
    1293             return message (QApplication::activeWindow(), Info,
    1294                             tr ("<p>There are no unused medium available for the newly "
    1295                                 "created attachment.</p>"
    1296                                 "<p>Press the <b>Create</b> button to start the <i>New "
    1297                                 "Virtual Disk</i> wizard and create a new medium, "
    1298                                 "or press the <b>Select</b> if you wish to open existing "
    1299                                 "medium using file-open dialog.</p>"),
    1300                             0, /* aAutoConfirmId */
    1301                             QIMessageBox::Yes,
    1302                             QIMessageBox::No | QIMessageBox::Default,
    1303                             QIMessageBox::Cancel | QIMessageBox::Escape,
    1304                             tr ("&Create", "medium"),
    1305                             tr ("&Select", "medium"));
    1306         default:
    1307             return message (QApplication::activeWindow(), Info,
    1308                             tr ("<p>There are no unused medium available for the newly "
    1309                                 "created attachment.</p>"
    1310                                 "<p>Press the <b>Select</b> if you wish to open existing "
    1311                                 "medium using file-open dialog.</p>"),
    1312                             0, /* aAutoConfirmId */
    1313                             QIMessageBox::No | QIMessageBox::Default,
    1314                             QIMessageBox::Cancel | QIMessageBox::Escape,
    1315                             0,
    1316                             tr ("&Select", "medium"));
    1317     }
    1318     return QIMessageBox::Cancel;
     1288int VBoxProblemReporter::askAboutHardDiskAttachmentCreation(QWidget *pParent,
     1289                                                            const QString &strControllerName)
     1290{
     1291    return message(pParent, Question,
     1292                   tr("<p>You are about to add a virtual hard disk to controller <b>%1</b>.</p>"
     1293                      "<p>Would you like to create a new, empty disk or select an existing one? "
     1294                      "You will be able to change the attached disk again at a later time "
     1295                      "if you wish using the button on the <b>Attributes</b> pane.</p>")
     1296                      .arg(strControllerName),
     1297                   0, /* aAutoConfirmId */
     1298                   QIMessageBox::Yes,
     1299                   QIMessageBox::No,
     1300                   QIMessageBox::Cancel | QIMessageBox::Default | QIMessageBox::Escape,
     1301                   tr("Create &new disk", "add attachment routine"),
     1302                   tr("&Choose existing disk", "add attachment routine"));
     1303}
     1304
     1305int VBoxProblemReporter::askAboutOpticalAttachmentCreation(QWidget *pParent,
     1306                                                           const QString &strControllerName)
     1307{
     1308    return message(pParent, Question,
     1309                   tr("<p>You are about to add a new CD/DVD drive to controller <b>%1</b>.</p>"
     1310                      "<p>Would you like to choose a virtual CD/DVD disk to insert into the drive "
     1311                      "or to leave it empty for now? "
     1312                      "You will be able to change the disk inserted later or pass through a physical disk "
     1313                      "using the button on the <b>Attributes</b> pane or while the machine is running using the <b>Device</b> menu.</p>")
     1314                      .arg(strControllerName),
     1315                   0, /* aAutoConfirmId */
     1316                   QIMessageBox::Yes,
     1317                   QIMessageBox::No,
     1318                   QIMessageBox::Cancel | QIMessageBox::Default | QIMessageBox::Escape,
     1319                   tr("&Choose disk", "add attachment routine"),
     1320                   tr("Leave &empty", "add attachment routine"));
     1321}
     1322
     1323int VBoxProblemReporter::askAboutFloppyAttachmentCreation(QWidget *pParent,
     1324                                                          const QString &strControllerName)
     1325{
     1326    return message(pParent, Question,
     1327                   tr("<p>You are about to add a new floppy drive to controller <b>%1</b>.</p>"
     1328                      "<p>Would you like to choose a virtual floppy disk to insert into the drive "
     1329                      "or to leave it empty for now? "
     1330                      "You will be able to change the disk inserted later or pass through a physical disk "
     1331                      "using the button on the <b>Attributes</b> pane or while the machine is running using the <b>Device</b> menu.</p>")
     1332                      .arg(strControllerName),
     1333                   0, /* aAutoConfirmId */
     1334                   QIMessageBox::Yes,
     1335                   QIMessageBox::No,
     1336                   QIMessageBox::Cancel | QIMessageBox::Default | QIMessageBox::Escape,
     1337                   tr("&Choose disk", "add attachment routine"),
     1338                   tr("Leave &empty", "add attachment routine"));
    13191339}
    13201340
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h

    r34069 r34329  
    260260    int confirmDetachAddControllerSlots (QWidget *aParent) const;
    261261    int confirmChangeAddControllerSlots (QWidget *aParent) const;
    262     int confirmRunNewHDWzdOrOFD (KDeviceType aDeviceType);
     262
     263    int askAboutHardDiskAttachmentCreation(QWidget *pParent, const QString &strControllerName);
     264    int askAboutOpticalAttachmentCreation(QWidget *pParent, const QString &strControllerName);
     265    int askAboutFloppyAttachmentCreation(QWidget *pParent, const QString &strControllerName);
    263266
    264267    int confirmRemovingOfLastDVDDevice() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r33932 r34329  
    3636#include <QTimer>
    3737#include <QCommonStyle>
    38 
    39 /* String Tags */
    40 const char *firstAvailableId = "first available";
    4138
    4239/* Type converters */
     
    133130    mPool [FDAttachmentAddDis]       = QPixmap (":/fd_add_disabled_16px.png");
    134131
    135     mPool [VMMEn]                    = QPixmap (":/select_file_16px.png");
    136     mPool [VMMDis]                   = QPixmap (":/select_file_dis_16px.png");
     132    mPool [ChooseExistingEn]         = QPixmap (":/select_file_16px.png");
     133    mPool [ChooseExistingDis]        = QPixmap (":/select_file_dis_16px.png");
     134    mPool [HDNewEn]                  = QPixmap (":/hd_new_16px.png");
     135    mPool [HDNewDis]                 = QPixmap (":/hd_new_disabled_16px.png");
     136    mPool [CDUnmountEnabled]         = QPixmap (":/cd_unmount_16px.png");
     137    mPool [CDUnmountDisabled]        = QPixmap (":/cd_unmount_dis_16px.png");
     138    mPool [FDUnmountEnabled]         = QPixmap (":/fd_unmount_16px.png");
     139    mPool [FDUnmountDisabled]        = QPixmap (":/fd_unmount_dis_16px.png");
    137140}
    138141
     
    406409    , mCtrName (aName)
    407410    , mCtrType (0)
     411    , mUseIoCache (false)
    408412{
    409413    /* Check for proper parent type */
     
    506510}
    507511
    508 QStringList ControllerItem::ctrAllMediumIds (bool aShowDiffs) const
    509 {
    510     QStringList allMediums;
    511     foreach (const VBoxMedium &medium, vboxGlobal().currentMediaList())
    512     {
    513          foreach (const KDeviceType &deviceType, mCtrType->deviceTypeList())
    514          {
    515              if (medium.isNull() || medium.medium().GetDeviceType() == deviceType)
    516              {
    517                  /* In 'don't show diffs' mode we should only show hard-disks which are:
    518                   * 1. Attached to 'current state' of this VM even if these are differencing disks.
    519                   * 2. Not attached to this VM at all only if they are not differencing disks. */
    520                  if (!aShowDiffs && medium.type() == VBoxDefs::MediumType_HardDisk)
    521                  {
    522                      if (medium.isAttachedInCurStateTo (parent()->machineId()) ||
    523                          (!medium.medium().GetMachineIds().contains (parent()->machineId()) && !medium.parent()))
    524                          allMediums << medium.id();
    525                  }
    526                  else allMediums << medium.id();
    527                  break;
    528              }
    529          }
    530     }
    531     return allMediums;
    532 }
    533 
    534 QStringList ControllerItem::ctrUsedMediumIds() const
    535 {
    536     QStringList usedImages;
    537     for (int i = 0; i < mAttachments.size(); ++ i)
    538     {
    539         QString usedMediumId = static_cast <AttachmentItem*> (mAttachments [i])->attMediumId();
    540         if (!vboxGlobal().findMedium (usedMediumId).isNull())
    541             usedImages << usedMediumId;
    542     }
    543     return usedImages;
    544 }
    545 
    546512AbstractItem::ItemType ControllerItem::rtti() const
    547513{
     
    606572    : AbstractItem (aParent)
    607573    , mAttDeviceType (aDeviceType)
    608     , mAttIsShowDiffs (false)
    609574    , mAttIsHostDrive (false)
    610575    , mAttIsPassthrough (false)
     
    616581    AssertMsg (!attSlots().isEmpty(), ("There should be at least one available slot!\n"));
    617582    mAttSlot = attSlots() [0];
    618 
    619     /* Try to select unique medium for HD and empty medium for CD/FD device */
    620     QStringList freeMediumIds (attMediumIds());
    621     if (freeMediumIds.size() > 0)
    622         setAttMediumId (freeMediumIds [0]);
    623583}
    624584
     
    657617}
    658618
    659 QStringList AttachmentItem::attMediumIds (bool aFilter) const
    660 {
    661     ControllerItem *ctr = static_cast <ControllerItem*> (mParent);
    662     QStringList allMediumIds;
    663 
    664     /* Populate list of suitable medium ids */
    665     foreach (QString mediumId, ctr->ctrAllMediumIds (mAttIsShowDiffs))
    666     {
    667         VBoxMedium medium = vboxGlobal().findMedium (mediumId);
    668         if ((medium.isNull() && mAttDeviceType != KDeviceType_HardDisk) ||
    669             (!medium.isNull() && medium.medium().GetDeviceType() == mAttDeviceType))
    670             allMediumIds << mediumId;
    671     }
    672 
    673     if (aFilter)
    674     {
    675         /* Filter list from used medium ids */
    676         QStringList usedMediumIds (ctr->ctrUsedMediumIds());
    677         foreach (QString usedMediumId, usedMediumIds)
    678             if (usedMediumId != mAttMediumId)
    679                 allMediumIds.removeAll (usedMediumId);
    680     }
    681 
    682     return allMediumIds;
    683 }
    684 
    685 bool AttachmentItem::attIsShowDiffs() const
    686 {
    687     return mAttIsShowDiffs;
    688 }
    689 
    690619bool AttachmentItem::attIsHostDrive() const
    691620{
     
    710639void AttachmentItem::setAttMediumId (const QString &aAttMediumId)
    711640{
    712     VBoxMedium medium;
    713 
    714     /* Caching first available medium */
    715     if (aAttMediumId == firstAvailableId && !attMediumIds (false).isEmpty())
    716         medium = vboxGlobal().findMedium (attMediumIds (false) [0]);
    717     /* Caching passed medium */
    718     else if (!aAttMediumId.isEmpty())
    719         medium = vboxGlobal().findMedium (aAttMediumId);
    720 
    721     mAttMediumId = medium.id();
     641    AssertMsg(!aAttMediumId.isEmpty(), ("Medium ID value can't be null/empty!\n"));
     642    mAttMediumId = vboxGlobal().findMedium(aAttMediumId).id();
    722643    cache();
    723644}
    724645
    725 void AttachmentItem::setAttIsShowDiffs (bool aAttIsShowDiffs)
    726 {
    727     mAttIsShowDiffs = aAttIsShowDiffs;
    728     cache();
    729 }
    730 
    731646void AttachmentItem::setAttIsPassthrough (bool aIsAttPassthrough)
    732647{
     
    764679
    765680    /* Cache medium information */
    766     mAttName = medium.name (!mAttIsShowDiffs);
    767     mAttTip = medium.toolTipCheckRO (!mAttIsShowDiffs, mAttDeviceType != KDeviceType_HardDisk);
    768     mAttPixmap = medium.iconCheckRO (!mAttIsShowDiffs);
     681    mAttName = medium.name (true);
     682    mAttTip = medium.toolTipCheckRO (true, mAttDeviceType != KDeviceType_HardDisk);
     683    mAttPixmap = medium.iconCheckRO (true);
    769684    mAttIsHostDrive = medium.isHostDrive();
    770685
    771686    /* Cache additional information */
    772     mAttSize = medium.size (!mAttIsShowDiffs);
    773     mAttLogicalSize = medium.logicalSize (!mAttIsShowDiffs);
    774     mAttLocation = medium.location (!mAttIsShowDiffs);
    775     mAttFormat = medium.isNull() ? QString ("--") :
    776         QString ("%1 (%2)").arg (medium.hardDiskType (!mAttIsShowDiffs))
    777                            .arg (medium.hardDiskFormat (!mAttIsShowDiffs));
    778     mAttUsage = medium.usage (!mAttIsShowDiffs);
     687    mAttSize = medium.size (true);
     688    mAttLogicalSize = medium.logicalSize (true);
     689    mAttLocation = medium.location (true);
     690    if (medium.isNull())
     691    {
     692        mAttFormat = QString("--");
     693    }
     694    else
     695    {
     696        switch (mAttDeviceType)
     697        {
     698            case KDeviceType_HardDisk:
     699            {
     700                mAttFormat = QString("%1 (%2)").arg(medium.hardDiskType(true)).arg(medium.hardDiskFormat(true));
     701                break;
     702            }
     703            case KDeviceType_DVD:
     704            case KDeviceType_Floppy:
     705            {
     706                mAttFormat = mAttIsHostDrive ? UIMachineSettingsStorage::tr("Host Drive") : UIMachineSettingsStorage::tr("Image");
     707                break;
     708            }
     709            default:
     710                break;
     711        }
     712    }
     713    mAttUsage = medium.usage (true);
    779714
    780715    /* Fill empty attributes */
     
    11381073            return QString();
    11391074        }
    1140         case R_AttIsShowDiffs:
    1141         {
    1142             if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
    1143                 if (item->rtti() == AbstractItem::Type_AttachmentItem)
    1144                     return static_cast <AttachmentItem*> (item)->attIsShowDiffs();
    1145             return false;
    1146         }
    11471075        case R_AttIsHostDrive:
    11481076        {
     
    13501278            return false;
    13511279        }
    1352         case R_AttIsShowDiffs:
    1353         {
    1354             if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
    1355                 if (item->rtti() == AbstractItem::Type_AttachmentItem)
    1356                 {
    1357                     static_cast <AttachmentItem*> (item)->setAttIsShowDiffs (aValue.toBool());
    1358                     emit dataChanged (aIndex, aIndex);
    1359                     return true;
    1360                 }
    1361             return false;
    1362         }
    13631280        case R_AttIsPassthrough:
    13641281        {
     
    13981315}
    13991316
    1400 QModelIndex StorageModel::addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType)
     1317QModelIndex StorageModel::addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, const QString &strMediumId)
    14011318{
    14021319    if (AbstractItem *parent = mRootItem->childById (aCtrId))
     
    14051322        QModelIndex parentIndex = index (parentPosition, 0, root());
    14061323        beginInsertRows (parentIndex, parent->childCount(), parent->childCount());
    1407         new AttachmentItem (parent, aDeviceType);
     1324        AttachmentItem *pItem = new AttachmentItem (parent, aDeviceType);
     1325        pItem->setAttMediumId(strMediumId);
    14081326        endInsertRows();
    14091327        return index (parent->childCount() - 1, 0, parentIndex);
     
    16531571
    16541572/**
     1573 * UI Medium ID Holder.
     1574 * Used for compliance with other storage page widgets
     1575 * which caching and holding corresponding information.
     1576 */
     1577class UIMediumIDHolder : public QObject
     1578{
     1579    Q_OBJECT;
     1580   
     1581public:
     1582
     1583    UIMediumIDHolder(QWidget *pParent) : QObject(pParent) {}
     1584
     1585    QString id() const { return m_strId; }
     1586    void setId(const QString &strId) { m_strId = strId; emit sigChanged(); }
     1587
     1588    VBoxDefs::MediumType type() const { return m_type; }
     1589    void setType(VBoxDefs::MediumType type) { m_type = type; }
     1590
     1591    bool isNull() const { return m_strId == VBoxMedium().id(); }
     1592
     1593signals:
     1594
     1595    void sigChanged();
     1596
     1597private:
     1598
     1599    QString m_strId;
     1600    VBoxDefs::MediumType m_type;
     1601};
     1602
     1603/**
    16551604 * QWidget class reimplementation.
    16561605 * Used as HD Settings widget.
     
    16631612    , mAddAttAction(0), mDelAttAction(0)
    16641613    , mAddHDAttAction(0), mAddCDAttAction(0), mAddFDAttAction(0)
     1614    , m_pMediumIdHolder(new UIMediumIDHolder(this))
    16651615    , mIsLoadingInProgress(0)
    16661616    , mIsPolished(false)
     
    17511701#endif /* Q_WS_MAC */
    17521702
    1753     /* Vdi Combo */
    1754     mCbVdi->setNullItemPresent (true);
    1755     mCbVdi->refresh();
    1756 
    1757     /* Vmm Button */
    1758     mTbOpen->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::VMMEn),
    1759                                         PixmapPool::pool()->pixmap (PixmapPool::VMMDis)));
    1760     mTbNew->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::HDAttachmentAddEn),
    1761                                         PixmapPool::pool()->pixmap (PixmapPool::HDAttachmentAddDis)));
     1703    /* Setup choose-medium button: */
     1704    QMenu *pOpenMediumMenu = new QMenu(this);
     1705    mTbOpen->setMenu(pOpenMediumMenu);
    17621706
    17631707    /* Info Pane initialization */
     1708    mLbHDFormatValue->setFullSizeSelection (true);
     1709    mLbCDFDTypeValue->setFullSizeSelection (true);
    17641710    mLbHDVirtualSizeValue->setFullSizeSelection (true);
    17651711    mLbHDActualSizeValue->setFullSizeSelection (true);
    17661712    mLbSizeValue->setFullSizeSelection (true);
    17671713    mLbLocationValue->setFullSizeSelection (true);
    1768     mLbHDFormatValue->setFullSizeSelection (true);
    17691714    mLbUsageValue->setFullSizeSelection (true);
    17701715
     
    18081753    connect (mCbSlot, SIGNAL (activated (int)), this, SLOT (setInformation()));
    18091754    connect (mCbIoCache, SIGNAL (stateChanged (int)), this, SLOT (setInformation()));
    1810     connect (mCbVdi, SIGNAL (activated (int)), this, SLOT (setInformation()));
    1811     connect (mTbOpen, SIGNAL (clicked (bool)), this, SLOT (sltOpenMedium()));
    1812     connect (mTbNew, SIGNAL (clicked (bool)), this, SLOT (sltNewMedium()));
    1813     connect (mCbShowDiffs, SIGNAL (stateChanged (int)), this, SLOT (setInformation()));
     1755    connect (m_pMediumIdHolder, SIGNAL (sigChanged()), this, SLOT (setInformation()));
     1756    connect (mTbOpen, SIGNAL (clicked (bool)), mTbOpen, SLOT (showMenu()));
     1757    connect (pOpenMediumMenu, SIGNAL (aboutToShow()), this, SLOT (sltPrepareOpenMediumMenu()));
    18141758    connect (mCbPassthrough, SIGNAL (stateChanged (int)), this, SLOT (setInformation()));
    18151759
     
    18921836{
    18931837    /* Apply internal variables data to QWidget(s): */
    1894     mCbVdi->setMachineId(m_cache.m_strMachineId);
    18951838    mStorageModel->setMachineId(m_cache.m_strMachineId);
    18961839    for (int iControllerIndex = 0; iControllerIndex < m_cache.m_items.size(); ++iControllerIndex)
     
    19071850            /* Get iterated attachment: */
    19081851            const UIStorageAttachmentData &attachmentData = controllerData.m_items[iAttachmentIndex];
    1909             QModelIndex attachmentIndex = mStorageModel->addAttachment(controllerId, attachmentData.m_attachmentType);
     1852            QModelIndex attachmentIndex = mStorageModel->addAttachment(controllerId, attachmentData.m_attachmentType, attachmentData.m_strAttachmentMediumId);
    19101853            StorageSlot attachmentStorageSlot(controllerData.m_controllerBus,
    19111854                                              attachmentData.m_iAttachmentPort,
     
    19131856            mStorageModel->setData(attachmentIndex, QVariant::fromValue(attachmentStorageSlot), StorageModel::R_AttSlot);
    19141857            mStorageModel->setData(attachmentIndex, attachmentData.m_fAttachmentPassthrough, StorageModel::R_AttIsPassthrough);
    1915             mStorageModel->setData(attachmentIndex, attachmentData.m_strAttachmentMediumId, StorageModel::R_AttMediumId);
    19161858        }
    19171859    }
     
    21192061        /* Second column indent minimum width */
    21202062        QList <QLabel*> labelsList;
    2121         labelsList << mLbSlot << mLbVdi
     2063        labelsList << mLbMedium << mLbHDFormat << mLbCDFDType
    21222064                   << mLbHDVirtualSize << mLbHDActualSize << mLbSize
    2123                    << mLbLocation << mLbHDFormat << mLbUsage;
     2065                   << mLbLocation << mLbUsage;
    21242066        int maxWidth = 0;
    21252067        QFontMetrics metrics (font());
     
    21662108            if (attMediumId == aMediumId)
    21672109            {
    2168                 mStorageModel->setData (attIndex, firstAvailableId, StorageModel::R_AttMediumId);
     2110                mStorageModel->setData (attIndex, VBoxMedium().id(), StorageModel::R_AttMediumId);
    21692111                if (mValidator) mValidator->revalidate();
    21702112            }
     
    23452287                mCbSlot->setToolTip (mCbSlot->itemText (mCbSlot->currentIndex()));
    23462288
    2347                 /* Getting Show Diffs state */
    2348                 bool isShowDiffs = mStorageModel->data (index, StorageModel::R_AttIsShowDiffs).toBool();
    2349                 mCbShowDiffs->setChecked (isShowDiffs);
    2350 
    23512289                /* Getting Attachment Medium */
    23522290                KDeviceType device = mStorageModel->data (index, StorageModel::R_AttDevice).value <KDeviceType>();
     
    23542292                {
    23552293                    case KDeviceType_HardDisk:
    2356                         mLbVdi->setText(tr("Hard &Disk:"));
    2357                         mTbOpen->setWhatsThis(tr("Open hard disk image file using file-open dialog."));
    2358                         mTbOpen->setToolTip(tr("Open hard disk image file"));
    2359                         mTbNew->setVisible(true);
     2294                        mLbMedium->setText(tr("Hard &Disk:"));
     2295                        mTbOpen->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap(PixmapPool::HDAttachmentNormal)));
     2296                        mTbOpen->setWhatsThis(tr("Choose or create a virtual hard disk file. The virtual machine will see "
     2297                                                 "the data in the file as the contents of the virtual hard disk."));
     2298                        mTbOpen->setToolTip(tr("Set up the virtual hard disk"));
    23602299                        break;
    23612300                    case KDeviceType_DVD:
    2362                         mLbVdi->setText(tr("&CD/DVD Device:"));
    2363                         mTbOpen->setWhatsThis(tr("Open CD/DVD image file using file-open dialog."));
    2364                         mTbOpen->setToolTip(tr("Open CD/DVD image file"));
    2365                         mTbNew->setVisible(false);
     2301                        mLbMedium->setText(tr("CD/DVD &Drive:"));
     2302                        mTbOpen->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap(PixmapPool::CDAttachmentNormal)));
     2303                        mTbOpen->setWhatsThis(tr("Choose a virtual CD/DVD disk or a physical drive to use with the virtual drive. "
     2304                                                 "The virtual machine will see a disk inserted into the drive with the data "
     2305                                                 "in the file or on the disk in the physical drive as its contents."));
     2306                        mTbOpen->setToolTip(tr("Set up the virtual CD/DVD drive"));
    23662307                        break;
    23672308                    case KDeviceType_Floppy:
    2368                         mLbVdi->setText(tr("&Floppy Device:"));
    2369                         mTbOpen->setWhatsThis(tr("Open floppy image file using file-open dialog."));
    2370                         mTbOpen->setToolTip(tr("Open floppy image file"));
    2371                         mTbNew->setVisible(false);
     2309                        mLbMedium->setText(tr("Floppy &Drive:"));
     2310                        mTbOpen->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap(PixmapPool::FDAttachmentNormal)));
     2311                        mTbOpen->setWhatsThis(tr("Choose a virtual floppy disk or a physical drive to use with the virtual drive. "
     2312                                                 "The virtual machine will see a disk inserted into the drive with the data "
     2313                                                 "in the file or on the disk in the physical drive as its contents."));
     2314                        mTbOpen->setToolTip(tr("Set up the virtual floppy drive"));
    23722315                        break;
    23732316                    default:
    23742317                        break;
    23752318                }
    2376                 mCbVdi->setType (typeToLocal (device));
    2377                 mCbVdi->setShowDiffs (isShowDiffs);
    2378                 mCbVdi->setCurrentItem (mStorageModel->data (index, StorageModel::R_AttMediumId).toString());
    2379                 mCbVdi->refresh();
     2319                m_pMediumIdHolder->setType(typeToLocal(device));
     2320                m_pMediumIdHolder->setId(mStorageModel->data(index, StorageModel::R_AttMediumId).toString());
    23802321
    23812322                /* Getting Passthrough state */
    23822323                bool isHostDrive = mStorageModel->data (index, StorageModel::R_AttIsHostDrive).toBool();
    2383                 mCbPassthrough->setEnabled (isHostDrive);
     2324                mCbPassthrough->setVisible (device == KDeviceType_DVD && isHostDrive);
    23842325                mCbPassthrough->setChecked (isHostDrive && mStorageModel->data (index, StorageModel::R_AttIsPassthrough).toBool());
    23852326
     
    23882329
    23892330                /* Getting Other Information */
     2331                mLbHDFormatValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttFormat).toString()));
     2332                mLbCDFDTypeValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttFormat).toString()));
    23902333                mLbHDVirtualSizeValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttLogicalSize).toString()));
    23912334                mLbHDActualSizeValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttSize).toString()));
    23922335                mLbSizeValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttSize).toString()));
    23932336                mLbLocationValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttLocation).toString()));
    2394                 mLbHDFormatValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttFormat).toString()));
    23952337                mLbUsageValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttUsage).toString()));
    23962338
     
    24432385            }
    24442386            /* Setting Attachment Medium */
    2445             else if (sdr == mCbVdi)
    2446                 mStorageModel->setData (index, mCbVdi->id(), StorageModel::R_AttMediumId);
    2447             else if (sdr == mCbShowDiffs)
    2448                 mStorageModel->setData (index, mCbShowDiffs->isChecked(), StorageModel::R_AttIsShowDiffs);
     2387            else if (sdr == m_pMediumIdHolder)
     2388                mStorageModel->setData (index, m_pMediumIdHolder->id(), StorageModel::R_AttMediumId);
    24492389            else if (sdr == mCbPassthrough)
    24502390            {
     
    24622402}
    24632403
    2464 void UIMachineSettingsStorage::sltOpenMedium()
    2465 {
    2466     QString id = vboxGlobal().openMediumWithFileOpenDialog(mCbVdi->type(), this);
    2467     if (!id.isNull())
    2468         mCbVdi->setCurrentItem(id);
    2469 }
    2470 
    2471 void UIMachineSettingsStorage::sltNewMedium()
    2472 {
    2473     QString id = getWithNewHDWizard();
    2474     if (!id.isNull())
    2475         mCbVdi->setCurrentItem (id);
     2404void UIMachineSettingsStorage::sltPrepareOpenMediumMenu()
     2405{
     2406    /* This slot should be called only by open-medium menu: */
     2407    QMenu *pOpenMediumMenu = qobject_cast<QMenu*>(sender());
     2408    AssertMsg(pOpenMediumMenu, ("Can't access open-medium menu!\n"));
     2409    if (pOpenMediumMenu)
     2410    {
     2411        /* Eraze menu initially: */
     2412        pOpenMediumMenu->clear();
     2413        /* Depending on current medium type: */
     2414        switch (m_pMediumIdHolder->type())
     2415        {
     2416            case VBoxDefs::MediumType_HardDisk:
     2417            {
     2418                /* Add "Create a new virtual hard disk" action: */
     2419                QAction *pCreateNewHardDisk = pOpenMediumMenu->addAction(tr("Create a new hard disk..."));
     2420                pCreateNewHardDisk->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap(PixmapPool::HDNewEn),
     2421                                                                PixmapPool::pool()->pixmap(PixmapPool::HDNewDis)));
     2422                connect(pCreateNewHardDisk, SIGNAL(triggered(bool)), this, SLOT(sltCreateNewHardDisk()));
     2423                /* Add "Choose a virtual hard disk file" action: */
     2424                addChooseExistingMediumAction(pOpenMediumMenu, tr("Choose a virtual hard disk file..."));
     2425                break;
     2426            }
     2427            case VBoxDefs::MediumType_DVD:
     2428            {
     2429                /* Add "Choose a virtual CD/DVD disk file" action: */
     2430                addChooseExistingMediumAction(pOpenMediumMenu, tr("Choose a CD/DVD disk image..."));
     2431                /* Add "Choose a physical drive" actions: */
     2432                addChooseHostDriveActions(pOpenMediumMenu);
     2433                /* Add "Eject current medium" action: */
     2434                pOpenMediumMenu->addSeparator();
     2435                QAction *pEjectCurrentMedium = pOpenMediumMenu->addAction(tr("Remove disk from virtual drive"));
     2436                pEjectCurrentMedium->setEnabled(!m_pMediumIdHolder->isNull());
     2437                pEjectCurrentMedium->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap(PixmapPool::CDUnmountEnabled),
     2438                                                                 PixmapPool::pool()->pixmap(PixmapPool::CDUnmountDisabled)));
     2439                connect(pEjectCurrentMedium, SIGNAL(triggered(bool)), this, SLOT(sltUnmountDevice()));
     2440                break;
     2441            }
     2442            case VBoxDefs::MediumType_Floppy:
     2443            {
     2444                /* Add "Choose a virtual floppy disk file" action: */
     2445                addChooseExistingMediumAction(pOpenMediumMenu, tr("Choose a floppy disk image..."));
     2446                /* Add "Choose a physical drive" actions: */
     2447                addChooseHostDriveActions(pOpenMediumMenu);
     2448                /* Add "Eject current medium" action: */
     2449                pOpenMediumMenu->addSeparator();
     2450                QAction *pEjectCurrentMedium = pOpenMediumMenu->addAction(tr("Remove disk from virtual drive"));
     2451                pEjectCurrentMedium->setEnabled(!m_pMediumIdHolder->isNull());
     2452                pEjectCurrentMedium->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap(PixmapPool::FDUnmountEnabled),
     2453                                                                 PixmapPool::pool()->pixmap(PixmapPool::FDUnmountDisabled)));
     2454                connect(pEjectCurrentMedium, SIGNAL(triggered(bool)), this, SLOT(sltUnmountDevice()));
     2455                break;
     2456            }
     2457            default:
     2458                break;
     2459        }
     2460    }
     2461}
     2462
     2463void UIMachineSettingsStorage::sltCreateNewHardDisk()
     2464{
     2465    QString strMediumId = getWithNewHDWizard();
     2466    if (!strMediumId.isNull())
     2467        m_pMediumIdHolder->setId(strMediumId);
     2468}
     2469
     2470void UIMachineSettingsStorage::sltUnmountDevice()
     2471{
     2472    m_pMediumIdHolder->setId(VBoxMedium().id());
     2473}
     2474
     2475void UIMachineSettingsStorage::sltChooseExistingMedium()
     2476{
     2477    QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(m_pMediumIdHolder->type(), this);
     2478    if (!strMediumId.isNull())
     2479        m_pMediumIdHolder->setId(strMediumId);
     2480}
     2481
     2482void UIMachineSettingsStorage::sltChooseHostDrive()
     2483{
     2484    /* This slot should be called ONLY by choose-host-drive action: */
     2485    QAction *pChooseHostDriveAction = qobject_cast<QAction*>(sender());
     2486    AssertMsg(pChooseHostDriveAction, ("Can't access choose-host-drive action!\n"));
     2487    if (pChooseHostDriveAction)
     2488        m_pMediumIdHolder->setId(pChooseHostDriveAction->data().toString());
    24762489}
    24772490
     
    25232536            if (!mTwStorageTree->isExpanded (aParent))
    25242537                mTwStorageTree->setExpanded (aParent, true);
    2525 
    2526             /* Check if no medium was selected for this attachment */
    2527             if (mStorageModel->data (index, StorageModel::R_AttMediumId).toString().isEmpty())
    2528             {
    2529                 /* Ask the user for the method to select medium */
    2530                 KDeviceType deviceType = mStorageModel->data (index, StorageModel::R_AttDevice).value <KDeviceType>();
    2531                 int askResult = vboxProblem().confirmRunNewHDWzdOrOFD (deviceType);
    2532                 QString mediumId = askResult == QIMessageBox::Yes ? getWithNewHDWizard() :
    2533                                    askResult == QIMessageBox::No ? vboxGlobal().openMediumWithFileOpenDialog(typeToLocal (deviceType), this) : QString();
    2534                 if (mediumId.isNull())
    2535                     mediumId = firstAvailableId;
    2536                 mStorageModel->setData (index, mediumId, StorageModel::R_AttMediumId);
    2537             }
    25382538            break;
    25392539        }
     
    28012801}
    28022802
    2803 void UIMachineSettingsStorage::addAttachmentWrapper (KDeviceType aDevice)
     2803void UIMachineSettingsStorage::addAttachmentWrapper(KDeviceType deviceType)
    28042804{
    28052805    QModelIndex index = mTwStorageTree->currentIndex();
    2806     Assert (mStorageModel->data (index, StorageModel::R_IsController).toBool());
    2807     Assert (mStorageModel->data (index, StorageModel::R_IsMoreAttachmentsPossible).toBool());
    2808 
    2809     mStorageModel->addAttachment (QUuid (mStorageModel->data (index, StorageModel::R_ItemId).toString()), aDevice);
    2810     mStorageModel->sort();
    2811     emit storageChanged();
    2812     if (mValidator) mValidator->revalidate();
     2806    Assert(mStorageModel->data(index, StorageModel::R_IsController).toBool());
     2807    Assert(mStorageModel->data(index, StorageModel::R_IsMoreAttachmentsPossible).toBool());
     2808    QString strControllerName(mStorageModel->data(index, StorageModel::R_CtrName).toString());
     2809
     2810    QString strMediumId;
     2811    switch (deviceType)
     2812    {
     2813        case KDeviceType_HardDisk:
     2814        {
     2815            int iAnswer = vboxProblem().askAboutHardDiskAttachmentCreation(this, strControllerName);
     2816            if (iAnswer == QIMessageBox::Yes)
     2817                strMediumId = getWithNewHDWizard();
     2818            else if (iAnswer == QIMessageBox::No)
     2819                strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_HardDisk, this);
     2820            break;
     2821        }
     2822        case KDeviceType_DVD:
     2823        {
     2824            int iAnswer = vboxProblem().askAboutOpticalAttachmentCreation(this, strControllerName);
     2825            if (iAnswer == QIMessageBox::Yes)
     2826                strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_DVD, this);
     2827            else if (iAnswer == QIMessageBox::No)
     2828                strMediumId = vboxGlobal().findMedium(strMediumId).id();
     2829            break;
     2830        }
     2831        case KDeviceType_Floppy:
     2832        {
     2833            int iAnswer = vboxProblem().askAboutFloppyAttachmentCreation(this, strControllerName);
     2834            if (iAnswer == QIMessageBox::Yes)
     2835                strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_Floppy, this);
     2836            else if (iAnswer == QIMessageBox::No)
     2837                strMediumId = vboxGlobal().findMedium(strMediumId).id();
     2838            break;
     2839        }
     2840    }
     2841
     2842    if (!strMediumId.isEmpty())
     2843    {
     2844        mStorageModel->addAttachment(QUuid(mStorageModel->data(index, StorageModel::R_ItemId).toString()), deviceType, strMediumId);
     2845        mStorageModel->sort();
     2846        emit storageChanged();
     2847        if (mValidator)
     2848            mValidator->revalidate();
     2849    }
    28132850}
    28142851
     
    28292866void UIMachineSettingsStorage::updateAdditionalObjects (KDeviceType aType)
    28302867{
    2831     mCbShowDiffs->setVisible (aType == KDeviceType_HardDisk);
    2832     mCbPassthrough->setVisible (aType == KDeviceType_DVD);
     2868    mLbHDFormat->setVisible (aType == KDeviceType_HardDisk);
     2869    mLbHDFormatValue->setVisible (aType == KDeviceType_HardDisk);
     2870
     2871    mLbCDFDType->setVisible (aType != KDeviceType_HardDisk);
     2872    mLbCDFDTypeValue->setVisible (aType != KDeviceType_HardDisk);
    28332873
    28342874    mLbHDVirtualSize->setVisible (aType == KDeviceType_HardDisk);
     
    28402880    mLbSize->setVisible (aType != KDeviceType_HardDisk);
    28412881    mLbSizeValue->setVisible (aType != KDeviceType_HardDisk);
    2842 
    2843     mLbHDFormat->setVisible (aType == KDeviceType_HardDisk);
    2844     mLbHDFormatValue->setVisible (aType == KDeviceType_HardDisk);
    28452882}
    28462883
     
    28832920}
    28842921
     2922void UIMachineSettingsStorage::addChooseExistingMediumAction(QMenu *pOpenMediumMenu, const QString &strActionName)
     2923{
     2924    QAction *pChooseExistingMedium = pOpenMediumMenu->addAction(strActionName);
     2925    pChooseExistingMedium->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap(PixmapPool::ChooseExistingEn),
     2926                                                       PixmapPool::pool()->pixmap(PixmapPool::ChooseExistingDis)));
     2927    connect(pChooseExistingMedium, SIGNAL(triggered(bool)), this, SLOT(sltChooseExistingMedium()));
     2928}
     2929
     2930void UIMachineSettingsStorage::addChooseHostDriveActions(QMenu *pOpenMediumMenu)
     2931{
     2932    const VBoxMediaList &mediums = vboxGlobal().currentMediaList();
     2933    VBoxMediaList::const_iterator it;
     2934    for (it = mediums.begin(); it != mediums.end(); ++it)
     2935    {
     2936        const VBoxMedium &medium = *it;
     2937        if (medium.isHostDrive() && m_pMediumIdHolder->type() == medium.type())
     2938        {
     2939            QAction *pHostDriveAction = pOpenMediumMenu->addAction(medium.name());
     2940            pHostDriveAction->setData(medium.id());
     2941            connect(pHostDriveAction, SIGNAL(triggered(bool)), this, SLOT(sltChooseHostDrive()));
     2942        }
     2943    }
     2944}
     2945
     2946#include "UIMachineSettingsStorage.moc"
     2947
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h

    r33932 r34329  
    3939class AttachmentItem;
    4040class ControllerItem;
     41class UIMediumIDHolder;
    4142
    4243/* Internal Types */
     
    110111        FDAttachmentAddDis       = 36,
    111112
    112         VMMEn                    = 37,
    113         VMMDis                   = 38,
     113        ChooseExistingEn         = 37,
     114        ChooseExistingDis        = 38,
     115        HDNewEn                  = 39,
     116        HDNewDis                 = 40,
     117        CDUnmountEnabled         = 41,
     118        CDUnmountDisabled        = 42,
     119        FDUnmountEnabled         = 43,
     120        FDUnmountDisabled        = 44,
    114121
    115122        MaxIndex
     
    313320    SlotsList ctrUsedSlots() const;
    314321    DeviceTypeList ctrDeviceTypeList() const;
    315     QStringList ctrAllMediumIds (bool aShowDiffs) const;
    316     QStringList ctrUsedMediumIds() const;
    317322
    318323    void setAttachments(const QList<AbstractItem*> &attachments) { mAttachments = attachments; }
     
    349354    DeviceTypeList attDeviceTypes() const;
    350355    QString attMediumId() const;
    351     QStringList attMediumIds (bool aFilter = true) const;
    352     bool attIsShowDiffs() const;
    353356    bool attIsHostDrive() const;
    354357    bool attIsPassthrough() const;
     
    357360    void setAttDevice (KDeviceType aAttDeviceType);
    358361    void setAttMediumId (const QString &aAttMediumId);
    359     void setAttIsShowDiffs (bool aAttIsShowDiffs);
    360362    void setAttIsPassthrough (bool aPassthrough);
    361363
     
    490492    void delController (const QUuid &aCtrId);
    491493
    492     QModelIndex addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType);
     494    QModelIndex addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, const QString &strMediumId);
    493495    void delAttachment (const QUuid &aCtrId, const QUuid &aAttId);
    494496
     
    630632    void setInformation();
    631633
    632     void sltOpenMedium();
    633     void sltNewMedium();
     634    void sltPrepareOpenMediumMenu();
     635    void sltCreateNewHardDisk();
     636    void sltUnmountDevice();
     637    void sltChooseExistingMedium();
     638    void sltChooseHostDrive();
    634639
    635640    void updateActionsState();
     
    659664
    660665    uint32_t deviceCount (KDeviceType aType) const;
     666
     667    void addChooseExistingMediumAction(QMenu *pOpenMediumMenu, const QString &strActionName);
     668    void addChooseHostDriveActions(QMenu *pOpenMediumMenu);
    661669
    662670    QIWidgetValidator *mValidator;
     
    677685    QAction *mAddFDAttAction;
    678686
     687    UIMediumIDHolder *m_pMediumIdHolder;
     688
    679689    bool mIsLoadingInProgress;
    680690    bool mIsPolished;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.ui

    r33882 r34329  
    256256        </item>
    257257        <item row="1" column="1" >
    258          <widget class="QLabel" name="mLbSlot" >
    259           <property name="text" >
    260            <string>S&amp;lot:</string>
    261           </property>
     258         <widget class="QLabel" name="mLbMedium" >
    262259          <property name="buddy" >
    263            <cstring>mCbSlot</cstring>
     260           <cstring>mTbOpen</cstring>
    264261          </property>
    265262          <property name="alignment" >
     
    269266        </item>
    270267        <item row="1" column="2" >
    271          <widget class="QComboBox" name="mCbSlot" >
    272           <property name="whatsThis" >
    273            <string>Selects the slot on the storage controller used by this attachment. The available slots depend on the type of the controller and other attachments on it.</string>
    274           </property>
    275           <property name="sizePolicy" >
    276            <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
    277             <horstretch>0</horstretch>
    278             <verstretch>0</verstretch>
    279            </sizepolicy>
    280           </property>
    281          </widget>
    282         </item>
    283         <item row="2" column="1" >
    284          <widget class="QLabel" name="mLbVdi" >
    285           <property name="buddy" >
    286            <cstring>mCbVdi</cstring>
    287           </property>
    288           <property name="alignment" >
    289            <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    290           </property>
    291          </widget>
     268         <layout class="QHBoxLayout" name="mLtContainer" >
     269          <property name="leftMargin" >
     270           <number>0</number>
     271          </property>
     272          <property name="topMargin" >
     273           <number>0</number>
     274           </property>
     275          <property name="rightMargin" >
     276           <number>0</number>
     277          </property>
     278          <property name="bottomMargin" >
     279           <number>0</number>
     280          </property>
     281          <property name="spacing" >
     282           <number>1</number>
     283          </property>
     284          <item>
     285           <widget class="QComboBox" name="mCbSlot" >
     286            <property name="whatsThis" >
     287             <string>Selects the slot on the storage controller used by this attachment. The available slots depend on the type of the controller and other attachments on it.</string>
     288            </property>
     289            <property name="sizePolicy" >
     290             <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
     291              <horstretch>0</horstretch>
     292              <verstretch>0</verstretch>
     293             </sizepolicy>
     294            </property>
     295           </widget>
     296          </item>
     297          <item>
     298           <widget class="QIToolButton" name="mTbOpen" >
     299            <property name="text" >
     300             <string/>
     301            </property>
     302            <property name="autoRaise" >
     303             <bool>true</bool>
     304            </property>
     305           </widget>
     306          </item>
     307         </layout>
    292308        </item>
    293309        <item row="2" column="2" >
    294          <widget class="QWidget" name="mWtContainer" >
    295           <layout class="QHBoxLayout" name="mLtContainer" >
    296            <property name="leftMargin" >
    297             <number>0</number>
    298            </property>
    299            <property name="topMargin" >
    300             <number>0</number>
    301             </property>
    302            <property name="rightMargin" >
    303             <number>0</number>
    304            </property>
    305            <property name="bottomMargin" >
    306             <number>0</number>
    307            </property>
    308            <property name="spacing" >
    309             <number>0</number>
    310            </property>
    311            <item>
    312             <widget class="VBoxMediaComboBox" native="1" name="mCbVdi" >
    313              <property name="whatsThis" >
    314               <string>Selects the virtual disk image or the host drive used by this attachment.</string>
    315              </property>
    316              <property name="sizePolicy" >
    317               <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
    318                <horstretch>0</horstretch>
    319                <verstretch>0</verstretch>
    320               </sizepolicy>
    321              </property>
    322             </widget>
    323            </item>
    324            <item>
    325             <widget class="QIToolButton" name="mTbOpen" >
    326              <property name="text" >
    327               <string/>
    328              </property>
    329              <property name="autoRaise" >
    330               <bool>true</bool>
    331              </property>
    332             </widget>
    333            </item>
    334            <item>
    335             <widget class="QIToolButton" name="mTbNew" >
    336              <property name="whatsThis" >
    337               <string>Create hard disk image file using New Hard Disk wizard.</string>
    338              </property>
    339              <property name="toolTip" >
    340               <string>Create hard disk image file</string>
    341              </property>
    342              <property name="text" >
    343               <string/>
    344              </property>
    345              <property name="autoRaise" >
    346               <bool>true</bool>
    347              </property>
    348             </widget>
    349            </item>
    350           </layout>
    351          </widget>
    352         </item>
    353         <item row="3" column="2" >
    354          <widget class="QCheckBox" name="mCbShowDiffs">
    355           <property name="sizePolicy" >
    356            <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
    357             <horstretch>0</horstretch>
    358             <verstretch>0</verstretch>
    359            </sizepolicy>
    360           </property>
    361           <property name="whatsThis">
    362            <string>If checked, shows the differencing hard disks that are attached to slots rather than their base hard disks (shown for indirect attachments) and allows explicit attaching of differencing hard disks. Check this only if you need a complex hard disk setup.</string>
    363           </property>
    364           <property name="text">
    365            <string>D&amp;ifferencing Disks</string>
    366           </property>
    367          </widget>
    368         </item>
    369         <item row="4" column="2" >
    370310         <widget class="QCheckBox" name="mCbPassthrough" >
    371311          <property name="sizePolicy" >
     
    383323         </widget>
    384324        </item>
    385         <item row="5" column="0" colspan="3" >
     325        <item row="3" column="0" colspan="3" >
    386326         <widget class="QILabelSeparator" native="1" name="mLsInformation" >
    387327          <property name="text" >
    388328           <string>Information</string>
     329          </property>
     330         </widget>
     331        </item>
     332        <item row="4" column="1" >
     333         <widget class="QLabel" name="mLbHDFormat" >
     334          <property name="text" >
     335           <string>Type (Format):</string>
     336          </property>
     337          <property name="alignment" >
     338           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     339          </property>
     340         </widget>
     341        </item>
     342        <item row="4" column="2" >
     343         <widget class="QILabel" name="mLbHDFormatValue" >
     344          <property name="sizePolicy" >
     345           <sizepolicy vsizetype="Preferred" hsizetype="Ignored" >
     346            <horstretch>0</horstretch>
     347            <verstretch>0</verstretch>
     348           </sizepolicy>
     349          </property>
     350         </widget>
     351        </item>
     352        <item row="5" column="1" >
     353         <widget class="QLabel" name="mLbCDFDType" >
     354          <property name="text" >
     355           <string>Type:</string>
     356          </property>
     357          <property name="alignment" >
     358           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     359          </property>
     360         </widget>
     361        </item>
     362        <item row="5" column="2" >
     363         <widget class="QILabel" name="mLbCDFDTypeValue" >
     364          <property name="sizePolicy" >
     365           <sizepolicy vsizetype="Preferred" hsizetype="Ignored" >
     366            <horstretch>0</horstretch>
     367            <verstretch>0</verstretch>
     368           </sizepolicy>
    389369          </property>
    390370         </widget>
     
    471451        </item>
    472452        <item row="10" column="1" >
    473          <widget class="QLabel" name="mLbHDFormat" >
    474           <property name="text" >
    475            <string>Type (Format):</string>
     453         <widget class="QLabel" name="mLbUsage" >
     454          <property name="text" >
     455           <string>Attached To:</string>
    476456          </property>
    477457          <property name="alignment" >
     
    481461        </item>
    482462        <item row="10" column="2" >
    483          <widget class="QILabel" name="mLbHDFormatValue" >
    484           <property name="sizePolicy" >
    485            <sizepolicy vsizetype="Preferred" hsizetype="Ignored" >
    486             <horstretch>0</horstretch>
    487             <verstretch>0</verstretch>
    488            </sizepolicy>
    489           </property>
    490          </widget>
    491         </item>
    492         <item row="11" column="1" >
    493          <widget class="QLabel" name="mLbUsage" >
    494           <property name="text" >
    495            <string>Attached To:</string>
    496           </property>
    497           <property name="alignment" >
    498            <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    499           </property>
    500          </widget>
    501         </item>
    502         <item row="11" column="2" >
    503463         <widget class="QILabel" name="mLbUsageValue" >
    504464          <property name="sizePolicy" >
     
    510470         </widget>
    511471        </item>
    512         <item row="12" column="0" colspan="3" >
     472        <item row="11" column="0" colspan="3" >
    513473         <spacer name="mSp6" >
    514474          <property name="orientation" >
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette