aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar un1versal2016-06-05 09:30:15 +0100
committerGravatar un1versal2016-06-09 01:48:06 +0100
commitbfb5ff869ae902b382acfd6fa9a545c2c49e2a60 (patch)
tree01854bdca73d66b3f932a8951702d31eb982fa9f
parentKviMenuBar: help menu entries; have one help entry only (diff)
downloadKVIrc-bfb5ff869ae902b382acfd6fa9a545c2c49e2a60.tar.gz
KVIrc-bfb5ff869ae902b382acfd6fa9a545c2c49e2a60.tar.bz2
KVIrc-bfb5ff869ae902b382acfd6fa9a545c2c49e2a60.zip
HelpWidget/Window: cleanup source
* change tr to __tr2qs as indicated in ancient todo list * remove unneed brackets * cleanup source formatting
-rw-r--r--src/modules/help/HelpWidget.cpp17
-rw-r--r--src/modules/help/HelpWindow.cpp21
2 files changed, 17 insertions, 21 deletions
diff --git a/src/modules/help/HelpWidget.cpp b/src/modules/help/HelpWidget.cpp
index d8e3dbd33..2f024fbcc 100644
--- a/src/modules/help/HelpWidget.cpp
+++ b/src/modules/help/HelpWidget.cpp
@@ -93,8 +93,8 @@ HelpWidget::HelpWidget(QWidget * par, bool bIsStandalone)
connect(m_pFindText, SIGNAL(textChanged(const QString)), this, SLOT(slotTextChanged(const QString)));
m_pToolBarHighlight->addAction(*g_pIconManager->getSmallIcon(KviIconManager::Discard), __tr2qs("Reset"), this, SLOT(slotResetFind()));
- m_pToolBarHighlight->addAction(*g_pIconManager->getSmallIcon(KviIconManager::Part), __tr2qs("Find previous"), this, SLOT(slotFindPrev()));
- m_pToolBarHighlight->addAction(*g_pIconManager->getSmallIcon(KviIconManager::Join), __tr2qs("Find next"), this, SLOT(slotFindNext()));
+ m_pToolBarHighlight->addAction(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPBACK), __tr2qs("Find previous"), this, SLOT(slotFindPrev()));
+ m_pToolBarHighlight->addAction(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPFORWARD), __tr2qs("Find next"), this, SLOT(slotFindNext()));
// upper toolbar contents (depends on webview)
QLabel * pBrowsingLabel = new QLabel();
@@ -165,6 +165,7 @@ void HelpWidget::slotFindNext()
{
m_pTextBrowser->findText(m_pFindText->text());
}
+
void HelpWidget::slotZoomIn()
{
kvs_real_t dZoom = m_pTextBrowser->zoomFactor();
@@ -214,19 +215,19 @@ HelpWidget::HelpWidget(QWidget * par, bool bIsStandalone)
connect(m_pBtnForward, SIGNAL(clicked()), m_pTextBrowser, SLOT(forward()));
m_pBtnForward->setEnabled(false);
- QWidget * pSpacer = new QWidget(m_pToolBar);
-
if(bIsStandalone)
{
setAttribute(Qt::WA_DeleteOnClose);
- QToolButton * b = new QToolButton(m_pToolBar);
- b->setIcon(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPCLOSE));
- connect(b, SIGNAL(clicked()), this, SLOT(close()));
+ QToolButton * m_pBtnClose = new QToolButton(m_pToolBar);
+ m_pBtnClose->setIcon(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPCLOSE));
+ connect(m_pBtnClose, SIGNAL(clicked()), this, SLOT(close()));
}
- m_pToolBar->setStretchFactor(pSpacer, 1);
connect(m_pTextBrowser, SIGNAL(backwardAvailable(bool)), m_pBtnBackward, SLOT(setEnabled(bool)));
connect(m_pTextBrowser, SIGNAL(forwardAvailable(bool)), m_pBtnForward, SLOT(setEnabled(bool)));
+
+ QWidget * pSpacer = new QWidget(m_pToolBar);
+ m_pToolBar->setStretchFactor(pSpacer, 1);
}
#endif
diff --git a/src/modules/help/HelpWindow.cpp b/src/modules/help/HelpWindow.cpp
index 155815c50..8ae68e57b 100644
--- a/src/modules/help/HelpWindow.cpp
+++ b/src/modules/help/HelpWindow.cpp
@@ -73,10 +73,8 @@ HelpWindow::HelpWindow(const char * name)
KviTalHBox * pSearchBox = new KviTalHBox(m_pIndexTab);
m_pIndexSearch = new QLineEdit(pSearchBox);
- connect(m_pIndexSearch, SIGNAL(textChanged(const QString &)),
- this, SLOT(searchInIndex(const QString &)));
- connect(m_pIndexSearch, SIGNAL(returnPressed()),
- this, SLOT(showIndexTopic()));
+ connect(m_pIndexSearch, SIGNAL(textChanged(const QString &)), this, SLOT(searchInIndex(const QString &)));
+ connect(m_pIndexSearch, SIGNAL(returnPressed()), this, SLOT(showIndexTopic()));
m_pBtnRefreshIndex = new QPushButton(pSearchBox);
m_pBtnRefreshIndex->setIcon(*g_pIconManager->getBigIcon(KVI_REFRESH_IMAGE_NAME));
@@ -91,8 +89,7 @@ HelpWindow::HelpWindow(const char * name)
m_pTermsEdit = new QLineEdit(m_pSearchTab);
- connect(m_pTermsEdit, SIGNAL(returnPressed()),
- this, SLOT(startSearch()));
+ connect(m_pTermsEdit, SIGNAL(returnPressed()), this, SLOT(startSearch()));
m_pResultBox = new KviTalListWidget(m_pSearchTab);
connect(m_pResultBox, SIGNAL(itemActivated(QListWidgetItem *)), this, SLOT(searchSelected(QListWidgetItem *)));
@@ -133,10 +130,7 @@ void HelpWindow::initialSetup()
m_pBtnRefreshIndex->setEnabled(true);
}
else
- {
g_pDocIndex->makeIndex();
- }
- //}
}
void HelpWindow::indexingStart(int iNum)
@@ -146,6 +140,7 @@ void HelpWindow::indexingStart(int iNum)
m_pProgressBar->setRange(0, iNum);
m_pProgressBar->setValue(0);
}
+
void HelpWindow::indexingProgress(int iNum)
{
m_pProgressBar->setValue(iNum);
@@ -219,8 +214,8 @@ void HelpWindow::startSearch()
s = s.simplified();
if(s.contains('*'))
{
- QMessageBox::warning(this, tr("Full Text Search - KVIrc"),
- tr("Using a wildcard within phrases is not allowed."));
+ QMessageBox::warning(this, __tr2qs("Full Text Search - KVIrc"),
+ __tr2qs("Using a wildcard within phrases is not allowed."));
return;
}
seqWords += s.split(' ', QString::SkipEmptyParts);
@@ -230,8 +225,8 @@ void HelpWindow::startSearch()
}
else
{
- QMessageBox::warning(this, tr("Full Text Search - KVIrc"),
- tr("The closing quotation mark is missing."));
+ QMessageBox::warning(this, __tr2qs("Full Text Search - KVIrc"),
+ __tr2qs("The closing quotation mark is missing."));
return;
}
}