Changeset 78061 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 9, 2019 1:42:47 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp
r77388 r78061 500 500 void UIWizardExportAppPage2::updatePageAppearance() 501 501 { 502 /* Update page appearance according to chosen storage-type: */502 /* Update page appearance according to chosen format: */ 503 503 m_pSettingsWidget->setCurrentIndex((int)isFormatCloudOne()); 504 504 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp
r78046 r78061 54 54 UIWizardImportAppPage1::UIWizardImportAppPage1() 55 55 : m_pSourceLabel(0) 56 , m_pSource Selector(0)56 , m_pSourceComboBox(0) 57 57 , m_pStackedLayout(0) 58 58 , m_pFileSelector(0) … … 80 80 } 81 81 82 /* Create source selectorlayout: */83 QHBoxLayout *pSource SelectorLayout = new QHBoxLayout;84 if (pSource SelectorLayout)82 /* Create source layout: */ 83 QHBoxLayout *pSourceLayout = new QHBoxLayout; 84 if (pSourceLayout) 85 85 { 86 86 /* Create source label: */ … … 93 93 94 94 /* Add into layout: */ 95 pSource SelectorLayout->addWidget(m_pSourceLabel);95 pSourceLayout->addWidget(m_pSourceLabel); 96 96 } 97 97 98 98 /* Create source selector: */ 99 m_pSource Selector= new QIComboBox(this);100 if (m_pSource Selector)101 { 102 m_pSourceLabel->setBuddy(m_pSource Selector);103 m_pSource Selector->hide();104 m_pSource Selector->addItem(QString(), QVariant::fromValue(ImportSourceType_Local));105 m_pSource Selector->addItem(QString(), QVariant::fromValue(ImportSourceType_Cloud));106 connect(m_pSource Selector, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated),107 this, static_cast<void(UIWizardImportAppPageBasic1::*)(int)>(&UIWizardImportAppPageBasic1::sltHandleSourceChange));108 109 /* Add into layout: */ 110 pSource SelectorLayout->addWidget(m_pSourceSelector);99 m_pSourceComboBox = new QIComboBox(this); 100 if (m_pSourceComboBox) 101 { 102 m_pSourceLabel->setBuddy(m_pSourceComboBox); 103 m_pSourceComboBox->hide(); 104 m_pSourceComboBox->addItem(QString(), QVariant::fromValue(ImportSourceType_Local)); 105 m_pSourceComboBox->addItem(QString(), QVariant::fromValue(ImportSourceType_Cloud)); 106 connect(m_pSourceComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated), 107 this, &UIWizardImportAppPageBasic1::sltHandleSourceChange); 108 109 /* Add into layout: */ 110 pSourceLayout->addWidget(m_pSourceComboBox); 111 111 } 112 112 113 113 /* Add into layout: */ 114 pMainLayout->addLayout(pSource SelectorLayout);114 pMainLayout->addLayout(pSourceLayout); 115 115 } 116 116 … … 182 182 } 183 183 184 void UIWizardImportAppPageBasic1::sltHandleSourceChange(int iIndex)185 {186 m_pStackedLayout->setCurrentIndex(m_stackedLayoutIndexMap.value(m_pSourceSelector->itemData(iIndex).value<ImportSourceType>()));187 }188 189 184 void UIWizardImportAppPageBasic1::retranslateUi() 190 185 { … … 197 192 "To continue, select the file to import below.</p>")); 198 193 199 /* Translate source selector: */ 200 m_pSourceLabel->setText(tr("Source:")); 201 for (int i = 0; i < m_pSourceSelector->count(); ++i) 202 m_pSourceSelector->setItemText(i, ImportSourceTypeConverter::toString(m_pSourceSelector->itemData(i).value<ImportSourceType>())); 194 /* Translate source label: */ 195 m_pSourceLabel->setText(tr("&Source:")); 196 /* Translate received values of Source combo-box. 197 * We are enumerating starting from 0 for simplicity: */ 198 for (int i = 0; i < m_pSourceComboBox->count(); ++i) 199 m_pSourceComboBox->setItemText(i, ImportSourceTypeConverter::toString(m_pSourceComboBox->itemData(i).value<ImportSourceType>())); 203 200 204 201 /* Translate file selector: */ … … 210 207 void UIWizardImportAppPageBasic1::initializePage() 211 208 { 209 /* Translate page: */ 212 210 retranslateUi(); 213 211 } … … 239 237 return pImportApplianceWidget->isValid(); 240 238 } 239 240 void UIWizardImportAppPageBasic1::sltHandleSourceChange(int iIndex) 241 { 242 m_pStackedLayout->setCurrentIndex(m_stackedLayoutIndexMap.value(m_pSourceComboBox->itemData(iIndex).value<ImportSourceType>())); 243 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.h
r78046 r78061 50 50 /** Holds the source type label instance. */ 51 51 QLabel *m_pSourceLabel; 52 /** Holds the source type selectorinstance. */53 QIComboBox *m_pSource Selector;52 /** Holds the source type combo-box instance. */ 53 QIComboBox *m_pSourceComboBox; 54 54 55 55 /** Holds the stacked layout instance. */ … … 72 72 UIWizardImportAppPageBasic1(); 73 73 74 private slots: 75 76 /** Handles change of import source to one with specified @a iIndex. */ 77 void sltHandleSourceChange(int iIndex); 78 79 private: 74 protected: 80 75 81 76 /** Handles translation event. */ … … 91 86 virtual bool validatePage() /* override */; 92 87 88 private slots: 89 90 /** Handles change of import source to one with specified @a iIndex. */ 91 void sltHandleSourceChange(int iIndex); 92 93 private: 94 93 95 /** Holds the label instance. */ 94 96 QIRichTextLabel *m_pLabel;
Note:
See TracChangeset
for help on using the changeset viewer.