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

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-08-13 14:08:06 UTC
  • mto: (0.14.1 main) (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060813140806-3364d3e02a086d51
Modified OliveDialog class interface; huge cleanups.

2006-08-13  Szilveszter Farkas <Szilveszter.Farkas@gmail.com>

    * olive/frontend/gtk/branch.py: display number of revisions branched
    * olive/frontend/gtk/*: use new dialog interface with detailed descriptions
    * olive/frontend/gtk/dialog.py: modified according to GNOME HIG (primary
      and secondary text)

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
import bzrlib
45
45
 
46
 
if (bzrlib.version_info[0] == 0) and (bzrlib.version_info[1] < 9):
 
46
if bzrlib.version_info < (0, 9):
47
47
    # function deprecated after 0.9
48
48
    from bzrlib.delta import compare_trees
49
49
 
51
51
import bzrlib.errors as errors
52
52
from bzrlib.workingtree import WorkingTree
53
53
 
54
 
from dialog import OliveDialog
55
 
 
56
54
class OliveDiff:
57
55
    """ Display Diff window and perform the needed actions. """
58
 
    def __init__(self, gladefile, comm):
 
56
    def __init__(self, gladefile, comm, dialog):
59
57
        """ Initialize the Diff window. """
60
58
        self.gladefile = gladefile
61
59
        self.glade = gtk.glade.XML(self.gladefile, 'window_diff')
62
60
        
 
61
        # Communication object
63
62
        self.comm = comm
64
 
        
65
 
        self.dialog = OliveDialog(self.gladefile)
 
63
        # Dialog object
 
64
        self.dialog = dialog
66
65
        
67
66
        # Get some important widgets
68
67
        self.window = self.glade.get_widget('window_diff')
104
103
    def display(self):
105
104
        """ Display the Diff window. """
106
105
        if self.notbranch:
107
 
            self.dialog.error_dialog('Directory is not a branch.')
 
106
            self.dialog.error_dialog('Directory is not a branch',
 
107
                                     'You can perform this action only in a branch.')
108
108
            self.close()
109
109
        else:
110
110
            self.window.show_all()
141
141
    def _init_diff(self):
142
142
        """ Generate initial diff. """
143
143
        self.model.clear()
144
 
        if (bzrlib.version_info[0] == 0) and (bzrlib.version_info[1] < 9):
 
144
        if bzrlib.version_info < (0, 9):
145
145
            delta = compare_trees(self.old_tree, self.wt)
146
146
        else:
147
147
            delta = self.wt.changes_from(self.old_tree)