Ignore:
Timestamp:
02/20/14 14:48:48 (11 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1
Children:
07e812b
Parents:
6b7fcc5
Message:

Add the ability for the AppCafe? to install random PBI files on the system through a menu option, and update the Installed tab interface a bit to make it more uniform between the two pages. Still have a couple things to do to finish it up, but it is perfectly functional.

File:
1 edited

Legend:

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

    r2916111 re543bca  
    292292  //Now emit the signal that items have changed or been added 
    293293  emit LocalPBIChanges(); 
     294} 
     295 
     296void PBIBackend::installPBIFromFile(QStringList files){ 
     297  qDebug() << "Install PBI files requested for:" << files; 
     298  for(int i=0; i<files.length(); i++){ 
     299    if(!files[i].endsWith(".pbi")){ continue; } //invalid file 
     300    //Now load the info about this PBI 
     301    bool root = PBIFileNeedsRoot(files[i]); 
     302    //Now create the commands 
     303    QString cmd = addRootCMD("pc-pbigui "+files[i], root); 
     304    //Don't bother integrating it furthur, the pc-pbigui will handle it all better 
     305    //  and if it actually gets installed it will automatically get detected/added to the AppCafe list 
     306    PENDINGOTHER << "EXTERNAL:::"+cmd; 
     307  } 
     308  QTimer::singleShot(0,this,SLOT(checkProcesses()) ); 
    294309} 
    295310 
     
    861876 } 
    862877  
    863  QStringList PBIBackend::removePbiCMD(QString pbiID, QStringList list){ 
     878QStringList PBIBackend::removePbiCMD(QString pbiID, QStringList list){ 
    864879   //Used for removing any pending CMD's for a particular pbiID 
    865880   QStringList output; 
     
    868883   } 
    869884   return output; 
    870  } 
    871   
     885} 
     886 
     887bool PBIBackend::PBIFileNeedsRoot(QString filepath){ 
     888  //Used to grab information from a stand-along *.pbi file 
     889  bool root = false; 
     890  QStringList info = Extras::getCmdOutput("pbi_add -i "+filepath); 
     891  //Only check if it needs root 
     892  root = !info.filter("RootInstall:").join("").contains("NO"); 
     893  return root; 
     894} 
     895 
    872896void PBIBackend::queueInstall(QString appID, QString version){ 
    873897  //This function assumes that the new app/version combination is not already installed on the system 
     
    9951019     QString cmd = PENDINGOTHER[0].section(":::",1,50); 
    9961020     PENDINGOTHER.removeAt(0);     
    997      if( !cmd.isEmpty() && PBIHASH.contains(cOther) ){ 
     1021     if( !cmd.isEmpty() && (PBIHASH.contains(cOther) || cOther=="EXTERNAL") ){ 
    9981022       //Update the PBI status 
    999        PBIHASH[cOther].setStatus(InstalledPBI::WORKING); 
    1000        emit PBIStatusChange(cOther); 
     1023       if(cOther!="EXTERNAL"){ 
     1024         PBIHASH[cOther].setStatus(InstalledPBI::WORKING); 
     1025         emit PBIStatusChange(cOther); 
     1026       } 
    10011027       //Start the process 
    10021028       PMAN->startProcess(ProcessManager::OTHER,cmd); 
Note: See TracChangeset for help on using the changeset viewer.