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

« back to all changes in this revision

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

  • Committer: Stephen Smally
  • Date: 2012-07-05 09:18:39 UTC
  • Revision ID: eco.stefi@fastwebnet.it-20120705091839-rqi1jj3ds7mws4ap
Added installed, available and local check in info dialog

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
        private Separator separator;
26
26
        private RoundBox box;
27
27
        public RoundBox reviews_box;
 
28
        private Image status_icon;
 
29
        private Label status_label;
28
30
        private Label load_label;
29
31
        private Image image;
30
32
        private Label pkg_name;
41
43
                        c.set_visible (true);
42
44
                }
43
45
        
 
46
        public void set_status (string data) {
 
47
                        switch (data) {
 
48
                                case "installed":
 
49
                                    status_icon.set_from_stock (Stock.YES, IconSize.MENU);
 
50
                                    status_label.label = "<i>%s</i>".printf ("Installed");
 
51
                                    break;
 
52
                                case "local":
 
53
                                    status_icon.set_from_icon_name ("deb", IconSize.MENU);
 
54
                                    status_label.label = "<i>%s</i>".printf ("Local");
 
55
                                    break;
 
56
                                default:
 
57
                                    status_icon.set_from_icon_name ("applications-internet", IconSize.MENU);
 
58
                                    status_label.label = "<i>%s</i>".printf ("Available");
 
59
                                    break;
 
60
                        }
 
61
                }
 
62
        
44
63
        public void set_details (LscApp app, Package pkg, Details details) {
45
64
                        this.foreach (show_children);
46
65
                        load_label.set_visible (false);
47
66
                        reviews_box.set_visible (false);
48
67
                        
 
68
                        set_status (pkg.get_data ());
 
69
                        
49
70
            pkg_name.label = "<big><b>"+app.name+"</b></big>";
50
71
            short_description.label = "<i>"+app.summary+"</i>";
51
72
            
104
125
            // Status box
105
126
            Box status_box = new Box(Orientation.HORIZONTAL, 0);
106
127
            
107
 
            Label status_label = new Label("<i>Installed</i>");
 
128
            status_label = new Label("");
108
129
            status_label.margin_right = 2;
109
130
            status_label.use_markup = true;
110
131
            
111
 
            status_box.pack_start(new Image.from_stock(Stock.YES, IconSize.MENU), false, false, 0);
 
132
            status_icon = new Image.from_stock(Stock.YES, IconSize.MENU);
 
133
            
 
134
            status_box.pack_start(status_icon, false, false, 0);
112
135
            status_box.pack_start(status_label, false, false, 0);
113
136
            
114
137
            summary_box.pack_end(status_box, false, false, 0);