Changeset edece96


Ignore:
Timestamp:
02/28/14 05:28:02 (7 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
a07b515
Parents:
f996b54
Message:

Clean up a couple more backup functions in the AppCafe?:
1) If you try to remove a non-installed PBI, it will simply cancel the installation instead
2) Make sure that if a non-installed PBI is right-clicked, it only shows the "cancel" option.

Location:
src-qt4/pc-softwaremanager
Files:
2 edited

Legend:

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

    r4e7809d redece96  
    537537      mmenu->addAction( QIcon(":icons/add-root.png"),tr("Add (All Users)"),this,SLOT(slotActionAddMenuAll()) ); 
    538538  } 
    539   //Paths are always available 
     539  //Paths are always available if actually installed 
     540  if( !PBI->isInstalled(pbiID).isEmpty() ){ 
    540541    QMenu *pmenu = contextActionMenu->addMenu( QIcon(":icons/xdg_paths.png"), tr("Path Links")); 
    541542      pmenu->addAction( QIcon(":icons/add.png"),tr("Add"),this,SLOT(slotActionAddPath()) ); 
    542543      pmenu->addAction( QIcon(":icons/remove.png"),tr("Remove"),this,SLOT(slotActionRemovePath()) );   
    543544      pmenu->addAction( QIcon(":icons/add-root.png"),tr("Add (All Users)"),this,SLOT(slotActionAddPathAll()) ); 
     545  } 
    544546  if(info[2]=="true"){ 
    545547    QMenu *fmenu = contextActionMenu->addMenu( QIcon(":icons/xdg_mime.png"), tr("File Associations")); 
     
    11951197  ui->tool_bapp_download->setEnabled(FALSE); //make sure it cannot be clicked more than once before page refresh 
    11961198  //Now show the Installed tab 
    1197   //ui->tabWidget->setCurrentWidget(ui->tab_installed); 
     1199  ui->tabWidget->setCurrentWidget(ui->tab_installed); 
    11981200} 
    11991201 
  • src-qt4/pc-softwaremanager/pbiBackend.cpp

    r7e41a70 redece96  
    259259  qDebug() << "PBI Removals requested for:" << pbiID; 
    260260  QStringList xdgrem; xdgrem << "remove-desktop" << "remove-menu" << "remove-mime" << "remove-paths"; 
     261  QStringList cancelList; 
    261262  for(int i=0; i<pbiID.length(); i++){ 
     263             
    262264    if(PBIHASH.contains(pbiID[i])){ 
    263       //Remove XDG entries for this app 
    264       PENDINGREMOVAL << pbiID[i]+":::"+generateXDGCMD(pbiID[i],xdgrem, FALSE); 
    265       //Remove the app itself 
    266       PENDINGREMOVAL << pbiID[i]+":::"+generateRemoveCMD(pbiID[i]); 
    267       //Now update the status 
    268       PBIHASH[pbiID[i]].setStatus(InstalledPBI::PENDINGREMOVAL); 
    269       emit PBIStatusChange(pbiID[i]); 
     265      if( isInstalled(pbiID[i]).isEmpty() ){ 
     266        //Not a fully-installed PBI - cancel it instead 
     267        cancelList << pbiID[i]; 
     268      }else{ 
     269        //Remove XDG entries for this app 
     270        PENDINGREMOVAL << pbiID[i]+":::"+generateXDGCMD(pbiID[i],xdgrem, FALSE); 
     271        //Remove the app itself 
     272        PENDINGREMOVAL << pbiID[i]+":::"+generateRemoveCMD(pbiID[i]); 
     273        //Now update the status 
     274        PBIHASH[pbiID[i]].setStatus(InstalledPBI::PENDINGREMOVAL); 
     275        emit PBIStatusChange(pbiID[i]); 
     276      } 
    270277    }else{ 
    271278      qDebug() << pbiID[i] << "not a valid PBI to remove";           
    272279    } 
    273280  } 
     281  //If there are PBIs to cancel, do that too 
     282  if(!cancelList.isEmpty()){ cancelActions(cancelList); } 
    274283  //Now check/start the remove process 
    275284  QTimer::singleShot(0,this,SLOT(checkProcesses()) ); 
Note: See TracChangeset for help on using the changeset viewer.