Changeset 86672 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 22, 2020 3:25:35 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/cloud/profilemanager/UICloudProfileManager.cpp
r86671 r86672 309 309 if (comCloudProfile.isOk()) 310 310 { 311 /* Acquire cloud profile manager restrictions: */312 const QStringList restrictions = gEDataManager->cloudProfileManagerRestrictions();313 314 /* Update profile in the tree: */315 UIDataCloudProfile data;316 loadCloudProfile(comCloudProfile, restrictions, *pProviderItem, data);317 updateItemForCloudProfile(data, true, pProfileItem);318 319 /* Make sure current-item fetched: */320 sltHandleCurrentItemChange();321 322 311 /* Save profile changes: */ 323 312 comCloudProvider.SaveProfiles(); … … 386 375 const QVector<QString> values(keys.size()); 387 376 comCloudProvider.CreateProfile(strProfileName, keys, values); 388 389 377 /* Show error message if necessary: */ 390 378 if (!comCloudProvider.isOk()) 391 msgCenter().cannotCreateCloudProf le(comCloudProvider, this);379 msgCenter().cannotCreateCloudProfile(comCloudProvider, this); 392 380 else 393 381 { 394 /* Look for corresponding profile: */395 CCloudProfile comCloudProfile = comCloudProvider.GetProfileByName(strProfileName);382 /* Save profile changes: */ 383 comCloudProvider.SaveProfiles(); 396 384 /* Show error message if necessary: */ 397 385 if (!comCloudProvider.isOk()) 398 msgCenter().cannotFindCloudProfile(comCloudProvider, strProfileName, this); 399 else 400 { 401 /* Acquire cloud profile manager restrictions: */ 402 const QStringList restrictions = gEDataManager->cloudProfileManagerRestrictions(); 403 404 /* Add profile to the tree: */ 405 UIDataCloudProfile data; 406 loadCloudProfile(comCloudProfile, restrictions, *pProviderItem, data); 407 createItemForCloudProfile(pProviderItem, data, true); 408 409 /* Save profile changes: */ 410 comCloudProvider.SaveProfiles(); 411 /* Show error message if necessary: */ 412 if (!comCloudProvider.isOk()) 413 msgCenter().cannotSaveCloudProfiles(comCloudProvider, this); 414 } 386 msgCenter().cannotSaveCloudProfiles(comCloudProvider, this); 415 387 } 416 388 } … … 459 431 if (!comCloudProvider.isOk()) 460 432 msgCenter().cannotImportCloudProfiles(comCloudProvider, this); 461 else462 loadCloudStuff();463 433 } 464 434 } … … 513 483 /* Remove current profile: */ 514 484 comCloudProfile.Remove(); 515 /// @todo how do we check that? 516 517 /* Remove interface from the tree: */ 518 delete pProfileItem; 485 /* Show error message if necessary: */ 486 if (!comCloudProfile.isOk()) 487 msgCenter().cannotRemoveCloudProfile(comCloudProfile, this); 519 488 520 489 /* Save profile changes: */ … … 802 771 803 772 /* Extra-data connections: */ 773 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProviderListChanged, 774 this, &UICloudProfileManagerWidget::sltLoadCloudStuff); 775 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProfileRegistered, 776 this, &UICloudProfileManagerWidget::sltLoadCloudStuff); 777 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProfileChanged, 778 this, &UICloudProfileManagerWidget::sltLoadCloudStuff); 804 779 connect(gEDataManager, &UIExtraDataManager::sigCloudProfileManagerRestrictionChange, 805 780 this, &UICloudProfileManagerWidget::sltLoadCloudStuff); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r86581 r86672 1875 1875 } 1876 1876 1877 void UIMessageCenter::cannotCreateCloudProf le(const CCloudProvider &comProvider, QWidget *pParent /* = 0 */) const1877 void UIMessageCenter::cannotCreateCloudProfile(const CCloudProvider &comProvider, QWidget *pParent /* = 0 */) const 1878 1878 { 1879 1879 error(pParent, MessageType_Error, 1880 1880 tr("Failed to create cloud profile."), 1881 1881 UIErrorString::formatErrorInfo(comProvider)); 1882 } 1883 1884 void UIMessageCenter::cannotRemoveCloudProfile(const CCloudProfile &comProfile, QWidget *pParent /* = 0 */) const 1885 { 1886 error(pParent, MessageType_Error, 1887 tr("Failed to remove cloud profile."), 1888 UIErrorString::formatErrorInfo(comProfile)); 1882 1889 } 1883 1890 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r86581 r86672 396 396 void cannotAcquireCloudProviderParameter(const CCloudProvider &comProvider, QWidget *pParent = 0) const; 397 397 void cannotFindCloudProfile(const CCloudProvider &comProvider, const QString &strName, QWidget *pParent = 0) const; 398 void cannotCreateCloudProfle(const CCloudProvider &comProvider, QWidget *pParent = 0) const; 398 void cannotCreateCloudProfile(const CCloudProvider &comProvider, QWidget *pParent = 0) const; 399 void cannotRemoveCloudProfile(const CCloudProfile &comProfile, QWidget *pParent = 0) const; 399 400 void cannotSaveCloudProfiles(const CCloudProvider &comProvider, QWidget *pParent = 0) const; 400 401 void cannotImportCloudProfiles(const CCloudProvider &comProvider, QWidget *pParent = 0) const;
Note:
See TracChangeset
for help on using the changeset viewer.