Ignore:
Timestamp:
07/12/13 10:48:43 (18 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
4f9718b
Parents:
b5cfd4d
git-author:
Ken Moore <ken@…> (07/12/13 10:44:39)
git-committer:
Ken Moore <ken@…> (07/12/13 10:48:43)
Message:

Add a bunch of error loggin to the backend processes, and also add a new dialog for displaying these error logs. Also fix the detection of an update failure.

File:
1 edited

Legend:

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

    rf3baeb9 rc71b68c  
    3838   connect(PMAN, SIGNAL(ProcessFinished(int)),this,SLOT(slotProcessFinished(int)) ); 
    3939   connect(PMAN, SIGNAL(ProcessMessage(int, QString)),this,SLOT(slotProcessMessage(int, QString)) ); 
    40    connect(PMAN, SIGNAL(ProcessError(int,QString)),this,SLOT(slotProcessError(int,QString)) ); 
     40   connect(PMAN, SIGNAL(ProcessError(int,QStringList)),this,SLOT(slotProcessError(int,QStringList)) ); 
    4141   PENDINGREMOVAL.clear(); PENDINGDL.clear(); PENDINGINSTALL.clear(); PENDINGUPDATE.clear(); PENDINGOTHER.clear(); 
    4242   sDownload=FALSE; sInstall=FALSE; sUpdate=FALSE; sRemove=FALSE; 
     
    557557  } 
    558558  return output; 
    559   /* 
    560   for(int i=0; i<pbilist.length(); i++){ 
    561     if(PBIHASH[pbilist[i]].metaID == appID){ 
    562       switch (PBIHASH[pbilist[i]].status){ 
    563         case InstalledPBI::DOWNLOADING: 
    564           output = tr("Downloading"); break; 
    565         case InstalledPBI::INSTALLING: 
    566           output = tr("Installing"); break; 
    567         case InstalledPBI::REMOVING: 
    568           output = tr("Removing"); break; 
    569         case InstalledPBI::UPDATING: 
    570           output = tr("Updating"); break; 
    571         case InstalledPBI::PENDINGDOWNLOAD: 
    572           output = tr("Pending Download"); break; 
    573         case InstalledPBI::PENDINGINSTALL: 
    574           output = tr("Pending Install"); break; 
    575         case InstalledPBI::PENDINGREMOVAL: 
    576           output = tr("Pending Removal"); break; 
    577         case InstalledPBI::PENDINGUPDATE: 
    578           output = tr("Pending Update"); break; 
    579         default: //do nothing for the rest 
    580           output.clear(); 
    581       } 
    582       if(!output.isEmpty()){ break; } //break out of the loop 
    583     } 
    584   } 
    585   return output;*/ 
    586559} 
    587560 
     
    943916   bool resync = FALSE; 
    944917   if(ID == ProcessManager::UPDATE){ 
     918     if(!isInstalled(cUpdate).isEmpty()){ 
     919       //Error completing the update - old version still installed 
     920       QString title = QString(tr("%1 Update Error:")).arg(PBIHASH[cUpdate].name); 
     921       QString err = tr("The PBI could not be updated, please try again later"); 
     922       QStringList log = PMAN->getProcessLog(ProcessManager::UPDATE); 
     923       emit Error(title,err,log); 
     924     } 
    945925     cUpdate.clear(); //remove that it is finished 
    946926     sUpdate=FALSE; 
     
    969949         QString title = QString(tr("%1 Download Error:")).arg(PBIHASH[cDownload].name); 
    970950         QString err = tr("The PBI could not be downloaded, please try again later"); 
    971          emit Error(title,err); 
     951         QStringList log = PMAN->getProcessLog(ProcessManager::DOWNLOAD); 
     952         emit Error(title,err,log); 
    972953       }else{ 
    973954         //Now Check to see if an alternate version needs to be removed 
    974          QString otherID = isInstalled( Extras::nameToID(PBIHASH[cDownload].name) ); 
     955         QString otherID = isInstalled( PBIHASH[cDownload].metaID ); 
    975956         QString cmd; 
    976957         if(!otherID.isEmpty()){ 
     
    1003984} 
    1004985 
    1005 void PBIBackend::slotProcessError(int ID, QString err){ 
     986void PBIBackend::slotProcessError(int ID, QStringList log){ 
    1006987   QString title; 
    1007988   QString name; 
     989   QString message; 
    1008990   if(ID == ProcessManager::UPDATE){ 
    1009991     if(!sUpdate){ //not stopped manually 
    1010992       if(PBIHASH.contains(cUpdate)){name = PBIHASH[cUpdate].name; } 
    1011993       title = QString(tr("%1 Update Error:")).arg(name);  
     994       message = tr("The update process experienced an error and could not be completed"); 
    1012995     } 
    1013996   } 
     
    1016999       if(APPHASH.contains(cInstall)){name = APPHASH[cInstall].name; } 
    10171000       title = QString(tr("%1 Installation Error:")).arg(name); 
     1001       message = tr("The installation process experienced an error and could not be completed"); 
    10181002     } 
    10191003   } 
     
    10221006       if(PBIHASH.contains(cRemove)){name = PBIHASH[cRemove].name; } 
    10231007       title = QString(tr("%1 Removal Error:")).arg(name); 
     1008       message = tr("The removal process experienced an error and could not be completed"); 
    10241009     } 
    10251010   } 
     
    10281013       if(APPHASH.contains(cDownload)){name = APPHASH[cDownload].name; } 
    10291014       title = QString(tr("%1 Download Error:")).arg(name); 
     1015       message = tr("The download process experienced an error and could not be completed"); 
    10301016     } 
    10311017   } 
     
    10331019     if(PBIHASH.contains(cOther)){name = PBIHASH[cOther].name; } 
    10341020     title = QString(tr("%1 PBI Error:")).arg(name);  
    1035    } 
    1036    if(!title.isEmpty() && !err.isEmpty()){ 
    1037      qDebug() << "Process Error:" << title << err; 
    1038      emit Error(title,err); //send error signal 
     1021     message = tr("The process experienced an error and could not be completed"); 
     1022   } 
     1023   if(!title.isEmpty() && !message.isEmpty()){ 
     1024     qDebug() << "Process Error:" << title << log; 
     1025     emit Error(title,message,log); //send error signal 
    10391026   } 
    10401027   slotProcessFinished(ID); //clean up 
Note: See TracChangeset for help on using the changeset viewer.