Changeset 73189 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 17, 2018 4:38:03 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123792
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
r73187 r73189 135 135 /* Acquire Cloud User-profile List: */ 136 136 CCloudUserProfileList comProfiles = m_comCloudUserProfileManager.GetProfilesByProvider(provider()); 137 AssertMsgReturnVoid(m_comCloudUserProfileManager.isOk() && comProfiles.isNotNull(), 138 ("Unable to acquire Cloud User-profile List")); 137 /* Return if we have nothing to populate (file missing?): */ 138 if (comProfiles.isNull()) 139 return; 139 140 140 141 /* Clear combo initially: */ … … 151 152 void UIWizardExportAppPage3::populateProfileSettings() 152 153 { 153 /* Acquire current profile table: */ 154 // Here goes the experiamental lists with 155 // arbitrary contents for testing purposes. 156 QStringList keys; 157 QStringList values; 158 keys << "Dummy Key 1"; 159 keys << "Dummy Key 2"; 160 keys << "Dummy Key 3"; 161 keys << "Dummy Key 4"; 162 values << "Dummy Value 1"; 163 values << "Dummy Value 2"; 164 values << "Dummy Value 3"; 165 values << "Dummy Value 4"; 154 /* Acquire Cloud User-profile List: */ 155 CCloudUserProfileList comProfiles = m_comCloudUserProfileManager.GetProfilesByProvider(provider()); 156 /* Return if we have nothing to populate (file missing?): */ 157 if (comProfiles.isNull()) 158 return; 159 160 /* Clear table initially: */ 166 161 m_pProfileSettingsTable->clear(); 167 m_pProfileSettingsTable->setRowCount(4); 162 163 /* Acquire profile properties: */ 164 QVector<QString> keys; 165 QVector<QString> values; 166 values = comProfiles.GetProfileProperties(profile(), keys); 167 168 /* Configure profile table: */ 169 m_pProfileSettingsTable->setRowCount(keys.size()); 168 170 m_pProfileSettingsTable->setColumnCount(2); 169 171 … … 171 173 for (int i = 0; i < m_pProfileSettingsTable->rowCount(); ++i) 172 174 { 173 QTableWidgetItem *pItem1 = new QTableWidgetItem(keys.at(i)); 174 pItem1->setFlags(pItem1->flags() & ~Qt::ItemIsEditable); 175 pItem1->setFlags(pItem1->flags() & ~Qt::ItemIsSelectable); 176 QTableWidgetItem *pItem2 = new QTableWidgetItem(values.at(i)); 177 pItem2->setFlags(pItem2->flags() & ~Qt::ItemIsEditable); 178 pItem2->setFlags(pItem2->flags() & ~Qt::ItemIsSelectable); 179 m_pProfileSettingsTable->setItem(i, 0, pItem1); 180 m_pProfileSettingsTable->setItem(i, 1, pItem2); 181 } 175 /* Create key item: */ 176 QTableWidgetItem *pItemK = new QTableWidgetItem(keys.at(i)); 177 if (pItemK) 178 { 179 /* Non-editable for sure, but non-selectable? */ 180 pItemK->setFlags(pItemK->flags() & ~Qt::ItemIsEditable); 181 pItemK->setFlags(pItemK->flags() & ~Qt::ItemIsSelectable); 182 183 /* Use non-translated description as tool-tip: */ 184 const QString strToolTip = comProfiles.GetPropertyDescription(keys.at(i)); 185 pItemK->setData(Qt::UserRole, strToolTip); 186 187 /* Insert into table: */ 188 m_pProfileSettingsTable->setItem(i, 0, pItemK); 189 } 190 191 /* Create value item: */ 192 QTableWidgetItem *pItemV = new QTableWidgetItem(values.at(i)); 193 if (pItemV) 194 { 195 /* Non-editable for sure, but non-selectable? */ 196 pItemV->setFlags(pItemV->flags() & ~Qt::ItemIsEditable); 197 pItemV->setFlags(pItemV->flags() & ~Qt::ItemIsSelectable); 198 199 /* Use the value as tool-tip, there can be quite long values: */ 200 const QString strToolTip = values.at(i); 201 pItemV->setToolTip(strToolTip); 202 203 /* Insert into table: */ 204 m_pProfileSettingsTable->setItem(i, 1, pItemV); 205 } 206 } 207 208 /* Update translateable tool-tips: */ 209 updateProfilePropertyTableToolTips(); 182 210 183 211 /* Adjust the table: */ … … 298 326 AssertMsg(!strCurrentToolTip.isEmpty(), ("Data not found!")); 299 327 m_pProviderComboBox->setToolTip(strCurrentToolTip); 328 } 329 330 void UIWizardExportAppPage3::updateProfilePropertyTableToolTips() 331 { 332 /* Iterate through all the key items: */ 333 for (int i = 0; i < m_pProfileSettingsTable->rowCount(); ++i) 334 { 335 /* Acquire current key item: */ 336 QTableWidgetItem *pItemK = m_pProfileSettingsTable->item(i, 0); 337 if (pItemK) 338 { 339 const QString strToolTip = pItemK->data(Qt::UserRole).toString(); 340 pItemK->setToolTip(QApplication::translate("UIWizardExportAppPageBasic3", strToolTip.toUtf8().constData())); 341 } 342 } 300 343 } 301 344 … … 735 778 updateMACAddressPolicyComboToolTip(); 736 779 updateProviderComboToolTip(); 780 updateProfilePropertyTableToolTips(); 737 781 } 738 782 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h
r73176 r73189 90 90 /** Updates provider combo tool-tips. */ 91 91 void updateProviderComboToolTip(); 92 /** Updates profile property tool-tips. */ 93 void updateProfilePropertyTableToolTips(); 92 94 93 95 /** Adjusts profile settings table. */
Note:
See TracChangeset
for help on using the changeset viewer.