Revision: 201025
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 06 Jul 2010 14:06:37 +0300
changeset 34 4533d75b8d4e
parent 33 1038206aa0cb
child 35 3ae60d69bf22
child 39 30223e2ae041
Revision: 201025 Kit: 2010127
userguide/Userguide.pro
userguide/inc/HelpBaseView.h
userguide/inc/HelpDataProvider.h
userguide/inc/HelpKeywordView.h
userguide/resources/Userguide.qrc
userguide/resources/qtg_large_help.svg
userguide/src/HelpBaseView.cpp
userguide/src/HelpCategoryView.cpp
userguide/src/HelpDataProvider.cpp
userguide/src/HelpKeywordView.cpp
userguide/src/HelpMainWindow.cpp
userguide/src/HelpUtils.cpp
--- a/userguide/Userguide.pro	Wed Jun 23 18:03:20 2010 +0300
+++ b/userguide/Userguide.pro	Tue Jul 06 14:06:37 2010 +0300
@@ -60,11 +60,11 @@
 
     CONFIG += mobility
     MOBILITY = systeminfo
-  	LIBS += -lezip -lxqservice -lxqserviceutil
+  	LIBS += -lezip -lxqservice -lxqserviceutil -lcone -leikcore -lmediaclientaudio -leikcoctl -leiksrv -lapparc -lavkon -lefsrv -lcharconv -lws32 -lhal -lgdi -lapgrfx
   	include(rom/userguide.pri)
+  	SKINICON = qtg_large_help
 }
-				
-ICON = resources/qtg_large_help.svg
+
 RESOURCES += resources/Userguide.qrc
 
 debug: DESTDIR = ./debug
--- a/userguide/inc/HelpBaseView.h	Wed Jun 23 18:03:20 2010 +0300
+++ b/userguide/inc/HelpBaseView.h	Tue Jul 06 14:06:37 2010 +0300
@@ -45,18 +45,12 @@
     void onToolbarFind()	{ emit showFindList(); };
     void onToolbarOnlineSupport();
 
-protected slots:
-	virtual void onOrientationChanged(Qt::Orientation orientation);
-
 protected:
 	void initBaseDocMl();
 
 protected:
 	HelpUIBuilder	mBuilder;
 	HbToolBar*		mToolBar;
-	
-private:
-	void RefreshToolbarText(Qt::Orientation orientation);
 };
 
 #endif //HELPBATHVIEW_H
--- a/userguide/inc/HelpDataProvider.h	Wed Jun 23 18:03:20 2010 +0300
+++ b/userguide/inc/HelpDataProvider.h	Tue Jul 06 14:06:37 2010 +0300
@@ -35,14 +35,13 @@
     static void destroyInstance();
 
 public:
+	void createHelpCategory();
 	QAbstractItemModel* getCategoryData();
 	QAbstractItemModel* getSearchData(const QString& key=QString());
 	void setHelpContentUrl(const QString& uid, const QString& href);
 	void getHelpContentData(QString& content, QString& url);
 
 private:
-	void createHelpCategory();
-
 	//construct 1st category
 	void constructCategory();
 	//construct help category in rom
--- a/userguide/inc/HelpKeywordView.h	Wed Jun 23 18:03:20 2010 +0300
+++ b/userguide/inc/HelpKeywordView.h	Tue Jul 06 14:06:37 2010 +0300
@@ -45,15 +45,16 @@
 	void initVirtualKeyboard();
 
 private:
-	void onOrientationChanged(Qt::Orientation orientation);
-
-private:
 	HbLabel* label();
     
 private:
 	void updateVisibleItems(bool visible);
 	void ResetSearchPanel();	
 	void updateLabelPos();
+	void showToolBar(bool visible);
+
+private slots:
+	void onOrientationChanged(Qt::Orientation orientation);
 
 private slots: // handle system event
     void onViewReady();
--- a/userguide/resources/Userguide.qrc	Wed Jun 23 18:03:20 2010 +0300
+++ b/userguide/resources/Userguide.qrc	Tue Jul 06 14:06:37 2010 +0300
@@ -6,10 +6,4 @@
 		<file alias="contentsView.docml">xml/contentsView.docml</file>
     <file alias="baseView.docml">xml/baseView.docml</file>    
   </qresource>
-	
-	<qresource prefix= "/images">
-		<file alias="show_all.svg">images/qtg_mono_show_all.svg</file>
-		<file alias="link_nokia.svg">images/qtg_mono_link_nokia.svg</file>
-	</qresource>
-
 </RCC>
