VirtualBox

Changeset 87294 in vbox


Ignore:
Timestamp:
Jan 18, 2021 11:12:13 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9515. Some more indentation fixes.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp

    r87249 r87294  
    184184    , m_pEnableUnattendedInstallCheckBox(0)
    185185    , m_pStartHeadlessCheckBox(0)
    186     , m_pNameAndFolderEditor(0)
    187     , m_pSystemTypeEditor(0)
     186    , m_pNameAndSystemEditor(0)
    188187    , m_pUnattendedLabel(0)
    189188    , m_pNameOSTypeLabel(0)
     
    205204        if (strNewName.contains(gs_OSTypePattern[i].pattern))
    206205        {
    207             if (m_pSystemTypeEditor)
    208                 m_pSystemTypeEditor->setType(uiCommon().vmGuestOSType(gs_OSTypePattern[i].pcstId));
     206            if (m_pNameAndSystemEditor)
     207                m_pNameAndSystemEditor->setType(uiCommon().vmGuestOSType(gs_OSTypePattern[i].pcstId));
    209208            break;
    210209        }
     
    215214    /* If the user manually edited the OS type, we didn't want our automatic OS type guessing anymore.
    216215     * So simply disconnect the text-edit signal. */
    217     if (m_pNameAndFolderEditor)
    218         m_pNameAndFolderEditor->disconnect(SIGNAL(sigNameChanged(const QString &)), thisImp(), SLOT(sltNameChanged(const QString &)));
     216    if (m_pNameAndSystemEditor)
     217        m_pNameAndSystemEditor->disconnect(SIGNAL(sigNameChanged(const QString &)), thisImp(), SLOT(sltNameChanged(const QString &)));
    219218}
    220219
     
    249248void UIWizardNewVMPage1::composeMachineFilePath()
    250249{
    251     if (!m_pNameAndFolderEditor)
     250    if (!m_pNameAndSystemEditor)
    252251        return;
    253     if (m_pNameAndFolderEditor->name().isEmpty() || m_pNameAndFolderEditor->path().isEmpty())
     252    if (m_pNameAndSystemEditor->name().isEmpty() || m_pNameAndSystemEditor->path().isEmpty())
    254253        return;
    255254    /* Get VBox: */
     
    257256
    258257    /* Compose machine filename: */
    259     m_strMachineFilePath = vbox.ComposeMachineFilename(m_pNameAndFolderEditor->name(),
     258    m_strMachineFilePath = vbox.ComposeMachineFilename(m_pNameAndSystemEditor->name(),
    260259                                                       m_strGroup,
    261260                                                       QString(),
    262                                                        m_pNameAndFolderEditor->path());
     261                                                       m_pNameAndSystemEditor->path());
    263262    /* Compose machine folder/basename: */
    264263    const QFileInfo fileInfo(m_strMachineFilePath);
     
    299298        m_pNameOSTypeLabel = new QIRichTextLabel;
    300299        if (m_pNameOSTypeLabel)
    301             pLayout->addWidget(m_pNameOSTypeLabel, iRow++, 0, 1, 4);
    302     }
    303 
    304     m_pNameAndFolderEditor = new UINameAndSystemEditor(0, true, true, false);
    305     if (m_pNameAndFolderEditor)
    306         pLayout->addWidget(m_pNameAndFolderEditor, iRow++, 0, 1, 4);
    307 
    308     pLayout->addWidget(horizontalLine(), iRow++, 0, 1, 4);
     300            pLayout->addWidget(m_pNameOSTypeLabel, iRow++, 0, 1, 6);
     301    }
     302
     303    m_pNameAndSystemEditor = new UINameAndSystemEditor(0, true, true, true);
     304    if (m_pNameAndSystemEditor)
     305        pLayout->addWidget(m_pNameAndSystemEditor, iRow++, 0, 1, 6);
     306
     307    pLayout->addWidget(horizontalLine(), iRow++, 0, 1, 6);
    309308
    310309    if (fCreateLabels)
     
    312311        m_pUnattendedLabel = new QIRichTextLabel;
    313312        if (m_pUnattendedLabel)
    314             pLayout->addWidget(m_pUnattendedLabel, iRow++, 0, 1, 4);
     313            pLayout->addWidget(m_pUnattendedLabel, iRow++, 0, 1, 6);
    315314    }
    316315
    317316    m_pEnableUnattendedInstallCheckBox = new QCheckBox;
    318     pLayout->addWidget(m_pEnableUnattendedInstallCheckBox, iRow++, 0, 1, 2, Qt::AlignLeft);
     317    pLayout->addWidget(m_pEnableUnattendedInstallCheckBox, iRow++, 0, 1, 1);
    319318
    320319    m_pISOSelectorLabel = new QLabel;
     
    324323        m_pISOSelectorLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
    325324        m_pISOSelectorLabel->setEnabled(false);
    326         pLayout->addWidget(m_pISOSelectorLabel, iRow, 0, 1, 1, Qt::AlignRight);
     325        pLayout->addWidget(m_pISOSelectorLabel, iRow, 1, 1, 1);
    327326    }
    328327    m_pISOFilePathSelector = new UIFilePathSelector;
     
    332331        m_pISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open);
    333332        m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO");
    334         m_pISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    335333        m_pISOFilePathSelector->setEnabled(false);
    336         pLayout->addWidget(m_pISOFilePathSelector, iRow++, 1, 1, 3);
     334        pLayout->addWidget(m_pISOFilePathSelector, iRow++, 2, 1, 4);
    337335    }
    338336
     
    341339    {
    342340        m_pStartHeadlessCheckBox->setEnabled(false);
    343         pLayout->addWidget(m_pStartHeadlessCheckBox, iRow++, 1, 1, 1);
     341        pLayout->addWidget(m_pStartHeadlessCheckBox, iRow++, 1, 1, 5);
    344342    }
    345343
    346344    pLayout->addWidget(horizontalLine(), iRow++, 0, 1, 4);
    347345
    348     m_pSystemTypeEditor = new UINameAndSystemEditor(0, false, false, true);
    349     if (m_pSystemTypeEditor)
    350         pLayout->addWidget(m_pSystemTypeEditor, iRow++, 0, 1, 4);
    351346    return pContainer;
    352347}
     
    354349bool UIWizardNewVMPage1::createMachineFolder()
    355350{
    356     if (!m_pNameAndFolderEditor)
     351    if (!m_pNameAndSystemEditor)
    357352        return false;
    358353    /* Cleanup previosly created folder if any: */
     
    441436QString UIWizardNewVMPage1::guestOSFamiyId() const
    442437{
    443     if (!m_pSystemTypeEditor)
     438    if (!m_pNameAndSystemEditor)
    444439        return QString();
    445     return m_pSystemTypeEditor->familyId();
     440    return m_pNameAndSystemEditor->familyId();
    446441}
    447442
     
    482477    if (m_pISOFilePathSelector)
    483478        m_pISOFilePathSelector->mark(!isISOFileSelectorComplete());
    484     if (m_pNameAndFolderEditor)
    485         m_pNameAndFolderEditor->markNameLineEdit(m_pNameAndFolderEditor->name().isEmpty());
     479    if (m_pNameAndSystemEditor)
     480        m_pNameAndSystemEditor->markNameLineEdit(m_pNameAndSystemEditor->name().isEmpty());
    486481}
    487482
     
    528523    createConnections();
    529524    /* Register fields: */
    530     registerField("name*", m_pNameAndFolderEditor, "name", SIGNAL(sigNameChanged(const QString &)));
    531     registerField("type", m_pSystemTypeEditor, "type", SIGNAL(sigOsTypeChanged()));
     525    registerField("name*", m_pNameAndSystemEditor, "name", SIGNAL(sigNameChanged(const QString &)));
     526    registerField("type", m_pNameAndSystemEditor, "type", SIGNAL(sigOsTypeChanged()));
    532527    registerField("machineFilePath", this, "machineFilePath");
    533528    registerField("machineFolder", this, "machineFolder");
     
    544539    connect(m_pEnableUnattendedInstallCheckBox, &QCheckBox::clicked, this, &UIWizardNewVMPageBasic1::sltUnattendedCheckBoxToggle);
    545540    connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, this, &UIWizardNewVMPageBasic1::sltISOPathChanged);
    546     connect(m_pNameAndFolderEditor, &UINameAndSystemEditor::sigNameChanged, this, &UIWizardNewVMPageBasic1::sltNameChanged);
    547     connect(m_pNameAndFolderEditor, &UINameAndSystemEditor::sigPathChanged, this, &UIWizardNewVMPageBasic1::sltPathChanged);
    548     connect(m_pSystemTypeEditor, &UINameAndSystemEditor::sigOsTypeChanged, this, &UIWizardNewVMPageBasic1::sltOsTypeChanged);
     541    connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, this, &UIWizardNewVMPageBasic1::sltNameChanged);
     542    connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, this, &UIWizardNewVMPageBasic1::sltPathChanged);
     543    connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, this, &UIWizardNewVMPageBasic1::sltOsTypeChanged);
    549544}
    550545
     
    560555{
    561556    markWidgets();
    562     if (m_pNameAndFolderEditor->name().isEmpty())
     557    if (m_pNameAndSystemEditor->name().isEmpty())
    563558        return false;
    564559    return isISOFileSelectorComplete();
     
    620615                                             "to identify this machine."));
    621616
    622     // if (   m_pNameAndFolderEditor
     617    // if (   m_pNameAndSystemEditor
    623618    //        && m_pSystemTypeEditor
    624619    //        && m_pISOSelectorLabel)
     
    626621    //     int iMinWidthHint = 0;
    627622    //     iMinWidthHint = qMax(iMinWidthHint, m_pISOSelectorLabel->minimumSizeHint().width());
    628     //     m_pNameAndFolderEditor->setMinimumLayoutIndent(iMinWidthHint);
     623    //     m_pNameAndSystemEditor->setMinimumLayoutIndent(iMinWidthHint);
    629624    //     m_pSystemTypeEditor->setMinimumLayoutIndent(iMinWidthHint);
    630625    // }
     
    635630    /* Translate page: */
    636631    retranslateUi();
    637     if (m_pNameAndFolderEditor)
    638         m_pNameAndFolderEditor->setFocus();
     632    if (m_pNameAndSystemEditor)
     633        m_pNameAndSystemEditor->setFocus();
    639634}
    640635
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h

    r87249 r87294  
    9595       /** We have two UINameAndSystemEditor instance since name/vm path fields and OS type fields
    9696        * are separated. */
    97        UINameAndSystemEditor *m_pNameAndFolderEditor;
    98        UINameAndSystemEditor *m_pSystemTypeEditor;
     97       UINameAndSystemEditor *m_pNameAndSystemEditor;
    9998       QIRichTextLabel *m_pUnattendedLabel;
    10099       QIRichTextLabel *m_pNameOSTypeLabel;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r87249 r87294  
    6969    qRegisterMetaType<CMedium>();
    7070    /* Register fields: */
    71     registerField("name*", m_pNameAndFolderEditor, "name", SIGNAL(sigNameChanged(const QString &)));
    72     registerField("type", m_pSystemTypeEditor, "type", SIGNAL(sigOsTypeChanged()));
     71    registerField("name*", m_pNameAndSystemEditor, "name", SIGNAL(sigNameChanged(const QString &)));
     72    registerField("type", m_pNameAndSystemEditor, "type", SIGNAL(sigOsTypeChanged()));
    7373    registerField("machineFilePath", this, "machineFilePath");
    7474    registerField("machineFolder", this, "machineFolder");
     
    9191    registerField("VCPUCount", this, "VCPUCount");
    9292
     93    const QPalette pal = palette();
     94    QColor tabBackgroundColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(110);
     95    QColor textColor = pal.color(QPalette::Active, QPalette::Text).lighter();
     96    QColor disabledTextColor = pal.color(QPalette::Disabled, QPalette::Text).lighter();
     97
    9398    m_pToolBox->setStyleSheet(QString::fromUtf8("QToolBox::tab {\n"
    94                                                 "    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,\n"
    95                                                 "                                stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,\n"
    96                                                 "                                stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);\n"
     99                                                "    background: %1; \n"
    97100                                                "    border-radius: 5px;\n"
    98                                                 "    color: black;\n"
     101                                                "    color: %2;\n"
    99102                                                "}\n"
    100103                                                "\n"
     
    108111                                                "QToolBox::tab:disabled {\n"
    109112                                                "    font: italic;\n"
    110                                                 "    color: gray;\n"
    111                                                 "}"));
     113                                                "    color: %3;\n"
     114                                                "}").arg(tabBackgroundColor.name()).arg(textColor.name()).arg(disabledTextColor.name()));
    112115
    113116    if (m_pEnableUnattendedInstallCheckBox)
     
    137140
    138141    /* Fetch recommended RAM value: */
    139     CGuestOSType type = m_pSystemTypeEditor->type();
     142    CGuestOSType type = m_pNameAndSystemEditor->type();
    140143    m_pBaseMemoryEditor->setValue(type.GetRecommendedRAM());
    141144
     
    213216{
    214217    /* Connections for Name, OS Type, and unattended install stuff: */
    215     if (m_pNameAndFolderEditor)
    216     {
    217         connect(m_pNameAndFolderEditor, &UINameAndSystemEditor::sigNameChanged,
     218    if (m_pNameAndSystemEditor)
     219    {
     220        connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged,
    218221                this, &UIWizardNewVMPageExpert::sltNameChanged);
    219         connect(m_pNameAndFolderEditor, &UINameAndSystemEditor::sigPathChanged,
     222        connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged,
    220223                this, &UIWizardNewVMPageExpert::sltPathChanged);
    221     }
    222     if (m_pSystemTypeEditor)
    223     {
    224         connect(m_pSystemTypeEditor, &UINameAndSystemEditor::sigOsTypeChanged,
     224        connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged,
    225225                this, &UIWizardNewVMPageExpert::sltOsTypeChanged);
    226         connect(m_pSystemTypeEditor, &UINameAndSystemEditor::sigOSFamilyChanged,
     226        connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOSFamilyChanged,
    227227                this, &UIWizardNewVMPageExpert::sltOSFamilyTypeChanged);
    228228    }
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