~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-05 13:49:59 UTC
  • Revision ID: eco.stefi@fastwebnet.it-20120705134959-y5vg66cadej8vix1
Added mutable install/remove button

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
        private ListStore model;
30
30
        private TreeIter iter;
31
31
        private TreePath path;
32
 
        private string stock_image;
33
32
        
34
 
        public void append_app (LscApp app) {
35
 
            /*if (app.get_info() == Info.INSTALLED) {
36
 
                stock_image = Stock.YES;
37
 
            } else {
38
 
                stock_image = null;
39
 
            }*/
40
 
            
 
33
        public void append_app (LscApp app) {            
41
34
            model.append(out iter);
42
 
            model.set(iter, 0, app.icon, 1, app.name+"\n"+app.summary, 2, stock_image, 3, app);
 
35
            model.set(iter, 0, app.icon, 1, app.name+"\n"+app.summary, 2, app);
43
36
        }
44
37
        
45
38
        public void clear () {
51
44
            if (path != null) {
52
45
                                LscApp val;
53
46
                model.get_iter(out iter, path);
54
 
                model.get(iter, 3, out val);
 
47
                model.get(iter, 2, out val);
55
48
                selected_row(val);
56
49
            }
57
50
        }
61
54
                        theme.append_search_path ("/usr/share/app-install/icons");
62
55
                        
63
56
                        Type t_string = typeof (string);
64
 
            model = new ListStore(4,
 
57
            model = new ListStore(3,
65
58
                t_string, // Icon name
66
59
                t_string, // Name and description
67
 
                t_string, // Installed (Gtk.Stock)
68
60
                typeof(LscApp)  // LscApp object
69
61
            );
70
62
            
77
69
            text.ellipsize = Pango.EllipsizeMode.END;
78
70
            
79
71
            insert_column_with_attributes(-1, "Icon", icon_cell, "icon-name", 0);
80
 
            insert_column_with_attributes(-1, "Inst", new CellRendererPixbuf(), "stock-id", 2);
81
72
            insert_column_with_attributes(-1, "Name", text, "text", 1);
82
73
            
83
 
            get_column(2).set_sort_column_id(1);
84
 
            get_column(2).set_expand(true);
85
 
            get_column(2).clicked();
86
 
            
87
 
            get_column(1).set_sort_column_id(2);
 
74
            get_column(1).set_sort_column_id(1);
 
75
            get_column(1).set_expand(true);
 
76
            get_column(1).clicked();
88
77
            
89
78
            rules_hint = true;
90
79