Changeset 80166a6


Ignore:
Timestamp:
05/08/14 07:49:58 (6 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.2, releng/10.0.3
Children:
3ff724e
Parents:
de6c883
Message:

Add the ability to run "pbi updateindex" from the UI.

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

Legend:

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

    rc9231c6 r80166a6  
    122122void MainUI::on_actionAppCafe_Settings_triggered(){ 
    123123  //PBI->openConfigurationDialog(); 
     124} 
     125 
     126void MainUI::on_actionRefresh_PBI_Index_triggered(){ 
     127  //Check that no pkg actions are running 
     128  if(PBI->safeToQuit()){ 
     129    this->setEnabled(false); 
     130    QTimer::singleShot(0,PBI, SLOT(UpdateIndexFiles()) ); //start the update 
     131  }else{ 
     132    QMessageBox::warning(this, tr("Please Wait"), tr("You currently have actions pending/running. Please wait until they finish first.") ); 
     133  }        
    124134} 
    125135 
     
    558568 
    559569void MainUI::slotEnableBrowser(){ 
     570  this->setEnabled(true); 
    560571  qDebug() << "Repo Ready: - generating browser home page"; 
    561572  //Now create the browser home page 
  • src-qt4/pc-softwaremanager/mainUI.h

    rc9231c6 r80166a6  
    6161  void on_actionQuit_triggered(); 
    6262  void on_actionAppCafe_Settings_triggered(); 
     63  void on_actionRefresh_PBI_Index_triggered(); 
    6364  void on_actionDeveloper_Mode_triggered(); 
    6465 
  • src-qt4/pc-softwaremanager/mainUI.ui

    rc9231c6 r80166a6  
    16221622     <string>&amp;File</string> 
    16231623    </property> 
    1624     <addaction name="actionInstall_From_File"/> 
    1625     <addaction name="separator"/> 
    16261624    <addaction name="actionImport_PBI_List"/> 
    16271625    <addaction name="actionExport_PBI_List"/> 
     
    16341632    </property> 
    16351633    <addaction name="actionAppCafe_Settings"/> 
     1634    <addaction name="separator"/> 
     1635    <addaction name="actionRefresh_PBI_Index"/> 
    16361636    <addaction name="separator"/> 
    16371637    <addaction name="actionDeveloper_Mode"/> 
     
    17091709   </property> 
    17101710   <property name="text"> 
    1711     <string>&amp;Settings</string> 
     1711    <string>Repository &amp;Settings</string> 
    17121712   </property> 
    17131713  </action> 
     
    18101810   <property name="text"> 
    18111811    <string>Show Raw Packages</string> 
     1812   </property> 
     1813  </action> 
     1814  <action name="actionRefresh_PBI_Index"> 
     1815   <property name="icon"> 
     1816    <iconset resource="SoftwareManager.qrc"> 
     1817     <normaloff>:/icons/app_upgrade_small.png</normaloff>:/icons/app_upgrade_small.png</iconset> 
     1818   </property> 
     1819   <property name="text"> 
     1820    <string>Refresh PBI Index</string> 
    18121821   </property> 
    18131822  </action> 
  • src-qt4/pc-softwaremanager/pbiNgBackend.cpp

    rc9231c6 r80166a6  
    574574} 
    575575 
     576void PBIBackend::UpdateIndexFiles(){ 
     577  Extras::getCmdOutput("pbi updateindex"); //don't care about output at the moment 
     578  slotSyncToDatabase(true, true); //now re-sync with the database and emit signals 
     579} 
    576580 // =============================== 
    577581 // ====== PRIVATE FUNCTIONS ====== 
     
    772776 
    773777 // === Database Synchronization === 
    774  void PBIBackend::slotSyncToDatabase(bool localChanges){ 
     778 void PBIBackend::slotSyncToDatabase(bool localChanges, bool all){ 
    775779   qDebug() << "Sync Database with local changes:" << localChanges; 
    776    sysDB->syncDBInfo("", localChanges); 
     780   sysDB->syncDBInfo("", localChanges, all); 
    777781   PKGHASH.clear(); 
    778782   APPHASH.clear(); 
    779783   CATHASH.clear(); 
    780    if(RECLIST.isEmpty()){ 
     784   if(RECLIST.isEmpty() || all){ 
    781785     sysDB->getAppCafeHomeInfo( &NEWLIST, &HIGHLIST, &RECLIST); 
    782786   } 
     
    785789   APPHASH = sysDB->DetailedAppList(); // load the pbi info 
    786790   CATHASH = sysDB->Categories(); // load all the different categories info 
    787    if(BASELIST.isEmpty()){ 
     791   if(BASELIST.isEmpty() || all){ 
    788792      //populate the list of base dependencies that cannot be removed 
    789793      BASELIST = listDependencies("misc/pcbsd-base"); 
     
    791795      //qDebug() << "Base:" << BASELIST; 
    792796   } 
    793    if(RUNNINGJAILS.isEmpty()){ checkForJails(); } 
     797   if(RUNNINGJAILS.isEmpty() || all){ checkForJails(); } 
    794798   //qDebug() << "Update Stats"; 
    795799   updateStatistics(); 
  • src-qt4/pc-softwaremanager/pbiNgBackend.h

    rc9231c6 r80166a6  
    102102        void startAppSearch(); //get list of apps containing the search string (SIGNAL OUTPUT ONLY) 
    103103        void startSimilarSearch(); //get list of apps that are similar to the input app 
    104          
     104        void UpdateIndexFiles(); //Force update the PBI index from remote 
    105105private: 
    106106        QWidget *parentWidget; 
     
    143143 
    144144        // Database sync 
    145         void slotSyncToDatabase(bool localChanges=false); 
     145        void slotSyncToDatabase(bool localChanges=false, bool all = false); 
    146146        void updateStatistics(); //number available/installed 
    147147         
Note: See TracChangeset for help on using the changeset viewer.