Changeset 8823fd2


Ignore:
Timestamp:
10/28/14 06:27:08 (2 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.1
Children:
f2c507b
Parents:
fa9ac0a
Message:

Update pc-systemupdatertray to use the new syscache system information (updatesavailable)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-systemupdatertray/TrayUI.cpp

    r7964857 r8823fd2  
    77  PKGSTATUS=-1; 
    88  SYSSTATUS=-1; 
    9   WARDENSTATUS=0; 
     9  WARDENSTATUS=-1; 
    1010  noInternet = false; //assume internet is available until we get a failure 
    1111  wasworking = false; 
     
    7575  watcher = new SystemFlagWatcher(this); 
    7676        connect(watcher,SIGNAL(FlagChanged(SystemFlags::SYSFLAG, SystemFlags::SYSMESSAGE)),this,SLOT(watcherMessage(SystemFlags::SYSFLAG, SystemFlags::SYSMESSAGE)) ); 
    77   watcher->checkForRecent(10); //Check for flags in the last 10 minutes 
     77  //watcher->checkForRecent(10); //Check for flags in the last 10 minutes 
    7878   
    7979  //Now connect the tray clicked signal 
     
    215215  if(SYSSTATUS==1){ return; } //already checking for updates 
    216216  qDebug() << " -Starting System Check..."; 
    217   QString cmd = "sudo pc-updatemanager check"; 
     217  //QString cmd = "sudo pc-updatemanager check"; 
    218218  SYSSTATUS=1; //working 
    219   QProcess::startDetached(cmd);          
     219  //QProcess::startDetached(cmd); 
     220  updateTrayIcon(); 
     221  updateToolTip();   
     222  QString info = pcbsd::Utils::runShellCommand("syscache hasupdates").join(""); 
     223  if(info.isEmpty() || info.contains("ERROR") ){ SYSSTATUS=0; } 
     224  else if(info.toLower().simplified()=="true"){ SYSSTATUS=2; } 
     225  else{ SYSSTATUS=0; } //no updates available 
    220226} 
    221227 
    222228void TrayUI::startWardenCheck(){ 
    223   WARDENSTATUS=0; 
    224   return; //Warden check command not currently working - just keep it invisible 
     229  //WARDENSTATUS=0; 
     230  //return; //Warden check command not currently working - just keep it invisible 
    225231  //------- 
    226232  if(rebootNeeded()){ return; } //do not start another check if a reboot is required first 
     
    271277void TrayUI::checkForUpdates(){ 
    272278  //Simplification function to start all checks 
    273     startSYSCheck(); //put this first since it starts a detached process 
     279    startSYSCheck(); 
    274280    startPKGCheck(); 
    275281    startWardenCheck(); 
     
    329335          break; 
    330336        case SystemFlags::SysUpdate: 
    331           if(msg==SystemFlags::UpdateAvailable){ SYSSTATUS=2; } 
    332           else if(msg==SystemFlags::Working){ SYSSTATUS=1; } 
    333           else if(msg==SystemFlags::Success){ SYSSTATUS=0; } 
     337          if(msg==SystemFlags::Working){ SYSSTATUS=1; } 
    334338          else if(msg==SystemFlags::Updating){ SYSSTATUS=3; } 
    335           else if(msg==SystemFlags::Error){ SYSSTATUS=0; noInternet=true; } 
    336339          else{ startSYSCheck(); } //unknown - check it 
    337340          break;         
Note: See TracChangeset for help on using the changeset viewer.