- Timestamp:
- Sep 23, 2016 3:27:40 PM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r63952 r63978 412 412 src/settings/UISettingsDialogSpecific.h \ 413 413 src/settings/UISettingsPage.h \ 414 src/settings/UISettingsSelector.h \ 414 415 src/settings/UISettingsSerializer.h \ 415 src/settings/VBoxSettingsSelector.h \416 416 src/settings/global/UIGlobalSettingsExtension.h \ 417 417 src/settings/global/UIGlobalSettingsGeneral.h \ … … 717 717 src/settings/UISettingsDialogSpecific.cpp \ 718 718 src/settings/UISettingsPage.cpp \ 719 src/settings/UISettingsSelector.cpp \ 719 720 src/settings/UISettingsSerializer.cpp \ 720 src/settings/VBoxSettingsSelector.cpp \721 721 src/settings/global/UIGlobalSettingsExtension.cpp \ 722 722 src/settings/global/UIGlobalSettingsGeneral.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/precomp.h
r63952 r63978 656 656 #include "VBoxMediaComboBox.h" 657 657 #include "VBoxOSTypeSelectorButton.h" 658 #include " VBoxSettingsSelector.h"658 #include "UISettingsSelector.h" 659 659 #include "VBoxSnapshotDetailsDlg.h" 660 660 #include "UISnapshotPane.h" -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r63567 r63978 34 34 # include "UIPopupCenter.h" 35 35 # include "QIWidgetValidator.h" 36 # include " VBoxSettingsSelector.h"36 # include "UISettingsSelector.h" 37 37 # include "UIModalWindowManager.h" 38 38 # include "UISettingsSerializer.h" … … 91 91 m_pLbTitle->hide(); 92 92 /* Create modern tool-bar selector: */ 93 m_pSelector = new VBoxSettingsToolBarSelector(this);93 m_pSelector = new UISettingsSelectorToolBar(this); 94 94 static_cast<UIToolBar*>(m_pSelector->widget())->enableMacToolbar(); 95 95 addToolBar(qobject_cast<QToolBar*>(m_pSelector->widget())); … … 99 99 #else 100 100 /* Create classical tree-view selector: */ 101 m_pSelector = new VBoxSettingsTreeViewSelector(this);101 m_pSelector = new UISettingsSelectorTreeView(this); 102 102 pMainLayout->addWidget(m_pSelector->widget(), 0, 0, 2, 1); 103 103 m_pSelector->widget()->setFocus(); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
r62493 r63978 31 31 class QTimer; 32 32 class UIWarningPane; 33 class VBoxSettingsSelector;33 class UISettingsSelector; 34 34 class UISettingsPage; 35 35 class UISettingsSerializer; … … 112 112 113 113 /* Protected variables: */ 114 VBoxSettingsSelector *m_pSelector;114 UISettingsSelector *m_pSelector; 115 115 QStackedWidget *m_pStack; 116 116 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r62493 r63978 28 28 # include "UIExtraDataManager.h" 29 29 # include "QIWidgetValidator.h" 30 # include " VBoxSettingsSelector.h"30 # include "UISettingsSelector.h" 31 31 # include "UIVirtualBoxEventHandler.h" 32 32 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSelector.cpp
r63977 r63978 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - VBoxSettingsSelector class implementation.3 * VBox Qt GUI - UISettingsSelector class implementation. 4 4 */ 5 5 … … 27 27 28 28 /* Local includes */ 29 # include " VBoxSettingsSelector.h"29 # include "UISettingsSelector.h" 30 30 # include "UISettingsPage.h" 31 31 # include "UIToolBar.h" … … 75 75 }; 76 76 77 VBoxSettingsSelector::VBoxSettingsSelector (QWidget *aParent /* = NULL */)77 UISettingsSelector::UISettingsSelector (QWidget *aParent /* = NULL */) 78 78 :QObject (aParent) 79 79 { 80 80 } 81 81 82 VBoxSettingsSelector::~VBoxSettingsSelector()82 UISettingsSelector::~UISettingsSelector() 83 83 { 84 84 qDeleteAll (mItemList); … … 86 86 } 87 87 88 void VBoxSettingsSelector::setItemText (int aId, const QString &aText)88 void UISettingsSelector::setItemText (int aId, const QString &aText) 89 89 { 90 90 if (SelectorItem *item = findItem (aId)) … … 92 92 } 93 93 94 QString VBoxSettingsSelector::itemTextByPage (UISettingsPage *aPage) const94 QString UISettingsSelector::itemTextByPage (UISettingsPage *aPage) const 95 95 { 96 96 QString text; … … 100 100 } 101 101 102 QWidget * VBoxSettingsSelector::idToPage (int aId) const102 QWidget *UISettingsSelector::idToPage (int aId) const 103 103 { 104 104 UISettingsPage *page = NULL; … … 108 108 } 109 109 110 QList<UISettingsPage*> VBoxSettingsSelector::settingPages() const110 QList<UISettingsPage*> UISettingsSelector::settingPages() const 111 111 { 112 112 QList<UISettingsPage*> list; … … 117 117 } 118 118 119 QList<QWidget*> VBoxSettingsSelector::rootPages() const119 QList<QWidget*> UISettingsSelector::rootPages() const 120 120 { 121 121 QList<QWidget*> list; … … 127 127 128 128 129 SelectorItem * VBoxSettingsSelector::findItem (int aId) const129 SelectorItem *UISettingsSelector::findItem (int aId) const 130 130 { 131 131 SelectorItem *result = NULL; … … 139 139 } 140 140 141 SelectorItem * VBoxSettingsSelector::findItemByLink (const QString &aLink) const141 SelectorItem *UISettingsSelector::findItemByLink (const QString &aLink) const 142 142 { 143 143 SelectorItem *result = NULL; … … 151 151 } 152 152 153 SelectorItem * VBoxSettingsSelector::findItemByPage (UISettingsPage* aPage) const153 SelectorItem *UISettingsSelector::findItemByPage (UISettingsPage* aPage) const 154 154 { 155 155 SelectorItem *result = NULL; … … 163 163 } 164 164 165 /* VBoxSettingsTreeViewSelector*/165 /* UISettingsSelectorTreeView */ 166 166 167 167 /* Returns the path to the item in the form of 'grandparent > parent > item' … … 182 182 } 183 183 184 VBoxSettingsTreeViewSelector::VBoxSettingsTreeViewSelector(QWidget *aParent /* = NULL */)185 : VBoxSettingsSelector (aParent)184 UISettingsSelectorTreeView::UISettingsSelectorTreeView (QWidget *aParent /* = NULL */) 185 :UISettingsSelector (aParent) 186 186 { 187 187 mTwSelector = new QITreeWidget (aParent); … … 212 212 } 213 213 214 QWidget * VBoxSettingsTreeViewSelector::widget() const214 QWidget *UISettingsSelectorTreeView::widget() const 215 215 { 216 216 return mTwSelector; 217 217 } 218 218 219 QWidget * VBoxSettingsTreeViewSelector::addItem (const QString & /* strBigIcon */,219 QWidget *UISettingsSelectorTreeView::addItem (const QString & /* strBigIcon */, 220 220 const QString &strMediumIcon , 221 221 const QString & /* strSmallIcon */, … … 244 244 } 245 245 246 void VBoxSettingsTreeViewSelector::setItemText (int aId, const QString &aText)247 { 248 VBoxSettingsSelector::setItemText (aId, aText);246 void UISettingsSelectorTreeView::setItemText (int aId, const QString &aText) 247 { 248 UISettingsSelector::setItemText (aId, aText); 249 249 QTreeWidgetItem *item = findItem (mTwSelector, idToString (aId), treeWidget_Id); 250 250 if (item) … … 252 252 } 253 253 254 QString VBoxSettingsTreeViewSelector::itemText (int aId) const254 QString UISettingsSelectorTreeView::itemText (int aId) const 255 255 { 256 256 return pagePath (idToString (aId)); 257 257 } 258 258 259 int VBoxSettingsTreeViewSelector::currentId () const259 int UISettingsSelectorTreeView::currentId () const 260 260 { 261 261 int id = -1; … … 266 266 } 267 267 268 int VBoxSettingsTreeViewSelector::linkToId (const QString &aLink) const268 int UISettingsSelectorTreeView::linkToId (const QString &aLink) const 269 269 { 270 270 int id = -1; … … 276 276 277 277 278 void VBoxSettingsTreeViewSelector::selectById (int aId)278 void UISettingsSelectorTreeView::selectById (int aId) 279 279 { 280 280 QTreeWidgetItem *item = findItem (mTwSelector, idToString (aId), treeWidget_Id); … … 283 283 } 284 284 285 void VBoxSettingsTreeViewSelector::setVisibleById (int aId, bool aShow)285 void UISettingsSelectorTreeView::setVisibleById (int aId, bool aShow) 286 286 { 287 287 QTreeWidgetItem *item = findItem (mTwSelector, idToString (aId), treeWidget_Id); … … 290 290 } 291 291 292 void VBoxSettingsTreeViewSelector::polish()292 void UISettingsSelectorTreeView::polish() 293 293 { 294 294 /* Get recommended size hint: */ … … 315 315 } 316 316 317 void VBoxSettingsTreeViewSelector::settingsGroupChanged (QTreeWidgetItem *aItem,317 void UISettingsSelectorTreeView::settingsGroupChanged (QTreeWidgetItem *aItem, 318 318 QTreeWidgetItem * /* aPrevItem */) 319 319 { … … 326 326 } 327 327 328 void VBoxSettingsTreeViewSelector::clear()328 void UISettingsSelectorTreeView::clear() 329 329 { 330 330 mTwSelector->clear(); … … 335 335 * details. 336 336 */ 337 QString VBoxSettingsTreeViewSelector::pagePath (const QString &aMatch) const337 QString UISettingsSelectorTreeView::pagePath (const QString &aMatch) const 338 338 { 339 339 QTreeWidgetItem *li = … … 346 346 /* Returns first item of 'aView' matching required 'aMatch' value 347 347 * searching the 'aColumn' column. */ 348 QTreeWidgetItem* VBoxSettingsTreeViewSelector::findItem (QTreeWidget *aView,348 QTreeWidgetItem* UISettingsSelectorTreeView::findItem (QTreeWidget *aView, 349 349 const QString &aMatch, 350 350 int aColumn) const … … 356 356 } 357 357 358 QString VBoxSettingsTreeViewSelector::idToString (int aId) const358 QString UISettingsSelectorTreeView::idToString (int aId) const 359 359 { 360 360 return QString ("%1").arg (aId, 2, 10, QLatin1Char ('0')); 361 361 } 362 362 363 /* VBoxSettingsToolBarSelector */363 /* UISettingsSelectorToolBar */ 364 364 365 365 … … 386 386 }; 387 387 388 VBoxSettingsToolBarSelector::VBoxSettingsToolBarSelector (QWidget *aParent /* = NULL */)389 : VBoxSettingsSelector (aParent)388 UISettingsSelectorToolBar::UISettingsSelectorToolBar (QWidget *aParent /* = NULL */) 389 : UISettingsSelector (aParent) 390 390 { 391 391 /* Init the toolbar */ … … 403 403 } 404 404 405 VBoxSettingsToolBarSelector::~VBoxSettingsToolBarSelector()405 UISettingsSelectorToolBar::~UISettingsSelectorToolBar() 406 406 { 407 407 delete mTbSelector; 408 408 } 409 409 410 QWidget * VBoxSettingsToolBarSelector::widget() const410 QWidget *UISettingsSelectorToolBar::widget() const 411 411 { 412 412 return mTbSelector; 413 413 } 414 414 415 QWidget * VBoxSettingsToolBarSelector::addItem (const QString &strBigIcon,415 QWidget *UISettingsSelectorToolBar::addItem (const QString &strBigIcon, 416 416 const QString & /* strMediumIcon */, 417 417 const QString &strSmallIcon, … … 465 465 } 466 466 467 void VBoxSettingsToolBarSelector::setItemText (int aId, const QString &aText)467 void UISettingsSelectorToolBar::setItemText (int aId, const QString &aText) 468 468 { 469 469 if (SelectorActionItem *item = findActionItem (aId)) … … 484 484 } 485 485 486 QString VBoxSettingsToolBarSelector::itemText (int aId) const486 QString UISettingsSelectorToolBar::itemText (int aId) const 487 487 { 488 488 QString result; … … 492 492 } 493 493 494 int VBoxSettingsToolBarSelector::currentId () const494 int UISettingsSelectorToolBar::currentId () const 495 495 { 496 496 SelectorActionItem *action = findActionItemByAction (mActionGroup->checkedAction()); … … 501 501 } 502 502 503 int VBoxSettingsToolBarSelector::linkToId (const QString &aLink) const503 int UISettingsSelectorToolBar::linkToId (const QString &aLink) const 504 504 { 505 505 int id = -1; 506 SelectorItem *item = VBoxSettingsSelector::findItemByLink (aLink);506 SelectorItem *item = UISettingsSelector::findItemByLink (aLink); 507 507 if (item) 508 508 id = item->id(); … … 510 510 } 511 511 512 QWidget * VBoxSettingsToolBarSelector::idToPage (int aId) const512 QWidget *UISettingsSelectorToolBar::idToPage (int aId) const 513 513 { 514 514 QWidget *page = NULL; … … 522 522 } 523 523 524 QWidget * VBoxSettingsToolBarSelector::rootPage (int aId) const524 QWidget *UISettingsSelectorToolBar::rootPage (int aId) const 525 525 { 526 526 QWidget *page = NULL; … … 537 537 } 538 538 539 void VBoxSettingsToolBarSelector::selectById (int aId)539 void UISettingsSelectorToolBar::selectById (int aId) 540 540 { 541 541 if (SelectorActionItem *item = findActionItem (aId)) … … 558 558 559 559 560 void VBoxSettingsToolBarSelector::setVisibleById (int aId, bool aShow)560 void UISettingsSelectorToolBar::setVisibleById (int aId, bool aShow) 561 561 { 562 562 SelectorActionItem *item = findActionItem (aId); … … 585 585 } 586 586 587 void VBoxSettingsToolBarSelector::clear()587 void UISettingsSelectorToolBar::clear() 588 588 { 589 589 QList<QAction*> list = mActionGroup->actions(); … … 592 592 } 593 593 594 int VBoxSettingsToolBarSelector::minWidth() const594 int UISettingsSelectorToolBar::minWidth() const 595 595 { 596 596 return mTbSelector->sizeHint().width() + 2 * 10; 597 597 } 598 598 599 void VBoxSettingsToolBarSelector::settingsGroupChanged (QAction *aAction)599 void UISettingsSelectorToolBar::settingsGroupChanged (QAction *aAction) 600 600 { 601 601 SelectorActionItem *item = findActionItemByAction (aAction); … … 621 621 } 622 622 623 void VBoxSettingsToolBarSelector::settingsGroupChanged (int aIndex)623 void UISettingsSelectorToolBar::settingsGroupChanged (int aIndex) 624 624 { 625 625 SelectorActionItem *item = findActionItemByTabWidget (qobject_cast<QTabWidget*> (sender()), aIndex); … … 639 639 } 640 640 641 SelectorActionItem* VBoxSettingsToolBarSelector::findActionItem (int aId) const642 { 643 return static_cast<SelectorActionItem*> ( VBoxSettingsSelector::findItem (aId));644 } 645 646 SelectorActionItem * VBoxSettingsToolBarSelector::findActionItemByTabWidget (QTabWidget* aTabWidget, int aIndex) const641 SelectorActionItem* UISettingsSelectorToolBar::findActionItem (int aId) const 642 { 643 return static_cast<SelectorActionItem*> (UISettingsSelector::findItem (aId)); 644 } 645 646 SelectorActionItem *UISettingsSelectorToolBar::findActionItemByTabWidget (QTabWidget* aTabWidget, int aIndex) const 647 647 { 648 648 SelectorActionItem *result = NULL; … … 660 660 } 661 661 662 QList<QWidget*> VBoxSettingsToolBarSelector::rootPages() const662 QList<QWidget*> UISettingsSelectorToolBar::rootPages() const 663 663 { 664 664 QList<QWidget*> list; … … 675 675 } 676 676 677 SelectorActionItem * VBoxSettingsToolBarSelector::findActionItemByAction (QAction *aAction) const677 SelectorActionItem *UISettingsSelectorToolBar::findActionItemByAction (QAction *aAction) const 678 678 { 679 679 SelectorActionItem *result = NULL; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSelector.h
r63977 r63978 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - VBoxSettingsSelector class declaration.3 * VBox Qt GUI - UISettingsSelector class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __ VBoxSettingsSelector_h__19 #define __ VBoxSettingsSelector_h__18 #ifndef __UISettingsSelector_h__ 19 #define __UISettingsSelector_h__ 20 20 21 21 /* Qt includes */ … … 36 36 class QTabWidget; 37 37 38 class VBoxSettingsSelector: public QObject38 class UISettingsSelector: public QObject 39 39 { 40 40 Q_OBJECT; … … 42 42 public: 43 43 44 VBoxSettingsSelector (QWidget *aParent = NULL);45 ~ VBoxSettingsSelector();44 UISettingsSelector (QWidget *aParent = NULL); 45 ~UISettingsSelector(); 46 46 47 47 virtual QWidget *widget() const = 0; … … 87 87 }; 88 88 89 class VBoxSettingsTreeViewSelector: public VBoxSettingsSelector89 class UISettingsSelectorTreeView: public UISettingsSelector 90 90 { 91 91 Q_OBJECT; … … 93 93 public: 94 94 95 VBoxSettingsTreeViewSelector(QWidget *aParent = NULL);95 UISettingsSelectorTreeView (QWidget *aParent = NULL); 96 96 97 97 virtual QWidget *widget() const; … … 127 127 }; 128 128 129 class VBoxSettingsToolBarSelector: public VBoxSettingsSelector129 class UISettingsSelectorToolBar: public UISettingsSelector 130 130 { 131 131 Q_OBJECT; … … 133 133 public: 134 134 135 VBoxSettingsToolBarSelector (QWidget *aParent = NULL);136 ~ VBoxSettingsToolBarSelector();135 UISettingsSelectorToolBar (QWidget *aParent = NULL); 136 ~UISettingsSelectorToolBar(); 137 137 138 138 virtual QWidget *widget() const; … … 174 174 }; 175 175 176 #endif /* __ VBoxSettingsSelector_h__ */176 #endif /* __UISettingsSelector_h__ */ 177 177
Note:
See TracChangeset
for help on using the changeset viewer.