\ No newline at end of file
--- a/userguide/resources/qtg_large_help.svg	Wed Jun 23 18:03:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<rect fill="none" height="60" width="60"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1" x1="30" x2="30" y1="8.16" y2="51.02">
-<stop offset="0" stop-color="#E5FFB2"/>
-<stop offset="0.39" stop-color="#6AAB18"/>
-<stop offset="0.68" stop-color="#247307"/>
-<stop offset="1" stop-color="#C2FF4A"/>
-</linearGradient>
-<circle cx="29.998" cy="29.385" fill="url(#SVGID_1)" r="21.427"/>
-<radialGradient cx="30.2" cy="10.41" gradientUnits="userSpaceOnUse" id="SVGID_2" r="39.38">
-<stop offset="0" stop-color="#AFED23"/>
-<stop offset="0.81" stop-color="#358C0C"/>
-<stop offset="1" stop-color="#67AD1A"/>
-</radialGradient>
-<path d="M29.998,50.2c-11.478,0-20.815-9.337-20.815-20.814S18.521,8.571,29.998,8.571 c11.477,0,20.814,9.337,20.814,20.815S41.475,50.2,29.998,50.2L29.998,50.2z" fill="url(#SVGID_2)"/>
-<path d="M23.264,21.626v-3.515c2.128-0.49,4.146-0.735,6.06-0.735 c2.821,0,4.986,0.547,6.492,1.642c1.507,1.093,2.26,2.697,2.26,4.815c0,1.231-0.291,2.274-0.869,3.129 c-0.581,0.854-4.583,4.875-4.978,5.425c-0.396,0.55-0.592,1.201-0.592,1.955v0.752h-5.615V34.09c0-1.22,0.267-2.25,0.799-3.094 c0.532-0.843,1.461-1.887,2.789-3.13c1.041-0.969,2.332-3.217,2.332-3.695c0-2.163-1.303-3.245-3.91-3.245 C26.562,20.927,24.974,21.16,23.264,21.626z M28.803,44.69c-0.944,0-1.757-0.335-2.439-1.005c-0.68-0.67-1.021-1.488-1.021-2.457 c0-0.957,0.338-1.775,1.013-2.457c0.676-0.682,1.491-1.022,2.447-1.022c0.957,0,1.775,0.341,2.458,1.022s1.022,1.5,1.022,2.457 c0,0.969-0.341,1.787-1.022,2.457C30.58,44.355,29.76,44.69,28.803,44.69z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M23.264,20.78v-3.515c2.128-0.49,4.146-0.735,6.06-0.735 c2.821,0,4.986,0.547,6.492,1.642c1.507,1.093,2.26,2.697,2.26,4.815c0,1.231-0.291,2.274-0.869,3.129 c-0.581,0.854-4.583,4.875-4.978,5.425c-0.396,0.55-0.592,1.202-0.592,1.954v0.754h-5.615v-1.005c0-1.22,0.267-2.251,0.799-3.094 c0.532-0.843,1.461-1.887,2.789-3.13c1.041-0.969,2.332-3.217,2.332-3.695c0-2.163-1.303-3.245-3.91-3.245 C26.562,20.081,24.974,20.314,23.264,20.78z M28.803,43.844c-0.944,0-1.757-0.334-2.439-1.004c-0.68-0.67-1.021-1.489-1.021-2.458 c0-0.956,0.338-1.775,1.013-2.457c0.676-0.682,1.491-1.022,2.447-1.022c0.957,0,1.775,0.341,2.458,1.022 c0.683,0.681,1.022,1.501,1.022,2.457c0,0.969-0.341,1.788-1.022,2.458C30.58,43.51,29.76,43.844,28.803,43.844z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_3" x1="30.67" x2="30.67" y1="15.45" y2="42.99">
-<stop offset="0" stop-color="#F6FDFF"/>
-<stop offset="1" stop-color="#ADB3B5"/>
-</linearGradient>
-<path d="M23.264,19.79v-3.515c2.128-0.491,4.146-0.735,6.06-0.735c2.821,0,4.986,0.546,6.492,1.642 c1.507,1.093,2.26,2.697,2.26,4.814c0,1.232-0.291,2.274-0.869,3.129C36.625,25.98,32.623,30,32.229,30.55 c-0.396,0.55-0.592,1.202-0.592,1.955v0.753h-5.615v-1.005c0-1.22,0.267-2.25,0.799-3.093c0.532-0.843,1.461-1.887,2.789-3.13 c1.041-0.968,2.332-3.216,2.332-3.694c0-2.163-1.303-3.245-3.91-3.245C26.562,19.091,24.974,19.323,23.264,19.79z M28.803,42.854 c-0.944,0-1.757-0.334-2.439-1.004c-0.68-0.67-1.021-1.489-1.021-2.457c0-0.957,0.338-1.775,1.013-2.458 c0.676-0.681,1.491-1.022,2.447-1.022c0.957,0,1.775,0.342,2.458,1.022c0.683,0.682,1.022,1.501,1.022,2.458 c0,0.968-0.341,1.787-1.022,2.457C30.58,42.52,29.76,42.854,28.803,42.854z" fill="url(#SVGID_3)"/>
-<rect fill="none" height="59.996" width="59.996"/>
-</svg>
--- a/userguide/src/HelpBaseView.cpp	Wed Jun 23 18:03:20 2010 +0300
+++ b/userguide/src/HelpBaseView.cpp	Tue Jul 06 14:06:37 2010 +0300
@@ -57,22 +57,5 @@
     notificationDialog->show();
 }
 
