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

« back to all changes in this revision

Viewing changes to src/Widgets/ProgressInfo.vala

  • Committer: Stephen Smally
  • Date: 2012-03-04 12:59:13 UTC
  • Revision ID: eco.stefi@fastwebnet.it-20120304125913-bk1iutifwoeoyo0i
Worked a lot!

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  Stephen Smally © 2012
 
2
//      This program is free software; you can redistribute it and/or modify
 
3
//      it under the terms of the GNU General Public License as published by
 
4
//      the Free Software Foundation; either version 2 of the License, or
 
5
//      (at your option) any later version.
 
6
//      
 
7
//      This program is distributed in the hope that it will be useful,
 
8
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
//      GNU General Public License for more details.
 
11
//      
 
12
//      You should have received a copy of the GNU General Public License
 
13
//      along with this program; if not, write to the Free Software
 
14
//      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
15
//      MA 02110-1301, USA.
 
16
//     
 
17
 
 
18
using Gtk;
 
19
 
 
20
namespace Lsc.Widgets {
 
21
    public class ProgressInfo : InfoBar {
 
22
        // Widgets
 
23
        public Label text;
 
24
        public ProgressBar progress_bar;
 
25
        public Spinner spin;
 
26
        
 
27
        public void load_undefined (string label_text) {
 
28
            show_all();
 
29
            text.set_label(label_text);
 
30
            progress_bar.set_visible(false);
 
31
            spin.set_visible(true);
 
32
            spin.start();
 
33
        }
 
34
        
 
35
        public void clear () {
 
36
            spin.stop();
 
37
            progress_bar.set_fraction(0.0);
 
38
            set_visible(false);
 
39
        }
 
40
        
 
41
        public ProgressInfo () {
 
42
            message_type = MessageType.INFO;
 
43
            Box main = get_content_area() as Box;
 
44
            main.orientation = Orientation.HORIZONTAL;
 
45
            main.spacing = 2;
 
46
            orientation = Orientation.HORIZONTAL;
 
47
            
 
48
            text = new Label("");
 
49
            text.ellipsize = Pango.EllipsizeMode.END;
 
50
            
 
51
            progress_bar = new ProgressBar();
 
52
            progress_bar.pulse_step = 0.1;
 
53
            
 
54
            spin = new Spinner();
 
55
            
 
56
            main.pack_start(text, false, false, 0);
 
57
            main.pack_end(progress_bar, false, false, 0);
 
58
            main.pack_end(spin, false, false, 0);
 
59
        }
 
60
    }
 
61
}
 
 
b'\\ No newline at end of file'