- Timestamp:
- Jan 11, 2021 5:31:52 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r87215 r87217 189 189 void sigSourceChanged(const QUrl &url); 190 190 void sigTitleUpdate(const QString &strTitle); 191 void sigOpenLinkInNewTab(const QUrl &url );191 void sigOpenLinkInNewTab(const QUrl &url, bool fBackground); 192 192 void sigAddBookmark(const QUrl &url, const QString &strTitle); 193 193 void sigFontPointSizeChanged(int iFontPointSize); … … 292 292 293 293 void sltHandletabTitleChange(const QString &strTitle); 294 void sltHandleOpenLinkInNewTab(const QUrl &url );294 void sltHandleOpenLinkInNewTab(const QUrl &url, bool fBackground); 295 295 void sltHandleTabClose(int iTabIndex); 296 296 void sltHandleContextMenuTabClose(); … … 304 304 void prepare(); 305 305 void clearAndDeleteTabs(); 306 void addNewTab(const QUrl &initialUrl );306 void addNewTab(const QUrl &initialUrl, bool fBackground); 307 307 /** Check if lists of tab url/title has changed. if so emit a signal. */ 308 308 void updateTabUrlTitleList(); … … 841 841 } 842 842 843 void UIHelpBrowserTabManager::addNewTab(const QUrl &initialUrl )843 void UIHelpBrowserTabManager::addNewTab(const QUrl &initialUrl, bool fBackground) 844 844 { 845 845 UIHelpBrowserTab *pTabWidget = new UIHelpBrowserTab(m_pHelpEngine, m_homeUrl, initialUrl); … … 860 860 this, &UIHelpBrowserTabManager::sigLinkHighlighted); 861 861 862 if ( m_fSwitchToNewTab)862 if (!fBackground) 863 863 setCurrentIndex(index); 864 864 … … 905 905 /* Start with a single tab showing the home URL: */ 906 906 if (m_savedUrlList.isEmpty()) 907 addNewTab(QUrl() );907 addNewTab(QUrl(), false); 908 908 /* Start with saved tab(s): */ 909 909 else 910 910 for (int i = 0; i < m_savedUrlList.size(); ++i) 911 addNewTab(m_savedUrlList[i] );911 addNewTab(m_savedUrlList[i], false); 912 912 updateTabUrlTitleList(); 913 913 } … … 931 931 } 932 932 else 933 addNewTab(url );933 addNewTab(url, false); 934 934 935 935 updateTabUrlTitleList(); … … 1052 1052 } 1053 1053 1054 void UIHelpBrowserTabManager::sltHandleOpenLinkInNewTab(const QUrl &url )1054 void UIHelpBrowserTabManager::sltHandleOpenLinkInNewTab(const QUrl &url, bool fBackground) 1055 1055 { 1056 1056 if (url.isValid()) 1057 addNewTab(url );1057 addNewTab(url, fBackground); 1058 1058 updateTabUrlTitleList(); 1059 1059 } -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp
r87211 r87217 520 520 } 521 521 522 void UIHelpViewer::mousePressEvent(QMouseEvent *pEvent) 523 { 524 QString strAnchor = anchorAt(pEvent->pos()); 525 if (!strAnchor.isEmpty()) 526 { 527 QString strLink = source().resolved(strAnchor).toString(); 528 emit sigOpenLinkInNewTab(strLink, true); 529 } 530 QIWithRetranslateUI<QTextBrowser>::mousePressEvent(pEvent); 531 } 532 522 533 void UIHelpViewer::retranslateUi() 523 534 { … … 616 627 QUrl url = pSender->data().toUrl(); 617 628 if (url.isValid()) 618 emit sigOpenLinkInNewTab(url );629 emit sigOpenLinkInNewTab(url, false); 619 630 } 620 631 -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.h
r87211 r87217 39 39 signals: 40 40 41 void sigOpenLinkInNewTab(const QUrl &url );41 void sigOpenLinkInNewTab(const QUrl &url, bool fBackground); 42 42 void sigCloseFindInPageWidget(); 43 43 void sigFontPointSizeChanged(int iFontPointSize); … … 66 66 virtual void resizeEvent(QResizeEvent *pEvent) /* override */; 67 67 virtual void wheelEvent(QWheelEvent *pEvent) /* override */; 68 virtual void mousePressEvent(QMouseEvent *pEvent) /* override */; 68 69 69 70 private slots:
Note:
See TracChangeset
for help on using the changeset viewer.