appinstaller/AppinstUi/sifuidevicedialogplugin/src/sifuidialogcontentwidget.cpp
changeset 44 329d304c1aa1
parent 42 d17dc5398051
child 55 ac7f90a6ff4c
child 60 245df5276b97
equal deleted inserted replaced
42:d17dc5398051 44:329d304c1aa1
   136     iconAndAppLayout->addItem(mAppIcon);
   136     iconAndAppLayout->addItem(mAppIcon);
   137 
   137 
   138     // Application name and version
   138     // Application name and version
   139     Q_ASSERT(mAppDetailsLayout == 0);
   139     Q_ASSERT(mAppDetailsLayout == 0);
   140     mAppDetailsLayout = new QGraphicsLinearLayout(Qt::Vertical);
   140     mAppDetailsLayout = new QGraphicsLinearLayout(Qt::Vertical);
   141     Q_ASSERT(mAppName == 0);
   141     createAppName(applicationName(parameters));
   142     mAppName = new HbLabel(applicationName(parameters));
       
   143     mAppDetailsLayout->addItem(mAppName);
   142     mAppDetailsLayout->addItem(mAppName);
   144 
   143 
   145     // Application size
   144     // Application size
   146     Q_ASSERT(mAppSize == 0);
   145     Q_ASSERT(mAppSize == 0);
   147     updateAppSize(parameters);
   146     updateAppSize(parameters);
   197         if (mAppName) {
   196         if (mAppName) {
   198             if (mAppName->plainText() != appNameStr) {
   197             if (mAppName->plainText() != appNameStr) {
   199                 mAppName->setPlainText(appNameStr);
   198                 mAppName->setPlainText(appNameStr);
   200             }
   199             }
   201         } else {
   200         } else {
   202             HbLabel *appName = new HbLabel(appNameStr);
   201             createAppName(appNameStr);
   203             mAppDetailsLayout->insertItem(KAppNameIndex, appName);
   202             mAppDetailsLayout->insertItem(KAppNameIndex, mAppName);
   204             mAppName = appName;
       
   205         }
   203         }
   206     }
   204     }
   207 
   205 
   208     // Application size
   206     // Application size
   209     updateAppSize(parameters);
   207     updateAppSize(parameters);
   350 //
   348 //
   351 void SifUiDialogContentWidget::addDetail(const QString &detailText)
   349 void SifUiDialogContentWidget::addDetail(const QString &detailText)
   352 {
   350 {
   353     Q_ASSERT(mAppDetailsLayout != 0);
   351     Q_ASSERT(mAppDetailsLayout != 0);
   354     HbLabel *detailItem = new HbLabel(detailText);
   352     HbLabel *detailItem = new HbLabel(detailText);
       
   353     detailItem->setTextWrapping(Hb::TextWordWrap);
       
   354     detailItem->setFontSpec(HbFontSpec(HbFontSpec::Secondary));
   355     mAppDetailsLayout->addItem(detailItem);
   355     mAppDetailsLayout->addItem(detailItem);
       
   356 }
       
   357 
       
   358 // ----------------------------------------------------------------------------
       
   359 // SifUiDialogContentWidget::createAppName()
       
   360 // ----------------------------------------------------------------------------
       
   361 //
       
   362 void SifUiDialogContentWidget::createAppName(const QString &appName)
       
   363 {
       
   364     Q_ASSERT(mAppName == 0);
       
   365     mAppName = new HbLabel(appName);
       
   366     mAppName->setTextWrapping(Hb::TextWordWrap);
       
   367     mAppName->setFontSpec(HbFontSpec(HbFontSpec::Secondary));
   356 }
   368 }
   357 
   369 
   358 // ----------------------------------------------------------------------------
   370 // ----------------------------------------------------------------------------
   359 // SifUiDialogContentWidget::updateAppIcon()
   371 // SifUiDialogContentWidget::updateAppIcon()
   360 // ----------------------------------------------------------------------------
   372 // ----------------------------------------------------------------------------
   400                 if (mAppSize->plainText() != appSizeStr) {
   412                 if (mAppSize->plainText() != appSizeStr) {
   401                     mAppSize->setPlainText(appSizeStr);
   413                     mAppSize->setPlainText(appSizeStr);
   402                 }
   414                 }
   403             } else {
   415             } else {
   404                 HbLabel *appSize = new HbLabel(appSizeStr);
   416                 HbLabel *appSize = new HbLabel(appSizeStr);
       
   417                 appSize->setTextWrapping(Hb::TextWordWrap);
       
   418                 appSize->setFontSpec(HbFontSpec(HbFontSpec::Secondary));
   405                 mAppDetailsLayout->insertItem(KAppSizeIndex, appSize);
   419                 mAppDetailsLayout->insertItem(KAppSizeIndex, appSize);
   406                 mAppSize = appSize;
   420                 mAppSize = appSize;
   407             }
   421             }
   408         }
   422         }
   409     }
   423     }
   429                 case EPhoneMemory:
   443                 case EPhoneMemory:
   430                     if (size > KSifUiMega) {
   444                     if (size > KSifUiMega) {
   431                         //: Drive name for internal phone memory with megabytes of free space.
   445                         //: Drive name for internal phone memory with megabytes of free space.
   432                         //: %1 is replaced with drive letter (usually 'C')
   446                         //: %1 is replaced with drive letter (usually 'C')
   433                         //: %2 is replaced with available free space (in megabytes, MB)
   447                         //: %2 is replaced with available free space (in megabytes, MB)
   434                         //TODO: use hbTrId("txt_sisxui_device_memory_mb") when available
   448                         //TODO: enable when available
       
   449                         //driveList.append(hbTrId("txt_installer_device_memory_mb")
       
   450                         //    .arg(volume).arg(size/KSifUiMega));
   435                         driveList.append(tr("%1: Device (%L2 MB free)"
   451                         driveList.append(tr("%1: Device (%L2 MB free)"
   436                             ).arg(volume).arg(size/KSifUiMega));
   452                             ).arg(volume).arg(size/KSifUiMega));
   437                     } else {
   453                     } else {
   438                         //: Drive name for internal phone memory with kilobytes of free space.
   454                         //: Drive name for internal phone memory with kilobytes of free space.
   439                         //: %1 is replaced with drive letter (usually 'C')
   455                         //: %1 is replaced with drive letter (usually 'C')
   440                         //: %2 is replaced with available free space (in kilobytes, kB)
   456                         //: %2 is replaced with available free space (in kilobytes, kB)
   441                         //TODO: use hbTrId("txt_sisxui_device_memory_kb") when available
   457                         //TODO: enable when available
       
   458                         //driveList.append(hbTrId("txt_installer_device_memory_kb")
       
   459                         //    .arg(volume).arg(size/KSifUiKilo));
   442                         driveList.append(tr("%1: Device (%L2 kB free)"
   460                         driveList.append(tr("%1: Device (%L2 kB free)"
   443                             ).arg(volume).arg(size/KSifUiKilo));
   461                             ).arg(volume).arg(size/KSifUiKilo));
   444                     }
   462                     }
   445                     break;
   463                     break;
   446                 case EMassStorage:
   464                 case EMassStorage:
   447                     if (size > KSifUiMega) {
   465                     if (size > KSifUiMega) {
   448                         //: Drive name for mass storage with megabytes of free space.
   466                         //: Drive name for mass storage with megabytes of free space.
   449                         //: %1 is replaced with drive letter (usually 'E')
   467                         //: %1 is replaced with drive letter (usually 'E')
   450                         //: %2 is replaced with available free space (in megabytes, MB)
   468                         //: %2 is replaced with available free space (in megabytes, MB)
   451                         // TODO: use hbTrId("txt_sisxui_mass_storage_mb") when available
   469                         // TODO: enable when available
       
   470                         //driveList.append(hbTrId("txt_installer_mass_storage_mb")
       
   471                         //    .arg(volume).arg(size/KSifUiMega));
   452                         driveList.append(tr("%1: Mass.mem (%L2 MB free)"
   472                         driveList.append(tr("%1: Mass.mem (%L2 MB free)"
   453                             ).arg(volume).arg(size/KSifUiMega));
   473                             ).arg(volume).arg(size/KSifUiMega));
   454                     } else {
   474                     } else {
   455                         //: Drive name for mass storage with kilobytes of free space.
   475                         //: Drive name for mass storage with kilobytes of free space.
   456                         //: %1 is replaced with drive letter (usually 'E')
   476                         //: %1 is replaced with drive letter (usually 'E')
   457                         //: %2 is replaced with available free space (in kilobytes, kB)
   477                         //: %2 is replaced with available free space (in kilobytes, kB)
   458                         // TODO: use hbTrId("txt_sisxui_mass_storage_kb") when available
   478                         // TODO: enable when available
       
   479                         //driveList.append(hbTrId("txt_installer_mass_storage_kb")
       
   480                         //    .arg(volume).arg(size/KSifUiKilo));
   459                         driveList.append(tr("%1: Mass.mem (%L2 kB free)"
   481                         driveList.append(tr("%1: Mass.mem (%L2 kB free)"
   460                             ).arg(volume).arg(size/KSifUiKilo));
   482                             ).arg(volume).arg(size/KSifUiKilo));
   461                     }
   483                     }
   462                     break;
   484                     break;
   463                 case EMemoryCard:
   485                 case EMemoryCard:
   464                     if (size > KSifUiMega) {
   486                     if (size > KSifUiMega) {
   465                         //: Drive name for memory card with megabytes of free space.
   487                         //: Drive name for memory card with megabytes of free space.
   466                         //: %1 is replaced with drive letter (usually 'F')
   488                         //: %1 is replaced with drive letter (usually 'F')
   467                         //: %2 is replaced with available free space (in megabytes, MB)
   489                         //: %2 is replaced with available free space (in megabytes, MB)
   468                         // TODO: use hbTrId("txt_sisxui_memory_card_mb") when available
   490                         // TODO: enable when available
       
   491                         //driveList.append(hbTrId("txt_installer_memory_card_mb")
       
   492                         //    .arg(volume).arg(size/KSifUiMega));
   469                         driveList.append(tr("%1: Mem.card (%L2 MB free)"
   493                         driveList.append(tr("%1: Mem.card (%L2 MB free)"
   470                             ).arg(volume).arg(size/KSifUiMega));
   494                             ).arg(volume).arg(size/KSifUiMega));
   471                     } else {
   495                     } else {
   472                         //: Drive name for memory card with kilobytes of free space.
   496                         //: Drive name for memory card with kilobytes of free space.
   473                         //: %1 is replaced with drive letter (usually 'F')
   497                         //: %1 is replaced with drive letter (usually 'F')
   474                         //: %2 is replaced with available free space (in kilobytes, kB)
   498                         //: %2 is replaced with available free space (in kilobytes, kB)
   475                         // TODO: use hbTrId("txt_sisxui_memory_card_kb") when available
   499                         // TODO: enable when available
       
   500                         //driveList.append(hbTrId("txt_installer_memory_card_kb")
       
   501                         //    .arg(volume).arg(size/KSifUiKilo));
   476                         driveList.append(tr("%1: Mem.card (%L2 kB free)"
   502                         driveList.append(tr("%1: Mem.card (%L2 kB free)"
   477                             ).arg(volume).arg(size/KSifUiKilo));
   503                             ).arg(volume).arg(size/KSifUiKilo));
   478                     }
   504                     }
   479                     break;
   505                     break;
   480                 default:
   506                 default: