Changeset 991 in vbox for trunk/src/VBox
- Timestamp:
- Feb 19, 2007 6:31:35 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r968 r991 497 497 * E_NOTIMPL, as for the OSE version. Don't show the error message in this 498 498 * case since it's normal. */ 499 COM ErrorInfo errInfo = obj.errorInfo();500 if ( obj.lastRC() == E_NOTIMPL && !errInfo.isBasicAvailable())499 COMResult res (obj); 500 if (res.rc() == E_NOTIMPL && !res.errorInfo().isBasicAvailable()) 501 501 return; 502 502 503 503 message (mainWindowShown(), Error, 504 504 tr ("Failed to access the USB subsystem."), 505 formatErrorInfo ( errInfo),505 formatErrorInfo (res), 506 506 "cannotAccessUSB"); 507 507 } … … 547 547 { 548 548 /* preserve the current error info before calling the object again */ 549 COM ErrorInfo errInfo = machine.errorInfo();549 COMResult res (machine); 550 550 551 551 message (parent ? parent : mainWindowShown(), Error, 552 552 tr ("Failed to save the settings of the virtual machine <b>%1</b>.") 553 553 .arg (machine.GetName()), 554 formatErrorInfo ( errInfo));554 formatErrorInfo (res)); 555 555 } 556 556 … … 563 563 QWidget *parent /* = 0 */) 564 564 { 565 COM ErrorInfo errInfo = machine.errorInfo();566 if (!strict && ! errInfo.isBasicAvailable())565 COMResult res (machine); 566 if (!strict && !res.errorInfo().isBasicAvailable()) 567 567 return; 568 568 … … 570 570 tr ("Failed to load the settings of the virtual machine <b>%1</b>.") 571 571 .arg (machine.GetName()), 572 formatErrorInfo ( errInfo));572 formatErrorInfo (res)); 573 573 } 574 574 575 575 void VBoxProblemReporter::cannotStartMachine (const CConsole &console) 576 576 { 577 // below, we use CConsole (console) to preserve current error info 578 // for formatErrorInfo() 579 580 message ( 581 mainWindowShown(), 582 Error, 577 /* preserve the current error info before calling the object again */ 578 COMResult res (console); 579 580 message (mainWindowShown(), Error, 583 581 tr ("Failed to start the virtual machine <b>%1</b>.") 584 .arg (CConsole (console).GetMachine().GetName()), 585 formatErrorInfo (console) 586 ); 582 .arg (console.GetMachine().GetName()), 583 formatErrorInfo (res)); 587 584 } 588 585 … … 604 601 void VBoxProblemReporter::cannotPauseMachine (const CConsole &console) 605 602 { 606 /* below, we use CConsole (console) to preserve current error info 607 * for formatErrorInfo() */ 608 609 message ( 610 mainWindowShown(), 611 Error, 603 /* preserve the current error info before calling the object again */ 604 COMResult res (console); 605 606 message (mainWindowShown(), Error, 612 607 tr ("Failed to pause the execution of the virtual machine <b>%1</b>.") 613 .arg (CConsole (console).GetMachine().GetName()), 614 formatErrorInfo (console) 615 ); 608 .arg (console.GetMachine().GetName()), 609 formatErrorInfo (res)); 616 610 } 617 611 618 612 void VBoxProblemReporter::cannotResumeMachine (const CConsole &console) 619 613 { 620 /* below, we use CConsole (console) to preserve current error info 621 * for formatErrorInfo() */ 622 623 message ( 624 mainWindowShown(), 625 Error, 614 /* preserve the current error info before calling the object again */ 615 COMResult res (console); 616 617 message (mainWindowShown(), Error, 626 618 tr ("Failed to resume the execution of the virtual machine <b>%1</b>.") 627 .arg (CConsole (console).GetMachine().GetName()), 628 formatErrorInfo (console) 629 ); 619 .arg (console.GetMachine().GetName()), 620 formatErrorInfo (res)); 630 621 } 631 622 632 623 void VBoxProblemReporter::cannotSaveMachineState (const CConsole &console) 633 624 { 634 // below, we use CConsole (console) to preserve current error info 635 // for formatErrorInfo() 636 637 message ( 638 mainWindowShown(), 639 Error, 625 /* preserve the current error info before calling the object again */ 626 COMResult res (console); 627 628 message (mainWindowShown(), Error, 640 629 tr ("Failed to save the state of the virtual machine <b>%1</b>.") 641 .arg (CConsole (console).GetMachine().GetName()), 642 formatErrorInfo (console) 643 ); 630 .arg (console.GetMachine().GetName()), 631 formatErrorInfo (res)); 644 632 } 645 633 … … 661 649 void VBoxProblemReporter::cannotTakeSnapshot (const CConsole &console) 662 650 { 663 // below, we use CConsole (console) to preserve current error info 664 // for formatErrorInfo() 665 666 message ( 667 mainWindowShown(), 668 Error, 651 /* preserve the current error info before calling the object again */ 652 COMResult res (console); 653 654 message (mainWindowShown(), Error, 669 655 tr ("Failed to create a snapshot of the virtual machine <b>%1</b>.") 670 .arg (CConsole (console).GetMachine().GetName()), 671 formatErrorInfo (console) 672 ); 656 .arg (console.GetMachine().GetName()), 657 formatErrorInfo (res)); 673 658 } 674 659 … … 690 675 void VBoxProblemReporter::cannotStopMachine (const CConsole &console) 691 676 { 692 // below, we use CConsole (console) to preserve current error info 693 // for formatErrorInfo() 694 695 message ( 696 mainWindowShown(), 697 Error, 677 /* preserve the current error info before calling the object again */ 678 COMResult res (console); 679 680 message (mainWindowShown(), Error, 698 681 tr ("Failed to stop the virtual machine <b>%1</b>.") 699 .arg (CConsole (console).GetMachine().GetName()), 700 formatErrorInfo (console) 701 ); 682 .arg (console.GetMachine().GetName()), 683 formatErrorInfo (res)); 702 684 } 703 685 … … 705 687 const CMachine &machine) 706 688 { 707 // below, we use CMachine (machine) to preserve current error info 708 // for formatErrorInfo() 709 710 message ( 711 mainWindowShown(), 712 Error, 689 /* preserve the current error info before calling the object again */ 690 COMResult res (machine); 691 692 message (mainWindowShown(), Error, 713 693 tr ("Failed to remove the virtual machine <b>%1</b>.") 714 .arg (CMachine (machine).GetName()), 715 !vbox.isOk() ? formatErrorInfo (vbox) : formatErrorInfo (machine) 716 ); 694 .arg (machine.GetName()), 695 !vbox.isOk() ? formatErrorInfo (vbox) : formatErrorInfo (res)); 717 696 } 718 697 719 698 void VBoxProblemReporter::cannotDiscardSavedState (const CConsole &console) 720 699 { 721 // below, we use CConsole (console) to preserve current error info 722 // for formatErrorInfo() 723 724 message ( 725 mainWindowShown(), 726 Error, 700 /* preserve the current error info before calling the object again */ 701 COMResult res (console); 702 703 message (mainWindowShown(), Error, 727 704 tr ("Failed to discard the saved state of the virtual machine <b>%1</b>.") 728 .arg (CConsole (console).GetMachine().GetName()), 729 formatErrorInfo (console) 730 ); 705 .arg (console.GetMachine().GetName()), 706 formatErrorInfo (res)); 731 707 } 732 708 … … 1119 1095 { 1120 1096 /* preserve the current error info before calling the object again */ 1121 COM ErrorInfo errInfo = console.errorInfo();1097 COMResult res (console); 1122 1098 1123 1099 message (&vboxGlobal().consoleWnd(), Error, … … 1126 1102 .arg (device) 1127 1103 .arg (console.GetMachine().GetName()), 1128 formatErrorInfo ( errInfo));1104 formatErrorInfo (res)); 1129 1105 } 1130 1106 … … 1133 1109 { 1134 1110 /* preserve the current error info before calling the object again */ 1135 COM ErrorInfo errInfo = console.errorInfo();1111 COMResult res (console); 1136 1112 1137 1113 message (&vboxGlobal().consoleWnd(), Error, … … 1140 1116 .arg (device) 1141 1117 .arg (console.GetMachine().GetName()), 1142 formatErrorInfo ( errInfo));1118 formatErrorInfo (res)); 1143 1119 } 1144 1120 … … 1149 1125 { 1150 1126 /* preserve the current error info before calling the object again */ 1151 COM ErrorInfo errInfo = aMachine.errorInfo();1127 COMResult res (aMachine); 1152 1128 1153 1129 message (aParent, Error, … … 1158 1134 .arg (aPath) 1159 1135 .arg (aMachine.GetName()), 1160 formatErrorInfo ( errInfo));1136 formatErrorInfo (res)); 1161 1137 } 1162 1138 … … 1167 1143 { 1168 1144 /* preserve the current error info before calling the object again */ 1169 COM ErrorInfo errInfo = aMachine.errorInfo();1145 COMResult res (aMachine); 1170 1146 1171 1147 message (aParent, Error, … … 1176 1152 .arg (aPath) 1177 1153 .arg (aMachine.GetName()), 1178 formatErrorInfo ( errInfo));1154 formatErrorInfo (res)); 1179 1155 } 1180 1156 … … 1185 1161 { 1186 1162 /* preserve the current error info before calling the object again */ 1187 COM ErrorInfo errInfo = aConsole.errorInfo();1163 COMResult res (aConsole); 1188 1164 1189 1165 message (aParent, Error, … … 1194 1170 .arg (aPath) 1195 1171 .arg (aConsole.GetMachine().GetName()), 1196 formatErrorInfo ( errInfo));1172 formatErrorInfo (res)); 1197 1173 } 1198 1174 … … 1203 1179 { 1204 1180 /* preserve the current error info before calling the object again */ 1205 COM ErrorInfo errInfo = aConsole.errorInfo();1181 COMResult res (aConsole); 1206 1182 1207 1183 message (aParent, Error, … … 1212 1188 .arg (aPath) 1213 1189 .arg (aConsole.GetMachine().GetName()), 1214 formatErrorInfo ( errInfo));1190 formatErrorInfo (res)); 1215 1191 } 1216 1192
Note:
See TracChangeset
for help on using the changeset viewer.