VirtualBox

Changeset 91350 in vbox for trunk


Ignore:
Timestamp:
Sep 23, 2021 2:09:33 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9083. Some renaming and improvement.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/medium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIFDCreationDialog.cpp

    r91349 r91350  
    4444    , m_strDefaultFolder(strDefaultFolder)
    4545    , m_strMachineName(strMachineName)
    46     , m_pLabelPath(0)
     46    , m_pPathLabel(0)
    4747    , m_pFilePathSelector(0)
    4848    , m_pSizeLabel(0)
    49     , m_pComboSize(0)
    50     , m_pCheckBoxFormat(0)
     49    , m_pSizeCombo(0)
     50    , m_pFormatCheckBox(0)
    5151    , m_pButtonBox(0)
    5252{
     
    8686    QVector<KMediumVariant> variants(1, KMediumVariant_Fixed);
    8787    /* Decide if disk formatting is required: */
    88     if (m_pCheckBoxFormat && m_pCheckBoxFormat->checkState() == Qt::Checked)
     88    if (m_pFormatCheckBox && m_pFormatCheckBox->checkState() == Qt::Checked)
    8989        variants.push_back(KMediumVariant_Formatted);
    9090
    9191    /* Create medium storage, asynchronously: */
    9292    UINotificationProgressMediumCreate *pNotification =
    93         new UINotificationProgressMediumCreate(comMedium, m_pComboSize->currentData().toLongLong(), variants);
     93        new UINotificationProgressMediumCreate(comMedium, m_pSizeCombo->currentData().toLongLong(), variants);
    9494    connect(pNotification, &UINotificationProgressMediumCreate::sigMediumCreated,
    9595            &uiCommon(), &UICommon::sltHandleMediumCreated);
     
    105105    else
    106106        setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(tr("Floppy Disk Creator")));
    107     if (m_pLabelPath)
    108         m_pLabelPath->setText(tr("File Path:"));
     107    if (m_pPathLabel)
     108        m_pPathLabel->setText(tr("File &Path:"));
    109109    if (m_pSizeLabel)
    110         m_pSizeLabel->setText(tr("Size:"));
     110    {
     111        m_pSizeLabel->setText(tr("&Size:"));
     112        m_pSizeLabel->setToolTip(tr("Sets the size of the floppy disk."));
     113    }
    111114    if (m_pButtonBox)
    112115        m_pButtonBox->button(QDialogButtonBox::Ok)->setText("C&reate");
    113     if (m_pCheckBoxFormat)
    114         m_pCheckBoxFormat->setText(tr("Format disk as FAT12"));
    115     if (m_pComboSize)
    116     {
    117         //m_pComboSize->setItemText(FDSize_2_88M, tr("2.88M"));
    118         m_pComboSize->setItemText(FDSize_1_44M, tr("1.44M"));
    119         m_pComboSize->setItemText(FDSize_1_2M, tr("1.2M"));
    120         m_pComboSize->setItemText(FDSize_720K, tr("720K"));
    121         m_pComboSize->setItemText(FDSize_360K, tr("360K"));
     116    if (m_pFormatCheckBox)
     117    {
     118        m_pFormatCheckBox->setText(tr("&Format disk as FAT12"));
     119        m_pFormatCheckBox->setToolTip(tr("Formats the floppy disk as FAT12."));
     120    }
     121    if (m_pSizeCombo)
     122    {
     123        //m_pSizeCombo->setItemText(FDSize_2_88M, tr("2.88M"));
     124        m_pSizeCombo->setItemText(FDSize_1_44M, tr("1.44M"));
     125        m_pSizeCombo->setItemText(FDSize_1_2M, tr("1.2M"));
     126        m_pSizeCombo->setItemText(FDSize_720K, tr("720K"));
     127        m_pSizeCombo->setItemText(FDSize_360K, tr("360K"));
    122128    }
    123129}
     
    160166    {
    161167        /* Prepare path label: */
    162         m_pLabelPath = new QLabel(this);
    163         if (m_pLabelPath)
    164         {
    165             m_pLabelPath->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    166             pLayoutMain->addWidget(m_pLabelPath, 0, 0);
     168        m_pPathLabel = new QLabel(this);
     169        if (m_pPathLabel)
     170        {
     171            m_pPathLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     172            pLayoutMain->addWidget(m_pPathLabel, 0, 0);
    167173        }
    168174        /* Prepare file path selector: */
     
    178184            connect(m_pFilePathSelector, &UIFilePathSelector::pathChanged,
    179185                    this, &UIFDCreationDialog::sltPathChanged);
     186            if (m_pPathLabel)
     187                m_pPathLabel->setBuddy(m_pFilePathSelector);
    180188        }
    181189
     
    188196        }
    189197        /* Prepare size combo: */
    190         m_pComboSize = new QComboBox(this);
    191         if (m_pComboSize)
    192         {
    193             //m_pComboSize->insertItem(FDSize_2_88M, "2.88M", 2949120);
    194             m_pComboSize->insertItem(FDSize_1_44M, "1.44M", 1474560);
    195             m_pComboSize->insertItem(FDSize_1_2M, "1.2M", 1228800);
    196             m_pComboSize->insertItem(FDSize_720K, "720K", 737280);
    197             m_pComboSize->insertItem(FDSize_360K, "360K", 368640);
    198             m_pComboSize->setCurrentIndex(FDSize_1_44M);
    199 
    200             pLayoutMain->addWidget(m_pComboSize, 1, 1);
     198        m_pSizeCombo = new QComboBox(this);
     199        if (m_pSizeCombo)
     200        {
     201            //m_pSizeCombo->insertItem(FDSize_2_88M, "2.88M", 2949120);
     202            m_pSizeCombo->insertItem(FDSize_1_44M, "1.44M", 1474560);
     203            m_pSizeCombo->insertItem(FDSize_1_2M, "1.2M", 1228800);
     204            m_pSizeCombo->insertItem(FDSize_720K, "720K", 737280);
     205            m_pSizeCombo->insertItem(FDSize_360K, "360K", 368640);
     206            m_pSizeCombo->setCurrentIndex(FDSize_1_44M);
     207
     208            pLayoutMain->addWidget(m_pSizeCombo, 1, 1);
     209
     210            if (m_pSizeLabel)
     211                m_pSizeLabel->setBuddy(m_pSizeCombo);
    201212        }
    202213
    203214        /* Prepare format check-box: */
    204         m_pCheckBoxFormat = new QCheckBox;
    205         if (m_pCheckBoxFormat)
    206         {
    207             m_pCheckBoxFormat->setCheckState(Qt::Checked);
    208             pLayoutMain->addWidget(m_pCheckBoxFormat, 2, 1, 1, 2);
     215        m_pFormatCheckBox = new QCheckBox;
     216        if (m_pFormatCheckBox)
     217        {
     218            m_pFormatCheckBox->setCheckState(Qt::Checked);
     219            pLayoutMain->addWidget(m_pFormatCheckBox, 2, 1, 1, 2);
    209220        }
    210221
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIFDCreationDialog.h

    r91349 r91350  
    9696
    9797    /** Holds the path label instance. */
    98     QLabel             *m_pLabelPath;
     98    QLabel             *m_pPathLabel;
    9999    /** Holds the file path selector instance. */
    100100    UIFilePathSelector *m_pFilePathSelector;
     
    102102    QLabel             *m_pSizeLabel;
    103103    /** Holds the size combo instance. */
    104     QComboBox          *m_pComboSize;
     104    QComboBox          *m_pSizeCombo;
    105105    /** Holds the format check-box instance. */
    106     QCheckBox          *m_pCheckBoxFormat;
     106    QCheckBox          *m_pFormatCheckBox;
    107107    /** holds the button-box instance. */
    108108    QDialogButtonBox   *m_pButtonBox;
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