tsdevicedialog/tsdevicedialogplugin/src/tstasksgriditem.cpp
changeset 109 e0aa398e6810
parent 104 9b022b1f357c
child 115 3ab5c078b490
--- a/tsdevicedialog/tsdevicedialogplugin/src/tstasksgriditem.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tstasksgriditem.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -14,8 +14,6 @@
 * Description:
 *
 */
-#include "tstasksgriditem.h"
-
 #include <HbPushButton>
 #include <HbAbstractItemView>
 #include <HbFrameItem>
@@ -23,6 +21,7 @@
 #include <HbIconItem>
 #include <HbStyleLoader>
 
+#include "tstasksgriditem.h"
 #include "tsdataroles.h"
 
 /*!
@@ -32,12 +31,21 @@
 */
 
 
-TsTasksGridItem::TsTasksGridItem() : HbAbstractViewItem(), mScreenshotLabel(0), mApplicationNameLabel(0), mDeleteButton(0), mActiveLabelFrame(0), mActiveLabel(0)
+TsTasksGridItem::TsTasksGridItem() 
+: 
+HbAbstractViewItem(), 
+mScreenshotLabel(0), 
+mApplicationNameLabel(0), 
+mDeleteButton(0), 
+mActiveLabelFrame(0), 
+mActiveLabel(0)
 {
     // Register the custom docml and css to provide our own style to the list items
-    bool widgetmlLoaded = HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.widgetml");
+    bool widgetmlLoaded = 
+        HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.widgetml");
     Q_ASSERT(widgetmlLoaded);
-    bool cssLoaded = HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.css");
+    bool cssLoaded = 
+        HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.css");
     Q_ASSERT(cssLoaded);
 }
 
@@ -54,7 +62,7 @@
     applicationLabelFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
     applicationLabelFrame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans");
 
-    mActiveLabel = new HbTextItem(hbTrId("txt_tsw_label_active"), this);
+    mActiveLabel = new HbTextItem(hbTrId("txt_ts_label_active"), this);
     mActiveLabelFrame = new HbFrameItem(this);
     mActiveLabelFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
     mActiveLabelFrame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans");
@@ -88,14 +96,21 @@
 {
     mScreenshotLabel->setIcon(modelIndex().data(Qt::DecorationRole).value<HbIcon>());
     mApplicationNameLabel->setText(modelIndex().data(Qt::DisplayRole).toString());
-    QVariant status(modelIndex().data(TsDataRoles::Closable));
-    const bool isClosable(status.isValid() && status.toBool());
+    
+    QVariant closableData(modelIndex().data(TsDataRoles::Closable));
+    const bool isClosable(closableData.isValid() && closableData.toBool());
     if (isClosable) {
         mDeleteButton->show();
+    } else {
+        mDeleteButton->hide();
+    }
+    
+    QVariant activeData(modelIndex().data(TsDataRoles::Active));
+    const bool isActive(activeData.isValid() && activeData.toBool());
+    if (isActive) {
         mActiveLabel->show();
         mActiveLabelFrame->show();
     } else {
-        mDeleteButton->hide();
         mActiveLabel->hide();
         mActiveLabelFrame->hide();
     }