[gnome-documents] listview: display file type and source details



commit 6572aed42bedbc2016783a89f2d3c23de3cc948f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Aug 31 14:31:04 2011 -0400

    listview: display file type and source details

 src/listView.js |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/listView.js b/src/listView.js
index 741c6fe..e4759eb 100644
--- a/src/listView.js
+++ b/src/listView.js
@@ -24,6 +24,7 @@ const Gd = imports.gi.Gd;
 const Pango = imports.gi.Pango;
 
 const Documents = imports.documents;
+const Global = imports.global;
 const View = imports.view;
 const Lang = imports.lang;
 
@@ -95,5 +96,27 @@ ListView.prototype = {
                           'text', Documents.ModelColumns.TITLE);
         col.add_attribute(textRenderer,
                           'line-two', Documents.ModelColumns.AUTHOR);
+
+        let typeRenderer =
+            new Gtk.CellRendererText({ xpad: 24 });
+        col.pack_start(typeRenderer, false);
+        col.set_cell_data_func(typeRenderer, Lang.bind(this,
+            function(col, cell, model, iter) {
+                let urn = model.get_value(iter, Documents.ModelColumns.URN);
+                let doc = Global.documentManager.lookupDocument(urn);
+
+                typeRenderer.text = doc.typeDescription;
+            }));
+
+        let whereRenderer =
+            new Gtk.CellRendererText({ xpad: 16 });
+        col.pack_start(whereRenderer, false);
+        col.set_cell_data_func(whereRenderer, Lang.bind(this,
+            function(col, cell, model, iter) {
+                let urn = model.get_value(iter, Documents.ModelColumns.URN);
+                let doc = Global.documentManager.lookupDocument(urn);
+
+                whereRenderer.text = doc.sourceName;
+            }));
     }
 };



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]