Changeset 2895 in vbox
- Timestamp:
- May 28, 2007 1:16:22 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
r2889 r2895 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 <variable access="private">bool mIsBootSettingsChanged;</variable> 2787 2791 </variables> 2788 2792 <slots> -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h
r2889 r2895 29 29 ** place of a destructor. 30 30 *****************************************************************************/ 31 32 33 extern const char *GUI_FirstRun; 31 34 32 35 … … 187 190 QStringList uniqueList; 188 191 int minimumWidth = 0; 192 mSequence = QString::null; 189 193 for (int i = 1; i <= 4; ++ i) 190 194 { … … 192 196 if (type != CEnums::NoDevice) 193 197 { 198 mSequence += type; 194 199 QString name = vboxGlobal().toString (type); 195 200 QCheckListItem *item = new QCheckListItem (mBootTable, … … 228 233 int index = 1; 229 234 item = static_cast<QCheckListItem*> (mBootTable->firstChild()); 235 QString sequence = QString::null; 230 236 while (item) 231 237 { … … 235 241 vboxGlobal().toDeviceType (item->text (0)); 236 242 aMachine.SetBootOrder (index++, type); 243 sequence += type; 237 244 } 238 245 item = static_cast<QCheckListItem*> (item->nextSibling()); … … 245 252 aMachine.SetBootOrder (index++, CEnums::NoDevice); 246 253 item = static_cast<QCheckListItem*> (item->nextSibling()); 254 } 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); 247 260 } 248 261 } … … 300 313 QToolButton *mBtnUp; 301 314 QToolButton *mBtnDown; 315 QString mSequence; 302 316 }; 303 317 … … 1273 1287 grbHDD->setChecked (false); 1274 1288 1289 /* Creating a clean hd array */ 1290 for (uint i = 0; i < SIZEOF_ARRAY (diskSet); ++ i) 1291 mHDList << QUuid(); 1292 1275 1293 CHardDiskAttachmentEnumerator en = 1276 1294 machine.GetHardDiskAttachments().Enumerate(); … … 1295 1313 diskSet [i].data.tx->setText (vboxGlobal().details (hd)); 1296 1314 *(diskSet [i].data.uuid) = QUuid (root.GetId()); 1315 mHDList [i] = root.GetId(); 1297 1316 } 1298 1317 } … … 1319 1338 1320 1339 CFloppyDrive floppy = machine.GetFloppyDrive(); 1340 mFDsettings = QString ("%1 %2").arg (floppy.GetState()); 1321 1341 switch (floppy.GetState()) 1322 1342 { … … 1340 1360 } 1341 1361 rbHostFloppy->setChecked (true); 1362 mFDsettings += name; 1342 1363 break; 1343 1364 } … … 1350 1371 rbISOFloppy->setChecked (true); 1351 1372 uuidISOFloppy = QUuid (img.GetId()); 1373 mFDsettings += uuidISOFloppy; 1352 1374 break; 1353 1375 } … … 1381 1403 1382 1404 CDVDDrive dvd = machine.GetDVDDrive(); 1405 mCDsettings = QString ("%1 %2").arg (dvd.GetState()); 1383 1406 switch (dvd.GetState()) 1384 1407 { … … 1402 1425 } 1403 1426 rbHostDVD->setChecked (true); 1427 mCDsettings += name; 1404 1428 break; 1405 1429 } … … 1412 1436 rbISODVD->setChecked (true); 1413 1437 uuidISODVD = QUuid (img.GetId()); 1438 mCDsettings += uuidISODVD; 1414 1439 break; 1415 1440 } … … 1528 1553 COMResult VBoxVMSettingsDlg::putBackToMachine() 1529 1554 { 1555 mIsBootSettingsChanged = false; 1556 1530 1557 CVirtualBox vbox = vboxGlobal().virtualBox(); 1531 1558 CBIOSSettings biosSettings = cmachine.GetBIOSSettings(); … … 1605 1632 1606 1633 /* now, attach new disks */ 1634 QStringList hdList; 1607 1635 for (uint i = 0; i < SIZEOF_ARRAY (diskSet); i++) 1608 1636 { 1609 1637 QUuid *newId = diskSet [i].data.uuid; 1638 hdList << *newId; 1610 1639 if (diskSet [i].data.grb->isChecked() && !(*newId).isNull()) 1611 1640 { … … 1616 1645 } 1617 1646 } 1647 1648 /* Check if the hd sequence was changed */ 1649 if (mHDList != hdList) 1650 mIsBootSettingsChanged = true; 1618 1651 } 1619 1652 1620 1653 /* floppy image */ 1621 1654 { 1655 QString curFDsettings; 1622 1656 CFloppyDrive floppy = cmachine.GetFloppyDrive(); 1623 1657 if (!bgFloppy->isChecked()) 1624 1658 { 1625 1659 floppy.Unmount(); 1660 curFDsettings = QString ("%1 %2").arg (floppy.GetState()); 1626 1661 } 1627 1662 else if (rbHostFloppy->isChecked()) … … 1635 1670 * as is 1636 1671 */ 1672 curFDsettings = QString ("%1 %2").arg (floppy.GetState()) 1673 .arg (floppy.GetHostDrive().GetName()); 1637 1674 } 1638 1675 else if (rbISOFloppy->isChecked()) … … 1640 1677 Assert (!uuidISOFloppy.isNull()); 1641 1678 floppy.MountImage (uuidISOFloppy); 1642 } 1679 curFDsettings = QString ("%1 %2").arg (floppy.GetState()) 1680 .arg (floppy.GetImage().GetId()); 1681 } 1682 1683 /* Check if the fd settings was changed */ 1684 if (mFDsettings != curFDsettings) 1685 mIsBootSettingsChanged = true; 1643 1686 } 1644 1687 1645 1688 /* CD/DVD-ROM image */ 1646 1689 { 1690 QString curCDsettings; 1647 1691 CDVDDrive dvd = cmachine.GetDVDDrive(); 1648 1692 if (!bgDVD->isChecked()) 1649 1693 { 1650 1694 dvd.Unmount(); 1695 curCDsettings = QString ("%1 %2").arg (dvd.GetState()); 1651 1696 } 1652 1697 else if (rbHostDVD->isChecked()) … … 1660 1705 * as is 1661 1706 */ 1707 curCDsettings = QString ("%1 %2").arg (dvd.GetState()) 1708 .arg (dvd.GetHostDrive().GetName()); 1662 1709 } 1663 1710 else if (rbISODVD->isChecked()) … … 1665 1712 Assert (!uuidISODVD.isNull()); 1666 1713 dvd.MountImage (uuidISODVD); 1667 } 1668 } 1714 curCDsettings = QString ("%1 %2").arg (dvd.GetState()) 1715 .arg (dvd.GetImage().GetId()); 1716 } 1717 1718 /* Check if the cd sequence was changed */ 1719 if (mCDsettings != curCDsettings) 1720 mIsBootSettingsChanged = true; 1721 } 1722 1723 /* Clear the "GUI_FirstRun" extra data key in case of one of the boot 1724 * settings was changed */ 1725 if (mIsBootSettingsChanged) 1726 cmachine.SetExtraData (GUI_FirstRun, QString::null); 1669 1727 1670 1728 /* audio */
Note:
See TracChangeset
for help on using the changeset viewer.