VirtualBox

Changeset 106138 in vbox for trunk


Ignore:
Timestamp:
Sep 24, 2024 12:36:53 PM (2 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10513: VM Settings / Storage page: Split label common for HD, CD and FD attachments into three separate labels (one per each type); Moving them into appropriate stacked widget to use horizontal space more effectively; That is the 3rd step after the r164806.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIStorageSettingsEditor.cpp

    r106076 r106138  
    28722872    , m_pCheckBoxIoCache(0)
    28732873    , m_pLabelSeparatorAttributes(0)
    2874     , m_pLabelMedium(0)
     2874    , m_pContainerMediumLabels(0)
     2875    , m_pLabelHD(0)
     2876    , m_pLabelCD(0)
     2877    , m_pLabelFD(0)
    28752878    , m_pComboSlot(0)
    28762879    , m_pToolButtonOpen(0)
     
    30013004    /* Polish attachments pane availability: */
    30023005    m_pLabelSeparatorAttributes->setEnabled(fMachineInValidMode);
    3003     m_pLabelMedium->setEnabled(fMachineOffline || (fMachineOnline && enmDeviceType != KDeviceType_HardDisk));
     3006    m_pLabelHD->setEnabled(fMachineOffline);
     3007    m_pLabelCD->setEnabled(fMachineOffline || fMachineOnline);
     3008    m_pLabelFD->setEnabled(fMachineOffline || fMachineOnline);
    30043009    m_pComboSlot->setEnabled(fMachineOffline);
    30053010    m_pToolButtonOpen->setEnabled(fMachineOffline || (fMachineOnline && enmDeviceType != KDeviceType_HardDisk));
     
    31973202    m_pCheckBoxIoCache->setText(tr("Use Host I/O Cache"));
    31983203    m_pLabelSeparatorAttributes->setText(tr("Attributes"));
     3204    m_pLabelHD->setText(tr("Hard &Disk:"));
     3205    m_pLabelCD->setText(tr("Optical &Drive:"));
     3206    m_pLabelFD->setText(tr("Floppy &Drive:"));
    31993207    m_pComboSlot->setToolTip(tr("Selects the slot on the storage controller used by this attachment. The available slots depend "
    32003208                                "on the type of the controller and other attachments on it."));
     
    35983606                {
    35993607                    case KDeviceType_HardDisk:
    3600                         m_pLabelMedium->setText(tr("Hard &Disk:"));
    36013608                        m_pToolButtonOpen->setIcon(iconPool()->icon(PixmapType_HDAttachmentNormal));
    36023609                        m_pToolButtonOpen->setToolTip(tr("Choose or create a virtual hard disk file. The virtual machine will "
     
    36043611                        break;
    36053612                    case KDeviceType_DVD:
    3606                         m_pLabelMedium->setText(tr("Optical &Drive:"));
    36073613                        m_pToolButtonOpen->setIcon(iconPool()->icon(PixmapType_CDAttachmentNormal));
    36083614                        m_pToolButtonOpen->setToolTip(tr("Choose a virtual optical disk or a physical drive to use with the "
     
    36123618                        break;
    36133619                    case KDeviceType_Floppy:
    3614                         m_pLabelMedium->setText(tr("Floppy &Drive:"));
    36153620                        m_pToolButtonOpen->setIcon(iconPool()->icon(PixmapType_FDAttachmentNormal));
    36163621                        m_pToolButtonOpen->setToolTip(tr("Choose a virtual floppy disk or a physical drive to use with the "
     
    36363641                                         || (   m_enmConfigurationAccessLevel == ConfigurationAccessLevel_Partial_Running
    36373642                                             && enmDeviceType == KDeviceType_HardDisk && fIsHotPluggable);
    3638                 m_pLabelMedium->setEnabled(fIsEditable);
     3643                m_pLabelHD->setEnabled(fIsEditable);
     3644                m_pLabelCD->setEnabled(fIsEditable);
     3645                m_pLabelFD->setEnabled(fIsEditable);
    36393646                m_pToolButtonOpen->setEnabled(fIsEditable);
     3647
     3648                /* Prepare medium label to show: */
     3649                int iIndexForMediumLabel = 0;
     3650                switch (enmDeviceType)
     3651                {
     3652                    case KDeviceType_HardDisk: iIndexForMediumLabel = 0; break;
     3653                    case KDeviceType_DVD: iIndexForMediumLabel = 1; break;
     3654                    case KDeviceType_Floppy: iIndexForMediumLabel = 2; break;
     3655                    default: break;
     3656                }
     3657                /* Trigger information to show: */
     3658                m_pContainerMediumLabels->setCurrentIndex(iIndexForMediumLabel);
    36403659
    36413660                /* Prepare setting #1 to show: */
     
    47814800                m_pLayoutAttachment->addWidget(m_pLabelSeparatorAttributes, 0, 0, 1, 3);
    47824801
    4783             /* Prepare medium label: */
    4784             m_pLabelMedium = new QLabel(pWidgetAttachment);
    4785             if (m_pLabelMedium)
     4802            /* Prepare medium label container: */
     4803            m_pContainerMediumLabels = new QStackedWidget(pWidgetAttachment);
     4804            if (m_pContainerMediumLabels)
    47864805            {
    4787                 m_pLabelMedium->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    4788                 m_pLayoutAttachment->addWidget(m_pLabelMedium, 1, 1);
     4806                /* Prepare HD label: */
     4807                m_pLabelHD = new QLabel(m_pContainerMediumLabels);
     4808                if (m_pLabelHD)
     4809                {
     4810                    m_pLabelHD->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     4811                    m_pContainerMediumLabels->addWidget(m_pLabelHD);
     4812                }
     4813
     4814                /* Prepare CD label: */
     4815                m_pLabelCD = new QLabel(m_pContainerMediumLabels);
     4816                if (m_pLabelCD)
     4817                {
     4818                    m_pLabelCD->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     4819                    m_pContainerMediumLabels->addWidget(m_pLabelCD);
     4820                }
     4821
     4822                /* Prepare FD label: */
     4823                m_pLabelFD = new QLabel(m_pContainerMediumLabels);
     4824                if (m_pLabelFD)
     4825                {
     4826                    m_pLabelFD->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     4827                    m_pContainerMediumLabels->addWidget(m_pLabelFD);
     4828                }
     4829
     4830                m_pLayoutAttachment->addWidget(m_pContainerMediumLabels, 1, 1);
    47894831            }
    47904832
     
    48084850                if (m_pToolButtonOpen)
    48094851                {
    4810                     if (m_pLabelMedium)
    4811                         m_pLabelMedium->setBuddy(m_pToolButtonOpen);
     4852                    if (m_pLabelHD)
     4853                        m_pLabelHD->setBuddy(m_pToolButtonOpen);
     4854                    if (m_pLabelCD)
     4855                        m_pLabelCD->setBuddy(m_pToolButtonOpen);
     4856                    if (m_pLabelFD)
     4857                        m_pLabelFD->setBuddy(m_pToolButtonOpen);
    48124858
    48134859                    /* Prepare open medium menu: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIStorageSettingsEditor.h

    r106075 r106138  
    480480        /** Holds the right pane attachment widget separator instance. */
    481481        QILabelSeparator *m_pLabelSeparatorAttributes;
    482         /** Holds the medium label instance. */
    483         QLabel           *m_pLabelMedium;
     482        /** Holds the medium label container instance. */
     483        QStackedWidget   *m_pContainerMediumLabels;
     484        /** Holds the HD label instance. */
     485        QLabel           *m_pLabelHD;
     486        /** Holds the CD label instance. */
     487        QLabel           *m_pLabelCD;
     488        /** Holds the FD label instance. */
     489        QLabel           *m_pLabelFD;
    484490        /** Holds the slot combo instance. */
    485491        QComboBox        *m_pComboSlot;
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