Changeset 8071 in vbox
- Timestamp:
- Apr 17, 2008 12:36:49 AM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r7983 r8071 191 191 ui/VBoxVMSettingsDlg.ui.h \ 192 192 ui/VBoxVMLogViewer.ui.h \ 193 ui/VBoxSharedFoldersSettings.ui.h 193 ui/VBoxSharedFoldersSettings.ui.h \ 194 ui/VBoxHardDiskSettings.ui.h 194 195 195 196 -
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r7983 r8071 27 27 ui/VBoxUSBFilterSettings.ui \ 28 28 ui/VBoxSharedFoldersSettings.ui \ 29 ui/VBoxHardDiskSettings.ui \ 29 30 ui/VBoxNewVMWzd.ui \ 30 31 ui/VBoxCloseVMDlg.ui \ -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h
r7442 r8071 215 215 } 216 216 217 KStorageBus toStorageBusType (const QString &s) const 218 { 219 QStringVector::const_iterator it = 220 qFind (storageBuses.begin(), storageBuses.end(), s); 221 AssertMsg (it != storageBuses.end(), ("No value for {%s}", s.latin1())); 222 return KStorageBus (it - storageBuses.begin()); 223 } 224 217 225 QString toString (KStorageBus t) const 218 226 { … … 221 229 } 222 230 231 LONG toStorageChannelType (KStorageBus t, const QString &c) const; 223 232 QString toString (KStorageBus t, LONG c) const; 233 234 LONG toStorageDeviceType (KStorageBus t, const QString &c) const; 224 235 QString toString (KStorageBus t, LONG c, LONG d) const; 225 236 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h
r7442 r8071 192 192 bool confirmHardDiskUnregister (QWidget *parent, const QString &src); 193 193 194 int confirmSATASlotsRemoving (QWidget *aParent); 195 194 196 void cannotCreateHardDiskImage ( 195 197 QWidget *parent, const CVirtualBox &vbox, const QString &src, -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r7651 r8071 738 738 , deviceTypes (KDeviceType_COUNT) 739 739 , storageBuses (KStorageBus_COUNT) 740 , storageBusDevices ( 3)740 , storageBusDevices (4) 741 741 , storageBusChannels (3) 742 742 , diskTypes (KHardDiskType_COUNT) … … 960 960 } 961 961 962 LONG VBoxGlobal::toStorageDeviceType (KStorageBus t, const QString &c) const 963 { 964 LONG device; 965 switch (t) 966 { 967 case KStorageBus_IDE: 968 { 969 QStringVector::const_iterator it = 970 qFind (storageBusDevices.begin(), storageBusDevices.end(), c); 971 AssertMsg (it != storageBusDevices.end(), ("No value for {%s}", c.latin1())); 972 device = (LONG) (it - storageBusDevices.begin()); 973 break; 974 } 975 default: 976 { 977 device = 0; 978 break; 979 } 980 } 981 return device; 982 } 983 962 984 QString VBoxGlobal::toString (KStorageBus t, LONG c, LONG d) const 963 985 { 964 Assert (storageBusDevices.count() == 3);986 Assert (storageBusDevices.count() == 4); 965 987 QString dev; 966 988 … … 976 998 } 977 999 } 1000 case KStorageBus_SATA: 1001 { 1002 dev = storageBusDevices [3].arg (d); 1003 break; 1004 } 978 1005 default: 979 1006 dev = storageBusDevices [2].arg (d); 980 1007 } 981 1008 return dev; 1009 } 1010 1011 LONG VBoxGlobal::toStorageChannelType (KStorageBus t, const QString &c) const 1012 { 1013 LONG channel; 1014 switch (t) 1015 { 1016 case KStorageBus_IDE: 1017 { 1018 QStringVector::const_iterator it = 1019 qFind (storageBusChannels.begin(), storageBusChannels.end(), c); 1020 AssertMsg (it != storageBusChannels.end(), ("No value for {%s}", c.latin1())); 1021 channel = (LONG) (it - storageBusChannels.begin()); 1022 break; 1023 } 1024 default: 1025 { 1026 channel = 0; 1027 break; 1028 } 1029 } 1030 return channel; 982 1031 } 983 1032 … … 2303 2352 tr ("Channel %1", "StorageBusChannel"); 2304 2353 2305 Assert (storageBusDevices.count() == 3);2354 Assert (storageBusDevices.count() == 4); 2306 2355 storageBusDevices [0] = tr ("Master", "StorageBusDevice"); 2307 2356 storageBusDevices [1] = tr ("Slave", "StorageBusDevice"); 2308 2357 storageBusDevices [2] = tr ("Device %1", "StorageBusDevice"); 2358 storageBusDevices [3] = tr ("Port %1", "StorageBusDevice"); 2309 2359 2310 2360 diskTypes [KHardDiskType_Normal] = -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r7983 r8071 1055 1055 } 1056 1056 1057 int VBoxProblemReporter::confirmSATASlotsRemoving (QWidget *aParent) 1058 { 1059 return messageOkCancel (aParent, Question, 1060 tr ("<p>Currently you have SATA devices attached in Hard Disk " 1061 "attachments list. If you really want to disable SATA Controller, " 1062 "SATA attachments will be removed.</p><p>Are you really want to " 1063 "disable the SATA Controller?</p>"), 1064 0 /* aAutoConfirmId */); 1065 } 1066 1057 1067 void VBoxProblemReporter::cannotCreateHardDiskImage ( 1058 1068 QWidget *parent, const CVirtualBox &vbox, const QString &src, -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui
r7021 r8071 1400 1400 <number>1</number> 1401 1401 </attribute> 1402 <vbox>1403 <property name="name">1404 <cstring>unnamed</cstring>1405 </property>1406 <property name="margin">1407 <number>0</number>1408 </property>1409 <property name="spacing">1410 <number>10</number>1411 </property>1412 <widget class="QGroupBox">1413 <property name="name">1414 <cstring>grbHDA</cstring>1415 </property>1416 <property name="title">1417 <string>&Primary Master</string>1418 </property>1419 <property name="checkable">1420 <bool>true</bool>1421 </property>1422 <vbox>1423 <property name="name">1424 <cstring>unnamed</cstring>1425 </property>1426 <widget class="QLayoutWidget">1427 <property name="name">1428 <cstring>hdaLayout</cstring>1429 </property>1430 <hbox>1431 <property name="name">1432 <cstring>unnamed</cstring>1433 </property>1434 <widget class="QToolButton">1435 <property name="name">1436 <cstring>tbHDA</cstring>1437 </property>1438 <property name="focusPolicy">1439 <enum>TabFocus</enum>1440 </property>1441 <property name="text">1442 <string>Select</string>1443 </property>1444 <property name="iconSet">1445 <iconset></iconset>1446 </property>1447 <property name="textLabel">1448 <string>Select</string>1449 </property>1450 <property name="autoRaise">1451 <bool>true</bool>1452 </property>1453 <property name="whatsThis" stdset="0">1454 <string>Invokes the Virtual Disk Manager to create a new or select an existing virtual hard disk to attach.</string>1455 </property>1456 </widget>1457 </hbox>1458 </widget>1459 <widget class="QLabel">1460 <property name="name">1461 <cstring>txHDA</cstring>1462 </property>1463 <property name="text">1464 <string><not selected></string>1465 </property>1466 </widget>1467 </vbox>1468 </widget>1469 <widget class="QGroupBox">1470 <property name="name">1471 <cstring>grbHDB</cstring>1472 </property>1473 <property name="title">1474 <string>P&rimary Slave</string>1475 </property>1476 <property name="checkable">1477 <bool>true</bool>1478 </property>1479 <vbox>1480 <property name="name">1481 <cstring>unnamed</cstring>1482 </property>1483 <widget class="QLayoutWidget">1484 <property name="name">1485 <cstring>hdbLayout</cstring>1486 </property>1487 <hbox>1488 <property name="name">1489 <cstring>unnamed</cstring>1490 </property>1491 <widget class="QToolButton">1492 <property name="name">1493 <cstring>tbHDB</cstring>1494 </property>1495 <property name="focusPolicy">1496 <enum>TabFocus</enum>1497 </property>1498 <property name="text">1499 <string>Select</string>1500 </property>1501 <property name="iconSet">1502 <iconset></iconset>1503 </property>1504 <property name="textLabel">1505 <string>Select</string>1506 </property>1507 <property name="autoRaise">1508 <bool>true</bool>1509 </property>1510 <property name="whatsThis" stdset="0">1511 <string>Invokes the Virtual Disk Manager to create a new or select an existing virtual hard disk to attach.</string>1512 </property>1513 </widget>1514 </hbox>1515 </widget>1516 <widget class="QLabel">1517 <property name="name">1518 <cstring>txHDB</cstring>1519 </property>1520 <property name="text">1521 <string><not selected></string>1522 </property>1523 </widget>1524 </vbox>1525 </widget>1526 <widget class="QGroupBox">1527 <property name="name">1528 <cstring>grbHDD</cstring>1529 </property>1530 <property name="title">1531 <string>&Secondary (IDE 1) Slave</string>1532 </property>1533 <property name="checkable">1534 <bool>true</bool>1535 </property>1536 <vbox>1537 <property name="name">1538 <cstring>unnamed</cstring>1539 </property>1540 <widget class="QLayoutWidget">1541 <property name="name">1542 <cstring>hddLayout</cstring>1543 </property>1544 <hbox>1545 <property name="name">1546 <cstring>unnamed</cstring>1547 </property>1548 <widget class="QToolButton">1549 <property name="name">1550 <cstring>tbHDD</cstring>1551 </property>1552 <property name="focusPolicy">1553 <enum>TabFocus</enum>1554 </property>1555 <property name="text">1556 <string>Select</string>1557 </property>1558 <property name="iconSet">1559 <iconset></iconset>1560 </property>1561 <property name="textLabel">1562 <string>Select</string>1563 </property>1564 <property name="autoRaise">1565 <bool>true</bool>1566 </property>1567 <property name="whatsThis" stdset="0">1568 <string>Invokes the Virtual Disk Manager to create a new or select an existing virtual hard disk to attach.</string>1569 </property>1570 </widget>1571 </hbox>1572 </widget>1573 <widget class="QLabel">1574 <property name="name">1575 <cstring>txHDD</cstring>1576 </property>1577 <property name="text">1578 <string><not selected></string>1579 </property>1580 </widget>1581 </vbox>1582 </widget>1583 <spacer>1584 <property name="name">1585 <cstring>spacer3</cstring>1586 </property>1587 <property name="orientation">1588 <enum>Vertical</enum>1589 </property>1590 <property name="sizeType">1591 <enum>Expanding</enum>1592 </property>1593 <property name="sizeHint">1594 <size>1595 <width>20</width>1596 <height>0</height>1597 </size>1598 </property>1599 </spacer>1600 </vbox>1601 1402 </widget> 1602 1403 <widget class="QWidget"> … … 3159 2960 <tabstop>tbSelectSavedStateFolder</tabstop> 3160 2961 <tabstop>tbResetSavedStateFolder</tabstop> 3161 <tabstop>grbHDA</tabstop>3162 <tabstop>tbHDA</tabstop>3163 <tabstop>grbHDB</tabstop>3164 <tabstop>tbHDB</tabstop>3165 <tabstop>grbHDD</tabstop>3166 <tabstop>tbHDD</tabstop>3167 2962 <tabstop>bgDVD</tabstop> 3168 2963 <tabstop>rbHostDVD</tabstop> … … 3222 3017 <include location="local" impldecl="in implementation">VBoxMediaComboBox.h</include> 3223 3018 <include location="local" impldecl="in implementation">QIRichLabel.h</include> 3019 <include location="local" impldecl="in implementation">VBoxHardDiskSettings.h</include> 3224 3020 </includes> 3225 3021 <forwards> … … 3228 3024 <forward>class VBoxUSBMenu</forward> 3229 3025 <forward>class VBoxSharedFoldersSettings</forward> 3026 <forward>class VBoxHardDiskSettings</forward> 3230 3027 <forward>class QIRichLabel</forward> 3231 3028 <forward>class BootItemsList</forward> … … 3241 3038 <variable access="private">QIWidgetValidator *wvalFloppy;</variable> 3242 3039 <variable access="private">QIWidgetValidator *wvalVRDP;</variable> 3243 <variable access="private">QUuid uuidHDA;</variable>3244 <variable access="private">QUuid uuidHDB;</variable>3245 <variable access="private">QUuid uuidHDD;</variable>3246 3040 <variable access="private">QUuid uuidISODVD;</variable> 3247 3041 <variable access="private">QUuid uuidISOFloppy;</variable> … … 3254 3048 <variable access="private">bool mUSBFilterListModified;</variable> 3255 3049 <variable access="private">VBoxSharedFoldersSettings *mSharedFolders;</variable> 3050 <variable access="private">VBoxHardDiskSettings *mHDSettings;</variable> 3256 3051 <variable access="private">QString warningString;</variable> 3257 <variable access="private">VBoxMediaComboBox *cbHDA;</variable>3258 <variable access="private">VBoxMediaComboBox *cbHDB;</variable>3259 <variable access="private">VBoxMediaComboBox *cbHDD;</variable>3260 3052 <variable access="private">VBoxMediaComboBox *cbISODVD;</variable> 3261 3053 <variable access="private">VBoxMediaComboBox *cbISOFloppy;</variable> … … 3273 3065 <slot>revalidate( QIWidgetValidator * wval )</slot> 3274 3066 <slot>updateWhatsThis( bool gotFocus = false )</slot> 3275 <slot>showImageManagerHDA()</slot>3276 <slot>showImageManagerHDB()</slot>3277 <slot>showImageManagerHDD()</slot>3278 3067 <slot>showImageManagerISODVD()</slot> 3279 3068 <slot>showImageManagerISOFloppy()</slot> … … 3300 3089 <slot>tbUSBFilterUp_clicked()</slot> 3301 3090 <slot>tbUSBFilterDown_clicked()</slot> 3302 <slot>hdaMediaChanged()</slot>3303 <slot>hdbMediaChanged()</slot>3304 <slot>hddMediaChanged()</slot>3305 3091 <slot>cdMediaChanged()</slot> 3306 3092 <slot>fdMediaChanged()</slot> -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h
r7525 r8071 584 584 /* HDD Images page */ 585 585 586 QWhatsThis::add (static_cast <QWidget *> (grbHDA->child ("qt_groupbox_checkbox")), 587 tr ("When checked, attaches the specified virtual hard disk to the " 588 "Master slot of the Primary IDE controller.")); 589 QWhatsThis::add (static_cast <QWidget *> (grbHDB->child ("qt_groupbox_checkbox")), 590 tr ("When checked, attaches the specified virtual hard disk to the " 591 "Slave slot of the Primary IDE controller.")); 592 QWhatsThis::add (static_cast <QWidget *> (grbHDD->child ("qt_groupbox_checkbox")), 593 tr ("When checked, attaches the specified virtual hard disk to the " 594 "Slave slot of the Secondary IDE controller.")); 595 cbHDA = new VBoxMediaComboBox (grbHDA, "cbHDA", VBoxDefs::HD); 596 cbHDB = new VBoxMediaComboBox (grbHDB, "cbHDB", VBoxDefs::HD); 597 cbHDD = new VBoxMediaComboBox (grbHDD, "cbHDD", VBoxDefs::HD); 598 hdaLayout->insertWidget (0, cbHDA); 599 hdbLayout->insertWidget (0, cbHDB); 600 hddLayout->insertWidget (0, cbHDD); 601 /* sometimes the weirdness of Qt just kills... */ 602 setTabOrder (static_cast <QWidget *> (grbHDA->child ("qt_groupbox_checkbox")), 603 cbHDA); 604 setTabOrder (static_cast <QWidget *> (grbHDB->child ("qt_groupbox_checkbox")), 605 cbHDB); 606 setTabOrder (static_cast <QWidget *> (grbHDD->child ("qt_groupbox_checkbox")), 607 cbHDD); 608 609 QWhatsThis::add (cbHDB, tr ("Displays the virtual hard disk to attach to this IDE slot " 610 "and allows to quickly select a different hard disk.")); 611 QWhatsThis::add (cbHDD, tr ("Displays the virtual hard disk to attach to this IDE slot " 612 "and allows to quickly select a different hard disk.")); 613 QWhatsThis::add (cbHDA, tr ("Displays the virtual hard disk to attach to this IDE slot " 614 "and allows to quickly select a different hard disk.")); 615 QWhatsThis::add (cbHDB, tr ("Displays the virtual hard disk to attach to this IDE slot " 616 "and allows to quickly select a different hard disk.")); 617 QWhatsThis::add (cbHDD, tr ("Displays the virtual hard disk to attach to this IDE slot " 618 "and allows to quickly select a different hard disk.")); 586 QVBoxLayout *hdPageLayout = new QVBoxLayout (pageHDD, 0, 10); 587 mHDSettings = new VBoxHardDiskSettings (pageHDD); 588 hdPageLayout->addWidget (mHDSettings); 619 589 620 590 wvalHDD = new QIWidgetValidator (pagePath (pageHDD), pageHDD, this); … … 624 594 this, SLOT (revalidate (QIWidgetValidator *))); 625 595 626 connect (grbHDA, SIGNAL (toggled (bool)), this, SLOT (hdaMediaChanged())); 627 connect (grbHDB, SIGNAL (toggled (bool)), this, SLOT (hdbMediaChanged())); 628 connect (grbHDD, SIGNAL (toggled (bool)), this, SLOT (hddMediaChanged())); 629 connect (cbHDA, SIGNAL (activated (int)), this, SLOT (hdaMediaChanged())); 630 connect (cbHDB, SIGNAL (activated (int)), this, SLOT (hdbMediaChanged())); 631 connect (cbHDD, SIGNAL (activated (int)), this, SLOT (hddMediaChanged())); 632 connect (tbHDA, SIGNAL (clicked()), this, SLOT (showImageManagerHDA())); 633 connect (tbHDB, SIGNAL (clicked()), this, SLOT (showImageManagerHDB())); 634 connect (tbHDD, SIGNAL (clicked()), this, SLOT (showImageManagerHDD())); 635 636 /* setup iconsets -- qdesigner is not capable... */ 637 tbHDA->setIconSet (VBoxGlobal::iconSet ("select_file_16px.png", 638 "select_file_dis_16px.png")); 639 tbHDB->setIconSet (VBoxGlobal::iconSet ("select_file_16px.png", 640 "select_file_dis_16px.png")); 641 tbHDD->setIconSet (VBoxGlobal::iconSet ("select_file_16px.png", 642 "select_file_dis_16px.png")); 596 connect (mHDSettings, SIGNAL (hddListChanged()), wvalHDD, SLOT (revalidate())); 597 connect (mHDSettings, SIGNAL (hddListChanged()), this, SLOT (resetFirstRunFlag())); 643 598 644 599 /* CD/DVD-ROM Drive Page */ … … 978 933 { 979 934 /* setup necessary combobox item */ 980 cbHDA->setCurrentItem (uuidHDA);981 cbHDB->setCurrentItem (uuidHDB);982 cbHDD->setCurrentItem (uuidHDD);983 935 cbISODVD->setCurrentItem (uuidISODVD); 984 936 cbISOFloppy->setCurrentItem (uuidISOFloppy); … … 988 940 else 989 941 { 990 cbHDA->refresh();991 cbHDB->refresh();992 cbHDD->refresh();993 942 cbISODVD->refresh(); 994 943 cbISOFloppy->refresh(); … … 1195 1144 1196 1145 1197 void VBoxVMSettingsDlg::hdaMediaChanged()1198 {1199 resetFirstRunFlag();1200 uuidHDA = grbHDA->isChecked() ? cbHDA->getId() : QUuid();1201 txHDA->setText (getHdInfo (grbHDA, uuidHDA));1202 /* revailidate */1203 wvalHDD->revalidate();1204 }1205 1206 1207 void VBoxVMSettingsDlg::hdbMediaChanged()1208 {1209 resetFirstRunFlag();1210 uuidHDB = grbHDB->isChecked() ? cbHDB->getId() : QUuid();1211 txHDB->setText (getHdInfo (grbHDB, uuidHDB));1212 /* revailidate */1213 wvalHDD->revalidate();1214 }1215 1216 1217 void VBoxVMSettingsDlg::hddMediaChanged()1218 {1219 resetFirstRunFlag();1220 uuidHDD = grbHDD->isChecked() ? cbHDD->getId() : QUuid();1221 txHDD->setText (getHdInfo (grbHDD, uuidHDD));1222 /* revailidate */1223 wvalHDD->revalidate();1224 }1225 1226 1227 1146 void VBoxVMSettingsDlg::cdMediaChanged() 1228 1147 { … … 1423 1342 { 1424 1343 CVirtualBox vbox = vboxGlobal().virtualBox(); 1425 valid = true; 1426 1427 QValueList <QUuid> uuids; 1428 1429 if (valid && grbHDA->isChecked()) 1430 { 1431 if (uuidHDA.isNull()) 1432 { 1433 valid = false; 1434 warningText = tr ("Primary Master hard disk is not selected"); 1435 } 1436 else uuids << uuidHDA; 1437 } 1438 1439 if (valid && grbHDB->isChecked()) 1440 { 1441 if (uuidHDB.isNull()) 1442 { 1443 valid = false; 1444 warningText = tr ("Primary Slave hard disk is not selected"); 1445 } 1446 else 1447 { 1448 bool found = uuids.findIndex (uuidHDB) >= 0; 1449 if (found) 1450 { 1451 CHardDisk hd = vbox.GetHardDisk (uuidHDB); 1452 valid = hd.GetType() == KHardDiskType_Immutable; 1453 } 1454 if (valid) 1455 uuids << uuidHDB; 1456 else 1457 warningText = tr ("Primary Slave hard disk is already attached " 1458 "to a different slot"); 1459 } 1460 } 1461 1462 if (valid && grbHDD->isChecked()) 1463 { 1464 if (uuidHDD.isNull()) 1465 { 1466 valid = false; 1467 warningText = tr ("Secondary Slave hard disk is not selected"); 1468 } 1469 else 1470 { 1471 bool found = uuids.findIndex (uuidHDD) >= 0; 1472 if (found) 1473 { 1474 CHardDisk hd = vbox.GetHardDisk (uuidHDD); 1475 valid = hd.GetType() == KHardDiskType_Immutable; 1476 } 1477 if (valid) 1478 uuids << uuidHDB; 1479 else 1480 warningText = tr ("Secondary Slave hard disk is already attached " 1481 "to a different slot"); 1482 } 1483 } 1484 1485 cbHDA->setEnabled (grbHDA->isChecked()); 1486 cbHDB->setEnabled (grbHDB->isChecked()); 1487 cbHDD->setEnabled (grbHDD->isChecked()); 1488 tbHDA->setEnabled (grbHDA->isChecked()); 1489 tbHDB->setEnabled (grbHDB->isChecked()); 1490 tbHDD->setEnabled (grbHDD->isChecked()); 1344 QString validity = mHDSettings->checkValidity(); 1345 valid = validity == QString::null; 1346 if (!valid) 1347 warningText = validity; 1491 1348 } 1492 1349 else if (pg == pageDVD) … … 1703 1560 /* hard disk images */ 1704 1561 { 1705 struct 1706 { 1707 KStorageBus bus; 1708 LONG channel; 1709 LONG dev; 1710 struct { 1711 QGroupBox *grb; 1712 QComboBox *cbb; 1713 QLabel *tx; 1714 QUuid *uuid; 1715 } data; 1716 } 1717 diskSet[] = 1718 { 1719 { KStorageBus_IDE, 0, 0, {grbHDA, cbHDA, txHDA, &uuidHDA} }, 1720 { KStorageBus_IDE, 0, 1, {grbHDB, cbHDB, txHDB, &uuidHDB} }, 1721 { KStorageBus_IDE, 1, 1, {grbHDD, cbHDD, txHDD, &uuidHDD} }, 1722 }; 1723 1724 grbHDA->setChecked (false); 1725 grbHDB->setChecked (false); 1726 grbHDD->setChecked (false); 1727 1728 CHardDiskAttachmentEnumerator en = 1729 machine.GetHardDiskAttachments().Enumerate(); 1730 while (en.HasMore()) 1731 { 1732 CHardDiskAttachment hda = en.GetNext(); 1733 for (uint i = 0; i < SIZEOF_ARRAY (diskSet); i++) 1734 { 1735 if (diskSet [i].bus == hda.GetBus() && 1736 diskSet [i].channel == hda.GetChannel() && 1737 diskSet [i].dev == hda.GetDevice()) 1738 { 1739 CHardDisk hd = hda.GetHardDisk(); 1740 CHardDisk root = hd.GetRoot(); 1741 QString src = root.GetLocation(); 1742 if (hd.GetStorageType() == KHardDiskStorageType_VirtualDiskImage) 1743 { 1744 QFileInfo fi (src); 1745 src = fi.fileName() + " (" + 1746 QDir::convertSeparators (fi.dirPath (true)) + ")"; 1747 } 1748 diskSet [i].data.grb->setChecked (true); 1749 diskSet [i].data.tx->setText (vboxGlobal().details (hd)); 1750 *(diskSet [i].data.uuid) = QUuid (root.GetId()); 1751 } 1752 } 1753 } 1562 mHDSettings->getFromMachine (machine); 1754 1563 } 1755 1564 … … 2010 1819 2011 1820 /* request for media shortcuts update */ 2012 cbHDA->setBelongsTo (machine.GetId());2013 cbHDB->setBelongsTo (machine.GetId());2014 cbHDD->setBelongsTo (machine.GetId());2015 1821 updateShortcuts(); 2016 1822 … … 2088 1894 /* hard disk images */ 2089 1895 { 2090 struct 2091 { 2092 KStorageBus bus; 2093 LONG channel; 2094 LONG dev; 2095 struct { 2096 QGroupBox *grb; 2097 QUuid *uuid; 2098 } data; 2099 } 2100 diskSet[] = 2101 { 2102 { KStorageBus_IDE, 0, 0, {grbHDA, &uuidHDA} }, 2103 { KStorageBus_IDE, 0, 1, {grbHDB, &uuidHDB} }, 2104 { KStorageBus_IDE, 1, 1, {grbHDD, &uuidHDD} } 2105 }; 2106 2107 /* 2108 * first, detach all disks (to ensure we can reattach them to different 2109 * controllers / devices, when appropriate) 2110 */ 2111 CHardDiskAttachmentEnumerator en = 2112 cmachine.GetHardDiskAttachments().Enumerate(); 2113 while (en.HasMore()) 2114 { 2115 CHardDiskAttachment hda = en.GetNext(); 2116 for (uint i = 0; i < SIZEOF_ARRAY (diskSet); i++) 2117 { 2118 if (diskSet [i].bus == hda.GetBus() && 2119 diskSet [i].channel == hda.GetChannel() && 2120 diskSet [i].dev == hda.GetDevice()) 2121 { 2122 cmachine.DetachHardDisk (diskSet [i].bus, diskSet [i].channel, diskSet [i].dev); 2123 if (!cmachine.isOk()) 2124 vboxProblem().cannotDetachHardDisk ( 2125 this, cmachine, diskSet [i].bus, diskSet [i].channel, diskSet [i].dev); 2126 } 2127 } 2128 } 2129 2130 /* now, attach new disks */ 2131 for (uint i = 0; i < SIZEOF_ARRAY (diskSet); i++) 2132 { 2133 QUuid *newId = diskSet [i].data.uuid; 2134 if (diskSet [i].data.grb->isChecked() && !(*newId).isNull()) 2135 { 2136 cmachine.AttachHardDisk (*newId, diskSet [i].bus, diskSet [i].channel, diskSet [i].dev); 2137 if (!cmachine.isOk()) 2138 vboxProblem().cannotAttachHardDisk ( 2139 this, cmachine, *newId, diskSet [i].bus, diskSet [i].channel, diskSet [i].dev); 2140 } 2141 } 1896 mHDSettings->putBackToMachine(); 2142 1897 } 2143 1898 … … 2309 2064 2310 2065 2311 void VBoxVMSettingsDlg::showImageManagerHDA() { showVDImageManager (&uuidHDA, cbHDA); }2312 void VBoxVMSettingsDlg::showImageManagerHDB() { showVDImageManager (&uuidHDB, cbHDB); }2313 void VBoxVMSettingsDlg::showImageManagerHDD() { showVDImageManager (&uuidHDD, cbHDD); }2314 2066 void VBoxVMSettingsDlg::showImageManagerISODVD() { showVDImageManager (&uuidISODVD, cbISODVD); } 2315 2067 void VBoxVMSettingsDlg::showImageManagerISOFloppy() { showVDImageManager(&uuidISOFloppy, cbISOFloppy); }
Note:
See TracChangeset
for help on using the changeset viewer.