Changeset a702d45


Ignore:
Timestamp:
05/09/14 08:10:52 (14 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, enter/10, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
eaea8ff
Parents:
9bd0110 (diff), b736a6d (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:
7 edited

Legend:

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

    r41ed195 rd4c9f0db  
    8080        //Add this repo as UNKNOWN 
    8181        QListWidgetItem *item = new QListWidgetItem( tr("UNKNOWN"), 0); 
     82          item->setWhatsThis(cURL); 
     83          item->setToolTip(cURL); 
    8284        ui->listWidget->addItem(item); 
    8385        ui->listWidget->setCurrentItem(item); 
  • src-qt4/pc-softwaremanager/pbiNgBackend.cpp

    r7d1cdbb rd4c9f0db  
    476476 
    477477bool PBIBackend::checkForUpdates(QString injail){ 
    478   bool upd = false; 
    479   QHash<QString, NGApp> hash; 
    480   if(JAILPKGS.contains(injail)){ hash = JAILPKGS[injail]; } //jail list 
    481   else{ hash = PKGHASH; } //system pkgs 
    482   QStringList keys = hash.keys(); 
    483   for(int i=0; i<keys.length() && !upd; i++){ 
    484     NGApp app = hash[keys[i]]; 
    485       if(app.isInstalled && !app.version.isEmpty() && !app.installedversion.isEmpty()){ 
    486         upd = (app.version != app.installedversion); 
    487       } 
    488       if(upd){ qDebug() << "Update Available:" << app.name << app.installedversion << "->" << app.version; } 
    489   } 
    490   return upd; 
     478  if(injail.isEmpty() || !JAILUPD.contains(injail)){ 
     479    return updavail; 
     480  }else{ 
     481    return JAILUPD[injail]; 
     482  } 
    491483} 
    492484 
     
    623615        QHash<QString, NGApp> pkgs = sysDB->JailPkgList(ID); 
    624616        JAILPKGS.insert(jail, pkgs); 
     617        JAILUPD.insert(jail, checkForPkgUpdates(ID) ); 
    625618      } 
    626619    } 
     
    629622    QHash<QString, NGApp> pkgs = sysDB->JailPkgList(RUNNINGJAILS[jail]); 
    630623    JAILPKGS.insert(jail, pkgs); 
     624    JAILUPD.insert(jail, checkForPkgUpdates(RUNNINGJAILS[jail]) ); 
    631625  } 
    632626} 
     
    803797      //qDebug() << "Base:" << BASELIST; 
    804798   } 
     799   updavail = checkForPkgUpdates(""); 
    805800   if(RUNNINGJAILS.isEmpty() || all){ checkForJails(); } 
    806801   //qDebug() << "Update Stats"; 
     
    821816} 
    822817 
     818bool PBIBackend::checkForPkgUpdates(QString jailID){ 
     819  //Run pc-updatemanager pkgcheck to check for updates 
     820  QString out; 
     821  if(jailID.isEmpty()){ out  = sysDB->runCMD("pc-updatemanager pkgcheck"); } 
     822  else{ out = sysDB->runCMD("pc-updatemanager -j "+jailID+" pkgcheck"); } 
     823  return (!out.contains("All packages are up to date!") && out.contains("To start the upgrade run ") ); 
     824} 
     825 
    823826void PBIBackend::updateSplashScreen(QString msg){ 
    824827  if(Splash == 0){ return; } 
  • src-qt4/pc-softwaremanager/pbiNgBackend.h

    r7d1cdbb rd4c9f0db  
    118118        QString sysUser; //Current user running the AppCafe 
    119119        bool autoDE;    //automatically create desktop entries after an install 
     120        bool updavail; //updates available 
    120121         
    121122        //All the Process queing/interaction 
     
    135136        QHash<QString, QString> RUNNINGJAILS; // <name, ID> 
    136137        QHash<QString, QHash<QString, NGApp> > JAILPKGS; // <name, hash of pkg details> 
     138        QHash<QString, bool> JAILUPD; // <name, updates available> 
    137139        void checkForJails(QString jailID=""); //parses the "jls" command to get name/JID combinations 
    138140         
     
    147149        void slotSyncToDatabase(bool localChanges=false, bool all = false); 
    148150        void updateStatistics(); //number available/installed 
    149  
     151        bool checkForPkgUpdates(QString jailID = ""); 
    150152        void updateSplashScreen(QString); 
    151153         
  • 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(); 
Note: See TracChangeset for help on using the changeset viewer.