Ignore:
Timestamp:
03/12/14 10:41:41 (7 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.2, releng/10.0.3
Children:
c754313
Parents:
535e584
Message:

Add the ability for the AppCafe? to set a system flag when the status of available PBI updates changes (using the new SystemFlag? class in libpcbsd).

File:
1 edited

Legend:

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

    redece96 re6fddc0  
    3333  statusLabel = new QLabel(); 
    3434  ui->statusbar->addWidget(statusLabel); 
     35  updatesAvailable = -1; //app starting value (0 for no updates, 1 for updates available) 
    3536} 
    3637 
     
    261262    cList << ui->tree_install_apps->topLevelItem(i)->whatsThis(0); 
    262263  } 
     264  bool up = false; //to keep track of whether updates are available for any installed apps 
    263265  //Quick finish if no items installed 
    264266  if(installList.isEmpty()){ 
     
    289291          cList.insert(i,installList[i]); //reflect this inclusion into the current list 
    290292        } 
     293        up = up || !PBI->upgradeAvailable(installList[i]).isEmpty(); //will remain "true" if a single item has an update available 
    291294      }else if(todo==1){ 
    292295        //Update current item 
    293296        formatInstalledItemDisplay( ui->tree_install_apps->topLevelItem(i) ); 
     297        up = up || !PBI->upgradeAvailable(installList[i]).isEmpty(); //will remain "true" if a single item has an update available 
    294298      }else{ 
    295299        //Remove current item 
     
    307311  } //end of empty list check 
    308312   
     313  //Check whether the system needs to be notified about a new PBI update availability 
     314  if( (updatesAvailable==0 && up) || (updatesAvailable==1 && !up) ){ 
     315    SystemFlags::setFlag(SystemFlags::PbiUpdate); 
     316  } 
     317  if(up){ updatesAvailable = 1; } 
     318  else{ updatesAvailable = 0; } 
    309319  //Make sure that there is an item selected 
    310320  if(ui->tree_install_apps->topLevelItemCount() > 0 ){ 
Note: See TracChangeset for help on using the changeset viewer.