-void HelpBaseView::onOrientationChanged(Qt::Orientation orientation)
-{
-    RefreshToolbarText(orientation);
-}
-
-void HelpBaseView::RefreshToolbarText(Qt::Orientation orientation)
-{
-	bool isLandscape = (Qt::Horizontal==orientation);
-    HbAction* tollbarAction = mBuilder.findObject<HbAction*>(DOCML_ACTION_ALL);
-    tollbarAction->setText(isLandscape ? qtTrId(TXT_BUTTON_ALL) : QString());
-
-    tollbarAction = mBuilder.findObject<HbAction*>(DOCML_ACTION_SEARCH);
-    tollbarAction->setText(isLandscape ? qtTrId(TXT_BUTTON_FIND) : QString());
-
-    tollbarAction = mBuilder.findObject<HbAction*>(DOCML_ACTION_LINK_NOKIA);
-    tollbarAction->setText(isLandscape ? qtTrId(TXT_BUTTON_LINK_SUPPORT) : QString());
-}
 
 // end of file
--- a/userguide/src/HelpCategoryView.cpp	Wed Jun 23 18:03:20 2010 +0300
+++ b/userguide/src/HelpCategoryView.cpp	Tue Jul 06 14:06:37 2010 +0300
@@ -25,6 +25,7 @@
 #include <hbtreeview.h>
 #include <hbscrollbar.h>
 #include <hbmenu.h>
+#include <hbtoolbar.h>
 
 #include "HelpDataProvider.h"
 
--- a/userguide/src/HelpDataProvider.cpp	Wed Jun 23 18:03:20 2010 +0300
+++ b/userguide/src/HelpDataProvider.cpp	Tue Jul 06 14:06:37 2010 +0300
@@ -72,11 +72,6 @@
 
 QAbstractItemModel* HelpDataProvider::getCategoryData()
 {
-    if(!mHelpModel->rowCount())
-    {
-        createHelpCategory();
-    }
-
     return mHelpModel;
 }
 
@@ -89,6 +84,7 @@
 
 	mLastSrhKey = key;
     mSearhResultModel->setFilterRegExp(key);
+
 	
     return mSearhResultModel;
 }
@@ -187,7 +183,6 @@
 
 void HelpDataProvider::constructBuiltInCategory(const QString& path, const QStringList& uidList, const QStringList& titleList)
 {
-//	constructCategory2(title, uid);
 	if(uidList.count() != titleList.count())
 	{
 		//ToDo
@@ -363,7 +358,7 @@
 		return;
 	}
 
-	for(int i = featureIdLst.count()  - 1; i <= 0; i--)
+	for(int i = featureIdLst.count()  - 1; i >= 0; i--)
 	{
 		int featureID = featureIdLst.at(i).toInt();
 		if(!HelpUtils::suppportFeatureID(featureID))
@@ -426,7 +421,7 @@
 		return;
 	}
 
-	for(int i = featureIdLst.count()  - 1; i <= 0; i--)
+	for(int i = featureIdLst.count()  - 1; i >= 0; i--)
 	{
 		int featureID = featureIdLst.at(i).toInt();
 		if(!HelpUtils::suppportFeatureID(featureID))
--- a/userguide/src/HelpKeywordView.cpp	Wed Jun 23 18:03:20 2010 +0300
+++ b/userguide/src/HelpKeywordView.cpp	Tue Jul 06 14:06:37 2010 +0300
@@ -104,7 +104,7 @@
 
 void HelpKeywordView::loadAllContent()
 {
-	toolBar()->hide();
+	showToolBar(false);
 	mBuilder.load(QRC_DOCML_KEYWORD, DOCML_LAYOUT_SEARCH);
 	ResetSearchPanel();
 	
@@ -172,6 +172,19 @@
 	}
 }
 
+void HelpKeywordView::showToolBar(bool visible)
+{
+	Hb::SceneItems items = Hb::ToolBarItem;
+	if(visible)
+	{
+		showItems(items);
+	}
+	else
+	{
+		hideItems(items);
+	}
+}
+
 ////////////////////////////////////////////////////////////////////////////////////////////
 // handle system event
 
@@ -223,7 +236,7 @@
 	{
 		mBuilder.load(QRC_DOCML_KEYWORD, DOCML_LAYOUT_SEARCH_NO_SRHPAL);
 	}	
-	toolBar()->show();
+	showToolBar(true);
 }
 
 void HelpKeywordView::onSearchPanelCriteriaChanged(const QString &criteria)
