Changeset 304095c


Ignore:
Timestamp:
Apr 25, 2013 11:18:40 AM (12 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.1-release, 9.2-release, releng/10.0, releng/10.0.1
Children:
35c5dc4a
Parents:
ad90f5d
Message:

Make system update tray aware of pc-pkgmanager

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

Legend:

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

    r1620346 r304095c  
    2626#define SYSTEM_UP2DATE 0 
    2727#define SYSTEM_UPDATE_AVAIL 1 
     28#define PACKAGE_UPDATE_AVAIL 1 
    2829#define SYSTEM_CHECKING4UPDATES 4 
    2930#define SYSTEM_UPDATING 5 
     
    340341 
    341342  bool haveUp = false; 
     343  bool haveNGUp = false; 
    342344  bool haveUpWarden = false; 
    343345   
     
    372374    line = m.readLine().simplified(); 
    373375    if ( line.indexOf("To start the upgrade") == 0 ) { 
    374       haveUp = true; 
     376      haveNGUp = true; 
    375377      break; 
    376378    }  
     
    423425  } else if ( haveUp ) { 
    424426    programstatus = SYSTEM_UPDATE_AVAIL; 
     427  } else if ( haveNGUp ) { 
     428    programstatus = PACKAGE_UPDATE_AVAIL; 
    425429  } else { 
    426430    // We have no updates available, indicate that now. 
     
    459463  if ( programstatus == SYSTEM_CHECKING4UPDATES )  
    460464     Icon.addFile(PREFIX + "/share/pcbsd/pc-systemupdatertray/images/working.png"); 
     465 
     466  if ( programstatus == PACKAGE_UPDATE_AVAIL )  
     467     Icon.addFile(PREFIX + "/share/pcbsd/pc-systemupdatertray/images/pbiupdates.png"); 
    461468 
    462469  // If the program shows system updates available 
     
    521528 
    522529   if(reason == QSystemTrayIcon::Trigger) { 
    523        if ( (programstatus != SYSTEM_UPDATE_AVAIL) && (pbistatus == PBI_UPDATES_AVAIL) ) 
     530       if ( (programstatus != SYSTEM_UPDATE_AVAIL && programstatus != PACKAGE_UPDATE_AVAIL) && (pbistatus == PBI_UPDATES_AVAIL) ) 
    524531       { 
    525532            slotOpenSoftwareManagerInstalled(); 
     
    532539              return; 
    533540           } 
     541           if ( programstatus == PACKAGE_UPDATE_AVAIL ) { 
     542              slotOpenPackageManager(); 
     543              return; 
     544           } 
    534545           if ( wardenstatus == WARDEN_UPDATE_AVAIL ) { 
    535546              slotOpenJailManager(); 
     
    545556{    
    546557   system ("(pc-su warden gui) &");  
     558} 
     559 
     560void UpdaterTray::slotOpenPackageManager(void) 
     561{    
     562   system ("(sudo pc-pkgmanager) &");  
    547563} 
    548564 
     
    599615        shownPopup=true; 
    600616        QTimer::singleShot(15000, this, SLOT(slotShowSysUpdatePopup())); 
     617      } 
     618   } 
     619 
     620   if (programstatus == PACKAGE_UPDATE_AVAIL) { 
     621      tooltipStr += "<br>" + tr("Package updates available"); 
     622      if ( !shownPopup && popAction->isChecked() ) { 
     623        shownPopup=true; 
     624        QTimer::singleShot(15000, this, SLOT(slotShowPkgUpdatePopup())); 
    601625      } 
    602626   } 
     
    726750} 
    727751 
     752void UpdaterTray::slotShowPkgUpdatePopup() 
     753{ 
     754        disconnect(trayIcon, SIGNAL(messageClicked()), 0, 0 ); 
     755        trayIcon->showMessage(tr("System Updates Available"), tr("Important package updates are available. Click here to install them!"), QSystemTrayIcon::Critical); 
     756        connect( trayIcon, SIGNAL(messageClicked()), this, SLOT(slotOpenPackageManager()) ); 
     757} 
     758 
    728759 
    729760void UpdaterTray::slotShowSysUpdatePopup() 
  • src-qt4/pc-systemupdatertray/UpdaterTray.h

    r1620346 r304095c  
    3838   void slotOpenJailManager(); 
    3939   void slotOpenUpdateManager(); 
     40   void slotOpenPackageManager(); 
    4041   void slotOpenSoftwareManager(); 
    4142   void slotOpenSoftwareManagerInstalled(); 
     
    5657   void slotShowPBIUpdatePopup(); 
    5758   void slotChangePopup(); 
     59   void slotShowPkgUpdatePopup(); 
    5860    
    5961protected: 
Note: See TracChangeset for help on using the changeset viewer.