- Timestamp:
- Jul 29, 2021 8:30:46 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145979
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r90389 r90393 47 47 QString UINotificationProgressMediumCreate::details() const 48 48 { 49 return UINotificationProgress::tr("<b>Location:</b> %1<br><b>Size:</b> %2") 50 .arg(m_comTarget.GetLocation()).arg(m_uSize); 49 return UINotificationProgress::tr("<b>Location:</b> %1<br><b>Size:</b> %2").arg(m_strLocation).arg(m_uSize); 51 50 } 52 51 53 52 CProgress UINotificationProgressMediumCreate::createProgress(COMResult &comResult) 54 53 { 54 /* Acquire location: */ 55 m_strLocation = m_comTarget.GetLocation(); 56 if (!m_comTarget.isOk()) 57 { 58 /* Store COM result: */ 59 comResult = m_comTarget; 60 /* Return progress-wrapper: */ 61 return CProgress(); 62 } 63 55 64 /* Initialize progress-wrapper: */ 56 65 CProgress comProgress = m_comTarget.CreateBaseStorage(m_uSize, m_variants); … … 90 99 QString UINotificationProgressMediumCopy::details() const 91 100 { 92 return UINotificationProgress::tr("<b>From:</b> %1<br><b>To:</b> %2") 93 .arg(m_comSource.GetLocation(), m_comTarget.GetLocation()); 101 return UINotificationProgress::tr("<b>From:</b> %1<br><b>To:</b> %2").arg(m_strSourceLocation, m_strTargetLocation); 94 102 } 95 103 96 104 CProgress UINotificationProgressMediumCopy::createProgress(COMResult &comResult) 97 105 { 106 /* Acquire locations: */ 107 m_strSourceLocation = m_comSource.GetLocation(); 108 if (!m_comSource.isOk()) 109 { 110 /* Store COM result: */ 111 comResult = m_comSource; 112 /* Return progress-wrapper: */ 113 return CProgress(); 114 } 115 m_strTargetLocation = m_comTarget.GetLocation(); 116 if (!m_comTarget.isOk()) 117 { 118 /* Store COM result: */ 119 comResult = m_comTarget; 120 /* Return progress-wrapper: */ 121 return CProgress(); 122 } 123 98 124 /* Initialize progress-wrapper: */ 99 125 CProgress comProgress = m_comSource.CloneTo(m_comTarget, m_variants, CMedium()); … … 169 195 QString UINotificationProgressMachineCopy::details() const 170 196 { 171 return UINotificationProgress::tr("<b>From:</b> %1<br><b>To:</b> %2") 172 .arg(m_comSource.GetName(), m_comTarget.GetName()); 197 return UINotificationProgress::tr("<b>From:</b> %1<br><b>To:</b> %2").arg(m_strSourceName, m_strTargetName); 173 198 } 174 199 175 200 CProgress UINotificationProgressMachineCopy::createProgress(COMResult &comResult) 176 201 { 202 /* Acquire names: */ 203 m_strSourceName = m_comSource.GetName(); 204 if (!m_comSource.isOk()) 205 { 206 /* Store COM result: */ 207 comResult = m_comSource; 208 /* Return progress-wrapper: */ 209 return CProgress(); 210 } 211 m_strTargetName = m_comTarget.GetName(); 212 if (!m_comTarget.isOk()) 213 { 214 /* Store COM result: */ 215 comResult = m_comTarget; 216 /* Return progress-wrapper: */ 217 return CProgress(); 218 } 219 177 220 /* Initialize progress-wrapper: */ 178 221 CProgress comProgress = m_comSource.CloneTo(m_comTarget, m_enmCloneMode, m_options); … … 212 255 QString UINotificationProgressMachineMove::details() const 213 256 { 214 return UINotificationProgress::tr("<b>From:</b> %1<br><b>To:</b> %2") 215 .arg(m_strSource, m_strDestination); 257 return UINotificationProgress::tr("<b>From:</b> %1<br><b>To:</b> %2").arg(m_strSource, m_strDestination); 216 258 } 217 259 … … 220 262 /* Open a session thru which we will modify the machine: */ 221 263 m_comSession = uiCommon().openSession(m_uId, KLockType_Write); 264 if (m_comSession.isNull()) 265 return CProgress(); 222 266 223 267 /* Get session machine: */ … … 226 270 { 227 271 comResult = m_comSession; 272 m_comSession.UnlockMachine(); 228 273 return CProgress(); 229 274 } … … 234 279 { 235 280 comResult = comMachine; 281 m_comSession.UnlockMachine(); 236 282 return CProgress(); 237 283 } … … 273 319 QString UINotificationProgressMachineMediaRemove::details() const 274 320 { 275 return UINotificationProgress::tr("<b>Machine Name:</b> %1").arg(m_ comMachine.GetName());321 return UINotificationProgress::tr("<b>Machine Name:</b> %1").arg(m_strName); 276 322 } 277 323 278 324 CProgress UINotificationProgressMachineMediaRemove::createProgress(COMResult &comResult) 279 325 { 326 /* Acquire names: */ 327 m_strName = m_comMachine.GetName(); 328 if (!m_comMachine.isOk()) 329 { 330 /* Store COM result: */ 331 comResult = m_comMachine; 332 /* Return progress-wrapper: */ 333 return CProgress(); 334 } 335 280 336 /* Initialize progress-wrapper: */ 281 337 CProgress comProgress = m_comMachine.DeleteConfig(m_media); … … 314 370 { 315 371 return UINotificationProgress::tr("<b>Provider:</b> %1<br><b>Profile:</b> %2<br><b>Instance Name:</b> %3") 316 .arg(m_strProviderShortName, m_strProfileName, m_strInstanceName);372 .arg(m_strProviderShortName, m_strProfileName, m_strInstanceName); 317 373 } 318 374 … … 349 405 , m_strProfileName(strProfileName) 350 406 { 407 connect(this, &UINotificationProgress::sigProgressFinished, 408 this, &UINotificationProgressCloudMachineCreate::sltHandleProgressFinished); 409 } 410 411 QString UINotificationProgressCloudMachineCreate::name() const 412 { 413 return UINotificationProgress::tr("Creating cloud VM ..."); 414 } 415 416 QString UINotificationProgressCloudMachineCreate::details() const 417 { 418 return UINotificationProgress::tr("<b>Provider:</b> %1<br><b>Profile:</b> %2<br><b>Name:</b> %3") 419 .arg(m_strProviderShortName, m_strProfileName, m_strName); 420 } 421 422 CProgress UINotificationProgressCloudMachineCreate::createProgress(COMResult &comResult) 423 { 351 424 /* Parse cloud VM name: */ 352 425 QVector<KVirtualSystemDescriptionType> types; … … 357 430 m_strName = origValues.first(); 358 431 359 /* Listen for last progress signal: */360 connect(this, &UINotificationProgress::sigProgressFinished,361 this, &UINotificationProgressCloudMachineCreate::sltHandleProgressFinished);362 }363 364 QString UINotificationProgressCloudMachineCreate::name() const365 {366 return UINotificationProgress::tr("Creating cloud VM ...");367 }368 369 QString UINotificationProgressCloudMachineCreate::details() const370 {371 return UINotificationProgress::tr("<b>Provider:</b> %1<br><b>Profile:</b> %2<br><b>Name:</b> %3")372 .arg(m_strProviderShortName, m_strProfileName, m_strName);373 }374 375 CProgress UINotificationProgressCloudMachineCreate::createProgress(COMResult &comResult)376 {377 432 /* Initialize progress-wrapper: */ 378 433 CProgress comProgress = m_comClient.CreateCloudMachine(m_comVSD, m_comMachine); … … 403 458 , m_strProfileName(strProfileName) 404 459 { 405 /* Acquire cloud VM name: */406 m_strName = m_comMachine.GetName();407 408 /* Listen for last progress signal: */409 460 connect(this, &UINotificationProgress::sigProgressFinished, 410 461 this, &UINotificationProgressCloudMachineRemove::sltHandleProgressFinished); … … 425 476 CProgress UINotificationProgressCloudMachineRemove::createProgress(COMResult &comResult) 426 477 { 478 /* Acquire cloud VM name: */ 479 m_strName = m_comMachine.GetName(); 480 if (!m_comMachine.isOk()) 481 { 482 /* Store COM result: */ 483 comResult = m_comMachine; 484 /* Return progress-wrapper: */ 485 return CProgress(); 486 } 487 427 488 /* Initialize progress-wrapper: */ 428 489 CProgress comProgress = m_fFullRemoval -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r90389 r90393 78 78 /** Holds the medium being the target. */ 79 79 CMedium m_comTarget; 80 /** Holds the target location. */ 81 QString m_strLocation; 80 82 /** Holds the target medium size. */ 81 83 qulonglong m_uSize; … … 124 126 /** Holds the medium being the target. */ 125 127 CMedium m_comTarget; 128 /** Holds the source location. */ 129 QString m_strSourceLocation; 130 /** Holds the target location. */ 131 QString m_strTargetLocation; 126 132 /** Holds the target medium options. */ 127 133 QVector<KMediumVariant> m_variants; … … 204 210 /** Holds the machine being the target. */ 205 211 CMachine m_comTarget; 212 /** Holds the source name. */ 213 QString m_strSourceName; 214 /** Holds the target name. */ 215 QString m_strTargetName; 206 216 /** Holds the machine cloning mode. */ 207 217 KCloneMode m_enmCloneMode; … … 279 289 /** Holds the machine being removed. */ 280 290 CMachine m_comMachine; 291 /** Holds the machine name. */ 292 QString m_strName; 281 293 /** Holds the machine media being removed. */ 282 294 CMediumVector m_media; … … 389 401 /** Holds the the virtual system description. */ 390 402 CVirtualSystemDescription m_comVSD; 391 /** Holds the name acquired from VSD. */403 /** Holds the cloud machine name. */ 392 404 QString m_strName; 393 405 /** Holds the short provider name. */ … … 440 452 /** Holds the cloud machine being removed. */ 441 453 CCloudMachine m_comMachine; 442 /** Holds the name acquired from cloud machine. */454 /** Holds the cloud machine name. */ 443 455 QString m_strName; 444 456 /** Holds whether cloud machine should be removed fully. */ … … 476 488 /** Holds the cloud machine for which console connection being created. */ 477 489 CCloudMachine m_comMachine; 478 /** Holds the name acquired from cloud machine. */490 /** Holds the cloud machine name. */ 479 491 QString m_strName; 480 492 /** Holds the public key used for console connection being created. */
Note:
See TracChangeset
for help on using the changeset viewer.