Changeset 2915 in vbox
- Timestamp:
- May 29, 2007 1:02:09 PM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/ui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui
r2895 r2915 2785 2785 <variable access="private">QIRichLabel *whatsThisLabel;</variable> 2786 2786 <variable access="private">BootItemsList *tblBootOrder;</variable> 2787 <variable access="private">QStringList mHDList;</variable>2788 <variable access="private">QString mCDsettings;</variable>2789 <variable access="private">QString mFDsettings;</variable>2790 2787 <variable access="private">bool mIsBootSettingsChanged;</variable> 2791 2788 </variables> … … 2825 2822 <slot>updateInterfaces( QWidget* )</slot> 2826 2823 <slot>networkPageUpdate( QWidget* )</slot> 2824 <slot>bootSequenceChanged()</slot> 2827 2825 </slots> 2828 2826 <functions> -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h
r2903 r2915 87 87 ~BootItemsTable() {} 88 88 89 void emitItemToggled() { emit itemToggled(); } 90 89 91 signals: 90 92 91 93 void moveItemUp(); 92 94 void moveItemDown(); 95 void itemToggled(); 93 96 94 97 private slots: … … 131 134 { 132 135 Q_OBJECT 136 137 class BootItem : public QCheckListItem 138 { 139 public: 140 141 BootItem (BootItemsTable *aParent, QListViewItem *aAfter, 142 const QString &aName, Type aType) 143 : QCheckListItem (aParent, aAfter, aName, aType) {} 144 145 private: 146 147 void stateChange (bool) 148 { 149 BootItemsTable *table = static_cast<BootItemsTable*> (listView()); 150 table->emitItemToggled(); 151 } 152 }; 133 153 134 154 public: … … 168 188 connect (mBootTable, SIGNAL (moveItemUp()), this, SLOT (moveItemUp())); 169 189 connect (mBootTable, SIGNAL (moveItemDown()), this, SLOT (moveItemDown())); 190 connect (mBootTable, SIGNAL (itemToggled()), this, SLOT (onItemToggled())); 170 191 buttonLayout->addWidget (mBtnUp); 171 192 buttonLayout->addWidget (mBtnDown); … … 190 211 QStringList uniqueList; 191 212 int minimumWidth = 0; 192 mSequence = QString::null;193 213 for (int i = 1; i <= 4; ++ i) 194 214 { … … 196 216 if (type != CEnums::NoDevice) 197 217 { 198 mSequence += type;199 218 QString name = vboxGlobal().toString (type); 200 QCheckListItem *item = new QCheckListItem (mBootTable,219 QCheckListItem *item = new BootItem (mBootTable, 201 220 mBootTable->lastItem(), name, QCheckListItem::CheckBox); 202 221 item->setOn (true); … … 212 231 if (!uniqueList.contains (name)) 213 232 { 214 QCheckListItem *item = new QCheckListItem (mBootTable,233 QCheckListItem *item = new BootItem (mBootTable, 215 234 mBootTable->lastItem(), name, QCheckListItem::CheckBox); 216 235 uniqueList << name; … … 233 252 int index = 1; 234 253 item = static_cast<QCheckListItem*> (mBootTable->firstChild()); 235 QString sequence = QString::null;236 254 while (item) 237 255 { … … 241 259 vboxGlobal().toDeviceType (item->text (0)); 242 260 aMachine.SetBootOrder (index++, type); 243 sequence += type;244 261 } 245 262 item = static_cast<QCheckListItem*> (item->nextSibling()); … … 253 270 item = static_cast<QCheckListItem*> (item->nextSibling()); 254 271 } 255 /* Check if the boot sequence was changed */256 if (mSequence != sequence)257 {258 /* Clear the "GUI_FirstRun" extra data key */259 aMachine.SetExtraData (GUI_FirstRun, QString::null);260 }261 272 } 262 273 … … 274 285 } 275 286 } 287 288 signals: 289 290 void bootSequenceChanged(); 276 291 277 292 private slots: … … 285 300 itemAbove->moveItem (item); 286 301 processCurrentChanged (item); 302 emit bootSequenceChanged(); 287 303 } 288 304 … … 295 311 item->moveItem (itemBelow); 296 312 processCurrentChanged (item); 313 emit bootSequenceChanged(); 314 } 315 316 void onItemToggled() 317 { 318 emit bootSequenceChanged(); 297 319 } 298 320 … … 313 335 QToolButton *mBtnUp; 314 336 QToolButton *mBtnDown; 315 QString mSequence;316 337 }; 317 338 … … 715 736 /* Boot-order table */ 716 737 tblBootOrder = new BootItemsList (groupBox12, "tblBootOrder"); 738 connect (tblBootOrder, SIGNAL (bootSequenceChanged()), 739 this, SLOT (bootSequenceChanged())); 717 740 /* Fixing focus order for BootItemsList */ 718 741 setTabOrder (tbwGeneral, tblBootOrder); … … 830 853 831 854 VBoxGlobal::centerWidget (this, parentWidget()); 855 856 mIsBootSettingsChanged = false; 832 857 } 833 858 … … 886 911 887 912 913 void VBoxVMSettingsDlg::bootSequenceChanged() 914 { 915 mIsBootSettingsChanged = true; 916 } 917 918 888 919 void VBoxVMSettingsDlg::hdaMediaChanged() 889 920 { 921 bootSequenceChanged(); 890 922 uuidHDA = grbHDA->isChecked() ? cbHDA->getId() : QUuid(); 891 923 txHDA->setText (getHdInfo (grbHDA, uuidHDA)); … … 897 929 void VBoxVMSettingsDlg::hdbMediaChanged() 898 930 { 931 bootSequenceChanged(); 899 932 uuidHDB = grbHDB->isChecked() ? cbHDB->getId() : QUuid(); 900 933 txHDB->setText (getHdInfo (grbHDB, uuidHDB)); … … 906 939 void VBoxVMSettingsDlg::hddMediaChanged() 907 940 { 941 bootSequenceChanged(); 908 942 uuidHDD = grbHDD->isChecked() ? cbHDD->getId() : QUuid(); 909 943 txHDD->setText (getHdInfo (grbHDD, uuidHDD)); … … 915 949 void VBoxVMSettingsDlg::cdMediaChanged() 916 950 { 951 bootSequenceChanged(); 917 952 uuidISODVD = bgDVD->isChecked() ? cbISODVD->getId() : QUuid(); 918 953 /* revailidate */ … … 923 958 void VBoxVMSettingsDlg::fdMediaChanged() 924 959 { 960 bootSequenceChanged(); 925 961 uuidISOFloppy = bgFloppy->isChecked() ? cbISOFloppy->getId() : QUuid(); 926 962 /* revailidate */ … … 1288 1324 grbHDD->setChecked (false); 1289 1325 1290 /* Creating a clean hd array */1291 for (uint i = 0; i < SIZEOF_ARRAY (diskSet); ++ i)1292 mHDList << QUuid();1293 1294 1326 CHardDiskAttachmentEnumerator en = 1295 1327 machine.GetHardDiskAttachments().Enumerate(); … … 1314 1346 diskSet [i].data.tx->setText (vboxGlobal().details (hd)); 1315 1347 *(diskSet [i].data.uuid) = QUuid (root.GetId()); 1316 mHDList [i] = root.GetId();1317 1348 } 1318 1349 } … … 1339 1370 1340 1371 CFloppyDrive floppy = machine.GetFloppyDrive(); 1341 mFDsettings = QString ("%1 %2").arg (floppy.GetState());1342 1372 switch (floppy.GetState()) 1343 1373 { … … 1361 1391 } 1362 1392 rbHostFloppy->setChecked (true); 1363 mFDsettings += name;1364 1393 break; 1365 1394 } … … 1372 1401 rbISOFloppy->setChecked (true); 1373 1402 uuidISOFloppy = QUuid (img.GetId()); 1374 mFDsettings += uuidISOFloppy;1375 1403 break; 1376 1404 } … … 1404 1432 1405 1433 CDVDDrive dvd = machine.GetDVDDrive(); 1406 mCDsettings = QString ("%1 %2").arg (dvd.GetState());1407 1434 switch (dvd.GetState()) 1408 1435 { … … 1426 1453 } 1427 1454 rbHostDVD->setChecked (true); 1428 mCDsettings += name;1429 1455 break; 1430 1456 } … … 1437 1463 rbISODVD->setChecked (true); 1438 1464 uuidISODVD = QUuid (img.GetId()); 1439 mCDsettings += uuidISODVD;1440 1465 break; 1441 1466 } … … 1554 1579 COMResult VBoxVMSettingsDlg::putBackToMachine() 1555 1580 { 1556 mIsBootSettingsChanged = false;1557 1558 1581 CVirtualBox vbox = vboxGlobal().virtualBox(); 1559 1582 CBIOSSettings biosSettings = cmachine.GetBIOSSettings(); … … 1633 1656 1634 1657 /* now, attach new disks */ 1635 QStringList hdList;1636 1658 for (uint i = 0; i < SIZEOF_ARRAY (diskSet); i++) 1637 1659 { 1638 1660 QUuid *newId = diskSet [i].data.uuid; 1639 hdList << *newId;1640 1661 if (diskSet [i].data.grb->isChecked() && !(*newId).isNull()) 1641 1662 { … … 1646 1667 } 1647 1668 } 1648 1649 /* Check if the hd sequence was changed */1650 if (mHDList != hdList)1651 mIsBootSettingsChanged = true;1652 1669 } 1653 1670 1654 1671 /* floppy image */ 1655 1672 { 1656 QString curFDsettings;1657 1673 CFloppyDrive floppy = cmachine.GetFloppyDrive(); 1658 1674 if (!bgFloppy->isChecked()) 1659 1675 { 1660 1676 floppy.Unmount(); 1661 curFDsettings = QString ("%1 %2").arg (floppy.GetState());1662 1677 } 1663 1678 else if (rbHostFloppy->isChecked()) … … 1671 1686 * as is 1672 1687 */ 1673 curFDsettings = QString ("%1 %2").arg (floppy.GetState())1674 .arg (floppy.GetHostDrive().GetName());1675 1688 } 1676 1689 else if (rbISOFloppy->isChecked()) … … 1678 1691 Assert (!uuidISOFloppy.isNull()); 1679 1692 floppy.MountImage (uuidISOFloppy); 1680 curFDsettings = QString ("%1 %2").arg (floppy.GetState()) 1681 .arg (floppy.GetImage().GetId()); 1682 } 1683 1684 /* Check if the fd settings was changed */ 1685 if (mFDsettings != curFDsettings) 1686 mIsBootSettingsChanged = true; 1693 } 1687 1694 } 1688 1695 1689 1696 /* CD/DVD-ROM image */ 1690 1697 { 1691 QString curCDsettings;1692 1698 CDVDDrive dvd = cmachine.GetDVDDrive(); 1693 1699 if (!bgDVD->isChecked()) 1694 1700 { 1695 1701 dvd.Unmount(); 1696 curCDsettings = QString ("%1 %2").arg (dvd.GetState());1697 1702 } 1698 1703 else if (rbHostDVD->isChecked()) … … 1706 1711 * as is 1707 1712 */ 1708 curCDsettings = QString ("%1 %2").arg (dvd.GetState())1709 .arg (dvd.GetHostDrive().GetName());1710 1713 } 1711 1714 else if (rbISODVD->isChecked()) … … 1713 1716 Assert (!uuidISODVD.isNull()); 1714 1717 dvd.MountImage (uuidISODVD); 1715 curCDsettings = QString ("%1 %2").arg (dvd.GetState()) 1716 .arg (dvd.GetImage().GetId()); 1717 } 1718 1719 /* Check if the cd sequence was changed */ 1720 if (mCDsettings != curCDsettings) 1721 mIsBootSettingsChanged = true; 1718 } 1722 1719 } 1723 1720 … … 1820 1817 void VBoxVMSettingsDlg::showVDImageManager (QUuid *id, VBoxMediaComboBox *cbb, QLabel*) 1821 1818 { 1819 bootSequenceChanged(); 1820 1822 1821 VBoxDefs::DiskType type = VBoxDefs::InvalidType; 1823 1822 if (cbb == cbISODVD)
Note:
See TracChangeset
for help on using the changeset viewer.