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