/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 annotate/spanselector.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-14 20:12:19 UTC
  • Revision ID: jelmer@samba.org-20110314201219-wo692nzwywu6mevh
Fix formatting, imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
class SpanSelector(gtk.HBox):
33
33
    """Encapsulates creation and functionality of widgets used for changing
34
34
    highlight spans.
35
 
    
 
35
 
36
36
    Note that calling any activate_* methods will emit "span-changed".
37
37
    """
38
 
    
 
38
 
39
39
    max_custom_spans = 4
40
40
    custom_spans = []
41
41
    last_selected = None
104
104
        self.combo.show()
105
105
 
106
106
        span = float(w.get_text())
107
 
        
 
107
 
108
108
        if span == 0:
109
109
            # FIXME this works as "cancel", returning to the previous span,
110
110
            # but it emits "span-changed", which isn't necessary.
121
121
            self.custom_iter = self.model.insert_after(self.custom_iter,
122
122
                                                       self.separator)
123
123
            self.custom_iter_top = self.custom_iter.copy()
124
 
        
 
124
 
125
125
        if len(self.custom_spans) == self.max_custom_spans:
126
126
            self.custom_spans.pop(0)
127
127
            self.model.remove(self.model.iter_next(self.custom_iter_top))
128
 
        
 
128
 
129
129
        self.custom_spans.append(span)
130
130
        self.custom_iter = self.model.insert_after(
131
131
            self.custom_iter, [span, "%.2f Days" % span, False, False])
143
143
                          gobject.TYPE_BOOLEAN)
144
144
 
145
145
        self.separator = [0., "", True, False]
146
 
        
 
146
 
147
147
        self.oldest_iter = m.append([0., "to Oldest Revision", False, False])
148
148
        self.newest_iter = m.append([0., "Newest to Oldest", False, False])
149
149
        m.append(self.separator)
170
170
 
171
171
    def _create_custom_entry(self):
172
172
        entry = gtk.HBox(False, 6)
173
 
        
 
173
 
174
174
        spin = gtk.SpinButton(digits=2)
175
175
        spin.set_numeric(True)
176
176
        spin.set_increments(1., 10.)