/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 nautilus-bzr.py

  • Committer: Jelmer Vernooij
  • Date: 2006-05-20 16:05:21 UTC
  • mto: This revision was merged to the branch mainline in revision 80.
  • Revision ID: jelmer@samba.org-20060520160521-f0d266f204d4bfc1
Add 'Commit' entries

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
 
73
73
        from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
74
74
        window = DiffWindow()
75
 
        window.set_diff("Working Tree", tree, tree.branch.repository.revision_tree(tree.branch.last_revision()))
 
75
        window.set_diff(tree.branch, tree, tree.branch.revision_tree())
76
76
        window.show()
77
77
 
78
78
        return
117
117
 
118
118
        vis = cmd_gannotate()
119
119
        vis.run(file)
120
 
 
121
 
        return
122
120
 
 
121
    def commit_cb(self, menu, vfs_file=None):
 
122
        # We can only cope with local files
 
123
        if vfs_file.get_uri_scheme() != 'file':
 
124
            return
 
125
 
 
126
        file = vfs_file.get_uri()
 
127
        try:
 
128
            tree, path = WorkingTree.open_containing(file)
 
129
        except NotBranchError:
 
130
            return
 
131
 
 
132
        from bzrlib.plugins.gtk.commit.gcommit import GCommitDialog
 
133
        dialog = GCommitDialog(tree)
 
134
        dialog.set_title(path + " - Commit")
 
135
        if dialog.run() != gtk.RESPONSE_CANCEL:
 
136
            Commit().commit(working_tree=wt,message=dialog.message,
 
137
                            specific_files=dialog.specific_files)
123
138
 
124
139
    def log_cb(self, menu, vfs_file):
125
140
        # We can only cope with local files
148
163
                                 'Create new Bazaar tree',
149
164
                                 'Create new Bazaar tree in this folder')
150
165
            item.connect('activate', self.newtree_cb, vfs_file)
151
 
            return item,
 
166
            return item
152
167
 
 
168
        items = []
153
169
        if have_gtkplugin:
154
170
            item = nautilus.MenuItem('BzrNautilus::log',
155
171
                                 'Log',
156
172
                                 'Show Bazaar history')
157
173
            item.connect('activate', self.log_cb, vfs_file)
158
 
            return item,
159
 
 
160
 
        return
 
174
            items.append(item)
 
175
 
 
176
            item = nautilus.MenuItem('BzrNautilus::commit',
 
177
                                 'Commit',
 
178
                                 'Commit Changes')
 
179
            item.connect('activate', self.commit_cb, vfs_file)
 
180
            items.append(item)
 
181
 
 
182
        return items
161
183
 
162
184
 
163
185
    def get_file_items(self, window, files):
208
230
                    item.connect('activate', self.log_cb, vfs_file)
209
231
                    items.append(item)
210
232
 
211
 
                    # FIXME: Don't show if there are no changes
212
 
                    # to the current file...
213
233
                    item = nautilus.MenuItem('BzrNautilus::diff',
214
234
                                     'Diff',
215
235
                                     'Show differences')
228
248
                                 'Annotate File Data')
229
249
                    item.connect('activate', self.annotate_cb, vfs_file)
230
250
                    items.append(item)
 
251
 
 
252
                    item = nautilus.MenuItem('BzrNautilus::commit',
 
253
                                 'Commit',
 
254
                                 'Commit Changes')
 
255
                    item.connect('activate', self.commit_cb, vfs_file)
 
256
                    items.append(item)
231
257
    
232
258
        return items