Changeset 221e4ca


Ignore:
Timestamp:
05/09/14 08:12:31 (11 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1
Children:
08a3270, aae0e0b
Parents:
7a59f02 (diff), a702d45 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of github.com:pcbsd/pcbsd

Location:
src-qt4
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/libpcbsd/utils/pcbsd-sysFlags.cpp

    r51d9921 r9bd0110  
    7171       }else if(flags[i].fileName().startsWith(SYSUPDATEAVAILABLE) ){ 
    7272         emit FlagChanged(SystemFlags::SysUpdate, msg); 
    73        }else if(flags[i].fileName().startsWith(PBIUPDATEAVAILABLE) ){ 
    74          emit FlagChanged(SystemFlags::PbiUpdate, msg); 
    7573       }else if(flags[i].fileName().startsWith(WARDENUPDATEAVAILABLE) ){ 
    7674         emit FlagChanged(SystemFlags::WardenUpdate, msg); 
  • src-qt4/libpcbsd/utils/pcbsd-sysFlags.h

    ra811223 r9bd0110  
    2121#define PKGUPDATEAVAILABLE QString("pkg-update-available") 
    2222#define SYSUPDATEAVAILABLE QString("sys-update-available") 
    23 #define PBIUPDATEAVAILABLE QString("pbi-update-available") 
    2423#define WARDENUPDATEAVAILABLE QString("warden-update-available") 
    2524 
     
    3332class SystemFlags{ 
    3433public: 
    35         enum SYSFLAG{ NetRestart, PkgUpdate, SysUpdate, PbiUpdate, WardenUpdate}; 
     34        enum SYSFLAG{ NetRestart, PkgUpdate, SysUpdate, WardenUpdate}; 
    3635        enum SYSMESSAGE{ Working, Error, Success, UpdateAvailable, Updating}; 
    3736}; 
  • src-qt4/pc-systemupdatertray/TrayUI.cpp

    r2e5fb6f r9bd0110  
    55  qDebug() << "Starting Up System Updater Tray..."; 
    66  //Set all the initial flags ( <0 means do initial checks if appropriate) 
    7   PBISTATUS=-1; 
    87  PKGSTATUS=-1; 
    98  SYSSTATUS=-1; 
     
    9089  bool isworking = false; 
    9190  QString msg; 
    92   if(PBISTATUS==3 || SYSSTATUS==3 || PKGSTATUS==3 || WARDENSTATUS==3){ 
     91  if(SYSSTATUS==3 || PKGSTATUS==3 || WARDENSTATUS==3){ 
    9392    this->setIcon( QIcon(":/images/updating.png") ); 
    9493    isworking = true; 
    95   }else if(PBISTATUS==1 || SYSSTATUS==1 || PKGSTATUS==1 || WARDENSTATUS==1){ 
     94  }else if( SYSSTATUS==1 || PKGSTATUS==1 || WARDENSTATUS==1){ 
    9695    this->setIcon( QIcon(":/images/working.png") ); 
    9796    isworking = true; 
     
    107106    this->setIcon( QIcon(":/images/pkgupdates.png") ); 
    108107    msg = tr("Package Updates Available"); 
    109   }else if(PBISTATUS==2){ 
    110     this->setIcon( QIcon(":/images/pbiupdates.png") ); 
    111     msg = tr("PBI Updates Available"); 
    112108  }else if(WARDENSTATUS==2){ 
    113109    this->setIcon( QIcon(":/images/sysupdates.png") ); 
     
    131127  }else if(noInternet){ 
    132128    msg.append("\n"+tr("Error checking for updates")+"\n"+tr("Please make sure you have a working internet connection") ); 
    133   }else if(PBISTATUS<=0 && SYSSTATUS<=0 && PKGSTATUS<=0 && WARDENSTATUS<=0){ 
     129  }else if(SYSSTATUS<=0 && PKGSTATUS<=0 && WARDENSTATUS<=0){ 
    134130    msg.append("\n"+tr("Your system is fully updated") ); 
    135131  }else{ 
     
    143139    else if(WARDENSTATUS==1){ msg.append("\n"+tr("Checking for jail updates...") ); } 
    144140    else if(WARDENSTATUS==3){ msg.append("\n"+tr("Jails Updating...") ); } 
    145     if(PBISTATUS==2){ msg.append("\n"+tr("PBI Updates Available") ); } 
    146     else if(PBISTATUS==1){ msg.append("\n"+tr("Checking for PBI updates") ); } 
    147     else if(PBISTATUS==3){ msg.append("\n"+tr("PBI Updating...") ); } 
    148141  } 
    149142   
     
    153146bool TrayUI::rebootNeeded(){ 
    154147  return QFile::exists("/tmp/.fbsdup-reboot"); 
    155 } 
    156  
    157 void TrayUI::startPBICheck(){ 
    158   if(PBISTATUS==1){ return; } //already checking for updates 
    159   qDebug() << " -Starting PBI Check..."; 
    160   QString cmd = "pbi_update --check-all"; 
    161   PBISTATUS=1; //working 
    162   QProcess::startDetached(cmd);          
    163148} 
    164149 
     
    197182void TrayUI::checkForUpdates(){ 
    198183  //Simplification function to start all checks 
    199     startPBICheck(); 
    200184    startPKGCheck(); 
    201185    startSYSCheck(); 
     
    212196  if(PKGSTATUS<0){ startPKGCheck(); } 
    213197  if(WARDENSTATUS<0){ startWardenCheck(); } 
    214   if(PBISTATUS<0){ startPBICheck(); } 
    215198  QTimer::singleShot(60000, watcher, SLOT(checkFlags()) ); //make sure to manually check 1 minute from now 
    216199} 
     
    243226void TrayUI::watcherMessage(SystemFlags::SYSFLAG flag, SystemFlags::SYSMESSAGE msg){ 
    244227  //reset the noInternet flag (prevent false positives, since something obviously just changed) 
    245     // - PBI system uses cached files - not a good indicator of internet availability 
    246228  bool oldstat = noInternet; 
    247   if(flag != SystemFlags::PbiUpdate && flag != SystemFlags::NetRestart){ noInternet = false; } 
     229  if(flag != SystemFlags::NetRestart){ noInternet = false; } 
    248230  switch(flag){ 
    249231        case SystemFlags::NetRestart: 
     
    268250          else{ startSYSCheck(); } //unknown - check it 
    269251          break;         
    270         case SystemFlags::PbiUpdate: 
    271           if(msg==SystemFlags::UpdateAvailable){ PBISTATUS=2; } 
    272           else if(msg==SystemFlags::Working){ PBISTATUS=1; } 
    273           else if(msg==SystemFlags::Success){ PBISTATUS=0; } 
    274           else if(msg==SystemFlags::Updating){ PBISTATUS=3; } 
    275           else if(msg==SystemFlags::Error){ PBISTATUS=0; } //nothing special for PBI errors yet 
    276           else{ startPBICheck(); } //unknown - check it 
    277           break;         
    278252        case SystemFlags::WardenUpdate: 
    279253          if(msg==SystemFlags::UpdateAvailable){ WARDENSTATUS=2; } 
     
    285259          break;         
    286260  } 
    287   qDebug() << "System Status Change:" << SYSSTATUS << PKGSTATUS << PBISTATUS <<WARDENSTATUS; 
     261  qDebug() << "System Status Change:" << SYSSTATUS << PKGSTATUS <<WARDENSTATUS; 
    288262  //Update the tray icon 
    289263  updateTrayIcon(); 
  • src-qt4/pc-systemupdatertray/TrayUI.h

    re565243 r9bd0110  
    2727        QSettings *settings; 
    2828        QTimer *chktime; 
    29         int PBISTATUS, PKGSTATUS, WARDENSTATUS, SYSSTATUS; // 0-up2date, 1-working, 2-updateavailable 
     29        int PKGSTATUS, WARDENSTATUS, SYSSTATUS; // 0-up2date, 1-working, 2-updateavailable 
    3030        bool noInternet; //flag whether the update checks could even work 
    3131        bool wasworking; //internal status for determining when to show messages 
     
    3838 
    3939        //External Process Launchers 
    40         void startPBICheck(); 
    4140        void startPKGCheck(); 
    4241        void startSYSCheck(); 
  • src-qt4/pc-softwaremanager/configDialog.cpp

    rd4c9f0db r7a59f02  
    7979      if(!found){ 
    8080        //Add this repo as UNKNOWN 
    81         QListWidgetItem *item = new QListWidgetItem( tr("UNKNOWN"), 0); 
     81        QListWidgetItem *item = new QListWidgetItem( cURL.left(10).append("..."), 0); 
    8282          item->setWhatsThis(cURL); 
    8383          item->setToolTip(cURL); 
  • src-qt4/pc-softwaremanager/pbiNgBackend.cpp

    rd4c9f0db r7a59f02  
    357357      if(PENDING[i].startsWith(appID+"::::")){ 
    358358        //Currently pending - check which type (install/remove) 
    359         if(PENDING[i].contains("pbi_add") || (PENDING[i].contains("pc-pkg ") &&PENDING[i].contains(" add ") ) ){ output = tr("Pending Installation"); } 
    360         else if(PENDING[i].contains("pbi_delete") || (PENDING[i].contains("pc-pkg ") && PENDING[i].contains(" remove ") ) ){ output = tr("Pending Removal"); } 
    361         return output; 
    362       } 
    363     } 
    364     //If it gets here, it is not pending, so check for updates 
    365     NGApp app; 
    366     if(JAILPKGS.contains(injail)){ 
    367         QHash<QString, NGApp> hash = JAILPKGS.value(injail); 
    368         if(hash.contains(appID)){ 
    369           app = hash[appID]; 
     359        if(injail.isEmpty() || PENDING[i].endsWith("::::"+injail) ){ 
     360          if(PENDING[i].contains("pbi_add") || (PENDING[i].contains("pc-pkg ") &&PENDING[i].contains(" add ") ) ){ output = tr("Pending Installation"); } 
     361          else if(PENDING[i].contains("pbi_delete") || (PENDING[i].contains("pc-pkg ") && PENDING[i].contains(" remove ") ) ){ output = tr("Pending Removal"); } 
     362          break; 
    370363        } 
    371     } 
    372     else if(APPHASH.contains(appID)){ app = APPHASH[appID]; } 
    373     else if(PKGHASH.contains(appID)){ app = PKGHASH[appID]; } 
    374     if(!app.origin.isEmpty()){ 
    375       if(app.version != app.installedversion && app.isInstalled && !app.version.isEmpty()){ 
    376          output = QString(tr("Update Available: %1")).arg(app.version); 
    377364      } 
    378365    } 
Note: See TracChangeset for help on using the changeset viewer.