[Aptitude-devel] [PATCH 1 of 2] Hide progress cell for the "Download started" row in the Downloads page

Luca Bruno lethalman88 at gmail.com
Thu Dec 25 17:11:26 UTC 2008


# HG changeset patch
# User Luca Bruno <lethalman88 at gmail.com>
# Date 1230223424 -3600
# Node ID 0730a57a88401e1af8d14505c300d61a12519ed0
# Parent  c188bfd4515f426032c59b9c7acd2b6d475e4ad6
Hide progress cell for the "Download started" row in the Downloads page.
	* src/gtk/download.cc (download_list_model::Start): do not show the
	  progress with "Download started"
	(download_list_model::maybe_new_item): show the progress on a newly
created list item
	(DownloadTab::DownloadTab): added "visible" attribute
	(DownloadColumns::DownloadColumns): add ProgressVisible model column

	* src/gtk/download.h (DownloadColumns): declared new model column
	  ProgressVisible

diff --git a/src/gtk/download.cc b/src/gtk/download.cc
--- a/src/gtk/download.cc
+++ b/src/gtk/download.cc
@@ -78,6 +78,7 @@
       row[download_columns.URI] = Itm.URI;
       row[download_columns.ShortDesc] = Itm.ShortDesc;
       row[download_columns.Description] = Itm.Description;
+      row[download_columns.ProgressVisible] = true;
     }
   }
 
@@ -104,6 +105,7 @@
     Gtk::TreeModel::Row row = *store_iter;
     row[download_columns.URI] = "";
     row[download_columns.ShortDesc] = "";
+    row[download_columns.ProgressVisible] = false;
     row[download_columns.Description] = "Download started";
   }
 
@@ -161,6 +163,7 @@
     add(URI);
     add(Status);
     add(ProgressPerc);
+    add(ProgressVisible);
     add(ShortDesc);
     add(Description);
   }
@@ -206,6 +209,7 @@
       ProgressPerc->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED);
       ProgressPerc->set_fixed_width(100);
       ProgressPerc->add_attribute(progress_renderer->property_value(), download_columns.ProgressPerc);
+      ProgressPerc->add_attribute(progress_renderer->property_visible(), download_columns.ProgressVisible);
       treeview->append_column(*ProgressPerc);
     }
 
diff --git a/src/gtk/download.h b/src/gtk/download.h
--- a/src/gtk/download.h
+++ b/src/gtk/download.h
@@ -47,6 +47,7 @@
       Gtk::TreeModelColumn<Glib::ustring> URI;
       Gtk::TreeModelColumn<Glib::ustring> Status;
       Gtk::TreeModelColumn<int> ProgressPerc;
+      Gtk::TreeModelColumn<bool> ProgressVisible;
       Gtk::TreeModelColumn<Glib::ustring> Description;
       Gtk::TreeModelColumn<Glib::ustring> ShortDesc;
 



More information about the Aptitude-devel mailing list