Changeset 74880 in vbox
- Timestamp:
- Oct 17, 2018 2:28:35 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 125863
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/cloud
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/cloud/UICloudProfileDetailsWidget.h
r74853 r74880 20 20 21 21 /* Qt includes: */ 22 #include <QUuid> 22 23 #include <QWidget> 23 24 … … 31 32 class QIDialogButtonBox; 32 33 34 35 /** Cloud Provider data structure. */ 36 struct UIDataCloudProvider 37 { 38 /** Constructs data. */ 39 UIDataCloudProvider() 40 : m_strName(QString()) 41 {} 42 43 /** Returns whether the @a other passed data is equal to this one. */ 44 bool equal(const UIDataCloudProvider &other) const 45 { 46 return true 47 && (m_uuid == other.m_uuid) 48 && (m_strName == other.m_strName) 49 ; 50 } 51 52 /** Returns whether the @a other passed data is equal to this one. */ 53 bool operator==(const UIDataCloudProvider &other) const { return equal(other); } 54 /** Returns whether the @a other passed data is different from this one. */ 55 bool operator!=(const UIDataCloudProvider &other) const { return !equal(other); } 56 57 /** Holds the provider ID. */ 58 QUuid m_uuid; 59 /** Holds the provider name. */ 60 QString m_strName; 61 }; 33 62 34 63 /** Cloud Profile data structure. */ … … 53 82 bool operator!=(const UIDataCloudProfile &other) const { return !equal(other); } 54 83 55 /** Holds the snapshotname. */84 /** Holds the profile name. */ 56 85 QString m_strName; 57 86 }; -
trunk/src/VBox/Frontends/VirtualBox/src/cloud/UICloudProfileManager.cpp
r74871 r74880 40 40 /* COM includes: */ 41 41 #include "CCloudProfile.h" 42 #include "CCloudProvider.h" 42 43 43 44 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 53 54 54 55 55 /** Cloud Profile Manager tree-widget item. */56 class UIItemCloudPro file : public QITreeWidgetItem, public UIDataCloudProfile56 /** Cloud Profile Manager provider's tree-widget item. */ 57 class UIItemCloudProvider : public QITreeWidgetItem, public UIDataCloudProvider 57 58 { 58 59 public: 59 60 60 /** Updates item fields from data. */61 /** Updates item fields from base-class data. */ 61 62 void updateFields(); 62 63 … … 65 66 }; 66 67 68 /** Cloud Profile Manager profile's tree-widget item. */ 69 class UIItemCloudProfile : public QITreeWidgetItem, public UIDataCloudProfile 70 { 71 public: 72 73 /** Updates item fields from base-class data. */ 74 void updateFields(); 75 76 /** Returns item name. */ 77 QString name() const { return m_strName; } 78 }; 79 80 81 /********************************************************************************************************************************* 82 * Class UIItemCloudProvider implementation. * 83 *********************************************************************************************************************************/ 84 85 void UIItemCloudProvider::updateFields() 86 { 87 /* Update item fields: */ 88 setText(Column_Name, m_strName); 89 /// @todo assign rest of field values! 90 91 /* Compose item tool-tip: */ 92 /// @todo assign tool-tips! 93 } 94 67 95 68 96 /********************************************************************************************************************************* … … 72 100 void UIItemCloudProfile::updateFields() 73 101 { 74 /* Compose item fields: */102 /* Update item fields: */ 75 103 setText(Column_Name, m_strName); 76 104 /// @todo assign rest of field values! … … 176 204 void UICloudProfileManagerWidget::sltRefreshCloudProfiles() 177 205 { 206 /// @todo refresh cloud profiles! 207 178 208 // Not implemented. 179 209 AssertMsgFailed(("Not implemented!")); … … 254 284 retranslateUi(); 255 285 256 /* Load cloud profiles: */257 loadCloud Profiles();286 /* Load cloud stuff: */ 287 loadCloudStuff(); 258 288 } 259 289 … … 384 414 } 385 415 386 void UICloudProfileManagerWidget::loadCloud Profiles()416 void UICloudProfileManagerWidget::loadCloudStuff() 387 417 { 388 418 /* Clear tree first of all: */ … … 392 422 } 393 423 424 void UICloudProfileManagerWidget::loadCloudProvider(const CCloudProvider &comProvider, UIDataCloudProvider &data) 425 { 426 Q_UNUSED(comProvider); 427 Q_UNUSED(data); 428 429 /// @todo load cloud profile! 430 } 431 394 432 void UICloudProfileManagerWidget::loadCloudProfile(const CCloudProfile &comProfile, UIDataCloudProfile &data) 395 433 { … … 400 438 } 401 439 402 void UICloudProfileManagerWidget::createItemForCloudPro file(const UIDataCloudProfile&data, bool fChooseItem)403 { 404 /* Create new item: */405 UIItemCloudPro file *pItem = new UIItemCloudProfile;440 void UICloudProfileManagerWidget::createItemForCloudProvider(const UIDataCloudProvider &data, bool fChooseItem) 441 { 442 /* Create new provider item: */ 443 UIItemCloudProvider *pItem = new UIItemCloudProvider; 406 444 if (pItem) 407 445 { 408 446 /* Configure item: */ 409 pItem->UIDataCloudPro file::operator=(data);447 pItem->UIDataCloudProvider::operator=(data); 410 448 pItem->updateFields(); 411 449 /* Add item to the tree: */ 412 450 m_pTreeWidget->addTopLevelItem(pItem); 451 /* And choose it as current if necessary: */ 452 if (fChooseItem) 453 m_pTreeWidget->setCurrentItem(pItem); 454 } 455 } 456 457 void UICloudProfileManagerWidget::createItemForCloudProfile(QTreeWidgetItem *pParent, const UIDataCloudProfile &data, bool fChooseItem) 458 { 459 /* Create new profile item: */ 460 UIItemCloudProfile *pItem = new UIItemCloudProfile; 461 if (pItem) 462 { 463 /* Configure item: */ 464 pItem->setFlags(pItem->flags() | Qt::ItemIsEditable); 465 pItem->UIDataCloudProfile::operator=(data); 466 pItem->updateFields(); 467 /* Add item to the parent: */ 468 pParent->addChild(pItem); 413 469 /* And choose it as current if necessary: */ 414 470 if (fChooseItem) -
trunk/src/VBox/Frontends/VirtualBox/src/cloud/UICloudProfileManager.h
r74853 r74880 30 30 class UICloudProfileDetailsWidget; 31 31 class UIItemCloudProfile; 32 class UIItemCloudProvider; 32 33 class UIToolBar; 33 34 struct UIDataCloudProfile; 35 struct UIDataCloudProvider; 34 36 class CCloudProfile; 37 class CCloudProvider; 35 38 36 39 … … 137 140 /** @name Loading stuff. 138 141 * @{ */ 139 /** Loads cloud profiles. */ 140 void loadCloudProfiles(); 141 /** Loads host @a comInterface data to passed @a data container. */ 142 void loadCloudProfile(const CCloudProfile &comInterface, UIDataCloudProfile &data); 142 /** Loads cloud stuff. */ 143 void loadCloudStuff(); 144 /** Loads cloud @a comProvider data to passed @a data container. */ 145 void loadCloudProvider(const CCloudProvider &comProvider, UIDataCloudProvider &data); 146 /** Loads cloud @a comProfile data to passed @a data container. */ 147 void loadCloudProfile(const CCloudProfile &comProfile, UIDataCloudProfile &data); 143 148 /** @} */ 144 149 … … 146 151 * @{ */ 147 152 /** Creates a new tree-widget item on the basis of passed @a data, @a fChooseItem if requested. */ 148 void createItemForCloudProfile(const UIDataCloudProfile &data, bool fChooseItem); 153 void createItemForCloudProvider(const UIDataCloudProvider &data, bool fChooseItem); 154 155 /** Creates a new tree-widget item as a child of certain @a pParent, on the basis of passed @a data, @a fChooseItem if requested. */ 156 void createItemForCloudProfile(QTreeWidgetItem *pParent, const UIDataCloudProfile &data, bool fChooseItem); 149 157 /** Updates the passed tree-widget item on the basis of passed @a data, @a fChooseItem if requested. */ 150 158 void updateItemForCloudProfile(const UIDataCloudProfile &data, bool fChooseItem, UIItemCloudProfile *pItem);
Note:
See TracChangeset
for help on using the changeset viewer.