~lubuntu-software-center-team/lubuntu-software-center/vala-port

« back to all changes in this revision

Viewing changes to src/Widgets/Pages/AppsView.vala

  • Committer: Stephen Smally
  • Date: 2012-07-04 11:46:04 UTC
  • Revision ID: eco.stefi@fastwebnet.it-20120704114604-3esw3fj1oo1j7eed
Implemented Database categories within GUI

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
        private Value value;
32
32
        private string stock_image;
33
33
        
34
 
        public void append_app (Package app) {
35
 
            if (app.get_info() == Info.INSTALLED) {
 
34
        public void append_app (LscApp app) {
 
35
            /*if (app.get_info() == Info.INSTALLED) {
36
36
                stock_image = Stock.YES;
37
37
            } else {
38
38
                stock_image = null;
39
 
            }
 
39
            }*/
40
40
            model.append(out iter);
41
 
            model.set(iter, 0, "deb", 1, IconSize.DND, 2, app.get_name()+"\n"+app.get_summary(), 3, stock_image, 4, app.get_id());
 
41
            model.set(iter, 0, app.icon, 1, app.name+"\n"+app.summary, 2, stock_image, 3, app.id);
42
42
        }
43
43
        
44
44
        public void clear () {
55
55
        }
56
56
        
57
57
        public AppsTree () {
58
 
            model = new ListStore(5,
 
58
            model = new ListStore(4,
59
59
                typeof(string), // Icon name
60
 
                typeof(int),    // Icon size
61
60
                typeof(string), // Name and description
62
61
                typeof(string), // Installed (Gtk.Stock)
63
62
                typeof(string)  // Package ID
65
64
            
66
65
            set_model(model);
67
66
            
68
 
            insert_column_with_attributes(-1, "Icon", new CellRendererPixbuf(), "icon-name", 0, "stock-size", 1);
69
 
            insert_column_with_attributes(-1, "Inst", new CellRendererPixbuf(), "stock-id", 3);
70
 
            insert_column_with_attributes(-1, "Name", new CellRendererText(), "text", 2);
71
 
            
72
 
            get_column(2).set_sort_column_id(2);
 
67
            CellRendererPixbuf icon_cell = new CellRendererPixbuf();
 
68
            icon_cell.stock_size = IconSize.DND;
 
69
            
 
70
            insert_column_with_attributes(-1, "Icon", icon_cell, "icon-name", 0);
 
71
            insert_column_with_attributes(-1, "Inst", new CellRendererPixbuf(), "stock-id", 2);
 
72
            insert_column_with_attributes(-1, "Name", new CellRendererText(), "text", 1);
 
73
            
 
74
            get_column(2).set_sort_column_id(1);
73
75
            get_column(2).set_expand(true);
74
76
            get_column(2).clicked();
75
77
            
76
 
            get_column(1).set_sort_column_id(3);
 
78
            get_column(1).set_sort_column_id(2);
77
79
            
78
80
            cursor_changed.connect(on_cursor_changed);
79
81