- Timestamp:
- Jul 26, 2021 1:07:24 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r90327 r90334 286 286 emit sigCloudMachineCreated(m_strShortProviderName, m_strProfileName, m_comMachine); 287 287 } 288 289 290 /********************************************************************************************************************************* 291 * Class UINotificationProgressApplianceImport implementation. * 292 *********************************************************************************************************************************/ 293 294 UINotificationProgressApplianceImport::UINotificationProgressApplianceImport(const CAppliance &comAppliance, 295 const QVector<KImportOptions> &options) 296 : m_comAppliance(comAppliance) 297 , m_options(options) 298 { 299 } 300 301 QString UINotificationProgressApplianceImport::name() const 302 { 303 return UINotificationProgress::tr("Importing appliance ..."); 304 } 305 306 QString UINotificationProgressApplianceImport::details() const 307 { 308 return UINotificationProgress::tr("<b>From:</b> %1").arg(m_comAppliance.GetPath()); 309 } 310 311 CProgress UINotificationProgressApplianceImport::createProgress(COMResult &comResult) 312 { 313 /* Initialize progress-wrapper: */ 314 CProgress comProgress = m_comAppliance.ImportMachines(m_options); 315 /* Store COM result: */ 316 comResult = m_comAppliance; 317 /* Return progress-wrapper: */ 318 return comProgress; 319 } -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r90327 r90334 27 27 /* COM includes: */ 28 28 #include "COMEnums.h" 29 #include "CAppliance.h" 29 30 #include "CCloudClient.h" 30 31 #include "CCloudMachine.h" … … 317 318 }; 318 319 320 /** UINotificationProgress extension for import appliance functionality. */ 321 class SHARED_LIBRARY_STUFF UINotificationProgressApplianceImport : public UINotificationProgress 322 { 323 Q_OBJECT; 324 325 public: 326 327 /** Constructs import appliance notification-progress. 328 * @param comAppliance Brings the appliance being imported. 329 * @param options Brings the import options to be taken into account. */ 330 UINotificationProgressApplianceImport(const CAppliance &comAppliance, 331 const QVector<KImportOptions> &options); 332 333 protected: 334 335 /** Returns object name. */ 336 virtual QString name() const /* override final */; 337 /** Returns object details. */ 338 virtual QString details() const /* override final */; 339 /** Creates and returns started progress-wrapper. */ 340 virtual CProgress createProgress(COMResult &comResult) /* override final */; 341 342 private: 343 344 /** Holds the medium being moved. */ 345 CAppliance m_comAppliance; 346 /** Holds the initial location. */ 347 QVector<KImportOptions> m_options; 348 }; 349 319 350 #endif /* !FEQT_INCLUDED_SRC_notificationcenter_UINotificationObjects_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceImportEditorWidget.cpp
r82968 r90334 26 26 #include "QITreeView.h" 27 27 #include "UIApplianceImportEditorWidget.h" 28 #include "UICommon.h" 28 29 #include "UIFilePathSelector.h" 29 30 #include "UIMessageCenter.h" 31 #include "UINotificationCenter.h" 30 32 #include "UIWizardImportApp.h" 31 #include "UICommon.h"32 33 33 34 /* COM includes: */ … … 248 249 if (m_pAppliance) 249 250 { 250 /* Start the import asynchronously */ 251 CProgress progress; 251 /* Configure appliance importing: */ 252 252 QVector<KImportOptions> options; 253 253 if (m_pMACComboBox) … … 266 266 } 267 267 } 268 269 268 if (m_pImportHDsAsVDI->isChecked()) 270 269 options.append(KImportOptions_ImportToVDI); 271 progress = m_pAppliance->ImportMachines(options); 272 bool fResult = m_pAppliance->isOk(); 273 if (fResult) 274 { 275 /* Show some progress, so the user know whats going on */ 276 msgCenter().showModalProgressDialog(progress, tr("Importing Appliance ..."), ":/progress_import_90px.png", this); 277 if (progress.GetCanceled()) 278 return false; 279 if (!progress.isOk() || progress.GetResultCode() != 0) 280 { 281 msgCenter().cannotImportAppliance(progress, m_pAppliance->GetPath(), this); 282 return false; 283 } 284 else 285 return true; 286 } 287 if (!fResult) 288 msgCenter().cannotImportAppliance(*m_pAppliance, this); 270 271 /* Import appliance: */ 272 UINotificationProgressApplianceImport *pNotification = new UINotificationProgressApplianceImport(*m_pAppliance, 273 options); 274 notificationCenter().append(pNotification); 275 276 /* Positive: */ 277 return true; 289 278 } 290 279 return false; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportApp.cpp
r86986 r90334 31 31 #include "UICommon.h" 32 32 #include "UIMessageCenter.h" 33 #include "UINotificationCenter.h" 33 34 #include "UIWizardImportApp.h" 34 35 #include "UIWizardImportAppPageBasic1.h" … … 209 210 QVector<KImportOptions> options; 210 211 211 /* Initiate import porocedure: */ 212 CProgress comProgress = comAppliance.ImportMachines(options); 213 214 /* Show error message if necessary: */ 215 if (!comAppliance.isOk()) 216 msgCenter().cannotImportAppliance(comAppliance, this); 217 else 218 { 219 /* Show "Import appliance" progress: */ 220 msgCenter().showModalProgressDialog(comProgress, tr("Importing Appliance ..."), ":/progress_import_90px.png", this, 0); 221 if (!comProgress.GetCanceled()) 222 { 223 /* Show error message if necessary: */ 224 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 225 msgCenter().cannotImportAppliance(comProgress, comAppliance.GetPath(), this); 226 else 227 return true; 228 } 229 } 230 231 /* Failure by default: */ 232 return false; 212 /* Import appliance: */ 213 UINotificationProgressApplianceImport *pNotification = new UINotificationProgressApplianceImport(comAppliance, 214 options); 215 notificationCenter().append(pNotification); 216 217 /* Positive: */ 218 return true; 233 219 } 234 220 else
Note:
See TracChangeset
for help on using the changeset viewer.