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

  • Committer: Aaron Bentley
  • Date: 2008-01-15 05:34:43 UTC
  • Revision ID: aaron@aaronbentley.com-20080115053443-6iq8bgfwktkdzy2x
Add merge button when displaying merge directives

Show diffs side-by-side

added added

removed removed

Lines of Context:
298
298
 
299
299
        self.construct()
300
300
 
 
301
    def _get_button_bar(self):
 
302
        return None
 
303
 
301
304
    def construct(self):
302
305
        """Construct the window contents."""
303
306
        # The   window  consists  of   a  pane   containing:  the
304
307
        # hierarchical list  of files on  the left, and  the diff
305
308
        # for the currently selected file on the right.
 
309
        self.vbox = gtk.VBox()
 
310
        self.add(self.vbox)
 
311
        self.vbox.show()
306
312
        self.pane = gtk.HPaned()
307
 
        self.add(self.pane)
 
313
        self.vbox.pack_end(self.pane, expand=True, fill=True)
 
314
        hbox = self._get_button_bar()
 
315
        if hbox is not None:
 
316
            self.vbox.pack_start(hbox, expand=False, fill=True)
308
317
        self.pane.show()
309
318
 
310
319
        # The file hierarchy: a scrollable treeview
342
351
            newname = patch.newname.split('\t')[0]
343
352
            self.model.append(None, [oldname, newname])
344
353
            self.diff_view._diffs[newname] = str(patch)
345
 
        
 
354
        self.diff_view.show_diff(None)
346
355
 
347
356
    def set_diff(self, description, rev_tree, parent_tree):
348
357
        """Set the differences showed by this window.
387
396
 
388
397
        self.treeview.expand_all()
389
398
        self.set_title(description + " - bzrk diff")
 
399
        self.diff_view.show_diff(None)
390
400
 
391
401
    def set_file(self, file_path):
392
402
        tv_path = None
412
422
        self.diff_view.show_diff(specific_files)
413
423
 
414
424
 
 
425
class MergeDirectiveWindow(DiffWindow):
 
426
 
 
427
    def _get_button_bar(self):
 
428
        merge_button = gtk.Button('Merge')
 
429
        merge_button.show()
 
430
        merge_button.set_relief(gtk.RELIEF_NONE)
 
431
        hbox = gtk.HButtonBox()
 
432
        hbox.set_layout(gtk.BUTTONBOX_START)
 
433
        hbox.pack_start(merge_button, expand=False, fill=True)
 
434
        hbox.show()
 
435
        return hbox
 
436
 
 
437
 
415
438
def _iter_changes_to_status(source, target):
416
439
    """Determine the differences between trees.
417
440