controlpanelplugins/aboutplugin/src/cpaboutopensourceview.cpp
changeset 39 5aa7c7ec6b8e
equal deleted inserted replaced
37:cb294e641644 39:5aa7c7ec6b8e
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0""
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  
       
    15  *
       
    16  */
       
    17 #include "cpaboutopensourceview.h"
       
    18 #include "cpaboututils.h"
       
    19 #include <HbScrollArea>
       
    20 #include <HbGroupBox>
       
    21 #include <QGraphicsLinearLayout>
       
    22 /*!
       
    23   \class CpAboutOpenSourceView
       
    24 */
       
    25 
       
    26 /*!
       
    27     Constructor
       
    28 */
       
    29 CpAboutOpenSourceView::CpAboutOpenSourceView(QGraphicsItem *parent) 
       
    30 : HbView(parent)    
       
    31 {
       
    32     QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
       
    33     layout->setContentsMargins(0, 0, 0, 0);
       
    34     //view title        
       
    35     HbGroupBox *label = new HbGroupBox();
       
    36     label->setHeading(hbTrId("txt_cp_subhead_open_source_software_notices"));
       
    37     layout->addItem(label);
       
    38     for (int i=1; i <=2; ++i) {
       
    39         HbTextEdit *edit = CpAboutUtils::createTextEdit();        
       
    40         QString str(CpAboutUtils::contentString(hbTrId("txt_cp_open_source_software_notices_"), i));        
       
    41         edit->setHtml(CpAboutUtils::preprocessText(str));
       
    42         layout->addItem(edit);
       
    43     }    
       
    44     HbScrollArea* scrollArea = new HbScrollArea();    
       
    45     QGraphicsWidget* content = new QGraphicsWidget();    
       
    46     content->setLayout(layout);   
       
    47     scrollArea->setContentWidget(content);    
       
    48     scrollArea->setScrollDirections(Qt::Vertical);
       
    49     setWidget(scrollArea);    
       
    50 }
       
    51 
       
    52 /*!
       
    53     Destructor
       
    54 */
       
    55 CpAboutOpenSourceView::~CpAboutOpenSourceView()
       
    56 {
       
    57 }
       
    58 
       
    59 
       
    60 
       
    61