Changeset 86791 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 3, 2020 11:21:51 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r86764 r86791 239 239 240 240 /* Help Browser */ 241 const char *UIExtraDataDefs::GUI_HelpBrowserLastURL = "GUI/HelpBrowserLastURL";241 const char *UIExtraDataDefs::GUI_HelpBrowserLastURLList = "GUI/HelpBrowserLastURLList"; 242 242 const char *UIExtraDataDefs::GUI_HelpBrowserDialogGeometry = "GUI/HelpBrowserDialogGeomety"; 243 243 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r86764 r86791 438 438 /** @name Help Browser 439 439 * @{ */ 440 SHARED_LIBRARY_STUFF extern const char *GUI_HelpBrowserLastURL ;440 SHARED_LIBRARY_STUFF extern const char *GUI_HelpBrowserLastURLList; 441 441 SHARED_LIBRARY_STUFF extern const char *GUI_HelpBrowserDialogGeometry; 442 442 /** @} */ -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r86764 r86791 1982 1982 << GUI_ExtraDataManager_Geometry << GUI_ExtraDataManager_SplitterHints 1983 1983 << GUI_LogWindowGeometry 1984 << GUI_HelpBrowserLastURL 1984 << GUI_HelpBrowserLastURLList 1985 1985 << GUI_HelpBrowserDialogGeometry; 1986 1986 } … … 4594 4594 } 4595 4595 4596 void UIExtraDataManager::setHelpBrowserLastUrl (const QString &url)4597 { 4598 setExtraDataString (GUI_HelpBrowserLastURL, url);4599 } 4600 4601 QString UIExtraDataManager::helpBrowserLastUrl()4602 { 4603 return extraDataString (GUI_HelpBrowserLastURL);4596 void UIExtraDataManager::setHelpBrowserLastUrlList(const QStringList &urlList) 4597 { 4598 setExtraDataStringList(GUI_HelpBrowserLastURLList, urlList); 4599 } 4600 4601 QStringList UIExtraDataManager::helpBrowserLastUrlList() 4602 { 4603 return extraDataStringList(GUI_HelpBrowserLastURLList); 4604 4604 } 4605 4605 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r86764 r86791 787 787 /** @name Help Browser 788 788 * @{ */ 789 void setHelpBrowserLastUrl (const QString &url);790 QString helpBrowserLastUrl();789 void setHelpBrowserLastUrlList(const QStringList &urlList); 790 QStringList helpBrowserLastUrlList(); 791 791 QRect helpBrowserDialogGeometry(QWidget *pWidget, QWidget *pParentWidget, const QRect &defaultGeometry); 792 792 void setHelpBrowserDialogGeometry(const QRect &geometry, bool fMaximized); -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserDialog.cpp
r86764 r86791 67 67 void UIHelpBrowserDialog::retranslateUi() 68 68 { 69 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) 69 70 setWindowTitle(UIHelpBrowserWidget::tr("User Manual")); 70 71 /* Translate buttons: */72 71 button(ButtonType_Close)->setText(UIHelpBrowserWidget::tr("Close")); 72 #endif 73 73 } 74 74 … … 81 81 void UIHelpBrowserDialog::configureCentralWidget() 82 82 { 83 /* Create widget: */ 84 UIHelpBrowserWidget *pWidget = 0; 85 86 #ifdef RT_OS_LINUX 87 pWidget = new UIHelpBrowserWidget(EmbedTo_Dialog, m_strHelpFilePath, true /* show toolbar */, this); 88 #endif 89 83 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) 84 UIHelpBrowserWidget *pWidget = new UIHelpBrowserWidget(EmbedTo_Dialog, m_strHelpFilePath, true /* show toolbar */, this); 90 85 if (pWidget) 91 86 { … … 102 97 centralWidget()->layout()->addWidget(pWidget); 103 98 } 99 #endif 104 100 } 105 101 -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r86781 r86791 49 49 #include "UIMessageCenter.h" 50 50 #include "UIHelpBrowserWidget.h" 51 #include "QITabWidget.h" 51 52 #include "QIToolBar.h" 52 53 #include "UICommon.h" … … 55 56 /* COM includes: */ 56 57 #include "CSystemProperties.h" 58 59 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) 57 60 58 61 enum HelpBrowserTabs … … 66 69 Q_DECLARE_METATYPE(HelpBrowserTabs); 67 70 68 class UIHelpBrowserAddressBar : public QComboBox 69 { 70 Q_OBJECT; 71 72 public: 73 UIHelpBrowserAddressBar(QWidget *pParent = 0); 74 75 }; 71 72 /********************************************************************************************************************************* 73 * UIHelpBrowserViewer definition. * 74 *********************************************************************************************************************************/ 76 75 77 76 class UIHelpBrowserViewer : public QTextBrowser … … 91 90 private: 92 91 93 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))94 92 const QHelpEngine* m_pHelpEngine; 95 #endif96 93 }; 97 94 98 UIHelpBrowserAddressBar::UIHelpBrowserAddressBar(QWidget *pParent /* = 0 */) 99 :QComboBox(pParent) 100 { 101 } 95 /********************************************************************************************************************************* 96 * UIHelpBrowserTab definition. * 97 *********************************************************************************************************************************/ 98 99 class UIHelpBrowserTab : public QWidget 100 { 101 Q_OBJECT; 102 103 signals: 104 105 void sigSourceChanged(const QUrl &url); 106 107 public: 108 109 UIHelpBrowserTab(const QHelpEngine *pHelpEngine, const QUrl &homeUrl, 110 const QUrl &initialUrl, QWidget *pParent = 0); 111 112 QUrl source() const; 113 void setSource(const QUrl &url); 114 115 private slots: 116 117 void sltHandleHomeAction(); 118 void sltHandleForwardAction(); 119 void sltHandleBackwardAction(); 120 void sltHandleHistoryChanged(); 121 void sltHandleAddressBarIndexChanged(int index); 122 void sltHandleAddBookmarkAction(); 123 void sltAnchorClicked(const QUrl &link); 124 125 private: 126 127 void prepare(const QUrl &initialUrl); 128 void prepareWidgets(const QUrl &initialUrl); 129 void prepareToolBarAndAddressBar(); 130 virtual void retranslateUi() /* override */; 131 132 QAction *m_pHomeAction; 133 QAction *m_pForwardAction; 134 QAction *m_pBackwardAction; 135 QAction *m_pAddBookmarkAction; 136 137 QVBoxLayout *m_pMainLayout; 138 QIToolBar *m_pToolBar; 139 QComboBox *m_pAddressBar; 140 UIHelpBrowserViewer *m_pContentViewer; 141 const QHelpEngine* m_pHelpEngine; 142 QString m_strPageNotFoundText; 143 QUrl m_homeUrl; 144 }; 145 146 147 /********************************************************************************************************************************* 148 * UIHelpBrowserTabManager definition. * 149 *********************************************************************************************************************************/ 150 151 class UIHelpBrowserTabManager : public QITabWidget 152 { 153 Q_OBJECT; 154 155 public: 156 157 UIHelpBrowserTabManager(const QHelpEngine *pHelpEngine, const QUrl &homeUrl, 158 const QStringList &urlList, QWidget *pParent = 0); 159 QStringList tabUrlList() const; 160 void initilizeTabs(); 161 /* Url of the current tab. */ 162 QUrl currentSource() const; 163 void setCurrentSource(const QUrl &url); 164 /* Return the list of urls of all open tabs as QStringList. */ 165 QStringList tabUrlList(); 166 167 private: 168 169 void prepare(); 170 void clearAndDeleteTabs(); 171 const QHelpEngine* m_pHelpEngine; 172 QUrl m_homeUrl; 173 QStringList m_savedUrlList; 174 }; 175 176 /********************************************************************************************************************************* 177 * UIHelpBrowserTab implementation. * 178 *********************************************************************************************************************************/ 179 180 UIHelpBrowserTab::UIHelpBrowserTab(const QHelpEngine *pHelpEngine, const QUrl &homeUrl, 181 const QUrl &initialUrl, QWidget *pParent /* = 0 */) 182 :QWidget(pParent) 183 , m_pHomeAction(0) 184 , m_pForwardAction(0) 185 , m_pBackwardAction(0) 186 , m_pAddBookmarkAction(0) 187 , m_pMainLayout(0) 188 , m_pToolBar(0) 189 , m_pAddressBar(0) 190 , m_pContentViewer(0) 191 , m_pHelpEngine(pHelpEngine) 192 , m_homeUrl(homeUrl) 193 { 194 if (initialUrl.isValid()) 195 prepare(initialUrl); 196 else 197 prepare(m_homeUrl); 198 } 199 200 QUrl UIHelpBrowserTab::source() const 201 { 202 if (!m_pContentViewer) 203 return QUrl(); 204 return m_pContentViewer->source(); 205 } 206 207 void UIHelpBrowserTab::setSource(const QUrl &url) 208 { 209 if (m_pContentViewer) 210 { 211 m_pContentViewer->blockSignals(true); 212 m_pContentViewer->setSource(url); 213 m_pContentViewer->blockSignals(false); 214 /* emit historyChanged signal explicitly since we have blocked the signals: */ 215 m_pContentViewer->emitHistoryChangedSignal(); 216 } 217 } 218 219 void UIHelpBrowserTab::prepare(const QUrl &initialUrl) 220 { 221 m_pMainLayout = new QVBoxLayout(this); 222 AssertReturnVoid(m_pMainLayout); 223 prepareToolBarAndAddressBar(); 224 prepareWidgets(initialUrl); 225 } 226 227 void UIHelpBrowserTab::prepareWidgets(const QUrl &initialUrl) 228 { 229 m_pContentViewer = new UIHelpBrowserViewer(m_pHelpEngine); 230 AssertReturnVoid(m_pContentViewer); 231 m_pMainLayout->setContentsMargins(0, 0, 0, 0); 232 m_pMainLayout->setSpacing(0); 233 234 m_pMainLayout->addWidget(m_pContentViewer); 235 m_pContentViewer->setOpenExternalLinks(false); 236 237 connect(m_pContentViewer, &UIHelpBrowserViewer::sourceChanged, 238 this, &UIHelpBrowserTab::sigSourceChanged); 239 connect(m_pContentViewer, &UIHelpBrowserViewer::historyChanged, 240 this, &UIHelpBrowserTab::sltHandleHistoryChanged); 241 connect(m_pContentViewer, &UIHelpBrowserViewer::anchorClicked, 242 this, &UIHelpBrowserTab::sltAnchorClicked); 243 244 m_pContentViewer->setSource(initialUrl); 245 } 246 247 void UIHelpBrowserTab::prepareToolBarAndAddressBar() 248 { 249 m_pHomeAction = 250 new QAction(UIIconPool::iconSet(":/help_browser_home_32px.png"), QString(), this); 251 m_pForwardAction = 252 new QAction(UIIconPool::iconSet(":/help_browser_forward_32px.png", ":/help_browser_forward_disabled_32px.png"), QString(), this); 253 m_pBackwardAction = 254 new QAction(UIIconPool::iconSet(":/help_browser_backward_32px.png", ":/help_browser_backward_disabled_32px.png"), QString(), this); 255 m_pAddBookmarkAction = 256 new QAction(UIIconPool::iconSet(":/help_browser_add_bookmark.png"), QString(), this); 257 258 connect(m_pHomeAction, &QAction::triggered, this, &UIHelpBrowserTab::sltHandleHomeAction); 259 connect(m_pBackwardAction, &QAction::triggered, this, &UIHelpBrowserTab::sltHandleAddBookmarkAction); 260 connect(m_pForwardAction, &QAction::triggered, this, &UIHelpBrowserTab::sltHandleForwardAction); 261 connect(m_pBackwardAction, &QAction::triggered, this, &UIHelpBrowserTab::sltHandleBackwardAction); 262 AssertReturnVoid(m_pHomeAction && m_pForwardAction && m_pBackwardAction && m_pAddBookmarkAction); 263 m_pForwardAction->setEnabled(false); 264 m_pBackwardAction->setEnabled(false); 265 266 m_pToolBar = new QIToolBar; 267 AssertReturnVoid(m_pToolBar); 268 m_pToolBar->addAction(m_pBackwardAction); 269 m_pToolBar->addAction(m_pForwardAction); 270 m_pToolBar->addAction(m_pHomeAction); 271 m_pToolBar->addAction(m_pAddBookmarkAction); 272 273 m_pAddressBar = new QComboBox(); 274 m_pAddressBar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 275 connect(m_pAddressBar, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 276 this, &UIHelpBrowserTab::sltHandleAddressBarIndexChanged); 277 278 279 QHBoxLayout *pTopLayout = new QHBoxLayout; 280 pTopLayout->addWidget(m_pToolBar); 281 pTopLayout->addWidget(m_pAddressBar); 282 m_pMainLayout->addLayout(pTopLayout); 283 } 284 285 void UIHelpBrowserTab::retranslateUi() 286 { 287 m_strPageNotFoundText = tr("<div><p><h3>404. Not found.</h3>The page <b>%1</b> could not be found.</p></div>"); 288 289 if (m_pHomeAction) 290 { 291 m_pHomeAction->setText(tr("Home")); 292 m_pHomeAction->setToolTip(tr("Return to start page")); 293 } 294 295 if (m_pBackwardAction) 296 { 297 m_pBackwardAction->setText(tr("Backward")); 298 m_pBackwardAction->setToolTip(tr("Navigate to previous page")); 299 } 300 301 if (m_pForwardAction) 302 { 303 m_pForwardAction->setText(tr("Forward")); 304 m_pForwardAction->setToolTip(tr("Navigate to next page")); 305 } 306 } 307 308 309 void UIHelpBrowserTab::sltHandleHomeAction() 310 { 311 if (!m_pContentViewer) 312 return; 313 if (m_homeUrl.isValid()) 314 m_pContentViewer->setSource(m_homeUrl); 315 } 316 317 void UIHelpBrowserTab::sltHandleForwardAction() 318 { 319 if (m_pContentViewer) 320 m_pContentViewer->forward(); 321 } 322 323 void UIHelpBrowserTab::sltHandleBackwardAction() 324 { 325 if (m_pContentViewer) 326 m_pContentViewer->backward(); 327 } 328 329 void UIHelpBrowserTab::sltHandleHistoryChanged() 330 { 331 if (!m_pContentViewer) 332 return; 333 int iCurrentIndex = 0; 334 /* QTextBrower history has negative and positive indices for bacward and forward items, respectively. 335 * 0 is the current item: */ 336 m_pAddressBar->blockSignals(true); 337 m_pAddressBar->clear(); 338 for (int i = -1 * m_pContentViewer->backwardHistoryCount(); i <= m_pContentViewer->forwardHistoryCount(); ++i) 339 { 340 QString strItem = QString("%1 (%2)").arg(m_pContentViewer->historyTitle(i)).arg(m_pContentViewer->historyUrl(i).toString()); 341 m_pAddressBar->addItem(strItem, i); 342 if (i == 0) 343 iCurrentIndex = m_pAddressBar->count(); 344 } 345 /* Make sure address bar show the current item: */ 346 m_pAddressBar->setCurrentIndex(iCurrentIndex - 1); 347 m_pAddressBar->blockSignals(false); 348 349 if (m_pBackwardAction) 350 m_pBackwardAction->setEnabled(m_pContentViewer->isBackwardAvailable()); 351 if (m_pForwardAction) 352 m_pForwardAction->setEnabled(m_pContentViewer->isForwardAvailable()); 353 354 } 355 356 void UIHelpBrowserTab::sltHandleAddressBarIndexChanged(int iIndex) 357 { 358 if (!m_pAddressBar && iIndex >= m_pAddressBar->count()) 359 return; 360 int iHistoryIndex = m_pAddressBar->itemData(iIndex).toInt(); 361 /* There seems to be no way to one-step-jump to a history item: */ 362 if (iHistoryIndex == 0) 363 return; 364 else if (iHistoryIndex > 0) 365 for (int i = 0; i < iHistoryIndex; ++i) 366 m_pContentViewer->forward(); 367 else 368 for (int i = 0; i > iHistoryIndex ; --i) 369 m_pContentViewer->backward(); 370 } 371 372 void UIHelpBrowserTab::sltHandleAddBookmarkAction() 373 { 374 } 375 376 377 void UIHelpBrowserTab::sltAnchorClicked(const QUrl &link) 378 { 379 Q_UNUSED(link); 380 } 381 382 383 /********************************************************************************************************************************* 384 * UIHelpBrowserViewer implementation. * 385 *********************************************************************************************************************************/ 102 386 103 387 UIHelpBrowserViewer::UIHelpBrowserViewer(const QHelpEngine *pHelpEngine, QWidget *pParent /* = 0 */) 104 388 :QTextBrowser(pParent) 105 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))106 389 , m_pHelpEngine(pHelpEngine) 107 #endif 108 { 109 #if !defined(RT_OS_LINUX) || !defined(VBOX_WITH_DOCS_QHELP) || !(QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) 390 { 110 391 Q_UNUSED(pHelpEngine); 111 #endif112 392 } 113 393 114 394 QVariant UIHelpBrowserViewer::loadResource(int type, const QUrl &name) 115 395 { 116 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))117 396 if (name.scheme() == "qthelp" && m_pHelpEngine) 118 397 return QVariant(m_pHelpEngine->fileData(name)); 119 398 else 120 399 return QTextBrowser::loadResource(type, name); 121 #else122 return QTextBrowser::loadResource(type, name);123 #endif124 400 } 125 401 … … 129 405 emit backwardAvailable(true); 130 406 } 407 408 409 /********************************************************************************************************************************* 410 * UIHelpBrowserTabManager definition. * 411 *********************************************************************************************************************************/ 412 413 UIHelpBrowserTabManager::UIHelpBrowserTabManager(const QHelpEngine *pHelpEngine, const QUrl &homeUrl, 414 const QStringList &urlList, QWidget *pParent /* = 0 */) 415 : QITabWidget(pParent) 416 , m_pHelpEngine(pHelpEngine) 417 , m_homeUrl(homeUrl) 418 , m_savedUrlList(urlList) 419 { 420 prepare(); 421 } 422 423 void UIHelpBrowserTabManager::initilizeTabs() 424 { 425 clearAndDeleteTabs(); 426 /* Add a single tab with m_homeUrl: */ 427 if (m_savedUrlList.isEmpty()) 428 { 429 addTab(new UIHelpBrowserTab(m_pHelpEngine, m_homeUrl, QUrl()), QString()); 430 } 431 else 432 { 433 addTab(new UIHelpBrowserTab(m_pHelpEngine, m_homeUrl, m_savedUrlList[0]), QString()); 434 435 } 436 } 437 438 QUrl UIHelpBrowserTabManager::currentSource() const 439 { 440 UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(currentWidget()); 441 if (!pTab) 442 return QUrl(); 443 return pTab->source(); 444 } 445 446 void UIHelpBrowserTabManager::setCurrentSource(const QUrl &url) 447 { 448 UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(currentWidget()); 449 if (!pTab) 450 return; 451 pTab->setSource(url); 452 } 453 454 QStringList UIHelpBrowserTabManager::tabUrlList() 455 { 456 QStringList list; 457 for (int i = 0; i < count(); ++i) 458 { 459 UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(currentWidget()); 460 if (!pTab || !pTab->source().isValid()) 461 continue; 462 list << pTab->source().toString(); 463 } 464 return list; 465 } 466 467 void UIHelpBrowserTabManager::prepare() 468 { 469 setTabsClosable(true); 470 //setTabBarAutoHide(true); 471 } 472 473 void UIHelpBrowserTabManager::clearAndDeleteTabs() 474 { 475 QList<QWidget*> tabList; 476 for (int i = 0; i < count(); ++i) 477 tabList << widget(i); 478 /* QTabWidget::clear() does not delete tab widgets: */ 479 clear(); 480 foreach (QWidget *pWidget, tabList) 481 delete pWidget; 482 } 483 484 485 /********************************************************************************************************************************* 486 * UIHelpBrowserWidget implementation. * 487 *********************************************************************************************************************************/ 131 488 132 489 UIHelpBrowserWidget::UIHelpBrowserWidget(EmbedTo enmEmbedding, … … 143 500 , m_pToolBar(0) 144 501 , m_strHelpFilePath(strHelpFilePath) 145 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))146 502 , m_pHelpEngine(0) 147 #endif148 , m_pAddressBar(0)149 , m_pContentViewer(0)150 503 , m_pSplitter(0) 151 504 , m_pMenu(0) … … 153 506 , m_pIndexWidget(0) 154 507 , m_pContentModel(0) 155 , m_pHelpSearchEngine(0) 156 , m_pHelpSearchQueryWidget(0) 157 , m_pHelpSearchResultWidget(0) 508 , m_pSearchEngine(0) 509 , m_pSearchQueryWidget(0) 510 , m_pSearchResultWidget(0) 511 , m_pTabManager(0) 158 512 , m_pBookmarksWidget(0) 159 513 , m_pSearchContainerWidget(0) 160 514 , m_pShowHideSideBarAction(0) 161 515 , m_pShowHideToolBarAction(0) 162 , m_pHomeAction(0)163 , m_pForwardAction(0)164 , m_pBackwardAction(0)165 , m_pAddBookmarkAction(0)166 516 , m_fModelContentCreated(false) 167 517 { … … 195 545 196 546 prepareActions(); 197 prepareToolBar();547 //prepareToolBar(); 198 548 prepareWidgets(); 199 549 prepareSearchWidgets(); … … 215 565 216 566 217 m_pHomeAction =218 new QAction(UIIconPool::iconSet(":/help_browser_home_32px.png"), QString(), this);219 connect(m_pHomeAction, &QAction::triggered, this, &UIHelpBrowserWidget::sltHandleHomeAction);220 221 m_pForwardAction =222 new QAction(UIIconPool::iconSet(":/help_browser_forward_32px.png", ":/help_browser_forward_disabled_32px.png"), QString(), this);223 connect(m_pForwardAction, &QAction::triggered, this, &UIHelpBrowserWidget::sltHandleForwardAction);224 sltHandleForwardAvailable(false);225 226 m_pBackwardAction =227 new QAction(UIIconPool::iconSet(":/help_browser_backward_32px.png", ":/help_browser_backward_disabled_32px.png"), QString(), this);228 connect(m_pBackwardAction, &QAction::triggered, this, &UIHelpBrowserWidget::sltHandleBackwardAction);229 sltHandleBackwardAvailable(false);230 231 m_pAddBookmarkAction =232 new QAction(UIIconPool::iconSet(":/help_browser_add_bookmark.png"), QString(), this);233 connect(m_pBackwardAction, &QAction::triggered, this, &UIHelpBrowserWidget::sltHandleAddBookmarkAction);234 567 } 235 568 … … 240 573 241 574 m_pMainLayout->addWidget(m_pSplitter); 242 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))243 575 m_pHelpEngine = new QHelpEngine(m_strHelpFilePath, this); 244 576 m_pBookmarksWidget = new QWidget(this); 245 577 m_pTabWidget = new QITabWidget; 578 m_pTabManager = new UIHelpBrowserTabManager(m_pHelpEngine, findIndexHtml(), loadSavedUrlList()); 579 246 580 AssertReturnVoid(m_pTabWidget && 247 581 m_pHelpEngine && 248 m_pBookmarksWidget); 582 m_pBookmarksWidget && 583 m_pTabManager); 249 584 250 585 m_pContentWidget = m_pHelpEngine->contentWidget(); … … 259 594 m_pTabWidget->insertTab(HelpBrowserTabs_Bookmarks, m_pBookmarksWidget, QString()); 260 595 261 m_pContentViewer = new UIHelpBrowserViewer(m_pHelpEngine); 262 AssertReturnVoid(m_pContentViewer); 263 264 m_pContentViewer->setOpenExternalLinks(false); 265 266 connect(m_pContentViewer, &UIHelpBrowserViewer::sourceChanged, 267 this, &UIHelpBrowserWidget::sltHandleHelpBrowserViewerSourceChange); 268 connect(m_pContentViewer, &UIHelpBrowserViewer::forwardAvailable, 269 this, &UIHelpBrowserWidget::sltHandleForwardAvailable); 270 connect(m_pContentViewer, &UIHelpBrowserViewer::backwardAvailable, 271 this, &UIHelpBrowserWidget::sltHandleBackwardAvailable); 272 connect(m_pContentViewer, &UIHelpBrowserViewer::sourceChanged, 273 this, &UIHelpBrowserWidget::sltHandleHelpBrowserViewerSourceChange); 274 connect(m_pContentViewer, &UIHelpBrowserViewer::historyChanged, 275 this, &UIHelpBrowserWidget::sltHandleHistoryChanged); 276 connect(m_pContentViewer, &UIHelpBrowserViewer::anchorClicked, 277 this, &UIHelpBrowserWidget::sltAnchorClicked); 278 279 280 m_pSplitter->addWidget(m_pContentViewer); 596 m_pSplitter->addWidget(m_pTabManager); 281 597 282 598 m_pSplitter->setStretchFactor(0, 1); … … 286 602 connect(m_pHelpEngine, &QHelpEngine::setupFinished, 287 603 this, &UIHelpBrowserWidget::sltHandleHelpEngineSetupFinished); 288 connect(m_pContentWidget, &QHelpContentWidget::linkActivated,289 m_pContentViewer, &UIHelpBrowserViewer::setSource);604 // connect(m_pContentWidget, &QHelpContentWidget::linkActivated, 605 // m_pContentViewer, &UIHelpBrowserViewer::setSource); 290 606 connect(m_pContentWidget, &QHelpContentWidget::clicked, 291 607 this, &UIHelpBrowserWidget::sltHandleContentWidgetItemClicked); 292 connect(m_pIndexWidget, &QHelpIndexWidget::linkActivated,293 m_pContentViewer, &UIHelpBrowserViewer::setSource);608 // connect(m_pIndexWidget, &QHelpIndexWidget::linkActivated, 609 // m_pContentViewer, &UIHelpBrowserViewer::setSource); 294 610 connect(m_pContentModel, &QHelpContentModel::contentsCreated, 295 611 this, &UIHelpBrowserWidget::sltHandleContentsCreated); … … 297 613 if (QFile(m_strHelpFilePath).exists() && m_pHelpEngine) 298 614 m_pHelpEngine->setupData(); 299 #endif300 615 } 301 616 302 617 void UIHelpBrowserWidget::prepareSearchWidgets() 303 618 { 304 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))305 # if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)306 307 619 AssertReturnVoid(m_pTabWidget && m_pHelpEngine); 308 620 … … 310 622 m_pTabWidget->insertTab(HelpBrowserTabs_Search, m_pSearchContainerWidget, QString()); 311 623 312 m_p HelpSearchEngine = m_pHelpEngine->searchEngine();313 AssertReturnVoid(m_p HelpSearchEngine);314 315 m_p HelpSearchQueryWidget = m_pHelpSearchEngine->queryWidget();316 m_p HelpSearchResultWidget = m_pHelpSearchEngine->resultWidget();317 AssertReturnVoid(m_p HelpSearchQueryWidget && m_pHelpSearchResultWidget);624 m_pSearchEngine = m_pHelpEngine->searchEngine(); 625 AssertReturnVoid(m_pSearchEngine); 626 627 m_pSearchQueryWidget = m_pSearchEngine->queryWidget(); 628 m_pSearchResultWidget = m_pSearchEngine->resultWidget(); 629 AssertReturnVoid(m_pSearchQueryWidget && m_pSearchResultWidget); 318 630 319 631 QVBoxLayout *pSearchLayout = new QVBoxLayout(m_pSearchContainerWidget); 320 pSearchLayout->addWidget(m_p HelpSearchQueryWidget);321 pSearchLayout->addWidget(m_p HelpSearchResultWidget);322 m_p HelpSearchQueryWidget->expandExtendedSearch();323 324 connect(m_p HelpSearchQueryWidget, &QHelpSearchQueryWidget::search,632 pSearchLayout->addWidget(m_pSearchQueryWidget); 633 pSearchLayout->addWidget(m_pSearchResultWidget); 634 m_pSearchQueryWidget->expandExtendedSearch(); 635 636 connect(m_pSearchQueryWidget, &QHelpSearchQueryWidget::search, 325 637 this, &UIHelpBrowserWidget::sltHandleSearchStart); 326 connect(m_pHelpSearchResultWidget, &QHelpSearchResultWidget::requestShowLink,327 m_pContentViewer, &UIHelpBrowserViewer::setSource);638 // connect(m_pSearchResultWidget, &QHelpSearchResultWidget::requestShowLink, 639 // m_pContentViewer, &UIHelpBrowserViewer::setSource); 328 640 329 641 // connect(searchEngine, &QHelpSearchEngine::searchingStarted, … … 333 645 334 646 335 connect(m_p HelpSearchEngine, &QHelpSearchEngine::indexingStarted,647 connect(m_pSearchEngine, &QHelpSearchEngine::indexingStarted, 336 648 this, &UIHelpBrowserWidget::sltHandleIndexingStarted); 337 connect(m_p HelpSearchEngine, &QHelpSearchEngine::indexingFinished,649 connect(m_pSearchEngine, &QHelpSearchEngine::indexingFinished, 338 650 this, &UIHelpBrowserWidget::sltHandleIndexingFinished); 339 651 340 connect(m_p HelpSearchEngine, &QHelpSearchEngine::searchingStarted,652 connect(m_pSearchEngine, &QHelpSearchEngine::searchingStarted, 341 653 this, &UIHelpBrowserWidget::sltHandleSearchingStarted); 342 654 343 m_pHelpSearchEngine->reindexDocumentation(); 344 # endif//if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) 345 #endif 655 m_pSearchEngine->reindexDocumentation(); 346 656 } 347 657 … … 357 667 const int iIconMetric = (int)(QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize)); 358 668 m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric)); 359 m_pToolBar->addAction(m_pBackwardAction);360 m_pToolBar->addAction(m_pForwardAction);361 m_pToolBar->addAction(m_pHomeAction);362 m_pToolBar->addAction(m_pAddBookmarkAction);669 // m_pToolBar->addAction(m_pBackwardAction); 670 // m_pToolBar->addAction(m_pForwardAction); 671 // m_pToolBar->addAction(m_pHomeAction); 672 // m_pToolBar->addAction(m_pAddBookmarkAction); 363 673 364 674 #ifdef VBOX_WS_MAC … … 376 686 #endif 377 687 } 378 m_pAddressBar = new UIHelpBrowserAddressBar();379 m_pAddressBar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);380 m_pTopLayout->addWidget(m_pAddressBar);381 connect(m_pAddressBar, static_cast<void(UIHelpBrowserAddressBar::*)(int)>(&UIHelpBrowserAddressBar::currentIndexChanged),382 this, &UIHelpBrowserWidget::sltHandleAddressBarIndexChanged);383 384 //m_pTopLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Fixed));385 688 } 386 689 … … 397 700 void UIHelpBrowserWidget::loadOptions() 398 701 { 399 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) 400 if (m_pContentViewer && m_pHelpEngine) 401 { 402 QUrl url(gEDataManager->helpBrowserLastUrl()); 403 if (url.isEmpty()) 404 return; 405 if (url.isValid()) 702 // if (m_pContentViewer && m_pHelpEngine) 703 // { 704 // QUrl url(gEDataManager->helpBrowserLastUrl()); 705 // if (url.isEmpty()) 706 // return; 707 // if (url.isValid()) 708 // { 709 // if (m_pHelpEngine->findFile(url).isValid()) 710 // { 711 // m_pContentViewer->setSource(url); 712 // m_pContentViewer->clearHistory(); 713 // } 714 // else 715 // show404Error(url); 716 // } 717 // } 718 } 719 720 QStringList UIHelpBrowserWidget::loadSavedUrlList() 721 { 722 return gEDataManager->helpBrowserLastUrlList(); 723 } 724 725 void UIHelpBrowserWidget::saveOptions() 726 { 727 if (m_pTabManager) 728 gEDataManager->setHelpBrowserLastUrlList(m_pTabManager->tabUrlList()); 729 } 730 731 QUrl UIHelpBrowserWidget::findIndexHtml() const 732 { 733 QList<QUrl> files = m_pHelpEngine->files(m_pHelpEngine->namespaceName(m_strHelpFilePath), QStringList()); 734 int iIndex = -1; 735 for (int i = 0; i < files.size(); ++i) 736 { 737 if (files[i].toString().contains("index.html", Qt::CaseInsensitive)) 406 738 { 407 if (m_pHelpEngine->findFile(url).isValid()) 739 iIndex = i; 740 break; 741 } 742 } 743 if (iIndex == -1) 744 { 745 /* If index html/htm could not be found try to find a html file at least: */ 746 for (int i = 0; i < files.size(); ++i) 747 { 748 if (files[i].toString().contains(".html", Qt::CaseInsensitive) || 749 files[i].toString().contains(".htm", Qt::CaseInsensitive)) 408 750 { 409 m_pContentViewer->setSource(url);410 m_pContentViewer->clearHistory();751 iIndex = i; 752 break; 411 753 } 412 else413 show404Error(url);414 754 } 415 755 } 416 #endif 417 } 418 419 void UIHelpBrowserWidget::saveOptions() 420 { 421 if (m_pContentViewer) 422 { 423 gEDataManager->setHelpBrowserLastUrl(m_pContentViewer->source().toString()); 424 } 756 if (iIndex != -1 && files.size() > iIndex) 757 return files[iIndex]; 758 else 759 return QUrl(); 425 760 } 426 761 … … 455 790 if (m_pShowHideToolBarAction) 456 791 m_pShowHideToolBarAction->setText(tr("Show/Hide Tool Bar")); 457 458 m_strPageNotFoundText = tr("<div><p><h3>404. Not found.</h3>The page <b>%1</b> could not be found.</p></div>"); 459 460 if (m_pHomeAction) 461 { 462 m_pHomeAction->setText(tr("Home")); 463 m_pHomeAction->setToolTip(tr("Return to start page")); 464 } 465 466 if (m_pBackwardAction) 467 { 468 m_pBackwardAction->setText(tr("Backward")); 469 m_pBackwardAction->setToolTip(tr("Navigate to previous page")); 470 } 471 472 if (m_pForwardAction) 473 { 474 m_pForwardAction->setText(tr("Forward")); 475 m_pForwardAction->setToolTip(tr("Navigate to next page")); 476 } 477 } 792 } 793 478 794 479 795 void UIHelpBrowserWidget::showEvent(QShowEvent *pEvent) … … 510 826 } 511 827 512 QUrl UIHelpBrowserWidget::findIndexHtml() const 513 { 514 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) 515 QList<QUrl> files = m_pHelpEngine->files(m_pHelpEngine->namespaceName(m_strHelpFilePath), QStringList()); 516 int iIndex = -1; 517 for (int i = 0; i < files.size(); ++i) 518 { 519 if (files[i].toString().contains("index.html", Qt::CaseInsensitive)) 520 { 521 iIndex = i; 522 break; 523 } 524 } 525 if (iIndex == -1) 526 { 527 /* If index html/htm could not be found try to find a html file at least: */ 528 for (int i = 0; i < files.size(); ++i) 529 { 530 if (files[i].toString().contains(".html", Qt::CaseInsensitive) || 531 files[i].toString().contains(".htm", Qt::CaseInsensitive)) 532 { 533 iIndex = i; 534 break; 535 } 536 } 537 } 538 if (iIndex != -1 && files.size() > iIndex) 539 return files[iIndex]; 540 return QUrl(); 541 #else 542 return QUrl(); 543 #endif 544 } 545 546 void UIHelpBrowserWidget::show404Error(const QUrl &url) 547 { 548 if (m_pContentWidget) 549 m_pContentViewer->setText(m_strPageNotFoundText.arg(url.toString())); 828 void UIHelpBrowserWidget::show404Error(const QUrl & /*url*/) 829 { 830 // QList<QUrl> files = m_pHelpEngine->files(m_pHelpEngine->namespaceName(m_strHelpFilePath), QStringList()); 831 // int iIndex = -1; 832 // for (int i = 0; i < files.size(); ++i) 833 // { 834 // if (files[i].toString().contains("index.html", Qt::CaseInsensitive)) 835 // { 836 // iIndex = i; 837 // break; 838 // } 839 // } 840 // if (iIndex == -1) 841 // { 842 // /* If index html/htm could not be found try to find a html file at least: */ 843 // for (int i = 0; i < files.size(); ++i) 844 // { 845 // if (files[i].toString().contains(".html", Qt::CaseInsensitive) || 846 // files[i].toString().contains(".htm", Qt::CaseInsensitive)) 847 // { 848 // iIndex = i; 849 // break; 850 // } 851 // } 852 // } 853 // if (iIndex != -1 && files.size() > iIndex) 854 // return files[iIndex]; 855 // return QUrl(); 856 // #else 857 // return QUrl(); 550 858 } 551 859 552 860 void UIHelpBrowserWidget::sltHandleHelpEngineSetupFinished() 553 861 { 554 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) 555 AssertReturnVoid(m_pContentViewer && m_pHelpEngine);862 AssertReturnVoid(m_pTabManager && m_pHelpEngine); 863 m_pTabManager->initilizeTabs(); 556 864 /* Search for the index of the index.htnl: */ 557 QUrl url = findIndexHtml(); 558 if (url.isValid()) 559 m_pContentViewer->setSource(url); 560 else 561 show404Error(url); 562 #endif 563 } 564 565 void sltHandleHomeAction(); 566 567 void UIHelpBrowserWidget::sltHandleContentWidgetItemClicked(const QModelIndex &index) 568 { 569 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) 570 AssertReturnVoid(m_pContentViewer && m_pHelpEngine && m_pContentWidget); 865 // QUrl url = findIndexHtml(); 866 // if (url.isValid()) 867 // m_pContentViewer->setSource(url); 868 // else 869 // show404Error(url); 870 } 871 872 873 void UIHelpBrowserWidget::sltHandleContentWidgetItemClicked(const QModelIndex & index) 874 { 875 AssertReturnVoid(m_pTabManager && m_pHelpEngine && m_pContentWidget); 571 876 QHelpContentModel *pContentModel = 572 877 qobject_cast<QHelpContentModel*>(m_pContentWidget->model()); … … 577 882 return; 578 883 const QUrl &url = pItem->url(); 579 m_pContentViewer->blockSignals(true); 580 m_pContentViewer->setSource(url); 581 m_pContentViewer->blockSignals(false); 582 /* emit historyChanged signal explicitly since we have blocked the signals: */ 583 m_pContentViewer->emitHistoryChangedSignal(); 584 #else 585 Q_UNUSED(index); 586 #endif 587 } 884 m_pTabManager->setCurrentSource(url); 885 } 886 588 887 589 888 void UIHelpBrowserWidget::sltHandleHelpBrowserViewerSourceChange(const QUrl &source) 590 889 { 591 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))592 890 if (m_fModelContentCreated && m_pContentWidget && source.isValid() && m_pContentModel) 593 891 { … … 603 901 } 604 902 } 605 #else606 Q_UNUSED(source);607 #endif608 903 } 609 904 … … 611 906 { 612 907 m_fModelContentCreated = true; 613 if (m_pContentViewer) 614 sltHandleHelpBrowserViewerSourceChange(m_pContentViewer->source()); 615 } 616 617 void UIHelpBrowserWidget::sltHandleHomeAction() 618 { 619 if (!m_pContentViewer) 620 return; 621 622 QUrl homeUrl = findIndexHtml(); 623 if (!homeUrl.isValid()) 624 return; 625 m_pContentViewer->setSource(homeUrl); 626 } 627 628 void UIHelpBrowserWidget::sltHandleForwardAction() 629 { 630 if (m_pContentViewer) 631 m_pContentViewer->forward(); 632 } 633 634 void UIHelpBrowserWidget::sltHandleBackwardAction() 635 { 636 if (m_pContentViewer) 637 m_pContentViewer->backward(); 638 } 639 640 void UIHelpBrowserWidget::sltHandleForwardAvailable(bool fAvailable) 641 { 642 if (m_pForwardAction) 643 m_pForwardAction->setEnabled(fAvailable); 644 } 645 646 void UIHelpBrowserWidget::sltHandleBackwardAvailable(bool fAvailable) 647 { 648 if (m_pBackwardAction) 649 m_pBackwardAction->setEnabled(fAvailable); 650 } 651 652 void UIHelpBrowserWidget::sltHandleHistoryChanged() 653 { 654 if (!m_pContentViewer) 655 return; 656 int iCurrentIndex = 0; 657 /* QTextBrower history has negative and positive indices for bacward and forward items, respectively. 658 * 0 is the current item: */ 659 m_pAddressBar->blockSignals(true); 660 m_pAddressBar->clear(); 661 for (int i = -1 * m_pContentViewer->backwardHistoryCount(); i <= m_pContentViewer->forwardHistoryCount(); ++i) 662 { 663 QString strItem = QString("%1 (%2)").arg(m_pContentViewer->historyTitle(i)).arg(m_pContentViewer->historyUrl(i).toString()); 664 m_pAddressBar->addItem(strItem, i); 665 if (i == 0) 666 iCurrentIndex = m_pAddressBar->count(); 667 } 668 /* Make sure address bar show the current item: */ 669 m_pAddressBar->setCurrentIndex(iCurrentIndex - 1); 670 m_pAddressBar->blockSignals(false); 671 } 672 673 void UIHelpBrowserWidget::sltHandleAddressBarIndexChanged(int iIndex) 674 { 675 if (!m_pAddressBar && iIndex >= m_pAddressBar->count()) 676 return; 677 int iHistoryIndex = m_pAddressBar->itemData(iIndex).toInt(); 678 /* There seems to be no way to one-step-jump to a history item: */ 679 if (iHistoryIndex == 0) 680 return; 681 else if (iHistoryIndex > 0) 682 for (int i = 0; i < iHistoryIndex; ++i) 683 m_pContentViewer->forward(); 684 else 685 for (int i = 0; i > iHistoryIndex ; --i) 686 m_pContentViewer->backward(); 687 688 } 689 690 void UIHelpBrowserWidget::sltHandleAddBookmarkAction() 691 { 908 if (m_pTabManager) 909 sltHandleHelpBrowserViewerSourceChange(m_pTabManager->currentSource()); 692 910 } 693 911 … … 714 932 void UIHelpBrowserWidget::sltHandleSearchStart() 715 933 { 716 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) 717 AssertReturnVoid(m_pHelpSearchEngine && m_pHelpSearchQueryWidget); 718 m_pHelpSearchEngine->search(m_pHelpSearchQueryWidget->searchInput()); 719 #endif 720 } 721 722 void UIHelpBrowserWidget::sltAnchorClicked(const QUrl &link) 723 { 724 Q_UNUSED(link); 725 } 934 AssertReturnVoid(m_pSearchEngine && m_pSearchQueryWidget); 935 m_pSearchEngine->search(m_pSearchQueryWidget->searchInput()); 936 } 937 726 938 727 939 #include "UIHelpBrowserWidget.moc" 940 941 #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/UIHelpBrowserWidget.h
r86781 r86791 52 52 class UIActionPool; 53 53 class UIDialogPanel; 54 class UIHelpBrowserAddressBar; 55 class UIHelpBrowserViewer; 54 class UIHelpBrowserTabManager; 56 55 56 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) 57 57 class SHARED_LIBRARY_STUFF UIHelpBrowserWidget : public QIWithRetranslateUI<QWidget> 58 58 { … … 87 87 void sltHandleSideBarVisibility(bool togggled); 88 88 void sltHandleToolBarVisibility(bool togggled); 89 void sltHandleHelpBrowserViewerSourceChange(const QUrl &source);90 89 void sltHandleContentsCreated(); 91 void sltHandleHomeAction();92 void sltHandleForwardAction();93 void sltHandleBackwardAction();94 void sltHandleForwardAvailable(bool fAvailable);95 void sltHandleBackwardAvailable(bool fAvailable);96 void sltHandleHistoryChanged();97 void sltHandleAddressBarIndexChanged(int index);98 void sltHandleAddBookmarkAction();99 90 void sltHandleIndexingStarted(); 100 91 void sltHandleIndexingFinished(); 101 92 void sltHandleSearchingStarted(); 102 93 void sltHandleSearchStart(); 103 void sltAnchorClicked(const QUrl &link); 94 void sltHandleHelpBrowserViewerSourceChange(const QUrl &source); 95 104 96 private: 105 97 … … 111 103 void prepareMenu(); 112 104 void loadOptions(); 113 105 QStringList loadSavedUrlList(); 114 106 void saveOptions(); 115 107 void cleanup(); … … 117 109 void show404Error(const QUrl &url); 118 110 /** @name Event handling stuff. 119 120 121 111 * @{ */ 112 /** Handles translation event. */ 113 virtual void retranslateUi() /* override */; 122 114 123 124 125 126 115 /** Handles Qt show @a pEvent. */ 116 virtual void showEvent(QShowEvent *pEvent) /* override */; 117 /** Handles Qt key-press @a pEvent. */ 118 virtual void keyPressEvent(QKeyEvent *pEvent) /* override */; 127 119 /** @} */ 128 120 … … 143 135 QITabWidget *m_pTabWidget; 144 136 /** @name Toolbar and menu variables. 145 146 137 * @{ */ 138 QIToolBar *m_pToolBar; 147 139 /** @} */ 148 140 149 141 QString m_strHelpFilePath; 150 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))151 142 QHelpEngine *m_pHelpEngine; 152 #endif153 UIHelpBrowserAddressBar *m_pAddressBar;154 UIHelpBrowserViewer *m_pContentViewer;155 143 QSplitter *m_pSplitter; 156 144 QMenu *m_pMenu; … … 158 146 QHelpIndexWidget *m_pIndexWidget; 159 147 QHelpContentModel *m_pContentModel; 160 QHelpSearchEngine *m_pHelpSearchEngine; 161 QHelpSearchQueryWidget *m_pHelpSearchQueryWidget; 162 QHelpSearchResultWidget *m_pHelpSearchResultWidget; 148 QHelpSearchEngine *m_pSearchEngine; 149 QHelpSearchQueryWidget *m_pSearchQueryWidget; 150 QHelpSearchResultWidget *m_pSearchResultWidget; 151 UIHelpBrowserTabManager *m_pTabManager; 163 152 QWidget *m_pBookmarksWidget; 164 153 QWidget *m_pSearchContainerWidget; 165 154 QAction *m_pShowHideSideBarAction; 166 155 QAction *m_pShowHideToolBarAction; 167 QAction *m_pHomeAction;168 QAction *m_pForwardAction;169 QAction *m_pBackwardAction;170 QAction *m_pAddBookmarkAction;171 QString m_strPageNotFoundText;172 156 /* This is set t true when handling QHelpContentModel::contentsCreated signal. */ 173 157 bool m_fModelContentCreated; 174 158 }; 175 159 160 #endif /* #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) */ 176 161 #endif /* !FEQT_INCLUDED_SRC_helpbrowser_UIHelpBrowserWidget_h */
Note:
See TracChangeset
for help on using the changeset viewer.