appinstaller/AppinstUi/sifuiinstallindicatorplugin/src/sifuiinstallindicator.cpp
changeset 60 245df5276b97
parent 42 d17dc5398051
equal deleted inserted replaced
53:ae54820ef82c 60:245df5276b97
   112                     //: Indicates that application installation is completed.
   112                     //: Indicates that application installation is completed.
   113                     // TODO: localized UI string needed
   113                     // TODO: localized UI string needed
   114                     data = tr("Installed");
   114                     data = tr("Installed");
   115                 }
   115                 }
   116             } else {
   116             } else {
   117                 switch(mPhase) {
   117                 switch (mPhase) {
   118                     case Installing:
   118                     case Installing:
   119                         //: Indicates that application installation is ongoing.
   119                         //: Indicates that application installation is ongoing.
   120                         // TODO: localized UI string needed
   120                         // TODO: localized UI string needed
   121                         data = tr("Installing");
   121                         data = tr("Installing");
   122                         break;
   122                         break;
   138 
   138 
   139         case SecondaryTextRole:
   139         case SecondaryTextRole:
   140             if (mIsComplete) {
   140             if (mIsComplete) {
   141                 data = mAppName;
   141                 data = mAppName;
   142             } else {
   142             } else {
   143                 if (!mAppName.isEmpty()) {
   143                 switch (mPhase) {
   144                     //: Application name %1 followed by installation progress %L2
   144                     case Installing:
   145                     // TODO: localized UI string needed
   145                     case Downloading:
   146                     data = tr("%1 (%L2 %)").arg(mAppName).arg(mProgress);
   146                         if (!mAppName.isEmpty()) {
       
   147                             //: Application name %1 followed by installation progress %L2
       
   148                             // TODO: localized UI string needed
       
   149                             data = tr("%1 (%L2 %)").arg(mAppName).arg(mProgress);
       
   150                         }
       
   151                         break;
       
   152                     case CheckingCerts:
       
   153                     default:
       
   154                         data = mAppName;
       
   155                         break;
   147                 }
   156                 }
   148             }
   157             }
   149             break;
   158             break;
   150 
   159 
   151         default:
   160         default:
   193         } else if (parameter.type() == QVariant::Map) {
   202         } else if (parameter.type() == QVariant::Map) {
   194             QVariantMap map = parameter.toMap();
   203             QVariantMap map = parameter.toMap();
   195             QMapIterator<QString,QVariant> iter(map);
   204             QMapIterator<QString,QVariant> iter(map);
   196             while (iter.hasNext()) {
   205             while (iter.hasNext()) {
   197                 iter.next();
   206                 iter.next();
   198                 if (iter.key() == KSifUiInstallIndicatorAppNameKey) {
   207                 if (iter.key() == KSifUiInstallIndicatorAppName) {
   199                     mAppName = iter.value().toString();
   208                     mAppName = iter.value().toString();
   200                 } else if (iter.key() == KSifUiInstallIndicatorPhaseKey) {
   209                 } else if (iter.key() == KSifUiInstallIndicatorPhase) {
   201                     int value = Installing;
   210                     int value = Installing;
   202                     getIntValue(iter.value(), value);
   211                     getIntValue(iter.value(), value);
   203                     mPhase = static_cast<Phase>(value);
   212                     mPhase = static_cast<Phase>(value);
   204                 } else if (iter.key() == KSifUiInstallIndicatorProgressKey) {
   213                 } else if (iter.key() == KSifUiInstallIndicatorProgress) {
   205                     getIntValue(iter.value(), mProgress);
   214                     getIntValue(iter.value(), mProgress);
   206                 } else if (iter.key() == KSifUiInstallIndicatorCompleteKey) {
   215                 } else if (iter.key() == KSifUiInstallIndicatorComplete) {
   207                     mIsComplete = true;
   216                     mIsComplete = true;
   208                     mErrorCode = KErrNone;
   217                     mErrorCode = KErrNone;
   209                     getIntValue(iter.value(), mErrorCode);
   218                     getIntValue(iter.value(), mErrorCode);
   210                 } else if (iter.key() == KSifUiInstallIndicatorIconKey) {
   219                 } else if (iter.key() == KSifUiInstallIndicatorIcon) {
   211                     // TODO: icon?
   220                     // TODO: icon?
   212                 } else {
   221                 } else {
   213                     // ignore other types
   222                     // ignore other types
   214                 }
   223                 }
   215             }
   224             }