perfapps/perfmon/ui/hb/app/src/mainview.cpp
changeset 53 819e59dfc032
parent 52 36d60d12b4af
equal deleted inserted replaced
52:36d60d12b4af 53:819e59dfc032
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <QActionGroup>
    18 #include <QActionGroup>
    19 #include <HbApplication>
    19 #include <HbApplication>
       
    20 #include <hbmainwindow.h>
    20 #include <HbMenu>
    21 #include <HbMenu>
    21 #include <HbToolBar>
    22 #include <HbToolBar>
    22 #include <HbAction>
    23 #include <HbAction>
    23 #include <HbMessageBox>
    24 #include <HbMessageBox>
    24 #include <HbLabel>
    25 #include <HbLabel>
    82 
    83 
    83 void MainView::showValues()
    84 void MainView::showValues()
    84 {
    85 {
    85     // remove old widget & take ownership
    86     // remove old widget & take ownership
    86     takeWidget();
    87     takeWidget();
       
    88     if(scene()){
       
    89         scene()->removeItem(mGraphDataContainer);
       
    90     }
    87     mGraphDataContainer->hideContainer();
    91     mGraphDataContainer->hideContainer();
    88     mValueDataContainer->showContainer(); 
    92     mValueDataContainer->showContainer(); 
    89     // set new widget
    93     // set new widget
    90     this->setWidget(mValueDataContainer);
    94     this->setWidget(mValueDataContainer);
    91     
    95     
    98 
   102 
    99 void MainView::showGraphs()
   103 void MainView::showGraphs()
   100 {
   104 {
   101     // remove old widget & take ownership
   105     // remove old widget & take ownership
   102     takeWidget();
   106     takeWidget();
       
   107     if(scene()){
       
   108         scene()->removeItem(mValueDataContainer);
       
   109     }
   103     mValueDataContainer->hideContainer();    
   110     mValueDataContainer->hideContainer();    
   104     mGraphDataContainer->showContainer();
   111     mGraphDataContainer->showContainer();
   105     // set new widget
   112     // set new widget
   106     this->setWidget(mGraphDataContainer);
   113     this->setWidget(mGraphDataContainer);
   107 
   114 
   126 }
   133 }
   127 
   134 
   128 void MainView::showAbout()
   135 void MainView::showAbout()
   129 {
   136 {
   130     HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
   137     HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
   131     messageBox->setText("Version 1.2.1 - 10th September 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
   138     messageBox->setText("Version 1.2.2 - 24th September 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
   132     HbLabel *header = new HbLabel("About PerfMon", messageBox);
   139     HbLabel *header = new HbLabel("About PerfMon", messageBox);
   133     messageBox->setHeadingWidget(header);
   140     messageBox->setHeadingWidget(header);
   134     messageBox->setAttribute(Qt::WA_DeleteOnClose);
   141     messageBox->setAttribute(Qt::WA_DeleteOnClose);
   135     messageBox->setTimeout(HbPopup::NoTimeout);
   142     messageBox->setTimeout(HbPopup::NoTimeout);
   136     messageBox->open();
   143     messageBox->open();