Changeset 45368 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 5, 2013 1:06:15 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r45364 r45368 86 86 int UIMessageCenter::message(QWidget *pParent, MessageType type, 87 87 const QString &strMessage, 88 const QString &strDetails /* = QString() */,88 const QString &strDetails, 89 89 const char *pcszAutoConfirmId /*= 0*/, 90 90 int iButton1 /*= 0*/, … … 116 116 } 117 117 118 int UIMessageCenter::message(QWidget *pParent, MessageType type, 118 void UIMessageCenter::error(QWidget *pParent, MessageType type, 119 const QString &strMessage, 120 const QString &strDetails, 121 const char *pcszAutoConfirmId /*= 0*/) const 122 { 123 message(pParent, type, strMessage, strDetails, pcszAutoConfirmId, 124 AlertButton_Ok | AlertButtonOption_Default); 125 } 126 127 bool UIMessageCenter::errorWithQuestion(QWidget *pParent, MessageType type, 128 const QString &strMessage, 129 const QString &strDetails, 130 const char *pcszAutoConfirmId /*= 0*/, 131 const QString &strOkButtonText /*= QString()*/, 132 const QString &strCancelButtonText /*= QString()*/) const 133 { 134 return (message(pParent, type, strMessage, strDetails, pcszAutoConfirmId, 135 AlertButton_Ok | AlertButtonOption_Default, 136 AlertButton_Cancel | AlertButtonOption_Escape, 137 0 /* third button */, 138 strOkButtonText, 139 strCancelButtonText, 140 QString() /* third button */) & 141 AlertButtonMask) == AlertButton_Ok; 142 } 143 144 void UIMessageCenter::alert(QWidget *pParent, MessageType type, 145 const QString &strMessage, 146 const char *pcszAutoConfirmId /*= 0*/) const 147 { 148 error(pParent, type, strMessage, QString(), pcszAutoConfirmId); 149 } 150 151 int UIMessageCenter::question(QWidget *pParent, MessageType type, 119 152 const QString &strMessage, 120 const char *pcszAutoConfirmId ,153 const char *pcszAutoConfirmId/* = 0*/, 121 154 int iButton1 /*= 0*/, 122 155 int iButton2 /*= 0*/, … … 130 163 } 131 164 132 bool UIMessageCenter::messageOkCancel(QWidget *pParent, MessageType type, 133 const QString &strMessage, 134 const QString &strDetails /*= QString()*/, 135 const char *pcszAutoConfirmId /*= 0*/, 136 const QString &strOkButtonText /*= QString()*/, 137 const QString &strCancelButtonText /*= QString()*/, 138 bool fOkByDefault /*= true*/) const 139 { 140 /* Which button will be the default one? Ok or Cancel? */ 141 int iOkButton = fOkByDefault ? AlertButton_Ok | AlertButtonOption_Default : 142 AlertButton_Ok; 143 int iCancelButton = fOkByDefault ? AlertButton_Cancel | AlertButtonOption_Escape : 144 AlertButton_Cancel | AlertButtonOption_Escape | AlertButtonOption_Default; 145 /* Show the message wrapping main function: */ 146 return (message(pParent, type, strMessage, strDetails, pcszAutoConfirmId, 147 iOkButton, iCancelButton, 0, strOkButtonText, strCancelButtonText, QString()) & 165 bool UIMessageCenter::questionBinary(QWidget *pParent, MessageType type, 166 const QString &strMessage, 167 const char *pcszAutoConfirmId /*= 0*/, 168 const QString &strOkButtonText /*= QString()*/, 169 const QString &strCancelButtonText /*= QString()*/) const 170 { 171 return (question(pParent, type, strMessage, pcszAutoConfirmId, 172 AlertButton_Ok | AlertButtonOption_Default, 173 AlertButton_Cancel | AlertButtonOption_Escape, 174 0 /* third button */, 175 strOkButtonText, 176 strCancelButtonText, 177 QString() /* third button */) & 148 178 AlertButtonMask) == AlertButton_Ok; 149 179 } 150 180 151 bool UIMessageCenter::messageOkCancel(QWidget *pParent, MessageType type, 152 const QString &strMessage, 153 const char *pcszAutoConfirmId, 154 const QString &strOkButtonText /*= QString()*/, 155 const QString &strCancelButtonText /*= QString()*/, 156 bool fOkByDefault /*= true*/) const 157 { 158 return messageOkCancel(pParent, type, strMessage, QString(), pcszAutoConfirmId, 159 strOkButtonText, strCancelButtonText, fOkByDefault); 181 int UIMessageCenter::questionTrinary(QWidget *pParent, MessageType type, 182 const QString &strMessage, 183 const char *pcszAutoConfirmId /*= 0*/, 184 const QString &strChoice1ButtonText /*= QString()*/, 185 const QString &strChoice2ButtonText /*= QString()*/, 186 const QString &strCancelButtonText /*= QString()*/) const 187 { 188 return question(pParent, type, strMessage, pcszAutoConfirmId, 189 AlertButton_Choice1, 190 AlertButton_Choice2 | AlertButtonOption_Default, 191 AlertButton_Cancel | AlertButtonOption_Escape, 192 strChoice1ButtonText, 193 strChoice2ButtonText, 194 strCancelButtonText); 160 195 } 161 196 … … 164 199 const QString &strOptionText, 165 200 bool fDefaultOptionValue /* = true */, 166 const QString &strDetails /* = QString() */,167 201 int iButton1 /*= 0*/, 168 202 int iButton2 /*= 0*/, … … 228 262 if (!strButtonName3.isNull()) 229 263 pBox->setButtonText(2, strButtonName3); 230 if (!strDetails.isEmpty())231 pBox->setDetailsText(strDetails);232 264 233 265 /* Show box: */ … … 331 363 void UIMessageCenter::warnAboutWrongUSBMounted() const 332 364 { 333 message(mainWindowShown(), MessageType_Warning,334 335 336 337 365 alert(mainWindowShown(), MessageType_Warning, 366 tr("You seem to have the USBFS filesystem mounted at /sys/bus/usb/drivers. " 367 "We strongly recommend that you change this, as it is a severe mis-configuration of " 368 "your system which could cause USB devices to fail in unexpected ways."), 369 "checkForMountedWrongUSB"); 338 370 } 339 371 #endif /* RT_OS_LINUX */ … … 341 373 void UIMessageCenter::cannotStartSelector() const 342 374 { 343 message(0, MessageType_Critical,344 345 375 alert(0, MessageType_Critical, 376 tr("<p>Cannot start VirtualBox Manager due to local restrictions.</p>" 377 "<p>The application will now terminate.</p>")); 346 378 } 347 379 348 380 void UIMessageCenter::showBETAWarning() const 349 381 { 350 message(0, MessageType_Warning,351 352 382 alert(0, MessageType_Warning, 383 tr("You are running a prerelease version of VirtualBox. " 384 "This version is not suitable for production use.")); 353 385 } 354 386 355 387 void UIMessageCenter::showBEBWarning() const 356 388 { 357 message(0, MessageType_Warning,358 359 389 alert(0, MessageType_Warning, 390 tr("You are running an EXPERIMENTAL build of VirtualBox. " 391 "This version is not suitable for production use.")); 360 392 } 361 393 362 394 void UIMessageCenter::cannotInitUserHome(const QString &strUserHome) const 363 395 { 364 message(0, MessageType_Critical,365 366 367 368 369 370 396 error(0, MessageType_Critical, 397 tr("<p>Failed to initialize COM because the VirtualBox global " 398 "configuration directory <b><nobr>%1</nobr></b> is not accessible. " 399 "Please check the permissions of this directory and of its parent directory.</p>" 400 "<p>The application will now terminate.</p>") 401 .arg(strUserHome), 402 formatErrorInfo(COMErrorInfo())); 371 403 } 372 404 373 405 void UIMessageCenter::cannotInitCOM(HRESULT rc) const 374 406 { 375 message(0, MessageType_Critical,376 377 378 379 407 error(0, MessageType_Critical, 408 tr("<p>Failed to initialize COM or to find the VirtualBox COM server. " 409 "Most likely, the VirtualBox server is not running or failed to start.</p>" 410 "<p>The application will now terminate.</p>"), 411 formatErrorInfo(COMErrorInfo(), rc)); 380 412 } 381 413 382 414 void UIMessageCenter::cannotCreateVirtualBox(const CVirtualBox &vbox) const 383 415 { 384 message(0, MessageType_Critical,385 386 387 416 error(0, MessageType_Critical, 417 tr("<p>Failed to create the VirtualBox COM object.</p>" 418 "<p>The application will now terminate.</p>"), 419 formatErrorInfo(vbox)); 388 420 } 389 421 390 422 void UIMessageCenter::cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const 391 423 { 392 message(0, MessageType_Error,393 394 395 396 397 424 alert(0, MessageType_Error, 425 tr("<p>Could not find a language file for the language <b>%1</b> in the directory <b><nobr>%2</nobr></b>.</p>" 426 "<p>The language will be temporarily reset to the system default language. " 427 "Please go to the <b>Preferences</b> dialog which you can open from the <b>File</b> menu " 428 "of the main VirtualBox window, and select one of the existing languages on the <b>Language</b> page.</p>") 429 .arg(strLangId).arg(strNlsPath)); 398 430 } 399 431 400 432 void UIMessageCenter::cannotLoadLanguage(const QString &strLangFile) const 401 433 { 402 message(0, MessageType_Error,403 404 405 406 407 434 alert(0, MessageType_Error, 435 tr("<p>Could not load the language file <b><nobr>%1</nobr></b>. " 436 "<p>The language will be temporarily reset to English (built-in). " 437 "Please go to the <b>Preferences</b> dialog which you can open from the <b>File</b> menu " 438 "of the main VirtualBox window, and select one of the existing languages on the <b>Language</b> page.</p>") 439 .arg(strLangFile)); 408 440 } 409 441 … … 412 444 /* Preserve error-info: */ 413 445 COMResult res(vbox); 414 /* Show the message: */415 message(0, MessageType_Critical,416 417 418 419 446 /* Show the error: */ 447 error(0, MessageType_Critical, 448 tr("<p>Failed to load the global GUI configuration from <b><nobr>%1</nobr></b>.</p>" 449 "<p>The application will now terminate.</p>") 450 .arg(vbox.GetSettingsFilePath()), 451 !res.isOk() ? formatErrorInfo(res) : QString("<!--EOM--><p>%1</p>").arg(vboxGlobal().emphasize(strError))); 420 452 } 421 453 … … 424 456 /* Preserve error-info: */ 425 457 COMResult res(vbox); 426 /* Show the message: */427 message(0, MessageType_Critical,428 429 430 431 458 /* Show the error: */ 459 error(0, MessageType_Critical, 460 tr("<p>Failed to save the global GUI configuration to <b><nobr>%1</nobr></b>.</p>" 461 "<p>The application will now terminate.</p>") 462 .arg(vbox.GetSettingsFilePath()), 463 formatErrorInfo(res)); 432 464 } 433 465 434 466 void UIMessageCenter::cannotFindMachineByName(const CVirtualBox &vbox, const QString &strName) const 435 467 { 436 message(0, MessageType_Error,437 438 439 468 error(0, MessageType_Error, 469 tr("There is no virtual machine named <b>%1</b>.") 470 .arg(strName), 471 formatErrorInfo(vbox)); 440 472 } 441 473 442 474 void UIMessageCenter::cannotFindMachineById(const CVirtualBox &vbox, const QString &strId) const 443 475 { 444 message(0, MessageType_Error,445 446 447 476 error(0, MessageType_Error, 477 tr("There is no virtual machine with id <b>%1</b>.") 478 .arg(strId), 479 formatErrorInfo(vbox)); 448 480 } 449 481 450 482 void UIMessageCenter::cannotOpenSession(const CSession &session) const 451 483 { 452 /* Show the message: */ 453 message(mainWindowShown(), MessageType_Error, 454 tr("Failed to create a new session."), 455 formatErrorInfo(session)); 484 error(mainWindowShown(), MessageType_Error, 485 tr("Failed to create a new session."), 486 formatErrorInfo(session)); 456 487 } 457 488 … … 460 491 /* Preserve error-info: */ 461 492 QString strErrorInfo = formatErrorInfo(machine); 462 /* Show the message: */463 message(mainWindowShown(), MessageType_Error,464 465 466 493 /* Show the error: */ 494 error(mainWindowShown(), MessageType_Error, 495 tr("Failed to open a session for the virtual machine <b>%1</b>.") 496 .arg(machine.GetName()), 497 strErrorInfo); 467 498 } 468 499 469 500 void UIMessageCenter::cannotOpenSession(const CProgress &progress, const QString &strMachineName) const 470 501 { 471 message(mainWindowShown(), MessageType_Error,472 473 474 502 error(mainWindowShown(), MessageType_Error, 503 tr("Failed to open a session for the virtual machine <b>%1</b>.") 504 .arg(strMachineName), 505 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 475 506 } 476 507 477 508 void UIMessageCenter::cannotGetMediaAccessibility(const UIMedium &medium) const 478 509 { 479 message(mainWindowShown(), MessageType_Error,480 481 482 510 error(mainWindowShown(), MessageType_Error, 511 tr("Failed to determine the accessibility state of the medium <nobr><b>%1</b></nobr>.") 512 .arg(medium.location()), 513 formatErrorInfo(medium.result())); 483 514 } 484 515 485 516 void UIMessageCenter::cannotOpenURL(const QString &strUrl) const 486 517 { 487 message(mainWindowShown(), MessageType_Error,488 489 490 518 alert(mainWindowShown(), MessageType_Error, 519 tr("Failed to open <tt>%1</tt>. " 520 "Make sure your desktop environment can properly handle URLs of this type.") 521 .arg(strUrl)); 491 522 } 492 523 493 524 void UIMessageCenter::cannotOpenMachine(const CVirtualBox &vbox, const QString &strMachinePath) const 494 525 { 495 message(mainWindowShown(), MessageType_Error,496 497 498 526 error(mainWindowShown(), MessageType_Error, 527 tr("Failed to open virtual machine located in %1.") 528 .arg(strMachinePath), 529 formatErrorInfo(vbox)); 499 530 } 500 531 501 532 void UIMessageCenter::cannotReregisterExistingMachine(const QString &strMachinePath, const QString &strMachineName) const 502 533 { 503 message(mainWindowShown(), MessageType_Error,504 505 534 alert(mainWindowShown(), MessageType_Error, 535 tr("Failed to add virtual machine <b>%1</b> located in <i>%2</i> because its already present.") 536 .arg(strMachineName).arg(strMachinePath)); 506 537 } 507 538 508 539 void UIMessageCenter::cannotResolveCollisionAutomatically(const QString &strName, const QString &strGroupName) const 509 540 { 510 message(mainWindowShown(), MessageType_Error,511 512 513 514 541 alert(mainWindowShown(), MessageType_Error, 542 tr("<p>You are trying to move machine <nobr><b>%1</b></nobr> " 543 "to group <nobr><b>%2</b></nobr> which already have sub-group <nobr><b>%1</b></nobr>.</p>" 544 "<p>Please resolve this name-conflict and try again.</p>") 545 .arg(strName, strGroupName)); 515 546 } 516 547 517 548 bool UIMessageCenter::confirmAutomaticCollisionResolve(const QString &strName, const QString &strGroupName) const 518 549 { 519 return messageOkCancel(mainWindowShown(), MessageType_Question,520 521 522 523 524 525 550 return questionBinary(mainWindowShown(), MessageType_Question, 551 tr("<p>You are trying to move group <nobr><b>%1</b></nobr> " 552 "to group <nobr><b>%2</b></nobr> which already have another item with the same name.</p>" 553 "<p>Would you like to automatically rename it?</p>") 554 .arg(strName, strGroupName), 555 0 /* auto-confirm id */, 556 tr("Rename")); 526 557 } 527 558 … … 534 565 if (strName.isEmpty()) 535 566 strName = QFileInfo(machine.GetSettingsFilePath()).baseName(); 536 /* Show the message: */537 message(mainWindowShown(), MessageType_Error,538 539 540 567 /* Show the error: */ 568 error(mainWindowShown(), MessageType_Error, 569 tr("Failed to set groups of the virtual machine <b>%1</b>.") 570 .arg(strName), 571 formatErrorInfo(res)); 541 572 } 542 573 543 574 bool UIMessageCenter::confirmMachineItemRemoval(const QStringList &names) const 544 575 { 545 return messageOkCancel(mainWindowShown(), MessageType_Question,546 547 548 549 550 576 return questionBinary(mainWindowShown(), MessageType_Question, 577 tr("<p>You are about to remove following virtual machine items from the machine list:</p>" 578 "<p><b>%1</b></p><p>Do you wish to proceed?</p>") 579 .arg(names.join(", ")), 580 0 /* auto-confirm id */, 581 tr("Remove")); 551 582 } 552 583 … … 616 647 return cInacessibleMachineCount == machines.size() ? 617 648 message(mainWindowShown(), MessageType_Question, 618 strText, 0 /* auto-confirm id */, 649 strText, QString(), 650 0 /* auto-confirm id */, 619 651 AlertButton_Ok | AlertButtonOption_Default, 620 652 AlertButton_Cancel | AlertButtonOption_Escape, … … 622 654 tr("Remove")) : 623 655 message(mainWindowShown(), MessageType_Question, 624 strText, 0 /* auto-confirm id */, 656 strText, QString(), 657 0 /* auto-confirm id */, 625 658 AlertButton_Choice1, 626 659 AlertButton_Choice2 | AlertButtonOption_Default, … … 634 667 /* Preserve error-info: */ 635 668 COMResult res(machine); 636 /* Show the message: */ 637 message(mainWindowShown(), 638 MessageType_Error, 639 tr("Failed to remove the virtual machine <b>%1</b>.") 640 .arg(machine.GetName()), 641 !machine.isOk() ? formatErrorInfo(machine) : formatErrorInfo(res)); 669 /* Show the error: */ 670 error(mainWindowShown(), MessageType_Error, 671 tr("Failed to remove the virtual machine <b>%1</b>.") 672 .arg(machine.GetName()), 673 !machine.isOk() ? formatErrorInfo(machine) : formatErrorInfo(res)); 642 674 } 643 675 644 676 void UIMessageCenter::cannotRemoveMachine(const CMachine &machine, const CProgress &progress) const 645 677 { 646 message(mainWindowShown(), 647 MessageType_Error, 648 tr("Failed to remove the virtual machine <b>%1</b>.") 649 .arg(machine.GetName()), 650 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 678 error(mainWindowShown(), MessageType_Error, 679 tr("Failed to remove the virtual machine <b>%1</b>.") 680 .arg(machine.GetName()), 681 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 651 682 } 652 683 653 684 bool UIMessageCenter::warnAboutInaccessibleMedia() const 654 685 { 655 return messageOkCancel(mainWindowShown(), MessageType_Warning,656 657 658 659 660 661 662 663 664 686 return questionBinary(mainWindowShown(), MessageType_Warning, 687 tr("<p>One or more virtual hard disks, CD/DVD or " 688 "floppy media are not currently accessible. As a result, you will " 689 "not be able to operate virtual machines that use these media until " 690 "they become accessible later.</p>" 691 "<p>Press <b>Check</b> to open the Virtual Media Manager window and " 692 "see what media are inaccessible, or press <b>Ignore</b> to " 693 "ignore this message.</p>"), 694 "warnAboutInaccessibleMedia", 695 tr("Ignore"), tr("Check", "inaccessible media message box")); 665 696 } 666 697 667 698 bool UIMessageCenter::confirmDiscardSavedState(const QString &strNames) const 668 699 { 669 return messageOkCancel(mainWindowShown(), MessageType_Question,670 671 672 673 674 675 676 700 return questionBinary(mainWindowShown(), MessageType_Question, 701 tr("<p>Are you sure you want to discard the saved state of " 702 "the following virtual machines?</p><p><b>%1</b></p>" 703 "<p>This operation is equivalent to resetting or powering off " 704 "the machine without doing a proper shutdown of the guest OS.</p>") 705 .arg(strNames), 706 0 /* auto-confirm id */, 707 tr("Discard", "saved state")); 677 708 } 678 709 679 710 bool UIMessageCenter::confirmResetMachine(const QString &strNames) const 680 711 { 681 return messageOkCancel(mainWindowShown(), MessageType_Question,682 683 684 685 686 687 712 return questionBinary(mainWindowShown(), MessageType_Question, 713 tr("<p>Do you really want to reset the following virtual machines?</p>" 714 "<p><b>%1</b></p><p>This will cause any unsaved data " 715 "in applications running inside it to be lost.</p>") 716 .arg(strNames), 717 "confirmResetMachine" /* auto-confirm id */, 718 tr("Reset", "machine")); 688 719 } 689 720 690 721 bool UIMessageCenter::confirmACPIShutdownMachine(const QString &strNames) const 691 722 { 692 return messageOkCancel(mainWindowShown(), MessageType_Question,693 694 695 696 697 723 return questionBinary(mainWindowShown(), MessageType_Question, 724 tr("<p>Do you really want to send an ACPI shutdown signal " 725 "to the following virtual machines?</p><p><b>%1</b></p>") 726 .arg(strNames), 727 "confirmACPIShutdownMachine" /* auto-confirm id */, 728 tr("ACPI Shutdown", "machine")); 698 729 } 699 730 700 731 bool UIMessageCenter::confirmPowerOffMachine(const QString &strNames) const 701 732 { 702 return messageOkCancel(mainWindowShown(), MessageType_Question,703 704 705 706 707 708 733 return questionBinary(mainWindowShown(), MessageType_Question, 734 tr("<p>Do you really want to power off the following virtual machines?</p>" 735 "<p><b>%1</b></p><p>This will cause any unsaved data in applications " 736 "running inside it to be lost.</p>") 737 .arg(strNames), 738 "confirmPowerOffMachine" /* auto-confirm id */, 739 tr("Power Off", "machine")); 709 740 } 710 741 … … 713 744 /* Preserve error-info: */ 714 745 COMResult res(console); 715 /* Show the message: */716 message(mainWindowShown(), MessageType_Error,717 718 719 746 /* Show the error: */ 747 error(mainWindowShown(), MessageType_Error, 748 tr("Failed to pause the execution of the virtual machine <b>%1</b>.") 749 .arg(console.GetMachine().GetName()), 750 formatErrorInfo(res)); 720 751 } 721 752 … … 724 755 /* Preserve error-info: */ 725 756 COMResult res(console); 726 /* Show the message: */727 message(mainWindowShown(), MessageType_Error,728 729 730 757 /* Show the error: */ 758 error(mainWindowShown(), MessageType_Error, 759 tr("Failed to resume the execution of the virtual machine <b>%1</b>.") 760 .arg(console.GetMachine().GetName()), 761 formatErrorInfo(res)); 731 762 } 732 763 … … 735 766 /* Preserve error-info: */ 736 767 COMResult res(console); 737 /* Show the message: */738 message(mainWindowShown(), MessageType_Error,739 740 741 768 /* Show the error: */ 769 error(mainWindowShown(), MessageType_Error, 770 tr("Failed to discard the saved state of the virtual machine <b>%1</b>.") 771 .arg(console.GetMachine().GetName()), 772 formatErrorInfo(res)); 742 773 } 743 774 … … 746 777 /* Preserve error-info: */ 747 778 COMResult res(console); 748 /* Show the message: */749 message(mainWindowShown(), MessageType_Error,750 751 752 779 /* Show the error: */ 780 error(mainWindowShown(), MessageType_Error, 781 tr("Failed to save the state of the virtual machine <b>%1</b>.") 782 .arg(console.GetMachine().GetName()), 783 formatErrorInfo(res)); 753 784 } 754 785 755 786 void UIMessageCenter::cannotSaveMachineState(const CProgress &progress, const QString &strName) 756 787 { 757 message(mainWindowShown(), MessageType_Error,758 759 760 788 error(mainWindowShown(), MessageType_Error, 789 tr("Failed to save the state of the virtual machine <b>%1</b>.") 790 .arg(strName), 791 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 761 792 } 762 793 … … 765 796 /* Preserve error-info: */ 766 797 COMResult res(console); 767 /* Show the message: */768 message(mainWindowShown(), MessageType_Error,769 770 771 772 798 /* Show the error: */ 799 error(mainWindowShown(), MessageType_Error, 800 tr("Failed to send the ACPI Power Button press event to the " 801 "virtual machine <b>%1</b>.") 802 .arg(console.GetMachine().GetName()), 803 formatErrorInfo(res)); 773 804 } 774 805 … … 777 808 /* Preserve error-info: */ 778 809 COMResult res(console); 779 /* Show the message: */780 message(mainWindowShown(), MessageType_Error,781 782 783 810 /* Show the error: */ 811 error(mainWindowShown(), MessageType_Error, 812 tr("Failed to stop the virtual machine <b>%1</b>.") 813 .arg(console.GetMachine().GetName()), 814 formatErrorInfo(res)); 784 815 } 785 816 786 817 void UIMessageCenter::cannotPowerDownMachine(const CProgress &progress, const QString &strName) const 787 818 { 788 message(mainWindowShown(), MessageType_Error,789 790 791 819 error(mainWindowShown(), MessageType_Error, 820 tr("Failed to stop the virtual machine <b>%1</b>.") 821 .arg(strName), 822 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 792 823 } 793 824 … … 802 833 tr("Create a snapshot of the current machine state"), 803 834 !vboxGlobal().virtualBox().GetExtraDataStringList(GUI_InvertMessageOption).contains("confirmSnapshotRestoring"), 804 QString() /* details */,805 835 AlertButton_Ok | AlertButtonOption_Default, 806 836 AlertButton_Cancel | AlertButtonOption_Escape, … … 810 840 tr("<p>Are you sure you want to restore snapshot <nobr><b>%1</b></nobr>?</p>") 811 841 .arg(strSnapshotName), 842 QString() /* details */, 812 843 0 /* auto-confirm id */, 813 844 AlertButton_Ok | AlertButtonOption_Default, … … 819 850 bool UIMessageCenter::confirmSnapshotRemoval(const QString &strSnapshotName) const 820 851 { 821 return messageOkCancel(mainWindowShown(), MessageType_Question,822 823 824 825 826 827 828 852 return questionBinary(mainWindowShown(), MessageType_Question, 853 tr("<p>Deleting the snapshot will cause the state information saved in it to be lost, and disk data spread over " 854 "several image files that VirtualBox has created together with the snapshot will be merged into one file. " 855 "This can be a lengthy process, and the information in the snapshot cannot be recovered.</p>" 856 "</p>Are you sure you want to delete the selected snapshot <b>%1</b>?</p>") 857 .arg(strSnapshotName), 858 0 /* auto-confirm id */, 859 tr("Delete")); 829 860 } 830 861 … … 834 865 const QString &strTargetFileSystemFree) const 835 866 { 836 return messageOkCancel(mainWindowShown(), MessageType_Question, 837 tr("<p>Deleting the snapshot %1 will temporarily need more disk space. In the worst case the size of image %2 will grow by %3, " 838 "however on this filesystem there is only %4 free.</p><p>Running out of disk space during the merge operation can result in " 839 "corruption of the image and the VM configuration, i.e. loss of the VM and its data.</p><p>You may continue with deleting " 840 "the snapshot at your own risk.</p>") 841 .arg(strSnapshotName) 842 .arg(strTargetImageName) 843 .arg(strTargetImageMaxSize) 844 .arg(strTargetFileSystemFree), 845 0 /* auto-confirm id */, 846 tr("Delete")); 867 return questionBinary(mainWindowShown(), MessageType_Question, 868 tr("<p>Deleting the snapshot %1 will temporarily need more disk space. In the worst case the size of image %2 will grow by %3, " 869 "however on this filesystem there is only %4 free.</p><p>Running out of disk space during the merge operation can result in " 870 "corruption of the image and the VM configuration, i.e. loss of the VM and its data.</p><p>You may continue with deleting " 871 "the snapshot at your own risk.</p>") 872 .arg(strSnapshotName, strTargetImageName, strTargetImageMaxSize, strTargetFileSystemFree), 873 0 /* auto-confirm id */, 874 tr("Delete")); 847 875 } 848 876 849 877 void UIMessageCenter::cannotTakeSnapshot(const CConsole &console, const QString &strMachineName, QWidget *pParent /*= 0*/) const 850 878 { 851 message(pParent ? pParent : mainWindowShown(), MessageType_Error,852 853 854 879 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 880 tr("Failed to create a snapshot of the virtual machine <b>%1</b>.") 881 .arg(strMachineName), 882 formatErrorInfo(console)); 855 883 } 856 884 857 885 void UIMessageCenter::cannotTakeSnapshot(const CProgress &progress, const QString &strMachineName, QWidget *pParent /*= 0*/) const 858 886 { 859 message(pParent ? pParent : mainWindowShown(), MessageType_Error,860 861 862 887 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 888 tr("Failed to create a snapshot of the virtual machine <b>%1</b>.") 889 .arg(strMachineName), 890 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 863 891 } 864 892 865 893 void UIMessageCenter::cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent /*= 0*/) const 866 894 { 867 message(pParent ? pParent : mainWindowShown(), MessageType_Error,868 869 870 895 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 896 tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.") 897 .arg(strSnapshotName, strMachineName), 898 formatErrorInfo(console)); 871 899 } 872 900 873 901 void UIMessageCenter::cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent /*= 0*/) const 874 902 { 875 message(pParent ? pParent : mainWindowShown(), MessageType_Error,876 877 878 903 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 904 tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.") 905 .arg(strSnapshotName, strMachineName), 906 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 879 907 } 880 908 881 909 void UIMessageCenter::cannotRemoveSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName) const 882 910 { 883 message(mainWindowShown(), MessageType_Error,884 885 886 911 error(mainWindowShown(), MessageType_Error, 912 tr("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.") 913 .arg(strSnapshotName, strMachineName), 914 formatErrorInfo(console)); 887 915 } 888 916 889 917 void UIMessageCenter::cannotRemoveSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName) const 890 918 { 891 message(mainWindowShown(), MessageType_Error,892 893 894 919 error(mainWindowShown(), MessageType_Error, 920 tr("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.") 921 .arg(strSnapshotName).arg(strMachineName), 922 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 895 923 } 896 924 897 925 bool UIMessageCenter::confirmHostInterfaceRemoval(const QString &strName, QWidget *pParent /*= 0*/) const 898 926 { 899 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,900 901 902 903 904 905 906 907 908 909 910 927 return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question, 928 tr("<p>Deleting this host-only network will remove " 929 "the host-only interface this network is based on. Do you want to " 930 "remove the (host-only network) interface <nobr><b>%1</b>?</nobr></p>" 931 "<p><b>Note:</b> this interface may be in use by one or more " 932 "virtual network adapters belonging to one of your VMs. " 933 "After it is removed, these adapters will no longer be usable until " 934 "you correct their settings by either choosing a different interface " 935 "name or a different adapter attachment type.</p>") 936 .arg(strName), 937 0 /* auto-confirm id */, 938 tr("Remove")); 911 939 } 912 940 913 941 void UIMessageCenter::cannotCreateHostInterface(const CHost &host, QWidget *pParent /*= 0*/) 914 942 { 915 message(pParent ? pParent : mainWindowShown(), MessageType_Error,916 917 943 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 944 tr("Failed to create the host network interface."), 945 formatErrorInfo(host)); 918 946 } 919 947 920 948 void UIMessageCenter::cannotCreateHostInterface(const CProgress &progress, QWidget *pParent /*= 0*/) 921 949 { 922 message(pParent ? pParent : mainWindowShown(), MessageType_Error,923 924 950 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 951 tr("Failed to create the host network interface."), 952 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 925 953 } 926 954 927 955 void UIMessageCenter::cannotRemoveHostInterface(const CHost &host, const QString &strName, QWidget *pParent /*= 0*/) 928 956 { 929 message(pParent ? pParent : mainWindowShown(), MessageType_Error,930 931 932 957 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 958 tr("Failed to remove the host network interface <b>%1</b>.") 959 .arg(strName), 960 formatErrorInfo(host)); 933 961 } 934 962 935 963 void UIMessageCenter::cannotRemoveHostInterface(const CProgress &progress, const QString &strName, QWidget *pParent /*= 0*/) 936 964 { 937 message(pParent ? pParent : mainWindowShown(), MessageType_Error,938 939 940 965 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 966 tr("Failed to remove the host network interface <b>%1</b>.") 967 .arg(strName), 968 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 941 969 } 942 970 943 971 void UIMessageCenter::cannotSetSystemProperties(const CSystemProperties &properties, QWidget *pParent /*= 0*/) const 944 972 { 945 message(pParent ? pParent : mainWindowShown(), MessageType_Critical,946 947 973 error(pParent ? pParent : mainWindowShown(), MessageType_Critical, 974 tr("Failed to set global VirtualBox properties."), 975 formatErrorInfo(properties)); 948 976 } 949 977 … … 956 984 if (res.rc() == E_NOTIMPL) 957 985 return; 958 /* Show the message: */959 message(pParent ? pParent : mainWindowShown(), res.isWarning() ? MessageType_Warning : MessageType_Error,960 961 962 986 /* Show the error: */ 987 error(pParent ? pParent : mainWindowShown(), res.isWarning() ? MessageType_Warning : MessageType_Error, 988 tr("Failed to access the USB subsystem."), 989 formatErrorInfo(res), 990 "warnAboutUnaccessibleUSB"); 963 991 } 964 992 … … 969 997 setWarningShown("warnAboutUnsupportedUSB2", true); 970 998 971 message(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning,972 973 974 975 976 977 999 alert(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning, 1000 tr("<p>USB 2.0 is currently enabled for this virtual machine. " 1001 "However, this requires the <b><nobr>%1</nobr></b> to be installed.</p>" 1002 "<p>Please install the Extension Pack from the VirtualBox download site. " 1003 "After this you will be able to re-enable USB 2.0. " 1004 "It will be disabled in the meantime unless you cancel the current settings changes.</p>") 1005 .arg(strExtPackName)); 978 1006 979 1007 setWarningShown("warnAboutUnsupportedUSB2", false); … … 986 1014 return; 987 1015 setWarningShown("warnAboutStateChange", true); 988 /* Show the message: */989 message(pParent ? pParent : mainWindowShown(), MessageType_Warning,990 991 992 1016 /* Show the error: */ 1017 alert(pParent ? pParent : mainWindowShown(), MessageType_Warning, 1018 tr("The virtual machine that you are changing has been started. " 1019 "Only certain settings can be changed while a machine is running. " 1020 "All other changes will be lost if you close this window now.")); 993 1021 /* Allow to show this async warning: */ 994 1022 setWarningShown("warnAboutStateChange", false); … … 997 1025 bool UIMessageCenter::confirmSettingsReloading(QWidget *pParent /*= 0*/) const 998 1026 { 999 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question, 1000 tr("<p>The machine settings were changed while you were editing them. " 1001 "You currently have unsaved setting changes.</p>" 1002 "<p>Would you like to reload the changed settings or to keep your own changes?</p>"), 1027 return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question, 1028 tr("<p>The machine settings were changed while you were editing them. " 1029 "You currently have unsaved setting changes.</p>" 1030 "<p>Would you like to reload the changed settings or to keep your own changes?</p>"), 1031 0 /* auto-confirm id */, 1032 tr("Reload settings"), tr("Keep changes")); 1033 } 1034 1035 int UIMessageCenter::confirmHardDiskAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const 1036 { 1037 return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question, 1038 tr("<p>You are about to add a virtual hard disk to controller <b>%1</b>.</p>" 1039 "<p>Would you like to create a new, empty file to hold the disk contents or select an existing one?</p>") 1040 .arg(strControllerName), 1003 1041 0 /* auto-confirm id */, 1004 tr("Reload settings"), tr("Keep changes")); 1005 } 1006 1007 int UIMessageCenter::confirmHardDiskAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const 1008 { 1009 return message(pParent ? pParent : mainWindowShown(), MessageType_Question, 1010 tr("<p>You are about to add a virtual hard disk to controller <b>%1</b>.</p>" 1011 "<p>Would you like to create a new, empty file to hold the disk contents or select an existing one?</p>") 1012 .arg(strControllerName), 1013 0 /* auto-confirm id */, 1014 AlertButton_Choice1, 1015 AlertButton_Choice2 | AlertButtonOption_Default, 1016 AlertButton_Cancel | AlertButtonOption_Escape, 1017 tr("Create &new disk", "add attachment routine"), 1018 tr("&Choose existing disk", "add attachment routine")); 1042 tr("Create &new disk", "add attachment routine"), 1043 tr("&Choose existing disk", "add attachment routine")); 1019 1044 } 1020 1045 1021 1046 int UIMessageCenter::confirmOpticalAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const 1022 1047 { 1023 return message(pParent ? pParent : mainWindowShown(), MessageType_Question, 1024 tr("<p>You are about to add a new CD/DVD drive to controller <b>%1</b>.</p>" 1025 "<p>Would you like to choose a virtual CD/DVD disk to put in the drive " 1026 "or to leave it empty for now?</p>") 1027 .arg(strControllerName), 1028 0 /* auto-confirm id */, 1029 AlertButton_Choice1 | AlertButtonOption_Default, 1030 AlertButton_Choice2, 1031 AlertButton_Cancel | AlertButtonOption_Escape, 1032 tr("&Choose disk", "add attachment routine"), 1033 tr("Leave &empty", "add attachment routine")); 1048 return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question, 1049 tr("<p>You are about to add a new CD/DVD drive to controller <b>%1</b>.</p>" 1050 "<p>Would you like to choose a virtual CD/DVD disk to put in the drive " 1051 "or to leave it empty for now?</p>") 1052 .arg(strControllerName), 1053 0 /* auto-confirm id */, 1054 tr("Leave &empty", "add attachment routine"), 1055 tr("&Choose disk", "add attachment routine")); 1034 1056 } 1035 1057 1036 1058 int UIMessageCenter::confirmFloppyAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const 1037 1059 { 1038 return message(pParent ? pParent : mainWindowShown(), MessageType_Question, 1039 tr("<p>You are about to add a new floppy drive to controller <b>%1</b>.</p>" 1040 "<p>Would you like to choose a virtual floppy disk to put in the drive " 1041 "or to leave it empty for now?</p>") 1042 .arg(strControllerName), 1043 0 /* auto-confirm id */, 1044 AlertButton_Choice1 | AlertButtonOption_Default, 1045 AlertButton_Choice2, 1046 AlertButton_Cancel | AlertButtonOption_Escape, 1047 tr("&Choose disk", "add attachment routine"), 1048 tr("Leave &empty", "add attachment routine")); 1060 return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question, 1061 tr("<p>You are about to add a new floppy drive to controller <b>%1</b>.</p>" 1062 "<p>Would you like to choose a virtual floppy disk to put in the drive " 1063 "or to leave it empty for now?</p>") 1064 .arg(strControllerName), 1065 0 /* auto-confirm id */, 1066 tr("Leave &empty", "add attachment routine"), 1067 tr("&Choose disk", "add attachment routine")); 1049 1068 } 1050 1069 1051 1070 int UIMessageCenter::confirmRemovingOfLastDVDDevice(QWidget *pParent /*= 0*/) const 1052 1071 { 1053 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Info,1054 1055 1056 1057 1058 1072 return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Info, 1073 tr("<p>Are you sure you want to delete the CD/DVD-ROM device?</p>" 1074 "<p>You will not be able to mount any CDs or ISO images " 1075 "or install the Guest Additions without it!</p>"), 1076 0 /* auto-confirm id */, 1077 tr("&Remove", "medium")); 1059 1078 } 1060 1079 … … 1087 1106 break; 1088 1107 } 1089 message(pParent ? pParent : mainWindowShown(), MessageType_Error, strMessage, formatErrorInfo(machine)); 1108 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1109 strMessage, formatErrorInfo(machine)); 1090 1110 } 1091 1111 1092 1112 void UIMessageCenter::warnAboutIncorrectPort(QWidget *pParent /*= 0*/) const 1093 1113 { 1094 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1095 1096 1114 alert(pParent ? pParent : mainWindowShown(), MessageType_Error, 1115 tr("The current port forwarding rules are not valid. " 1116 "None of the host or guest port values may be set to zero.")); 1097 1117 } 1098 1118 1099 1119 bool UIMessageCenter::confirmCancelingPortForwardingDialog(QWidget *pParent /*= 0*/) const 1100 1120 { 1101 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,1102 1103 1121 return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question, 1122 tr("<p>There are unsaved changes in the port forwarding configuration.</p>" 1123 "<p>If you proceed your changes will be discarded.</p>")); 1104 1124 } 1105 1125 … … 1108 1128 QWidget *pParent /*= 0*/) 1109 1129 { 1110 message(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,1111 1112 1113 1114 1130 error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error, 1131 tr("Failed to create the shared folder <b>%1</b> (pointing to " 1132 "<nobr><b>%2</b></nobr>) for the virtual machine <b>%3</b>.") 1133 .arg(strName, strPath, strMachineName), 1134 formatErrorInfo(machine)); 1115 1135 } 1116 1136 … … 1119 1139 QWidget *pParent /*= 0*/) 1120 1140 { 1121 message(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,1122 1123 1124 1125 1141 error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error, 1142 tr("Failed to create the shared folder <b>%1</b> (pointing to " 1143 "<nobr><b>%2</b></nobr>) for the virtual machine <b>%3</b>.") 1144 .arg(strName, strPath, strMachineName), 1145 formatErrorInfo(console)); 1126 1146 } 1127 1147 … … 1130 1150 QWidget *pParent /*= 0*/) 1131 1151 { 1132 message(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,1133 1134 1135 1136 1137 1138 1152 error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error, 1153 tr("<p>Failed to remove the shared folder <b>%1</b> (pointing to " 1154 "<nobr><b>%2</b></nobr>) from the virtual machine <b>%3</b>.</p>" 1155 "<p>Please close all programs in the guest OS that " 1156 "may be using this shared folder and try again.</p>") 1157 .arg(strName, strPath, strMachineName), 1158 formatErrorInfo(machine)); 1139 1159 } 1140 1160 … … 1143 1163 QWidget *pParent /*= 0*/) 1144 1164 { 1145 message(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,1146 1147 1148 1149 1150 1151 1165 error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error, 1166 tr("<p>Failed to remove the shared folder <b>%1</b> (pointing to " 1167 "<nobr><b>%2</b></nobr>) from the virtual machine <b>%3</b>.</p>" 1168 "<p>Please close all programs in the guest OS that " 1169 "may be using this shared folder and try again.</p>") 1170 .arg(strName, strPath, strMachineName), 1171 formatErrorInfo(console)); 1152 1172 } 1153 1173 … … 1156 1176 /* Preserve error-info: */ 1157 1177 COMResult res(machine); 1158 /* Show the message: */1159 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1160 1161 1162 1178 /* Show the error: */ 1179 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1180 tr("Failed to save the settings of the virtual machine <b>%1</b> to <b><nobr>%2</nobr></b>.") 1181 .arg(machine.GetName(), machine.GetSettingsFilePath()), 1182 formatErrorInfo(res)); 1163 1183 } 1164 1184 … … 1166 1186 QWidget *pParent /*= 0*/) const 1167 1187 { 1168 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1169 1170 1171 1188 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1189 tr("<p>Error changing medium type from <b>%1</b> to <b>%2</b>.</p>") 1190 .arg(gpConverter->toString(oldMediumType)).arg(gpConverter->toString(newMediumType)), 1191 formatErrorInfo(medium)); 1172 1192 } 1173 1193 … … 1199 1219 break; 1200 1220 } 1201 /* Show the message: */1202 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,1203 1204 1221 /* Show the question: */ 1222 return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question, 1223 strMessage.arg(medium.location(), strUsage), 1224 0 /* auto-confirm id */, tr("Release", "detach medium")); 1205 1225 } 1206 1226 … … 1249 1269 break; 1250 1270 } 1251 /* Show the message: */1252 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,1253 1254 1271 /* Show the question: */ 1272 return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question, 1273 strMessage.arg(medium.location()), 1274 "confirmMediumRemoval" /* auto-confirm id */, tr("Remove", "medium")); 1255 1275 } 1256 1276 1257 1277 int UIMessageCenter::confirmDeleteHardDiskStorage(const QString &strLocation, QWidget *pParent /*= 0*/) const 1258 1278 { 1259 return message(pParent ? pParent : mainWindowShown(), MessageType_Question, 1260 tr("<p>Do you want to delete the storage unit of the hard disk " 1261 "<nobr><b>%1</b></nobr>?</p>" 1262 "<p>If you select <b>Delete</b> then the specified storage unit " 1263 "will be permanently deleted. This operation <b>cannot be " 1264 "undone</b>.</p>" 1265 "<p>If you select <b>Keep</b> then the hard disk will be only " 1266 "removed from the list of known hard disks, but the storage unit " 1267 "will be left untouched which makes it possible to add this hard " 1268 "disk to the list later again.</p>") 1269 .arg(strLocation), 1270 0 /* auto-confirm id */, 1271 AlertButton_Choice1, 1272 AlertButton_Choice2 | AlertButtonOption_Default, 1273 AlertButton_Cancel | AlertButtonOption_Escape, 1274 tr("Delete", "hard disk storage"), 1275 tr("Keep", "hard disk storage")); 1279 return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question, 1280 tr("<p>Do you want to delete the storage unit of the hard disk " 1281 "<nobr><b>%1</b></nobr>?</p>" 1282 "<p>If you select <b>Delete</b> then the specified storage unit " 1283 "will be permanently deleted. This operation <b>cannot be " 1284 "undone</b>.</p>" 1285 "<p>If you select <b>Keep</b> then the hard disk will be only " 1286 "removed from the list of known hard disks, but the storage unit " 1287 "will be left untouched which makes it possible to add this hard " 1288 "disk to the list later again.</p>") 1289 .arg(strLocation), 1290 0 /* auto-confirm id */, 1291 tr("Delete", "hard disk storage"), 1292 tr("Keep", "hard disk storage")); 1276 1293 } 1277 1294 1278 1295 void UIMessageCenter::cannotDeleteHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /*= 0*/) const 1279 1296 { 1280 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1281 1282 1283 1297 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1298 tr("Failed to delete the storage unit of the hard disk <b>%1</b>.") 1299 .arg(strLocation), 1300 formatErrorInfo(medium)); 1284 1301 } 1285 1302 1286 1303 void UIMessageCenter::cannotDeleteHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /*= 0*/) const 1287 1304 { 1288 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1289 1290 1291 1305 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1306 tr("Failed to delete the storage unit of the hard disk <b>%1</b>.") 1307 .arg(strLocation), 1308 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 1292 1309 } 1293 1310 … … 1321 1338 break; 1322 1339 } 1323 /* Show the message: */ 1324 message(pParent ? pParent : mainWindowShown(), MessageType_Error, strMessage, strErrorInfo); 1325 } 1326 1327 int UIMessageCenter::cannotRemountMedium(const CMachine &machine, const UIMedium &medium, bool fMount, bool fRetry, QWidget *pParent /*= 0*/) const 1340 /* Show the error: */ 1341 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1342 strMessage, strErrorInfo); 1343 } 1344 1345 bool UIMessageCenter::cannotRemountMedium(const CMachine &machine, const UIMedium &medium, bool fMount, bool fRetry, QWidget *pParent /*= 0*/) const 1328 1346 { 1329 1347 /* Preserve error-info: */ … … 1370 1388 /* Show the messsage: */ 1371 1389 if (fRetry) 1372 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question, 1373 strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()), 1374 strErrorInfo, 1375 0 /* Auto Confirm ID */, 1376 tr("Force Unmount")); 1377 return message(pParent ? pParent : mainWindowShown(), MessageType_Error, 1378 strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()), 1379 strErrorInfo); 1390 return errorWithQuestion(pParent ? pParent : mainWindowShown(), MessageType_Question, 1391 strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()), 1392 strErrorInfo, 1393 0 /* Auto Confirm ID */, 1394 tr("Force Unmount")); 1395 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1396 strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()), 1397 strErrorInfo); 1398 return false; 1380 1399 } 1381 1400 … … 1404 1423 break; 1405 1424 } 1406 /* Show the message: */1407 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1408 1425 /* Show the error: */ 1426 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1427 strMessage.arg(strLocation), formatErrorInfo(vbox)); 1409 1428 } 1410 1429 … … 1433 1452 break; 1434 1453 } 1435 /* Show the message: */1436 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1437 1454 /* Show the error: */ 1455 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1456 strMessage.arg(medium.location()), formatErrorInfo(rc)); 1438 1457 } 1439 1458 1440 1459 bool UIMessageCenter::confirmHardDisklessMachine(QWidget *pParent /*= 0*/) const 1441 1460 { 1442 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Warning,1443 1444 1445 1446 1447 1448 1449 1461 return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Warning, 1462 tr("You are about to create a new virtual machine without a hard drive. " 1463 "You will not be able to install an operating system on the machine " 1464 "until you add one. In the mean time you will only be able to start the " 1465 "machine using a virtual optical disk or from the network."), 1466 0 /* auto-confirm id */, 1467 tr("Continue", "no hard disk attached"), 1468 tr("Go Back", "no hard disk attached")); 1450 1469 } 1451 1470 1452 1471 void UIMessageCenter::cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent /*= 0*/) const 1453 1472 { 1454 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1455 1456 1473 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1474 tr("Failed to create a new virtual machine."), 1475 formatErrorInfo(vbox)); 1457 1476 } 1458 1477 1459 1478 void UIMessageCenter::cannotRegisterMachine(const CVirtualBox &vbox, const QString &strMachineName, QWidget *pParent /*= 0*/) const 1460 1479 { 1461 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1462 1463 1464 1480 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1481 tr("Failed to register the virtual machine <b>%1</b>.") 1482 .arg(strMachineName), 1483 formatErrorInfo(vbox)); 1465 1484 } 1466 1485 … … 1469 1488 /* Preserve error-info: */ 1470 1489 QString strErrorInfo = formatErrorInfo(machine); 1471 /* Show the message: */1472 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1473 1474 1475 1490 /* Show the error: */ 1491 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1492 tr("Failed to clone the virtual machine <b>%1</b>.") 1493 .arg(machine.GetName()), 1494 strErrorInfo); 1476 1495 } 1477 1496 1478 1497 void UIMessageCenter::cannotCreateClone(const CProgress &progress, const QString &strMachineName, QWidget *pParent /*= 0*/) const 1479 1498 { 1480 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1481 1482 1483 1499 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1500 tr("Failed to clone the virtual machine <b>%1</b>.") 1501 .arg(strMachineName), 1502 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 1484 1503 } 1485 1504 1486 1505 void UIMessageCenter::cannotOverwriteHardDiskStorage(const QString &strLocation, QWidget *pParent /*= 0*/) const 1487 1506 { 1488 message(pParent ? pParent : mainWindowShown(), MessageType_Info,1489 1490 1491 1492 1493 1507 alert(pParent ? pParent : mainWindowShown(), MessageType_Info, 1508 tr("<p>The hard disk storage unit at location <b>%1</b> already exists. " 1509 "You cannot create a new virtual hard disk that uses this location " 1510 "because it can be already used by another virtual hard disk.</p>" 1511 "<p>Please specify a different location.</p>") 1512 .arg(strLocation)); 1494 1513 } 1495 1514 1496 1515 void UIMessageCenter::cannotCreateHardDiskStorage(const CVirtualBox &vbox, const QString &strLocation, QWidget *pParent /*= 0*/) const 1497 1516 { 1498 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1499 1500 1501 1517 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1518 tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>") 1519 .arg(strLocation), 1520 formatErrorInfo(vbox)); 1502 1521 } 1503 1522 1504 1523 void UIMessageCenter::cannotCreateHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /*= 0*/) const 1505 1524 { 1506 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1507 1508 1509 1525 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1526 tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>") 1527 .arg(strLocation), 1528 formatErrorInfo(medium)); 1510 1529 } 1511 1530 1512 1531 void UIMessageCenter::cannotCreateHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /*= 0*/) const 1513 1532 { 1514 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1515 1516 1517 1533 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1534 tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>") 1535 .arg(strLocation), 1536 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 1518 1537 } 1519 1538 … … 1521 1540 { 1522 1541 QFileInfo fi(strFolderName); 1523 message(pParent ? pParent : mainWindowShown(), MessageType_Critical,1524 1525 1526 1542 alert(pParent ? pParent : mainWindowShown(), MessageType_Critical, 1543 tr("<p>Cannot remove the machine folder <nobr><b>%1</b>.</nobr></p>" 1544 "<p>Please check that this folder really exists and that you have permissions to remove it.</p>") 1545 .arg(fi.fileName())); 1527 1546 } 1528 1547 … … 1530 1549 { 1531 1550 QFileInfo fi(strFolderName); 1532 message(pParent ? pParent : mainWindowShown(), MessageType_Critical,1533 1534 1535 1551 alert(pParent ? pParent : mainWindowShown(), MessageType_Critical, 1552 tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>" 1553 "<p>This folder already exists and possibly belongs to another machine.</p>") 1554 .arg(fi.fileName()).arg(fi.absolutePath())); 1536 1555 } 1537 1556 … … 1539 1558 { 1540 1559 QFileInfo fi(strFolderName); 1541 message(pParent ? pParent : mainWindowShown(), MessageType_Critical,1542 1543 1544 1560 alert(pParent ? pParent : mainWindowShown(), MessageType_Critical, 1561 tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>" 1562 "<p>Please check that the parent really exists and that you have permissions to create the machine folder.</p>") 1563 .arg(fi.fileName()).arg(fi.absolutePath())); 1545 1564 } 1546 1565 … … 1555 1574 if (!strWarningInfo.isEmpty()) 1556 1575 strWarningInfo = "<br />" + strWarningInfo; 1557 /* Show the message: */1558 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1559 1560 1561 1576 /* Show the error: */ 1577 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1578 tr("Failed to open/interpret appliance <b>%1</b>.") 1579 .arg(appliance.GetPath()), 1580 strWarningInfo + strErrorInfo); 1562 1581 } 1563 1582 1564 1583 void UIMessageCenter::cannotImportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent /*= 0*/) const 1565 1584 { 1566 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1567 1568 1569 1585 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1586 tr("Failed to import appliance <b>%1</b>.") 1587 .arg(strPath), 1588 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 1570 1589 } 1571 1590 1572 1591 void UIMessageCenter::cannotCheckFiles(const CProgress &progress, QWidget *pParent /*= 0*/) const 1573 1592 { 1574 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1575 1576 1593 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1594 tr("Failed to check files."), 1595 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 1577 1596 } 1578 1597 1579 1598 void UIMessageCenter::cannotRemoveFiles(const CProgress &progress, QWidget *pParent /*= 0*/) const 1580 1599 { 1581 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1582 1583 1600 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1601 tr("Failed to remove file."), 1602 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 1584 1603 } 1585 1604 1586 1605 bool UIMessageCenter::confirmExportMachinesInSaveState(const QStringList &machineNames, QWidget *pParent /*= 0*/) const 1587 1606 { 1588 return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Warning, 1589 tr("<p>The %n following virtual machine(s) are currently in a saved state: <b>%1</b></p>" 1590 "<p>If you continue the runtime state of the exported machine(s) will be discarded. " 1591 "The other machine(s) will not be changed.</p>", 1592 "This text is never used with n == 0. Feel free to drop the %n where possible, " 1593 "we only included it because of problems with Qt Linguist " 1594 "(but the user can see how many machines are in the list and doesn't need to be told).", 1595 machineNames.size()) 1596 .arg(machineNames.join(", ")), 1597 0 /* auto-confirm id */, 1598 tr("Continue")); 1607 return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Warning, 1608 tr("<p>The %n following virtual machine(s) are currently in a saved state: <b>%1</b></p>" 1609 "<p>If you continue the runtime state of the exported machine(s) will be discarded. " 1610 "The other machine(s) will not be changed.</p>", 1611 "This text is never used with n == 0. Feel free to drop the %n where possible, " 1612 "we only included it because of problems with Qt Linguist (but the user can see " 1613 "how many machines are in the list and doesn't need to be told).", machineNames.size()) 1614 .arg(machineNames.join(", ")), 1615 0 /* auto-confirm id */, 1616 tr("Continue")); 1599 1617 } 1600 1618 … … 1603 1621 /* Preserve error-info: */ 1604 1622 QString strErrorInfo = formatErrorInfo(appliance); 1605 /* Show the message: */1606 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1607 1608 1609 1623 /* Show the error: */ 1624 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1625 tr("Failed to prepare the export of the appliance <b>%1</b>.") 1626 .arg(appliance.GetPath()), 1627 strErrorInfo); 1610 1628 } 1611 1629 1612 1630 void UIMessageCenter::cannotExportAppliance(const CMachine &machine, const QString &strPath, QWidget *pParent /*= 0*/) const 1613 1631 { 1614 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1615 1616 1617 1632 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1633 tr("Failed to prepare the export of the appliance <b>%1</b>.") 1634 .arg(strPath), 1635 formatErrorInfo(machine)); 1618 1636 } 1619 1637 1620 1638 void UIMessageCenter::cannotExportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent /*= 0*/) const 1621 1639 { 1622 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1623 1624 1625 1640 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1641 tr("Failed to export appliance <b>%1</b>.") 1642 .arg(strPath), 1643 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 1626 1644 } 1627 1645 1628 1646 void UIMessageCenter::cannotFindSnapshotByName(const CMachine &machine, const QString &strName, QWidget *pParent /*= 0*/) const 1629 1647 { 1630 message(pParent ? pParent : mainWindowShown(), MessageType_Error,1631 1632 1633 1648 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 1649 tr("Can't find snapshot named <b>%1</b>.") 1650 .arg(strName), 1651 formatErrorInfo(machine)); 1634 1652 } 1635 1653 … … 1692 1710 formatted = "<qt>" + formatted + "</qt>"; 1693 1711 1694 /* Show the message: */1712 /* Show the error: */ 1695 1713 if (type == MessageType_Critical) 1696 1714 { 1697 message(mainMachineWindowShown(), type,1698 1699 1700 1701 1715 error(mainMachineWindowShown(), type, 1716 tr("<p>A fatal error has occurred during virtual machine execution! " 1717 "The virtual machine will be powered off. Please copy the following error message " 1718 "using the clipboard to help diagnose the problem:</p>"), 1719 formatted, autoConfimId.data()); 1702 1720 } 1703 1721 else if (type == MessageType_Error) 1704 1722 { 1705 message(mainMachineWindowShown(), type,1706 1707 1708 1709 1723 error(mainMachineWindowShown(), type, 1724 tr("<p>An error has occurred during virtual machine execution! " 1725 "The error details are shown below. You may try to correct the error " 1726 "and resume the virtual machine execution.</p>"), 1727 formatted, autoConfimId.data()); 1710 1728 } 1711 1729 else 1712 1730 { 1713 message(mainMachineWindowShown(), type,1714 1715 1716 1731 error(mainMachineWindowShown(), type, 1732 tr("<p>The virtual machine execution may run into an error condition as described below. " 1733 "We suggest that you take an appropriate action to avert the error.</p>"), 1734 formatted, autoConfimId.data()); 1717 1735 } 1718 1736 … … 1728 1746 bool UIMessageCenter::remindAboutGuruMeditation(const QString &strLogFolder) 1729 1747 { 1730 return messageOkCancel(mainMachineWindowShown(), MessageType_GuruMeditation,1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1748 return questionBinary(mainMachineWindowShown(), MessageType_GuruMeditation, 1749 tr("<p>A critical error has occurred while running the virtual " 1750 "machine and the machine execution has been stopped.</p>" 1751 "" 1752 "<p>For help, please see the Community section on " 1753 "<a href=http://www.virtualbox.org>http://www.virtualbox.org</a> " 1754 "or your support contract. Please provide the contents of the " 1755 "log file <tt>VBox.log</tt> and the image file <tt>VBox.png</tt>, " 1756 "which you can find in the <nobr><b>%1</b></nobr> directory, " 1757 "as well as a description of what you were doing when this error happened. " 1758 "" 1759 "Note that you can also access the above files by selecting <b>Show Log</b> " 1760 "from the <b>Machine</b> menu of the main VirtualBox window.</p>" 1761 "" 1762 "<p>Press <b>OK</b> if you want to power off the machine " 1763 "or press <b>Ignore</b> if you want to leave it as is for debugging. " 1764 "Please note that debugging requires special knowledge and tools, " 1765 "so it is recommended to press <b>OK</b> now.</p>") 1766 .arg(strLogFolder), 1767 0 /* auto-confirm id */, 1768 QIMessageBox::tr("OK"), 1769 tr("Ignore")); 1752 1770 } 1753 1771 … … 1755 1773 { 1756 1774 if (fHWVirtExSupported) 1757 return messageOkCancel(mainMachineWindowShown(), MessageType_Error,1758 1759 1760 1761 1762 1763 1764 1775 return questionBinary(mainMachineWindowShown(), MessageType_Error, 1776 tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is " 1777 "not operational. Your 64-bit guest will fail to detect a " 1778 "64-bit CPU and will not be able to boot.</p><p>Please ensure " 1779 "that you have enabled VT-x/AMD-V properly in the BIOS of your " 1780 "host computer.</p>"), 1781 0 /* auto-confirm id */, 1782 tr("Close VM"), tr("Continue")); 1765 1783 else 1766 return messageOkCancel(mainMachineWindowShown(), MessageType_Error,1767 1768 1769 1770 1771 1784 return questionBinary(mainMachineWindowShown(), MessageType_Error, 1785 tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. " 1786 "Your 64-bit guest will fail to detect a 64-bit CPU and will " 1787 "not be able to boot."), 1788 0 /* auto-confirm id */, 1789 tr("Close VM"), tr("Continue")); 1772 1790 } 1773 1791 … … 1775 1793 { 1776 1794 if (fHWVirtExSupported) 1777 return messageOkCancel(mainMachineWindowShown(), MessageType_Error,1778 1779 1780 1781 1782 1795 return questionBinary(mainMachineWindowShown(), MessageType_Error, 1796 tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is not operational. " 1797 "Certain guests (e.g. OS/2 and QNX) require this feature.</p>" 1798 "<p>Please ensure that you have enabled VT-x/AMD-V properly in the BIOS of your host computer.</p>"), 1799 0 /* auto-confirm id */, 1800 tr("Close VM"), tr("Continue")); 1783 1801 else 1784 return messageOkCancel(mainMachineWindowShown(), MessageType_Error,1785 1786 1787 1788 1802 return questionBinary(mainMachineWindowShown(), MessageType_Error, 1803 tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. " 1804 "Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it.</p>"), 1805 0 /* auto-confirm id */, 1806 tr("Close VM"), tr("Continue")); 1789 1807 } 1790 1808 1791 1809 bool UIMessageCenter::cannotStartWithoutNetworkIf(const QString &strMachineName, const QString &strIfNames) const 1792 1810 { 1793 return messageOkCancel(mainMachineWindowShown(), MessageType_Error, 1794 tr("<p>Could not start the machine <b>%1</b> because the following " 1795 "physical network interfaces were not found:</p><p><b>%2</b></p>" 1796 "<p>You can either change the machine's network settings or stop the machine.</p>") 1797 .arg(strMachineName) 1798 .arg(strIfNames), 1799 0 /* auto-confirm id */, 1800 tr("Change Network Settings"), tr("Close VM")); 1811 return questionBinary(mainMachineWindowShown(), MessageType_Error, 1812 tr("<p>Could not start the machine <b>%1</b> because the following " 1813 "physical network interfaces were not found:</p><p><b>%2</b></p>" 1814 "<p>You can either change the machine's network settings or stop the machine.</p>") 1815 .arg(strMachineName, strIfNames), 1816 0 /* auto-confirm id */, 1817 tr("Change Network Settings"), tr("Close VM")); 1801 1818 } 1802 1819 1803 1820 void UIMessageCenter::cannotStartMachine(const CConsole &console, const QString &strName) const 1804 1821 { 1805 message(mainMachineWindowShown(), MessageType_Error,1806 1807 1808 1822 error(mainMachineWindowShown(), MessageType_Error, 1823 tr("Failed to start the virtual machine <b>%1</b>.") 1824 .arg(strName), 1825 formatErrorInfo(console)); 1809 1826 } 1810 1827 1811 1828 void UIMessageCenter::cannotStartMachine(const CProgress &progress, const QString &strName) const 1812 1829 { 1813 message(mainMachineWindowShown(), MessageType_Error,1814 1815 1816 1830 error(mainMachineWindowShown(), MessageType_Error, 1831 tr("Failed to start the virtual machine <b>%1</b>.") 1832 .arg(strName), 1833 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 1817 1834 } 1818 1835 1819 1836 void UIMessageCenter::cannotSendACPIToMachine() const 1820 1837 { 1821 message(mainMachineWindowShown(), MessageType_Warning,1822 1823 1838 alert(mainMachineWindowShown(), MessageType_Warning, 1839 tr("You are trying to shut down the guest with the ACPI power button. " 1840 "This is currently not possible because the guest does not support software shutdown.")); 1824 1841 } 1825 1842 1826 1843 bool UIMessageCenter::confirmInputCapture(bool &fAutoConfirmed) const 1827 1844 { 1828 int rc = message(mainMachineWindowShown(), MessageType_Info,1829 tr("<p>You have <b>clicked the mouse</b> inside the Virtual Machine display or pressed the <b>host key</b>. "1830 "This will cause the Virtual Machine to <b>capture</b> the host mouse pointer (only if the mouse pointer "1831 "integration is not currently supported by the guest OS) and the keyboard, which will make them "1832 "unavailable to other applications running on your host machine.</p>"1833 "<p>You can press the <b>host key</b> at any time to <b>uncapture</b> the keyboard and mouse "1834 "(if it is captured) and return them to normal operation. "1835 "The currently assigned host key is shown on the status bar at the bottom of the Virtual Machine window, "1836 "next to the <img src=:/hostkey_16px.png/> icon. "1837 "This icon, together with the mouse icon placed nearby, indicate the current keyboard and mouse capture state.</p>") +1838 tr("<p>The host key is currently defined as <b>%1</b>.</p>", "additional message box paragraph")1839 .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),1840 "confirmInputCapture",1841 AlertButton_Ok | AlertButtonOption_Default,1842 AlertButton_Cancel | AlertButtonOption_Escape,1843 0,1844 tr("Capture", "do input capture"));1845 int rc = question(mainMachineWindowShown(), MessageType_Info, 1846 tr("<p>You have <b>clicked the mouse</b> inside the Virtual Machine display or pressed the <b>host key</b>. " 1847 "This will cause the Virtual Machine to <b>capture</b> the host mouse pointer (only if the mouse pointer " 1848 "integration is not currently supported by the guest OS) and the keyboard, which will make them " 1849 "unavailable to other applications running on your host machine.</p>" 1850 "<p>You can press the <b>host key</b> at any time to <b>uncapture</b> the keyboard and mouse " 1851 "(if it is captured) and return them to normal operation. " 1852 "The currently assigned host key is shown on the status bar at the bottom of the Virtual Machine window, " 1853 "next to the <img src=:/hostkey_16px.png/> icon. " 1854 "This icon, together with the mouse icon placed nearby, indicate the current keyboard and mouse capture state.</p>") + 1855 tr("<p>The host key is currently defined as <b>%1</b>.</p>", "additional message box paragraph") 1856 .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())), 1857 "confirmInputCapture", 1858 AlertButton_Ok | AlertButtonOption_Default, 1859 AlertButton_Cancel | AlertButtonOption_Escape, 1860 0, 1861 tr("Capture", "do input capture")); 1845 1862 /* Was the message auto-confirmed? */ 1846 1863 fAutoConfirmed = (rc & AutoConfirmed); … … 1851 1868 void UIMessageCenter::remindAboutAutoCapture() const 1852 1869 { 1853 message(mainMachineWindowShown(), MessageType_Info,1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1870 alert(mainMachineWindowShown(), MessageType_Info, 1871 tr("<p>You have the <b>Auto capture keyboard</b> option turned on. " 1872 "This will cause the Virtual Machine to automatically <b>capture</b> " 1873 "the keyboard every time the VM window is activated and make it " 1874 "unavailable to other applications running on your host machine: " 1875 "when the keyboard is captured, all keystrokes (including system ones " 1876 "like Alt-Tab) will be directed to the VM.</p>" 1877 "<p>You can press the <b>host key</b> at any time to <b>uncapture</b> the " 1878 "keyboard and mouse (if it is captured) and return them to normal " 1879 "operation. The currently assigned host key is shown on the status bar " 1880 "at the bottom of the Virtual Machine window, next to the " 1881 "<img src=:/hostkey_16px.png/> icon. This icon, together " 1882 "with the mouse icon placed nearby, indicate the current keyboard " 1883 "and mouse capture state.</p>") + 1884 tr("<p>The host key is currently defined as <b>%1</b>.</p>", 1885 "additional message box paragraph") 1886 .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())), 1887 "remindAboutAutoCapture"); 1871 1888 } 1872 1889 … … 1886 1903 if (fSupportsAbsolute) 1887 1904 { 1888 message(mainMachineWindowShown(), MessageType_Info,1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1905 alert(mainMachineWindowShown(), MessageType_Info, 1906 tr("<p>The Virtual Machine reports that the guest OS supports <b>mouse pointer integration</b>. " 1907 "This means that you do not need to <i>capture</i> the mouse pointer to be able to use it in your guest OS -- " 1908 "all mouse actions you perform when the mouse pointer is over the Virtual Machine's display " 1909 "are directly sent to the guest OS. If the mouse is currently captured, it will be automatically uncaptured.</p>" 1910 "<p>The mouse icon on the status bar will look like <img src=:/mouse_seamless_16px.png/> to inform you " 1911 "that mouse pointer integration is supported by the guest OS and is currently turned on.</p>" 1912 "<p><b>Note</b>: Some applications may behave incorrectly in mouse pointer integration mode. " 1913 "You can always disable it for the current session (and enable it again) " 1914 "by selecting the corresponding action from the menu bar.</p>"), 1915 kNames [1] /* auto-confirm id */); 1899 1916 } 1900 1917 else 1901 1918 { 1902 message(mainMachineWindowShown(), MessageType_Info,1903 1904 1905 1906 1919 alert(mainMachineWindowShown(), MessageType_Info, 1920 tr("<p>The Virtual Machine reports that the guest OS does not support <b>mouse pointer integration</b> " 1921 "in the current video mode. You need to capture the mouse (by clicking over the VM display " 1922 "or pressing the host key) in order to use the mouse inside the guest OS.</p>"), 1923 kNames [0] /* auto-confirm id */); 1907 1924 } 1908 1925 … … 1911 1928 } 1912 1929 1913 bool UIMessageCenter::remindAboutPausedVMInput() const 1914 { 1915 int rc = message(mainMachineWindowShown(), MessageType_Info, 1916 tr("<p>The Virtual Machine is currently in the <b>Paused</b> state and " 1917 "not able to see any keyboard or mouse input. If you want to " 1918 "continue to work inside the VM, you need to resume it by selecting the " 1919 "corresponding action from the menu bar.</p>"), 1920 "remindAboutPausedVMInput"); 1921 return !(rc & AutoConfirmed); 1930 void UIMessageCenter::remindAboutPausedVMInput() const 1931 { 1932 alert(mainMachineWindowShown(), MessageType_Info, 1933 tr("<p>The Virtual Machine is currently in the <b>Paused</b> state and " 1934 "not able to see any keyboard or mouse input. If you want to " 1935 "continue to work inside the VM, you need to resume it by selecting the " 1936 "corresponding action from the menu bar.</p>"), 1937 "remindAboutPausedVMInput"); 1922 1938 } 1923 1939 1924 1940 bool UIMessageCenter::confirmGoingFullscreen(const QString &strHotKey) const 1925 1941 { 1926 return messageOkCancel(mainMachineWindowShown(), MessageType_Info, 1927 tr("<p>The virtual machine window will be now switched to <b>fullscreen</b> mode. " 1928 "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>" 1929 "<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>" 1930 "<p>Note that the main menu bar is hidden in fullscreen mode. " 1931 "You can access it by pressing <b>Host+Home</b>.</p>") 1932 .arg(strHotKey) 1933 .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())), 1934 "confirmGoingFullscreen", 1935 tr("Switch")); 1942 return questionBinary(mainMachineWindowShown(), MessageType_Info, 1943 tr("<p>The virtual machine window will be now switched to <b>fullscreen</b> mode. " 1944 "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>" 1945 "<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>" 1946 "<p>Note that the main menu bar is hidden in fullscreen mode. " 1947 "You can access it by pressing <b>Host+Home</b>.</p>") 1948 .arg(strHotKey, UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())), 1949 "confirmGoingFullscreen", 1950 tr("Switch")); 1936 1951 } 1937 1952 1938 1953 bool UIMessageCenter::confirmGoingSeamless(const QString &strHotKey) const 1939 1954 { 1940 return messageOkCancel(mainMachineWindowShown(), MessageType_Info, 1941 tr("<p>The virtual machine window will be now switched to <b>Seamless</b> mode. " 1942 "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>" 1943 "<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>" 1944 "<p>Note that the main menu bar is hidden in seamless mode. " 1945 "You can access it by pressing <b>Host+Home</b>.</p>") 1946 .arg(strHotKey) 1947 .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())), 1948 "confirmGoingSeamless", 1949 tr("Switch")); 1955 return questionBinary(mainMachineWindowShown(), MessageType_Info, 1956 tr("<p>The virtual machine window will be now switched to <b>Seamless</b> mode. " 1957 "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>" 1958 "<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>" 1959 "<p>Note that the main menu bar is hidden in seamless mode. " 1960 "You can access it by pressing <b>Host+Home</b>.</p>") 1961 .arg(strHotKey, UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())), 1962 "confirmGoingSeamless", 1963 tr("Switch")); 1950 1964 } 1951 1965 1952 1966 bool UIMessageCenter::confirmGoingScale(const QString &strHotKey) const 1953 1967 { 1954 return messageOkCancel(mainMachineWindowShown(), MessageType_Info, 1955 tr("<p>The virtual machine window will be now switched to <b>Scale</b> mode. " 1956 "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>" 1957 "<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>" 1958 "<p>Note that the main menu bar is hidden in scale mode. " 1959 "You can access it by pressing <b>Host+Home</b>.</p>") 1960 .arg(strHotKey) 1961 .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())), 1962 "confirmGoingScale", 1963 tr("Switch")); 1968 return questionBinary(mainMachineWindowShown(), MessageType_Info, 1969 tr("<p>The virtual machine window will be now switched to <b>Scale</b> mode. " 1970 "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>" 1971 "<p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p>" 1972 "<p>Note that the main menu bar is hidden in scale mode. " 1973 "You can access it by pressing <b>Host+Home</b>.</p>") 1974 .arg(strHotKey, UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())), 1975 "confirmGoingScale", 1976 tr("Switch")); 1964 1977 } 1965 1978 1966 1979 bool UIMessageCenter::cannotEnterFullscreenMode(ULONG /* uWidth */, ULONG /* uHeight */, ULONG /* uBpp */, ULONG64 uMinVRAM) const 1967 1980 { 1968 return messageOkCancel(mainMachineWindowShown(), MessageType_Warning,1969 1970 1971 1972 1973 1974 1981 return questionBinary(mainMachineWindowShown(), MessageType_Warning, 1982 tr("<p>Could not switch the guest display to fullscreen mode due to insufficient guest video memory.</p>" 1983 "<p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p>" 1984 "<p>Press <b>Ignore</b> to switch to fullscreen mode anyway or press <b>Cancel</b> to cancel the operation.</p>") 1985 .arg(VBoxGlobal::formatSize(uMinVRAM)), 1986 0 /* auto-confirm id */, 1987 tr("Ignore")); 1975 1988 } 1976 1989 1977 1990 void UIMessageCenter::cannotEnterSeamlessMode(ULONG /* uWidth */, ULONG /* uHeight */, ULONG /* uBpp */, ULONG64 uMinVRAM) const 1978 1991 { 1979 message(mainMachineWindowShown(), MessageType_Error,1980 1981 1982 1983 1984 1992 alert(mainMachineWindowShown(), MessageType_Error, 1993 tr("<p>Could not enter seamless mode due to insufficient guest " 1994 "video memory.</p>" 1995 "<p>You should configure the virtual machine to have at " 1996 "least <b>%1</b> of video memory.</p>") 1997 .arg(VBoxGlobal::formatSize(uMinVRAM))); 1985 1998 } 1986 1999 1987 2000 bool UIMessageCenter::cannotSwitchScreenInFullscreen(quint64 uMinVRAM) const 1988 2001 { 1989 return messageOkCancel(mainMachineWindowShown(), MessageType_Warning,1990 1991 1992 1993 1994 1995 2002 return questionBinary(mainMachineWindowShown(), MessageType_Warning, 2003 tr("<p>Could not change the guest screen to this host screen due to insufficient guest video memory.</p>" 2004 "<p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p>" 2005 "<p>Press <b>Ignore</b> to switch the screen anyway or press <b>Cancel</b> to cancel the operation.</p>") 2006 .arg(VBoxGlobal::formatSize(uMinVRAM)), 2007 0 /* auto-confirm id */, 2008 tr("Ignore")); 1996 2009 } 1997 2010 1998 2011 void UIMessageCenter::cannotSwitchScreenInSeamless(quint64 uMinVRAM) const 1999 2012 { 2000 message(mainMachineWindowShown(), MessageType_Error,2001 2002 2003 2004 2005 2006 } 2007 2008 void UIMessageCenter::cannotAttachUSBDevice(const CConsole &console, const QString &strDevice) 2013 alert(mainMachineWindowShown(), MessageType_Error, 2014 tr("<p>Could not change the guest screen to this host screen " 2015 "due to insufficient guest video memory.</p>" 2016 "<p>You should configure the virtual machine to have at " 2017 "least <b>%1</b> of video memory.</p>") 2018 .arg(VBoxGlobal::formatSize(uMinVRAM))); 2019 } 2020 2021 void UIMessageCenter::cannotAttachUSBDevice(const CConsole &console, const QString &strDevice) const 2009 2022 { 2010 2023 /* Preserve error-info: */ 2011 2024 QString strErrorInfo = formatErrorInfo(console); 2012 /* Show the message: */2013 message(mainMachineWindowShown(), MessageType_Error,2014 2015 2016 2017 } 2018 2019 void UIMessageCenter::cannotAttachUSBDevice(const CVirtualBoxErrorInfo &error , const QString &strDevice, const QString &strMachineName)2020 { 2021 message(mainMachineWindowShown(), MessageType_Error,2022 2023 2024 formatErrorInfo(error));2025 } 2026 2027 void UIMessageCenter::cannotDetachUSBDevice(const CConsole &console, const QString &strDevice) 2025 /* Show the error: */ 2026 error(mainMachineWindowShown(), MessageType_Error, 2027 tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.") 2028 .arg(strDevice, console.GetMachine().GetName()), 2029 strErrorInfo); 2030 } 2031 2032 void UIMessageCenter::cannotAttachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const 2033 { 2034 error(mainMachineWindowShown(), MessageType_Error, 2035 tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.") 2036 .arg(strDevice, strMachineName), 2037 formatErrorInfo(errorInfo)); 2038 } 2039 2040 void UIMessageCenter::cannotDetachUSBDevice(const CConsole &console, const QString &strDevice) const 2028 2041 { 2029 2042 /* Preserve error-info: */ 2030 2043 QString strErrorInfo = formatErrorInfo(console); 2031 /* Show the message: */ 2032 message(mainMachineWindowShown(), MessageType_Error, 2033 tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.") 2034 .arg(strDevice, console.GetMachine().GetName()), 2035 strErrorInfo); 2036 } 2037 2038 void UIMessageCenter::cannotDetachUSBDevice(const CVirtualBoxErrorInfo &error, const QString &strDevice, const QString &strMachineName) 2039 { 2040 message(mainMachineWindowShown(), MessageType_Error, 2041 tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.") 2042 .arg(strDevice, strMachineName), 2043 formatErrorInfo(error)); 2044 } 2045 2046 void UIMessageCenter::remindAboutGuestAdditionsAreNotActive(QWidget *pParent /*= 0*/) 2047 { 2048 message(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning, 2049 tr("<p>The VirtualBox Guest Additions do not appear to be available on this virtual machine, " 2050 "and shared folders cannot be used without them. To use shared folders inside the virtual machine, " 2051 "please install the Guest Additions if they are not installed, or re-install them if they are " 2052 "not working correctly, by selecting <b>Install Guest Additions</b> from the <b>Devices</b> menu. " 2053 "If they are installed but the machine is not yet fully started then shared folders will be available once it is.</p>"), 2054 "remindAboutGuestAdditionsAreNotActive"); 2055 } 2056 2057 bool UIMessageCenter::confirmCancelingAllNetworkRequests() 2058 { 2059 return messageOkCancel(networkManagerOrMainWindowShown(), MessageType_Question, 2060 tr("Do you wish to cancel all current network operations?")); 2061 } 2062 2063 void UIMessageCenter::showUpdateSuccess(const QString &strVersion, const QString &strLink) 2064 { 2065 message(networkManagerOrMainWindowShown(), MessageType_Info, 2066 tr("<p>A new version of VirtualBox has been released! Version <b>%1</b> is available " 2067 "at <a href=\"http://www.virtualbox.org/\">virtualbox.org</a>.</p>" 2068 "<p>You can download this version using the link:</p>" 2069 "<p><a href=%2>%3</a></p>") 2070 .arg(strVersion, strLink, strLink)); 2071 } 2072 2073 void UIMessageCenter::showUpdateNotFound() 2074 { 2075 message(networkManagerOrMainWindowShown(), MessageType_Info, 2076 tr("You are already running the most recent version of VirtualBox.")); 2077 } 2078 2079 bool UIMessageCenter::askUserToDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion) 2080 { 2081 return message(mainWindowShown(), MessageType_Info, 2082 tr("<p>You have version %1 of the <b><nobr>%2</nobr></b> installed.</p>" 2083 "<p>You should download and install version %3 of this extension pack from Oracle!</p>") 2084 .arg(strExtPackVersion).arg(strExtPackName).arg(strVBoxVersion), 2085 0 /* auto-confirm id */, 2086 AlertButton_Ok | AlertButtonOption_Default, 2087 0, 2088 0, 2089 tr("Ok", "extension pack")); 2044 /* Show the error: */ 2045 error(mainMachineWindowShown(), MessageType_Error, 2046 tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.") 2047 .arg(strDevice, console.GetMachine().GetName()), 2048 strErrorInfo); 2049 } 2050 2051 void UIMessageCenter::cannotDetachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const 2052 { 2053 error(mainMachineWindowShown(), MessageType_Error, 2054 tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.") 2055 .arg(strDevice, strMachineName), 2056 formatErrorInfo(errorInfo)); 2057 } 2058 2059 void UIMessageCenter::remindAboutGuestAdditionsAreNotActive(QWidget *pParent /*= 0*/) const 2060 { 2061 alert(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning, 2062 tr("<p>The VirtualBox Guest Additions do not appear to be available on this virtual machine, " 2063 "and shared folders cannot be used without them. To use shared folders inside the virtual machine, " 2064 "please install the Guest Additions if they are not installed, or re-install them if they are " 2065 "not working correctly, by selecting <b>Install Guest Additions</b> from the <b>Devices</b> menu. " 2066 "If they are installed but the machine is not yet fully started then shared folders will be available once it is.</p>"), 2067 "remindAboutGuestAdditionsAreNotActive"); 2068 } 2069 2070 bool UIMessageCenter::confirmCancelingAllNetworkRequests() const 2071 { 2072 return questionBinary(networkManagerOrMainWindowShown(), MessageType_Question, 2073 tr("Do you wish to cancel all current network operations?")); 2074 } 2075 2076 void UIMessageCenter::showUpdateSuccess(const QString &strVersion, const QString &strLink) const 2077 { 2078 alert(networkManagerOrMainWindowShown(), MessageType_Info, 2079 tr("<p>A new version of VirtualBox has been released! Version <b>%1</b> is available " 2080 "at <a href=\"http://www.virtualbox.org/\">virtualbox.org</a>.</p>" 2081 "<p>You can download this version using the link:</p>" 2082 "<p><a href=%2>%3</a></p>") 2083 .arg(strVersion, strLink, strLink)); 2084 } 2085 2086 void UIMessageCenter::showUpdateNotFound() const 2087 { 2088 alert(networkManagerOrMainWindowShown(), MessageType_Info, 2089 tr("You are already running the most recent version of VirtualBox.")); 2090 } 2091 2092 void UIMessageCenter::askUserToDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion) const 2093 { 2094 alert(mainWindowShown(), MessageType_Info, 2095 tr("<p>You have version %1 of the <b><nobr>%2</nobr></b> installed.</p>" 2096 "<p>You should download and install version %3 of this extension pack from Oracle!</p>") 2097 .arg(strExtPackVersion).arg(strExtPackName).arg(strVBoxVersion), 2098 0 /* auto-confirm id */); 2090 2099 } 2091 2100 2092 2101 bool UIMessageCenter::cannotFindGuestAdditions() const 2093 2102 { 2094 return messageOkCancel(mainMachineWindowShown(), MessageType_Question,2095 2096 2097 2098 2103 return questionBinary(mainMachineWindowShown(), MessageType_Question, 2104 tr("<p>Could not find the <b>VirtualBox Guest Additions</b> CD image.</p>" 2105 "<p>Do you wish to download this CD image from the Internet?</p>"), 2106 0 /* auto-confirm id */, 2107 tr("Download")); 2099 2108 } 2100 2109 … … 2102 2111 { 2103 2112 QLocale loc(VBoxGlobal::languageId()); 2104 return messageOkCancel(networkManagerOrMainMachineWindowShown(), MessageType_Question,2105 2106 2107 2108 2109 2113 return questionBinary(networkManagerOrMainMachineWindowShown(), MessageType_Question, 2114 tr("<p>Are you sure you want to download the <b>VirtualBox Guest Additions</b> CD image " 2115 "from <nobr><a href=\"%1\">%1</a></nobr> (size %2 bytes)?</p>") 2116 .arg(strUrl, loc.toString(uSize)), 2117 0 /* auto-confirm id */, 2118 tr("Download")); 2110 2119 } 2111 2120 2112 2121 void UIMessageCenter::cannotSaveGuestAdditions(const QString &strURL, const QString &strTarget) const 2113 2122 { 2114 message(networkManagerOrMainMachineWindowShown(), MessageType_Error,2115 2116 2117 2118 2119 2123 alert(networkManagerOrMainMachineWindowShown(), MessageType_Error, 2124 tr("<p>The <b>VirtualBox Guest Additions</b> CD image has been successfully downloaded " 2125 "from <nobr><a href=\"%1\">%1</a></nobr> " 2126 "but can't be saved locally as <nobr><b>%2</b>.</nobr></p>" 2127 "<p>Please choose another location for that file.</p>") 2128 .arg(strURL, strTarget)); 2120 2129 } 2121 2130 2122 2131 bool UIMessageCenter::proposeMountGuestAdditions(const QString &strUrl, const QString &strSrc) const 2123 2132 { 2124 return messageOkCancel(networkManagerOrMainMachineWindowShown(), MessageType_Question,2125 2126 2127 2128 2129 2130 2131 2133 return questionBinary(networkManagerOrMainMachineWindowShown(), MessageType_Question, 2134 tr("<p>The <b>VirtualBox Guest Additions</b> CD image has been successfully downloaded " 2135 "from <nobr><a href=\"%1\">%1</a></nobr> " 2136 "and saved locally as <nobr><b>%2</b>.</nobr></p>" 2137 "<p>Do you wish to register this CD image and mount it on the virtual CD/DVD drive?</p>") 2138 .arg(strUrl, strSrc), 2139 0 /* auto-confirm id */, 2140 tr("Mount", "additions")); 2132 2141 } 2133 2142 2134 2143 void UIMessageCenter::cannotMountGuestAdditions(const QString &strMachineName) const 2135 2144 { 2136 message(mainMachineWindowShown(), MessageType_Error,2137 2138 2139 2140 2145 alert(mainMachineWindowShown(), MessageType_Error, 2146 tr("<p>Could not insert the <b>VirtualBox Guest Additions</b> CD image into the virtual machine <b>%1</b>, " 2147 "as the machine has no CD/DVD-ROM drives. Please add a drive using the storage page of the " 2148 "virtual machine settings dialog.</p>") 2149 .arg(strMachineName)); 2141 2150 } 2142 2151 2143 2152 void UIMessageCenter::cannotUpdateGuestAdditions(const CProgress &progress) const 2144 2153 { 2145 message(mainMachineWindowShown(), MessageType_Error,2146 2147 2148 2154 error(mainMachineWindowShown(), MessageType_Error, 2155 tr("Failed to update Guest Additions. " 2156 "The Guest Additions installation image will be mounted to provide a manual installation."), 2157 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 2149 2158 } 2150 2159 2151 2160 bool UIMessageCenter::cannotFindUserManual(const QString &strMissedLocation) const 2152 2161 { 2153 return messageOkCancel(mainWindowShown(), MessageType_Question,2154 2155 2156 2157 2158 2162 return questionBinary(mainWindowShown(), MessageType_Question, 2163 tr("<p>Could not find the <b>VirtualBox User Manual</b> <nobr><b>%1</b>.</nobr></p>" 2164 "<p>Do you wish to download this file from the Internet?</p>") 2165 .arg(strMissedLocation), 2166 0 /* auto-confirm id */, 2167 tr("Download")); 2159 2168 } 2160 2169 … … 2162 2171 { 2163 2172 QLocale loc(VBoxGlobal::languageId()); 2164 return messageOkCancel(networkManagerOrMainWindowShown(), MessageType_Question,2165 2166 2167 2168 2169 2173 return questionBinary(networkManagerOrMainWindowShown(), MessageType_Question, 2174 tr("<p>Are you sure you want to download the <b>VirtualBox User Manual</b> " 2175 "from <nobr><a href=\"%1\">%1</a></nobr> (size %2 bytes)?</p>") 2176 .arg(strURL, loc.toString(uSize)), 2177 0 /* auto-confirm id */, 2178 tr("Download")); 2170 2179 } 2171 2180 2172 2181 void UIMessageCenter::cannotSaveUserManual(const QString &strURL, const QString &strTarget) const 2173 2182 { 2174 message(networkManagerOrMainWindowShown(), MessageType_Error,2175 2176 2177 2178 2179 2183 alert(networkManagerOrMainWindowShown(), MessageType_Error, 2184 tr("<p>The VirtualBox User Manual has been successfully downloaded " 2185 "from <nobr><a href=\"%1\">%1</a></nobr> " 2186 "but can't be saved locally as <nobr><b>%2</b>.</nobr></p>" 2187 "<p>Please choose another location for that file.</p>") 2188 .arg(strURL, strTarget)); 2180 2189 } 2181 2190 2182 2191 void UIMessageCenter::warnAboutUserManualDownloaded(const QString &strURL, const QString &strTarget) const 2183 2192 { 2184 message(networkManagerOrMainWindowShown(), MessageType_Warning,2185 2186 2187 2188 2193 alert(networkManagerOrMainWindowShown(), MessageType_Warning, 2194 tr("<p>The VirtualBox User Manual has been successfully downloaded " 2195 "from <nobr><a href=\"%1\">%1</a></nobr> " 2196 "and saved locally as <nobr><b>%2</b>.</nobr></p>") 2197 .arg(strURL, strTarget)); 2189 2198 } 2190 2199 2191 2200 bool UIMessageCenter::warAboutOutdatedExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion) const 2192 2201 { 2193 return messageOkCancel(mainWindowShown(),2194 2195 2196 2197 2198 2199 2202 return questionBinary(mainWindowShown(), 2203 MessageType_Question, 2204 tr("<p>You have an old version (%1) of the <b><nobr>%2</nobr></b> installed.</p>" 2205 "<p>Do you wish to download latest one from the Internet?</p>") 2206 .arg(strExtPackVersion).arg(strExtPackName), 2207 0 /* auto-confirm id */, 2208 tr("Download")); 2200 2209 } 2201 2210 … … 2203 2212 { 2204 2213 QLocale loc(VBoxGlobal::languageId()); 2205 return messageOkCancel(networkManagerOrMainWindowShown(), MessageType_Question,2206 2207 2208 2209 2210 2214 return questionBinary(networkManagerOrMainWindowShown(), MessageType_Question, 2215 tr("<p>Are you sure you want to download the <b><nobr>%1</nobr></b> " 2216 "from <nobr><a href=\"%2\">%2</a></nobr> (size %3 bytes)?</p>") 2217 .arg(strExtPackName, strURL, loc.toString(uSize)), 2218 0 /* auto-confirm id */, 2219 tr("Download")); 2211 2220 } 2212 2221 2213 2222 void UIMessageCenter::cannotSaveExtensionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo) const 2214 2223 { 2215 message(networkManagerOrMainWindowShown(), MessageType_Error,2216 2217 2218 2219 2220 2224 alert(networkManagerOrMainWindowShown(), MessageType_Error, 2225 tr("<p>The <b><nobr>%1</nobr></b> has been successfully downloaded " 2226 "from <nobr><a href=\"%2\">%2</a></nobr> " 2227 "but can't be saved locally as <nobr><b>%3</b>.</nobr></p>" 2228 "<p>Please choose another location for that file.</p>") 2229 .arg(strExtPackName, strFrom, strTo)); 2221 2230 } 2222 2231 2223 2232 bool UIMessageCenter::proposeInstallExtentionPack(const QString &strExtPackName, const QString &strFrom, const QString &strTo) const 2224 2233 { 2225 return messageOkCancel(networkManagerOrMainWindowShown(), MessageType_Question,2226 2227 2228 2229 2230 2231 2232 2234 return questionBinary(networkManagerOrMainWindowShown(), MessageType_Question, 2235 tr("<p>The <b><nobr>%1</nobr></b> has been successfully downloaded " 2236 "from <nobr><a href=\"%2\">%2</a></nobr> " 2237 "and saved locally as <nobr><b>%3</b>.</nobr></p>" 2238 "<p>Do you wish to install this extension pack?</p>") 2239 .arg(strExtPackName, strFrom, strTo), 2240 0 /* auto-confirm id */, 2241 tr("Install", "extension pack")); 2233 2242 } 2234 2243 … … 2236 2245 const QString &strPackDescription, QWidget *pParent /*= 0*/) const 2237 2246 { 2238 return messageOkCancel(pParent ? pParent : mainWindowShown(),2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2247 return questionBinary(pParent ? pParent : mainWindowShown(), 2248 MessageType_Question, 2249 tr("<p>You are about to install a VirtualBox extension pack. " 2250 "Extension packs complement the functionality of VirtualBox and can contain system level software " 2251 "that could be potentially harmful to your system. Please review the description below and only proceed " 2252 "if you have obtained the extension pack from a trusted source.</p>" 2253 "<p><table cellpadding=0 cellspacing=0>" 2254 "<tr><td><b>Name: </b></td><td>%1</td></tr>" 2255 "<tr><td><b>Version: </b></td><td>%2</td></tr>" 2256 "<tr><td><b>Description: </b></td><td>%3</td></tr>" 2257 "</table></p>") 2258 .arg(strPackName).arg(strPackVersion).arg(strPackDescription), 2259 0, 2260 tr("Install", "extension pack")); 2252 2261 } 2253 2262 … … 2267 2276 int iVerCmp = RTStrVersionCompare(ba1.constData(), ba2.constData()); 2268 2277 2269 /* Show the message: */2278 /* Show the question: */ 2270 2279 bool fRc; 2271 2280 if (iVerCmp > 0) 2272 fRc = messageOkCancel(pParent ? pParent : mainWindowShown(),2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2281 fRc = questionBinary(pParent ? pParent : mainWindowShown(), 2282 MessageType_Question, 2283 tr("<p>An older version of the extension pack is already installed, would you like to upgrade? " 2284 "<p>%1</p>" 2285 "<p><table cellpadding=0 cellspacing=0>" 2286 "<tr><td><b>Name: </b></td><td>%2</td></tr>" 2287 "<tr><td><b>New Version: </b></td><td>%3</td></tr>" 2288 "<tr><td><b>Current Version: </b></td><td>%4</td></tr>" 2289 "<tr><td><b>Description: </b></td><td>%5</td></tr>" 2290 "</table></p>") 2291 .arg(strBelehrung).arg(strPackName).arg(strPackVersionNew).arg(strPackVersionOld).arg(strPackDescription), 2292 0, 2293 tr("&Upgrade")); 2285 2294 else if (iVerCmp < 0) 2286 fRc = messageOkCancel(pParent ? pParent : mainWindowShown(),2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2295 fRc = questionBinary(pParent ? pParent : mainWindowShown(), 2296 MessageType_Question, 2297 tr("<p>An newer version of the extension pack is already installed, would you like to downgrade? " 2298 "<p>%1</p>" 2299 "<p><table cellpadding=0 cellspacing=0>" 2300 "<tr><td><b>Name: </b></td><td>%2</td></tr>" 2301 "<tr><td><b>New Version: </b></td><td>%3</td></tr>" 2302 "<tr><td><b>Current Version: </b></td><td>%4</td></tr>" 2303 "<tr><td><b>Description: </b></td><td>%5</td></tr>" 2304 "</table></p>") 2305 .arg(strBelehrung).arg(strPackName).arg(strPackVersionNew).arg(strPackVersionOld).arg(strPackDescription), 2306 0, 2307 tr("&Downgrade")); 2299 2308 else 2300 fRc = messageOkCancel(pParent ? pParent : mainWindowShown(),2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2309 fRc = questionBinary(pParent ? pParent : mainWindowShown(), 2310 MessageType_Question, 2311 tr("<p>The extension pack is already installed with the same version, would you like reinstall it? " 2312 "<p>%1</p>" 2313 "<p><table cellpadding=0 cellspacing=0>" 2314 "<tr><td><b>Name: </b></td><td>%2</td></tr>" 2315 "<tr><td><b>Version: </b></td><td>%3</td></tr>" 2316 "<tr><td><b>Description: </b></td><td>%4</td></tr>" 2317 "</table></p>") 2318 .arg(strBelehrung).arg(strPackName).arg(strPackVersionOld).arg(strPackDescription), 2319 0, 2320 tr("&Reinstall")); 2312 2321 return fRc; 2313 2322 } … … 2315 2324 bool UIMessageCenter::confirmRemoveExtensionPack(const QString &strPackName, QWidget *pParent /*= 0*/) const 2316 2325 { 2317 return messageOkCancel(pParent ? pParent : mainWindowShown(),2318 2319 2320 2321 2322 2323 2326 return questionBinary(pParent ? pParent : mainWindowShown(), 2327 MessageType_Question, 2328 tr("<p>You are about to remove the VirtualBox extension pack <b>%1</b>.</p>" 2329 "<p>Are you sure you want to proceed?</p>") 2330 .arg(strPackName), 2331 0, 2332 tr("&Remove")); 2324 2333 } 2325 2334 2326 2335 void UIMessageCenter::cannotOpenExtPack(const QString &strFilename, const CExtPackManager &extPackManager, QWidget *pParent /*= 0*/) const 2327 2336 { 2328 message(pParent ? pParent : mainWindowShown(), MessageType_Error,2329 2330 2337 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 2338 tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename), 2339 formatErrorInfo(extPackManager)); 2331 2340 } 2332 2341 2333 2342 void UIMessageCenter::warnAboutBadExtPackFile(const QString &strFilename, const CExtPackFile &extPackFile, QWidget *pParent /*= 0*/) const 2334 2343 { 2335 message(pParent ? pParent : mainWindowShown(), MessageType_Error,2336 2337 2344 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 2345 tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename), 2346 "<!--EOM-->" + extPackFile.GetWhyUnusable()); 2338 2347 } 2339 2348 2340 2349 void UIMessageCenter::cannotInstallExtPack(const CExtPackFile &extPackFile, const QString &strFilename, QWidget *pParent /*= 0*/) const 2341 2350 { 2342 message(pParent ? pParent : mainWindowShown(), MessageType_Error,2343 2344 2345 2351 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 2352 tr("Failed to install the Extension Pack <b>%1</b>.") 2353 .arg(strFilename), 2354 formatErrorInfo(extPackFile)); 2346 2355 } 2347 2356 2348 2357 void UIMessageCenter::cannotInstallExtPack(const CProgress &progress, const QString &strFilename, QWidget *pParent /*= 0*/) const 2349 2358 { 2350 message(pParent ? pParent : mainWindowShown(), MessageType_Error,2351 2352 2353 2359 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 2360 tr("Failed to install the Extension Pack <b>%1</b>.") 2361 .arg(strFilename), 2362 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 2354 2363 } 2355 2364 2356 2365 void UIMessageCenter::cannotUninstallExtPack(const CExtPackManager &extPackManager, const QString &strPackName, QWidget *pParent /*= 0*/) const 2357 2366 { 2358 message(pParent ? pParent : mainWindowShown(), MessageType_Error,2359 2360 2361 2367 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 2368 tr("Failed to uninstall the Extension Pack <b>%1</b>.") 2369 .arg(strPackName), 2370 formatErrorInfo(extPackManager)); 2362 2371 } 2363 2372 2364 2373 void UIMessageCenter::cannotUninstallExtPack(const CProgress &progress, const QString &strPackName, QWidget *pParent /*= 0*/) const 2365 2374 { 2366 message(pParent ? pParent : mainWindowShown(), MessageType_Error,2367 2368 2369 2375 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 2376 tr("Failed to uninstall the Extension Pack <b>%1</b>.") 2377 .arg(strPackName), 2378 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 2370 2379 } 2371 2380 2372 2381 void UIMessageCenter::warnAboutExtPackInstalled(const QString &strPackName, QWidget *pParent /*= 0*/) const 2373 2382 { 2374 message(pParent ? pParent : mainWindowShown(), 2375 MessageType_Info, 2376 tr("The extension pack <br><nobr><b>%1</b><nobr><br> was installed successfully.") 2377 .arg(strPackName)); 2383 alert(pParent ? pParent : mainWindowShown(), MessageType_Info, 2384 tr("The extension pack <br><nobr><b>%1</b><nobr><br> was installed successfully.") 2385 .arg(strPackName)); 2378 2386 } 2379 2387 … … 2381 2389 void UIMessageCenter::cannotDropData(const CGuest &guest, QWidget *pParent /*= 0*/) const 2382 2390 { 2383 message(pParent ? pParent : mainWindowShown(), MessageType_Error,2384 2385 2391 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 2392 tr("Failed to drop data."), 2393 formatErrorInfo(guest)); 2386 2394 } 2387 2395 2388 2396 void UIMessageCenter::cannotDropData(const CProgress &progress, QWidget *pParent /*= 0*/) const 2389 2397 { 2390 message(pParent ? pParent : mainWindowShown(), MessageType_Error,2391 2392 2398 error(pParent ? pParent : mainWindowShown(), MessageType_Error, 2399 tr("Failed to drop data."), 2400 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 2393 2401 } 2394 2402 #endif /* VBOX_WITH_DRAG_AND_DROP */ 2395 2403 2396 void UIMessageCenter::cannotOpenLicenseFile(const QString &strPath, QWidget *pParent /*= 0*/) 2397 { 2398 message(pParent ? pParent : mainWindowShown(), MessageType_Error,2399 2400 2401 } 2402 2403 bool UIMessageCenter::confirmOverridingFile(const QString &strPath, QWidget *pParent /*= 0*/) 2404 { 2405 return messageOkCancel(pParent, MessageType_Question,2406 2407 2408 2409 2410 } 2411 2412 bool UIMessageCenter::confirmOverridingFiles(const QVector<QString> &strPaths, QWidget *pParent /*= 0*/) 2404 void UIMessageCenter::cannotOpenLicenseFile(const QString &strPath, QWidget *pParent /*= 0*/) const 2405 { 2406 alert(pParent ? pParent : mainWindowShown(), MessageType_Error, 2407 tr("Failed to open the license file <nobr><b>%1</b></nobr>. Check file permissions.") 2408 .arg(strPath)); 2409 } 2410 2411 bool UIMessageCenter::confirmOverridingFile(const QString &strPath, QWidget *pParent /*= 0*/) const 2412 { 2413 return questionBinary(pParent, MessageType_Question, 2414 tr("A file named <b>%1</b> already exists. " 2415 "Are you sure you want to replace it?<br /><br />" 2416 "Replacing it will overwrite its contents.") 2417 .arg(strPath)); 2418 } 2419 2420 bool UIMessageCenter::confirmOverridingFiles(const QVector<QString> &strPaths, QWidget *pParent /*= 0*/) const 2413 2421 { 2414 2422 /* If it is only one file use the single question versions above: */ … … 2416 2424 return confirmOverridingFile(strPaths.at(0), pParent); 2417 2425 else if (strPaths.size() > 1) 2418 return messageOkCancel(pParent, MessageType_Question,2419 2420 2421 2422 2426 return questionBinary(pParent, MessageType_Question, 2427 tr("The following files already exist:<br /><br />%1<br /><br />" 2428 "Are you sure you want to replace them? " 2429 "Replacing them will overwrite their contents.") 2430 .arg(QStringList(strPaths.toList()).join("<br />"))); 2423 2431 else 2424 2432 return true; 2425 2433 } 2426 2434 2427 bool UIMessageCenter::confirmOverridingFileIfExists(const QString &strPath, QWidget *pParent /*= 0*/) 2435 bool UIMessageCenter::confirmOverridingFileIfExists(const QString &strPath, QWidget *pParent /*= 0*/) const 2428 2436 { 2429 2437 QFileInfo fi(strPath); … … 2434 2442 } 2435 2443 2436 bool UIMessageCenter::confirmOverridingFilesIfExists(const QVector<QString> &strPaths, QWidget *pParent /*= 0*/) 2444 bool UIMessageCenter::confirmOverridingFilesIfExists(const QVector<QString> &strPaths, QWidget *pParent /*= 0*/) const 2437 2445 { 2438 2446 QVector<QString> existingFiles; … … 2519 2527 } 2520 2528 2521 void UIMessageCenter::remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) 2529 void UIMessageCenter::remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const 2522 2530 { 2523 2531 emit sigRemindAboutWrongColorDepth(uRealBPP, uWantedBPP); … … 2622 2630 } 2623 2631 2624 void UIMessageCenter::sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) 2632 void UIMessageCenter::sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const 2625 2633 { 2626 2634 const char *kName = "remindAboutWrongColorDepth"; … … 2634 2642 } 2635 2643 2636 message(mainMachineWindowShown(), MessageType_Info,2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2644 alert(mainMachineWindowShown(), MessageType_Info, 2645 tr("<p>The virtual machine window is optimized to work in " 2646 "<b>%1 bit</b> color mode but the " 2647 "virtual display is currently set to <b>%2 bit</b>.</p>" 2648 "<p>Please open the display properties dialog of the guest OS and " 2649 "select a <b>%3 bit</b> color mode, if it is available, for " 2650 "best possible performance of the virtual video subsystem.</p>" 2651 "<p><b>Note</b>. Some operating systems, like OS/2, may actually " 2652 "work in 32 bit mode but report it as 24 bit " 2653 "(16 million colors). You may try to select a different color " 2654 "mode to see if this message disappears or you can simply " 2655 "disable the message now if you are sure the required color " 2656 "mode (%4 bit) is not available in the guest OS.</p>") 2657 .arg(uWantedBPP).arg(uRealBPP).arg(uWantedBPP).arg(uWantedBPP), 2658 kName); 2651 2659 } 2652 2660 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r45364 r45368 66 66 67 67 /* Notifiers: Synchronization stuff: */ 68 void sigRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) ;68 void sigRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const; 69 69 70 70 public: … … 79 79 void setWarningShown(const QString &strWarningName, bool fWarningShown) const; 80 80 81 /* API: Alert providing stuff: Main function: */81 /* API: Main message function, used directly only in exceptional cases: */ 82 82 int message(QWidget *pParent, MessageType type, 83 83 const QString &strMessage, 84 const QString &strDetails = QString(),84 const QString &strDetails, 85 85 const char *pcszAutoConfirmId = 0, 86 86 int iButton1 = 0, int iButton2 = 0, int iButton3 = 0, … … 89 89 const QString &strButtonText3 = QString()) const; 90 90 91 /* API: Alert providing stuff: Wrapper to the main function, 91 /* API: Wrapper to 'message' function. 92 * Provides single OK button: */ 93 void error(QWidget *pParent, MessageType type, 94 const QString &strMessage, 95 const QString &strDetails, 96 const char *pcszAutoConfirmId = 0) const; 97 98 /* API: Wrapper to 'message' function, 99 * Error with question providing two buttons (OK and Cancel by default): */ 100 bool errorWithQuestion(QWidget *pParent, MessageType type, 101 const QString &strMessage, 102 const QString &strDetails, 103 const char *pcszAutoConfirmId = 0, 104 const QString &strOkButtonText = QString(), 105 const QString &strCancelButtonText = QString()) const; 106 107 /* API: Wrapper to 'error' function. 92 108 * Omits details: */ 93 int message(QWidget *pParent, MessageType type, 94 const QString &strMessage, 95 const char *pcszAutoConfirmId, 96 int iButton1 = 0, int iButton2 = 0, int iButton3 = 0, 97 const QString &strButtonText1 = QString(), 98 const QString &strButtonText2 = QString(), 99 const QString &strButtonText3 = QString()) const; 100 101 /* API: Alert providing stuff: Wrapper to the main function, 102 * Takes button type(s) as "Ok / Cancel": */ 103 bool messageOkCancel(QWidget *pParent, MessageType type, 104 const QString &strMessage, 105 const QString &strDetails = QString(), 106 const char *pcszAutoConfirmId = 0, 107 const QString &strOkButtonText = QString(), 108 const QString &strCancelButtonText = QString(), 109 bool fOkByDefault = true) const; 110 111 /* API: Alert providing stuff: Wrapper to the function above, 112 * Takes button type(s) as "Ok / Cancel", 113 * Omits details. */ 114 bool messageOkCancel(QWidget *pParent, MessageType type, 115 const QString &strMessage, 116 const char *pcszAutoConfirmId, 117 const QString &strOkButtonText = QString(), 118 const QString &strCancelButtonText = QString(), 119 bool fOkByDefault = true) const; 120 121 /* API: Alert providing stuff: One more main function: */ 109 void alert(QWidget *pParent, MessageType type, 110 const QString &strMessage, 111 const char *pcszAutoConfirmId = 0) const; 112 113 /* API: Wrapper to 'message' function. 114 * Omits details, provides two or three buttons: */ 115 int question(QWidget *pParent, MessageType type, 116 const QString &strMessage, 117 const char *pcszAutoConfirmId = 0, 118 int iButton1 = 0, int iButton2 = 0, int iButton3 = 0, 119 const QString &strButtonText1 = QString(), 120 const QString &strButtonText2 = QString(), 121 const QString &strButtonText3 = QString()) const; 122 123 /* API: Wrapper to 'question' function, 124 * Question providing two buttons (OK and Cancel by default): */ 125 bool questionBinary(QWidget *pParent, MessageType type, 126 const QString &strMessage, 127 const char *pcszAutoConfirmId = 0, 128 const QString &strOkButtonText = QString(), 129 const QString &strCancelButtonText = QString()) const; 130 131 /* API: Wrapper to 'question' function, 132 * Question providing three buttons (Yes, No and Cancel by default): */ 133 int questionTrinary(QWidget *pParent, MessageType type, 134 const QString &strMessage, 135 const char *pcszAutoConfirmId = 0, 136 const QString &strChoice1ButtonText = QString(), 137 const QString &strChoice2ButtonText = QString(), 138 const QString &strCancelButtonText = QString()) const; 139 140 /* API: One more main function: */ 122 141 int messageWithOption(QWidget *pParent, MessageType type, 123 142 const QString &strMessage, 124 143 const QString &strOptionText, 125 144 bool fDefaultOptionValue = true, 126 const QString &strDetails = QString(),127 145 int iButton1 = 0, int iButton2 = 0, int iButton3 = 0, 128 146 const QString &strButtonText1 = QString(), … … 237 255 void cannotDeleteHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent = 0) const; 238 256 void cannotDetachDevice(const CMachine &machine, UIMediumType type, const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent = 0) const; 239 intcannotRemountMedium(const CMachine &machine, const UIMedium &medium, bool fMount, bool fRetry, QWidget *pParent = 0) const;257 bool cannotRemountMedium(const CMachine &machine, const UIMedium &medium, bool fMount, bool fRetry, QWidget *pParent = 0) const; 240 258 void cannotOpenMedium(const CVirtualBox &vbox, UIMediumType type, const QString &strLocation, QWidget *pParent = 0) const; 241 259 void cannotCloseMedium(const UIMedium &medium, const COMResult &rc, QWidget *pParent = 0) const; … … 276 294 void remindAboutAutoCapture() const; 277 295 void remindAboutMouseIntegration(bool fSupportsAbsolute) const; 278 boolremindAboutPausedVMInput() const;296 void remindAboutPausedVMInput() const; 279 297 bool confirmGoingFullscreen(const QString &strHotKey) const; 280 298 bool confirmGoingSeamless(const QString &strHotKey) const; … … 284 302 bool cannotSwitchScreenInFullscreen(quint64 uMinVRAM) const; 285 303 void cannotSwitchScreenInSeamless(quint64 uMinVRAM) const; 286 void cannotAttachUSBDevice(const CConsole &console, const QString &strDevice) ;287 void cannotAttachUSBDevice(const CVirtualBoxErrorInfo &error , const QString &strDevice, const QString &strMachineName);288 void cannotDetachUSBDevice(const CConsole &console, const QString &strDevice) ;289 void cannotDetachUSBDevice(const CVirtualBoxErrorInfo &error , const QString &strDevice, const QString &strMachineName);290 void remindAboutGuestAdditionsAreNotActive(QWidget *pParent = 0) ;304 void cannotAttachUSBDevice(const CConsole &console, const QString &strDevice) const; 305 void cannotAttachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const; 306 void cannotDetachUSBDevice(const CConsole &console, const QString &strDevice) const; 307 void cannotDetachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const; 308 void remindAboutGuestAdditionsAreNotActive(QWidget *pParent = 0) const; 291 309 292 310 /* API: Network management warnings: */ 293 bool confirmCancelingAllNetworkRequests() ;294 void showUpdateSuccess(const QString &strVersion, const QString &strLink) ;295 void showUpdateNotFound() ;296 bool askUserToDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion);311 bool confirmCancelingAllNetworkRequests() const; 312 void showUpdateSuccess(const QString &strVersion, const QString &strLink) const; 313 void showUpdateNotFound() const; 314 void askUserToDownloadExtensionPack(const QString &strExtPackName, const QString &strExtPackVersion, const QString &strVBoxVersion) const; 297 315 298 316 /* API: Downloading warnings: */ … … 330 348 331 349 /* API: License-viewer warnings: */ 332 void cannotOpenLicenseFile(const QString &strPath, QWidget *pParent = 0) ;350 void cannotOpenLicenseFile(const QString &strPath, QWidget *pParent = 0) const; 333 351 334 352 /* API: File-dialog warnings: */ 335 bool confirmOverridingFile(const QString &strPath, QWidget *pParent = 0) ;336 bool confirmOverridingFiles(const QVector<QString> &strPaths, QWidget *pParent = 0) ;337 bool confirmOverridingFileIfExists(const QString &strPath, QWidget *pParent = 0) ;338 bool confirmOverridingFilesIfExists(const QVector<QString> &strPaths, QWidget *pParent = 0) ;353 bool confirmOverridingFile(const QString &strPath, QWidget *pParent = 0) const; 354 bool confirmOverridingFiles(const QVector<QString> &strPaths, QWidget *pParent = 0) const; 355 bool confirmOverridingFileIfExists(const QString &strPath, QWidget *pParent = 0) const; 356 bool confirmOverridingFilesIfExists(const QVector<QString> &strPaths, QWidget *pParent = 0) const; 339 357 340 358 /* API: Static helpers: */ … … 346 364 347 365 /* API: Async stuff: */ 348 void remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) ;366 void remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const; 349 367 350 368 public slots: … … 367 385 368 386 /* Handlers: Synchronization stuff: */ 369 void sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) ;387 void sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const; 370 388 371 389 private: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
r45333 r45368 906 906 /* Show a possible warning on key release which seems to be more expected by the end user: */ 907 907 if (uisession()->isPaused()) 908 { 909 /* If the reminder is disabled we pass the event to Qt to enable normal 910 * keyboard functionality (for example, menu access with Alt+Letter): */ 911 if (!msgCenter().remindAboutPausedVMInput()) 912 break; 913 } 908 msgCenter().remindAboutPausedVMInput(); 914 909 } 915 910 break; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r45334 r45368 1504 1504 /* Ask for force remounting: */ 1505 1505 if (msgCenter().cannotRemountMedium(machine, vboxGlobal().findMedium(fMount ? newId : currentId), 1506 fMount, true /* retry? */, activeMachineWindow()) == AlertButton_Ok)1506 fMount, true /* retry? */, activeMachineWindow())) 1507 1507 { 1508 1508 /* Force remount medium to the predefined port/device: */ … … 1565 1565 /* Ask for force remounting: */ 1566 1566 if (msgCenter().cannotRemountMedium(machine, vboxGlobal().findMedium(fMount ? strNewId : strCurrentId), 1567 fMount, true /* retry? */, activeMachineWindow()) == AlertButton_Ok)1567 fMount, true /* retry? */, activeMachineWindow())) 1568 1568 { 1569 1569 /* Force remount medium to the predefined port/device: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r45328 r45368 591 591 /* Ask for force mounting: */ 592 592 if (msgCenter().cannotRemountMedium(machine, vboxMedium, true /* mount? */, 593 true /* retry? */, mainMachineWindow()) == AlertButton_Ok)593 true /* retry? */, mainMachineWindow())) 594 594 { 595 595 /* Force mount medium to the predefined port/device: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r45362 r45368 3056 3056 int iAnswer = msgCenter().confirmOpticalAttachmentCreation(strControllerName, this); 3057 3057 if (iAnswer == AlertButton_Choice1) 3058 strMediumId = vboxGlobal().findMedium(strMediumId).id(); 3059 else if (iAnswer == AlertButton_Choice2) 3058 3060 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumType_DVD, this, strMachineFolder); 3059 else if (iAnswer == AlertButton_Choice2)3060 strMediumId = vboxGlobal().findMedium(strMediumId).id();3061 3061 break; 3062 3062 } … … 3065 3065 int iAnswer = msgCenter().confirmFloppyAttachmentCreation(strControllerName, this); 3066 3066 if (iAnswer == AlertButton_Choice1) 3067 strMediumId = vboxGlobal().findMedium(strMediumId).id(); 3068 else if (iAnswer == AlertButton_Choice2) 3067 3069 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumType_Floppy, this, strMachineFolder); 3068 else if (iAnswer == AlertButton_Choice2)3069 strMediumId = vboxGlobal().findMedium(strMediumId).id();3070 3070 break; 3071 3071 }
Note:
See TracChangeset
for help on using the changeset viewer.