Changeset 37126 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 17, 2011 1:56:50 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r37109 r37126 193 193 /* If such page present we should fetch internal page cache: */ 194 194 if (m_pages.contains(iPageId)) 195 {196 195 m_pages[iPageId]->getFromCache(); 197 m_pages[iPageId]->polishPage();198 }199 196 } 200 197 /* If thats the page we are waiting for, -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.cpp
r37051 r37126 70 70 mCbAudioDriver->setCurrentIndex(mCbAudioDriver->findText(vboxGlobal().toString(audioData.m_audioDriverType))); 71 71 mCbAudioController->setCurrentIndex(mCbAudioController->findText(vboxGlobal().toString(audioData.m_audioControllerType))); 72 73 /* Polish page finally: */ 74 polishPage(); 72 75 } 73 76 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r37051 r37126 197 197 /* Load display data to page: */ 198 198 mSlMonitors->setValue(displayData.m_cMonitorCount); 199 mCb3D->setEnabled(vboxGlobal().virtualBox().GetHost().GetAcceleration3DAvailable());200 199 mCb3D->setChecked(displayData.m_f3dAccelerationEnabled); 201 200 #ifdef VBOX_WITH_VIDEOHWACCEL 202 mCb2DVideo->setEnabled(VBoxGlobal::isAcceleration2DVideoAvailable());203 201 mCb2DVideo->setChecked(displayData.m_f2dAccelerationEnabled); 204 202 #endif /* VBOX_WITH_VIDEOHWACCEL */ … … 216 214 mTwDisplay->removeTab(1); 217 215 216 /* Polish page finally: */ 217 polishPage(); 218 218 219 /* Revalidate if possible: */ 219 if (mValidator) mValidator->revalidate(); 220 if (mValidator) 221 mValidator->revalidate(); 220 222 } 221 223 … … 474 476 mLeMonitors->setEnabled(isMachineOffline()); 475 477 mLbOptions->setEnabled(isMachineOffline()); 476 mCb3D->setEnabled(isMachineOffline() );477 #ifdef VBOX_WITH_VIDEOHWACCEL 478 mCb2DVideo->setEnabled(isMachineOffline() );478 mCb3D->setEnabled(isMachineOffline() && vboxGlobal().virtualBox().GetHost().GetAcceleration3DAvailable()); 479 #ifdef VBOX_WITH_VIDEOHWACCEL 480 mCb2DVideo->setEnabled(isMachineOffline() && VBoxGlobal::isAcceleration2DVideoAvailable()); 479 481 #endif /* VBOX_WITH_VIDEOHWACCEL */ 480 482 /* VRDE tab: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r37051 r37126 115 115 mCbShowToolBar->setChecked(generalData.m_fShowMiniToolBar); 116 116 mCbToolBarAlignment->setChecked(generalData.m_fMiniToolBarAtTop); 117 mCbToolBarAlignment->setEnabled(mCbShowToolBar->isChecked());118 117 mPsSnapshot->setPath(generalData.m_strSnapshotsFolder); 119 118 mPsSnapshot->setHomeDir(generalData.m_strSnapshotsHomeDir); … … 121 120 mTeDescription->setPlainText(generalData.m_strDescription); 122 121 122 /* Polish page finally: */ 123 polishPage(); 124 123 125 /* Revalidate if possible: */ 124 if (mValidator) mValidator->revalidate(); 126 if (mValidator) 127 mValidator->revalidate(); 125 128 } 126 129 … … 245 248 mLbToolBar->setEnabled(isMachineInValidMode()); 246 249 mCbShowToolBar->setEnabled(isMachineInValidMode()); 247 mCbToolBarAlignment->setEnabled( mCbShowToolBar->isChecked() && isMachineInValidMode());248 } 249 250 mCbToolBarAlignment->setEnabled(isMachineInValidMode() && mCbShowToolBar->isChecked()); 251 } 252 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
r37051 r37126 87 87 m_pMACEditor->setEnabled(m_pParent->isMachineOffline()); 88 88 m_pMACButton->setEnabled(m_pParent->isMachineOffline()); 89 90 m_pPortForwardingButton->setEnabled(m_pParent->isMachineInValidMode() && 91 attachmentType() == KNetworkAttachmentType_NAT); 89 92 90 93 /* Postprocessing: */ … … 856 859 retranslateUi(); 857 860 861 /* Polish page finally: */ 862 polishPage(); 863 858 864 /* Revalidate if possible: */ 859 if (m_pValidator) m_pValidator->revalidate(); 865 if (m_pValidator) 866 m_pValidator->revalidate(); 860 867 } 861 868 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.cpp
r37051 r37126 260 260 retranslateUi(); 261 261 262 /* Polish page finally: */ 263 polishPage(); 264 262 265 /* Revalidate if possible: */ 263 if (mValidator) mValidator->revalidate(); 266 if (mValidator) 267 mValidator->revalidate(); 264 268 } 265 269 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.cpp
r37051 r37126 295 295 mTwFolders->setCurrentItem(mTwFolders->topLevelItem(0)); 296 296 processCurrentChanged(mTwFolders->currentItem()); 297 298 /* Polish page finally: */ 299 polishPage(); 297 300 } 298 301 … … 521 524 } 522 525 523 void UIMachineSettingsSF::showContextMenu (const QPoint &aPos)526 void UIMachineSettingsSF::showContextMenu(const QPoint &pos) 524 527 { 525 528 QMenu menu; 526 QTreeWidgetItem * item = mTwFolders->itemAt (aPos);527 if ( item && item->flags() & Qt::ItemIsSelectable)528 { 529 menu.addAction 530 menu.addAction 529 QTreeWidgetItem *pItem = mTwFolders->itemAt(pos); 530 if (mTwFolders->isEnabled() && pItem && pItem->flags() & Qt::ItemIsSelectable) 531 { 532 menu.addAction(mEdtAction); 533 menu.addAction(mDelAction); 531 534 } 532 535 else 533 536 { 534 menu.addAction (mNewAction); 535 } 536 menu.exec (mTwFolders->viewport()->mapToGlobal (aPos)); 537 menu.addAction(mNewAction); 538 } 539 if (!menu.isEmpty()) 540 menu.exec(mTwFolders->viewport()->mapToGlobal(pos)); 537 541 } 538 542 … … 694 698 void UIMachineSettingsSF::polishPage() 695 699 { 700 /* Update widgets availability: */ 701 mNameSeparator->setEnabled(isMachineInValidMode()); 702 mTwFolders->setEnabled(isMachineInValidMode()); 703 mTbFolders->setEnabled(isMachineInValidMode()); 704 696 705 /* Update root items visibility: */ 697 706 updateRootItemsVisibility(); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.cpp
r37051 r37126 296 296 retranslateUi(); 297 297 298 /* Polish page finally: */ 299 polishPage(); 300 298 301 /* Revalidate if possible: */ 299 if (mValidator) mValidator->revalidate(); 302 if (mValidator) 303 mValidator->revalidate(); 300 304 } 301 305 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r37051 r37126 1910 1910 updateActionsState(); 1911 1911 1912 /* Polish page finally: */ 1913 polishPage(); 1914 1912 1915 /* Revalidate if possible: */ 1913 if (mValidator) mValidator->revalidate(); 1916 if (mValidator) 1917 mValidator->revalidate(); 1914 1918 } 1915 1919 … … 3440 3444 void UIMachineSettingsStorage::setDialogType(SettingsDialogType settingsDialogType) 3441 3445 { 3446 /* Update model 'settings dialog type': */ 3447 mStorageModel->setDialogType(settingsDialogType); 3442 3448 /* Update 'settings dialog type' of base class: */ 3443 3449 UISettingsPageMachine::setDialogType(settingsDialogType); 3444 /* Update model 'settings dialog type': */3445 mStorageModel->setDialogType(dialogType());3446 /* Update action states: */3447 updateActionsState();3448 3450 } 3449 3451 3450 3452 void UIMachineSettingsStorage::polishPage() 3451 3453 { 3454 /* Declare required variables: */ 3455 QModelIndex index = mTwStorageTree->currentIndex(); 3456 KDeviceType device = mStorageModel->data(index, StorageModel::R_AttDevice).value<KDeviceType>(); 3457 3452 3458 /* Left pane: */ 3453 3459 mLsLeftPane->setEnabled(isMachineInValidMode()); … … 3465 3471 /* Attachments pane: */ 3466 3472 mLsAttributes->setEnabled(isMachineInValidMode()); 3467 mLbMedium->setEnabled(isMachine InValidMode());3473 mLbMedium->setEnabled(isMachineOffline() || (isMachineOnline() && device != KDeviceType_HardDisk)); 3468 3474 mCbSlot->setEnabled(isMachineOffline()); 3469 mTbOpen->setEnabled(isMachine InValidMode());3475 mTbOpen->setEnabled(isMachineOffline() || (isMachineOnline() && device != KDeviceType_HardDisk)); 3470 3476 mCbPassthrough->setEnabled(isMachineOffline()); 3471 3477 mLsInformation->setEnabled(isMachineInValidMode()); … … 3484 3490 mLbUsage->setEnabled(isMachineInValidMode()); 3485 3491 mLbUsageValue->setEnabled(isMachineInValidMode()); 3492 3493 /* Update action states: */ 3494 updateActionsState(); 3486 3495 } 3487 3496 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r37051 r37126 246 246 mCbTCUseUTC->setChecked(systemData.m_fUTCEnabled); 247 247 mCbUseAbsHID->setChecked(systemData.m_fUseAbsHID); 248 mSlCPU->setEnabled(systemData.m_fPFHwVirtExSupported);249 mLeCPU->setEnabled(systemData.m_fPFHwVirtExSupported);250 mCbPae->setEnabled(systemData.m_fPFPAESupported);251 248 mCbPae->setChecked(systemData.m_fPAEEnabled); 252 mCbVirt->setEnabled(systemData.m_fPFHwVirtExSupported);253 249 mCbVirt->setChecked(systemData.m_fHwVirtExEnabled); 254 mCbNestedPaging->setEnabled(systemData.m_fPFHwVirtExSupported && systemData.m_fHwVirtExEnabled);255 250 mCbNestedPaging->setChecked(systemData.m_fNestedPagingEnabled); 256 251 mSlMemory->setValue(systemData.m_iRAMSize); … … 258 253 int iChipsetPositionPos = mCbChipset->findData(systemData.m_chipsetType); 259 254 mCbChipset->setCurrentIndex(iChipsetPositionPos == -1 ? 0 : iChipsetPositionPos); 260 if (!systemData.m_fPFHwVirtExSupported) 261 mTwSystem->removeTab(2); 255 256 /* Polish page finally: */ 257 polishPage(); 262 258 263 259 /* Revalidate if possible: */ 264 if (mValidator) mValidator->revalidate(); 260 if (mValidator) 261 mValidator->revalidate(); 265 262 } 266 263 … … 566 563 void UIMachineSettingsSystem::polishPage() 567 564 { 565 /* Get system data from cache: */ 566 const UIDataSettingsMachineSystem &systemData = m_cache.base(); 567 568 568 /* Motherboard tab: */ 569 569 mLbMemory->setEnabled(isMachineOffline()); … … 575 575 mLbBootOrder->setEnabled(isMachineOffline()); 576 576 mTwBootOrder->setEnabled(isMachineOffline()); 577 mTbBootItemUp->setEnabled(isMachineOffline() );578 mTbBootItemDown->setEnabled(isMachineOffline() );577 mTbBootItemUp->setEnabled(isMachineOffline() && mTwBootOrder->hasFocus() && mTwBootOrder->currentRow() > 0); 578 mTbBootItemDown->setEnabled(isMachineOffline() && mTwBootOrder->hasFocus() && (mTwBootOrder->currentRow() < mTwBootOrder->count() - 1)); 579 579 mLbChipset->setEnabled(isMachineOffline()); 580 580 mCbChipset->setEnabled(isMachineOffline()); … … 588 588 mLbCPUMin->setEnabled(isMachineOffline()); 589 589 mLbCPUMax->setEnabled(isMachineOffline()); 590 mSlCPU->setEnabled(isMachineOffline() );591 mLeCPU->setEnabled(isMachineOffline() );590 mSlCPU->setEnabled(isMachineOffline() && systemData.m_fPFHwVirtExSupported); 591 mLeCPU->setEnabled(isMachineOffline() && systemData.m_fPFHwVirtExSupported); 592 592 mLbProcessorExtended->setEnabled(isMachineOffline()); 593 mCbPae->setEnabled(isMachineOffline() );593 mCbPae->setEnabled(isMachineOffline() && systemData.m_fPFPAESupported); 594 594 /* Acceleration tab: */ 595 mTwSystem->setTabEnabled(2, systemData.m_fPFHwVirtExSupported); 595 596 mLbVirt->setEnabled(isMachineOffline()); 596 597 mCbVirt->setEnabled(isMachineOffline()); 597 mCbNestedPaging->setEnabled( mCbVirt->isChecked() && isMachineOffline());598 } 599 598 mCbNestedPaging->setEnabled(isMachineOffline() && mCbVirt->isChecked()); 599 } 600 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp
r37051 r37126 33 33 : UISettingsPage(type) 34 34 , mValidator(0) 35 , m_pToolBar(0) 35 36 , mNewAction(0), mAddAction(0), mEdtAction(0), mDelAction(0) 36 37 , mMupAction(0), mMdnAction(0) 37 , m Menu(0), mUSBDevicesMenu(0)38 , mUSBDevicesMenu(0) 38 39 { 39 40 /* Apply UI decorations */ … … 68 69 ":/usb_movedown_disabled_16px.png")); 69 70 70 /* Prepare menu and toolbar */71 mMenu = new QMenu (mTwFilters);72 mMenu->addAction (mNewAction);73 mMenu->addAction (mAddAction);74 mMenu->addSeparator();75 mMenu->addAction (mEdtAction);76 mMenu->addSeparator();77 mMenu->addAction (mDelAction);78 mMenu->addSeparator();79 mMenu->addAction (mMupAction);80 mMenu->addAction (mMdnAction);81 82 71 /* Prepare toolbar */ 83 UIToolBar *toolBar = new UIToolBar (mWtFilterHandler);84 toolBar->setUsesTextLabel (false);85 toolBar->setIconSize (QSize (16, 16));86 toolBar->setOrientation (Qt::Vertical);87 toolBar->addAction (mNewAction);88 toolBar->addAction (mAddAction);89 toolBar->addAction (mEdtAction);90 toolBar->addAction (mDelAction);91 toolBar->addAction (mMupAction);92 toolBar->addAction (mMdnAction);93 toolBar->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);94 toolBar->updateGeometry();72 m_pToolBar = new UIToolBar (mWtFilterHandler); 73 m_pToolBar->setUsesTextLabel (false); 74 m_pToolBar->setIconSize (QSize (16, 16)); 75 m_pToolBar->setOrientation (Qt::Vertical); 76 m_pToolBar->addAction (mNewAction); 77 m_pToolBar->addAction (mAddAction); 78 m_pToolBar->addAction (mEdtAction); 79 m_pToolBar->addAction (mDelAction); 80 m_pToolBar->addAction (mMupAction); 81 m_pToolBar->addAction (mMdnAction); 82 m_pToolBar->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::MinimumExpanding); 83 m_pToolBar->updateGeometry(); 95 84 #ifdef Q_WS_MAC 96 85 /* On the Mac this has to be slightly higher, than what sizeHint returned. 97 86 * No idea why. */ 98 toolBar->setMinimumHeight(toolBar->sizeHint().height() + 4);87 m_pToolBar->setMinimumHeight(m_pToolBar->sizeHint().height() + 4); 99 88 #else 100 toolBar->setMinimumHeight(toolBar->sizeHint().height());89 m_pToolBar->setMinimumHeight(m_pToolBar->sizeHint().height()); 101 90 #endif /* Q_WS_MAC */ 102 mWtFilterHandler->layout()->addWidget ( toolBar);91 mWtFilterHandler->layout()->addWidget (m_pToolBar); 103 92 104 93 /* Setup connections */ … … 296 285 /* Update page: */ 297 286 usbAdapterToggled(mGbUSB->isChecked()); 287 288 /* Polish page finally: */ 289 polishPage(); 298 290 299 291 /* Revalidate if possible: */ … … 793 785 } 794 786 795 void UIMachineSettingsUSB::showContextMenu (const QPoint &aPos) 796 { 797 mMenu->exec (mTwFilters->mapToGlobal (aPos)); 787 void UIMachineSettingsUSB::showContextMenu(const QPoint &pos) 788 { 789 QMenu menu; 790 if (mTwFilters->isEnabled()) 791 { 792 menu.addAction(mNewAction); 793 menu.addAction(mAddAction); 794 menu.addSeparator(); 795 menu.addAction(mEdtAction); 796 menu.addSeparator(); 797 menu.addAction(mDelAction); 798 menu.addSeparator(); 799 menu.addAction(mMupAction); 800 menu.addAction(mMdnAction); 801 } 802 if (!menu.isEmpty()) 803 menu.exec(mTwFilters->mapToGlobal(pos)); 798 804 } 799 805 … … 914 920 { 915 921 mGbUSB->setEnabled(isMachineOffline()); 916 mCbUSB2->setEnabled(isMachineOffline()); 917 mGbUSBFilters->setEnabled(isMachineInValidMode()); 918 mTwFilters->setEnabled(isMachineInValidMode()); 919 } 920 922 mUSBChild->setEnabled(isMachineInValidMode() && mGbUSB->isChecked()); 923 mCbUSB2->setEnabled(isMachineOffline() && mGbUSB->isChecked()); 924 } 925 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.h
r36936 r37126 25 25 26 26 class VBoxUSBMenu; 27 class UIToolBar; 27 28 28 29 /* Common settings / USB page / USB filter data: */ … … 156 157 void mupClicked(); 157 158 void mdnClicked(); 158 void showContextMenu (const QPoint &aPos);159 void showContextMenu(const QPoint &pos); 159 160 void sltUpdateActivityState(QTreeWidgetItem *pChangedItem); 160 161 … … 184 185 /* Other variables: */ 185 186 QIWidgetValidator *mValidator; 187 UIToolBar *m_pToolBar; 186 188 QAction *mNewAction; 187 189 QAction *mAddAction; … … 190 192 QAction *mMupAction; 191 193 QAction *mMdnAction; 192 QMenu *mMenu;193 194 VBoxUSBMenu *mUSBDevicesMenu; 194 195 QString mUSBFilterName;
Note:
See TracChangeset
for help on using the changeset viewer.