userguide/src/HelpContentsView.cpp
changeset 24 bce8d4d2cc72
parent 15 c0dfc135a46c
--- a/userguide/src/HelpContentsView.cpp	Mon May 03 12:24:47 2010 +0300
+++ b/userguide/src/HelpContentsView.cpp	Wed May 26 00:57:05 2010 +0300
@@ -46,27 +46,18 @@
 
     connect(mBrowser, SIGNAL(linkClicked(const QUrl&)), this, SLOT(onLinkClicked(const QUrl&)));
     connect(mBrowser, SIGNAL(urlChanged(const QUrl&)), this, SLOT(onUrlChanged(const QUrl&)));
-    connect(mainWindow(), SIGNAL(currentViewChanged(HbView*)), this, SLOT(onCurrentViewChanged(HbView*)));
+    connect(mainWindow(), SIGNAL(viewReady()), this, SLOT(onViewReady()));
 }
 
 void HelpContentsView::initDocMl()
 {
- // Create widget hierarchy
-    setObjectName( DOCML_VIEW_CONTENTS );
-
-    // List existing root elements - this allows us to refer to objects in the XML 
-    // which are created outside the document.
-    QObjectList roots;
-    roots.append( this );
-
-	mBuilder.setObjectTree(roots);
-
+	initBaseDocMl();
     mBuilder.load(QRC_DOCML_CONTENTS);
 }
 
 void HelpContentsView::initBackAction()
 {
-    mSoftKeyAction = new HbAction(Hb::BackAction);
+    mSoftKeyAction = new HbAction(Hb::BackNaviAction  );
     connect(mSoftKeyAction, SIGNAL(triggered()), this, SLOT(onBackAction()));
 }
 
@@ -110,16 +101,16 @@
 void HelpContentsView::openHelpContent(const QUrl& url)
 {
     QString html;
-    QString baseUrl = url.toString();
-    HelpDataProvider::instance()->getHelpContentData(html, baseUrl);
-    mBrowser->setHtml(html, baseUrl);
+    QString urlStr = url.toString();
+    HelpDataProvider::instance()->getHelpContentData(html, urlStr);
+	mBrowser->setHtml(html, urlStr);
 }
 
 ////////////////////////////////////////////////////////////////////////////////////////////
 
-void HelpContentsView::onCurrentViewChanged(HbView *view)
+void HelpContentsView::onViewReady()
 {
-    if(this == view)
+    if(isVisible())
     {
         setNavigationAction(mSoftKeyAction);
         openHelpContent();
@@ -140,7 +131,7 @@
 	}
 	else
 	{
-		emit activateView(HelpViewCategory);
+		emit activateView(PreviousView);
 	}
 }