diff options
author | kh1 <[email protected]> | 2010-03-30 17:44:28 +0200 |
---|---|---|
committer | kh1 <[email protected]> | 2010-03-30 17:51:46 +0200 |
commit | edcefd69ad49f10ffe6c75c8f01de41a44868df1 (patch) | |
tree | 976f37bbe686fb28299747280bd588324b9bb4f1 /src/shared/help/contentwindow.cpp | |
parent | a8801d15c56eaef7d3ac65d4616dbf8f26966972 (diff) |
Implement tabless help mode, behaves now like edit mode.
Diffstat (limited to 'src/shared/help/contentwindow.cpp')
-rw-r--r-- | src/shared/help/contentwindow.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/shared/help/contentwindow.cpp b/src/shared/help/contentwindow.cpp index 1560f27c566..e728a9a7478 100644 --- a/src/shared/help/contentwindow.cpp +++ b/src/shared/help/contentwindow.cpp @@ -29,8 +29,8 @@ #include "contentwindow.h" -#include "centralwidget.h" #include "helpmanager.h" +#include "openpagesmanager.h" #include <QtGui/QLayout> #include <QtGui/QFocusEvent> @@ -39,6 +39,8 @@ #include <QtHelp/QHelpEngine> #include <QtHelp/QHelpContentWidget> +using namespace Help::Internal; + ContentWindow::ContentWindow() : m_contentWidget(0) , m_expandDepth(-2) @@ -110,15 +112,12 @@ bool ContentWindow::eventFilter(QObject *o, QEvent *e) if (contentModel) { QHelpContentItem *itm = contentModel->contentItemAt(index); if (itm && !isPdfFile(itm)) - Help::Internal::CentralWidget::instance()->setSourceInNewTab(itm->url()); + OpenPagesManager::instance().createPage(itm->url()); } } else if (button == Qt::LeftButton) { itemClicked(index); } } - } else if (o == m_contentWidget && e->type() == QEvent::KeyPress) { - if (static_cast<QKeyEvent *>(e)->key() == Qt::Key_Escape) - emit escapePressed(); } return QWidget::eventFilter(o, e); } @@ -135,7 +134,7 @@ void ContentWindow::showContextMenu(const QPoint &pos) QMenu menu; QAction *curTab = menu.addAction(tr("Open Link")); - QAction *newTab = menu.addAction(tr("Open Link in New Tab")); + QAction *newTab = menu.addAction(tr("Open Link as New Page")); if (isPdfFile(itm)) newTab->setEnabled(false); @@ -145,7 +144,7 @@ void ContentWindow::showContextMenu(const QPoint &pos) if (curTab == action) emit linkActivated(itm->url()); else if (newTab == action) - Help::Internal::CentralWidget::instance()->setSourceInNewTab(itm->url()); + OpenPagesManager::instance().createPage(itm->url()); } void ContentWindow::itemClicked(const QModelIndex &index) |