Changeset ddb1adb4


Ignore:
Timestamp:
05/06/14 12:17:50 (12 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1
Children:
e095cc0
Parents:
acb0f00 (diff), 8482df7 (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

Files:
12 edited

Legend:

Unmodified
Added
Removed
  • src-sh/libsh/functions.sh

    reee006a r8482df7  
    664664  # Check if we need to prune any BEs 
    665665  # TODO 
    666  
    667 } 
     666  snapList=`beadm list | grep ^beforeUpdate | awk '{print $1}'` 
     667  snapCount=`echo $snapList | wc -l | awk '{print $1}'` 
     668 
     669  if [ -z "$snapCount" ] ; then return ; fi 
     670  if [ $snapCount -lt 5 ] ; then return ; fi 
     671 
     672 
     673  # Reverse the list 
     674  for tmp in $snapList 
     675  do 
     676     rSnaps="$tmp $rSnaps" 
     677  done 
     678 
     679  # Do any pruning 
     680  KEEP="5" 
     681  num=0 
     682  for snap in $rSnaps 
     683  do 
     684     cur="`echo $snap | cut -d '-' -f 1`" 
     685     if [ "$cur" != "beforeUpdate" ] ; then continue; fi 
     686 
     687     num=`expr $num + 1` 
     688 
     689     # Make sure this BE isn't mounted or running 
     690     beadm list grep "^$snap " | grep -q -e " N " -e " NR "  -e " /" 
     691     if [ $? -eq 0 ] ; then continue ; fi 
     692 
     693     if [ $num -gt $KEEP ] ; then 
     694        # Remove this old BE 
     695        echo "Removing BE: $snap" 
     696        beadm destroy $snap >/dev/null 2>/dev/null 
     697     fi 
     698  done 
     699} 
  • src-qt4/pc-softwaremanager/mainUI.cpp

    rbdc8227 racb0f00  
    7676   slotRefreshInstallTab(); 
    7777   slotEnableBrowser(); 
     78   if(ui->group_updates->isVisible()){ ui->tabWidget->setCurrentWidget(ui->tab_installed); } 
    7879} 
    7980 
     
    152153    //Get the update stats and ask for verification to start now 
    153154    QMessageBox MB(QMessageBox::Question, tr("Start Updates?"), tr("Are you ready to start performing updates?")+"\n\n"+tr("NOTE: Please close any running applications first!!"), QMessageBox::Yes | QMessageBox::No, this); 
    154       MB.setDetailedText(PBI->updateDetails()); 
     155      MB.setDetailedText(PBI->updateDetails(VISJAIL)); 
    155156    if( QMessageBox::Yes != MB.exec() ){ 
    156157      return; //cancelled 
     
    158159     
    159160    //Now start the updates 
    160     UpdateDialog dlg(this); 
     161    UpdateDialog dlg(this, PBI->JailID(VISJAIL)); 
    161162    dlg.exec(); 
    162163    if(dlg.rebooting){ this->close(); } //reboot triggered, close down the AppCafe 
     
    164165      //re-check for updates 
    165166      PBI->syncLocalPackages(); 
     167      slotRefreshInstallTab(); 
    166168    } 
    167169  }else{ 
     
    179181      dmenu->addAction( QIcon(":icons/add.png"),tr("Add"),this,SLOT(slotActionAddDesktop()) ); 
    180182      dmenu->addAction( QIcon(":icons/remove.png"),tr("Remove"),this,SLOT(slotActionRemoveDesktop()) ); 
     183    QMenu *lmenu = actionMenu->addMenu( QIcon(":icons/lock.png"), tr("Version Lock") ); 
     184        lmenu->addAction( QIcon(":icons/lock.png"), tr("Lock Current Version"), this, SLOT(slotActionLock()) ); 
     185        lmenu->addAction( QIcon(":icons/unlock.png"), tr("Unlock Application"), this, SLOT(slotActionUnlock()) ); 
    181186    actionMenu->addSeparator(); 
    182187    actionMenu->addAction( QIcon(":icons/remove.png"), tr("Uninstall"), this, SLOT(slotActionRemove()) ); 
     
    209214  //simplification function for filling the tree widget item with the appropriate information about the PBI 
    210215  QString ID = item->whatsThis(0); 
    211   NGApp app = PBI->singleAppInfo(ID); 
     216  NGApp app = PBI->singleAppInfo(ID, VISJAIL); 
    212217  //qDebug() << "Item:" << ID << app.origin << app.name << item->text(0); 
    213218  if(app.origin.isEmpty()){ return; } //invalid item 
    214   if(item->text(0).isEmpty()){  //new entry - get everything 
    215     //Fill the item columns [name, version, status] 
     219    //Fill the item columns [name, version, status, size, date, arch] 
    216220      item->setText(0,app.name); 
    217221      item->setText(1,app.installedversion); 
    218       item->setText(2, PBI->currentAppStatus(ID)); 
    219       //for(int i=0; i<vals.length(); i++){ item->setText(i,vals[i]); } 
     222      item->setText(2, PBI->currentAppStatus(ID, VISJAIL)); 
     223      item->setText(3, app.installedsize); 
     224      item->setText(4, app.installedwhen); 
     225      item->setText(5, app.installedarch); 
     226      //Application Icon 
    220227      QString icon = checkIcon(app.icon, app.type); 
    221         //Load a default icon if none found 
    222       if(icon.isEmpty() || !QFile::exists(icon) ){ icon = defaultIcon; } 
    223       item->setIcon(0,QIcon(icon) ); 
     228        item->setIcon(0,QIcon(icon) ); 
     229      //Application Lock status 
     230      icon.clear(); 
     231        if(app.isLocked){ icon = ":/icons/lock.png"; } 
     232        item->setIcon(1,QIcon(icon) ); 
     233      //Set the application install status 
     234      QColor col(0,0,0,0); //completely transparent 
     235      if(app.isOrphan){ col = QColor(255,250,205,190); } // yellow 
     236      if(!PBI->safeToRemove( app.origin )){ col = QColor(255,10,10,20); } //mostly-transparent red 
     237        item->setBackground(0,QBrush(col)); 
     238         
    224239      item->setCheckState(0,Qt::Unchecked); 
    225   }else{ // Just update the necesary info 
    226     item->setText(1, app.installedversion); 
    227     item->setText(2, PBI->currentAppStatus(ID) ); 
    228   } 
     240 
    229241} 
    230242 
     
    305317    } 
    306318    //Now re-size the columns to the minimum required width 
    307     for(int i=0; i<3; i++){ 
     319    for(int i=0; i<6; i++){ 
    308320      ui->tree_install_apps->resizeColumnToContents(i); 
    309321    }  
     
    312324  slotDisplayStats(); 
    313325  slotCheckSelectedItems(); 
    314   ui->group_updates->setVisible(PBI->checkForUpdates()); 
     326  ui->group_updates->setVisible(PBI->checkForUpdates(VISJAIL)); 
    315327  //If the browser app page is currently visible for this app 
    316328  if( (ui->stacked_browser->currentWidget() == ui->page_app) && ui->page_app->isVisible() ){ 
     
    415427  bool pending = PBI->isWorking(pbiID); 
    416428  contextActionMenu->clear(); 
    417   if(info.hasDE){ 
     429  if(info.hasDE && VISJAIL.isEmpty() ){ 
    418430    QMenu *dmenu = contextActionMenu->addMenu( QIcon(":icons/xdg_desktop.png"), tr("Desktop Icons")); 
    419431      dmenu->addAction( QIcon(":icons/add.png"),tr("Add"),this,SLOT(slotActionAddDesktop()) ); 
    420432      dmenu->addAction( QIcon(":icons/remove.png"),tr("Remove"),this,SLOT(slotActionRemoveDesktop()) ); 
    421433  } 
    422   if(!pending){ 
     434  if(info.isLocked){ 
     435    contextActionMenu->addAction( QIcon(":icons/unlock.png"), tr("Unlock Application"), this, SLOT(slotActionUnlock()) ); 
     436  }else{ 
     437    contextActionMenu->addAction( QIcon(":icons/lock.png"), tr("Lock Current Version"), this, SLOT(slotActionLock()) ); 
     438  } 
     439  if(!pending && PBI->safeToRemove(pbiID)){ 
    423440    //Remove option is only available if not currently pending actions 
    424441    contextActionMenu->addSeparator(); 
    425442    contextActionMenu->addAction( QIcon(":icons/remove.png"), tr("Uninstall"), this, SLOT(slotActionRemove()) ); 
    426   }else{ 
     443  }else if(pending){ 
    427444    //Cancel option is only available if actions are currently pending     
    428445    contextActionMenu->addSeparator(); 
     
    465482    PBI->cancelActions(checkedID);   
    466483  } 
     484} 
     485 
     486void MainUI::slotActionLock(){ 
     487  QStringList checkedID = getCheckedItems(); 
     488  if(!checkedID.isEmpty()){ 
     489    PBI->lockApp(checkedID, VISJAIL);   
     490  }      
     491} 
     492 
     493void MainUI::slotActionUnlock(){ 
     494  QStringList checkedID = getCheckedItems(); 
     495  if(!checkedID.isEmpty()){ 
     496    PBI->unlockApp(checkedID, VISJAIL);   
     497  }      
    467498} 
    468499 
     
    10831114    NGApp app = PBI->singleAppInfo(apps[i]); 
    10841115    msg.append(app.name+"\n"); 
    1085     if(!app.rdependency.isEmpty()){ msg.append( " - "+QString(tr("Also Removes: %1")).arg(app.rdependency.join(", "))+"\n" ); } 
     1116    if(!app.rdependency.isEmpty()){ msg.append( " - "+QString(tr("Also Removes: %1")).arg( PBI->listRDependencies(apps[i]).join(", "))+"\n" ); } 
    10861117  } 
    10871118   
  • src-qt4/pc-softwaremanager/mainUI.h

    ra1eda3b rc220c7e  
    8585  void slotActionRemove(); 
    8686  void slotActionCancel(); 
     87  void slotActionLock(); 
     88  void slotActionUnlock(); 
    8789  void slotStartApp(QAction*); 
    8890 
  • src-qt4/pc-softwaremanager/mainUI.ui

    ra1eda3b rc220c7e  
    4141     <number>2</number> 
    4242    </property> 
    43     <item> 
    44      <widget class="QGroupBox" name="group_updates"> 
    45       <property name="styleSheet"> 
    46        <string notr="true">QGroupBox{ 
    47 background: rbga(50,190,255,130); 
    48 border-radius: 5px; 
    49 }</string> 
    50       </property> 
    51       <property name="title"> 
    52        <string/> 
    53       </property> 
    54       <layout class="QHBoxLayout" name="horizontalLayout_6"> 
    55        <property name="margin"> 
    56         <number>3</number> 
    57        </property> 
    58        <item> 
    59         <widget class="QToolButton" name="tool_start_updates"> 
    60          <property name="text"> 
    61           <string>Start Updates</string> 
    62          </property> 
    63          <property name="icon"> 
    64           <iconset resource="SoftwareManager.qrc"> 
    65            <normaloff>:/icons/view-refresh.png</normaloff>:/icons/view-refresh.png</iconset> 
    66          </property> 
    67          <property name="toolButtonStyle"> 
    68           <enum>Qt::ToolButtonTextBesideIcon</enum> 
    69          </property> 
    70         </widget> 
    71        </item> 
    72        <item> 
    73         <widget class="QLabel" name="label_updates"> 
    74          <property name="font"> 
    75           <font> 
    76            <weight>75</weight> 
    77            <bold>true</bold> 
    78           </font> 
    79          </property> 
    80          <property name="text"> 
    81           <string>Application updates are available!</string> 
    82          </property> 
    83         </widget> 
    84        </item> 
    85       </layout> 
    86      </widget> 
    87     </item> 
    8843    <item> 
    8944     <widget class="QTabWidget" name="tabWidget"> 
     
    12277        </property> 
    12378        <item> 
    124          <layout class="QHBoxLayout" name="horizontalLayout_11"> 
    125           <item> 
     79         <layout class="QGridLayout" name="gridLayout_2"> 
     80          <item row="0" column="1" rowspan="2"> 
     81           <spacer name="horizontalSpacer_2"> 
     82            <property name="orientation"> 
     83             <enum>Qt::Horizontal</enum> 
     84            </property> 
     85            <property name="sizeHint" stdset="0"> 
     86             <size> 
     87              <width>278</width> 
     88              <height>20</height> 
     89             </size> 
     90            </property> 
     91           </spacer> 
     92          </item> 
     93          <item row="0" column="0" rowspan="2"> 
    12694           <widget class="QLabel" name="label_install_jail"> 
    12795            <property name="font"> 
     
    136104           </widget> 
    137105          </item> 
    138           <item> 
    139            <spacer name="horizontalSpacer_2"> 
    140             <property name="orientation"> 
    141              <enum>Qt::Horizontal</enum> 
    142             </property> 
    143             <property name="sizeHint" stdset="0"> 
    144              <size> 
    145               <width>278</width> 
    146               <height>20</height> 
    147              </size> 
    148             </property> 
    149            </spacer> 
    150           </item> 
    151           <item> 
     106          <item row="1" column="2"> 
    152107           <widget class="QToolButton" name="tool_install_details"> 
    153108            <property name="text"> 
     
    161116             <enum>Qt::ToolButtonTextBesideIcon</enum> 
    162117            </property> 
     118           </widget> 
     119          </item> 
     120          <item row="2" column="0" colspan="3"> 
     121           <widget class="QGroupBox" name="group_updates"> 
     122            <property name="styleSheet"> 
     123             <string notr="true">QGroupBox{ 
     124background: rbga(50,190,255,130); 
     125border-radius: 5px; 
     126}</string> 
     127            </property> 
     128            <property name="title"> 
     129             <string/> 
     130            </property> 
     131            <layout class="QHBoxLayout" name="horizontalLayout_6"> 
     132             <property name="margin"> 
     133              <number>3</number> 
     134             </property> 
     135             <item> 
     136              <widget class="QToolButton" name="tool_start_updates"> 
     137               <property name="text"> 
     138                <string>Start Updates</string> 
     139               </property> 
     140               <property name="icon"> 
     141                <iconset resource="SoftwareManager.qrc"> 
     142                 <normaloff>:/icons/view-refresh.png</normaloff>:/icons/view-refresh.png</iconset> 
     143               </property> 
     144               <property name="toolButtonStyle"> 
     145                <enum>Qt::ToolButtonTextBesideIcon</enum> 
     146               </property> 
     147              </widget> 
     148             </item> 
     149             <item> 
     150              <widget class="QLabel" name="label_updates"> 
     151               <property name="font"> 
     152                <font> 
     153                 <weight>75</weight> 
     154                 <bold>true</bold> 
     155                </font> 
     156               </property> 
     157               <property name="text"> 
     158                <string>Application updates are available!</string> 
     159               </property> 
     160              </widget> 
     161             </item> 
     162            </layout> 
    163163           </widget> 
    164164          </item> 
     
    198198           <property name="text"> 
    199199            <string>Status</string> 
     200           </property> 
     201          </column> 
     202          <column> 
     203           <property name="text"> 
     204            <string>Size</string> 
     205           </property> 
     206          </column> 
     207          <column> 
     208           <property name="text"> 
     209            <string>Installed</string> 
     210           </property> 
     211          </column> 
     212          <column> 
     213           <property name="text"> 
     214            <string>Architecture</string> 
    200215           </property> 
    201216          </column> 
     
    13751390                        <x>0</x> 
    13761391                        <y>0</y> 
    1377                         <width>452</width> 
    1378                         <height>66</height> 
     1392                        <width>88</width> 
     1393                        <height>18</height> 
    13791394                       </rect> 
    13801395                      </property> 
  • src-qt4/pc-softwaremanager/migrateUI.cpp

    rbdc8227 racb0f00  
    55  ui->setupUi(this); //load the designer file    
    66  ui->group_reboot->setVisible(false); 
    7   proc = new QProcess(this); 
     7  proc = new DLProcess(this); 
     8        proc->setParentWidget(this); 
     9        proc->setDLType("PKG"); 
    810        proc->setProcessChannelMode(QProcess::MergedChannels); 
    911  connect(proc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(procFinished()) ); 
    10   connect(proc, SIGNAL(readyReadStandardOutput()), this, SLOT(updateProgress()) ); 
     12  connect(proc, SIGNAL(UpdateMessage(QString)), this, SLOT(updateProgress(QString)) ); 
     13  connect(proc, SIGNAL(UpdatePercent(QString,QString,QString)), this, SLOT(updatePercent(QString,QString,QString)) ); 
    1114  connect(ui->push_start, SIGNAL(clicked()), this, SLOT(startMigration()) ); 
    1215  connect(ui->push_reboot, SIGNAL(clicked()), this, SLOT(restartSystem()) ); 
     
    3336} 
    3437         
    35 void MigrateUI::updateProgress(){ 
    36   QString output = proc->readAllStandardOutput(); 
    37   ui->text_progress->append(output); 
     38void MigrateUI::updateProgress(QString msg){ 
     39  ui->text_progress->append(msg); 
    3840} 
    39          
     41 
     42void MigrateUI::updatePercent(QString percent, QString size, QString filename){ 
     43  QString msg = QString(tr("Downloading: %1 (%2 of %3)")).arg(filename, percent, size); 
     44  ui->text_progress->append(msg); 
     45} 
    4046void MigrateUI::restartSystem(){ 
    4147  QProcess::startDetached("shutdown -r now"); 
  • src-qt4/pc-softwaremanager/migrateUI.h

    rd25fc88 racb0f00  
    66#include <QString> 
    77#include <QCloseEvent> 
     8 
     9#include <pcbsd-DLProcess.h> 
    810 
    911#include "ui_migrateUI.h" 
     
    2123private: 
    2224        Ui::MigrateUI *ui; 
    23         QProcess *proc; 
     25        DLProcess *proc; 
    2426 
    2527private slots: 
     
    2830        void startMigration(); 
    2931        void procFinished(); 
    30         void updateProgress(); 
     32        void updateProgress(QString); 
     33        void updatePercent(QString,QString,QString); 
    3134        void restartSystem(); 
    3235 
    3336protected: 
    3437        void closeEvent(QCloseEvent *event){ 
    35           if(proc->state() != QProcess::NotRunning){ 
     38          if(proc->isRunning()){ 
    3639            //Dangerous to stop the process while it is running - just minimize it 
    3740            event->ignore(); 
  • src-qt4/pc-softwaremanager/pbiDBAccess.cpp

    rbdd93eb rc220c7e  
    6868} 
    6969 
     70QHash<QString, NGApp> PBIDBAccess::JailPkgList(QString jailID){ 
     71  syncPkgInstallList(jailID, true); //always force reload this (since it is the installed list - which changes regularly) 
     72  return PKGINSTALLED; 
     73} 
     74 
    7075NGApp PBIDBAccess::getLocalPkgDetails(NGApp app){ 
    7176  //Simply set the proper bits in the container for locally installed apps 
     
    203208      app.installedsize = info[2]; 
    204209      app.isLocked = (info[3] == "1"); 
    205       app.installedwhen = QDateTime::fromMSecsSinceEpoch( info[4].toLongLong() ).toString(Qt::DefaultLocaleShortDate); 
     210      app.installedwhen = QDateTime::fromTime_t( info[4].toLongLong() ).toString(Qt::DefaultLocaleShortDate); 
    206211      app.isOrphan = (info[5] == "1"); 
    207212      app.installedarch = info[6]; 
    208213      app.isInstalled = true; 
    209214      PKGINSTALLED.insert(info[0], app); 
     215      //if(!jailID.isEmpty()){ qDebug() << "Installed:" << out[i]; } 
    210216    } 
    211217    //Now get the reverse dependancy lists 
     
    225231    jailLoaded = jailID; //keep track of which jail this list is for 
    226232    synced = true; 
    227     //qDebug() << "PKGINSTALLED:" << PKGINSTALLED; 
    228233  } 
    229234  //qDebug() << " - end Local PKG Repo Sync"; 
  • src-qt4/pc-softwaremanager/pbiDBAccess.h

    r3b5ba44 rc220c7e  
    5656        QHash<QString, NGApp> DetailedAppList(); //PBI-apps that can/are installed 
    5757        QHash<QString, NGApp> DetailedPkgList(); //Pkg-apps that can/are installed (Warning - takes a while!) 
    58          
     58        QHash<QString, NGApp> JailPkgList(QString jailID); //Pkg-apps that are installed in jail 
     59 
    5960        //Individual access functions 
    6061        NGApp getLocalPkgDetails(NGApp); 
  • src-qt4/pc-softwaremanager/pbiNgBackend.cpp

    ra1eda3b racb0f00  
    7575     } 
    7676   }else if( JAILPKGS.contains(injail) ){   
    77      out = JAILPKGS[injail]; 
     77     out = JAILPKGS[injail].keys(); 
    7878   } 
    7979   return out;  
     
    8383  QStringList out; 
    8484  for(int i=0; i<PENDING.length(); i++){ 
    85     if(PENDING[i].contains("pc-pkg add ") || PENDING[i].contains("pbi_add ")){ 
     85    if( (PENDING[i].contains("pc-pkg ") && PENDING[i].contains(" add ") ) || PENDING[i].contains("pbi_add ")){ 
    8686      out << PENDING[i].section("::::",0,0); 
    8787    } 
     
    9393  QStringList out; 
    9494  for(int i=0; i<PENDING.length(); i++){ 
    95     if(PENDING[i].contains("pc-pkg remove ") || PENDING[i].contains("pbi_delete ")){ 
     95    if((PENDING[i].contains("pc-pkg ") && PENDING[i].contains(" remove ") ) || PENDING[i].contains("pbi_delete ")){ 
    9696      out << PENDING[i].section("::::",0,0); 
    9797    } 
     
    294294 
    295295// INFO FUNCTIONS 
    296 NGApp PBIBackend::singleAppInfo( QString app){ 
    297   if(APPHASH.contains(app)){ 
     296NGApp PBIBackend::singleAppInfo( QString app, QString injail){ 
     297  if(JAILPKGS.contains(injail)){ 
     298    QHash<QString, NGApp> hash = JAILPKGS[injail]; 
     299    if( hash.contains(app) ){ return hash[app]; } 
     300    else{ return NGApp(); } 
     301  }else if(APPHASH.contains(app)){ 
    298302    return APPHASH[app]; 
    299303  }else if(PKGHASH.contains(app)){ 
     
    329333} 
    330334 
    331 QString PBIBackend::currentAppStatus( QString appID ){ 
     335QString PBIBackend::currentAppStatus( QString appID, QString injail ){ 
    332336  QString output; 
    333337  if(appID == PKGRUN){ output = PKGRUNSTAT; } //currently running 
     
    343347    //If it gets here, it is not pending, so check for updates 
    344348    NGApp app; 
    345     if(APPHASH.contains(appID)){ app = APPHASH[appID]; } 
     349    if(JAILPKGS.contains(injail)){ 
     350        QHash<QString, NGApp> hash = JAILPKGS.value(injail); 
     351        if(hash.contains(appID)){ 
     352          app = hash[appID]; 
     353        } 
     354    } 
     355    else if(APPHASH.contains(appID)){ app = APPHASH[appID]; } 
    346356    else if(PKGHASH.contains(appID)){ app = PKGHASH[appID]; } 
    347357    if(!app.origin.isEmpty()){ 
     
    448458 
    449459 
    450 bool PBIBackend::checkForUpdates(){ 
     460bool PBIBackend::checkForUpdates(QString injail){ 
    451461  QStringList inst = sysDB->getRawInstalledPackages(); 
    452462  bool upd = false; 
     463  QHash<QString, NGApp> hash; 
     464  if(JAILPKGS.contains(injail)){ hash = JAILPKGS[injail]; } 
    453465  for(int i=0; i<inst.length() && !upd; i++){ 
    454466    NGApp app; 
    455       if(APPHASH.contains(inst[i])){ app = APPHASH[inst[i]]; } 
     467      if(hash.contains(inst[i])){ app = hash[inst[i]]; } //in a jail 
     468      else if(APPHASH.contains(inst[i])){ app = APPHASH[inst[i]]; } 
    456469      else if(PKGHASH.contains(inst[i])){ app = PKGHASH[inst[i]]; } 
    457470      else{ continue; } 
     
    463476} 
    464477 
    465 QString PBIBackend::updateDetails(){ 
    466   QString details = sysDB->runCMD("pc-updatemanager pkgcheck"); 
     478bool PBIBackend::safeToRemove(QString appID){ 
     479  return !BASELIST.contains(appID);      
     480} 
     481 
     482QString PBIBackend::updateDetails(QString injail){ 
     483  QString details; 
     484  if(injail.isEmpty() || !RUNNINGJAILS.contains(injail) ){ details = Extras::getCmdOutput("pc-updatemanager pkgcheck").join("\n"); } 
     485  else{ details = Extras::getCmdOutput("pc-updatemanager -j "+RUNNINGJAILS[injail]+" pkgcheck").join("\n"); } //need to add jail usage 
    467486  return details; 
    468487} 
     
    476495} 
    477496 
     497QString PBIBackend::JailID(QString jailname){ 
     498  if(RUNNINGJAILS.contains(jailname)){ return RUNNINGJAILS[jailname]; } 
     499  else{ return ""; } 
     500} 
    478501 // ========================== 
    479502 // ====== PUBLIC SLOTS ====== 
     
    577600      if( !jail.isEmpty() && !ID.isEmpty() ){ 
    578601        RUNNINGJAILS.insert( jail, ID ); // <name, ID> 
    579         QStringList pkgs = sysDB->listJailPackages(ID); 
    580         qDebug() << "Jail Pkgs:" << jail << ID << pkgs; 
     602        QHash<QString, NGApp> pkgs = sysDB->JailPkgList(ID); 
    581603        JAILPKGS.insert(jail, pkgs); 
    582604      } 
     
    584606  }else{ 
    585607    //Just update the installed list for the given jail 
    586     QStringList pkgs = sysDB->listJailPackages(RUNNINGJAILS[jail]); 
     608    QHash<QString, NGApp> pkgs = sysDB->JailPkgList(RUNNINGJAILS[jail]); 
    587609    JAILPKGS.insert(jail, pkgs); 
    588610  } 
  • src-qt4/pc-softwaremanager/pbiNgBackend.h

    ra1eda3b racb0f00  
    6969         
    7070        // Information Retrieval 
    71         NGApp singleAppInfo(QString app); 
     71        NGApp singleAppInfo(QString app, QString injail = ""); 
    7272        QList<NGApp> AppInfo( QStringList apps ); 
    7373        NGCat singleCatInfo(QString cat); 
     
    7575        QList<NGApp> SimilarApps( QString app ); 
    7676         
    77         QString currentAppStatus( QString appID ); 
     77        QString currentAppStatus(QString appID , QString injail = ""); 
    7878        bool isWorking(QString pbiID); 
    7979        QStringList appBinList(QString appID); //<name>::::<*.desktop file path> list 
     
    8989        //General purpose 
    9090        void runCmdAsUser(QString cmd); 
    91         bool checkForUpdates(); 
    92         QString updateDetails(); 
     91        bool checkForUpdates(QString injail=""); 
     92        bool safeToRemove(QString appID); 
     93        QString updateDetails(QString injail=""); 
    9394        QStringList filterBasePkgs(QStringList); 
     95        QString JailID(QString jailname); 
     96         
     97        //General functions 
     98        QStringList listDependencies(QString); 
     99        QStringList listRDependencies(QString); 
    94100         
    95101public slots: 
     
    126132        //Jail interaction/translation 
    127133        QHash<QString, QString> RUNNINGJAILS; // <name, ID> 
    128         QHash<QString, QStringList> JAILPKGS; // <name, list of installed pkgs> 
     134        QHash<QString, QHash<QString, NGApp> > JAILPKGS; // <name, hash of pkg details> 
    129135        void checkForJails(QString jailID=""); //parses the "jls" command to get name/JID combinations 
    130          
    131         //General functions 
    132         QStringList listDependencies(QString); 
    133         QStringList listRDependencies(QString); 
    134136         
    135137private slots: 
  • src-qt4/pc-softwaremanager/updateDialog.cpp

    r0381f41 racb0f00  
    22#include "ui_updateDialog.h" 
    33 
    4 UpdateDialog::UpdateDialog(QWidget* parent) : QDialog(parent), ui(new Ui::UpdateDialog){ 
     4UpdateDialog::UpdateDialog(QWidget* parent, QString jailID) : QDialog(parent), ui(new Ui::UpdateDialog){ 
    55  ui->setupUi(this); //load the designer file 
    66  rebooting = false; //output variable 
     
    1010        proc->setParentWidget(this); 
    1111        proc->setDLType("PKG"); //pkg download message system 
     12 
     13  //Initial UI setup 
     14  ui->text_log->setVisible(false); 
     15  ui->check_viewlog->setChecked(false); 
     16  ui->frame->setVisible(false); 
    1217         
    1318  //Connect the signals/slots 
     
    2126  ui->push_done->setVisible(false); 
    2227  ui->push_reboot->setVisible(false); 
     28   
    2329  //Now start the process 
    24   proc->start("pc-updatemanager pkgupdate"); 
     30  if(jailID.isEmpty()){ 
     31    proc->start("pc-updatemanager pkgupdate"); 
     32  }else{ 
     33    proc->start("pc-updatemanager -j "+jailID+" pkgupdate"); 
     34  } 
    2535} 
    2636 
     
    3040 
    3141void UpdateDialog::procMessage(QString msg){ 
     42  ui->frame->setVisible(true); 
    3243  ui->text_log->append(msg); 
    3344  //Do some quick parsing of the message for better messages 
     
    4657 
    4758void UpdateDialog::procUpdate(QString percent, QString fsize, QString fname){ 
     59  ui->frame->setVisible(true); 
    4860  ui->label_progress->setText( QString(tr("Downloading %1 (%2)")).arg(fname, fsize) ); 
    4961  ui->progressBar->setValue( percent.toInt() ); 
     
    5264 
    5365void UpdateDialog::procFinished(int ret, QProcess::ExitStatus stat){ 
     66  ui->frame->setVisible(false); 
    5467  if(ret !=0 || stat!=QProcess::NormalExit){ 
    5568    //Error 
  • src-qt4/pc-softwaremanager/updateDialog.h

    r0381f41 racb0f00  
    1515        Q_OBJECT 
    1616public: 
    17         UpdateDialog(QWidget *parent = 0); 
     17        UpdateDialog(QWidget *parent = 0, QString jailID = ""); 
    1818        ~UpdateDialog(); 
    1919 
Note: See TracChangeset for help on using the changeset viewer.