Changeset 86776 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 30, 2020 6:29:07 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r86721 r86776 3227 3227 3228 3228 UIMessageCenter::UIMessageCenter() 3229 : m_pHelpBrowserDialog(0) 3229 3230 { 3230 3231 /* Assign instance: */ … … 3397 3398 void UIMessageCenter::showHelpBrowser(const QString strHelpFilePath, QWidget *pParent /* = 0 */) 3398 3399 { 3399 QWidget *pDialogParent = windowManager().realParentWindow(pParent ? pParent : windowManager().mainWindowShown()); 3400 AssertReturnVoid(pDialogParent); 3401 3402 3403 QIManagerDialog *pHelpBrowserDialog; 3404 UIHelpBrowserDialogFactory dialogFactory(strHelpFilePath); 3405 3406 dialogFactory.prepare(pHelpBrowserDialog); 3407 AssertReturnVoid(pHelpBrowserDialog); 3408 3409 connect(pHelpBrowserDialog, &QIManagerDialog::sigClose, 3410 this, &UIMessageCenter::sltCloseHelpBrowser); 3411 3412 pHelpBrowserDialog->show(); 3413 pHelpBrowserDialog->setWindowState(pHelpBrowserDialog->windowState() & ~Qt::WindowMinimized); 3414 pHelpBrowserDialog->activateWindow(); 3400 Q_UNUSED(pParent); 3401 if (!m_pHelpBrowserDialog) 3402 { 3403 3404 UIHelpBrowserDialogFactory dialogFactory(strHelpFilePath); 3405 dialogFactory.prepare(m_pHelpBrowserDialog); 3406 AssertReturnVoid(m_pHelpBrowserDialog); 3407 connect(m_pHelpBrowserDialog, &QIManagerDialog::sigClose, 3408 this, &UIMessageCenter::sltCloseHelpBrowser); 3409 } 3410 m_pHelpBrowserDialog->show(); 3411 m_pHelpBrowserDialog->setWindowState(m_pHelpBrowserDialog->windowState() & ~Qt::WindowMinimized); 3412 m_pHelpBrowserDialog->activateWindow(); 3415 3413 } 3416 3414 3417 3415 void UIMessageCenter::sltCloseHelpBrowser() 3418 3416 { 3419 QIManagerDialog *pDialog = qobject_cast<QIManagerDialog*>(sender());3420 if ( !pDialog)3417 QIManagerDialog* pDialog = qobject_cast<QIManagerDialog*>(sender()); 3418 if (m_pHelpBrowserDialog != pDialog || !pDialog) 3421 3419 return; 3422 3420 3421 m_pHelpBrowserDialog = 0; 3422 pDialog->close(); 3423 3423 UIHelpBrowserDialogFactory().cleanup(pDialog); 3424 3424 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r86672 r86776 34 34 35 35 /* Forward declarations: */ 36 class QIManagerDialog; 36 37 class UIMedium; 37 38 struct StorageSlot; … … 604 605 mutable QStringList m_warnings; 605 606 607 /** Holds UIHelpBrowserDialog instance. */ 608 QIManagerDialog *m_pHelpBrowserDialog; 609 606 610 /** Holds the singleton message-center instance. */ 607 611 static UIMessageCenter *s_pInstance; -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r86764 r86776 262 262 AssertReturnVoid(m_pContentViewer); 263 263 264 m_pContentViewer->setOpenExternalLinks(false); 265 264 266 connect(m_pContentViewer, &UIHelpBrowserViewer::sourceChanged, 265 267 this, &UIHelpBrowserWidget::sltHandleHelpBrowserViewerSourceChange); … … 272 274 connect(m_pContentViewer, &UIHelpBrowserViewer::historyChanged, 273 275 this, &UIHelpBrowserWidget::sltHandleHistoryChanged); 276 connect(m_pContentViewer, &UIHelpBrowserViewer::anchorClicked, 277 this, &UIHelpBrowserWidget::sltAnchorClicked); 278 274 279 275 280 m_pSplitter->addWidget(m_pContentViewer); … … 336 341 this, &UIHelpBrowserWidget::sltHandleSearchingStarted); 337 342 338 343 m_pHelpSearchEngine->reindexDocumentation(); 339 344 # endif//if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) 340 345 #endif … … 656 661 for (int i = -1 * m_pContentViewer->backwardHistoryCount(); i <= m_pContentViewer->forwardHistoryCount(); ++i) 657 662 { 658 m_pAddressBar->addItem(m_pContentViewer->historyTitle(i), i); 663 QString strItem = QString("%1 (%2)").arg(m_pContentViewer->historyTitle(i)).arg(m_pContentViewer->historyUrl(i).toString()); 664 m_pAddressBar->addItem(strItem, i); 659 665 if (i == 0) 660 666 iCurrentIndex = m_pAddressBar->count(); … … 713 719 #endif 714 720 } 721 722 void UIHelpBrowserWidget::sltAnchorClicked(const QUrl &link) 723 { 724 Q_UNUSED(link); 725 } 726 715 727 #include "UIHelpBrowserWidget.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h
r86757 r86776 101 101 void sltHandleSearchingStarted(); 102 102 void sltHandleSearchStart(); 103 103 void sltAnchorClicked(const QUrl &link); 104 104 private: 105 105
Note:
See TracChangeset
for help on using the changeset viewer.