/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 logview.py

  • Committer: Mateusz Korniak
  • Date: 2007-07-21 13:16:33 UTC
  • mto: This revision was merged to the branch mainline in revision 248.
  • Revision ID: matkor@laptop-hp-20070721131633-t40kxs20j1q2fvvc
Context menu "Remove and delete added"
Acts like "Remove" but also deletes file locally.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    start.
31
31
    """
32
32
 
33
 
    def __init__(self, revision=None, scroll=True, tags=[]):
 
33
    def __init__(self, revision=None, scroll=True, tags=None):
34
34
        super(LogView, self).__init__()
35
35
        if scroll:
36
36
            self.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
51
51
    def set_go_callback(self, callback):
52
52
        self._go_callback = callback
53
53
 
54
 
    def set_revision(self, revision, tags=[]):
 
54
    def set_revision(self, revision, tags=None):
55
55
        self._revision = revision
56
56
        self.revision_id.set_text(revision.revision_id)
57
57
        if revision.committer is not None:
58
58
            self.committer.set_text(revision.committer)
59
59
        else:
60
60
            self.committer.set_text("")
61
 
        author = revision.properties.get('author', '')
62
 
        if author != '':
63
 
            self.author.set_text(author)
64
 
            self.author.show()
65
 
            self.author_label.show()
66
 
        else:
67
 
            self.author.hide()
68
 
            self.author_label.hide()
69
 
 
70
61
        if revision.timestamp is not None:
71
62
            self.timestamp.set_text(format_date(revision.timestamp,
72
63
                                                revision.timezone))
179
170
        self.revision_id.show()
180
171
 
181
172
        align = gtk.Alignment(1.0, 0.5)
182
 
        self.author_label = gtk.Label()
183
 
        self.author_label.set_markup("<b>Author:</b>")
184
 
        align.add(self.author_label)
 
173
        label = gtk.Label()
 
174
        label.set_markup("<b>Committer:</b>")
 
175
        align.add(label)
185
176
        self.table.attach(align, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
186
177
        align.show()
187
 
        self.author_label.show()
188
 
 
189
 
        align = gtk.Alignment(0.0, 0.5)
190
 
        self.author = gtk.Label()
191
 
        self.author.set_selectable(True)
192
 
        align.add(self.author)
193
 
        self.table.attach(align, 1, 2, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
194
 
        align.show()
195
 
        self.author.show()
196
 
        self.author.hide()
197
 
 
198
 
        align = gtk.Alignment(1.0, 0.5)
199
 
        label = gtk.Label()
200
 
        label.set_markup("<b>Committer:</b>")
201
 
        align.add(label)
202
 
        self.table.attach(align, 0, 1, 2, 3, gtk.FILL, gtk.FILL)
203
 
        align.show()
204
178
        label.show()
205
179
 
206
180
        align = gtk.Alignment(0.0, 0.5)
207
181
        self.committer = gtk.Label()
208
182
        self.committer.set_selectable(True)
209
183
        align.add(self.committer)
210
 
        self.table.attach(align, 1, 2, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
184
        self.table.attach(align, 1, 2, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
211
185
        align.show()
212
186
        self.committer.show()
213
187
 
215
189
        label = gtk.Label()
216
190
        label.set_markup("<b>Branch nick:</b>")
217
191
        align.add(label)
218
 
        self.table.attach(align, 0, 1, 3, 4, gtk.FILL, gtk.FILL)
 
192
        self.table.attach(align, 0, 1, 2, 3, gtk.FILL, gtk.FILL)
219
193
        label.show()
220
194
        align.show()
221
195
 
223
197
        self.branchnick_label = gtk.Label()
224
198
        self.branchnick_label.set_selectable(True)
225
199
        align.add(self.branchnick_label)
226
 
        self.table.attach(align, 1, 2, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
200
        self.table.attach(align, 1, 2, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
227
201
        self.branchnick_label.show()
228
202
        align.show()
229
203
 
231
205
        label = gtk.Label()
232
206
        label.set_markup("<b>Timestamp:</b>")
233
207
        align.add(label)
234
 
        self.table.attach(align, 0, 1, 4, 5, gtk.FILL, gtk.FILL)
 
208
        self.table.attach(align, 0, 1, 3, 4, gtk.FILL, gtk.FILL)
235
209
        align.show()
236
210
        label.show()
237
211
 
239
213
        self.timestamp = gtk.Label()
240
214
        self.timestamp.set_selectable(True)
241
215
        align.add(self.timestamp)
242
 
        self.table.attach(align, 1, 2, 4, 5, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
216
        self.table.attach(align, 1, 2, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
243
217
        align.show()
244
218
        self.timestamp.show()
245
219
 
248
222
        self.tags_label.set_markup("<b>Tags:</b>")
249
223
        align.add(self.tags_label)
250
224
        align.show()
251
 
        self.table.attach(align, 0, 1, 5, 6, gtk.FILL, gtk.FILL)
 
225
        self.table.attach(align, 0, 1, 4, 5, gtk.FILL, gtk.FILL)
252
226
        self.tags_label.show()
253
227
 
254
228
        align = gtk.Alignment(0.0, 0.5)
255
229
        self.tags_list = gtk.VBox()
256
230
        align.add(self.tags_list)
257
 
        self.table.attach(align, 1, 2, 5, 6, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
231
        self.table.attach(align, 1, 2, 4, 5, gtk.EXPAND | gtk.FILL, gtk.FILL)
258
232
        align.show()
259
233
        self.tags_list.show()
260
234
        self.tags_widgets = []