~ubuntu-core-dev/synaptic/ubuntu

« back to all changes in this revision

Viewing changes to gtk/rgmainwindow.cc

  • Committer: mvo
  • Date: 2004-10-06 16:46:20 UTC
  • Revision ID: gustavo@niemeyer.net-20041006164620-74f4a2d8ad59fbca
* packages can be marked as supported with a special icon now 
  (see README.supported for details)
* "Auto-Install Recommends" is back

Show diffs side-by-side

added added

removed removed

Lines of Context:
362
362
   // return if no pkg is selected
363
363
   if (!pkg) 
364
364
      return;
365
 
   
 
365
 
 
366
//    cout <<   pkg->label() << endl;
 
367
//    cout <<   pkg->component() << endl;
 
368
  
366
369
   // set menu according to pkg status
367
370
   int flags = pkg->getFlags();
368
371
 
533
536
   return changed;
534
537
}
535
538
 
 
539
void RGMainWindow::installAllWeakDepends(RPackage *pkg, 
 
540
                                         pkgCache::Dep::DepType type)
 
541
{
 
542
   //cout << "RGMainWindow::installWeakDepends()" << endl;
 
543
   if(pkg == NULL) return;
 
544
   
 
545
   vector<RPackage::DepInformation> deps = pkg->enumDeps();
 
546
   for(unsigned int i=0;i<deps.size();i++) {
 
547
      if(deps[i].type == type) {
 
548
         if(!deps[i].isVirtual) {
 
549
            RPackage *newpkg = (RPackage *) _lister->getPackage(deps[i].name);
 
550
            pkgInstallHelper(newpkg);
 
551
         }
 
552
      }
 
553
   } 
 
554
}
 
555
 
536
556
void RGMainWindow::pkgAction(RGPkgAction action)
537
557
{
538
558
   GtkTreeSelection *selection;
590
610
         case PKG_INSTALL:     // install
591
611
            instPkgs.push_back(pkg);
592
612
            pkgInstallHelper(pkg, false);
 
613
            if(_config->FindB("Synaptic::UseRecommends", false)) {
 
614
               installAllWeakDepends(pkg, pkgCache::Dep::Recommends);
 
615
            }
593
616
            break;
594
617
         case PKG_INSTALL_FROM_VERSION:     // install with specific version
595
618
            pkgInstallHelper(pkg, false);
785
808
      all_columns.push_back(pair<int, GtkTreeViewColumn *>(pos, column));
786
809
   }
787
810
 
 
811
   /* supported(pixmap) column */
 
812
   pos = _config->FindI("Synaptic::supportedColumnPos", 1);
 
813
   visible = _config->FindI("Synaptic::supportedColumnVisible", true);
 
814
   if(visible) {
 
815
      renderer = gtk_cell_renderer_pixbuf_new();
 
816
      // TRANSLATORS: Column header for the column "Status" in the package list
 
817
      column = gtk_tree_view_column_new_with_attributes(_(" "), renderer,
 
818
                                                        "pixbuf",
 
819
                                                        SUPPORTED_COLUMN, NULL);
 
820
      gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
 
821
      gtk_tree_view_column_set_fixed_width(column, 20);
 
822
      //gtk_tree_view_insert_column(GTK_TREE_VIEW(_treeView), column, pos);
 
823
      gtk_tree_view_column_set_sort_column_id(column, COLOR_COLUMN);
 
824
      all_columns.push_back(pair<int, GtkTreeViewColumn *>(pos, column));
 
825
   }
 
826
 
788
827
 
789
828
   /* Package name */
790
 
   pos = _config->FindI("Synaptic::nameColumnPos", 1);
 
829
   pos = _config->FindI("Synaptic::nameColumnPos", 2);
791
830
   visible = _config->FindI("Synaptic::nameColumnVisible", true);
792
831
   if (visible) {
793
832
      renderer = gtk_cell_renderer_text_new();