VirtualBox

Ignore:
Timestamp:
Jun 7, 2019 7:28:32 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6769: UIApplianceImportEditorWidget: More convenient layout and NLS-tag for machine base folder label.

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

Legend:

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

    r76606 r79032  
    2424
    2525/* GUI includes: */
    26 #include "QIRichTextLabel.h"
    2726#include "QITreeView.h"
    2827#include "UIApplianceImportEditorWidget.h"
     
    6867void UIApplianceImportEditorWidget::prepareWidgets()
    6968{
    70     /* Create path selector label: */
    71     m_pPathSelectorLabel = new QIRichTextLabel(this);
    72     if (m_pPathSelectorLabel)
    73     {
    74         /* Add into layout: */
    75         m_pLayout->addWidget(m_pPathSelectorLabel);
    76     }
    77 
    78     /* Create path selector editor: */
    79     m_pPathSelector = new UIFilePathSelector(this);
    80     if (m_pPathSelector)
    81     {
    82         m_pPathSelector->setResetEnabled(true);
    83         m_pPathSelector->setDefaultPath(vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder());
    84         m_pPathSelector->setPath(vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder());
    85         connect(m_pPathSelector, &UIFilePathSelector::pathChanged, this, &UIApplianceImportEditorWidget::sltHandlePathChanged);
    86 
    87         /* Add into layout: */
    88         m_pLayout->addWidget(m_pPathSelector);
    89     }
    90 
    9169    /* Create options layout: */
    9270    m_pOptionsLayout = new QGridLayout;
     
    9674        m_pOptionsLayout->setColumnStretch(1, 1);
    9775
     76        /* Create path selector label: */
     77        m_pPathSelectorLabel = new QLabel;
     78        if (m_pPathSelectorLabel)
     79        {
     80            m_pPathSelectorLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
     81
     82            /* Add into layout: */
     83            m_pOptionsLayout->addWidget(m_pPathSelectorLabel, 0, 0);
     84        }
     85
     86        /* Create path selector editor: */
     87        m_pPathSelector = new UIFilePathSelector;
     88        if (m_pPathSelector)
     89        {
     90            m_pPathSelector->setResetEnabled(true);
     91            m_pPathSelector->setDefaultPath(vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder());
     92            m_pPathSelector->setPath(vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder());
     93            m_pPathSelectorLabel->setBuddy(m_pPathSelector);
     94
     95            /* Add into layout: */
     96            m_pOptionsLayout->addWidget(m_pPathSelector, 0, 1, 1, 2);
     97        }
     98
    9899        /* Create MAC address policy label: */
    99100        m_pMACComboBoxLabel = new QLabel;
     
    103104
    104105            /* Add into layout: */
    105             m_pOptionsLayout->addWidget(m_pMACComboBoxLabel, 0, 0);
     106            m_pOptionsLayout->addWidget(m_pMACComboBoxLabel, 1, 0);
    106107        }
    107108
     
    114115
    115116            /* Add into layout: */
    116             m_pOptionsLayout->addWidget(m_pMACComboBox, 0, 1, 1, 2);
     117            m_pOptionsLayout->addWidget(m_pMACComboBox, 1, 1, 1, 2);
    117118        }
    118119
     
    124125
    125126            /* Add into layout: */
    126             m_pOptionsLayout->addWidget(m_pAdditionalOptionsLabel, 1, 0);
     127            m_pOptionsLayout->addWidget(m_pAdditionalOptionsLabel, 2, 0);
    127128        }
    128129
     
    133134
    134135            /* Add into layout: */
    135             m_pOptionsLayout->addWidget(m_pImportHDsAsVDI, 1, 1);
     136            m_pOptionsLayout->addWidget(m_pImportHDsAsVDI, 2, 1);
    136137        }
    137138
     
    142143    /* Populate MAC address import combo: */
    143144    populateMACAddressImportPolicies();
    144     /* And connect this combo' signals afterwards: */
     145    /* And connect signals afterwards: */
     146    connect(m_pPathSelector, &UIFilePathSelector::pathChanged,
     147            this, &UIApplianceImportEditorWidget::sltHandlePathChanged);
    145148    connect(m_pMACComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
    146149            this, &UIApplianceImportEditorWidget::sltHandleMACAddressImportPolicyComboChange);
     
    314317    UIApplianceEditorWidget::retranslateUi();
    315318    if (m_pPathSelectorLabel)
    316         m_pPathSelectorLabel->setText(UIWizardImportApp::tr("You can modify the base folder which will host all the virtual machines. "
    317                                                             "Home folders can also be individually (per virtual machine) modified."));
     319        m_pPathSelectorLabel->setText(tr("&Machine Base Folder:"));
    318320    if (m_pImportHDsAsVDI)
    319321    {
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceImportEditorWidget.h

    r76581 r79032  
    2727/* Forward declarations: */
    2828class UIFilePathSelector;
    29 class QIRichTextLabel;
    3029class QComboBox;
    3130class QGridLayout;
     
    7069    void    updateMACAddressImportPolicyComboToolTip();
    7170
    72     QIRichTextLabel    *m_pPathSelectorLabel;
     71    QLabel             *m_pPathSelectorLabel;
    7372    UIFilePathSelector *m_pPathSelector;
    7473    /** Holds the checkbox that controls 'import HDs as VDI' behaviour. */
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