Changeset 10999 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 30, 2008 4:44:26 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDiskImageManagerDlg.h
r9867 r10999 49 49 VBoxDiskImageManagerDlg (QWidget *aParent = NULL, Qt::WindowFlags aFlags = Qt::Dialog); 50 50 51 void setup (int aType, bool aDoSelect, const QUuid *aTargetVMId = NULL, bool aRefresh = true, CMachine aMachine = NULL, const QUuid & aHdId = QUuid(), const QUuid & aCdId = QUuid(), const QUuid &aFdId = QUuid());51 void setup (int aType, bool aDoSelect, const QUuid &aTargetVMId = QUuid(), bool aRefresh = true, CMachine aMachine = NULL, const QUuid &aHdId = QUuid(), const QUuid &aCdId = QUuid(), const QUuid &aFdId = QUuid()); 52 52 53 53 static void showModeless (bool aRefresh = true); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsHD.h
r10167 r10999 287 287 signals: 288 288 289 void signalToCloseEditor (QWidget *aEditor, 290 QAbstractItemDelegate::EndEditHint aCloseHint); 289 291 void hdChanged(); 290 292 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp
r10888 r10999 2578 2578 2579 2579 VBoxDiskImageManagerDlg dlg (this); 2580 QUuid id = csession.GetMachine().GetId(); 2581 dlg.setup (VBoxDefs::FD, true, &id); 2580 dlg.setup (VBoxDefs::FD, true, csession.GetMachine().GetId()); 2582 2581 2583 2582 if (dlg.exec() == QDialog::Accepted) … … 2622 2621 2623 2622 VBoxDiskImageManagerDlg dlg (this); 2624 QUuid id = csession.GetMachine().GetId(); 2625 dlg.setup (VBoxDefs::CD, true, &id); 2623 dlg.setup (VBoxDefs::CD, true, csession.GetMachine().GetId()); 2626 2624 2627 2625 if (dlg.exec() == QDialog::Accepted) -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDiskImageManagerDlg.cpp
r10519 r10999 447 447 448 448 void VBoxDiskImageManagerDlg::setup (int aType, bool aDoSelect, 449 const QUuid *aTargetVMId /* = NULL */,449 const QUuid &aTargetVMId /* = NULL */, 450 450 bool aRefresh /* = true */, 451 451 CMachine aMachine /* = NULL */, … … 465 465 466 466 mDoSelect = aDoSelect; 467 if ( aTargetVMId)468 mTargetVMId = *aTargetVMId;467 if (!aTargetVMId.isNull()) 468 mTargetVMId = aTargetVMId; 469 469 470 470 if (mDoSelect) -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMFirstRunWzd.cpp
r9245 r10999 242 242 { 243 243 VBoxDiskImageManagerDlg vdm (this); 244 QUuid machineId = mMachine.GetId();245 244 VBoxDefs::DiskType type = mRbCdType->isChecked() ? VBoxDefs::CD : 246 245 mRbFdType->isChecked() ? VBoxDefs::FD : VBoxDefs::InvalidType; 247 vdm.setup (type, true, &machineId);246 vdm.setup (type, true, mMachine.GetId()); 248 247 if (vdm.exec() == QDialog::Accepted) 249 248 { -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsCD.cpp
r10936 r10999 248 248 QUuid oldId = mUuidIsoCD; 249 249 VBoxDiskImageManagerDlg dlg (this); 250 QUuid machineId = mMachine.GetId(); 251 dlg.setup (VBoxDefs::CD, true, &machineId, true /* aRefresh */, 250 dlg.setup (VBoxDefs::CD, true, mMachine.GetId(), true /* aRefresh */, 252 251 mMachine, QUuid(), mCbIsoCD->getId(), QUuid()); 253 252 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsFD.cpp
r10936 r10999 244 244 QUuid oldId = mUuidIsoFD; 245 245 VBoxDiskImageManagerDlg dlg (this); 246 QUuid machineId = mMachine.GetId(); 247 dlg.setup (VBoxDefs::FD, true, &machineId, true /* aRefresh */, 246 dlg.setup (VBoxDefs::FD, true, mMachine.GetId(), true /* aRefresh */, 248 247 mMachine, QUuid(), mCbIsoFD->getId(), QUuid()); 249 248 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsHD.cpp
r10604 r10999 260 260 : VBoxMediaComboBox (aParent, VBoxDefs::HD) 261 261 { 262 mInstance = this; 262 263 setBelongsTo (HDSlotUniquizer::instance()->machine().GetId()); 263 264 connect (this, SIGNAL (currentIndexChanged (int)), this, SLOT (onActivate())); … … 265 266 parent()->parent(), SLOT (commitData (QWidget *))); 266 267 refresh(); 267 mInstance = this;268 268 } 269 269 HDVdiEditor::~HDVdiEditor() 270 270 { 271 mInstance = 0; 271 if (mInstance == this) 272 mInstance = 0; 272 273 } 273 274 … … 468 469 SIGNAL (mediaRemoved (VBoxDefs::DiskType, const QUuid &)), 469 470 this, SLOT (onMediaRemoved (VBoxDefs::DiskType, const QUuid &))); 471 connect (this, SIGNAL (signalToCloseEditor (QWidget*, QAbstractItemDelegate::EndEditHint)), 472 mTwAts, SLOT (closeEditor (QWidget*, QAbstractItemDelegate::EndEditHint))); 470 473 471 474 /* Install global event filter */ … … 650 653 if (result == QIMessageBox::Yes) 651 654 { 652 mTwAts->closePersistentEditor (mTwAts->currentIndex()); 655 /* Close the editor to avoid it's infliction to data model */ 656 emit signalToCloseEditor (HDVdiEditor::activeEditor(), 657 QAbstractItemDelegate::NoHint); 658 659 /* Run new HD wizard */ 653 660 VBoxNewHDWzd dlg (this); 654 661 if (dlg.exec() == QDialog::Accepted) … … 703 710 Assert (mTwAts->currentIndex().isValid()); 704 711 712 /* Close the editor to avoid it's infliction to data model */ 713 emit signalToCloseEditor (HDVdiEditor::activeEditor(), 714 QAbstractItemDelegate::NoHint); 715 716 HDVdiValue oldVdi (mModel->data (mTwAts->currentIndex(), Qt::EditRole) 717 .value<HDVdiValue>()); 718 705 719 VBoxDiskImageManagerDlg dlg (this); 706 QUuid machineId = mMachine.GetId(); 707 HDVdiValue vdiInfo (mModel->data (mTwAts->currentIndex(), Qt::EditRole) 708 .value<HDVdiValue>()); 709 QUuid hdId = vdiInfo.id; 710 dlg.setup (VBoxDefs::HD, true, &machineId, true, mMachine, hdId); 720 dlg.setup (VBoxDefs::HD, true, mMachine.GetId(), true, mMachine, oldVdi.id); 711 721 712 722 if (dlg.exec() == QDialog::Accepted) 713 723 { 724 /* Compose resulting vdi */ 714 725 QVariant result; 715 HDVdiValue val (VBoxMediaComboBox::fullItemName (dlg.selectedPath()), 716 dlg.selectedUuid()); 717 result.setValue (val); 726 HDVdiValue newVdi (VBoxMediaComboBox::fullItemName (dlg.selectedPath()), 727 dlg.selectedUuid()); 728 result.setValue (newVdi); 729 730 /* Set the model's data */ 718 731 mModel->setData (mTwAts->currentIndex(), result); 719 732 } … … 722 735 } 723 736 724 void VBoxVMSettingsHD::onCurrentChanged (const QModelIndex &aIndex)737 void VBoxVMSettingsHD::onCurrentChanged (const QModelIndex& /* aIndex */) 725 738 { 726 739 mNewAction->setEnabled (mModel->rowCount() - 1 < 727 740 HDSlotUniquizer::instance()->list (HDSltValue(), false).count()); 728 741 mDelAction->setEnabled (mTwAts->currentIndex().row() != mModel->rowCount() - 1); 729 mVdmAction->setEnabled (aIndex.isValid() && aIndex.column() == 1); 742 mVdmAction->setEnabled (mTwAts->currentIndex().row() != mModel->rowCount() - 1 && 743 mTwAts->currentIndex().column() == 1); 730 744 } 731 745 … … 744 758 if (firstSataPort < list.size()) 745 759 { 746 int rc = vboxProblem().confirmDetachSATASlots (this); 747 if (rc != QIMessageBox::Ok) 760 if (vboxProblem().confirmDetachSATASlots (this) != QIMessageBox::Ok) 748 761 { 749 762 /* Switch check-box back to "Qt::Checked" */ … … 757 770 /* Delete SATA items */ 758 771 mModel->removeSata(); 772 773 /* Set column #1 of first index to be the current */ 774 mTwAts->setCurrentIndex (mModel->index (0, 1)); 775 759 776 if (mValidator) 760 777 mValidator->revalidate();
Note:
See TracChangeset
for help on using the changeset viewer.