tsdevicedialog/tsdevicedialogplugin/src/tstasksgriditem.cpp
changeset 102 8b8b34fa9751
parent 99 7aaf39b772ac
child 107 b34d53f6acdf
equal deleted inserted replaced
100:0920c6a9b6c8 102:8b8b34fa9751
    52 
    52 
    53     HbFrameItem *applicationLabelFrame = new HbFrameItem(this);
    53     HbFrameItem *applicationLabelFrame = new HbFrameItem(this);
    54     applicationLabelFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
    54     applicationLabelFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
    55     applicationLabelFrame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans");
    55     applicationLabelFrame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans");
    56 
    56 
    57     mActiveLabel = new HbTextItem(hbTrId("txt_tsw_label_active"), this);
    57     mActiveLabel = new HbTextItem(hbTrId("txt_ts_label_active"), this);
    58     mActiveLabelFrame = new HbFrameItem(this);
    58     mActiveLabelFrame = new HbFrameItem(this);
    59     mActiveLabelFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
    59     mActiveLabelFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
    60     mActiveLabelFrame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans");
    60     mActiveLabelFrame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans");
    61 
    61 
    62     mDeleteButton->setIcon(HbIcon("qtg_mono_exit"));
    62     mDeleteButton->setIcon(HbIcon("qtg_mono_exit"));
    86 
    86 
    87 void TsTasksGridItem::updateChildItems()
    87 void TsTasksGridItem::updateChildItems()
    88 {
    88 {
    89     mScreenshotLabel->setIcon(modelIndex().data(Qt::DecorationRole).value<HbIcon>());
    89     mScreenshotLabel->setIcon(modelIndex().data(Qt::DecorationRole).value<HbIcon>());
    90     mApplicationNameLabel->setText(modelIndex().data(Qt::DisplayRole).toString());
    90     mApplicationNameLabel->setText(modelIndex().data(Qt::DisplayRole).toString());
    91     QVariant status(modelIndex().data(TsDataRoles::Closable));
    91     
    92     const bool isClosable(status.isValid() && status.toBool());
    92     QVariant closableData(modelIndex().data(TsDataRoles::Closable));
       
    93     const bool isClosable(closableData.isValid() && closableData.toBool());
    93     if (isClosable) {
    94     if (isClosable) {
    94         mDeleteButton->show();
    95         mDeleteButton->show();
       
    96     } else {
       
    97         mDeleteButton->hide();
       
    98     }
       
    99     
       
   100     QVariant activeData(modelIndex().data(TsDataRoles::Active));
       
   101     const bool isActive(activeData.isValid() && activeData.toBool());
       
   102     if (isActive) {
    95         mActiveLabel->show();
   103         mActiveLabel->show();
    96         mActiveLabelFrame->show();
   104         mActiveLabelFrame->show();
    97     } else {
   105     } else {
    98         mDeleteButton->hide();
       
    99         mActiveLabel->hide();
   106         mActiveLabel->hide();
   100         mActiveLabelFrame->hide();
   107         mActiveLabelFrame->hide();
   101     }
   108     }
   102 }
   109 }