VirtualBox

Changeset 62079 in vbox for trunk/src


Ignore:
Timestamp:
Jul 6, 2016 5:27:13 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
108551
Message:

FE/Qt: bugref:8399: Medium Type Change dialog cleanup/rework (part 02): Renaming.

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

Legend:

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

    r62078 r62079  
    3838
    3939
    40 UIMediumTypeChangeDialog::UIMediumTypeChangeDialog(QWidget *pParent, const QString &strMediumId)
     40UIMediumTypeChangeDialog::UIMediumTypeChangeDialog(QWidget *pParent, const QString &strMediumID)
    4141    : QIWithRetranslateUI<QIDialog>(pParent)
    4242{
     
    5050
    5151    /* Search for corresponding medium: */
    52     m_medium = vboxGlobal().medium(strMediumId).medium();
    53     m_oldMediumType = m_medium.GetType();
    54     m_newMediumType = m_oldMediumType;
     52    m_medium = vboxGlobal().medium(strMediumID).medium();
     53    m_enmMediumTypeOld = m_medium.GetType();
     54    m_enmMediumTypeNew = m_enmMediumTypeOld;
    5555
    5656    /* Create main layout: */
     
    8484    pMainLayout->addStretch();
    8585
    86     /* Create radio-buttons: */
    87     createMediumTypeButtons();
     86    /* Prepare radio-buttons: */
     87    prepareMediumTypeButtons();
    8888
    8989    /* Retranslate: */
     
    9797{
    9898    /* Try to assign new medium type: */
    99     m_medium.SetType(m_newMediumType);
     99    m_medium.SetType(m_enmMediumTypeNew);
    100100    /* Check for result: */
    101101    if (!m_medium.isOk())
    102102    {
    103103        /* Show error message: */
    104         msgCenter().cannotChangeMediumType(m_medium, m_oldMediumType, m_newMediumType, this);
     104        msgCenter().cannotChangeMediumType(m_medium, m_enmMediumTypeOld, m_enmMediumTypeNew, this);
    105105        return;
    106106    }
     
    153153
    154154    /* Determine chosen type: */
    155     m_newMediumType = pCheckedButton->property("mediumType").value<KMediumType>();
     155    m_enmMediumTypeNew = pCheckedButton->property("mediumType").value<KMediumType>();
    156156
    157157    /* Enable/disable OK button depending on chosen type,
    158158     * for now only the previous type is restricted, others are free to choose: */
    159     m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(m_oldMediumType != m_newMediumType);
    160 }
    161 
    162 void UIMediumTypeChangeDialog::createMediumTypeButtons()
     159    m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(m_enmMediumTypeOld != m_enmMediumTypeNew);
     160}
     161
     162void UIMediumTypeChangeDialog::prepareMediumTypeButtons()
    163163{
    164164    /* Register required meta-type: */
     
    168168    m_pGroupBoxLayout = new QVBoxLayout(m_pGroupBox);
    169169    /* Populate radio-buttons: */
    170     createMediumTypeButton(KMediumType_Normal);
    171     createMediumTypeButton(KMediumType_Immutable);
    172     createMediumTypeButton(KMediumType_Writethrough);
    173     createMediumTypeButton(KMediumType_Shareable);
    174     createMediumTypeButton(KMediumType_MultiAttach);
     170    prepareMediumTypeButton(KMediumType_Normal);
     171    prepareMediumTypeButton(KMediumType_Immutable);
     172    prepareMediumTypeButton(KMediumType_Writethrough);
     173    prepareMediumTypeButton(KMediumType_Shareable);
     174    prepareMediumTypeButton(KMediumType_MultiAttach);
    175175    /* Make sure button reflecting current type is checked: */
    176176    QList<QRadioButton*> buttons = findChildren<QRadioButton*>();
    177177    for (int i = 0; i < buttons.size(); ++i)
    178178    {
    179         if (buttons[i]->property("mediumType").value<KMediumType>() == m_oldMediumType)
     179        if (buttons[i]->property("mediumType").value<KMediumType>() == m_enmMediumTypeOld)
    180180        {
    181181            buttons[i]->setChecked(true);
     
    188188}
    189189
    190 void UIMediumTypeChangeDialog::createMediumTypeButton(KMediumType mediumType)
     190void UIMediumTypeChangeDialog::prepareMediumTypeButton(KMediumType mediumType)
    191191{
    192192    /* Create radio-button: */
  • trunk/src/VBox/Frontends/VirtualBox/src/UIMediumTypeChangeDialog.h

    r62078 r62079  
    4444
    4545    /** Constructs the dialog passing @a pParent to the base-class.
    46       * @param  strMediumId  Brings the ID of the medium to be modified. */
    47     UIMediumTypeChangeDialog(QWidget *pParent, const QString &strMediumId);
     46      * @param  strMediumID  Brings the ID of the medium to be modified. */
     47    UIMediumTypeChangeDialog(QWidget *pParent, const QString &strMediumID);
    4848
    4949protected:
    5050
    5151    /** Handles translation event. */
    52     void retranslateUi();
     52    void retranslateUi() /* override */;
    5353
    5454protected slots:
     
    6565
    6666    /** Prepares medium-type radio-buttons. */
    67     void createMediumTypeButtons();
     67    void prepareMediumTypeButtons();
    6868    /** Prepares radio-button for the passed @a mediumType. */
    69     void createMediumTypeButton(KMediumType mediumType);
     69    void prepareMediumTypeButton(KMediumType mediumType);
    7070
    7171    /** Holds the description label instance. */
     
    8181    CMedium m_medium;
    8282    /** Holds the old medium type. */
    83     KMediumType m_oldMediumType;
     83    KMediumType m_enmMediumTypeOld;
    8484    /** Holds the new medium type. */
    85     KMediumType m_newMediumType;
     85    KMediumType m_enmMediumTypeNew;
    8686};
    8787
Note: See TracChangeset for help on using the changeset viewer.

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