Changeset 1ac09a9


Ignore:
Timestamp:
05/05/14 10:16:36 (11 months ago)
Author:
Josh <joshms@…>
Branches:
master, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1
Children:
3fd6a59
Parents:
3da60ed5 (diff), 05b024a (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 git://github.com/pcbsd/pcbsd

Files:
34 added
5 edited

Legend:

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

    rd73f99a ra1eda3b  
    124124void MainUI::on_actionDeveloper_Mode_triggered(){ 
    125125  ui->text_dev_output->setVisible(ui->actionDeveloper_Mode->isChecked()); 
     126} 
     127 
     128void MainUI::on_actionShow_Base_Packages_triggered(){ 
     129  slotRefreshInstallTab();       
     130} 
     131 
     132void MainUI::on_actionShow_Local_System_triggered(){ 
     133  ui->actionShow_Local_System->setChecked(true); 
     134  VISJAIL.clear(); //no jail visible 
     135  slotRefreshInstallTab(); 
     136} 
     137 
     138void MainUI::on_menuShow_Jail_triggered(QAction* act){ 
     139  //Get the selected jail 
     140  VISJAIL = act->text(); 
     141  ui->actionShow_Local_System->setChecked(false); 
     142  slotRefreshInstallTab(); 
    126143} 
    127144 
     
    192209  QString ID = item->whatsThis(0); 
    193210  NGApp app = PBI->singleAppInfo(ID); 
     211  //qDebug() << "Item:" << ID << app.origin << app.name << item->text(0); 
    194212  if(app.origin.isEmpty()){ return; } //invalid item 
    195213  if(item->text(0).isEmpty()){  //new entry - get everything 
     
    199217      item->setText(2, PBI->currentAppStatus(ID)); 
    200218      //for(int i=0; i<vals.length(); i++){ item->setText(i,vals[i]); } 
    201       QString icon = app.icon; 
     219      QString icon = checkIcon(app.icon, app.type); 
    202220        //Load a default icon if none found 
    203221      if(icon.isEmpty() || !QFile::exists(icon) ){ icon = defaultIcon; } 
     
    234252  //Update the list of installed PBI's w/o clearing the list (loses selections) 
    235253   //Get the list we need (in order) 
    236   QStringList installList = PBI->installedList(); 
     254  slotUpdateJailMenu(); 
     255  if(VISJAIL.isEmpty()){ ui->label_install_jail->setText( tr("Showing: Local System") ); } 
     256  else{ ui->label_install_jail->setText( QString(tr("Showing Jail: %1")).arg(VISJAIL) ); } 
     257  QStringList installList = PBI->installedList(VISJAIL); 
     258  //qDebug() << "Installed Pkgs:" << installList; 
    237259  installList.append( PBI->pendingInstallList() ); 
    238260  installList.removeDuplicates(); 
    239   installList = PBI->filterBasePkgs(installList); //don't show base dependencies 
     261  if( !ui->actionShow_Base_Packages->isChecked() ){ 
     262    installList = PBI->filterBasePkgs(installList); //don't show base dependencies 
     263  } 
    240264  //Quick finish if no items installed/pending 
    241265  if(installList.isEmpty()){ 
     
    244268  } 
    245269  //Get the list we have now and handle items as needed 
    246   QStringList cList; 
     270  //QStringList cList; 
    247271  for(int i=0; i<ui->tree_install_apps->topLevelItemCount(); i++){ 
    248272    QString item = ui->tree_install_apps->topLevelItem(i)->whatsThis(0); 
     
    264288        //Now format the display 
    265289        formatInstalledItemDisplay(item); 
     290        //qDebug() << "New Item:" << installList[i] << item->text(0); 
    266291        if(item->text(0).isEmpty()){ 
    267292          //Do not put empty items into the display 
     
    269294        }else{ 
    270295          //Now insert this item onto the list 
    271           ui->tree_install_apps->insertTopLevelItem(i,item); 
     296          ui->tree_install_apps->addTopLevelItem(item); 
    272297        } 
    273298  } 
     
    348373 //Make sure it is a valid/installed application 
    349374 QString appID = item->whatsThis(0); 
    350    if( !PBI->isInstalled(appID) ){ return; } 
    351375  qDebug() << "Item Double Clicked:" << appID; 
    352376  //Update the info on the details page 
     
    390414  bool pending = PBI->isWorking(pbiID); 
    391415  contextActionMenu->clear(); 
    392   if( (info.version != info.installedversion) &&  !pending){ 
    393     //Upgrade is only available if actions not pending 
    394     contextActionMenu->addAction( QIcon(":icons/view-refresh.png"), tr("Update"), this, SLOT(slotActionUpdate()) ); 
    395     contextActionMenu->addSeparator(); 
    396   } 
    397416  if(info.hasDE){ 
    398417    QMenu *dmenu = contextActionMenu->addMenu( QIcon(":icons/xdg_desktop.png"), tr("Desktop Icons")); 
     
    435454    checkedID = generateRemoveMessage(checkedID); 
    436455    if( !checkedID.isEmpty() ){ 
    437       PBI->removePBI(checkedID); 
     456      PBI->removePBI(checkedID, VISJAIL); 
    438457    } 
    439458  } 
     
    961980} 
    962981 
     982void MainUI::slotUpdateJailMenu(){ 
     983  ui->menuShow_Jail->clear(); 
     984  QStringList jls = PBI->runningJails(); 
     985  for(int i=0; i<jls.length(); i++){ 
     986    ui->menuShow_Jail->addAction(jls[i]); 
     987  } 
     988  if(jls.isEmpty()){ 
     989    ui->actionShow_Local_System->setEnabled(false); 
     990    ui->actionShow_Local_System->setChecked(true); 
     991    ui->label_install_jail->setVisible(false); 
     992    ui->menuShow_Jail->setEnabled(false); 
     993    if( !VISJAIL.isEmpty() ){ 
     994      VISJAIL.clear(); 
     995      //slotRefreshInstallTab(); 
     996    } 
     997  }else{ 
     998    ui->label_install_jail->setVisible(true); 
     999    ui->actionShow_Local_System->setEnabled(true); 
     1000    ui->menuShow_Jail->setEnabled(true);           
     1001  } 
     1002 
     1003} 
    9631004void MainUI::slotDisplayError(QString title,QString message,QStringList log){ 
    9641005  QMessageBox *dlg = new QMessageBox(this); 
  • src-qt4/pc-softwaremanager/mainUI.h

    r0381f41 ra1eda3b  
    4848   explicit MainUI(QWidget* parent = 0); 
    4949   void ProgramInit(); 
    50    //void setWardenMode(QString dir,QString ip); //call before ProgramInit 
    5150 
    5251public slots: 
     
    6362  void on_actionAppCafe_Settings_triggered(); 
    6463  void on_actionDeveloper_Mode_triggered(); 
     64 
     65  void on_actionShow_Base_Packages_triggered(); 
     66  void on_actionShow_Local_System_triggered(); 
     67  void on_menuShow_Jail_triggered(QAction*); 
    6568 
    6669  void on_tool_start_updates_clicked(); 
     
    125128  //INSTALLED TAB 
    126129  QMenu *actionMenu, *appBinMenu, *sDeskMenu, *contextActionMenu, *jailMenu, *backMenu; 
    127   QString cDetails; 
     130  QString cDetails, VISJAIL; 
    128131  void initializeInstalledTab(); 
    129132  void formatInstalledItemDisplay(QTreeWidgetItem *item); 
     133  void slotUpdateJailMenu(); 
    130134  QStringList getCheckedItems(); 
    131135  //BROWSER TAB 
  • src-qt4/pc-softwaremanager/mainUI.ui

    rbdd93eb ra1eda3b  
    8989     <widget class="QTabWidget" name="tabWidget"> 
    9090      <property name="currentIndex"> 
    91        <number>1</number> 
     91       <number>0</number> 
    9292      </property> 
    9393      <property name="iconSize"> 
     
    124124         <layout class="QHBoxLayout" name="horizontalLayout_11"> 
    125125          <item> 
    126            <widget class="QComboBox" name="comboBox"/> 
     126           <widget class="QLabel" name="label_install_jail"> 
     127            <property name="font"> 
     128             <font> 
     129              <weight>75</weight> 
     130              <bold>true</bold> 
     131             </font> 
     132            </property> 
     133            <property name="text"> 
     134             <string notr="true">Showing Local System</string> 
     135            </property> 
     136           </widget> 
    127137          </item> 
    128138          <item> 
     
    782792                  <item> 
    783793                   <widget class="QToolButton" name="tool_app_tips"> 
     794                    <property name="toolTip"> 
     795                     <string>Open up the wiki page for this application</string> 
     796                    </property> 
    784797                    <property name="styleSheet"> 
    785798                     <string notr="true">QToolButton{background: transparent; border-width: 0px;} 
     
    16121625    <addaction name="actionRaw_Packages"/> 
    16131626   </widget> 
     1627   <widget class="QMenu" name="menuInstall_View"> 
     1628    <property name="title"> 
     1629     <string>Install View</string> 
     1630    </property> 
     1631    <widget class="QMenu" name="menuShow_Jail"> 
     1632     <property name="title"> 
     1633      <string>Show Jail</string> 
     1634     </property> 
     1635     <addaction name="actionSample"/> 
     1636    </widget> 
     1637    <addaction name="actionShow_Base_Packages"/> 
     1638    <addaction name="separator"/> 
     1639    <addaction name="actionShow_Local_System"/> 
     1640    <addaction name="menuShow_Jail"/> 
     1641   </widget> 
    16141642   <addaction name="menuFile"/> 
    16151643   <addaction name="menuConfigure"/> 
     1644   <addaction name="menuInstall_View"/> 
    16161645   <addaction name="menuBrowser_View"/> 
    16171646  </widget> 
     
    17291758   </property> 
    17301759  </action> 
     1760  <action name="actionShow_Base_Packages"> 
     1761   <property name="checkable"> 
     1762    <bool>true</bool> 
     1763   </property> 
     1764   <property name="text"> 
     1765    <string>Show Base Packages</string> 
     1766   </property> 
     1767  </action> 
     1768  <action name="actionShow_Local_System"> 
     1769   <property name="checkable"> 
     1770    <bool>true</bool> 
     1771   </property> 
     1772   <property name="checked"> 
     1773    <bool>true</bool> 
     1774   </property> 
     1775   <property name="text"> 
     1776    <string>Show Local System</string> 
     1777   </property> 
     1778  </action> 
     1779  <action name="actionSample"> 
     1780   <property name="text"> 
     1781    <string>Sample</string> 
     1782   </property> 
     1783  </action> 
    17311784 </widget> 
    17321785 <resources> 
  • src-qt4/pc-softwaremanager/pbiNgBackend.cpp

    r3b5ba44 ra1eda3b  
    6767} 
    6868 
    69 QStringList PBIBackend::installedList(){ 
    70    QStringList KL = APPHASH.keys(); 
     69QStringList PBIBackend::installedList(QString injail){ 
    7170   QStringList out; 
     71   if( injail.isEmpty() ){  
     72     QStringList KL  = APPHASH.keys();  
    7273     for(int i=0; i<KL.length(); i++){ 
    7374       if(APPHASH[KL[i]].isInstalled){ out << KL[i]; } 
    7475     } 
     76   }else if( JAILPKGS.contains(injail) ){   
     77     out = JAILPKGS[injail]; 
     78   } 
    7579   return out;  
    7680} 
     
    163167        QString cmd = PKGCMD; 
    164168        if(PROCTYPE==0 ){ cmd =cmd.replace("pbi_add ", "pbi_remove "); } 
    165         else if(PROCTYPE==0 && cmd.contains("pc-pkg ") ){ cmd = cmd.replace("pc-pkg add ", "pc-pkg remove "); } 
    166         else if(PROCTYPE==1 && cmd.contains("pc-pkg ") ){ cmd = cmd.replace("pc-pkg remove ", "pc-pkg add "); } 
     169        else if(PROCTYPE==0 && cmd.contains("pc-pkg ") ){ cmd = cmd.replace(" add ", " remove "); } 
     170        else if(PROCTYPE==1 && cmd.contains("pc-pkg ") ){ cmd = cmd.replace(" remove ", " add "); } 
    167171        else if(PROCTYPE==1){ cmd=cmd.replace("pbi_remove ", "pbi_add "); } 
    168172        if(PROCTYPE >= 0){ PENDING.prepend(PKGRUN+"::::"+cmd+"::::"+PKGJAIL); } 
     
    182186    bool jailpkgok = false; 
    183187    if(jailok){ jailpkgok = !JAILPKGS[injail].contains(app.origin); } 
    184       if( !app.isInstalled || jailpkgok ){ 
     188      if( (!app.isInstalled && !jailok) || jailpkgok ){ 
    185189        //Not a fully-installed PBI - cancel it instead (probably pending) 
     190        qDebug() << jailok << jailpkgok << appID[i]; 
    186191        cancelList << appID[i]; 
    187192      }else if( BASELIST.contains(appID[i]) ){ 
     
    331336      if(PENDING[i].startsWith(appID+"::::")){ 
    332337        //Currently pending - check which type (install/remove) 
    333         if(PENDING[i].contains("pbi_add") || PENDING[i].contains("pc-pkg add") ){ output = tr("Pending Installation"); } 
    334         else if(PENDING[i].contains("pbi_delete") || PENDING[i].contains("pc-pkg remove") ){ output = tr("Pending Removal"); } 
     338        if(PENDING[i].contains("pbi_add") || (PENDING[i].contains("pc-pkg ") &&PENDING[i].contains(" add ") ) ){ output = tr("Pending Installation"); } 
     339        else if(PENDING[i].contains("pbi_delete") || (PENDING[i].contains("pc-pkg ") && PENDING[i].contains(" remove ") ) ){ output = tr("Pending Removal"); } 
    335340        return output; 
    336341      } 
     
    547552  if(cmd.isEmpty()){ return; } //invalid app 
    548553  if(!injail.isEmpty() && RUNNINGJAILS.contains(injail)){ 
    549     cmd.append("-j "+RUNNINGJAILS[injail]+" "); //Make sure to use the Jail ID number 
     554    if(cmd.startsWith("pc-pkg")){ 
     555      cmd.replace("pc-pkg", "pc-pkg -j "+RUNNINGJAILS[injail]); //jail usage is between the pkg and <command> 
     556    }else{ 
     557      cmd.append("-j "+RUNNINGJAILS[injail]+" "); //Make sure to use the Jail ID number 
     558    } 
    550559  }else{injail.clear(); } 
    551560  cmd.append(origin); 
     
    745754      BASELIST = listDependencies("misc/pcbsd-base"); 
    746755      BASELIST.removeDuplicates(); 
    747       qDebug() << "Base:" << BASELIST; 
     756      //qDebug() << "Base:" << BASELIST; 
    748757   } 
     758   if(RUNNINGJAILS.isEmpty()){ checkForJails(); } 
    749759   //qDebug() << "Load CATHASH"; 
    750760   CATHASH = sysDB->Categories(); // load all the different categories info 
  • src-qt4/pc-softwaremanager/pbiNgBackend.h

    r3b5ba44 ra1eda3b  
    4444        QString searchSimilar; 
    4545        // Main Listing functions 
    46         QStringList installedList(); //return origin of all installed PBI's 
     46        QStringList installedList(QString injail = ""); //return origin of all installed PBI's 
    4747        QStringList pendingInstallList(); //return origin of all apps pending install 
    4848        QStringList pendingRemoveList(); //return origin of all apps pending removal 
Note: See TracChangeset for help on using the changeset viewer.