Ignore:
Timestamp:
Jul 9, 2013 2:57:42 PM (12 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
a3c7851
Parents:
e7d8648
Message:

Add a quick "cancel" button to the AppCafe?, and make the quick buttons dynamically visible as necessary. Also fix up and add a couple icons for the small update button.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-softwaremanager/pbiBackend.cpp

    recf5153 rf3baeb9  
    159159// ===== Local/Repo Interaction Functions ===== 
    160160QString PBIBackend::isInstalled(QString appID){ 
     161  //check if the pbiID was given (quick) 
     162  if(PBIHASH.contains(appID)){ 
     163    if(PBIHASH[appID].path.isEmpty()){ return ""; } 
     164    else{ return appID; } 
     165  } 
    161166  //Returns pbiID of the installed application 
    162167  QString output; 
     
    167172  QStringList pbiID = PBIHASH.keys(); //get list of installed PBI's 
    168173  for(int i=0; i<pbiID.length();i++){ 
    169     QString pbi = Extras::nameToID(PBIHASH[pbiID[i]].name); 
     174    QString pbi = Extras::nameToID(PBIHASH[pbiID[i]].metaID); 
    170175    if( (pbi == appID) && !PBIHASH[pbiID[i]].path.isEmpty() ){ 
    171176      output = pbiID[i]; 
     
    179184  QString output; 
    180185  if(!PBIHASH.contains(pbiID)){return output;} 
    181   QString appID = Extras::nameToID(PBIHASH[pbiID].name); 
     186  QString appID = Extras::nameToID(PBIHASH[pbiID].metaID); 
    182187  if(APPHASH.contains(appID)){ 
    183188    if(APPHASH[appID].latestVersion != PBIHASH[pbiID].version){output = APPHASH[appID].latestVersion;}   
     
    247252  //Now check/start the remove process 
    248253  QTimer::singleShot(0,this,SLOT(checkProcesses()) ); 
    249 } 
    250  
    251 void PBIBackend::stopUpdate(QStringList pbiID){ 
    252   qDebug() << "Stop Update requested for:" << pbiID; 
    253254} 
    254255 
     
    522523 
    523524QString PBIBackend::currentAppStatus( QString appID ){ 
     525  QString output; 
     526  int status = -999; 
     527  //pbiID given (quicker) 
     528  if(PBIHASH.contains(appID)){ status = PBIHASH[appID].status; } 
     529  else{ 
     530    //appID given 
     531    if(!APPHASH.contains(appID)){ return ""; } 
     532    QStringList pbilist = PBIHASH.keys(); 
     533    for(int i=0; i<pbilist.length(); i++){ 
     534      if(PBIHASH[pbilist[i]].metaID == appID){ status = PBIHASH[pbilist[i]].status; } 
     535    } 
     536  } 
    524537  //Determine if the app is currently in a pending state 
    525   if(!APPHASH.contains(appID)){ return ""; } 
    526   QString output; 
    527   QStringList pbilist = PBIHASH.keys(); 
     538  switch (status){ 
     539        case InstalledPBI::DOWNLOADING: 
     540          output = tr("Downloading"); break; 
     541        case InstalledPBI::INSTALLING: 
     542          output = tr("Installing"); break; 
     543        case InstalledPBI::REMOVING: 
     544          output = tr("Removing"); break; 
     545        case InstalledPBI::UPDATING: 
     546          output = tr("Updating"); break; 
     547        case InstalledPBI::PENDINGDOWNLOAD: 
     548          output = tr("Pending Download"); break; 
     549        case InstalledPBI::PENDINGINSTALL: 
     550          output = tr("Pending Install"); break; 
     551        case InstalledPBI::PENDINGREMOVAL: 
     552          output = tr("Pending Removal"); break; 
     553        case InstalledPBI::PENDINGUPDATE: 
     554          output = tr("Pending Update"); break; 
     555        default: //do nothing for the rest 
     556          output.clear(); 
     557  } 
     558  return output; 
     559  /* 
    528560  for(int i=0; i<pbilist.length(); i++){ 
    529561    if(PBIHASH[pbilist[i]].metaID == appID){ 
     
    551583    } 
    552584  } 
    553   return output; 
     585  return output;*/ 
    554586} 
    555587 
Note: See TracChangeset for help on using the changeset viewer.