VirtualBox

Ignore:
Timestamp:
Apr 21, 2016 4:41:09 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: ​​​​​​​​​bugref:6451: New VD Wizard: Make the preferred image formats bold (expert mode only).

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic1.cpp

    r60625 r60636  
    4141}
    4242
    43 void UIWizardNewVDPage1::addFormatButton(QWidget *pParent, QVBoxLayout *pFormatLayout, CMediumFormat medFormat)
     43void UIWizardNewVDPage1::addFormatButton(QWidget *pParent, QVBoxLayout *pFormatLayout, CMediumFormat medFormat, bool fPreferred /* = false */)
    4444{
    4545    /* Check that medium format supports creation: */
     
    6363    /* Create/add corresponding radio-button: */
    6464    QRadioButton *pFormatButton = new QRadioButton(pParent);
    65     pFormatLayout->addWidget(pFormatButton);
    66     m_formats << medFormat;
    67     m_formatNames << medFormat.GetName();
    68     m_pFormatButtonGroup->addButton(pFormatButton, m_formatNames.size() - 1);
     65    AssertPtrReturnVoid(pFormatButton);
     66    {
     67        /* Make the preferred button font bold: */
     68        if (fPreferred)
     69        {
     70            QFont font = pFormatButton->font();
     71            font.setBold(true);
     72            pFormatButton->setFont(font);
     73        }
     74        pFormatLayout->addWidget(pFormatButton);
     75        m_formats << medFormat;
     76        m_formatNames << medFormat.GetName();
     77        m_pFormatButtonGroup->addButton(pFormatButton, m_formatNames.size() - 1);
     78    }
    6979}
    7080
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic1.h

    r55401 r60636  
    4141
    4242    /* Helping stuff: */
    43     void addFormatButton(QWidget *pParent, QVBoxLayout *pFormatsLayout, CMediumFormat medFormat);
     43    void addFormatButton(QWidget *pParent, QVBoxLayout *pFormatsLayout, CMediumFormat medFormat, bool fPreferred = false);
    4444
    4545    /* Stuff for 'mediumFormat' field: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageExpert.cpp

    r56180 r60636  
    128128                        const CMediumFormat &medFormat = medFormats[i];
    129129                        if (medFormat.GetName() == "VDI")
    130                             addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat);
     130                            addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat, true);
    131131                    }
    132132                    for (int i = 0; i < medFormats.size(); ++i)
    133133                    {
    134134                        const CMediumFormat &medFormat = medFormats[i];
     135                        const QVector<KMediumFormatCapabilities> &capabilities = medFormat.GetCapabilities();
    135136                        if (medFormat.GetName() != "VDI")
    136                             addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat);
     137                            addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat, capabilities.contains(KMediumFormatCapabilities_Preferred));
    137138                    }
    138139                    if (!m_pFormatButtonGroup->buttons().isEmpty())
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