Changeset 87158 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jan 4, 2021 11:12:01 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r87157 r87158 813 813 src/globals/VBoxUtils.h \ 814 814 src/helpbrowser/UIHelpBrowserDialog.h \ 815 src/helpbrowser/UIHelp BrowserViewer.h \815 src/helpbrowser/UIHelpViewer.h \ 816 816 src/helpbrowser/UIHelpBrowserWidget.h \ 817 817 src/logviewer/UIVMLogPage.h \ … … 994 994 src/globals/UIVirtualBoxEventHandler.cpp \ 995 995 src/globals/UIVirtualBoxClientEventHandler.cpp \ 996 src/helpbrowser/UIHelp BrowserViewer.cpp \996 src/helpbrowser/UIHelpViewer.cpp \ 997 997 src/helpbrowser/UIHelpBrowserWidget.cpp \ 998 998 src/logviewer/UIVMLogViewerFilterPanel.cpp \ … … 1337 1337 src/globals/UIVirtualBoxClientEventHandler.cpp \ 1338 1338 src/helpbrowser/UIHelpBrowserDialog.cpp \ 1339 src/helpbrowser/UIHelp BrowserViewer.cpp \1339 src/helpbrowser/UIHelpViewer.cpp \ 1340 1340 src/helpbrowser/UIHelpBrowserWidget.cpp \ 1341 1341 src/logviewer/UIVMLogPage.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r87157 r87158 58 58 #include "UIActionPool.h" 59 59 #include "UIExtraDataManager.h" 60 #include "UIHelp BrowserViewer.h"60 #include "UIHelpViewer.h" 61 61 #include "UIHelpBrowserWidget.h" 62 62 #include "UIIconPool.h" … … 250 250 QIToolBar *m_pToolBar; 251 251 QComboBox *m_pAddressBar; 252 UIHelp BrowserViewer *m_pContentViewer;252 UIHelpViewer *m_pContentViewer; 253 253 const QHelpEngine* m_pHelpEngine; 254 254 QUrl m_homeUrl; … … 657 657 void UIHelpBrowserTab::prepareWidgets(const QUrl &initialUrl) 658 658 { 659 m_pContentViewer = new UIHelp BrowserViewer(m_pHelpEngine);659 m_pContentViewer = new UIHelpViewer(m_pHelpEngine); 660 660 AssertReturnVoid(m_pContentViewer); 661 661 m_pMainLayout->setContentsMargins(0, 0, 0, 0); … … 664 664 m_pMainLayout->addWidget(m_pContentViewer); 665 665 m_pContentViewer->setOpenExternalLinks(false); 666 connect(m_pContentViewer, &UIHelp BrowserViewer::sourceChanged,666 connect(m_pContentViewer, &UIHelpViewer::sourceChanged, 667 667 this, &UIHelpBrowserTab::sigSourceChanged); 668 connect(m_pContentViewer, &UIHelp BrowserViewer::historyChanged,668 connect(m_pContentViewer, &UIHelpViewer::historyChanged, 669 669 this, &UIHelpBrowserTab::sltHandleHistoryChanged); 670 connect(m_pContentViewer, &UIHelp BrowserViewer::anchorClicked,670 connect(m_pContentViewer, &UIHelpViewer::anchorClicked, 671 671 this, &UIHelpBrowserTab::sltAnchorClicked); 672 connect(m_pContentViewer, &UIHelp BrowserViewer::sigOpenLinkInNewTab,672 connect(m_pContentViewer, &UIHelpViewer::sigOpenLinkInNewTab, 673 673 this, &UIHelpBrowserTab::sigOpenLinkInNewTab); 674 connect(m_pContentViewer, &UIHelp BrowserViewer::sigCloseFindInPageWidget,674 connect(m_pContentViewer, &UIHelpViewer::sigCloseFindInPageWidget, 675 675 this, &UIHelpBrowserTab::sltCloseFindInPageWidget); 676 connect(m_pContentViewer, &UIHelp BrowserViewer::sigFontPointSizeChanged,676 connect(m_pContentViewer, &UIHelpViewer::sigFontPointSizeChanged, 677 677 this, &UIHelpBrowserTab::sigFontPointSizeChanged); 678 connect(m_pContentViewer, &UIHelp BrowserViewer::sigGoBackward,678 connect(m_pContentViewer, &UIHelpViewer::sigGoBackward, 679 679 this, &UIHelpBrowserTab::sltHandleBackwardAction); 680 connect(m_pContentViewer, &UIHelp BrowserViewer::sigGoForward,680 connect(m_pContentViewer, &UIHelpViewer::sigGoForward, 681 681 this, &UIHelpBrowserTab::sltHandleForwardAction); 682 connect(m_pContentViewer, &UIHelp BrowserViewer::sigGoHome,682 connect(m_pContentViewer, &UIHelpViewer::sigGoHome, 683 683 this, &UIHelpBrowserTab::sltHandleHomeAction); 684 connect(m_pContentViewer, &UIHelp BrowserViewer::sigAddBookmark,684 connect(m_pContentViewer, &UIHelpViewer::sigAddBookmark, 685 685 this, &UIHelpBrowserTab::sltHandleAddBookmarkAction); 686 connect(m_pContentViewer, static_cast<void(UIHelp BrowserViewer::*)(const QString&)>(&UIHelpBrowserViewer::highlighted),686 connect(m_pContentViewer, static_cast<void(UIHelpViewer::*)(const QString&)>(&UIHelpViewer::highlighted), 687 687 this, &UIHelpBrowserTab::sigLinkHighlighted); 688 688 -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp
r87157 r87158 58 58 #include "UIActionPool.h" 59 59 #include "UIExtraDataManager.h" 60 #include "UIHelp BrowserViewer.h"60 #include "UIHelpViewer.h" 61 61 #include "UIHelpBrowserWidget.h" 62 62 #include "UIIconPool.h" … … 324 324 325 325 /********************************************************************************************************************************* 326 * UIHelp BrowserViewer implementation. *326 * UIHelpViewer implementation. * 327 327 *********************************************************************************************************************************/ 328 328 329 UIHelp BrowserViewer::UIHelpBrowserViewer(const QHelpEngine *pHelpEngine, QWidget *pParent /* = 0 */)329 UIHelpViewer::UIHelpViewer(const QHelpEngine *pHelpEngine, QWidget *pParent /* = 0 */) 330 330 :QIWithRetranslateUI<QTextBrowser>(pParent) 331 331 , m_pHelpEngine(pHelpEngine) … … 339 339 setUndoRedoEnabled(true); 340 340 connect(m_pFindInPageWidget, &UIFindInPageWidget::sigDragging, 341 this, &UIHelp BrowserViewer::sltHandleFindWidgetDrag);341 this, &UIHelpViewer::sltHandleFindWidgetDrag); 342 342 connect(m_pFindInPageWidget, &UIFindInPageWidget::sigSearchTextChanged, 343 this, &UIHelp BrowserViewer::sltHandleFindInPageSearchTextChange);343 this, &UIHelpViewer::sltHandleFindInPageSearchTextChange); 344 344 345 345 connect(m_pFindInPageWidget, &UIFindInPageWidget::sigSelectPreviousMatch, 346 this, &UIHelp BrowserViewer::sltSelectPreviousMatch);346 this, &UIHelpViewer::sltSelectPreviousMatch); 347 347 connect(m_pFindInPageWidget, &UIFindInPageWidget::sigSelectNextMatch, 348 this, &UIHelp BrowserViewer::sltSelectNextMatch);348 this, &UIHelpViewer::sltSelectNextMatch); 349 349 connect(m_pFindInPageWidget, &UIFindInPageWidget::sigClose, 350 this, &UIHelp BrowserViewer::sigCloseFindInPageWidget);350 this, &UIHelpViewer::sigCloseFindInPageWidget); 351 351 352 352 m_pFindInPageWidget->setVisible(false); … … 354 354 } 355 355 356 QVariant UIHelp BrowserViewer::loadResource(int type, const QUrl &name)356 QVariant UIHelpViewer::loadResource(int type, const QUrl &name) 357 357 { 358 358 if (name.scheme() == "qthelp" && m_pHelpEngine) … … 362 362 } 363 363 364 void UIHelp BrowserViewer::emitHistoryChangedSignal()364 void UIHelpViewer::emitHistoryChangedSignal() 365 365 { 366 366 emit historyChanged(); … … 368 368 } 369 369 370 void UIHelp BrowserViewer::setSource(const QUrl &url)370 void UIHelpViewer::setSource(const QUrl &url) 371 371 { 372 372 QTextBrowser::setSource(url); … … 383 383 } 384 384 385 void UIHelp BrowserViewer::toggleFindInPageWidget(bool fVisible)385 void UIHelpViewer::toggleFindInPageWidget(bool fVisible) 386 386 { 387 387 if (!m_pFindInPageWidget) … … 403 403 } 404 404 405 int UIHelp BrowserViewer::initialFontPointSize() const405 int UIHelpViewer::initialFontPointSize() const 406 406 { 407 407 return m_iInitialFontPointSize; 408 408 } 409 409 410 void UIHelp BrowserViewer::setFont(const QFont &font)410 void UIHelpViewer::setFont(const QFont &font) 411 411 { 412 412 QIWithRetranslateUI<QTextBrowser>::setFont(font); … … 420 420 } 421 421 422 void UIHelp BrowserViewer::contextMenuEvent(QContextMenuEvent *event)422 void UIHelpViewer::contextMenuEvent(QContextMenuEvent *event) 423 423 { 424 424 QMenu pMenu; … … 429 429 430 430 connect(pNavigationActions, &UIContextMenuNavigationAction::sigGoBackward, 431 this, &UIHelp BrowserViewer::sigGoBackward);431 this, &UIHelpViewer::sigGoBackward); 432 432 connect(pNavigationActions, &UIContextMenuNavigationAction::sigGoForward, 433 this, &UIHelp BrowserViewer::sigGoForward);433 this, &UIHelpViewer::sigGoForward); 434 434 connect(pNavigationActions, &UIContextMenuNavigationAction::sigGoHome, 435 this, &UIHelp BrowserViewer::sigGoHome);435 this, &UIHelpViewer::sigGoHome); 436 436 connect(pNavigationActions, &UIContextMenuNavigationAction::sigAddBookmark, 437 this, &UIHelp BrowserViewer::sigAddBookmark);437 this, &UIHelpViewer::sigAddBookmark); 438 438 439 439 QAction *pOpenLinkAction = new QAction(UIHelpBrowserWidget::tr("Open Link")); 440 440 connect(pOpenLinkAction, &QAction::triggered, 441 this, &UIHelp BrowserViewer::sltHandleOpenLink);441 this, &UIHelpViewer::sltHandleOpenLink); 442 442 443 443 QAction *pOpenInNewTabAction = new QAction(UIHelpBrowserWidget::tr("Open Link in New Tab")); 444 444 connect(pOpenInNewTabAction, &QAction::triggered, 445 this, &UIHelp BrowserViewer::sltHandleOpenLinkInNewTab);445 this, &UIHelpViewer::sltHandleOpenLinkInNewTab); 446 446 447 447 QAction *pCopyLink = new QAction(UIHelpBrowserWidget::tr("Copy Link")); 448 448 connect(pCopyLink, &QAction::triggered, 449 this, &UIHelp BrowserViewer::sltHandleCopyLink);449 this, &UIHelpViewer::sltHandleCopyLink); 450 450 451 451 pMenu.addAction(pNavigationActions); … … 471 471 } 472 472 473 void UIHelp BrowserViewer::resizeEvent(QResizeEvent *pEvent)473 void UIHelpViewer::resizeEvent(QResizeEvent *pEvent) 474 474 { 475 475 /* Make sure the widget stays inside the parent during parent resize: */ … … 482 482 } 483 483 484 void UIHelp BrowserViewer::wheelEvent(QWheelEvent *pEvent)484 void UIHelpViewer::wheelEvent(QWheelEvent *pEvent) 485 485 { 486 486 int iPreviousSize = font().pointSize(); … … 498 498 } 499 499 500 void UIHelp BrowserViewer::retranslateUi()501 { 502 } 503 504 void UIHelp BrowserViewer::moveFindWidgetIn(int iMargin)500 void UIHelpViewer::retranslateUi() 501 { 502 } 503 504 void UIHelpViewer::moveFindWidgetIn(int iMargin) 505 505 { 506 506 if (!m_pFindInPageWidget) … … 521 521 } 522 522 523 bool UIHelp BrowserViewer::isRectInside(const QRect &rect, int iMargin) const523 bool UIHelpViewer::isRectInside(const QRect &rect, int iMargin) const 524 524 { 525 525 if (rect.left() < iMargin || rect.top() < iMargin) … … 530 530 } 531 531 532 void UIHelp BrowserViewer::findAllMatches(const QString &searchString)532 void UIHelpViewer::findAllMatches(const QString &searchString) 533 533 { 534 534 QTextDocument *pDocument = document(); … … 552 552 } 553 553 554 void UIHelp BrowserViewer::highlightFinds(int iSearchTermLength)554 void UIHelpViewer::highlightFinds(int iSearchTermLength) 555 555 { 556 556 QTextDocument* pDocument = document(); … … 576 576 } 577 577 578 void UIHelp BrowserViewer::selectMatch(int iMatchIndex, int iSearchStringLength)578 void UIHelpViewer::selectMatch(int iMatchIndex, int iSearchStringLength) 579 579 { 580 580 QTextCursor cursor = textCursor(); … … 587 587 } 588 588 589 void UIHelp BrowserViewer::sltHandleOpenLinkInNewTab()589 void UIHelpViewer::sltHandleOpenLinkInNewTab() 590 590 { 591 591 QAction *pSender = qobject_cast<QAction*>(sender()); … … 597 597 } 598 598 599 void UIHelp BrowserViewer::sltHandleOpenLink()599 void UIHelpViewer::sltHandleOpenLink() 600 600 { 601 601 QAction *pSender = qobject_cast<QAction*>(sender()); … … 607 607 } 608 608 609 void UIHelp BrowserViewer::sltHandleCopyLink()609 void UIHelpViewer::sltHandleCopyLink() 610 610 { 611 611 QAction *pSender = qobject_cast<QAction*>(sender()); … … 621 621 } 622 622 623 void UIHelp BrowserViewer::sltHandleFindWidgetDrag(const QPoint &delta)623 void UIHelpViewer::sltHandleFindWidgetDrag(const QPoint &delta) 624 624 { 625 625 if (!m_pFindInPageWidget) … … 635 635 } 636 636 637 void UIHelp BrowserViewer::sltHandleFindInPageSearchTextChange(const QString &strSearchText)637 void UIHelpViewer::sltHandleFindInPageSearchTextChange(const QString &strSearchText) 638 638 { 639 639 m_iSearchTermLength = strSearchText.length(); … … 646 646 } 647 647 648 void UIHelp BrowserViewer::sltSelectPreviousMatch()648 void UIHelpViewer::sltSelectPreviousMatch() 649 649 { 650 650 m_iSelectedMatchIndex = m_iSelectedMatchIndex <= 0 ? m_matchedCursorPosition.size() - 1 : (m_iSelectedMatchIndex - 1); … … 654 654 } 655 655 656 void UIHelp BrowserViewer::sltSelectNextMatch()656 void UIHelpViewer::sltSelectNextMatch() 657 657 { 658 658 m_iSelectedMatchIndex = m_iSelectedMatchIndex >= m_matchedCursorPosition.size() - 1 ? 0 : (m_iSelectedMatchIndex + 1); … … 662 662 } 663 663 664 #include "UIHelp BrowserViewer.moc"664 #include "UIHelpViewer.moc" 665 665 666 666 #endif /*#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))*/ -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.h
r87157 r87158 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_helpbrowser_UIHelp BrowserViewer_h19 #define FEQT_INCLUDED_SRC_helpbrowser_UIHelp BrowserViewer_h18 #ifndef FEQT_INCLUDED_SRC_helpbrowser_UIHelpViewer_h 19 #define FEQT_INCLUDED_SRC_helpbrowser_UIHelpViewer_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 60 60 61 61 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) 62 class UIHelp BrowserViewer : public QIWithRetranslateUI<QTextBrowser>62 class UIHelpViewer : public QIWithRetranslateUI<QTextBrowser> 63 63 { 64 64 Q_OBJECT; … … 76 76 public: 77 77 78 UIHelp BrowserViewer(const QHelpEngine *pHelpEngine, QWidget *pParent = 0);78 UIHelpViewer(const QHelpEngine *pHelpEngine, QWidget *pParent = 0); 79 79 virtual QVariant loadResource(int type, const QUrl &name) /* override */; 80 80 void emitHistoryChangedSignal(); … … 124 124 125 125 #endif /* #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) */ 126 #endif /* !FEQT_INCLUDED_SRC_helpbrowser_UIHelp BrowserViewer_h */126 #endif /* !FEQT_INCLUDED_SRC_helpbrowser_UIHelpViewer_h */
Note:
See TracChangeset
for help on using the changeset viewer.