@@ -237,8 +250,7 @@
 	{
 		mBuilder.load(QRC_DOCML_KEYWORD, DOCML_LAYOUT_SEARCH);
 	}
-
-	toolBar()->hide();
+	showToolBar(false);
 }
 
 ////////////////////////////////////////////////////////////////////////////////////////////
@@ -257,14 +269,14 @@
 	updateVisibleItems(true);
 	qreal mainHeight  = mainWindow()->layoutRect().height();
 	qreal toolbarHeight = toolBar()->size().height();
-	qreal height = mainHeight - (toolBar()->isVisible() ? toolbarHeight : 0);
+	qreal height = mainHeight - ( toolBar()->isVisible() ? toolbarHeight : 0);
 	this->setMaximumHeight(height);
 	updateLabelPos();
 }
 
 void HelpKeywordView::onOrientationChanged(Qt::Orientation orientation)
 {
-	HelpBaseView::onOrientationChanged(orientation);
+	Q_UNUSED(orientation);
 	updateLabelPos();
 }
 
--- a/userguide/src/HelpMainWindow.cpp	Wed Jun 23 18:03:20 2010 +0300
+++ b/userguide/src/HelpMainWindow.cpp	Tue Jul 06 14:06:37 2010 +0300
@@ -35,6 +35,7 @@
 mContentsView(NULL)
 {
     QObject::connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(saveActivity()));
+	HelpDataProvider::instance()->createHelpCategory();
     activateCategoryView();
 }
 
@@ -62,6 +63,7 @@
 			}
 			break;
 	    default:
+			HbApplication::exit();
 	        break;
 	}
 }
@@ -134,30 +136,29 @@
 
 void HelpMainWindow::saveActivity()
 {
-  HbActivityManager* activityManager = qobject_cast<HbApplication*>(qApp)->activityManager();
+	HbActivityManager* activityManager = qobject_cast<HbApplication*>(qApp)->activityManager();
 
-  // clean up any previous versions of this activity from the activity manager.
-  bool ok = activityManager->removeActivity("UserGuideMainView");
-  if ( !ok )
-      {
-      //qFatal("Remove failed" );
-      }
+	// clean up any previous versions of this activity from the activity manager.
+	bool ok = activityManager->removeActivity("UserGuideMainView");
+	if ( !ok )
+	{
+		//qFatal("Remove failed" );
+	}
 
-  // get a screenshot for saving to the activity manager
-  QVariantHash metadata;
-  metadata.insert("screenshot", QPixmap::grabWidget(this, rect()));
+	// get a screenshot for saving to the activity manager
+	QVariantHash metadata;
+	metadata.insert("screenshot", QPixmap::grabWidget(this, rect()));
 
-  // save any data necessary to save the state
-  QByteArray serializedActivity;
-  QDataStream stream(&serializedActivity, QIODevice::WriteOnly | QIODevice::Append);
-  stream << "whatever data you need to save the state adequately";
+	// save any data necessary to save the state
+	QByteArray serializedActivity;
+	QDataStream stream(&serializedActivity, QIODevice::WriteOnly | QIODevice::Append);
 
-  // add the activity to the activity manager
-  ok = activityManager->addActivity("UserGuideMainView", serializedActivity, metadata);
-  if ( !ok )
-      {
-      qFatal("Add failed" );
-      }
+	// add the activity to the activity manager
+	ok = activityManager->addActivity("UserGuideMainView", serializedActivity, metadata);
+	if ( !ok )
+	{
+		qFatal("Add failed" );
+	}
 }
 
 // end of file
--- a/userguide/src/HelpUtils.cpp	Wed Jun 23 18:03:20 2010 +0300
+++ b/userguide/src/HelpUtils.cpp	Tue Jul 06 14:06:37 2010 +0300
@@ -232,9 +232,6 @@
 
     QString uriStr("appto://");
     uriStr.append(appUid);
-  /*  uriStr.append("?");
-    uriStr.append("activityname");
-    uriStr.append("=MainView&key1=data1&key2=data2");*/
     QUrl uri(uriStr); 
     
     XQApplicationManager appmgr;