/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to revisionview.py

  • Committer: Daniel Schierbeck
  • Date: 2008-04-02 12:51:58 UTC
  • mto: (461.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 462.
  • Revision ID: daniel.schierbeck@gmail.com-20080402125158-tf6xys6ws1d43thq
Changed Bugs page labels.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    def __init__(self):
37
37
        super(BugsTab, self).__init__(False, 6)
38
38
    
39
 
        self.num_bugs = 0
40
 
 
41
39
        table = gtk.Table(rows=2, columns=2)
42
40
 
43
41
        table.set_row_spacings(6)
48
46
        table.attach(image, 0, 1, 0, 1, gtk.FILL)
49
47
 
50
48
        align = gtk.Alignment(0.0, 0.1)
51
 
        label = gtk.Label()
52
 
        label.set_markup("<b>Bug associations</b>\n" +
53
 
                         "This revision has one or more bug associations.")
54
 
        align.add(label)
 
49
        self.label = gtk.Label()
 
50
        align.add(self.label)
55
51
        table.attach(align, 1, 2, 0, 1, gtk.FILL)
56
52
 
57
53
        treeview = self.construct_treeview()
60
56
        self.set_border_width(6)
61
57
        self.pack_start(table, expand=False)
62
58
 
63
 
        self.set_sensitive(False)
 
59
        self.clear()
64
60
        self.show_all()
65
61
 
66
62
    def set_revision(self, revision):
73
69
                (url, status) = bugline.split(" ")
74
70
                if status == "fixed":
75
71
                    self.add_bug(url, status)
 
72
        
 
73
        if self.num_bugs == 0:
 
74
            return
 
75
        elif self.num_bugs == 1:
 
76
            label = "bug"
 
77
        else:
 
78
            label = "bugs"
 
79
 
 
80
        self.label.set_markup("<b>Bugs fixed</b>\n" +
 
81
                              "This revision claims to fix " +
 
82
                              "%d %s." % (self.num_bugs, label))
76
83
 
77
84
    def construct_treeview(self):
78
85
        self.bugs = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
95
102
        self.num_bugs = 0
96
103
        self.bugs.clear()
97
104
        self.set_sensitive(False)
 
105
        self.label.set_markup("<b>No bugs fixed</b>\n" +
 
106
                              "This revision does not claim to fix any bugs.")
98
107
 
99
108
    def add_bug(self, url, status):
100
109
        self.num_bugs += 1