VirtualBox

Changeset 91561 in vbox


Ignore:
Timestamp:
Oct 5, 2021 10:15:55 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147268
Message:

FE/Qt: bugref:9996: UIWizardImportApp: A bit of cleanup for page constructors.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp

    r91522 r91561  
    370370    , m_pLabelDescription(0)
    371371{
    372     /* Create main layout: */
     372    /* Prepare main layout: */
    373373    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    374374    if (pMainLayout)
    375375    {
    376         /* Create main label: */
     376        /* Prepare main label: */
    377377        m_pLabelMain = new QIRichTextLabel(this);
    378378        if (m_pLabelMain)
    379         {
    380             /* Add into layout: */
    381379            pMainLayout->addWidget(m_pLabelMain);
    382         }
    383 
    384         /* Create source layout: */
     380
     381        /* Prepare source layout: */
    385382        m_pSourceLayout = new QGridLayout;
    386383        if (m_pSourceLayout)
     
    390387            m_pSourceLayout->setColumnStretch(1, 1);
    391388
    392             /* Create source label: */
     389            /* Prepare source label: */
    393390            m_pSourceLabel = new QLabel(this);
    394391            if (m_pSourceLabel)
    395             {
    396                 /* Add into layout: */
    397392                m_pSourceLayout->addWidget(m_pSourceLabel, 0, 0, Qt::AlignRight);
    398             }
    399             /* Create source selector: */
     393            /* Prepare source selector: */
    400394            m_pSourceComboBox = new QIComboBox(this);
    401395            if (m_pSourceComboBox)
    402396            {
    403397                m_pSourceLabel->setBuddy(m_pSourceComboBox);
    404 
    405                 /* Add into layout: */
    406398                m_pSourceLayout->addWidget(m_pSourceComboBox, 0, 1);
    407399            }
     
    411403        }
    412404
    413         /* Create description label: */
     405        /* Prepare description label: */
    414406        m_pLabelDescription = new QIRichTextLabel(this);
    415407        if (m_pLabelDescription)
    416         {
    417             /* Add into layout: */
    418408            pMainLayout->addWidget(m_pLabelDescription);
    419         }
    420 
    421         /* Create stacked layout: */
     409
     410        /* Prepare stacked layout: */
    422411        m_pStackedLayout = new QStackedLayout;
    423412        if (m_pStackedLayout)
    424413        {
    425             /* Create local container: */
     414            /* Prepare local container: */
    426415            QWidget *pLocalContainer = new QWidget(this);
    427416            if (pLocalContainer)
    428417            {
    429                 /* Create local container layout: */
     418                /* Prepare local container layout: */
    430419                m_pLocalContainerLayout = new QGridLayout(pLocalContainer);
    431420                if (m_pLocalContainerLayout)
     
    436425                    m_pLocalContainerLayout->setRowStretch(1, 1);
    437426
    438                     /* Create file label: */
    439                     m_pFileLabel = new QLabel;
     427                    /* Prepare file label: */
     428                    m_pFileLabel = new QLabel(pLocalContainer);
    440429                    if (m_pFileLabel)
    441                     {
    442                         /* Add into layout: */
    443430                        m_pLocalContainerLayout->addWidget(m_pFileLabel, 0, 0, Qt::AlignRight);
    444                     }
    445 
    446                     /* Create file-path selector: */
    447                     m_pFileSelector = new UIEmptyFilePathSelector(this);
     431
     432                    /* Prepare file-path selector: */
     433                    m_pFileSelector = new UIEmptyFilePathSelector(pLocalContainer);
    448434                    if (m_pFileSelector)
    449435                    {
     
    453439                        m_pFileSelector->setButtonPosition(UIEmptyFilePathSelector::RightPosition);
    454440                        m_pFileSelector->setEditable(true);
    455 
    456                         /* Add into layout: */
    457441                        m_pLocalContainerLayout->addWidget(m_pFileSelector, 0, 1);
    458442                    }
     
    463447            }
    464448
    465             /* Create cloud container: */
     449            /* Prepare cloud container: */
    466450            QWidget *pCloudContainer = new QWidget(this);
    467451            if (pCloudContainer)
    468452            {
    469                 /* Create cloud container layout: */
     453                /* Prepare cloud container layout: */
    470454                m_pCloudContainerLayout = new QGridLayout(pCloudContainer);
    471455                if (m_pCloudContainerLayout)
     
    477461                    m_pCloudContainerLayout->setRowStretch(2, 1);
    478462
    479                     /* Create profile label: */
    480                     m_pProfileLabel = new QLabel;
     463                    /* Prepare profile label: */
     464                    m_pProfileLabel = new QLabel(pCloudContainer);
    481465                    if (m_pProfileLabel)
    482                     {
    483                         /* Add into layout: */
    484466                        m_pCloudContainerLayout->addWidget(m_pProfileLabel, 0, 0, Qt::AlignRight);
    485                     }
    486 
    487                     /* Create sub-layout: */
     467
     468                    /* Prepare sub-layout: */
    488469                    QHBoxLayout *pSubLayout = new QHBoxLayout;
    489470                    if (pSubLayout)
     
    492473                        pSubLayout->setSpacing(1);
    493474
    494                         /* Create profile combo-box: */
    495                         m_pProfileComboBox = new QIComboBox;
     475                        /* Prepare profile combo-box: */
     476                        m_pProfileComboBox = new QIComboBox(pCloudContainer);
    496477                        if (m_pProfileComboBox)
    497478                        {
    498479                            m_pProfileLabel->setBuddy(m_pProfileComboBox);
    499 
    500                             /* Add into layout: */
    501480                            pSubLayout->addWidget(m_pProfileComboBox);
    502481                        }
    503482
    504                         /* Create profile tool-button: */
    505                         m_pProfileToolButton = new QIToolButton;
     483                        /* Prepare profile tool-button: */
     484                        m_pProfileToolButton = new QIToolButton(pCloudContainer);
    506485                        if (m_pProfileToolButton)
    507486                        {
    508487                            m_pProfileToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png",
    509488                                                                              ":/cloud_profile_manager_disabled_16px.png"));
    510 
    511                             /* Add into layout: */
    512489                            pSubLayout->addWidget(m_pProfileToolButton);
    513490                        }
     
    517494                    }
    518495
    519                     /* Create profile instance label: */
    520                     m_pProfileInstanceLabel = new QLabel;
     496                    /* Prepare profile instance label: */
     497                    m_pProfileInstanceLabel = new QLabel(pCloudContainer);
    521498                    if (m_pProfileInstanceLabel)
    522                     {
    523                         /* Add into layout: */
    524499                        m_pCloudContainerLayout->addWidget(m_pProfileInstanceLabel, 1, 0, Qt::AlignRight);
    525                     }
    526 
    527                     /* Create profile instances table: */
    528                     m_pProfileInstanceList = new QListWidget;
     500
     501                    /* Prepare profile instances table: */
     502                    m_pProfileInstanceList = new QListWidget(pCloudContainer);
    529503                    if (m_pProfileInstanceList)
    530504                    {
     
    538512//                        m_pProfileInstanceList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    539513                        m_pProfileInstanceList->setAlternatingRowColors(true);
    540 
    541                         /* Add into layout: */
    542514                        m_pCloudContainerLayout->addWidget(m_pProfileInstanceList, 1, 1, 2, 1);
    543515                    }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp

    r82968 r91561  
    7373    if (pMainLayout)
    7474    {
    75         /* Create label: */
     75        /* Prepare label: */
    7676        m_pLabel = new QIRichTextLabel(this);
    7777        if (m_pLabel)
    78         {
    79             /* Add into layout: */
    8078            pMainLayout->addWidget(m_pLabel);
    81         }
    82 
    83         /* Create settings container layout: */
     79
     80        /* Prepare settings container layout: */
    8481        m_pSettingsCntLayout = new QStackedLayout;
    8582        if (m_pSettingsCntLayout)
    8683        {
    87             /* Create appliance widget container: */
     84            /* Prepare appliance widget container: */
    8885            QWidget *pApplianceWidgetCnt = new QWidget(this);
    8986            if (pApplianceWidgetCnt)
    9087            {
    91                 /* Create appliance widget layout: */
     88                /* Prepare appliance widget layout: */
    9289                QVBoxLayout *pApplianceWidgetLayout = new QVBoxLayout(pApplianceWidgetCnt);
    9390                if (pApplianceWidgetLayout)
     
    9592                    pApplianceWidgetLayout->setContentsMargins(0, 0, 0, 0);
    9693
    97                     /* Create appliance widget: */
     94                    /* Prepare appliance widget: */
    9895                    m_pApplianceWidget = new UIApplianceImportEditorWidget(pApplianceWidgetCnt);
    9996                    if (m_pApplianceWidget)
     
    10198                        m_pApplianceWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
    10299                        m_pApplianceWidget->setFile(strFileName);
    103 
    104                         /* Add into layout: */
    105100                        pApplianceWidgetLayout->addWidget(m_pApplianceWidget);
    106101                    }
    107102
    108                     /* Create certificate label: */
    109                     m_pCertLabel = new QLabel(QString(), pApplianceWidgetCnt);
     103                    /* Prepare certificate label: */
     104                    m_pCertLabel = new QLabel(pApplianceWidgetCnt);
    110105                    if (m_pCertLabel)
    111                     {
    112                         /* Add into layout: */
    113106                        pApplianceWidgetLayout->addWidget(m_pCertLabel);
    114                     }
    115107                }
    116108
     
    119111            }
    120112
    121             /* Create form editor container: */
     113            /* Prepare form editor container: */
    122114            QWidget *pFormEditorCnt = new QWidget(this);
    123115            if (pFormEditorCnt)
    124116            {
    125                 /* Create form editor layout: */
     117                /* Prepare form editor layout: */
    126118                QVBoxLayout *pFormEditorLayout = new QVBoxLayout(pFormEditorCnt);
    127119                if (pFormEditorLayout)
     
    129121                    pFormEditorLayout->setContentsMargins(0, 0, 0, 0);
    130122
    131                     /* Create form editor widget: */
     123                    /* Prepare form editor widget: */
    132124                    m_pFormEditor = new UIFormEditorWidget(pFormEditorCnt);
    133125                    if (m_pFormEditor)
    134                     {
    135                         /* Add into layout: */
    136126                        pFormEditorLayout->addWidget(m_pFormEditor);
    137                     }
    138127                }
    139128
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.cpp

    r91522 r91561  
    4545    , m_pSettingsCnt(0)
    4646{
    47     /* Create main layout: */
     47    /* Prepare main layout: */
    4848    QHBoxLayout *pMainLayout = new QHBoxLayout(this);
    4949    if (pMainLayout)
    5050    {
    51         /* Create source container: */
     51        /* Prepare source container: */
    5252        m_pCntSource = new QGroupBox(this);
    5353        if (m_pCntSource)
    5454        {
    55             /* Create source layout: */
     55            /* Prepare source layout: */
    5656            m_pSourceLayout = new QGridLayout(m_pCntSource);
    5757            if (m_pSourceLayout)
    5858            {
    59                 /* Create source selector: */
     59                /* Prepare source selector: */
    6060                m_pSourceComboBox = new QIComboBox(m_pCntSource);
    6161                if (m_pSourceComboBox)
    62                 {
    63                     /* Add into layout: */
    6462                    m_pSourceLayout->addWidget(m_pSourceComboBox, 0, 0);
    65                 }
    66 
    67                 /* Create stacked layout: */
     63
     64                /* Prepare stacked layout: */
    6865                m_pStackedLayout = new QStackedLayout;
    6966                if (m_pStackedLayout)
    7067                {
    71                     /* Create local container: */
     68                    /* Prepare local container: */
    7269                    QWidget *pLocalContainer = new QWidget(m_pCntSource);
    7370                    if (pLocalContainer)
    7471                    {
    75                         /* Create local container layout: */
     72                        /* Prepare local container layout: */
    7673                        m_pLocalContainerLayout = new QGridLayout(pLocalContainer);
    7774                        if (m_pLocalContainerLayout)
     
    8077                            m_pLocalContainerLayout->setRowStretch(1, 1);
    8178
    82                             /* Create file-path selector: */
     79                            /* Prepare file-path selector: */
    8380                            m_pFileSelector = new UIEmptyFilePathSelector(pLocalContainer);
    8481                            if (m_pFileSelector)
     
    8885                                m_pFileSelector->setButtonPosition(UIEmptyFilePathSelector::RightPosition);
    8986                                m_pFileSelector->setEditable(true);
    90 
    91                                 /* Add into layout: */
    9287                                m_pLocalContainerLayout->addWidget(m_pFileSelector, 0, 0);
    9388                            }
     
    9893                    }
    9994
    100                     /* Create cloud container: */
     95                    /* Prepare cloud container: */
    10196                    QWidget *pCloudContainer = new QWidget(m_pCntSource);
    10297                    if (pCloudContainer)
    10398                    {
    104                         /* Create cloud container layout: */
     99                        /* Prepare cloud container layout: */
    105100                        m_pCloudContainerLayout = new QGridLayout(pCloudContainer);
    106101                        if (m_pCloudContainerLayout)
     
    109104                            m_pCloudContainerLayout->setRowStretch(1, 1);
    110105
    111                             /* Create sub-layout: */
     106                            /* Prepare sub-layout: */
    112107                            QHBoxLayout *pSubLayout = new QHBoxLayout;
    113108                            if (pSubLayout)
     
    116111                                pSubLayout->setSpacing(1);
    117112
    118                                 /* Create profile combo-box: */
     113                                /* Prepare profile combo-box: */
    119114                                m_pProfileComboBox = new QIComboBox(pCloudContainer);
    120115                                if (m_pProfileComboBox)
    121                                 {
    122                                     /* Add into layout: */
    123116                                    pSubLayout->addWidget(m_pProfileComboBox);
    124                                 }
    125 
    126                                 /* Create profile tool-button: */
     117
     118                                /* Prepare profile tool-button: */
    127119                                m_pProfileToolButton = new QIToolButton(pCloudContainer);
    128120                                if (m_pProfileToolButton)
     
    130122                                    m_pProfileToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png",
    131123                                                                                      ":/cloud_profile_manager_disabled_16px.png"));
    132 
    133                                     /* Add into layout: */
    134124                                    pSubLayout->addWidget(m_pProfileToolButton);
    135125                                }
     
    151141//                                m_pProfileInstanceList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    152142                                m_pProfileInstanceList->setAlternatingRowColors(true);
    153 
    154                                 /* Add into layout: */
    155143                                m_pCloudContainerLayout->addWidget(m_pProfileInstanceList, 1, 0);
    156144                            }
     
    170158        }
    171159
    172         /* Create settings container: */
     160        /* Prepare settings container: */
    173161        m_pSettingsCnt = new QGroupBox(this);
    174162        if (m_pSettingsCnt)
    175163        {
    176             /* Create settings container layout: */
     164            /* Prepare settings container layout: */
    177165            m_pSettingsCntLayout = new QStackedLayout(m_pSettingsCnt);
    178166            if (m_pSettingsCntLayout)
    179167            {
    180                 /* Create appliance widget container: */
     168                /* Prepare appliance widget container: */
    181169                QWidget *pApplianceWidgetCnt = new QWidget(m_pSettingsCnt);
    182170                if (pApplianceWidgetCnt)
    183171                {
    184                     /* Create appliance widget layout: */
     172                    /* Prepare appliance widget layout: */
    185173                    QVBoxLayout *pApplianceWidgetLayout = new QVBoxLayout(pApplianceWidgetCnt);
    186174                    if (pApplianceWidgetLayout)
    187175                    {
    188                         /* Create appliance widget: */
     176                        /* Prepare appliance widget: */
    189177                        m_pApplianceWidget = new UIApplianceImportEditorWidget(pApplianceWidgetCnt);
    190178                        if (m_pApplianceWidget)
     
    192180                            m_pApplianceWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
    193181                            m_pApplianceWidget->setFile(strFileName);
    194 
    195                             /* Add into layout: */
    196182                            pApplianceWidgetLayout->addWidget(m_pApplianceWidget);
    197183                        }
     
    202188                }
    203189
    204                 /* Create form editor container: */
     190                /* Prepare form editor container: */
    205191                QWidget *pFormEditorCnt = new QWidget(m_pSettingsCnt);
    206192                if (pFormEditorCnt)
    207193                {
    208                     /* Create form editor layout: */
     194                    /* Prepare form editor layout: */
    209195                    QVBoxLayout *pFormEditorLayout = new QVBoxLayout(pFormEditorCnt);
    210196                    if (pFormEditorLayout)
    211197                    {
    212                         /* Create form editor widget: */
     198                        /* Prepare form editor widget: */
    213199                        m_pFormEditor = new UIFormEditorWidget(pFormEditorCnt);
    214200                        if (m_pFormEditor)
    215                         {
    216                             /* Add into layout: */
    217201                            pFormEditorLayout->addWidget(m_pFormEditor);
    218                         }
    219202                    }
    220203
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