Changeset 7d1cdbb


Ignore:
Timestamp:
05/09/14 07:00:46 (16 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, enter/10, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2, releng/10.2, stable/10
Children:
12db463d, 41ed195
Parents:
96de1803
Message:

Make the AppCafe? splash screen a bit more dynamic, and also add a debug line for when updates are detected.

Location:
src-qt4/pc-softwaremanager
Files:
5 edited

Legend:

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

    rd9128921 r7d1cdbb  
    4545      return a.exec(); 
    4646    }else{ 
    47      QPixmap pix(":/icons/splash.png"); 
    48      QSplashScreen SS(pix); 
    49         SS.showMessage(QObject::tr("Starting Up.."), Qt::AlignHCenter | Qt::AlignBottom); 
    50         SS.show(); 
    51         a.processEvents(); 
    52         a.processEvents(); 
     47     //QPixmap pix(":/icons/splash.png"); 
     48     //QSplashScreen SS(pix); 
     49        //SS.showMessage(QObject::tr("Starting Up.."), Qt::AlignHCenter | Qt::AlignBottom); 
     50        //SS.show(); 
     51        //a.processEvents(); 
     52        //a.processEvents(); 
    5353 
    5454      //Already on PBI-NG 
     
    6161      } 
    6262      w.show(); 
    63       SS.finish(&w); 
     63      //SS.finish(&w); 
    6464      QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &w, SLOT(slotSingleInstance()) ); 
    6565      a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); 
  • src-qt4/pc-softwaremanager/mainUI.cpp

    rd9128921 r7d1cdbb  
    4949void MainUI::ProgramInit() 
    5050{  
     51   QSplashScreen *SS = new QSplashScreen(this, QPixmap(":/icons/splash.png")); 
     52     SS->show(); 
     53     QCoreApplication::processEvents(); 
    5154   qDebug("Application starting..."); 
    5255   //Now startup the backend 
    5356   qDebug() << "Startup Backend"; 
    5457   QApplication::processEvents(); 
    55    PBI = new PBIBackend(); 
     58   PBI = new PBIBackend(this, SS); 
    5659   //Initialize the Installed tab 
    5760   qDebug() << "Initialize Installed Tab"; 
     
    6063   qDebug() << "Initialize Browser Tab"; 
    6164   initializeBrowserTab(); 
    62     
     65 
    6366 
    6467     connect(PBI,SIGNAL(LocalPBIChanges()),this,SLOT(slotRefreshInstallTab()) ); 
     
    7679   slotRefreshInstallTab(); 
    7780   slotEnableBrowser(); 
    78    if(ui->group_updates->isVisible()){ ui->tabWidget->setCurrentWidget(ui->tab_installed); } 
     81   SS->finish(this); 
    7982} 
    8083 
  • src-qt4/pc-softwaremanager/mainUI.h

    red8ad03 r7d1cdbb  
    2626#include <QNetworkReply> 
    2727#include <QWidgetAction> 
     28#include <QSplashScreen> 
    2829 
    2930/* LibPCBSD Includes */ 
  • src-qt4/pc-softwaremanager/pbiNgBackend.cpp

    r4fc34c1 r7d1cdbb  
    3333 
    3434  
    35  PBIBackend::PBIBackend(QWidget *parent) : QObject(){ 
     35 PBIBackend::PBIBackend(QWidget *parent, QSplashScreen *splash) : QObject(){ 
    3636   parentWidget = parent; 
     37   Splash = splash; 
     38   updateSplashScreen(tr("Initializing")); 
    3739   sysArch = Extras::getSystemArch(); 
    3840   sysUser = Extras::getRegularUser(); 
     
    5254   //Now startup the syncing process 
    5355   UpdateIndexFiles(false); //do not force pbi index redownload on startup 
     56   //Done with initial sync - disable splash screen 
     57   updateSplashScreen(tr("Starting UI")); 
     58   Splash = 0; 
    5459 } 
    5560  
     
    478483  for(int i=0; i<keys.length() && !upd; i++){ 
    479484    NGApp app = hash[keys[i]]; 
    480       if(app.isInstalled && !app.version.isEmpty()){ 
     485      if(app.isInstalled && !app.version.isEmpty() && !app.installedversion.isEmpty()){ 
    481486        upd = (app.version != app.installedversion); 
    482487      } 
     488      if(upd){ qDebug() << "Update Available:" << app.name << app.installedversion << "->" << app.version; } 
    483489  } 
    484490  return upd; 
     
    574580 
    575581void PBIBackend::UpdateIndexFiles(bool force){ 
     582  updateSplashScreen(tr("Updating Index")); 
    576583  if(force){ Extras::getCmdOutput("pbi updateindex -f"); } 
    577584  else{ Extras::getCmdOutput("pbi updateindex"); } 
     
    778785 void PBIBackend::slotSyncToDatabase(bool localChanges, bool all){ 
    779786   qDebug() << "Sync Database with local changes:" << localChanges; 
     787   updateSplashScreen(tr("Loading Database")); 
    780788   sysDB->syncDBInfo("", localChanges, all); 
    781789   PKGHASH.clear(); 
     
    813821} 
    814822 
     823void PBIBackend::updateSplashScreen(QString msg){ 
     824  if(Splash == 0){ return; } 
     825     Splash->showMessage(msg, Qt::AlignHCenter | Qt::AlignBottom); 
     826     Splash->show(); 
     827     QCoreApplication::processEvents(); 
     828     QCoreApplication::processEvents(); 
     829} 
     830 
  • src-qt4/pc-softwaremanager/pbiNgBackend.h

    r4fc34c1 r7d1cdbb  
    1616#include <QDir> 
    1717#include <QDebug> 
    18 //#include <QDate> 
     18#include <QSplashScreen> 
    1919#include <QMessageBox> 
    2020#include <QProcess> 
     21#include <QCoreApplication> 
    2122 
    2223// libPCBSD includes 
     
    3334public: 
    3435        //Initializations 
    35         PBIBackend(QWidget *parent = 0); 
     36        PBIBackend(QWidget *parent = 0, QSplashScreen *splash = 0); 
    3637        ~PBIBackend(){} 
    3738        //General Setup or restart functions 
     
    105106private: 
    106107        QWidget *parentWidget; 
     108        QSplashScreen *Splash; //only used during initial sync 
    107109        //variables - database 
    108110        PBIDBAccess *sysDB; 
     
    145147        void slotSyncToDatabase(bool localChanges=false, bool all = false); 
    146148        void updateStatistics(); //number available/installed 
     149 
     150        void updateSplashScreen(QString); 
    147151         
    148152signals: 
Note: See TracChangeset for help on using the changeset viewer.