~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 16:30:46 UTC
  • Revision ID: eco.stefi@fastwebnet.it-20120705163046-01tc1im1m9efk0zo
Added install and remove voids

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
namespace Lsc.Pages {
24
24
    public class AppsInfo : Box {
 
25
                public signal void action_response (ActionType type, string id);
 
26
                
25
27
        private Separator separator;
26
28
        private RoundBox box;
27
29
        public RoundBox reviews_box;
36
38
        private Label version;
37
39
        private Label size;
38
40
        private Button action_button;
 
41
        private string pkg_id;
 
42
        private ActionType action_type;
39
43
        
40
44
        private void hide_children (Widget c) {
41
45
                        c.set_visible (false);
45
49
                }
46
50
        
47
51
        public void set_action (ActionType type) {
 
52
                        action_type = type;
48
53
                        switch (type) {
49
54
                                case ActionType.INSTALL:
50
55
                                    action_button.label = "Install";
71
76
                }
72
77
        
73
78
        public void set_details (LscApp app, Package pkg, Details details) {
 
79
                        pkg_id = pkg.get_id();
 
80
                        
74
81
                        this.foreach (show_children);
75
82
                        load_label.set_visible (false);
76
83
                        reviews_box.set_visible (false);
89
96
            size.label = "<b>Size:</b> "+details.size.to_string();
90
97
        }
91
98
        
 
99
        public void emit_action (Button button) {
 
100
                        action_response (action_type, pkg_id);
 
101
                }
 
102
        
92
103
        public void start_load (string comment) {
93
104
                        this.foreach (hide_children);
94
105
                        load_label.set_visible (true);
204
215
            
205
216
            Button bt = new Button.with_label("Check for reviews");
206
217
            action_button = new Button();
 
218
            action_button.clicked.connect (emit_action);
207
219
            
208
220
            b_container.pack_start(bt, false, false, 0);
209
221
            b_container.pack_start(action_button, false, false, 0);