userguide/src/HelpContentsView.cpp
changeset 18 375271912456
parent 15 c0dfc135a46c
child 23 99b096216bc8
equal deleted inserted replaced
15:c0dfc135a46c 18:375271912456
    49     connect(mainWindow(), SIGNAL(currentViewChanged(HbView*)), this, SLOT(onCurrentViewChanged(HbView*)));
    49     connect(mainWindow(), SIGNAL(currentViewChanged(HbView*)), this, SLOT(onCurrentViewChanged(HbView*)));
    50 }
    50 }
    51 
    51 
    52 void HelpContentsView::initDocMl()
    52 void HelpContentsView::initDocMl()
    53 {
    53 {
    54  // Create widget hierarchy
    54 	initBaseDocMl();
    55     setObjectName( DOCML_VIEW_CONTENTS );
       
    56 
       
    57     // List existing root elements - this allows us to refer to objects in the XML 
       
    58     // which are created outside the document.
       
    59     QObjectList roots;
       
    60     roots.append( this );
       
    61 
       
    62 	mBuilder.setObjectTree(roots);
       
    63 
       
    64     mBuilder.load(QRC_DOCML_CONTENTS);
    55     mBuilder.load(QRC_DOCML_CONTENTS);
    65 }
    56 }
    66 
    57 
    67 void HelpContentsView::initBackAction()
    58 void HelpContentsView::initBackAction()
    68 {
    59 {
    69     mSoftKeyAction = new HbAction(Hb::BackAction);
    60     mSoftKeyAction = new HbAction(Hb::BackNaviAction  );
    70     connect(mSoftKeyAction, SIGNAL(triggered()), this, SLOT(onBackAction()));
    61     connect(mSoftKeyAction, SIGNAL(triggered()), this, SLOT(onBackAction()));
    71 }
    62 }
    72 
    63 
    73 ///////////////////////////////////////////////////////////////////////////////////////
    64 ///////////////////////////////////////////////////////////////////////////////////////
    74 
    65 
   110 void HelpContentsView::openHelpContent(const QUrl& url)
   101 void HelpContentsView::openHelpContent(const QUrl& url)
   111 {
   102 {
   112     QString html;
   103     QString html;
   113     QString baseUrl = url.toString();
   104     QString baseUrl = url.toString();
   114     HelpDataProvider::instance()->getHelpContentData(html, baseUrl);
   105     HelpDataProvider::instance()->getHelpContentData(html, baseUrl);
   115     mBrowser->setHtml(html, baseUrl);
   106 	mBrowser->setHtml(html, baseUrl);
   116 }
   107 }
   117 
   108 
   118 ////////////////////////////////////////////////////////////////////////////////////////////
   109 ////////////////////////////////////////////////////////////////////////////////////////////
   119 
   110 
   120 void HelpContentsView::onCurrentViewChanged(HbView *view)
   111 void HelpContentsView::onCurrentViewChanged(HbView *view)
   121 {
   112 {
   122     if(this == view)
   113     if(this == view)
   123     {
   114     {
       
   115 		setVisible(true);
   124         setNavigationAction(mSoftKeyAction);
   116         setNavigationAction(mSoftKeyAction);
   125         openHelpContent();
   117         openHelpContent();
   126     }
   118     }
   127     else
   119     else
   128     {
   120     {
   138 	{
   130 	{
   139 		mBrowser->back();
   131 		mBrowser->back();
   140 	}
   132 	}
   141 	else
   133 	else
   142 	{
   134 	{
   143 		emit activateView(HelpViewCategory);
   135 		emit activateView(PreviousView);
   144 	}
   136 	}
   145 }
   137 }
   146 
   138 
   147 ///////////////////////////////////////////////////////////////////////////////////////
   139 ///////////////////////////////////////////////////////////////////////////////////////
   148 
   140