Changeset 70 in vbox
- Timestamp:
- Jan 16, 2007 4:12:31 PM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 edited
-
include/VBoxProblemReporter.h (modified) (1 diff)
-
src/VBoxGlobal.cpp (modified) (13 diffs)
-
src/VBoxProblemReporter.cpp (modified) (1 diff)
-
ui/VBoxVMSettingsDlg.ui.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h
r1 r70 110 110 void cannotSaveMachineSettings (const CMachine &machine, 111 111 QWidget *parent = 0); 112 void cannotLoadMachineSettings (const CMachine &machine, 113 bool strict = true, 114 QWidget *parent = 0); 115 112 116 void cannotStartMachine (const CConsole &console); 113 117 void cannotStartMachine (const CProgress &progress); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r56 r70 636 636 static QString sGeneralFullHrefTpl, sGeneralFullBoldTpl; 637 637 638 / / generate templates after every language change638 /* generate templates after every language change */ 639 639 640 640 if (!detailReportTemplatesReady) … … 648 648 tr ("<nobr>%3 MB</nobr>", "details report")); 649 649 sGeneralBasicHrefTpl = QString (sSectionHrefTpl) 650 .arg (2 + 3) / / rows651 .arg ("machine_16px.png", / / icon652 "#general", / / link653 tr ("General", "details report"), / / title654 generalItems); / / items650 .arg (2 + 3) /* rows */ 651 .arg ("machine_16px.png", /* icon */ 652 "#general", /* link */ 653 tr ("General", "details report"), /* title */ 654 generalItems); /* items */ 655 655 sGeneralBasicBoldTpl = QString (sSectionBoldTpl) 656 .arg (2 + 3) / / rows657 .arg ("machine_16px.png", / / icon658 "#general", / / link659 tr ("General", "details report"), / / title660 generalItems); / / items656 .arg (2 + 3) /* rows */ 657 .arg ("machine_16px.png", /* icon */ 658 "#general", /* link */ 659 tr ("General", "details report"), /* title */ 660 generalItems); /* items */ 661 661 662 662 generalItems … … 668 668 669 669 sGeneralFullHrefTpl = QString (sSectionHrefTpl) 670 .arg (2 + 7) / / rows671 .arg ("machine_16px.png", / / icon672 "#general", / / link673 tr ("General", "details report"), / / title674 generalItems); / / items670 .arg (2 + 7) /* rows */ 671 .arg ("machine_16px.png", /* icon */ 672 "#general", /* link */ 673 tr ("General", "details report"), /* title */ 674 generalItems); /* items */ 675 675 sGeneralFullBoldTpl = QString (sSectionBoldTpl) 676 .arg (2 + 7) / / rows677 .arg ("machine_16px.png", / / icon678 "#general", / / link679 tr ("General", "details report"), / / title680 generalItems); / / items681 } 682 683 / / common generated content676 .arg (2 + 7) /* rows */ 677 .arg ("machine_16px.png", /* icon */ 678 "#general", /* link */ 679 tr ("General", "details report"), /* title */ 680 generalItems); /* items */ 681 } 682 683 /* common generated content */ 684 684 685 685 const QString §ionTpl = withLinks … … 689 689 QString hardDisks; 690 690 { 691 int rows = 2; / / including section header and footer691 int rows = 2; /* including section header and footer */ 692 692 693 693 CHardDiskAttachmentEnumerator aen = m.GetHardDiskAttachments().Enumerate(); … … 715 715 716 716 hardDisks = sectionTpl 717 .arg (rows) / / rows718 .arg ("hd_16px.png", / / icon719 "#hdds", / / link720 tr ("Hard Disks", "details report"), / / title721 hardDisks); / / items722 } 723 724 / / compose details report717 .arg (rows) /* rows */ 718 .arg ("hd_16px.png", /* icon */ 719 "#hdds", /* link */ 720 tr ("Hard Disks", "details report"), /* title */ 721 hardDisks); /* items */ 722 } 723 724 /* compose details report */ 725 725 726 726 const QString &generalBasicTpl = withLinks … … 745 745 else 746 746 { 747 / / boot order747 /* boot order */ 748 748 QString bootOrder; 749 749 for (ulong i = 1; i <= vbox.GetSystemProperties().GetMaxBootPosition(); i++) … … 761 761 CBIOSSettings biosSettings = m.GetBIOSSettings(); 762 762 763 / / ACPI763 /* ACPI */ 764 764 QString acpi = biosSettings.GetACPIEnabled() 765 765 ? tr ("Enabled", "details report (ACPI)") 766 766 : tr ("Disabled", "details report (ACPI)"); 767 767 768 / / IO APIC768 /* IO APIC */ 769 769 QString ioapic = biosSettings.GetIOAPICEnabled() 770 770 ? tr ("Enabled", "details report (IO APIC)") 771 771 : tr ("Disabled", "details report (IO APIC)"); 772 772 773 / / General + Hard Disks773 /* General + Hard Disks */ 774 774 detailsReport 775 775 = generalFullTpl … … 785 785 QString item; 786 786 787 / / Floppy787 /* Floppy */ 788 788 CFloppyDrive floppy = m.GetFloppyDrive(); 789 789 item = QString (sSectionItemTpl); … … 811 811 } 812 812 detailsReport += sectionTpl 813 .arg (2 + 1) / / rows814 .arg ("fd_16px.png", / / icon815 "#floppy", / / link816 tr ("Floppy", "details report"), / / title817 item); / / items818 819 / / DVD813 .arg (2 + 1) /* rows */ 814 .arg ("fd_16px.png", /* icon */ 815 "#floppy", /* link */ 816 tr ("Floppy", "details report"), /* title */ 817 item); /* items */ 818 819 /* DVD */ 820 820 CDVDDrive dvd = m.GetDVDDrive(); 821 821 item = QString (sSectionItemTpl); … … 843 843 } 844 844 detailsReport += sectionTpl 845 .arg (2 + 1) / / rows846 .arg ("cd_16px.png", / / icon847 "#dvd", / / link848 tr ("CD/DVD-ROM", "details report"), / / title845 .arg (2 + 1) /* rows */ 846 .arg ("cd_16px.png", /* icon */ 847 "#dvd", /* link */ 848 tr ("CD/DVD-ROM", "details report"), /* title */ 849 849 item); // items 850 850 851 / / audio851 /* audio */ 852 852 { 853 853 CAudioAdapter audio = m.GetAudioAdapter(); … … 861 861 862 862 detailsReport += sectionTpl 863 .arg (2 + 1) / / rows864 .arg ("sound_16px.png", / / icon865 "#audio", / / link866 tr ("Audio", "details report"), / / title867 item); / / items868 } 869 / / network863 .arg (2 + 1) /* rows */ 864 .arg ("sound_16px.png", /* icon */ 865 "#audio", /* link */ 866 tr ("Audio", "details report"), /* title */ 867 item); /* items */ 868 } 869 /* network */ 870 870 { 871 871 item = QString::null; 872 872 ulong count = vbox.GetSystemProperties().GetNetworkAdapterCount(); 873 int rows = 2; / / including section header and footer873 int rows = 2; /* including section header and footer */ 874 874 for (ulong slot = 0; slot < count; slot ++) 875 875 { … … 892 892 893 893 detailsReport += sectionTpl 894 .arg (rows) / / rows895 .arg ("nw_16px.png", / / icon896 "#network", / / link897 tr ("Network", "details report"), / / title898 item); / / items899 } 900 / / USB894 .arg (rows) /* rows */ 895 .arg ("nw_16px.png", /* icon */ 896 "#network", /* link */ 897 tr ("Network", "details report"), /* title */ 898 item); /* items */ 899 } 900 /* USB */ 901 901 { 902 902 CUSBController ctl = m.GetUSBController(); 903 903 if (!ctl.isNull()) 904 904 { 905 /* the USB controller may be unavailable (i.e. in VirtualBox OSE) */ 906 905 907 if (ctl.GetEnabled()) 906 908 { … … 922 924 923 925 detailsReport += sectionTpl 924 .arg (2 + 1) / / rows925 .arg ("usb_16px.png", / / icon926 "#usb", / / link927 tr ("USB Controller", "details report"), / / title928 item); / / items926 .arg (2 + 1) /* rows */ 927 .arg ("usb_16px.png", /* icon */ 928 "#usb", /* link */ 929 tr ("USB Controller", "details report"), /* title */ 930 item); /* items */ 929 931 } 930 932 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r1 r70 532 532 QWidget *parent /* = 0 */) 533 533 { 534 // below, we use CMachine (machine) to preserve current error info 535 // for formatErrorInfo() 536 537 message ( 538 parent ? parent : mainWindowShown(), 539 Error, 540 tr ("Failed to save the settings of the virtual machine <b>%1</b>.") 541 .arg (CMachine (machine).GetName()), 542 formatErrorInfo (machine) 543 ); 534 /* preserve the current error info before calling the object again */ 535 COMErrorInfo errInfo = machine.errorInfo(); 536 537 message (parent ? parent : mainWindowShown(), Error, 538 tr ("Failed to save the settings of the virtual machine <b>%1</b>.") 539 .arg (machine.GetName()), 540 formatErrorInfo (errInfo)); 541 } 542 543 /** 544 * @param strict if |true| then show the message even if there is no basic 545 * error info available 546 */ 547 void VBoxProblemReporter::cannotLoadMachineSettings (const CMachine &machine, 548 bool strict /* = true */, 549 QWidget *parent /* = 0 */) 550 { 551 COMErrorInfo errInfo = machine.errorInfo(); 552 if (!strict && !errInfo.isBasicAvailable()) 553 return; 554 555 message (parent ? parent : mainWindowShown(), Error, 556 tr ("Failed to load the settings of the virtual machine <b>%1</b>.") 557 .arg (machine.GetName()), 558 formatErrorInfo (errInfo)); 544 559 } 545 560 -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h
r59 r70 1231 1231 } 1232 1232 1233 /* usb*/1233 /* USB */ 1234 1234 { 1235 1235 CUSBController ctl = machine.GetUSBController(); 1236 1236 1237 QListViewItem *usbListItem = listView->findItem ("USB", 0, Qt::Contains); 1238 if (usbListItem && ctl.isNull()) 1239 usbListItem->setVisible (false); 1240 1241 cbEnableUSBController->setChecked (ctl.GetEnabled()); 1242 1243 CUSBDeviceFilterEnumerator en = ctl.GetDeviceFilters().Enumerate(); 1244 while (en.HasMore()) 1245 addUSBFilter (en.GetNext(), false /* isNew */); 1246 1247 lvUSBFilters->setCurrentItem (lvUSBFilters->firstChild()); 1248 /* 1249 * silly, silly Qt -- doesn't emit currentChanged after adding the 1250 * first item to an empty list 1251 */ 1252 lvUSBFilters_currentChanged (lvUSBFilters->firstChild()); 1237 if (ctl.isNull()) 1238 { 1239 /* disable the USB controller category if the USB controller is 1240 * not available (i.e. in VirtualBox OSE) */ 1241 1242 QListViewItem *usbItem = listView->findItem ("#usb", listView_Link); 1243 Assert (usbItem); 1244 if (usbItem) 1245 usbItem->setVisible (false); 1246 1247 /* if machine has something to say, show the message */ 1248 vboxProblem().cannotLoadMachineSettings (machine, false /* strict */); 1249 } 1250 else 1251 { 1252 cbEnableUSBController->setChecked (ctl.GetEnabled()); 1253 1254 CUSBDeviceFilterEnumerator en = ctl.GetDeviceFilters().Enumerate(); 1255 while (en.HasMore()) 1256 addUSBFilter (en.GetNext(), false /* isNew */); 1257 1258 lvUSBFilters->setCurrentItem (lvUSBFilters->firstChild()); 1259 /* 1260 * silly, silly Qt -- doesn't emit currentChanged after adding the 1261 * first item to an empty list 1262 */ 1263 lvUSBFilters_currentChanged (lvUSBFilters->firstChild()); 1264 } 1253 1265 } 1254 1266 … … 1429 1441 CUSBController ctl = cmachine.GetUSBController(); 1430 1442 1431 ctl.SetEnabled (cbEnableUSBController->isChecked()); 1432 1433 /* 1434 * first, remove all old filters (only if the list is changed, 1435 * not only individual properties of filters) 1436 */ 1437 if (mUSBFilterListModified) 1438 for (ulong count = ctl.GetDeviceFilters().GetCount(); count; -- count) 1439 ctl.RemoveDeviceFilter (0); 1440 1441 /* then add all new filters */ 1442 for (QListViewItem *item = lvUSBFilters->firstChild(); item; 1443 item = item->nextSibling()) 1444 { 1445 USBListItem *uli = static_cast <USBListItem *> (item); 1446 VBoxUSBFilterSettings *settings = 1447 static_cast <VBoxUSBFilterSettings *> 1448 (wstUSBFilters->widget (uli->mId)); 1449 Assert (settings); 1450 1451 COMResult res = settings->putBackToFilter(); 1452 if (!res.isOk()) 1453 return res; 1454 1455 CUSBDeviceFilter filter = settings->filter(); 1456 filter.SetActive (uli->isOn()); 1457 1443 if (!ctl.isNull()) 1444 { 1445 /* the USB controller may be unavailable (i.e. in VirtualBox OSE) */ 1446 1447 ctl.SetEnabled (cbEnableUSBController->isChecked()); 1448 1449 /* 1450 * first, remove all old filters (only if the list is changed, 1451 * not only individual properties of filters) 1452 */ 1458 1453 if (mUSBFilterListModified) 1459 ctl.InsertDeviceFilter (~0, filter); 1454 for (ulong count = ctl.GetDeviceFilters().GetCount(); count; -- count) 1455 ctl.RemoveDeviceFilter (0); 1456 1457 /* then add all new filters */ 1458 for (QListViewItem *item = lvUSBFilters->firstChild(); item; 1459 item = item->nextSibling()) 1460 { 1461 USBListItem *uli = static_cast <USBListItem *> (item); 1462 VBoxUSBFilterSettings *settings = 1463 static_cast <VBoxUSBFilterSettings *> 1464 (wstUSBFilters->widget (uli->mId)); 1465 Assert (settings); 1466 1467 COMResult res = settings->putBackToFilter(); 1468 if (!res.isOk()) 1469 return res; 1470 1471 CUSBDeviceFilter filter = settings->filter(); 1472 filter.SetActive (uli->isOn()); 1473 1474 if (mUSBFilterListModified) 1475 ctl.InsertDeviceFilter (~0, filter); 1476 } 1460 1477 } 1461 1478
Note:
See TracChangeset
for help on using the changeset viewer.

