- Timestamp:
- Apr 2, 2013 11:29:53 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r45281 r45282 588 588 message(mainWindowShown(), 589 589 MessageType_Error, 590 tr("Failed to remove the virtual machine <b>%1</b>.").arg(machine.GetName()), 590 tr("Failed to remove the virtual machine <b>%1</b>.") 591 .arg(machine.GetName()), 591 592 !machine.isOk() ? formatErrorInfo(machine) : formatErrorInfo(res)); 592 593 } … … 596 597 message(mainWindowShown(), 597 598 MessageType_Error, 598 tr("Failed to remove the virtual machine <b>%1</b>.").arg(machine.GetName()), 599 tr("Failed to remove the virtual machine <b>%1</b>.") 600 .arg(machine.GetName()), 599 601 formatErrorInfo(progress.GetErrorInfo())); 602 } 603 604 bool UIMessageCenter::remindAboutInaccessibleMedia() 605 { 606 return messageOkCancel(mainWindowShown(), MessageType_Warning, 607 tr("<p>One or more virtual hard disks, CD/DVD or " 608 "floppy media are not currently accessible. As a result, you will " 609 "not be able to operate virtual machines that use these media until " 610 "they become accessible later.</p>" 611 "<p>Press <b>Check</b> to open the Virtual Media Manager window and " 612 "see what media are inaccessible, or press <b>Ignore</b> to " 613 "ignore this message.</p>"), 614 "remindAboutInaccessibleMedia", 615 tr("Check", "inaccessible media message box")); 600 616 } 601 617 … … 612 628 } 613 629 630 bool UIMessageCenter::confirmVMReset(const QString &strNames) 631 { 632 return messageOkCancel(mainWindowShown(), MessageType_Question, 633 tr("<p>Do you really want to reset the following virtual machines?</p>" 634 "<p><b>%1</b></p><p>This will cause any unsaved data " 635 "in applications running inside it to be lost.</p>") 636 .arg(strNames), 637 "confirmVMReset" /* pcszAutoConfirmId */, 638 tr("Reset", "machine")); 639 } 640 641 bool UIMessageCenter::confirmVMACPIShutdown(const QString &strNames) 642 { 643 return messageOkCancel(mainWindowShown(), MessageType_Question, 644 tr("<p>Do you really want to send an ACPI shutdown signal " 645 "to the following virtual machines?</p><p><b>%1</b></p>") 646 .arg(strNames), 647 "confirmVMACPIShutdown" /* pcszAutoConfirmId */, 648 tr("ACPI Shutdown", "machine")); 649 } 650 651 bool UIMessageCenter::confirmVMPowerOff(const QString &strNames) 652 { 653 return messageOkCancel(mainWindowShown(), MessageType_Question, 654 tr("<p>Do you really want to power off the following virtual machines?</p>" 655 "<p><b>%1</b></p><p>This will cause any unsaved data in applications " 656 "running inside it to be lost.</p>") 657 .arg(strNames), 658 "confirmVMPowerOff" /* pcszAutoConfirmId */, 659 tr("Power Off", "machine")); 660 } 661 614 662 void UIMessageCenter::cannotDiscardSavedState(const CConsole &console) 615 663 { … … 618 666 /* Show the message: */ 619 667 message(mainWindowShown(), MessageType_Error, 620 tr("Failed to discard the saved state of the virtual machine <b>%1</b>.").arg(console.GetMachine().GetName()), 668 tr("Failed to discard the saved state of the virtual machine <b>%1</b>.") 669 .arg(console.GetMachine().GetName()), 621 670 formatErrorInfo(res)); 622 671 } 623 672 624 bool UIMessageCenter::remindAboutInaccessibleMedia() 625 { 626 int rc = message(&vboxGlobal().selectorWnd(), MessageType_Warning, 627 tr("<p>One or more virtual hard disks, CD/DVD or " 628 "floppy media are not currently accessible. As a result, you will " 629 "not be able to operate virtual machines that use these media until " 630 "they become accessible later.</p>" 631 "<p>Press <b>Check</b> to open the Virtual Media Manager window and " 632 "see what media are inaccessible, or press <b>Ignore</b> to " 633 "ignore this message.</p>"), 634 "remindAboutInaccessibleMedia", 635 QIMessageBox::Ok | QIMessageBox::Default, 636 QIMessageBox::Ignore | QIMessageBox::Escape, 637 0, 638 tr("Check", "inaccessible media message box")); 639 640 return rc == QIMessageBox::Ok; /* implies !AutoConfirmed */ 641 } 642 643 bool UIMessageCenter::confirmVMReset(const QString &strNames) 644 { 645 return messageOkCancel(mainMachineWindowShown(), MessageType_Question, 646 tr("<p>Do you really want to reset the following virtual machines?</p>" 647 "<p><b>%1</b></p><p>This will cause any unsaved data " 648 "in applications running inside it to be lost.</p>") 649 .arg(strNames), 650 "confirmVMReset" /* pcszAutoConfirmId */, 651 tr("Reset", "machine")); 652 } 653 654 bool UIMessageCenter::confirmVMACPIShutdown(const QString &strNames) 655 { 656 return messageOkCancel(mainMachineWindowShown(), MessageType_Question, 657 tr("<p>Do you really want to send an ACPI shutdown signal " 658 "to the following virtual machines?</p><p><b>%1</b></p>") 659 .arg(strNames), 660 "confirmVMACPIShutdown" /* pcszAutoConfirmId */, 661 tr("ACPI Shutdown", "machine")); 662 } 663 664 bool UIMessageCenter::confirmVMPowerOff(const QString &strNames) 665 { 666 return messageOkCancel(mainMachineWindowShown(), MessageType_Question, 667 tr("<p>Do you really want to power off the following virtual machines?</p>" 668 "<p><b>%1</b></p><p>This will cause any unsaved data in applications " 669 "running inside it to be lost.</p>") 670 .arg(strNames), 671 "confirmVMPowerOff" /* pcszAutoConfirmId */, 672 tr("Power Off", "machine")); 673 void UIMessageCenter::cannotStopMachine(const CConsole &console) 674 { 675 /* Preserve error-info: */ 676 COMResult res(console); 677 /* Show the message: */ 678 message(mainWindowShown(), MessageType_Error, 679 tr("Failed to stop the virtual machine <b>%1</b>.") 680 .arg(console.GetMachine().GetName()), 681 formatErrorInfo(res)); 673 682 } 674 683 … … 1671 1680 formatErrorInfo(progress.GetErrorInfo()) 1672 1681 ); 1673 }1674 1675 void UIMessageCenter::cannotStopMachine(const CConsole &console)1676 {1677 /* preserve the current error info before calling the object again */1678 COMResult res(console);1679 1680 message(mainWindowShown(), MessageType_Error,1681 tr("Failed to stop the virtual machine <b>%1</b>.")1682 .arg(console.GetMachine().GetName()),1683 formatErrorInfo(res));1684 1682 } 1685 1683 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r45281 r45282 219 219 void cannotRemoveMachine(const CMachine &machine); 220 220 void cannotRemoveMachine(const CMachine &machine, const CProgress &progress); 221 bool remindAboutInaccessibleMedia(); 221 222 bool confirmDiscardSavedState(const QString &strNames); 222 void cannotDiscardSavedState(const CConsole &console);223 bool remindAboutInaccessibleMedia();224 223 bool confirmVMReset(const QString &strNames); 225 224 bool confirmVMACPIShutdown(const QString &strNames); 226 225 bool confirmVMPowerOff(const QString &strNames); 226 void cannotDiscardSavedState(const CConsole &console); 227 void cannotStopMachine(const CConsole &console); 227 228 228 229 /* API: Snapshot warnings: */ … … 309 310 void cannotTakeSnapshot(const CConsole &console); 310 311 void cannotTakeSnapshot(const CProgress &progress); 311 void cannotStopMachine(const CConsole &console);312 312 void cannotStopMachine(const CProgress &progress); 313 313 void cannotSendACPIToMachine(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r45280 r45282 692 692 /* Power Off: */ 693 693 console.PowerDown(); 694 if (!console.isOk()) 695 msgCenter().cannotStopMachine(console); 694 696 695 697 /* Unlock machine finally: */
Note:
See TracChangeset
for help on using the changeset viewer.