aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/help/HelpWindow.cpp
diff options
context:
space:
mode:
authorGravatar Noldor2011-03-13 12:20:32 +0000
committerGravatar Noldor2011-03-13 12:20:32 +0000
commitcba5b65658676e2817ef72bf2c6b66e42a801ca9 (patch)
tree2f1ab6a389bdfafd9e2ad41e684386a8b0a3d186 /src/modules/help/HelpWindow.cpp
parentFix the webView preview painting (diff)
downloadKVIrc-cba5b65658676e2817ef72bf2c6b66e42a801ca9.tar.gz
KVIrc-cba5b65658676e2817ef72bf2c6b66e42a801ca9.tar.bz2
KVIrc-cba5b65658676e2817ef72bf2c6b66e42a801ca9.zip
Code improvements in help window when using webkit(wip)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5570 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/help/HelpWindow.cpp')
-rw-r--r--src/modules/help/HelpWindow.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/modules/help/HelpWindow.cpp b/src/modules/help/HelpWindow.cpp
index 8adc29c70..21b5192d7 100644
--- a/src/modules/help/HelpWindow.cpp
+++ b/src/modules/help/HelpWindow.cpp
@@ -25,6 +25,7 @@
#include "HelpWindow.h"
#include "HelpWidget.h"
+#include "kvi_settings.h"
#include "KviApplication.h"
#include "KviIconManager.h"
#include "KviOptions.h"
@@ -46,7 +47,7 @@ extern HelpIndex * g_pDocIndex;
extern KviPointerList<HelpWindow> * g_pHelpWindowList;
extern KviPointerList<HelpWidget> * g_pHelpWidgetList;
-bool g_bIndexingDone = FALSE;
+//bool g_bIndexingDone = FALSE;
HelpWindow::HelpWindow(KviMainWindow * lpFrm,const char * name)
: KviWindow(KviWindow::Help,lpFrm,name)
{
@@ -117,9 +118,9 @@ void HelpWindow::initialSetup()
{
m_pIndexSearch->setFocus();
- if(!g_bIndexingDone)
+/* if(!g_bIndexingDone)
{
- g_bIndexingDone=TRUE;
+ g_bIndexingDone=true;*/
QString szDoclist,szDict;
g_pApp->getLocalKvircDirectory(szDoclist,KviApplication::Help,"help.doclist." KVI_SOURCES_DATE);
@@ -134,8 +135,9 @@ void HelpWindow::initialSetup()
m_pBtnRefreshIndex->setEnabled(true);
} else {
g_pDocIndex->makeIndex();
- }
- }
+
+ }
+ //}
}
void HelpWindow::indexingStart( int iNum )
@@ -258,7 +260,12 @@ void HelpWindow::startSearch()
setCursor( Qt::ArrowCursor );
}
+
+#ifdef COMPILE_WEBKIT_SUPPORT
+QWebView * HelpWindow::textBrowser()
+#else
QTextBrowser * HelpWindow::textBrowser()
+#endif
{
return m_pHelpWidget->textBrowser();
}
@@ -267,7 +274,11 @@ void HelpWindow::showIndexTopic()
{
if (m_pIndexSearch->text().isEmpty()|| !m_pIndexListWidget->selectedItems().count()) return;
int i=g_pDocIndex->titlesList().indexOf(m_pIndexListWidget->selectedItems().at(0)->text());
+ #ifdef COMPILE_WEBKIT_SUPPORT
+ textBrowser()->load(QUrl(g_pDocIndex->documentList()[ i ]));
+ #else
textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[ i ]));
+ #endif
}
void HelpWindow::searchInIndex( const QString &s )
@@ -291,14 +302,22 @@ void HelpWindow::indexSelected ( QListWidgetItem *item )
{
if (!item) return;
int i=g_pDocIndex->titlesList().indexOf(item->text());
+ #ifdef COMPILE_WEBKIT_SUPPORT
+ textBrowser()->load(QUrl(g_pDocIndex->documentList()[ i ]));
+ #else
textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[ i ]));
+ #endif
}
void HelpWindow::searchSelected ( QListWidgetItem *item )
{
if (!item) return;
int i=g_pDocIndex->titlesList().indexOf(item->text());
+ #ifdef COMPILE_WEBKIT_SUPPORT
+ textBrowser()->load(QUrl(g_pDocIndex->documentList()[ i ]));
+ #else
textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[ i ]));
+ #endif
}
QPixmap * HelpWindow::myIconPtr()