/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/status.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:
30
30
    sys.exit(1)
31
31
 
32
32
import bzrlib
33
 
import bzrlib.errors as errors
34
33
 
35
 
if bzrlib.version_info < (0, 9):
 
34
if (bzrlib.version_info[0] == 0) and (bzrlib.version_info[1] < 9):
36
35
    # function deprecated after 0.9
37
36
    from bzrlib.delta import compare_trees
38
37
 
43
42
 
44
43
class OliveStatus:
45
44
    """ Display Status window and perform the needed actions. """
46
 
    def __init__(self, gladefile, comm, dialog):
47
 
        """ Initialize the Status window. """
 
45
    def __init__(self, gladefile, comm):
 
46
        """ Initialize the Diff window. """
48
47
        self.gladefile = gladefile
49
48
        self.glade = gtk.glade.XML(self.gladefile, 'window_status')
50
49
        
51
 
        # Communication object
52
50
        self.comm = comm
53
 
        # Dialog object
54
 
        self.dialog = dialog
55
51
        
56
 
        # Get the Status window widget
57
 
        self.window = self.glade.get_widget('window_status')
 
52
        self.dialog = OliveDialog(self.gladefile)
58
53
        
59
54
        # Check if current location is a branch
60
55
        try:
76
71
        # Set the old working tree
77
72
        self.old_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
78
73
        
 
74
        # Get the Diff window widget
 
75
        self.window = self.glade.get_widget('window_status')
 
76
        
79
77
        # Dictionary for signal_autoconnect
80
78
        dic = { "on_button_status_close_clicked": self.close }
81
79
        
98
96
        column.add_attribute(cell, "text", 0)
99
97
        self.treeview.append_column(column)
100
98
        
101
 
        if bzrlib.version_info < (0, 9):
 
99
        if (bzrlib.version_info[0] == 0) and (bzrlib.version_info[1] < 9):
102
100
            delta = compare_trees(self.old_tree, self.wt)
103
101
        else:
104
102
            delta = self.wt.changes_from(self.old_tree)
105
103
 
106
104
        if len(delta.added):
107
 
            titer = self.model.append(None, [ _('Added'), None ])
 
105
            titer = self.model.append(None, [ "Added", None ])
108
106
            for path, id, kind in delta.added:
109
107
                self.model.append(titer, [ path, path ])
110
108
 
111
109
        if len(delta.removed):
112
 
            titer = self.model.append(None, [ _('Removed'), None ])
 
110
            titer = self.model.append(None, [ "Removed", None ])
113
111
            for path, id, kind in delta.removed:
114
112
                self.model.append(titer, [ path, path ])
115
113
 
116
114
        if len(delta.renamed):
117
 
            titer = self.model.append(None, [ _('Renamed'), None ])
 
115
            titer = self.model.append(None, [ "Renamed", None ])
118
116
            for oldpath, newpath, id, kind, text_modified, meta_modified \
119
117
                    in delta.renamed:
120
118
                self.model.append(titer, [ oldpath, newpath ])
121
119
 
122
120
        if len(delta.modified):
123
 
            titer = self.model.append(None, [ _('Modified'), None ])
 
121
            titer = self.model.append(None, [ "Modified", None ])
124
122
            for path, id, kind, text_modified, meta_modified in delta.modified:
125
123
                self.model.append(titer, [ path, path ])
126
124
        
127
125
        done_unknown = False
128
126
        for path in self.wt.unknowns():
129
127
            if not done_unknown:
130
 
                titer = self.model.append(None, [ _('Unknown'), None ])
 
128
                titer = self.model.append(None, [ "Unknown", None ])
131
129
                done_unknown = True
132
130
            self.model.append(titer, [ path, path ])
133
131
 
136
134
    def display(self):
137
135
        """ Display the Diff window. """
138
136
        if self.notbranch:
139
 
            self.dialog.error_dialog(_('Directory is not a branch'),
140
 
                                     _('You can perform this action only in a branch.'))
141
 
            self.close()
 
137
            self.dialog.error_dialog('Directory is not a branch.')
142
138
        else:
143
139
            self.window.show_all()
144
140