summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2010-06-02 10:28:40 (GMT)
committerkh1 <qt-info@nokia.com>2010-06-02 11:51:09 (GMT)
commit2573227b32597f3ae1ab861f0724765662e41174 (patch)
tree12ac2fc9ebfd15bfb7fa814259ffe67a018de91b
parent89f4deb6ae092c5d5fe91a169cb328288a87f146 (diff)
downloadQt-2573227b32597f3ae1ab861f0724765662e41174.zip
Qt-2573227b32597f3ae1ab861f0724765662e41174.tar.gz
Qt-2573227b32597f3ae1ab861f0724765662e41174.tar.bz2
Remove in-page switcher.
Reviewed-by: ck
-rw-r--r--tools/assistant/tools/assistant/helpviewer.cpp33
-rw-r--r--tools/assistant/tools/assistant/helpviewer.h3
-rw-r--r--tools/assistant/tools/assistant/helpviewer_p.h30
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qtb.cpp7
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.cpp11
5 files changed, 9 insertions, 75 deletions
diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp
index 81870a9..a448dd4 100644
--- a/tools/assistant/tools/assistant/helpviewer.cpp
+++ b/tools/assistant/tools/assistant/helpviewer.cpp
@@ -51,7 +51,6 @@
#include <QtCore/QTemporaryFile>
#include <QtCore/QUrl>
-#include <QtGui/QComboBox>
#include <QtGui/QDesktopServices>
#include <QtGui/QMouseEvent>
@@ -109,6 +108,12 @@ struct ExtensionMap {
{ 0, 0 }
};
+HelpViewer::~HelpViewer()
+{
+ TRACE_OBJ
+ delete d;
+}
+
bool HelpViewer::isLocalUrl(const QUrl &url)
{
TRACE_OBJ
@@ -208,30 +213,4 @@ bool HelpViewer::handleForwardBackwardMouseButtons(QMouseEvent *event)
return false;
}
-bool HelpViewer::openPagesListRequested(const QMouseEvent *event) const
-{
- return event->buttons() == Qt::RightButton
- && event->modifiers() == Qt::ControlModifier;
-}
-
-bool HelpViewer::openPagesListRequested(const QContextMenuEvent *event) const
-{
- return event->reason() == QContextMenuEvent::Mouse
- && event->modifiers() == Qt::ControlModifier;
-}
-
-void HelpViewer::showOpenPagesList(const QPoint &pos)
-{
- QComboBox * const openPagesBox = d->openPagesBox(this);
- openPagesBox->move(pos);
- openPagesBox->setCurrentIndex(CentralWidget::instance()->currentIndex());
- openPagesBox->showPopup();
-}
-
-HelpViewer::~HelpViewer()
-{
- TRACE_OBJ
- delete d;
-}
-
QT_END_NAMESPACE
diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h
index 1f897d9..847b0ca 100644
--- a/tools/assistant/tools/assistant/helpviewer.h
+++ b/tools/assistant/tools/assistant/helpviewer.h
@@ -145,9 +145,6 @@ private:
void contextMenuEvent(QContextMenuEvent *event);
QVariant loadResource(int type, const QUrl &name);
bool handleForwardBackwardMouseButtons(QMouseEvent *e);
- bool openPagesListRequested(const QMouseEvent *event) const;
- bool openPagesListRequested(const QContextMenuEvent *event) const;
- void showOpenPagesList(const QPoint &pos);
private:
HelpViewerPrivate *d;
diff --git a/tools/assistant/tools/assistant/helpviewer_p.h b/tools/assistant/tools/assistant/helpviewer_p.h
index 2bd4e16..2772905 100644
--- a/tools/assistant/tools/assistant/helpviewer_p.h
+++ b/tools/assistant/tools/assistant/helpviewer_p.h
@@ -47,11 +47,9 @@
#include "openpagesmanager.h"
#include <QtCore/QObject>
-#include <QtGui/QComboBox>
#ifdef QT_NO_WEBKIT
#include <QtGui/QTextBrowser>
#endif
-#include <QtGui/QTreeView>
QT_BEGIN_NAMESPACE
@@ -69,7 +67,6 @@ public:
HelpViewerPrivate()
#endif
{
- m_openPagesBox = 0;
}
#ifdef QT_NO_WEBKIT
@@ -98,25 +95,8 @@ public:
CentralWidget::instance()->setSource(lastAnchor);
lastAnchor.clear();
}
-#endif // QT_NO_WEBKIT
-
- QComboBox *openPagesBox(QWidget *parent = 0)
- {
- if (!m_openPagesBox) {
- m_openPagesBox = new QComboBox(parent);
- m_openPagesBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
- m_openPagesBox->setModel(OpenPagesManager::instance()
- ->openPagesWidget()->model());
- connect(m_openPagesBox, SIGNAL(activated(int)), this,
- SLOT(switchToPage(int)));
- }
-
- return m_openPagesBox;
- }
public slots:
-
-#ifdef QT_NO_WEBKIT
void openLink()
{
openLink(false);
@@ -132,16 +112,6 @@ public:
bool forceFont;
QString lastAnchor;
#endif // QT_NO_WEBKIT
-
-private slots:
-
- void switchToPage(int row)
- {
- OpenPagesManager::instance()->setCurrentPage(row);
- }
-
-private:
- QComboBox *m_openPagesBox;
};
QT_END_NAMESPACE
diff --git a/tools/assistant/tools/assistant/helpviewer_qtb.cpp b/tools/assistant/tools/assistant/helpviewer_qtb.cpp
index 98eb59f..f6b5022 100644
--- a/tools/assistant/tools/assistant/helpviewer_qtb.cpp
+++ b/tools/assistant/tools/assistant/helpviewer_qtb.cpp
@@ -298,10 +298,6 @@ void HelpViewer::mousePressEvent(QMouseEvent *e)
if (handleForwardBackwardMouseButtons(e))
return;
#endif
- if (openPagesListRequested(e)) {
- showOpenPagesList(e->pos());
- return;
- }
QTextBrowser::mousePressEvent(e);
}
@@ -346,9 +342,6 @@ void HelpViewer::contextMenuEvent(QContextMenuEvent *event)
{
TRACE_OBJ
- if (openPagesListRequested(event))
- return;
-
QMenu menu(QString(), 0);
QUrl link;
QAction *copyAnchorAction = 0;
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
index 869789b..f61d6d4 100644
--- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp
+++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
@@ -243,7 +243,8 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *,
// -- HelpViewer
HelpViewer::HelpViewer(qreal zoom, QWidget *parent)
- : QWebView(parent), d(new HelpViewerPrivate)
+ : QWebView(parent)
+ , d(new HelpViewerPrivate)
{
TRACE_OBJ
setAcceptDrops(false);
@@ -432,11 +433,6 @@ void HelpViewer::mousePressEvent(QMouseEvent *event)
return;
#endif
- if (openPagesListRequested(event)) {
- showOpenPagesList(event->pos());
- return;
- }
-
if (HelpPage *currentPage = static_cast<HelpPage*> (page())) {
currentPage->m_pressedButtons = event->buttons();
currentPage->m_keyboardModifiers = event->modifiers();
@@ -481,8 +477,7 @@ bool HelpViewer::eventFilter(QObject *obj, QEvent *event)
void HelpViewer::contextMenuEvent(QContextMenuEvent *event)
{
TRACE_OBJ
- if (!openPagesListRequested(event))
- QWebView::contextMenuEvent(event);
+ QWebView::contextMenuEvent(event);
}
QT_END_NAMESPACE