Commit 66e5da21 authored by kh1's avatar kh1
Browse files

Fix typo.

parent a84b3b52
...@@ -24,7 +24,7 @@ HEADERS += \ ...@@ -24,7 +24,7 @@ HEADERS += \
helpviewer_p.h \ helpviewer_p.h \
openpagesmanager.h \ openpagesmanager.h \
openpagesmodel.h \ openpagesmodel.h \
openpagesswicher.h \ openpagesswitcher.h \
openpageswidget.h \ openpageswidget.h \
searchwidget.h \ searchwidget.h \
xbelsupport.h xbelsupport.h
...@@ -44,7 +44,7 @@ SOURCES += \ ...@@ -44,7 +44,7 @@ SOURCES += \
helpviewer_qwv.cpp \ helpviewer_qwv.cpp \
openpagesmanager.cpp \ openpagesmanager.cpp \
openpagesmodel.cpp \ openpagesmodel.cpp \
openpagesswicher.cpp \ openpagesswitcher.cpp \
openpageswidget.cpp \ openpageswidget.cpp \
searchwidget.cpp \ searchwidget.cpp \
xbelsupport.cpp xbelsupport.cpp
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include "helpmanager.h" #include "helpmanager.h"
#include "helpviewer.h" #include "helpviewer.h"
#include "openpagesmodel.h" #include "openpagesmodel.h"
#include "openpagesswicher.h" #include "openpagesswitcher.h"
#include "openpageswidget.h" #include "openpageswidget.h"
#include <QtGui/QApplication> #include <QtGui/QApplication>
...@@ -54,7 +54,7 @@ OpenPagesManager::OpenPagesManager(QObject *parent) ...@@ -54,7 +54,7 @@ OpenPagesManager::OpenPagesManager(QObject *parent)
, m_comboBox(0) , m_comboBox(0)
, m_model(0) , m_model(0)
, m_openPagesWidget(0) , m_openPagesWidget(0)
, m_openPagesSwicher(0) , m_openPagesSwitcher(0)
{ {
Q_ASSERT(!m_instance); Q_ASSERT(!m_instance);
...@@ -74,17 +74,17 @@ OpenPagesManager::OpenPagesManager(QObject *parent) ...@@ -74,17 +74,17 @@ OpenPagesManager::OpenPagesManager(QObject *parent)
m_comboBox->setMinimumContentsLength(40); m_comboBox->setMinimumContentsLength(40);
connect(m_comboBox, SIGNAL(activated(int)), this, SLOT(setCurrentPage(int))); connect(m_comboBox, SIGNAL(activated(int)), this, SLOT(setCurrentPage(int)));
m_openPagesSwicher = new OpenPagesSwicher(m_model); m_openPagesSwitcher = new OpenPagesSwitcher(m_model);
connect(m_openPagesSwicher, SIGNAL(closePage(QModelIndex)), this, connect(m_openPagesSwitcher, SIGNAL(closePage(QModelIndex)), this,
SLOT(closePage(QModelIndex))); SLOT(closePage(QModelIndex)));
connect(m_openPagesSwicher, SIGNAL(setCurrentPage(QModelIndex)), this, connect(m_openPagesSwitcher, SIGNAL(setCurrentPage(QModelIndex)), this,
SLOT(setCurrentPage(QModelIndex))); SLOT(setCurrentPage(QModelIndex)));
} }
OpenPagesManager ::~OpenPagesManager() OpenPagesManager ::~OpenPagesManager()
{ {
m_instance = 0; m_instance = 0;
delete m_openPagesSwicher; delete m_openPagesSwitcher;
} }
OpenPagesManager &OpenPagesManager::instance() OpenPagesManager &OpenPagesManager::instance()
...@@ -168,7 +168,7 @@ void OpenPagesManager::setupInitialPages() ...@@ -168,7 +168,7 @@ void OpenPagesManager::setupInitialPages()
emit pagesChanged(); emit pagesChanged();
setCurrentPage(initialPage); setCurrentPage(initialPage);
m_openPagesSwicher->selectCurrentPage(); m_openPagesSwitcher->selectCurrentPage();
} }
// -- public slots // -- public slots
...@@ -246,23 +246,23 @@ void OpenPagesManager::closePagesExcept(const QModelIndex &index) ...@@ -246,23 +246,23 @@ void OpenPagesManager::closePagesExcept(const QModelIndex &index)
void OpenPagesManager::gotoNextPage() void OpenPagesManager::gotoNextPage()
{ {
if (!m_openPagesSwicher->isVisible()) { if (!m_openPagesSwitcher->isVisible()) {
m_openPagesSwicher->selectCurrentPage(); m_openPagesSwitcher->selectCurrentPage();
m_openPagesSwicher->gotoNextPage(); m_openPagesSwitcher->gotoNextPage();
showTwicherOrSelectPage(); showTwicherOrSelectPage();
} else { } else {
m_openPagesSwicher->gotoNextPage(); m_openPagesSwitcher->gotoNextPage();
} }
} }
void OpenPagesManager::gotoPreviousPage() void OpenPagesManager::gotoPreviousPage()
{ {
if (!m_openPagesSwicher->isVisible()) { if (!m_openPagesSwitcher->isVisible()) {
m_openPagesSwicher->selectCurrentPage(); m_openPagesSwitcher->selectCurrentPage();
m_openPagesSwicher->gotoPreviousPage(); m_openPagesSwitcher->gotoPreviousPage();
showTwicherOrSelectPage(); showTwicherOrSelectPage();
} else { } else {
m_openPagesSwicher->gotoPreviousPage(); m_openPagesSwitcher->gotoPreviousPage();
} }
} }
...@@ -285,10 +285,10 @@ void OpenPagesManager::showTwicherOrSelectPage() const ...@@ -285,10 +285,10 @@ void OpenPagesManager::showTwicherOrSelectPage() const
const int width = CentralWidget::instance()->width(); const int width = CentralWidget::instance()->width();
const int height = CentralWidget::instance()->height(); const int height = CentralWidget::instance()->height();
const QPoint p(CentralWidget::instance()->mapToGlobal(QPoint(0, 0))); const QPoint p(CentralWidget::instance()->mapToGlobal(QPoint(0, 0)));
m_openPagesSwicher->move((width - m_openPagesSwicher->width()) / 2 + p.x(), m_openPagesSwitcher->move((width - m_openPagesSwitcher->width()) / 2 + p.x(),
(height - m_openPagesSwicher->height()) / 2 + p.y()); (height - m_openPagesSwitcher->height()) / 2 + p.y());
m_openPagesSwicher->setVisible(true); m_openPagesSwitcher->setVisible(true);
} else { } else {
m_openPagesSwicher->selectAndHide(); m_openPagesSwitcher->selectAndHide();
} }
} }
...@@ -44,7 +44,7 @@ namespace Help { ...@@ -44,7 +44,7 @@ namespace Help {
class HelpViewer; class HelpViewer;
class OpenPagesModel; class OpenPagesModel;
class OpenPagesSwicher; class OpenPagesSwitcher;
class OpenPagesWidget; class OpenPagesWidget;
class OpenPagesManager : public QObject class OpenPagesManager : public QObject
...@@ -89,7 +89,7 @@ private: ...@@ -89,7 +89,7 @@ private:
QComboBox *m_comboBox; QComboBox *m_comboBox;
OpenPagesModel *m_model; OpenPagesModel *m_model;
OpenPagesWidget *m_openPagesWidget; OpenPagesWidget *m_openPagesWidget;
OpenPagesSwicher *m_openPagesSwicher; OpenPagesSwitcher *m_openPagesSwitcher;
static OpenPagesManager *m_instance; static OpenPagesManager *m_instance;
}; };
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
**************************************************************************/ **************************************************************************/
#include "openpagesswicher.h" #include "openpagesswitcher.h"
#include "centralwidget.h" #include "centralwidget.h"
#include "openpagesmodel.h" #include "openpagesmodel.h"
...@@ -43,7 +43,7 @@ const int gMargin = 4; ...@@ -43,7 +43,7 @@ const int gMargin = 4;
const int gWidth = 300; const int gWidth = 300;
const int gHeight = 200; const int gHeight = 200;
OpenPagesSwicher::OpenPagesSwicher(OpenPagesModel *model) OpenPagesSwitcher::OpenPagesSwitcher(OpenPagesModel *model)
: QWidget(0, Qt::Popup) : QWidget(0, Qt::Popup)
, m_openPagesModel(model) , m_openPagesModel(model)
{ {
...@@ -63,45 +63,45 @@ OpenPagesSwicher::OpenPagesSwicher(OpenPagesModel *model) ...@@ -63,45 +63,45 @@ OpenPagesSwicher::OpenPagesSwicher(OpenPagesModel *model)
SIGNAL(setCurrentPage(QModelIndex))); SIGNAL(setCurrentPage(QModelIndex)));
} }
OpenPagesSwicher::~OpenPagesSwicher() OpenPagesSwitcher::~OpenPagesSwitcher()
{ {
} }
void OpenPagesSwicher::gotoNextPage() void OpenPagesSwitcher::gotoNextPage()
{ {
selectPageUpDown(-1); selectPageUpDown(-1);
} }
void OpenPagesSwicher::gotoPreviousPage() void OpenPagesSwitcher::gotoPreviousPage()
{ {
selectPageUpDown(1); selectPageUpDown(1);
} }
void OpenPagesSwicher::selectAndHide() void OpenPagesSwitcher::selectAndHide()
{ {
setVisible(false); setVisible(false);
emit setCurrentPage(m_openPagesWidget->currentIndex()); emit setCurrentPage(m_openPagesWidget->currentIndex());
} }
void OpenPagesSwicher::selectCurrentPage() void OpenPagesSwitcher::selectCurrentPage()
{ {
m_openPagesWidget->selectCurrentPage(); m_openPagesWidget->selectCurrentPage();
} }
void OpenPagesSwicher::setVisible(bool visible) void OpenPagesSwitcher::setVisible(bool visible)
{ {
QWidget::setVisible(visible); QWidget::setVisible(visible);
if (visible) if (visible)
setFocus(); setFocus();
} }
void OpenPagesSwicher::focusInEvent(QFocusEvent *event) void OpenPagesSwitcher::focusInEvent(QFocusEvent *event)
{ {
Q_UNUSED(event) Q_UNUSED(event)
m_openPagesWidget->setFocus(); m_openPagesWidget->setFocus();
} }
bool OpenPagesSwicher::eventFilter(QObject *object, QEvent *event) bool OpenPagesSwitcher::eventFilter(QObject *object, QEvent *event)
{ {
if (object == m_openPagesWidget) { if (object == m_openPagesWidget) {
if (event->type() == QEvent::KeyPress) { if (event->type() == QEvent::KeyPress) {
...@@ -129,7 +129,7 @@ bool OpenPagesSwicher::eventFilter(QObject *object, QEvent *event) ...@@ -129,7 +129,7 @@ bool OpenPagesSwicher::eventFilter(QObject *object, QEvent *event)
return QWidget::eventFilter(object, event); return QWidget::eventFilter(object, event);
} }
void OpenPagesSwicher::selectPageUpDown(int summand) void OpenPagesSwitcher::selectPageUpDown(int summand)
{ {
const int pageCount = m_openPagesModel->rowCount(); const int pageCount = m_openPagesModel->rowCount();
if (pageCount < 2) if (pageCount < 2)
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef OPENPAGESSWICHER_H #ifndef OPENPAGESSWITCHER_H
#define OPENPAGESSWICHER_H #define OPENPAGESSWITCHER_H
#include <QtGui/QWidget> #include <QtGui/QWidget>
...@@ -40,13 +40,13 @@ namespace Help { ...@@ -40,13 +40,13 @@ namespace Help {
class OpenPagesModel; class OpenPagesModel;
class OpenPagesWidget; class OpenPagesWidget;
class OpenPagesSwicher : public QWidget class OpenPagesSwitcher : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
OpenPagesSwicher(OpenPagesModel *model); OpenPagesSwitcher(OpenPagesModel *model);
~OpenPagesSwicher(); ~OpenPagesSwitcher();
void gotoNextPage(); void gotoNextPage();
void gotoPreviousPage(); void gotoPreviousPage();
...@@ -73,4 +73,4 @@ private: ...@@ -73,4 +73,4 @@ private:
} // namespace Internal } // namespace Internal
} // namespace Help } // namespace Help
#endif // OPENPAGESSWICHER_H #endif // OPENPAGESSWITCHER_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment