VirtualBox

Ignore:
Timestamp:
May 24, 2018 9:16:58 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: ​bugref:6769 Hiding the path selector in general machine settings dialog

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

Legend:

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

    r72313 r72314  
    121121    m_pLabelType->setText(tr("&Version:"));
    122122    m_pNameLabel->setText(tr("Name:"));
    123     m_pPathLabel->setText(tr("Path:"));
     123    if (m_pPathLabel)
     124        m_pPathLabel->setText(tr("Path:"));
    124125
    125126    m_pComboFamily->setWhatsThis(tr("Selects the operating system family that "
     
    232233
    233234        m_pNameLabel = new QLabel;
     235        int iRow = 0;
    234236        if (m_pNameLabel)
    235237        {
    236238            m_pNameLabel->setAlignment(Qt::AlignRight);
    237239            m_pNameLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    238             pMainLayout->addWidget(m_pNameLabel, 0, 0, 1, 1);
     240            pMainLayout->addWidget(m_pNameLabel, iRow, 0, 1, 1);
    239241        }
    240242        m_pNameLineEdit = new QILineEdit;
    241243        if (m_pNameLineEdit)
    242244        {
    243             pMainLayout->addWidget(m_pNameLineEdit, 0, 1, 1, 2);
    244         }
    245 
    246         m_pPathLabel = new QLabel;
    247         if (m_pPathLabel)
    248         {
    249             m_pPathLabel->setAlignment(Qt::AlignRight);
    250             m_pPathLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    251             pMainLayout->addWidget(m_pPathLabel, 1, 0, 1, 1);
    252         }
    253 
    254         m_pPathSelector = new UIFilePathSelector;
    255         if (m_pPathSelector)
    256         {
    257             pMainLayout->addWidget(m_pPathSelector, 1, 1, 1, 2);
    258             QString strDefaultMachineFolder = vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder();
    259             m_pPathSelector->setPath(strDefaultMachineFolder);
    260             m_pPathSelector->setDefaultPath(strDefaultMachineFolder);
     245            pMainLayout->addWidget(m_pNameLineEdit, iRow++, 1, 1, 2);
     246        }
     247
     248        if (m_fChooseLocation)
     249        {
     250            m_pPathLabel = new QLabel;
     251            if (m_pPathLabel)
     252            {
     253                m_pPathLabel->setAlignment(Qt::AlignRight);
     254                m_pPathLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
     255                pMainLayout->addWidget(m_pPathLabel, iRow, 0, 1, 1);
     256            }
     257
     258            m_pPathSelector = new UIFilePathSelector;
     259            if (m_pPathSelector)
     260            {
     261                pMainLayout->addWidget(m_pPathSelector, iRow++, 1, 1, 2);
     262                QString strDefaultMachineFolder = vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder();
     263                m_pPathSelector->setPath(strDefaultMachineFolder);
     264                m_pPathSelector->setDefaultPath(strDefaultMachineFolder);
     265            }
    261266        }
    262267
     
    269274            m_pLabelFamily->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    270275            /* Add VM OS family label into main-layout: */
    271             pMainLayout->addWidget(m_pLabelFamily, 2, 0);
    272         }
    273 
     276            pMainLayout->addWidget(m_pLabelFamily, iRow, 0);
     277        }
     278        int iIconRow = iRow;
    274279        /* Create VM OS family combo: */
    275280        m_pComboFamily = new QComboBox;
     
    280285            m_pLabelFamily->setBuddy(m_pComboFamily);
    281286            /* Add VM OS family combo into main-layout: */
    282             pMainLayout->addWidget(m_pComboFamily, 2, 1);
     287            pMainLayout->addWidget(m_pComboFamily, iRow++, 1);
    283288        }
    284289
     
    291296            m_pLabelType->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    292297            /* Add VM OS type label into main-layout: */
    293             pMainLayout->addWidget(m_pLabelType, 3, 0);
     298            pMainLayout->addWidget(m_pLabelType, iRow, 0);
    294299        }
    295300
     
    302307            m_pLabelType->setBuddy(m_pComboType);
    303308            /* Add VM OS type combo into main-layout: */
    304             pMainLayout->addWidget(m_pComboType, 3, 1);
     309            pMainLayout->addWidget(m_pComboType, iRow++, 1);
    305310        }
    306311
     
    321326            pLayoutIcon->addStretch();
    322327            /* Add sub-layout into main-layout: */
    323             pMainLayout->addLayout(pLayoutIcon, 2, 2, 2, 1);
     328            pMainLayout->addLayout(pLayoutIcon, iIconRow, 2, 2, 1);
    324329        }
    325330    }
     
    352357    connect(m_pNameLineEdit, &QILineEdit::textChanged,
    353358            this, &UINameAndSystemEditor::sigNameChanged);
    354     connect(m_pPathSelector, &UIFilePathSelector::pathChanged,
    355             this, &UINameAndSystemEditor::sigPathChanged);
     359    if (m_pPathSelector)
     360        connect(m_pPathSelector, &UIFilePathSelector::pathChanged,
     361                this, &UINameAndSystemEditor::sigPathChanged);
    356362    connect(m_pComboFamily, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
    357363            this, &UINameAndSystemEditor::sltFamilyChanged);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp

    r72279 r72314  
    328328    {
    329329        m_pLabel = new QIRichTextLabel(this);
    330         m_pNameAndSystemEditor = new UINameAndSystemEditor(this);
     330        m_pNameAndSystemEditor = new UINameAndSystemEditor(this, true);
    331331        pMainLayout->addWidget(m_pLabel);
    332332        pMainLayout->addWidget(m_pNameAndSystemEditor);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r72191 r72314  
    5555            QHBoxLayout *pNameAndSystemCntLayout = new QHBoxLayout(m_pNameAndSystemCnt);
    5656            {
    57                 m_pNameAndSystemEditor = new UINameAndSystemEditor(m_pNameAndSystemCnt);
     57                m_pNameAndSystemEditor = new UINameAndSystemEditor(m_pNameAndSystemCnt, true);
    5858                pNameAndSystemCntLayout->addWidget(m_pNameAndSystemEditor);
    5959            }
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