/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-07 16:51:21 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-20060807165121-10fe27c374bbdffd
Added new artwork.

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

    * olive.galde: added custom artwork (icons)
    * icons/*: new icons for the toolbar
    * setup.py: install the icons

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, 9):
 
46
if (bzrlib.version_info[0] == 0) and (bzrlib.version_info[1] < 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
 
54
56
class OliveDiff:
55
57
    """ Display Diff window and perform the needed actions. """
56
 
    def __init__(self, gladefile, comm, dialog):
 
58
    def __init__(self, gladefile, comm):
57
59
        """ Initialize the Diff window. """
58
60
        self.gladefile = gladefile
59
 
        self.glade = gtk.glade.XML(self.gladefile, 'window_diff', 'olive-gtk')
 
61
        self.glade = gtk.glade.XML(self.gladefile, 'window_diff')
60
62
        
61
 
        # Communication object
62
63
        self.comm = comm
63
 
        # Dialog object
64
 
        self.dialog = dialog
 
64
        
 
65
        self.dialog = OliveDialog(self.gladefile)
65
66
        
66
67
        # Get some important widgets
67
68
        self.window = self.glade.get_widget('window_diff')
103
104
    def display(self):
104
105
        """ Display the Diff window. """
105
106
        if self.notbranch:
106
 
            self.dialog.error_dialog(_('Directory is not a branch'),
107
 
                                     _('You can perform this action only in a branch.'))
 
107
            self.dialog.error_dialog('Directory is not 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, 9):
 
144
        if (bzrlib.version_info[0] == 0) and (bzrlib.version_info[1] < 9):
145
145
            delta = compare_trees(self.old_tree, self.wt)
146
146
        else:
147
147
            delta = self.wt.changes_from(self.old_tree)
148
148
 
149
 
        self.model.append(None, [ _('Complete Diff'), "" ])
 
149
        self.model.append(None, [ "Complete Diff", "" ])
150
150
 
151
151
        if len(delta.added):
152
 
            titer = self.model.append(None, [ _('Added'), None ])
 
152
            titer = self.model.append(None, [ "Added", None ])
153
153
            for path, id, kind in delta.added:
154
154
                self.model.append(titer, [ path, path ])
155
155
 
156
156
        if len(delta.removed):
157
 
            titer = self.model.append(None, [ _('Removed'), None ])
 
157
            titer = self.model.append(None, [ "Removed", None ])
158
158
            for path, id, kind in delta.removed:
159
159
                self.model.append(titer, [ path, path ])
160
160
 
161
161
        if len(delta.renamed):
162
 
            titer = self.model.append(None, [ _('Renamed'), None ])
 
162
            titer = self.model.append(None, [ "Renamed", None ])
163
163
            for oldpath, newpath, id, kind, text_modified, meta_modified \
164
164
                    in delta.renamed:
165
165
                self.model.append(titer, [ oldpath, newpath ])
166
166
 
167
167
        if len(delta.modified):
168
 
            titer = self.model.append(None, [ _('Modified'), None ])
 
168
            titer = self.model.append(None, [ "Modified", None ])
169
169
            for path, id, kind, text_modified, meta_modified in delta.modified:
170
170
                self.model.append(titer, [ path, path ])
171
171