Changeset 75376 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 9, 2018 7:11:40 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/cloud
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/cloud/UICloudProfileDetailsWidget.h
r74928 r75376 20 20 21 21 /* Qt includes: */ 22 #include <QMap> 22 23 #include <QUuid> 23 24 #include <QWidget> … … 62 63 /** Holds the provider name. */ 63 64 QString m_strName; 65 66 /** Holds the profile supported property descriptions. */ 67 QMap<QString, QString> m_propertyDescriptions; 64 68 }; 65 69 -
trunk/src/VBox/Frontends/VirtualBox/src/cloud/UICloudProfileManager.cpp
r75371 r75376 265 265 /* Update profile in the tree: */ 266 266 UIDataCloudProfile data; 267 loadCloudProfile(comCloudProfile, data);267 loadCloudProfile(comCloudProfile, *pProviderItem, data); 268 268 updateItemForCloudProfile(data, true, pProfileItem); 269 269 … … 333 333 { 334 334 /* Create new profile: */ 335 QVector<QString> keys;336 QVector<QString> values;335 const QVector<QString> keys = pProviderItem->m_propertyDescriptions.keys().toVector(); 336 const QVector<QString> values(keys.size()); 337 337 comCloudProvider.CreateProfile(strProfileName, keys, values); 338 338 … … 351 351 /* Add profile to the tree: */ 352 352 UIDataCloudProfile data; 353 loadCloudProfile(comCloudProfile, data);353 loadCloudProfile(comCloudProfile, *pProviderItem, data); 354 354 createItemForCloudProfile(pProviderItem, data, true); 355 356 /* If profile still Ok: */357 if (comCloudProfile.isOk())358 {359 /* Acquire supported property names: */360 const QVector<QString> supportedNames = comCloudProvider.GetSupportedPropertyNames();361 /* Show error message if necessary: */362 if (!comCloudProfile.isOk())363 msgCenter().cannotAcquireCloudProfileParameter(comCloudProfile, this);364 else365 {366 /* Add unknown supported properties to known properties list.367 * That allows to have at least something if we have nothing. */368 foreach (const QString &strSupportedName, supportedNames)369 if (!data.m_data.contains(strSupportedName))370 data.m_data[strSupportedName] = qMakePair(QString(), QString());371 }372 }373 355 374 356 /* If profile still Ok: */ … … 390 372 /* Update profile in the tree: */ 391 373 UIDataCloudProfile updatedData; 392 loadCloudProfile(comCloudProfile, updatedData);374 loadCloudProfile(comCloudProfile, *pProviderItem, updatedData); 393 375 updateItemForCloudProfile(updatedData, true, static_cast<UIItemCloudProfile*>(m_pTreeWidget->currentItem())); 394 376 sltHandleCurrentItemChange(); … … 778 760 /* Load profile data: */ 779 761 UIDataCloudProfile profileData; 780 loadCloudProfile(comCloudProfile, pro fileData);762 loadCloudProfile(comCloudProfile, providerData, profileData); 781 763 createItemForCloudProfile(pItem, profileData, false); 782 764 } … … 794 776 void UICloudProfileManagerWidget::loadCloudProvider(const CCloudProvider &comProvider, UIDataCloudProvider &data) 795 777 { 796 Q_UNUSED(comProvider);797 Q_UNUSED(data);798 799 778 /* Gather provider settings: */ 800 779 if (comProvider.isOk()) … … 802 781 if (comProvider.isOk()) 803 782 data.m_strName = comProvider.GetName(); 783 foreach (const QString &strSupportedPropertyName, comProvider.GetSupportedPropertyNames()) 784 data.m_propertyDescriptions[strSupportedPropertyName] = comProvider.GetPropertyDescription(strSupportedPropertyName); 804 785 805 786 /* Show error message if necessary: */ … … 808 789 } 809 790 810 void UICloudProfileManagerWidget::loadCloudProfile(const CCloudProfile &comProfile, UIDataCloudProfile &data) 811 { 812 Q_UNUSED(comProfile); 813 Q_UNUSED(data); 814 791 void UICloudProfileManagerWidget::loadCloudProfile(const CCloudProfile &comProfile, const UIDataCloudProvider &providerData, UIDataCloudProfile &profileData) 792 { 815 793 /* Gather profile settings: */ 816 794 if (comProfile.isOk()) 817 data.m_strName = comProfile.GetName();795 profileData.m_strName = comProfile.GetName(); 818 796 819 797 if (comProfile.isOk()) … … 831 809 if (comProfile.isOk()) 832 810 { 833 /* Acquire descriptions: */834 // for (int i = 0; i < keys.size(); ++i)835 // {836 // descriptions[i] = comProfile.GetPropertyDescription(keys.at(i));837 // if (!comProfile.isOk())838 // continue;839 // }840 841 811 /* Enumerate all the keys: */ 842 812 for (int i = 0; i < keys.size(); ++i) 843 data.m_data[keys.at(i)] = qMakePair(values.at(i), descriptions.at(i));813 profileData.m_data[keys.at(i)] = qMakePair(values.at(i), providerData.m_propertyDescriptions.value(keys.at(i))); 844 814 } 845 815 } -
trunk/src/VBox/Frontends/VirtualBox/src/cloud/UICloudProfileManager.h
r75054 r75376 138 138 /** Loads cloud @a comProvider data to passed @a data container. */ 139 139 void loadCloudProvider(const CCloudProvider &comProvider, UIDataCloudProvider &data); 140 /** Loads cloud @a comProfile data to passed @a data container. */141 void loadCloudProfile(const CCloudProfile &comProfile, UIDataCloudProfile &data);140 /** Loads cloud @a comProfile data to passed @a profileData container, using @a providerData as hint. */ 141 void loadCloudProfile(const CCloudProfile &comProfile, const UIDataCloudProvider &providerData, UIDataCloudProfile &profileData); 142 142 /** @} */ 143 143
Note:
See TracChangeset
for help on using the changeset viewer.