Changeset 91094 in vbox
- Timestamp:
- Sep 2, 2021 1:35:13 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r91079 r91094 612 612 #endif 613 613 if (enmOptType == OptType_VMRunner && m_enmType != UIType_RuntimeUI) 614 msgCenter(). warnAboutUnrelatedOptionType(arg);614 msgCenter().cannotHandleRuntimeOption(arg); 615 615 616 616 i++; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMachineAttributeSetter.cpp
r90758 r91094 142 142 if (!comMachine.isOk()) 143 143 { 144 msgCenter().cannotAcquireMachineParameter(comMachine);144 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 145 145 fErrorHappened = true; 146 146 break; … … 161 161 if (!comMachine.isOk()) 162 162 { 163 msgCenter().cannotAcquireMachineParameter(comMachine);163 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 164 164 fErrorHappened = true; 165 165 break; … … 180 180 if (!comMachine.isOk()) 181 181 { 182 msgCenter().cannotAcquireMachineParameter(comMachine);182 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 183 183 fErrorHappened = true; 184 184 break; … … 199 199 if (!comMachine.isOk()) 200 200 { 201 msgCenter().cannotAcquireMachineParameter(comMachine);201 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 202 202 fErrorHappened = true; 203 203 break; … … 220 220 if (!comMachine.isOk()) 221 221 { 222 msgCenter().cannotAcquireMachineParameter(comMachine);222 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 223 223 fErrorHappened = true; 224 224 break; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r91076 r91094 39 39 #include "UIMessageCenter.h" 40 40 #include "UIModalWindowManager.h" 41 #include "UINotificationCenter.h" 41 42 #include "UIProgressDialog.h" 42 43 #include "UITranslator.h" … … 408 409 } 409 410 410 void UIMessageCenter::warnAboutUnrelatedOptionType(const QString &strOption) const 411 void UIMessageCenter::cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const 412 { 413 alert(0, MessageType_Error, 414 tr("<p>Could not find a language file for the language <b>%1</b> in the directory <b><nobr>%2</nobr></b>.</p>" 415 "<p>The language will be temporarily reset to the system default language. " 416 "Please go to the <b>Preferences</b> window which you can open from the <b>File</b> menu of the " 417 "VirtualBox Manager window, and select one of the existing languages on the <b>Language</b> page.</p>") 418 .arg(strLangId).arg(strNlsPath)); 419 } 420 421 void UIMessageCenter::cannotLoadLanguage(const QString &strLangFile) const 422 { 423 alert(0, MessageType_Error, 424 tr("<p>Could not load the language file <b><nobr>%1</nobr></b>. " 425 "<p>The language will be temporarily reset to English (built-in). " 426 "Please go to the <b>Preferences</b> window which you can open from the <b>File</b> menu of the " 427 "VirtualBox Manager window, and select one of the existing languages on the <b>Language</b> page.</p>") 428 .arg(strLangFile)); 429 } 430 431 void UIMessageCenter::cannotInitUserHome(const QString &strUserHome) const 432 { 433 error(0, MessageType_Critical, 434 tr("<p>Failed to initialize COM because the VirtualBox global " 435 "configuration directory <b><nobr>%1</nobr></b> is not accessible. " 436 "Please check the permissions of this directory and of its parent directory.</p>" 437 "<p>The application will now terminate.</p>") 438 .arg(strUserHome), 439 UIErrorString::formatErrorInfo(COMErrorInfo())); 440 } 441 442 void UIMessageCenter::cannotInitCOM(HRESULT rc) const 443 { 444 error(0, MessageType_Critical, 445 tr("<p>Failed to initialize COM or to find the VirtualBox COM server. " 446 "Most likely, the VirtualBox server is not running or failed to start.</p>" 447 "<p>The application will now terminate.</p>"), 448 UIErrorString::formatErrorInfo(COMErrorInfo(), rc)); 449 } 450 451 void UIMessageCenter::cannotHandleRuntimeOption(const QString &strOption) const 411 452 { 412 453 alert(0, MessageType_Error, … … 453 494 } 454 495 455 void UIMessageCenter::cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const 456 { 457 alert(0, MessageType_Error, 458 tr("<p>Could not find a language file for the language <b>%1</b> in the directory <b><nobr>%2</nobr></b>.</p>" 459 "<p>The language will be temporarily reset to the system default language. " 460 "Please go to the <b>Preferences</b> window which you can open from the <b>File</b> menu of the " 461 "VirtualBox Manager window, and select one of the existing languages on the <b>Language</b> page.</p>") 462 .arg(strLangId).arg(strNlsPath)); 463 } 464 465 void UIMessageCenter::cannotLoadLanguage(const QString &strLangFile) const 466 { 467 alert(0, MessageType_Error, 468 tr("<p>Could not load the language file <b><nobr>%1</nobr></b>. " 469 "<p>The language will be temporarily reset to English (built-in). " 470 "Please go to the <b>Preferences</b> window which you can open from the <b>File</b> menu of the " 471 "VirtualBox Manager window, and select one of the existing languages on the <b>Language</b> page.</p>") 472 .arg(strLangFile)); 473 } 474 475 void UIMessageCenter::cannotInitUserHome(const QString &strUserHome) const 476 { 477 error(0, MessageType_Critical, 478 tr("<p>Failed to initialize COM because the VirtualBox global " 479 "configuration directory <b><nobr>%1</nobr></b> is not accessible. " 480 "Please check the permissions of this directory and of its parent directory.</p>" 481 "<p>The application will now terminate.</p>") 482 .arg(strUserHome), 483 UIErrorString::formatErrorInfo(COMErrorInfo())); 484 } 485 486 void UIMessageCenter::cannotInitCOM(HRESULT rc) const 487 { 488 error(0, MessageType_Critical, 489 tr("<p>Failed to initialize COM or to find the VirtualBox COM server. " 490 "Most likely, the VirtualBox server is not running or failed to start.</p>" 491 "<p>The application will now terminate.</p>"), 492 UIErrorString::formatErrorInfo(COMErrorInfo(), rc)); 493 } 494 495 void UIMessageCenter::cannotCreateVirtualBoxClient(const CVirtualBoxClient &client) const 496 void UIMessageCenter::cannotCreateVirtualBoxClient(const CVirtualBoxClient &comClient) const 496 497 { 497 498 error(0, MessageType_Critical, 498 499 tr("<p>Failed to create the VirtualBoxClient COM object.</p>" 499 500 "<p>The application will now terminate.</p>"), 500 UIErrorString::formatErrorInfo(c lient));501 } 502 503 void UIMessageCenter::cannotAcquireVirtualBox(const CVirtualBoxClient &c lient) const501 UIErrorString::formatErrorInfo(comClient)); 502 } 503 504 void UIMessageCenter::cannotAcquireVirtualBox(const CVirtualBoxClient &comClient) const 504 505 { 505 506 QString err = tr("<p>Failed to acquire the VirtualBox COM object.</p>" 506 507 "<p>The application will now terminate.</p>"); 507 508 #if defined(VBOX_WS_X11) || defined(VBOX_WS_MAC) 508 if (c lient.lastRC() == NS_ERROR_SOCKET_FAIL)509 if (comClient.lastRC() == NS_ERROR_SOCKET_FAIL) 509 510 err += tr("<p>The reason for this error are most likely wrong permissions of the IPC " 510 511 "daemon socket due to an installation problem. Please check the permissions of " 511 512 "<font color=blue>'/tmp'</font> and <font color=blue>'/tmp/.vbox-*-ipc/'</font></p>"); 512 513 #endif 513 error(0, MessageType_Critical, err, UIErrorString::formatErrorInfo(c lient));514 } 515 516 void UIMessageCenter::cannotFindMachineByName(const CVirtualBox & vbox, const QString &strName) const514 error(0, MessageType_Critical, err, UIErrorString::formatErrorInfo(comClient)); 515 } 516 517 void UIMessageCenter::cannotFindMachineByName(const CVirtualBox &comVBox, const QString &strName) const 517 518 { 518 519 error(0, MessageType_Error, 519 520 tr("There is no virtual machine named <b>%1</b>.") 520 521 .arg(strName), 521 UIErrorString::formatErrorInfo( vbox));522 } 523 524 void UIMessageCenter::cannotFindMachineById(const CVirtualBox & vbox, const QUuid &uId) const522 UIErrorString::formatErrorInfo(comVBox)); 523 } 524 525 void UIMessageCenter::cannotFindMachineById(const CVirtualBox &comVBox, const QUuid &uId) const 525 526 { 526 527 error(0, MessageType_Error, 527 528 tr("There is no virtual machine with the identifier <b>%1</b>.") 528 529 .arg(uId.toString()), 529 UIErrorString::formatErrorInfo(vbox)); 530 } 531 532 void UIMessageCenter::cannotOpenSession(const CSession &session) const 530 UIErrorString::formatErrorInfo(comVBox)); 531 } 532 533 void UIMessageCenter::cannotSetExtraData(const CVirtualBox &comVBox, const QString &strKey, const QString &strValue) 534 { 535 error(0, MessageType_Error, 536 tr("Failed to set the global VirtualBox extra data for key <i>%1</i> to value <i>{%2}</i>.") 537 .arg(strKey, strValue), 538 UIErrorString::formatErrorInfo(comVBox)); 539 } 540 541 void UIMessageCenter::cannotOpenSession(const CSession &comSession) const 533 542 { 534 543 error(0, MessageType_Error, 535 544 tr("Failed to create a new session."), 536 UIErrorString::formatErrorInfo( session));537 } 538 539 void UIMessageCenter::cannotOpenSession(const CMachine & machine) const545 UIErrorString::formatErrorInfo(comSession)); 546 } 547 548 void UIMessageCenter::cannotOpenSession(const CMachine &comMachine) const 540 549 { 541 550 error(0, MessageType_Error, 542 551 tr("Failed to open a session for the virtual machine <b>%1</b>.") 543 .arg(CMachine( machine).GetName()),544 UIErrorString::formatErrorInfo( machine));545 } 546 547 void UIMessageCenter::cannotOpenSession(const CProgress & progress, const QString &strMachineName) const552 .arg(CMachine(comMachine).GetName()), 553 UIErrorString::formatErrorInfo(comMachine)); 554 } 555 556 void UIMessageCenter::cannotOpenSession(const CProgress &comProgress, const QString &strMachineName) const 548 557 { 549 558 error(0, MessageType_Error, 550 559 tr("Failed to open a session for the virtual machine <b>%1</b>.") 551 560 .arg(strMachineName), 552 UIErrorString::formatErrorInfo(progress)); 553 } 554 555 void UIMessageCenter::cannotSetExtraData(const CVirtualBox &vbox, const QString &strKey, const QString &strValue) 556 { 557 error(0, MessageType_Error, 558 tr("Failed to set the global VirtualBox extra data for key <i>%1</i> to value <i>{%2}</i>.") 559 .arg(strKey, strValue), 560 UIErrorString::formatErrorInfo(vbox)); 561 UIErrorString::formatErrorInfo(comProgress)); 561 562 } 562 563 … … 567 568 .arg(strKey, CMachine(machine).GetName(), strValue), 568 569 UIErrorString::formatErrorInfo(machine)); 569 }570 571 void UIMessageCenter::cannotAcquireVirtualBoxParameter(const CVirtualBox &comVBox, QWidget *pParent /* = 0 */) const572 {573 /* Show the error: */574 error(pParent, MessageType_Error,575 tr("Failed to acquire VirtualBox parameter."), UIErrorString::formatErrorInfo(comVBox));576 }577 578 void UIMessageCenter::cannotAcquireSessionParameter(const CSession &comSession, QWidget *pParent /* = 0 */) const579 {580 /* Show the error: */581 error(pParent, MessageType_Error,582 tr("Failed to acquire session parameter."), UIErrorString::formatErrorInfo(comSession));583 }584 585 void UIMessageCenter::cannotAcquireMachineParameter(const CMachine &comMachine, QWidget *pParent /* = 0 */) const586 {587 /* Show the error: */588 error(pParent, MessageType_Error,589 tr("Failed to acquire machine parameter."), UIErrorString::formatErrorInfo(comMachine));590 }591 592 void UIMessageCenter::cannotAcquireSnapshotParameter(const CSnapshot &comSnapshot, QWidget *pParent /* = 0 */) const593 {594 /* Show the error: */595 error(pParent, MessageType_Error,596 tr("Failed to acquire snapshot parameter."), UIErrorString::formatErrorInfo(comSnapshot));597 }598 599 void UIMessageCenter::cannotFindHelpFile(const QString &strFileLocation) const600 {601 alert(0, MessageType_Error, QString("<p>%1:</p>%2").arg(tr("Failed to find the following help file")).arg(strFileLocation));602 }603 604 void UIMessageCenter::cannotOpenMachine(const CVirtualBox &vbox, const QString &strMachinePath) const605 {606 error(0, MessageType_Error,607 tr("Failed to open virtual machine located in %1.")608 .arg(strMachinePath),609 UIErrorString::formatErrorInfo(vbox));610 570 } 611 571 … … 3374 3334 } 3375 3335 3336 void UIMessageCenter::sltHelpBrowserClosed() 3337 { 3338 m_pHelpBrowserDialog = 0; 3339 } 3340 3341 void UIMessageCenter::sltHandleHelpRequest() 3342 { 3343 #if defined(VBOX_WITH_QHELP_VIEWER) 3344 sltHandleHelpRequestWithKeyword(uiCommon().helpKeyword(sender())); 3345 #endif /* #if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))&& (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) */ 3346 } 3347 3348 void UIMessageCenter::sltHandleHelpRequestWithKeyword(const QString &strHelpKeyword) 3349 { 3350 #if defined(VBOX_WITH_QHELP_VIEWER) 3351 /* First open or show the help browser: */ 3352 showHelpBrowser(uiCommon().helpFile()); 3353 /* Show the help page for the @p strHelpKeyword: */ 3354 if (m_pHelpBrowserDialog) 3355 m_pHelpBrowserDialog->showHelpForKeyword(strHelpKeyword); 3356 #else 3357 Q_UNUSED(strHelpKeyword); 3358 # endif /* #if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))&& (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) */ 3359 } 3360 3376 3361 void UIMessageCenter::sltShowMessageBox(QWidget *pParent, MessageType enmType, 3377 3362 const QString &strMessage, const QString &strDetails, … … 3564 3549 if (!QFileInfo(strHelpFilePath).exists()) 3565 3550 { 3566 cannotFindHelpFile(strHelpFilePath);3551 UINotificationMessage::cannotFindHelpFile(strHelpFilePath); 3567 3552 return; 3568 3553 } … … 3581 3566 #endif 3582 3567 } 3583 3584 void UIMessageCenter::sltHelpBrowserClosed()3585 {3586 m_pHelpBrowserDialog = 0;3587 }3588 3589 void UIMessageCenter::sltHandleHelpRequest()3590 {3591 #if defined(VBOX_WITH_QHELP_VIEWER)3592 sltHandleHelpRequestWithKeyword(uiCommon().helpKeyword(sender()));3593 #endif /* #if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))&& (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) */3594 }3595 3596 void UIMessageCenter::sltHandleHelpRequestWithKeyword(const QString &strHelpKeyword)3597 {3598 #if defined(VBOX_WITH_QHELP_VIEWER)3599 /* First open or show the help browser: */3600 showHelpBrowser(uiCommon().helpFile());3601 /* Show the help page for the @p strHelpKeyword: */3602 if (m_pHelpBrowserDialog)3603 m_pHelpBrowserDialog->showHelpForKeyword(strHelpKeyword);3604 #else3605 Q_UNUSED(strHelpKeyword);3606 # endif /* #if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))&& (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) */3607 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r91076 r91094 242 242 int cMinDuration = 2000); 243 243 244 /** @name General (startup)warnings.244 /** @name Startup warnings. 245 245 * @{ */ 246 void warnAboutUnrelatedOptionType(const QString &strOption) const; 246 void cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const; 247 void cannotLoadLanguage(const QString &strLangFile) const; 248 249 void cannotInitUserHome(const QString &strUserHome) const; 250 void cannotInitCOM(HRESULT rc) const; 251 252 void cannotHandleRuntimeOption(const QString &strOption) const; 253 247 254 #ifdef RT_OS_LINUX 248 255 void warnAboutWrongUSBMounted() const; 249 256 #endif 257 250 258 void cannotStartSelector() const; 251 259 void cannotStartRuntime() const; 252 253 void cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const;254 void cannotLoadLanguage(const QString &strLangFile) const;255 260 /** @} */ 256 261 257 /** @name COM (startup)warnings.262 /** @name General COM warnings. 258 263 * @{ */ 259 void cannotInitUserHome(const QString &strUserHome) const; 260 void cannotInitCOM(HRESULT rc) const; 261 void cannotCreateVirtualBoxClient(const CVirtualBoxClient &client) const; 262 void cannotAcquireVirtualBox(const CVirtualBoxClient &client) const; 264 void cannotCreateVirtualBoxClient(const CVirtualBoxClient &comClient) const; 265 void cannotAcquireVirtualBox(const CVirtualBoxClient &comClient) const; 266 267 void cannotFindMachineByName(const CVirtualBox &comVBox, const QString &strName) const; 268 void cannotFindMachineById(const CVirtualBox &comVBox, const QUuid &uId) const; 269 void cannotSetExtraData(const CVirtualBox &comVBox, const QString &strKey, const QString &strValue); 270 271 void cannotOpenSession(const CSession &comSession) const; 272 void cannotOpenSession(const CMachine &comMachine) const; 273 void cannotOpenSession(const CProgress &comProgress, const QString &strMachineName) const; 274 275 void cannotSetExtraData(const CMachine &machine, const QString &strKey, const QString &strValue); 263 276 /** @} */ 264 277 265 /* API: Global warnings: */266 void cannotFindMachineByName(const CVirtualBox &vbox, const QString &strName) const;267 void cannotFindMachineById(const CVirtualBox &vbox, const QUuid &uId) const;268 void cannotOpenSession(const CSession &session) const;269 void cannotOpenSession(const CMachine &machine) const;270 void cannotOpenSession(const CProgress &progress, const QString &strMachineName) const;271 void cannotSetExtraData(const CVirtualBox &vbox, const QString &strKey, const QString &strValue);272 void cannotSetExtraData(const CMachine &machine, const QString &strKey, const QString &strValue);273 void cannotAcquireVirtualBoxParameter(const CVirtualBox &comVBox, QWidget *pParent = 0) const;274 void cannotAcquireSessionParameter(const CSession &comSession, QWidget *pParent = 0) const;275 void cannotAcquireMachineParameter(const CMachine &comMachine, QWidget *pParent = 0) const;276 void cannotAcquireSnapshotParameter(const CSnapshot &comSnapshot, QWidget *pParent = 0) const;277 void cannotFindHelpFile(const QString &strFileLocation) const;278 279 278 /* API: Selector warnings: */ 280 void cannotOpenMachine(const CVirtualBox &vbox, const QString &strMachinePath) const;281 279 void cannotReregisterExistingMachine(const QString &strMachinePath, const QString &strMachineName) const; 282 280 void cannotResolveCollisionAutomatically(const QString &strCollisionName, const QString &strGroupName) const; … … 581 579 void sltResetSuppressedMessages(); 582 580 void sltShowUserManual(const QString &strLocation); 581 582 /// @todo move it away .. 583 583 void sltHelpBrowserClosed(); 584 584 void sltHandleHelpRequest(); … … 636 636 const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3, 637 637 const QString &strAutoConfirmId, const QString &strHelpKeyword) const; 638 639 /// @todo move it away .. 638 640 void showHelpBrowser(const QString &strHelpFilePath, QWidget *pParent = 0); 639 641 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r91079 r91094 2461 2461 if (!comVBox.isOk()) 2462 2462 { 2463 msgCenter().cannotOpenMachine(comVBox, strTmpFile);2463 UINotificationMessage::cannotOpenMachine(comVBox, strTmpFile); 2464 2464 return; 2465 2465 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r90751 r91094 30 30 #include "UIExtraDataManager.h" 31 31 #include "UIMessageCenter.h" 32 #include "UINotificationCenter.h" 32 33 #include "UIProgressTaskReadCloudMachineList.h" 33 34 #include "UIVirtualBoxEventHandler.h" … … 1034 1035 /* Show error message if necessary: */ 1035 1036 if (!comVBox.isOk()) 1036 msgCenter().cannotAcquireVirtualBoxParameter(comVBox);1037 UINotificationMessage::cannotAcquireVirtualBoxParameter(comVBox); 1037 1038 else 1038 1039 { … … 1049 1050 if (!comMachine.isOk()) 1050 1051 { 1051 msgCenter().cannotAcquireMachineParameter(comMachine);1052 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 1052 1053 continue; 1053 1054 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp
r90939 r91094 23 23 #include "UIMediumEnumerator.h" 24 24 #include "UIMessageCenter.h" 25 #include "UINotificationCenter.h" 25 26 #include "UITask.h" 26 27 #include "UIThreadPool.h" … … 555 556 { 556 557 LogRel2(("GUI: UIMediumEnumerator: Unable to acquire machine ID!\n")); 557 msgCenter().cannotAcquireMachineParameter(comMachine);558 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 558 559 } 559 560 else -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r91077 r91094 56 56 /* static */ 57 57 QMap<QString, QUuid> UINotificationMessage::m_messages = QMap<QString, QUuid>(); 58 59 /* static */ 60 void UINotificationMessage::cannotFindHelpFile(const QString &strLocation) 61 { 62 createMessage( 63 QApplication::translate("UIMessageCenter", "Can't fina help file ..."), 64 QApplication::translate("UIMessageCenter", "Failed to find the following help file:") 65 .arg(strLocation)); 66 } 58 67 59 68 /* static */ … … 225 234 226 235 /* static */ 236 void UINotificationMessage::cannotAcquireVirtualBoxParameter(const CVirtualBox &comVBox) 237 { 238 createMessage( 239 QApplication::translate("UIMessageCenter", "VirtualBox failure ..."), 240 QApplication::translate("UIMessageCenter", "Failed to acquire VirtualBox parameter.") + 241 UIErrorString::formatErrorInfo(comVBox)); 242 } 243 244 /* static */ 245 void UINotificationMessage::cannotAcquireSessionParameter(const CSession &comSession) 246 { 247 createMessage( 248 QApplication::translate("UIMessageCenter", "Session failure ..."), 249 QApplication::translate("UIMessageCenter", "Failed to acquire session parameter.") + 250 UIErrorString::formatErrorInfo(comSession)); 251 } 252 253 /* static */ 254 void UINotificationMessage::cannotAcquireMachineParameter(const CMachine &comMachine) 255 { 256 createMessage( 257 QApplication::translate("UIMessageCenter", "Machine failure ..."), 258 QApplication::translate("UIMessageCenter", "Failed to acquire machine parameter.") + 259 UIErrorString::formatErrorInfo(comMachine)); 260 } 261 262 /* static */ 263 void UINotificationMessage::cannotAcquireSnapshotParameter(const CSnapshot &comSnapshot) 264 { 265 createMessage( 266 QApplication::translate("UIMessageCenter", "Snapshot failure ..."), 267 QApplication::translate("UIMessageCenter", "Failed to acquire snapshot parameter.") + 268 UIErrorString::formatErrorInfo(comSnapshot)); 269 } 270 271 /* static */ 227 272 void UINotificationMessage::cannotAttachUSBDevice(const CConsole &comConsole, const QString &strDevice) 228 273 { … … 308 353 "cannotEnumerateHostUSBDevices", 309 354 strHelpKeyword); 355 } 356 357 /* static */ 358 void UINotificationMessage::cannotOpenMachine(const CVirtualBox &comVBox, const QString &strLocation) 359 { 360 createMessage( 361 QApplication::translate("UIMessageCenter", "Can't open machine ..."), 362 QApplication::translate("UIMessageCenter", "Failed to open virtual machine located in %1.") 363 .arg(strLocation) + 364 UIErrorString::formatErrorInfo(comVBox)); 310 365 } 311 366 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r91076 r91094 61 61 public: 62 62 63 /** Notifies about inability to find help file at certain @a strLocation. */ 64 static void cannotFindHelpFile(const QString &strLocation); 63 65 /** Notifies about inability to open @a strUrl. */ 64 66 static void cannotOpenURL(const QString &strUrl); … … 94 96 /** Reminds about GA not affected. */ 95 97 static void remindAboutGuestAdditionsAreNotActive(); 98 99 /** Notifies about inability to acquire IVirtualBox parameter. 100 * @param comVBox Brings the object paramter get acquired from. */ 101 static void cannotAcquireVirtualBoxParameter(const CVirtualBox &comVBox); 102 /** Notifies about inability to acquire ISession parameter. 103 * @param comSession Brings the object paramter get acquired from. */ 104 static void cannotAcquireSessionParameter(const CSession &comSession); 105 /** Notifies about inability to acquire IMachine parameter. 106 * @param comSession Brings the object paramter get acquired from. */ 107 static void cannotAcquireMachineParameter(const CMachine &comMachine); 108 /** Notifies about inability to acquire ISnapshot parameter. 109 * @param comSnapshot Brings the object paramter get acquired from. */ 110 static void cannotAcquireSnapshotParameter(const CSnapshot &comSnapshot); 96 111 97 112 /** Notifies about inability to attach USB device. … … 130 145 * @param comHost Brings the host devices enumerated for. */ 131 146 static void cannotEnumerateHostUSBDevices(const CHost &comHost); 147 /** Notifies about inability to open machine. 148 * @param comVBox Brings common VBox object trying to open machine. 149 * @param strLocation Brings the machine location. */ 150 static void cannotOpenMachine(const CVirtualBox &comVBox, const QString &strLocation); 132 151 /** Notifies about inability to open medium. 133 152 * @param comVBox Brings common VBox object trying to open medium. -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r91057 r91094 2402 2402 CMediumVector comMedia = comVBox.GetDVDImages(); 2403 2403 if (!comVBox.isOk()) 2404 msgCenter().cannotAcquireVirtualBoxParameter(comVBox);2404 UINotificationMessage::cannotAcquireVirtualBoxParameter(comVBox); 2405 2405 else 2406 2406 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.cpp
r91060 r91094 149 149 /* Acquire machine name beforehand: */ 150 150 const QString strMachineName = m_machine.GetName(); 151 if (!m_machine.isOk())152 {153 msgCenter().cannotAcquireMachineParameter(m_machine);154 return false;155 }156 151 157 152 /* Open session: */
Note:
See TracChangeset
for help on using the changeset viewer.