Changeset 10468 in vbox for trunk/src/VBox/Frontends/VirtualBox4
- Timestamp:
- Jul 10, 2008 1:16:45 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk
r10462 r10468 573 573 include/VBoxSettingsDialog.h \ 574 574 include/VBoxSettingsDialogSpecific.h \ 575 include/VBoxSettingsPage.h 575 include/VBoxSettingsPage.h \ 576 include/VBoxSettingsSelector.h 576 577 577 578 # Sources containing local definitions of classes that use the Q_OBJECT macro. … … 641 642 src/VBoxGLSettingsLanguage.cpp \ 642 643 src/VBoxSettingsDialog.cpp \ 643 src/VBoxSettingsDialogSpecific.cpp 644 src/VBoxSettingsDialogSpecific.cpp \ 645 src/VBoxSettingsSelector.cpp 644 646 645 647 ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSettingsDialog.h
r10212 r10468 30 30 class VBoxWarnIconLabel; 31 31 class QIWidgetValidator; 32 class VBoxSettingsSelector; 32 33 class QTimer; 33 34 class QStackedWidget; … … 44 45 public: 45 46 46 VBoxSettingsDialog (QWidget *aParent );47 VBoxSettingsDialog (QWidget *aParent = NULL); 47 48 48 49 virtual void getFrom() = 0; … … 52 53 53 54 virtual void revalidate (QIWidgetValidator * /* aWval */) {} 54 void settingsGroupChanged (QTreeWidgetItem *aItem,55 QTreeWidgetItem *aPrev = 0);56 55 57 56 protected: 58 57 59 static QTreeWidgetItem* findItem (QTreeWidget *aView,60 const QString &aMatch,61 int aColumn);62 63 58 virtual void retranslateUi(); 64 59 65 QString pagePath (QWidget *aPage);66 60 void setWarning (const QString &aWarning); 67 61 62 VBoxSettingsSelector *mSelector; 68 63 QStackedWidget *mStack; 69 64 … … 73 68 void updateWhatsThis (bool aGotFocus = false); 74 69 void whatsThisCandidateDestroyed (QObject *aObj = 0); 70 71 void categoryChanged (int aId); 75 72 76 73 private: -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSettingsDialogSpecific.h
r10212 r10468 40 40 public: 41 41 42 enum GLSettingsPageIds 43 { 44 GeneralId = 0, 45 InputId, 46 LanguageId, 47 USBId 48 }; 49 42 50 VBoxGLSettingsDlg (QWidget *aParent); 43 51 … … 64 72 65 73 public: 74 75 enum VMSettingsPageIds 76 { 77 GeneralId = 0, 78 HDId, 79 CDId, 80 FDId, 81 AudioId, 82 NetworkId, 83 SerialId, 84 ParallelId, 85 USBId, 86 SFId, 87 VRDPId 88 }; 66 89 67 90 VBoxVMSettingsDlg (QWidget *aParent, const CMachine &aMachine, -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSettingsPage.h
r10212 r10468 62 62 QWidget *mFirstWidget; 63 63 }; 64 64 65 #endif // __VBoxSettingsPage_h__ 65 66 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSettingsUtils.h
r10167 r10468 26 26 #include <VBoxGlobal.h> 27 27 28 /* Qt includes */ 28 29 #ifdef Q_WS_WIN 29 30 #include <QDialog> … … 40 41 enum 41 42 { 42 /* mTwSelector column numbers */43 treeWidget_Category = 0,44 treeWidget_Id = 1,45 treeWidget_Link = 2,46 47 43 /* mTwUSBFilters column numbers */ 48 44 twUSBFilters_Name = 0, -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSettingsDialog.cpp
r10376 r10468 6 6 7 7 /* 8 * Copyright (C) 2006-200 7Sun Microsystems, Inc.8 * Copyright (C) 2006-2008 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 26 26 #include "VBoxProblemReporter.h" 27 27 #include "QIWidgetValidator.h" 28 #include "VBoxSettingsSelector.h" 28 29 29 30 #ifdef Q_WS_MAC … … 36 37 #include <QStackedWidget> 37 38 38 /* Returns the path to the item in the form of 'grandparent > parent > item' 39 * using the text of the first column of every item. */ 40 static QString path (QTreeWidgetItem *aItem) 41 { 42 static QString sep = ": "; 43 QString p; 44 QTreeWidgetItem *cur = aItem; 45 while (cur) 46 { 47 if (!p.isNull()) 48 p = sep + p; 49 p = cur->text (treeWidget_Category).simplified() + p; 50 cur = cur->parent(); 51 } 52 return p; 53 } 54 55 VBoxSettingsDialog::VBoxSettingsDialog (QWidget *aParent) 39 VBoxSettingsDialog::VBoxSettingsDialog (QWidget *aParent /* = NULL */) 56 40 : QIWithRetranslateUI<QIMainDialog> (aParent) 57 41 , mPolished (false) … … 77 61 mLbTitle->setFont (f); 78 62 79 /* Hide unnecessary columns and header */ 80 mTwSelector->header()->hide(); 81 mTwSelector->hideColumn (treeWidget_Id); 82 mTwSelector->hideColumn (treeWidget_Link); 83 84 /* Crating stack of pages */ 63 /* Create the classical tree view selector */ 64 mSelector = new VBoxSettingsTreeSelector (mAllWidget); 65 QGridLayout *mainLayout = static_cast<QGridLayout*> (mAllWidget->layout()); 66 mainLayout->addWidget (mSelector->widget(), 0, 0, 3, 1); 67 mSelector->widget()->setFocus(); 68 69 /* Creating stack of pages */ 85 70 mStack = new QStackedWidget (mWtStackHandler); 86 71 QVBoxLayout *layout = new QVBoxLayout (mWtStackHandler); … … 109 94 connect (mButtonBox, SIGNAL (rejected()), this, SLOT (reject())); 110 95 connect (mButtonBox, SIGNAL (helpRequested()), &vboxProblem(), SLOT (showHelpHelpDialog())); 111 connect (m TwSelector, SIGNAL (currentItemChanged (QTreeWidgetItem*, QTreeWidgetItem*)),112 this, SLOT ( settingsGroupChanged (QTreeWidgetItem *, QTreeWidgetItem*)));96 connect (mSelector, SIGNAL (categoryChanged (int)), 97 this, SLOT (categoryChanged (int))); 113 98 114 99 /* Applying language settings */ … … 120 105 /* Translate uic generated strings */ 121 106 Ui::VBoxSettingsDialog::retranslateUi (this); 122 123 /* Adjust selector list */124 mTwSelector->setFixedWidth (static_cast<QAbstractItemView*> (mTwSelector)125 ->sizeHintForColumn (treeWidget_Category) + 2 * mTwSelector->frameWidth());126 127 /* Sort selector by the id column */128 mTwSelector->sortItems (treeWidget_Id, Qt::AscendingOrder);129 mTwSelector->resizeColumnToContents (treeWidget_Category);130 131 mWarnIconLabel->setWarningText (tr ("Invalid settings detected"));132 mButtonBox->button (QDialogButtonBox::Ok)133 ->setWhatsThis (tr ("Accepts (saves) changes and closes the dialog."));134 mButtonBox->button (QDialogButtonBox::Cancel)135 ->setWhatsThis (tr ("Cancels changes and closes the dialog."));136 mButtonBox->button (QDialogButtonBox::Help)137 ->setWhatsThis (tr ("Displays the dialog help."));138 107 139 108 /* Revalidate all pages to retranslate the warning messages also. */ … … 142 111 if (!wval->isValid()) 143 112 revalidate (wval); 144 145 /* Add some margin to every item in the tree */146 mTwSelector->addTopBottomMarginToItems (12);147 }148 149 /**150 * Returns a path to the given page of this settings dialog. See ::path() for151 * details.152 */153 QString VBoxSettingsDialog::pagePath (QWidget *aPage)154 {155 QTreeWidgetItem *li =156 findItem (mTwSelector,157 QString ("%1")158 .arg (mStack->indexOf (aPage), 2, 10, QChar ('0')),159 treeWidget_Id);160 return ::path (li);161 113 } 162 114 … … 213 165 } 214 166 215 void VBoxSettingsDialog::settingsGroupChanged (QTreeWidgetItem *aItem, 216 QTreeWidgetItem *) 217 { 218 if (aItem) 219 { 220 int id = aItem->text (treeWidget_Id).toInt(); 221 Assert (id >= 0); 222 167 void VBoxSettingsDialog::categoryChanged (int aId) 168 { 223 169 //#ifndef Q_WS_MAC 224 170 #if 1 225 mLbTitle->setText ( ::path (aItem));226 mStack->setCurrentIndex ( id);171 mLbTitle->setText (mSelector->itemText (aId)); 172 mStack->setCurrentIndex (aId); 227 173 #else /* Q_WS_MAC */ 228 174 /* We will update at once later */ … … 248 194 setFixedSize (minimumSizeHint()); 249 195 #endif /* !Q_WS_MAC */ 250 }251 }252 253 /* Returns first item of 'aView' matching required 'aMatch' value254 * searching the 'aColumn' column. */255 QTreeWidgetItem* VBoxSettingsDialog::findItem (QTreeWidget *aView,256 const QString &aMatch,257 int aColumn)258 {259 QList<QTreeWidgetItem*> list =260 aView->findItems (aMatch, Qt::MatchExactly, aColumn);261 262 return list.count() ? list [0] : 0;263 196 } 264 197 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSettingsDialogSpecific.cpp
r10332 r10468 27 27 #include "VBoxProblemReporter.h" 28 28 #include "QIWidgetValidator.h" 29 #include "VBoxSettingsSelector.h" 29 30 30 31 #include "VBoxGLSettingsGeneral.h" … … 47 48 #include <QStackedWidget> 48 49 49 50 50 VBoxGLSettingsDlg::VBoxGLSettingsDlg (QWidget *aParent) 51 51 : VBoxSettingsDialog (aParent) … … 59 59 60 60 /* Creating settings pages */ 61 attachPage ( (VBoxSettingsPage*)new VBoxGLSettingsGeneral());62 63 attachPage ( (VBoxSettingsPage*)new VBoxGLSettingsInput());64 65 attachPage ( (VBoxSettingsPage*)new VBoxGLSettingsLanguage());61 attachPage (new VBoxGLSettingsGeneral()); 62 63 attachPage (new VBoxGLSettingsInput()); 64 65 attachPage (new VBoxGLSettingsLanguage()); 66 66 67 67 #ifdef ENABLE_GLOBAL_USB 68 attachPage ( (VBoxSettingsPage*)new VBoxVMSettingsUSB (VBoxVMSettingsUSB::HostType));68 attachPage (new VBoxVMSettingsUSB (VBoxVMSettingsUSB::HostType)); 69 69 #endif 70 70 71 /* Update QTreeWidgetwith available items */71 /* Update Selector with available items */ 72 72 updateAvailability(); 73 73 } … … 110 110 111 111 /* Remember old index */ 112 int ci = mTwSelector->indexOfTopLevelItem (mTwSelector->currentItem()); 113 114 mTwSelector->clear(); 115 116 /* Populate selector list */ 117 QTreeWidgetItem *item = 0; 112 int cid = mSelector->currentId(); 113 /* Remove all items */ 114 mSelector->clear(); 118 115 119 116 /* General page */ 120 item = new QTreeWidgetItem (mTwSelector, QStringList() << " General " 121 << "00" << "#general"); 122 item->setIcon (treeWidget_Category, 123 VBoxGlobal::iconSet (":/machine_16px.png")); 117 mSelector->addItem (VBoxGlobal::iconSet (":/machine_16px.png"), 118 tr ("General"), GeneralId, "#general"); 124 119 125 120 /* Input page */ 126 item = new QTreeWidgetItem (mTwSelector, QStringList() << " Input " 127 << "01" << "#input"); 128 item->setIcon (treeWidget_Category, 129 VBoxGlobal::iconSet (":/hostkey_16px.png")); 121 mSelector->addItem (VBoxGlobal::iconSet (":/hostkey_16px.png"), 122 tr ("Input"), InputId, "#input"); 130 123 131 124 /* Language page */ 132 item = new QTreeWidgetItem (mTwSelector, QStringList() << " Language " 133 << "02" << "#language"); 134 item->setIcon (treeWidget_Category, 135 VBoxGlobal::iconSet (":/site_16px.png")); 125 mSelector->addItem (VBoxGlobal::iconSet (":/site_16px.png"), 126 tr ("Language"), LanguageId, "#language"); 136 127 137 128 #ifdef ENABLE_GLOBAL_USB 138 129 /* USB page */ 139 item = new QTreeWidgetItem (mTwSelector, QStringList() << " USB " 140 << "03" << "#usb"); 141 item->setIcon (treeWidget_Category, 142 VBoxGlobal::iconSet (":/usb_16px.png")); 130 mSelector->addItem (VBoxGlobal::iconSet (":/usb_16px.png"), 131 tr ("USB"), USBId, "#usb"); 143 132 #endif 144 133 134 /* Translate the selector */ 135 mSelector->retranslateUi(); 136 145 137 VBoxSettingsDialog::retranslateUi(); 146 138 147 /* Se t the old index*/148 m TwSelector->setCurrentItem (mTwSelector->topLevelItem (ci == -1 ? 0 : ci));149 150 /* Update QTreeWidgetwith available items */139 /* Select old remembered category */ 140 mSelector->selectById (cid == -1 ? 0 : cid); 141 142 /* Update Selector with available items */ 151 143 updateAvailability(); 152 144 } … … 156 148 mStack->addWidget (aPage); 157 149 158 aPage->setOrderAfter (m TwSelector);150 aPage->setOrderAfter (mSelector->widget()); 159 151 160 152 return aPage; … … 175 167 /* Disable the USB controller category if the USB controller is 176 168 * not available (i.e. in VirtualBox OSE) */ 177 QTreeWidgetItem *usbItem = findItem (mTwSelector, "#usb",178 treeWidget_Link);179 if ( usbItem)169 mSelector->setVisibleById (USBId, false); 170 int index = mSelector->idToIndex (USBId); 171 if (index > -1) 180 172 { 181 usbItem->setHidden (true);182 int index = mTwSelector->indexOfTopLevelItem (usbItem);183 173 if (mStack->widget (index)) 184 174 mStack->widget (index)->setEnabled (false); … … 238 228 if (!aCategory.isNull()) 239 229 { 240 /* Search for a list view item corresponding to the category */ 241 if (QTreeWidgetItem *item = findItem (mTwSelector, aCategory, treeWidget_Link)) 230 mSelector->selectByLink (aCategory); 231 /* Search for a widget with the given name */ 232 if (!aControl.isNull()) 242 233 { 243 mTwSelector->setCurrentItem (item); 244 /* Search for a widget with the given name */ 245 if (!aControl.isNull()) 234 if (QWidget *w = mStack->currentWidget()->findChild<QWidget*> (aControl)) 246 235 { 247 if (QWidget *w = mStack->currentWidget()->findChild<QWidget*> (aControl)) 236 QList<QWidget*> parents; 237 QWidget *p = w; 238 while ((p = p->parentWidget()) != NULL) 248 239 { 249 QList<QWidget*> parents; 250 QWidget *p = w; 251 while ((p = p->parentWidget()) != NULL) 240 if (QTabWidget *tb = qobject_cast<QTabWidget*> (p)) 252 241 { 253 if (QTabWidget *tb = qobject_cast<QTabWidget*> (p)) 254 { 255 /* The tab contents widget is two steps down 256 * (QTabWidget -> QStackedWidget -> QWidget) */ 257 QWidget *c = parents [parents.count() - 1]; 258 if (c) 259 c = parents [parents.count() - 2]; 260 if (c) 261 tb->setCurrentWidget (c); 262 } 263 parents.append (p); 242 /* The tab contents widget is two steps down 243 * (QTabWidget -> QStackedWidget -> QWidget) */ 244 QWidget *c = parents [parents.count() - 1]; 245 if (c) 246 c = parents [parents.count() - 2]; 247 if (c) 248 tb->setCurrentWidget (c); 264 249 } 265 266 w->setFocus(); 250 parents.append (p); 267 251 } 252 253 w->setFocus(); 268 254 } 269 255 } … … 278 264 279 265 QString warningText; 280 QString pageTitle = pagePath (pg); 266 267 QString pageTitle = mSelector->itemTextByIndex (mStack->indexOf (pg)); 281 268 282 269 VBoxSettingsPage *page = static_cast<VBoxSettingsPage*> (pg); … … 319 306 setWindowTitle (dialogTitle()); 320 307 321 /* Remember old index */322 int ci = mTwSelector->indexOfTopLevelItem (mTwSelector->currentItem());323 324 mTwSelector->clear();325 326 308 /* We have to make sure that the Serial & Network subpages are retranslated 327 309 * before they are revalidated. Cause: They do string comparing within … … 330 312 331 313 /* Populate selector list */ 332 QTreeWidgetItem *item = 0;333 314 QWidget *curpage = 0; 334 315 316 /* Remember old index */ 317 int cid = mSelector->currentId(); 318 /* Remove all items */ 319 mSelector->clear(); 320 335 321 /* General page */ 336 item = new QTreeWidgetItem (mTwSelector, QStringList() << " General " 337 << "00" << "#general"); 338 item->setIcon (treeWidget_Category, 339 VBoxGlobal::iconSet (":/machine_16px.png")); 322 mSelector->addItem (VBoxGlobal::iconSet (":/machine_16px.png"), 323 tr ("General"), GeneralId, "#general"); 340 324 341 325 /* HD page */ 342 item = new QTreeWidgetItem (mTwSelector, QStringList() << " Hard Disks " 343 << "01" << "#hdds"); 344 item->setIcon (treeWidget_Category, 345 VBoxGlobal::iconSet (":/hd_16px.png")); 326 mSelector->addItem (VBoxGlobal::iconSet (":/hd_16px.png"), 327 tr ("Hard Disks"), HDId, "#hdds"); 346 328 347 329 /* CD page */ 348 item = new QTreeWidgetItem (mTwSelector, QStringList() << " CD/DVD-ROM " 349 << "02" << "#dvd"); 350 item->setIcon (treeWidget_Category, 351 VBoxGlobal::iconSet (":/cd_16px.png")); 330 mSelector->addItem (VBoxGlobal::iconSet (":/cd_16px.png"), 331 tr ("CD/DVD-ROM"), CDId, "#dvd"); 352 332 353 333 /* FD page */ 354 item = new QTreeWidgetItem (mTwSelector, QStringList() << " Floppy " 355 << "03" << "#floppy"); 356 item->setIcon (treeWidget_Category, 357 VBoxGlobal::iconSet (":/fd_16px.png")); 334 mSelector->addItem (VBoxGlobal::iconSet (":/fd_16px.png"), 335 tr ("Floppy"), FDId, "#floppy"); 358 336 359 337 /* Audio page */ 360 item = new QTreeWidgetItem (mTwSelector, QStringList() << " Audio " 361 << "04" << "#audio"); 362 item->setIcon (treeWidget_Category, 363 VBoxGlobal::iconSet (":/sound_16px.png")); 338 mSelector->addItem (VBoxGlobal::iconSet (":/sound_16px.png"), 339 tr ("Audio"), AudioId, "#audio"); 364 340 365 341 /* Network page */ 366 item = new QTreeWidgetItem (mTwSelector, QStringList() << " Network " 367 << "05" << "#network"); 368 item->setIcon (treeWidget_Category, 369 VBoxGlobal::iconSet (":/nw_16px.png")); 370 curpage = mStack->widget (mTwSelector->indexOfTopLevelItem (item)); 342 mSelector->addItem (VBoxGlobal::iconSet (":/nw_16px.png"), 343 tr ("Network"), NetworkId, "#network"); 344 345 curpage = mStack->widget (mSelector->idToIndex (NetworkId)); 371 346 if (curpage) 372 347 qApp->sendEvent (curpage, &event); 373 348 374 349 /* Serial page */ 375 item = new QTreeWidgetItem (mTwSelector, QStringList() << " Serial Ports " 376 << "06" << "#serialPorts"); 377 item->setIcon (treeWidget_Category, 378 VBoxGlobal::iconSet (":/serial_port_16px.png")); 379 curpage = mStack->widget (mTwSelector->indexOfTopLevelItem (item)); 350 mSelector->addItem (VBoxGlobal::iconSet (":/serial_port_16px.png"), 351 tr ("Serial Ports"), SerialId, "#serialPorts"); 352 353 curpage = mStack->widget (mSelector->idToIndex (SerialId)); 380 354 if (curpage) 381 355 qApp->sendEvent (curpage, &event); 382 356 383 357 /* Parallel page */ 384 item = new QTreeWidgetItem (mTwSelector, QStringList() << " Parallel Ports " 385 << "07" << "#parallelPorts"); 386 item->setIcon (treeWidget_Category, 387 VBoxGlobal::iconSet (":/parallel_port_16px.png")); 388 curpage = mStack->widget (mTwSelector->indexOfTopLevelItem (item)); 358 mSelector->addItem (VBoxGlobal::iconSet (":/parallel_port_16px.png"), 359 tr ("Parallel Ports"), ParallelId, "#parallelPorts"); 360 361 curpage = mStack->widget (mSelector->idToIndex (ParallelId)); 389 362 if (curpage) 390 363 qApp->sendEvent (curpage, &event); 391 364 392 365 /* USB page */ 393 item = new QTreeWidgetItem (mTwSelector, QStringList() << " USB " 394 << "08" << "#usb"); 395 item->setIcon (treeWidget_Category, 396 VBoxGlobal::iconSet (":/usb_16px.png")); 366 mSelector->addItem (VBoxGlobal::iconSet (":/usb_16px.png"), 367 tr ("USB"), USBId, "#usb"); 397 368 398 369 /* SFolders page */ 399 item = new QTreeWidgetItem (mTwSelector, QStringList() << " Shared Folders " 400 << "09" << "#sfolders"); 401 item->setIcon (treeWidget_Category, 402 VBoxGlobal::iconSet (":/shared_folder_16px.png")); 370 mSelector->addItem (VBoxGlobal::iconSet (":/shared_folder_16px.png"), 371 tr ("Shared Folders"), SFId, "#sfolders"); 403 372 404 373 /* VRDP page */ 405 item = new QTreeWidgetItem (mTwSelector, QStringList() << " Remote Display " 406 << "10" << "#vrdp"); 407 item->setIcon (treeWidget_Category, 408 VBoxGlobal::iconSet (":/vrdp_16px.png")); 409 374 mSelector->addItem (VBoxGlobal::iconSet (":/vrdp_16px.png"), 375 tr ("Remote Display"), VRDPId, "#vrdp"); 376 377 /* Translate the selector */ 378 mSelector->retranslateUi(); 379 410 380 VBoxSettingsDialog::retranslateUi(); 411 381 412 /* Se t the old index*/413 m TwSelector->setCurrentItem (mTwSelector->topLevelItem (ci == -1 ? 0 : ci));382 /* Select old remembered category */ 383 mSelector->selectById (cid == -1 ? 0 : cid); 414 384 415 385 /* Update QTreeWidget with available items */ … … 438 408 mStack->addWidget (aPage); 439 409 440 QIWidgetValidator *wval = new QIWidgetValidator ( pagePath (aPage),410 QIWidgetValidator *wval = new QIWidgetValidator (mSelector->itemTextByIndex (mStack->indexOf (aPage)), 441 411 aPage, this); 442 412 connect (wval, SIGNAL (validityChanged (const QIWidgetValidator*)), … … 446 416 447 417 aPage->setValidator (wval); 448 aPage->setOrderAfter (m TwSelector);418 aPage->setOrderAfter (mSelector->widget()); 449 419 450 420 return aPage; … … 465 435 466 436 /* Parallel Port Page (currently disabled) */ 467 QTreeWidgetItem *parallelItem = 468 findItem (mTwSelector, "#parallelPorts", treeWidget_Link); 469 Assert (parallelItem); 470 if (parallelItem) 471 { 472 parallelItem->setHidden (true); 473 int index = mTwSelector->indexOfTopLevelItem (parallelItem); 437 mSelector->setVisibleById (ParallelId, false); 438 int index = mSelector->idToIndex (ParallelId); 439 if (index > -1) 440 { 474 441 if (mStack->widget (index)) 475 442 mStack->widget (index)->setEnabled (false); … … 487 454 /* Disable the USB controller category if the USB controller is 488 455 * not available (i.e. in VirtualBox OSE) */ 489 QTreeWidgetItem *usbItem = 490 findItem (mTwSelector, "#usb", treeWidget_Link); 491 Assert (usbItem); 492 if (usbItem) 456 mSelector->setVisibleById (USBId, false); 457 int index = mSelector->idToIndex (USBId); 458 if (index > -1) 493 459 { 494 usbItem->setHidden (true);495 int index = mTwSelector->indexOfTopLevelItem (usbItem);496 460 if (mStack->widget (index)) 497 461 mStack->widget (index)->setEnabled (false); … … 505 469 /* Disable the VRDP category if VRDP is 506 470 * not available (i.e. in VirtualBox OSE) */ 507 QTreeWidgetItem *vrdpItem = 508 findItem (mTwSelector, "#vrdp", treeWidget_Link); 509 Assert (vrdpItem); 510 if (vrdpItem) 471 mSelector->setVisibleById (VRDPId, false); 472 int index = mSelector->idToIndex (VRDPId); 473 if (index > -1) 511 474 { 512 vrdpItem->setHidden (true);513 int index = mTwSelector->indexOfTopLevelItem (vrdpItem);514 475 if (mStack->widget (index)) 515 476 mStack->widget (index)->setEnabled (false); -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxSettingsDialog.ui
r10376 r10468 44 44 <number>0</number> 45 45 </property> 46 <item rowspan="3" row="0" column="0" >47 <widget class="QITreeWidget" name="mTwSelector" >48 <property name="sizePolicy" >49 <sizepolicy vsizetype="Expanding" hsizetype="Minimum" >50 <horstretch>0</horstretch>51 <verstretch>0</verstretch>52 </sizepolicy>53 </property>54 <property name="verticalScrollBarPolicy" >55 <enum>Qt::ScrollBarAlwaysOff</enum>56 </property>57 <property name="horizontalScrollBarPolicy" >58 <enum>Qt::ScrollBarAlwaysOff</enum>59 </property>60 <property name="rootIsDecorated" >61 <bool>false</bool>62 </property>63 <property name="uniformRowHeights" >64 <bool>true</bool>65 </property>66 <column>67 <property name="text" >68 <string>Category</string>69 </property>70 </column>71 <column>72 <property name="text" >73 <string>[id]</string>74 </property>75 </column>76 <column>77 <property name="text" >78 <string>[link]</string>79 </property>80 </column>81 </widget>82 </item>83 46 <item row="0" column="1" > 84 47 <widget class="QLabel" name="mLbTitle" > … … 204 167 <header>QILabel.h</header> 205 168 </customwidget> 206 <customwidget>207 <class>QITreeWidget</class>208 <extends>QTreeWidget</extends>209 <header>QITreeWidget.h</header>210 </customwidget>211 169 </customwidgets> 212 170 <resources>
Note:
See TracChangeset
for help on using the changeset viewer.