VirtualBox

Changeset 84277 in vbox


Ignore:
Timestamp:
May 12, 2020 5:51:16 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: New Cloud VM wizard: Rename image label/list to source label/list, we are going to support more than one source type.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.cpp

    r84276 r84277  
    5353    , m_pAccountToolButton(0)
    5454    , m_pAccountPropertyTable(0)
    55     , m_pAccountImageLabel(0)
    56     , m_pAccountImageList(0)
     55    , m_pSourceImageLabel(0)
     56    , m_pSourceImageList(0)
    5757{
    5858}
     
    269269}
    270270
    271 void UIWizardNewCloudVMPage1::populateAccountImages()
     271void UIWizardNewCloudVMPage1::populateSourceImages()
    272272{
    273273    /* Block signals while updating: */
    274     m_pAccountImageList->blockSignals(true);
     274    m_pSourceImageList->blockSignals(true);
    275275
    276276    /* Clear list initially: */
    277     m_pAccountImageList->clear();
     277    m_pSourceImageList->clear();
    278278    /* Clear Cloud Client: */
    279279    setClient(CCloudClient());
     
    326326            {
    327327                /* Create list item: */
    328                 QListWidgetItem *pItem = new QListWidgetItem(names.at(i), m_pAccountImageList);
     328                QListWidgetItem *pItem = new QListWidgetItem(names.at(i), m_pSourceImageList);
    329329                if (pItem)
    330330                {
     
    335335
    336336            /* Choose the 1st one by default if possible: */
    337             if (m_pAccountImageList->count())
    338                 m_pAccountImageList->setCurrentRow(0);
     337            if (m_pSourceImageList->count())
     338                m_pSourceImageList->setCurrentRow(0);
    339339        }
    340340        while (0);
     
    342342
    343343    /* Unblock signals after update: */
    344     m_pAccountImageList->blockSignals(false);
     344    m_pSourceImageList->blockSignals(false);
    345345}
    346346
     
    475475QString UIWizardNewCloudVMPage1::imageId() const
    476476{
    477     QListWidgetItem *pItem = m_pAccountImageList->currentItem();
     477    QListWidgetItem *pItem = m_pSourceImageList->currentItem();
    478478    return pItem ? pItem->data(Qt::UserRole).toString() : QString();
    479479}
     
    584584            }
    585585            /* Create sub-layout: */
    586             QHBoxLayout *pSubLayout = new QHBoxLayout;
    587             if (pSubLayout)
    588             {
    589                 pSubLayout->setContentsMargins(0, 0, 0, 0);
    590                 pSubLayout->setSpacing(1);
     586            QHBoxLayout *pAccountLayout = new QHBoxLayout;
     587            if (pAccountLayout)
     588            {
     589                pAccountLayout->setContentsMargins(0, 0, 0, 0);
     590                pAccountLayout->setSpacing(1);
    591591
    592592                /* Create account combo-box: */
     
    597597
    598598                    /* Add into layout: */
    599                     pSubLayout->addWidget(m_pAccountComboBox);
     599                    pAccountLayout->addWidget(m_pAccountComboBox);
    600600                }
    601601                /* Create account tool-button: */
     
    607607
    608608                    /* Add into layout: */
    609                     pSubLayout->addWidget(m_pAccountToolButton);
     609                    pAccountLayout->addWidget(m_pAccountToolButton);
    610610                }
    611611
    612612                /* Add into layout: */
    613                 m_pCloudContainerLayout->addLayout(pSubLayout, 0, 1);
     613                m_pCloudContainerLayout->addLayout(pAccountLayout, 0, 1);
    614614            }
    615615
     
    634634            }
    635635
    636             /* Create account instance label: */
    637             m_pAccountImageLabel = new QLabel(this);
    638             if (m_pAccountImageLabel)
     636            /* Create source image label: */
     637            m_pSourceImageLabel = new QLabel(this);
     638            if (m_pSourceImageLabel)
    639639            {
    640640                /* Add into layout: */
    641                 m_pCloudContainerLayout->addWidget(m_pAccountImageLabel, 2, 0, Qt::AlignRight);
    642             }
    643             /* Create profile instances table: */
    644             m_pAccountImageList = new QListWidget(this);
    645             if (m_pAccountImageList)
    646             {
    647                 m_pAccountImageLabel->setBuddy(m_pAccountImageLabel);
    648                 const QFontMetrics fm(m_pAccountImageList->font());
     641                m_pCloudContainerLayout->addWidget(m_pSourceImageLabel, 2, 0, Qt::AlignRight);
     642            }
     643            /* Create source image list: */
     644            m_pSourceImageList = new QListWidget(this);
     645            if (m_pSourceImageList)
     646            {
     647                m_pSourceImageLabel->setBuddy(m_pSourceImageList);
     648                const QFontMetrics fm(m_pSourceImageList->font());
    649649                const int iFontWidth = fm.width('x');
    650650                const int iTotalWidth = 50 * iFontWidth;
    651651                const int iFontHeight = fm.height();
    652652                const int iTotalHeight = 4 * iFontHeight;
    653                 m_pAccountImageList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));
    654                 //m_pAccountImageList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    655                 m_pAccountImageList->setAlternatingRowColors(true);
     653                m_pSourceImageList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));
     654                //m_pSourceImageList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
     655                m_pSourceImageList->setAlternatingRowColors(true);
    656656
    657657                /* Add into layout: */
    658                 m_pCloudContainerLayout->addWidget(m_pAccountImageList, 2, 1, 2, 1);
     658                m_pCloudContainerLayout->addWidget(m_pSourceImageList, 2, 1, 2, 1);
    659659            }
    660660
     
    674674    connect(m_pAccountToolButton, &QIToolButton::clicked,
    675675            this, &UIWizardNewCloudVMPageBasic1::sltHandleAccountButtonClick);
    676     connect(m_pAccountImageList, &QListWidget::currentRowChanged,
     676    connect(m_pSourceImageList, &QListWidget::currentRowChanged,
    677677            this, &UIWizardNewCloudVMPageBasic1::completeChanged);
    678678
     
    729729    /* Translate cloud stuff: */
    730730    m_pAccountLabel->setText(UIWizardNewCloudVM::tr("&Account:"));
    731     m_pAccountImageLabel->setText(UIWizardNewCloudVM::tr("&Images:"));
     731    m_pSourceImageLabel->setText(UIWizardNewCloudVM::tr("&Source:"));
    732732
    733733    /* Adjust label widths: */
     
    735735    labels << m_pLocationLabel;
    736736    labels << m_pAccountLabel;
    737     labels << m_pAccountImageLabel;
     737    labels << m_pSourceImageLabel;
    738738    int iMaxWidth = 0;
    739739    foreach (QWidget *pLabel, labels)
     
    797797
    798798    /* Make image list focused by default: */
    799     m_pAccountImageList->setFocus();
     799    m_pSourceImageList->setFocus();
    800800
    801801    /* Refresh required settings: */
    802802    populateAccounts();
    803803    populateAccountProperties();
    804     populateAccountImages();
     804    populateSourceImages();
    805805    emit completeChanged();
    806806}
     
    810810    /* Refresh required settings: */
    811811    populateAccountProperties();
    812     populateAccountImages();
     812    populateSourceImages();
    813813    emit completeChanged();
    814814}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.h

    r84275 r84277  
    7171    /** Populates account properties. */
    7272    void populateAccountProperties();
    73     /** Populates account images. */
    74     void populateAccountImages();
     73    /** Populates source images. */
     74    void populateSourceImages();
    7575    /** Populates form properties. */
    7676    void populateFormProperties();
     
    137137    /** Holds the account property table instance. */
    138138    QTableWidget *m_pAccountPropertyTable;
    139     /** Holds the account image label instance. */
    140     QLabel       *m_pAccountImageLabel;
    141     /** Holds the account image list instance. */
    142     QListWidget  *m_pAccountImageList;
     139    /** Holds the source image label instance. */
     140    QLabel       *m_pSourceImageLabel;
     141    /** Holds the source image list instance. */
     142    QListWidget  *m_pSourceImageList;
    143143};
    144144
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp

    r84275 r84277  
    118118                    }
    119119
    120                     /* Create profile instances table: */
    121                     m_pAccountImageList = new QListWidget(m_pCntLocation);
    122                     if (m_pAccountImageList)
     120                    /* Create source image list: */
     121                    m_pSourceImageList = new QListWidget(m_pCntLocation);
     122                    if (m_pSourceImageList)
    123123                    {
    124                         const QFontMetrics fm(m_pAccountImageList->font());
     124                        const QFontMetrics fm(m_pSourceImageList->font());
    125125                        const int iFontWidth = fm.width('x');
    126126                        const int iTotalWidth = 50 * iFontWidth;
    127127                        const int iFontHeight = fm.height();
    128128                        const int iTotalHeight = 4 * iFontHeight;
    129                         m_pAccountImageList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));
    130                         //m_pAccountImageList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    131                         m_pAccountImageList->setAlternatingRowColors(true);
     129                        m_pSourceImageList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));
     130                        //m_pSourceImageList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
     131                        m_pSourceImageList->setAlternatingRowColors(true);
    132132
    133133                        /* Add into layout: */
    134                         m_pCloudContainerLayout->addWidget(m_pAccountImageList, 2, 0);
     134                        m_pCloudContainerLayout->addWidget(m_pSourceImageList, 2, 0);
    135135                    }
    136136
     
    183183    connect(m_pAccountToolButton, &QIToolButton::clicked,
    184184            this, &UIWizardNewCloudVMPageExpert::sltHandleAccountButtonClick);
    185     connect(m_pAccountImageList, &QListWidget::currentRowChanged,
     185    connect(m_pSourceImageList, &QListWidget::currentRowChanged,
    186186            this, &UIWizardNewCloudVMPageExpert::sltHandleInstanceListChange);
    187187
     
    316316
    317317    /* Make image list focused by default: */
    318     m_pAccountImageList->setFocus();
     318    m_pSourceImageList->setFocus();
    319319
    320320    /* Refresh required settings: */
    321321    populateAccounts();
    322322    populateAccountProperties();
    323     populateAccountImages();
     323    populateSourceImages();
    324324    populateFormProperties();
    325325    refreshFormPropertiesTable();
     
    331331    /* Refresh required settings: */
    332332    populateAccountProperties();
    333     populateAccountImages();
     333    populateSourceImages();
    334334    populateFormProperties();
    335335    refreshFormPropertiesTable();
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