Changeset 88550 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 15, 2021 4:45:15 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 143840
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r88526 r88550 208 208 bool hasSelectedText() const; 209 209 bool isFindInPageWidgetVisible() const; 210 void findNext(); 211 void findPrevious(); 210 212 211 213 public slots: … … 291 293 bool isFindInPageWidgetVisible() const; 292 294 void toggleFindInPage(bool fTrigger); 295 void findNext(); 296 void findPrevious(); 293 297 294 298 public slots: … … 632 636 return m_pContentViewer->isFindInPageWidgetVisible(); 633 637 return false; 638 } 639 640 void UIHelpBrowserTab::findNext() 641 { 642 if (m_pContentViewer) 643 return m_pContentViewer->sltSelectNextMatch(); 644 } 645 646 void UIHelpBrowserTab::findPrevious() 647 { 648 if (m_pContentViewer) 649 return m_pContentViewer->sltSelectPreviousMatch(); 634 650 } 635 651 … … 704 720 m_pFindInPageAction); 705 721 m_pFindInPageAction->setCheckable(true); 706 m_pFindInPageAction->setShortcut(QKeySequence::Find);707 722 708 723 connect(m_pHomeAction, &QAction::triggered, this, &UIHelpBrowserTab::sltHomeAction); … … 1083 1098 if (pTab) 1084 1099 pTab->sltFindInPageAction(fTrigger); 1100 } 1101 1102 void UIHelpBrowserTabManager::findNext() 1103 { 1104 UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(currentWidget()); 1105 if (pTab) 1106 pTab->findNext(); 1107 } 1108 1109 void UIHelpBrowserTabManager::findPrevious() 1110 { 1111 UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(currentWidget()); 1112 if (pTab) 1113 pTab->findPrevious(); 1085 1114 } 1086 1115 … … 1250 1279 , m_pCopySelectedTextAction(0) 1251 1280 , m_pFindInPageAction(0) 1281 , m_pFindNextInPageAction(0) 1282 , m_pFindPreviousInPageAction(0) 1252 1283 , m_pZoomMenuAction(0) 1253 1284 , m_fModelContentCreated(false) … … 1336 1367 connect(m_pFindInPageAction, &QAction::triggered, 1337 1368 this, &UIHelpBrowserWidget::sltFindInPage); 1338 m_pFindInPageAction->setShortcut(QString("Ctrl+F")); 1369 m_pFindInPageAction->setShortcut(QKeySequence::Find); 1370 1371 m_pFindNextInPageAction = new QAction(this); 1372 m_pFindNextInPageAction->setEnabled(false); 1373 connect(m_pFindNextInPageAction, &QAction::triggered, 1374 this, &UIHelpBrowserWidget::sltFindNextInPage); 1375 m_pFindNextInPageAction->setShortcut(QKeySequence::FindNext); 1376 1377 m_pFindPreviousInPageAction = new QAction(this); 1378 m_pFindPreviousInPageAction->setEnabled(false); 1379 connect(m_pFindPreviousInPageAction, &QAction::triggered, 1380 this, &UIHelpBrowserWidget::sltFindPreviousInPage); 1381 m_pFindPreviousInPageAction->setShortcut(QKeySequence::FindPrevious); 1339 1382 1340 1383 m_pPrintAction = new QAction(this); … … 1505 1548 if(m_pFindInPageAction) 1506 1549 m_pEditMenu->addAction(m_pFindInPageAction); 1550 if(m_pFindNextInPageAction) 1551 m_pEditMenu->addAction(m_pFindNextInPageAction); 1552 if(m_pFindPreviousInPageAction) 1553 m_pEditMenu->addAction(m_pFindPreviousInPageAction); 1507 1554 1508 1555 if (m_pZoomMenuAction) … … 1646 1693 if (m_pFindInPageAction) 1647 1694 m_pFindInPageAction->setText(tr("&Find in Page")); 1695 if (m_pFindNextInPageAction) 1696 m_pFindNextInPageAction->setText(tr("&Find Next")); 1697 if (m_pFindPreviousInPageAction) 1698 m_pFindPreviousInPageAction->setText(tr("&Find Previous")); 1648 1699 } 1649 1700 … … 1701 1752 } 1702 1753 1754 void UIHelpBrowserWidget::sltFindNextInPage() 1755 { 1756 if (m_pTabManager) 1757 m_pTabManager->findNext(); 1758 } 1759 1760 void UIHelpBrowserWidget::sltFindPreviousInPage() 1761 { 1762 if (m_pTabManager) 1763 m_pTabManager->findPrevious(); 1764 } 1765 1703 1766 void UIHelpBrowserWidget::sltCopyAvailableChanged(bool fAvailable) 1704 1767 { … … 1715 1778 m_pFindInPageAction->blockSignals(false); 1716 1779 } 1780 if (m_pFindNextInPageAction) 1781 m_pFindNextInPageAction->setEnabled(fVisible); 1782 1783 if (m_pFindPreviousInPageAction) 1784 m_pFindPreviousInPageAction->setEnabled(fVisible); 1717 1785 } 1718 1786 … … 1984 2052 if (m_pFindInPageAction) 1985 2053 m_pFindInPageAction->setChecked(m_pTabManager->isFindInPageWidgetVisible()); 2054 if (m_pFindNextInPageAction) 2055 m_pFindNextInPageAction->setEnabled(m_pTabManager->isFindInPageWidgetVisible()); 2056 if (m_pFindPreviousInPageAction) 2057 m_pFindPreviousInPageAction->setEnabled(m_pTabManager->isFindInPageWidgetVisible()); 1986 2058 } 1987 2059 } -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h
r88526 r88550 101 101 void sltFindInPage(bool fChecked); 102 102 void sltFindInPageWidgetVisibilityChanged(bool fVisible); 103 void sltFindNextInPage(); 104 void sltFindPreviousInPage(); 103 105 104 106 private: … … 175 177 QAction *m_pCopySelectedTextAction; 176 178 QAction *m_pFindInPageAction; 179 QAction *m_pFindNextInPageAction; 180 QAction *m_pFindPreviousInPageAction; 177 181 UIZoomMenuAction *m_pZoomMenuAction; 178 182 -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.h
r88526 r88550 77 77 void toggleFindInPageWidget(bool fVisible); 78 78 79 public slots: 80 81 void sltSelectPreviousMatch(); 82 void sltSelectNextMatch(); 83 79 84 protected: 80 85 … … 97 102 void sltFindWidgetDrag(const QPoint &delta); 98 103 void sltFindInPageSearchTextChange(const QString &strSearchText); 99 void sltSelectPreviousMatch();100 void sltSelectNextMatch();101 104 void sltToggleFindInPageWidget(bool fVisible); 102 105 void sltCloseFindInPageWidget();
Note:
See TracChangeset
for help on using the changeset viewer.