Changeset 9889 in vbox
- Timestamp:
- Jun 23, 2008 6:28:49 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsDlg.h
r9782 r9889 72 72 QString dialogTitle() const; 73 73 74 void updateAvailability(); 75 74 76 /* Common */ 75 77 CMachine mMachine; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsUSB.h
r9827 r9889 63 63 const QString &aPath); 64 64 65 ~VBoxVMSettingsUSB(); 66 65 67 void getFromHost(); 66 68 void putBackToHost(); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobalSettingsDlg.cpp
r9886 r9889 418 418 /* Disable the USB controller category if the USB controller is 419 419 * not available (i.e. in VirtualBox OSE) */ 420 QList<QTreeWidgetItem*> items = mTwSelector->findItems ( 421 "#usb", Qt::MatchExactly, listView_Link); 422 QTreeWidgetItem *usbItem = items.count() ? items [0] : 0; 420 QTreeWidgetItem *usbItem = findItem (mTwSelector, "#usb", listView_Link); 423 421 Assert (usbItem); 424 422 if (usbItem) -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsDlg.cpp
r9827 r9889 120 120 connect (&vboxGlobal(), SIGNAL (mediaEnumFinished (const VBoxMediaList &)), 121 121 this, SLOT (onMediaEnumerationDone())); 122 123 /* Parallel Port Page (currently disabled) */124 //QTreeWidgetItem *item = findItem (mTwSelector, "#parallelPorts", listView_Link);125 //Assert (item);126 //if (item) item->setHidden (true);127 122 128 123 /* Hide unnecessary columns and header */ … … 181 176 mMachine = aMachine; 182 177 178 updateAvailability(); 179 183 180 setWindowTitle (dialogTitle()); 184 181 … … 213 210 214 211 /* Parallel Ports */ 215 VBoxVMSettingsParallel::getFromMachine (aMachine, mPageParallel, 216 this, pagePath (mPageParallel)); 212 if (mPageParallel->isEnabled()) 213 VBoxVMSettingsParallel::getFromMachine (aMachine, mPageParallel, 214 this, pagePath (mPageParallel)); 217 215 218 216 /* USB */ 219 VBoxVMSettingsUSB::getFrom (aMachine, mPageUSB, 220 this, pagePath (mPageUSB)); 217 if (mPageUSB->isEnabled()) 218 VBoxVMSettingsUSB::getFrom (aMachine, mPageUSB, 219 this, pagePath (mPageUSB)); 221 220 222 221 /* Shared Folders */ … … 224 223 225 224 /* Vrdp */ 226 VBoxVMSettingsVRDP::getFromMachine (aMachine, mPageVrdp, 227 this, pagePath (mPageVrdp)); 225 if (mPageVrdp->isEnabled()) 226 VBoxVMSettingsVRDP::getFromMachine (aMachine, mPageVrdp, 227 this, pagePath (mPageVrdp)); 228 228 229 229 /* Finally set the reset First Run Wizard flag to "false" to make sure … … 288 288 /* Set the old index */ 289 289 mTwSelector->setCurrentItem (mTwSelector->topLevelItem (ci)); 290 291 /* Update QTreeWidget with available items */ 292 updateAvailability(); 290 293 291 294 /* Adjust selector list */ … … 550 553 } 551 554 555 void VBoxVMSettingsDlg::updateAvailability() 556 { 557 if (mMachine.isNull()) 558 return; 559 560 /* Parallel Port Page (currently disabled) */ 561 QTreeWidgetItem *parallelItem = 562 findItem (mTwSelector, "#parallelPorts", listView_Link); 563 Assert (parallelItem); 564 if (parallelItem) 565 parallelItem->setHidden (true); 566 mPageParallel->setEnabled (false); 567 568 /* USB Stuff */ 569 CUSBController ctl = mMachine.GetUSBController(); 570 /* Show an error message (if there is any). 571 * Note that we don't use the generic cannotLoadMachineSettings() 572 * call here because we want this message to be suppressable. */ 573 if (!mMachine.isReallyOk()) 574 vboxProblem().cannotAccessUSB (mMachine); 575 if (ctl.isNull()) 576 { 577 /* Disable the USB controller category if the USB controller is 578 * not available (i.e. in VirtualBox OSE) */ 579 QTreeWidgetItem *usbItem = 580 findItem (mTwSelector, "#usb", listView_Link); 581 Assert (usbItem); 582 if (usbItem) 583 usbItem->setHidden (true); 584 mPageUSB->setEnabled (false); 585 } 586 587 /* VRDP Stuff */ 588 CVRDPServer vrdp = mMachine.GetVRDPServer(); 589 if (vrdp.isNull()) 590 { 591 /* Disable the VRDP category if VRDP is 592 * not available (i.e. in VirtualBox OSE) */ 593 QTreeWidgetItem *vrdpItem = 594 findItem (mTwSelector, "#vrdp", listView_Link); 595 Assert (vrdpItem); 596 if (vrdpItem) 597 vrdpItem->setHidden (true); 598 mPageVrdp->setEnabled (false); 599 /* If mMachine has something to say, show the message */ 600 vboxProblem().cannotLoadMachineSettings (mMachine, false /* strict */); 601 } 602 } 603 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsParallel.cpp
r9751 r9889 108 108 void VBoxVMSettingsParallel::putBackToMachine() 109 109 { 110 for (int index = 0; index < mTabWidget->count(); ++ index) 111 { 112 VBoxVMSettingsParallel *page = 113 (VBoxVMSettingsParallel*) mTabWidget->widget (index); 114 Assert (page); 115 page->putBackToPort(); 116 } 110 if (mTabWidget) 111 for (int index = 0; index < mTabWidget->count(); ++ index) 112 { 113 VBoxVMSettingsParallel *page = 114 (VBoxVMSettingsParallel*) mTabWidget->widget (index); 115 Assert (page); 116 page->putBackToPort(); 117 } 117 118 } 118 119 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsUSB.cpp
r9886 r9889 66 66 const QString &aPath) 67 67 { 68 CUSBController ctl = aMachine.GetUSBController();69 70 /* Show an error message (if there is any).71 * Note that we don't use the generic cannotLoadMachineSettings()72 * call here because we want this message to be suppressable. */73 if (!aMachine.isReallyOk())74 vboxProblem().cannotAccessUSB (aMachine);75 76 if (ctl.isNull())77 {78 /* Disable the USB controller category if the USB controller is79 * not available (i.e. in VirtualBox OSE) */80 QList<QTreeWidgetItem*> items = aDlg->mTwSelector->findItems (81 "#usb", Qt::MatchExactly, listView_Link);82 QTreeWidgetItem *usbItem = items.count() ? items [0] : 0;83 Assert (usbItem);84 if (usbItem)85 usbItem->setHidden (true);86 return;87 }88 89 68 mSettings = new VBoxVMSettingsUSB (aPage, MachineType, aDlg, aPath); 90 69 QVBoxLayout *layout = new QVBoxLayout (aPage); … … 238 217 /* Applying language settings */ 239 218 retranslateUi(); 219 } 220 221 VBoxVMSettingsUSB::~VBoxVMSettingsUSB() 222 { 223 mSettings = 0; 240 224 } 241 225 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsVRDP.cpp
r9751 r9889 70 70 const QString &aPath) 71 71 { 72 CVRDPServer vrdp = aMachine.GetVRDPServer();73 74 if (vrdp.isNull())75 {76 /* Disable the VRDP category if VRDP is77 * not available (i.e. in VirtualBox OSE) */78 QList<QTreeWidgetItem*> items = aDlg->mTwSelector->findItems (79 "#vrdp", Qt::MatchExactly, listView_Link);80 QTreeWidgetItem *vrdpItem = items.count() ? items [0] : 0;81 Assert (vrdpItem);82 if (vrdpItem)83 vrdpItem->setHidden (true);84 return;85 86 /* If aMachine has something to say, show the message */87 vboxProblem().cannotLoadMachineSettings (aMachine, false /* strict */);88 }89 90 72 mSettings = new VBoxVMSettingsVRDP (aPage, aDlg, aPath); 91 73 QVBoxLayout *layout = new QVBoxLayout (aPage); … … 104 86 void VBoxVMSettingsVRDP::putBackToMachine() 105 87 { 106 mSettings->putBackTo(); 88 if (mSettings) 89 mSettings->putBackTo(); 107 90 } 108 91
Note:
See TracChangeset
for help on using the changeset viewer.