Changeset 51394 in vbox
- Timestamp:
- May 26, 2014 1:39:05 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 93915
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r51345 r51394 316 316 UISettingsSerializer* UISettingsSerializer::m_pInstance = 0; 317 317 318 UISettingsDialogGlobal::UISettingsDialogGlobal(QWidget *pParent) 318 UISettingsDialogGlobal::UISettingsDialogGlobal(QWidget *pParent, 319 const QString &strCategory /* = QString() */, 320 const QString &strControl /* = QString() */) 319 321 : UISettingsDialog(pParent) 320 322 { … … 418 420 retranslateUi(); 419 421 420 /* Choose first item by default: */ 421 m_pSelector->selectById(GlobalSettingsPageType_General); 422 /* Setup settings window: */ 423 if (!strCategory.isNull()) 424 { 425 m_pSelector->selectByLink(strCategory); 426 /* Search for a widget with the given name: */ 427 if (!strControl.isNull()) 428 { 429 printf("Looking for widget %s..\n", strControl.toAscii().constData()); 430 if (QWidget *pWidget = m_pStack->findChild<QWidget*>(strControl)) 431 { 432 printf("Widget %s found!\n", strControl.toAscii().constData()); 433 QList<QWidget*> parents; 434 QWidget *pParentWidget = pWidget; 435 while ((pParentWidget = pParentWidget->parentWidget()) != 0) 436 { 437 if (QTabWidget *pTabWidget = qobject_cast<QTabWidget*>(pParentWidget)) 438 { 439 /* The tab contents widget is two steps down 440 * (QTabWidget -> QStackedWidget -> QWidget): */ 441 QWidget *pTabPage = parents[parents.count() - 1]; 442 if (pTabPage) 443 pTabPage = parents[parents.count() - 2]; 444 if (pTabPage) 445 pTabWidget->setCurrentWidget(pTabPage); 446 } 447 parents.append(pParentWidget); 448 } 449 pWidget->setFocus(); 450 } 451 } 452 } 453 /* First item as default: */ 454 else 455 m_pSelector->selectById(GlobalSettingsPageType_General); 422 456 } 423 457 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h
r50906 r51394 36 36 public: 37 37 38 UISettingsDialogGlobal(QWidget *pParent); 38 UISettingsDialogGlobal(QWidget *pParent, 39 const QString &strCategory = QString(), 40 const QString &strControl = QString()); 39 41 ~UISettingsDialogGlobal(); 40 42
Note:
See TracChangeset
for help on using the changeset viewer.