Changeset 86907 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 18, 2020 10:41:44 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141387
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r86233 r86907 118 118 { 119 119 const int iIndex = m_pages.value(cId); 120 120 setHelpButtonHelpTag(iIndex); 121 121 #ifdef VBOX_WS_MAC 122 122 /* If index is within the stored size list bounds: */ … … 426 426 } 427 427 428 void UISettingsDialog::enableHelpButton() 429 { 430 if (m_pButtonBox) 431 { 432 QPushButton *pHelpButton = m_pButtonBox->addButton(QDialogButtonBox::Help); 433 if (pHelpButton) 434 connect(pHelpButton, &QAbstractButton::pressed, 435 &(msgCenter()), &UIMessageCenter::sltHandleDialogHelpButtonPress); 436 } 437 } 438 439 void UISettingsDialog::setHelpButtonHelpTag(int iPageType) 440 { 441 if (m_pButtonBox && m_pButtonBox->button(QDialogButtonBox::Help)) 442 m_pButtonBox->button(QDialogButtonBox::Help)->setProperty("helptag", m_pageHelpTags[iPageType]); 443 } 444 445 void UISettingsDialog::addPageHelpTag(int iPageType, const QString &strHelpTag) 446 { 447 m_pageHelpTags[iPageType] = strHelpTag; 448 } 449 428 450 void UISettingsDialog::revalidate(UIPageValidator *pValidator) 429 451 { … … 667 689 { 668 690 m_pButtonBox->button(QDialogButtonBox::Ok)->setDefault(true); 669 connect(m_pButtonBox, &QIDialogButtonBox::helpRequested,670 &msgCenter(), &UIMessageCenter::sltShowHelpHelpDialog);671 691 672 692 /* Create status-bar: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
r86081 r86907 136 136 virtual void recorrelate(UISettingsPage *pSettingsPage) { Q_UNUSED(pSettingsPage); } 137 137 138 /** Inserts the standard help button to the button box of the dialog and make a connection to the appropirate slot. */ 139 void enableHelpButton(); 140 /** Set/change/reset the help tag of the help buttons help tag. Possibly used as tabs are changed. Searches the map 141 * m_pageHelpTags for the help tag for the page with @iPageType (GlobalSettingsPageType or MachineSettingsPageType) */ 142 void setHelpButtonHelpTag(int iPageType); 143 /** Inserts an item to the map m_pageHelpTags. */ 144 void addPageHelpTag(int iPageType, const QString &strHelpTag); 145 138 146 /** Validates data correctness using certain @a pValidator. */ 139 147 void revalidate(UIPageValidator *pValidator); … … 203 211 /** Holds the map of settings pages. */ 204 212 QMap<int, int> m_pages; 213 /** Stores the help tag per page. Key is the page type (either GlobalSettingsPageType or MachineSettingsPageType) 214 * and value is the help tag. Used in context sensitive help: */ 215 QMap<int, QString> m_pageHelpTags; 205 216 206 217 #ifdef VBOX_WS_MAC -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r85711 r86907 703 703 addItem(":/machine_32px.png", ":/machine_24px.png", ":/machine_16px.png", 704 704 iPageIndex, "#general", pSettingsPage); 705 addPageHelpTag(iPageIndex, "generalsettings"); 705 706 break; 706 707 } … … 711 712 addItem(":/chipset_32px.png", ":/chipset_24px.png", ":/chipset_16px.png", 712 713 iPageIndex, "#system", pSettingsPage); 714 addPageHelpTag(iPageIndex, "settings-system"); 713 715 break; 714 716 } … … 831 833 else 832 834 m_pSelector->selectById(MachineSettingsPageType_General); 835 836 /* Enabled the 'Help' button of the button box for the context senstive help: */ 837 enableHelpButton(); 833 838 } 834 839 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UIWizard.cpp
r86906 r86907 51 51 /* Make sure custom buttons shown even if final page is first to show: */ 52 52 sltCurrentIdChanged(startId()); 53 54 /* If help button is enabled by the subclass, connect it to proper slot: */55 if (button(QWizard::HelpButton))56 connect(button(QWizard::HelpButton), &QAbstractButton::pressed,57 &(msgCenter()), &UIMessageCenter::sltHandleDialogHelpButtonPress);58 53 } 59 54 … … 273 268 #endif 274 269 270 void UIWizard::enableHelpButton(const QString &strHelpTag /* = QString() */) 271 { 272 setOptions(options() | QWizard::HaveHelpButton); 273 if (button(QWizard::HelpButton)) 274 { 275 button(QWizard::HelpButton)->setProperty("helptag", strHelpTag); 276 connect(button(QWizard::HelpButton), &QAbstractButton::pressed, 277 &(msgCenter()), &UIMessageCenter::sltHandleDialogHelpButtonPress); 278 } 279 } 280 281 void UIWizard::setHelpButtonHelpTag(const QString &strHelpTag /* = QString() */) 282 { 283 if (button(QWizard::HelpButton)) 284 button(QWizard::HelpButton)->setProperty("helptag", strHelpTag); 285 } 286 275 287 void UIWizard::sltCurrentIdChanged(int iId) 276 288 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UIWizard.h
r82968 r86907 78 78 void assignBackground(const QString &strBackground); 79 79 #endif 80 /** Inserts the standard help button to the button box of the wizard. Optional @param strHelpTag 81 * is set as property. This is used for context sensitive help. */ 82 void enableHelpButton(const QString &strHelpTag = QString()); 83 void setHelpButtonHelpTag(const QString &strHelpTag = QString()); 80 84 81 85 protected slots: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r86906 r86907 57 57 , m_iUSBCount(0) 58 58 { 59 setOptions(options() | QWizard::HaveHelpButton);60 if (button(QWizard::HelpButton))61 button(QWizard::HelpButton)->setProperty("helptag", "gui-createvm");62 59 #ifndef VBOX_WS_MAC 63 60 /* Assign watermark: */ … … 97 94 } 98 95 } 96 enableHelpButton("gui-createvm"); 99 97 /* Call to base-class: */ 100 98 UIWizard::prepare();
Note:
See TracChangeset
for help on using the changeset viewer.