/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz
0.8.19 by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com>
1
# Copyright (C) 2006 by Szilveszter Farkas (Phanatic) <szilveszter.farkas@gmail.com>
0.8.46 by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups.
2
#
0.8.19 by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com>
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
0.8.46 by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups.
7
#
0.8.19 by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com>
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
0.8.46 by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups.
12
#
0.8.19 by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com>
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
17
try:
18
    import pygtk
19
    pygtk.require("2.0")
20
except:
21
    pass
0.8.98 by Szilveszter Farkas (Phanatic)
Loads of fixes. Pyflakes cleanup.
22
0.13.11 by Jelmer Vernooij
Bunch of small fixes, cleanups and simplifications.
23
import gtk
24
import gobject
25
import pango
0.8.19 by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com>
26
126.1.10 by Szilveszter Farkas (Phanatic)
Allow to commit single files from the context menu (Fixed: #54983)
27
import os.path
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
28
import re
126.1.10 by Szilveszter Farkas (Phanatic)
Allow to commit single files from the context menu (Fixed: #54983)
29
248 by Jelmer Vernooij
Merge fixes for #127392 and #127381)
30
from bzrlib import errors, osutils
235.1.5 by Mateusz Korniak
Missing mutter import added.
31
from bzrlib.trace import mutter
0.8.20 by Szilveszter Farkas (Phanatic)
2006-07-24 Szilveszter Farkas <Szilveszter.Farkas@gmail.com>
32
153 by Jelmer Vernooij
Fix references to dialog.
33
from dialog import error_dialog, question_dialog
132 by Jelmer Vernooij
Use decorator for catching and showing bzr-gtk errors graphically. Eventually, this should go away and should be handled by the ui factory.
34
from errors import show_bzr_error
93.1.6 by Alexander Belchenko
detecting name of glade file doing in separate module (olive.gladefile)
35
158 by Jelmer Vernooij
If available, use NetworkManager to find out whether a commit should be local or not.
36
try:
37
    import dbus
38
    import dbus.glib
180 by Jelmer Vernooij
Don't obtain handle to network manager until it's actually needed.
39
    have_dbus = True
158 by Jelmer Vernooij
If available, use NetworkManager to find out whether a commit should be local or not.
40
except ImportError:
180 by Jelmer Vernooij
Don't obtain handle to network manager until it's actually needed.
41
    have_dbus = False
158 by Jelmer Vernooij
If available, use NetworkManager to find out whether a commit should be local or not.
42
278.1.4 by John Arbash Meinel
Just playing around.
43
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
44
def pending_revisions(wt):
45
    """Return a list of pending merges or None if there are none of them.
46
47
    Arguably this should be a core function, and
48
    ``bzrlib.status.show_pending_merges`` should be built on top of it.
49
50
    :return: [(rev, [children])]
51
    """
52
    parents = wt.get_parent_ids()
53
    if len(parents) < 2:
54
        return None
55
56
    # The basic pending merge algorithm uses the same algorithm as
57
    # bzrlib.status.show_pending_merges
58
    pending = parents[1:]
59
    branch = wt.branch
60
    last_revision = parents[0]
61
62
    if last_revision is not None:
63
        try:
64
            ignore = set(branch.repository.get_ancestry(last_revision,
65
                                                        topo_sorted=False))
66
        except errors.NoSuchRevision:
67
            # the last revision is a ghost : assume everything is new
68
            # except for it
69
            ignore = set([None, last_revision])
70
    else:
71
        ignore = set([None])
72
73
    pm = []
74
    for merge in pending:
75
        ignore.add(merge)
76
        try:
77
            rev = branch.repository.get_revision(merge)
78
            children = []
79
            pm.append((rev, children))
80
81
            # This does need to be topo sorted, so we search backwards
82
            inner_merges = branch.repository.get_ancestry(merge)
83
            assert inner_merges[0] is None
84
            inner_merges.pop(0)
85
            for mmerge in reversed(inner_merges):
86
                if mmerge in ignore:
87
                    continue
88
                rev = branch.repository.get_revision(mmerge)
89
                children.append(rev)
90
91
                ignore.add(mmerge)
92
        except errors.NoSuchRevision:
93
            print "DEBUG: NoSuchRevision:", merge
94
95
    return pm
96
97
135 by Jelmer Vernooij
Throw out the old CommitDialog code and use the new code instead, also for 'gcommit'.
98
class CommitDialog(gtk.Dialog):
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
99
    """Implementation of Commit."""
100
101
    def __init__(self, wt, selected=None, parent=None):
278.1.16 by John Arbash Meinel
Implement the file changes list on top of _iter_changes rather than
102
        gtk.Dialog.__init__(self, title="Commit - Olive",
103
                                  parent=parent,
104
                                  flags=0,
105
                                  buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
106
        self._wt = wt
107
        self._selected = selected
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
108
278.1.16 by John Arbash Meinel
Implement the file changes list on top of _iter_changes rather than
109
        self.setup_params()
110
        self.construct()
111
        self.fill_in_data()
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
112
113
    def setup_params(self):
114
        """Setup the member variables for state."""
115
        self._basis_tree = self._wt.basis_tree()
278.1.12 by John Arbash Meinel
Delay computing the delta, and clean up some of the diff view names.
116
        self._delta = None
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
117
        self._pending = pending_revisions(self._wt)
118
119
        self._is_checkout = (self._wt.branch.get_bound_location() is not None)
120
278.1.14 by John Arbash Meinel
Tests that we fill out the pending list correctly.
121
    def fill_in_data(self):
122
        # Now that we are built, handle changes to the view based on the state
123
        self._fill_in_pending()
278.1.20 by John Arbash Meinel
We always select the All Files record in the files view,
124
        self._fill_in_diff()
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
125
        self._fill_in_files()
278.1.14 by John Arbash Meinel
Tests that we fill out the pending list correctly.
126
127
    def _fill_in_pending(self):
128
        if not self._pending:
129
            self._pending_box.hide()
130
            return
131
132
        # TODO: We'd really prefer this to be a nested list
133
        for rev, children in self._pending:
134
            rev_info = self._rev_to_pending_info(rev)
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
135
            self._pending_store.append([
278.1.14 by John Arbash Meinel
Tests that we fill out the pending list correctly.
136
                rev_info['revision_id'],
137
                rev_info['date'],
138
                rev_info['committer'],
139
                rev_info['summary'],
140
                ])
141
            for child in children:
142
                rev_info = self._rev_to_pending_info(child)
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
143
                self._pending_store.append([
278.1.14 by John Arbash Meinel
Tests that we fill out the pending list correctly.
144
                    rev_info['revision_id'],
145
                    rev_info['date'],
146
                    rev_info['committer'],
147
                    rev_info['summary'],
148
                    ])
149
        self._pending_box.show()
150
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
151
    def _fill_in_files(self):
152
        # We should really use _iter_changes, and then add a progress bar of
153
        # some kind.
154
        # While we fill in the view, hide the store
155
        store = self._files_store
156
        self._treeview_files.set_model(None)
157
158
        added = _('added')
159
        removed = _('removed')
160
        renamed = _('renamed')
161
        renamed_and_modified = _('renamed and modified')
162
        modified = _('modified')
278.1.16 by John Arbash Meinel
Implement the file changes list on top of _iter_changes rather than
163
        kind_changed = _('kind changed')
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
164
278.1.16 by John Arbash Meinel
Implement the file changes list on top of _iter_changes rather than
165
        # The store holds:
278.1.21 by John Arbash Meinel
Start tracking the per-file commit messages.
166
        # [file_id, real path, checkbox, display path, changes type, message]
278.1.16 by John Arbash Meinel
Implement the file changes list on top of _iter_changes rather than
167
        # _iter_changes returns:
168
        # (file_id, (path_in_source, path_in_target),
169
        #  changed_content, versioned, parent, name, kind,
170
        #  executable)
171
278.1.20 by John Arbash Meinel
We always select the All Files record in the files view,
172
        # The first entry is always the 'whole tree'
278.1.21 by John Arbash Meinel
Start tracking the per-file commit messages.
173
        store.append([None, None, True, 'All Files', '', ''])
278.1.16 by John Arbash Meinel
Implement the file changes list on top of _iter_changes rather than
174
        # should we pass specific_files?
175
        self._wt.lock_read()
176
        self._basis_tree.lock_read()
177
        try:
178
            for (file_id, paths, changed_content, versioned, parent_ids, names,
179
                 kinds, executables) in self._wt._iter_changes(self._basis_tree):
180
181
                # Skip the root entry.
182
                if parent_ids == (None, None):
183
                    continue
184
185
                change_type = None
186
                if kinds[0] is None:
187
                    source_marker = ''
188
                else:
189
                    source_marker = osutils.kind_marker(kinds[0])
190
                if kinds[1] is None:
191
                    assert kinds[0] is not None
192
                    marker = osutils.kind_marker(kinds[0])
193
                else:
194
                    marker = osutils.kind_marker(kinds[1])
195
196
                real_path = paths[1]
197
                if real_path is None:
198
                    real_path = paths[0]
199
                assert real_path is not None
200
                display_path = real_path + marker
201
202
                present_source = versioned[0] and kinds[0] is not None
203
                present_target = versioned[1] and kinds[1] is not None
204
205
                if present_source != present_target:
206
                    if present_target:
207
                        change_type = added
208
                    else:
209
                        change_type = removed
210
                elif names[0] != names[1] or parent_ids[0] != parent_ids[1]:
211
                    # Renamed
212
                    if changed_content or executables[0] != executables[1]:
213
                        # and modified
214
                        change_type = renamed_and_modified
215
                    else:
216
                        change_type = renamed
217
                    display_path = (paths[0] + source_marker
218
                                    + ' => ' + paths[1] + marker)
219
                elif kinds[0] != kinds[1]:
220
                    change_type = kind_changed
221
                    display_path = (paths[0] + source_marker
222
                                    + ' => ' + paths[1] + marker)
223
                elif changed_content is True or executables[0] != executables[1]:
224
                    change_type = modified
225
                else:
226
                    assert False, "How did we get here?"
227
278.1.21 by John Arbash Meinel
Start tracking the per-file commit messages.
228
                store.append([file_id, real_path, True, display_path,
229
                              change_type, ''])
278.1.16 by John Arbash Meinel
Implement the file changes list on top of _iter_changes rather than
230
        finally:
231
            self._basis_tree.unlock()
232
            self._wt.unlock()
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
233
234
        self._treeview_files.set_model(store)
278.1.21 by John Arbash Meinel
Start tracking the per-file commit messages.
235
        self._last_selected_file = None
278.1.20 by John Arbash Meinel
We always select the All Files record in the files view,
236
        self._treeview_files.set_cursor(0)
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
237
278.1.17 by John Arbash Meinel
Add a * reference for why you can't change the commit selection.
238
    def _fill_in_diff(self):
239
        self._diff_view.set_trees(self._wt, self._basis_tree)
240
278.1.12 by John Arbash Meinel
Delay computing the delta, and clean up some of the diff view names.
241
    def _compute_delta(self):
242
        self._delta = self._wt.changes_from(self._basis_tree)
243
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
244
    def construct(self):
245
        """Build up the dialog widgets."""
246
        # The primary pane which splits it into left and right (adjustable)
247
        # sections.
278.1.4 by John Arbash Meinel
Just playing around.
248
        self._hpane = gtk.HPaned()
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
249
250
        self._construct_left_pane()
251
        self._construct_right_pane()
252
253
        self.vbox.pack_start(self._hpane)
254
        self._hpane.show()
255
        self.set_focus(self._global_message_text_view)
256
278.1.17 by John Arbash Meinel
Add a * reference for why you can't change the commit selection.
257
        # This seems like a reasonable default, we might like it to
258
        # be a bit wider, so that by default we can fit an 80-line diff in the
259
        # diff window.
260
        # Alternatively, we should be saving the last position/size rather than
261
        # setting it to a fixed value every time we start up.
262
        screen = self.get_screen()
263
        monitor = 0 # We would like it to be the monitor we are going to
264
                    # display on, but I don't know how to figure that out
265
                    # Only really useful for freaks like me that run dual
266
                    # monitor, with different sizes on the monitors
267
        monitor_rect = screen.get_monitor_geometry(monitor)
268
        width = int(monitor_rect.width * 0.66)
269
        height = int(monitor_rect.height * 0.66)
270
        self.set_default_size(width, height)
278.1.16 by John Arbash Meinel
Implement the file changes list on top of _iter_changes rather than
271
        self._hpane.set_position(300)
272
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
273
    def _construct_left_pane(self):
278.1.11 by John Arbash Meinel
Worked out the rest of the spacing.
274
        self._left_pane_box = gtk.VBox(homogeneous=False, spacing=5)
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
275
        self._construct_file_list()
276
        self._construct_pending_list()
277
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
278
        self._hpane.pack1(self._left_pane_box, resize=False, shrink=False)
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
279
        self._left_pane_box.show()
280
281
    def _construct_right_pane(self):
282
        # TODO: I really want to make it so the diff view gets more space than
283
        # the global commit message, and the per-file commit message gets even
284
        # less. When I did it with wxGlade, I set it to 4 for diff, 2 for
285
        # commit, and 1 for file commit, and it looked good. But I don't seem
286
        # to have a way to do that with the gtk boxes... :( (Which is extra
287
        # weird since wx uses gtk on Linux...)
278.1.10 by John Arbash Meinel
To get the space weighting I wanted, I turned to a Table.
288
        self._right_pane_table = gtk.Table(rows=10, columns=1, homogeneous=False)
278.1.11 by John Arbash Meinel
Worked out the rest of the spacing.
289
        self._right_pane_table.set_row_spacings(5)
290
        self._right_pane_table.set_col_spacings(5)
278.1.10 by John Arbash Meinel
To get the space weighting I wanted, I turned to a Table.
291
        self._right_pane_table_row = 0
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
292
        self._construct_diff_view()
293
        self._construct_file_message()
294
        self._construct_global_message()
295
278.1.10 by John Arbash Meinel
To get the space weighting I wanted, I turned to a Table.
296
        self._right_pane_table.show()
297
        self._hpane.pack2(self._right_pane_table, resize=True, shrink=True)
298
299
    def _add_to_right_table(self, widget, weight, expanding=False):
300
        """Add another widget to the table
301
302
        :param widget: The object to add
303
        :param weight: How many rows does this widget get to request
304
        :param expanding: Should expand|fill|shrink be set?
305
        """
306
        end_row = self._right_pane_table_row + weight
307
        options = 0
308
        expand_opts = gtk.EXPAND | gtk.FILL | gtk.SHRINK
309
        if expanding:
310
            options = expand_opts
311
        self._right_pane_table.attach(widget, 0, 1,
312
                                      self._right_pane_table_row, end_row,
313
                                      xoptions=expand_opts, yoptions=options)
314
        self._right_pane_table_row = end_row
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
315
316
    def _construct_file_list(self):
278.1.11 by John Arbash Meinel
Worked out the rest of the spacing.
317
        self._files_box = gtk.VBox(homogeneous=False, spacing=0)
278.1.17 by John Arbash Meinel
Add a * reference for why you can't change the commit selection.
318
        file_label = gtk.Label(_('Files'))
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
319
        file_label.show()
320
        self._files_box.pack_start(file_label, expand=False)
321
322
        scroller = gtk.ScrolledWindow()
323
        scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
126.1.1 by Szilveszter Farkas (Phanatic)
New Commit dialog implementation (no more Glade).
324
        self._treeview_files = gtk.TreeView()
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
325
        self._treeview_files.show()
326
        scroller.add(self._treeview_files)
327
        scroller.show()
328
        scroller.set_shadow_type(gtk.SHADOW_IN)
329
        self._files_box.pack_start(scroller,
330
                                   expand=True, fill=True)
331
        self._files_box.show()
332
        self._left_pane_box.pack_start(self._files_box)
333
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
334
        liststore = gtk.ListStore(
335
            gobject.TYPE_STRING,  # [0] file_id
336
            gobject.TYPE_STRING,  # [1] real path
337
            gobject.TYPE_BOOLEAN, # [2] checkbox
338
            gobject.TYPE_STRING,  # [3] display path
339
            gobject.TYPE_STRING,  # [4] changes type
278.1.21 by John Arbash Meinel
Start tracking the per-file commit messages.
340
            gobject.TYPE_STRING,  # [5] commit message
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
341
            )
342
        self._files_store = liststore
343
        self._treeview_files.set_model(liststore)
344
        crt = gtk.CellRendererToggle()
278.1.20 by John Arbash Meinel
We always select the All Files record in the files view,
345
        crt.set_active(not bool(self._pending))
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
346
        crt.connect("toggled", self._toggle_commit, self._files_store)
278.1.17 by John Arbash Meinel
Add a * reference for why you can't change the commit selection.
347
        if self._pending:
348
            name = _('Commit*')
349
        else:
350
            name = _('Commit')
351
        self._treeview_files.append_column(gtk.TreeViewColumn(name,
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
352
                                           crt, active=2))
353
        self._treeview_files.append_column(gtk.TreeViewColumn(_('Path'),
354
                                           gtk.CellRendererText(), text=3))
355
        self._treeview_files.append_column(gtk.TreeViewColumn(_('Type'),
356
                                           gtk.CellRendererText(), text=4))
278.1.17 by John Arbash Meinel
Add a * reference for why you can't change the commit selection.
357
        self._treeview_files.connect('cursor-changed',
358
                                     self._on_treeview_files_cursor_changed)
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
359
360
    def _toggle_commit(self, cell, path, model):
278.1.20 by John Arbash Meinel
We always select the All Files record in the files view,
361
        if model[path][0] is None: # No file_id means 'All Files'
362
            new_val = not model[path][2]
363
            for node in model:
364
                node[2] = new_val
365
        else:
366
            model[path][2] = not model[path][2]
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
367
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
368
    def _construct_pending_list(self):
369
        # Pending information defaults to hidden, we put it all in 1 box, so
370
        # that we can show/hide all of them at once
371
        self._pending_box = gtk.VBox()
372
        self._pending_box.hide()
373
374
        pending_message = gtk.Label()
375
        pending_message.set_markup(
278.1.17 by John Arbash Meinel
Add a * reference for why you can't change the commit selection.
376
            _('<i>* Cannot select specific files when merging</i>'))
278.1.11 by John Arbash Meinel
Worked out the rest of the spacing.
377
        self._pending_box.pack_start(pending_message, expand=False, padding=5)
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
378
        pending_message.show()
379
278.1.17 by John Arbash Meinel
Add a * reference for why you can't change the commit selection.
380
        pending_label = gtk.Label(_('Pending Revisions'))
278.1.11 by John Arbash Meinel
Worked out the rest of the spacing.
381
        self._pending_box.pack_start(pending_label, expand=False, padding=0)
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
382
        pending_label.show()
383
384
        scroller = gtk.ScrolledWindow()
385
        scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
386
        self._treeview_pending = gtk.TreeView()
387
        scroller.add(self._treeview_pending)
388
        scroller.show()
389
        scroller.set_shadow_type(gtk.SHADOW_IN)
390
        self._pending_box.pack_start(scroller,
278.1.11 by John Arbash Meinel
Worked out the rest of the spacing.
391
                                     expand=True, fill=True, padding=5)
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
392
        self._treeview_pending.show()
393
        self._left_pane_box.pack_start(self._pending_box)
394
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
395
        liststore = gtk.ListStore(gobject.TYPE_STRING, # revision_id
396
                                  gobject.TYPE_STRING, # date
397
                                  gobject.TYPE_STRING, # committer
398
                                  gobject.TYPE_STRING, # summary
278.1.14 by John Arbash Meinel
Tests that we fill out the pending list correctly.
399
                                 )
278.1.15 by John Arbash Meinel
Hook up the list of modified files.
400
        self._pending_store = liststore
278.1.14 by John Arbash Meinel
Tests that we fill out the pending list correctly.
401
        self._treeview_pending.set_model(liststore)
402
        self._treeview_pending.append_column(gtk.TreeViewColumn(_('Date'),
403
                                             gtk.CellRendererText(), text=1))
404
        self._treeview_pending.append_column(gtk.TreeViewColumn(_('Committer'),
405
                                             gtk.CellRendererText(), text=2))
406
        self._treeview_pending.append_column(gtk.TreeViewColumn(_('Summary'),
407
                                             gtk.CellRendererText(), text=3))
408
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
409
    def _construct_diff_view(self):
278.1.12 by John Arbash Meinel
Delay computing the delta, and clean up some of the diff view names.
410
        from diff import DiffView
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
411
412
        self._diff_label = gtk.Label(_('Diff for whole tree'))
278.1.11 by John Arbash Meinel
Worked out the rest of the spacing.
413
        self._diff_label.set_alignment(0, 0)
414
        self._right_pane_table.set_row_spacing(self._right_pane_table_row, 0)
278.1.10 by John Arbash Meinel
To get the space weighting I wanted, I turned to a Table.
415
        self._add_to_right_table(self._diff_label, 1, False)
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
416
        self._diff_label.show()
417
278.1.12 by John Arbash Meinel
Delay computing the delta, and clean up some of the diff view names.
418
        self._diff_view = DiffView()
278.1.10 by John Arbash Meinel
To get the space weighting I wanted, I turned to a Table.
419
        self._add_to_right_table(self._diff_view, 4, True)
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
420
        self._diff_view.show()
421
422
    def _construct_file_message(self):
423
        file_message_box = gtk.VBox()
278.1.9 by John Arbash Meinel
Move all text entry boxes into a ScrolledWindow, so that they don't change size constantly.
424
        scroller = gtk.ScrolledWindow()
425
        scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
426
427
        self._file_message_text_view = gtk.TextView()
428
        scroller.add(self._file_message_text_view)
429
        scroller.show()
430
        scroller.set_shadow_type(gtk.SHADOW_IN)
431
        file_message_box.pack_start(scroller, expand=True, fill=True)
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
432
433
        self._file_message_text_view.modify_font(pango.FontDescription("Monospace"))
434
        self._file_message_text_view.set_wrap_mode(gtk.WRAP_WORD)
435
        self._file_message_text_view.set_accepts_tab(False)
436
        self._file_message_text_view.show()
437
278.1.21 by John Arbash Meinel
Start tracking the per-file commit messages.
438
        self._file_message_expander = gtk.Expander(_('File commit message'))
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
439
        self._file_message_expander.add(file_message_box)
440
        file_message_box.show()
278.1.10 by John Arbash Meinel
To get the space weighting I wanted, I turned to a Table.
441
        self._add_to_right_table(self._file_message_expander, 1, False)
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
442
        self._file_message_expander.show()
443
444
    def _construct_global_message(self):
445
        self._global_message_label = gtk.Label(_('Global Commit Message'))
278.1.11 by John Arbash Meinel
Worked out the rest of the spacing.
446
        self._global_message_label.set_alignment(0, 0)
447
        self._right_pane_table.set_row_spacing(self._right_pane_table_row, 0)
278.1.10 by John Arbash Meinel
To get the space weighting I wanted, I turned to a Table.
448
        self._add_to_right_table(self._global_message_label, 1, False)
278.1.11 by John Arbash Meinel
Worked out the rest of the spacing.
449
        # Can we remove the spacing between the label and the box?
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
450
        self._global_message_label.show()
451
278.1.9 by John Arbash Meinel
Move all text entry boxes into a ScrolledWindow, so that they don't change size constantly.
452
        scroller = gtk.ScrolledWindow()
453
        scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
454
455
        self._global_message_text_view = gtk.TextView()
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
456
        self._global_message_text_view.modify_font(pango.FontDescription("Monospace"))
278.1.9 by John Arbash Meinel
Move all text entry boxes into a ScrolledWindow, so that they don't change size constantly.
457
        scroller.add(self._global_message_text_view)
458
        scroller.show()
459
        scroller.set_shadow_type(gtk.SHADOW_IN)
278.1.10 by John Arbash Meinel
To get the space weighting I wanted, I turned to a Table.
460
        self._add_to_right_table(scroller, 2, True)
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
461
        self._file_message_text_view.set_wrap_mode(gtk.WRAP_WORD)
462
        self._file_message_text_view.set_accepts_tab(False)
463
        self._global_message_text_view.show()
464
278.1.17 by John Arbash Meinel
Add a * reference for why you can't change the commit selection.
465
    def _on_treeview_files_cursor_changed(self, treeview):
278.1.18 by John Arbash Meinel
Start checking the diff view is correct.
466
        treeselection = treeview.get_selection()
278.1.21 by John Arbash Meinel
Start tracking the per-file commit messages.
467
        (model, selection) = treeselection.get_selected()
278.1.17 by John Arbash Meinel
Add a * reference for why you can't change the commit selection.
468
278.1.21 by John Arbash Meinel
Start tracking the per-file commit messages.
469
        if selection is not None:
470
            path, display_path = model.get(selection, 1, 3)
278.1.18 by John Arbash Meinel
Start checking the diff view is correct.
471
            self._diff_label.set_text(_('Diff for ') + display_path)
278.1.20 by John Arbash Meinel
We always select the All Files record in the files view,
472
            if path is None:
473
                self._diff_view.show_diff(None)
474
            else:
475
                self._diff_view.show_diff([path])
278.1.21 by John Arbash Meinel
Start tracking the per-file commit messages.
476
            self._update_per_file_info(selection)
477
478
    def _save_current_file_message(self):
479
        if self._last_selected_file is None:
480
            return # Nothing to save
481
        text_buffer = self._file_message_text_view.get_buffer()
482
        cur_text = text_buffer.get_text(text_buffer.get_start_iter(),
483
                                        text_buffer.get_end_iter())
484
        last_selected = self._files_store.get_iter(self._last_selected_file)
485
        self._files_store.set_value(last_selected, 5, cur_text)
486
487
    def _update_per_file_info(self, selection):
488
        # The node is changing, so cache the current message
489
        self._save_current_file_message()
490
        text_buffer = self._file_message_text_view.get_buffer()
491
        file_id, display_path, message = self._files_store.get(selection, 0, 3, 5)
492
        if file_id is None: # Whole tree
493
            self._file_message_expander.set_label(_('File commit message'))
494
            self._file_message_expander.set_expanded(False)
495
            self._file_message_expander.set_sensitive(False)
496
            text_buffer.set_text('')
497
            self._last_selected_file = None
498
        else:
499
            self._file_message_expander.set_label(_('Commit message for ')
500
                                                  + display_path)
501
            self._file_message_expander.set_expanded(True)
502
            self._file_message_expander.set_sensitive(True)
503
            text_buffer.set_text(message)
504
            self._last_selected_file = self._files_store.get_path(selection)
278.1.17 by John Arbash Meinel
Add a * reference for why you can't change the commit selection.
505
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
506
    @staticmethod
507
    def _rev_to_pending_info(rev):
508
        """Get the information from a pending merge."""
126.1.1 by Szilveszter Farkas (Phanatic)
New Commit dialog implementation (no more Glade).
509
        from bzrlib.osutils import format_date
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
510
511
        rev_dict = {}
512
        rev_dict['committer'] = re.sub('<.*@.*>', '', rev.committer).strip(' ')
513
        rev_dict['summary'] = rev.get_summary()
514
        rev_dict['date'] = format_date(rev.timestamp,
515
                                       rev.timezone or 0,
516
                                       'original', date_fmt="%Y-%m-%d",
517
                                       show_offset=False)
518
        rev_dict['revision_id'] = rev.revision_id
519
        return rev_dict
520
521
522
# class CommitDialog(gtk.Dialog):
523
#     """ New implementation of the Commit dialog. """
524
#     def __init__(self, wt, wtpath, notbranch, selected=None, parent=None):
525
#         """ Initialize the Commit Dialog. """
526
#         gtk.Dialog.__init__(self, title="Commit - Olive",
527
#                                   parent=parent,
528
#                                   flags=0,
529
#                                   buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
530
#         
531
#         # Get arguments
532
#         self.wt = wt
533
#         self.wtpath = wtpath
534
#         self.notbranch = notbranch
535
#         self.selected = selected
536
#         
537
#         # Set the delta
538
#         self.old_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
539
#         self.delta = self.wt.changes_from(self.old_tree)
540
#         
541
#         # Get pending merges
542
#         self.pending = self._pending_merges(self.wt)
543
#         
544
#         # Do some preliminary checks
545
#         self._is_checkout = False
546
#         self._is_pending = False
547
#         if self.wt is None and not self.notbranch:
548
#             error_dialog(_('Directory does not have a working tree'),
549
#                          _('Operation aborted.'))
550
#             self.close()
551
#             return
552
# 
553
#         if self.notbranch:
554
#             error_dialog(_('Directory is not a branch'),
555
#                          _('You can perform this action only in a branch.'))
556
#             self.close()
557
#             return
558
#         else:
559
#             if self.wt.branch.get_bound_location() is not None:
560
#                 # we have a checkout, so the local commit checkbox must appear
561
#                 self._is_checkout = True
562
#             
563
#             if self.pending:
564
#                 # There are pending merges, file selection not supported
565
#                 self._is_pending = True
566
#         
567
#         # Create the widgets
568
#         # This is the main horizontal box, which is used to separate the commit
569
#         # info from the diff window.
570
#         self._hpane = gtk.HPaned()
571
#         self._button_commit = gtk.Button(_("Comm_it"), use_underline=True)
572
#         self._expander_files = gtk.Expander(_("File(s) to commit"))
573
#         self._vpaned_main = gtk.VPaned()
574
#         self._scrolledwindow_files = gtk.ScrolledWindow()
575
#         self._scrolledwindow_message = gtk.ScrolledWindow()
576
#         self._treeview_files = gtk.TreeView()
577
#         self._vbox_message = gtk.VBox()
578
#         self._label_message = gtk.Label(_("Commit message:"))
579
#         self._textview_message = gtk.TextView()
580
#         
581
#         if self._is_pending:
582
#             self._expander_merges = gtk.Expander(_("Pending merges"))
583
#             self._vpaned_list = gtk.VPaned()
584
#             self._scrolledwindow_merges = gtk.ScrolledWindow()
585
#             self._treeview_merges = gtk.TreeView()
586
# 
587
#         # Set callbacks
588
#         self._button_commit.connect('clicked', self._on_commit_clicked)
589
#         self._treeview_files.connect('cursor-changed', self._on_treeview_files_cursor_changed)
590
#         self._treeview_files.connect('row-activated', self._on_treeview_files_row_activated)
591
#         
592
#         # Set properties
593
#         self._scrolledwindow_files.set_policy(gtk.POLICY_AUTOMATIC,
594
#                                               gtk.POLICY_AUTOMATIC)
595
#         self._scrolledwindow_message.set_policy(gtk.POLICY_AUTOMATIC,
596
#                                                 gtk.POLICY_AUTOMATIC)
597
#         self._textview_message.modify_font(pango.FontDescription("Monospace"))
598
#         self.set_default_size(500, 500)
599
#         self._vpaned_main.set_position(200)
600
#         self._button_commit.set_flags(gtk.CAN_DEFAULT)
601
# 
602
#         if self._is_pending:
603
#             self._scrolledwindow_merges.set_policy(gtk.POLICY_AUTOMATIC,
604
#                                                    gtk.POLICY_AUTOMATIC)
605
#             self._treeview_files.set_sensitive(False)
606
#         
607
#         # Construct the dialog
608
#         self.action_area.pack_end(self._button_commit)
609
#         
610
#         self._scrolledwindow_files.add(self._treeview_files)
611
#         self._scrolledwindow_message.add(self._textview_message)
612
#         
613
#         self._expander_files.add(self._scrolledwindow_files)
614
#         
615
#         self._vbox_message.pack_start(self._label_message, False, False)
616
#         self._vbox_message.pack_start(self._scrolledwindow_message, True, True)
617
#         
618
#         if self._is_pending:        
619
#             self._expander_merges.add(self._scrolledwindow_merges)
620
#             self._scrolledwindow_merges.add(self._treeview_merges)
621
#             self._vpaned_list.add1(self._expander_files)
622
#             self._vpaned_list.add2(self._expander_merges)
623
#             self._vpaned_main.add1(self._vpaned_list)
624
#         else:
625
#             self._vpaned_main.add1(self._expander_files)
626
# 
627
#         self._vpaned_main.add2(self._vbox_message)
628
#         
629
#         self._hpane.pack1(self._vpaned_main)
630
#         self.vbox.pack_start(self._hpane, expand=True, fill=True)
631
#         if self._is_checkout: 
632
#             self._check_local = gtk.CheckButton(_("_Only commit locally"),
633
#                                                 use_underline=True)
634
#             self.vbox.pack_start(self._check_local, False, False)
635
#             if have_dbus:
636
#                 bus = dbus.SystemBus()
637
#                 proxy_obj = bus.get_object('org.freedesktop.NetworkManager', 
638
#                               '/org/freedesktop/NetworkManager')
639
#                 dbus_iface = dbus.Interface(
640
#                         proxy_obj, 'org.freedesktop.NetworkManager')
641
#                 try:
642
#                     # 3 is the enum value for STATE_CONNECTED
643
#                     self._check_local.set_active(dbus_iface.state() != 3)
644
#                 except dbus.DBusException, e:
645
#                     # Silently drop errors. While DBus may be 
646
#                     # available, NetworkManager doesn't necessarily have to be
647
#                     mutter("unable to get networkmanager state: %r" % e)
648
#                 
649
#         # Create the file list
650
#         self._create_file_view()
651
#         # Create the pending merges
652
#         self._create_pending_merges()
653
#         self._create_diff_view()
654
#         
655
#         # Expand the corresponding expander
656
#         if self._is_pending:
657
#             self._expander_merges.set_expanded(True)
658
#         else:
659
#             self._expander_files.set_expanded(True)
660
#         
661
#         # Display dialog
662
#         self.vbox.show_all()
663
#         
664
#         # Default to Commit button
665
#         self._button_commit.grab_default()
666
#     
667
#     def _show_diff_view(self, treeview):
668
#         # FIXME: the diff window freezes for some reason
669
#         treeselection = treeview.get_selection()
670
#         (model, iter) = treeselection.get_selected()
671
# 
672
#         if iter is not None:
673
#             selected = model.get_value(iter, 3) # Get the real_path attribute
674
#             self._diff_display.show_diff([selected])
675
# 
676
#     def _on_treeview_files_cursor_changed(self, treeview):
677
#         self._show_diff_view(treeview)
678
#         
679
#     def _on_treeview_files_row_activated(self, treeview, path, view_column):
680
#         self._show_diff_view(treeview)
681
#     
682
#     @show_bzr_error
683
#     def _on_commit_clicked(self, button):
684
#         """ Commit button clicked handler. """
685
#         textbuffer = self._textview_message.get_buffer()
686
#         start, end = textbuffer.get_bounds()
687
#         message = textbuffer.get_text(start, end).decode('utf-8')
688
#         
689
#         if not self.pending:
690
#             specific_files = self._get_specific_files()
691
#         else:
692
#             specific_files = None
693
# 
694
#         if message == '':
695
#             response = question_dialog(_('Commit with an empty message?'),
696
#                                        _('You can describe your commit intent in the message.'))
697
#             if response == gtk.RESPONSE_NO:
698
#                 # Kindly give focus to message area
699
#                 self._textview_message.grab_focus()
700
#                 return
701
# 
702
#         if self._is_checkout:
703
#             local = self._check_local.get_active()
704
#         else:
705
#             local = False
706
# 
707
#         if list(self.wt.unknowns()) != []:
708
#             response = question_dialog(_("Commit with unknowns?"),
709
#                _("Unknown files exist in the working tree. Commit anyway?"))
710
#             if response == gtk.RESPONSE_NO:
711
#                 return
712
#         
713
#         try:
714
#             self.wt.commit(message,
715
#                        allow_pointless=False,
716
#                        strict=False,
717
#                        local=local,
718
#                        specific_files=specific_files)
719
#         except errors.PointlessCommit:
720
#             response = question_dialog(_('Commit with no changes?'),
721
#                                        _('There are no changes in the working tree.'))
722
#             if response == gtk.RESPONSE_YES:
723
#                 self.wt.commit(message,
724
#                                allow_pointless=True,
725
#                                strict=False,
726
#                                local=local,
727
#                                specific_files=specific_files)
728
#         self.response(gtk.RESPONSE_OK)
729
# 
730
#     def _pending_merges(self, wt):
731
#         """ Return a list of pending merges or None if there are none of them. """
732
#         parents = wt.get_parent_ids()
733
#         if len(parents) < 2:
734
#             return None
735
#         
736
#         import re
737
#         from bzrlib.osutils import format_date
738
#         
739
#         pending = parents[1:]
740
#         branch = wt.branch
741
#         last_revision = parents[0]
742
#         
743
#         if last_revision is not None:
744
#             try:
745
#                 ignore = set(branch.repository.get_ancestry(last_revision))
746
#             except errors.NoSuchRevision:
747
#                 # the last revision is a ghost : assume everything is new 
748
#                 # except for it
749
#                 ignore = set([None, last_revision])
750
#         else:
751
#             ignore = set([None])
752
#         
753
#         pm = []
754
#         for merge in pending:
755
#             ignore.add(merge)
756
#             try:
757
#                 m_revision = branch.repository.get_revision(merge)
758
#                 
759
#                 rev = {}
760
#                 rev['committer'] = re.sub('<.*@.*>', '', m_revision.committer).strip(' ')
761
#                 rev['summary'] = m_revision.get_summary()
762
#                 rev['date'] = format_date(m_revision.timestamp,
763
#                                           m_revision.timezone or 0, 
764
#                                           'original', date_fmt="%Y-%m-%d",
765
#                                           show_offset=False)
766
#                 
767
#                 pm.append(rev)
768
#                 
769
#                 inner_merges = branch.repository.get_ancestry(merge)
770
#                 assert inner_merges[0] is None
771
#                 inner_merges.pop(0)
772
#                 inner_merges.reverse()
773
#                 for mmerge in inner_merges:
774
#                     if mmerge in ignore:
775
#                         continue
776
#                     mm_revision = branch.repository.get_revision(mmerge)
777
#                     
778
#                     rev = {}
779
#                     rev['committer'] = re.sub('<.*@.*>', '', mm_revision.committer).strip(' ')
780
#                     rev['summary'] = mm_revision.get_summary()
781
#                     rev['date'] = format_date(mm_revision.timestamp,
782
#                                               mm_revision.timezone or 0, 
783
#                                               'original', date_fmt="%Y-%m-%d",
784
#                                               show_offset=False)
785
#                 
786
#                     pm.append(rev)
787
#                     
788
#                     ignore.add(mmerge)
789
#             except errors.NoSuchRevision:
790
#                 print "DEBUG: NoSuchRevision:", merge
791
#         
792
#         return pm
793
# 
794
#     def _create_file_view(self):
795
#         self._file_store = gtk.ListStore(gobject.TYPE_BOOLEAN,   # [0] checkbox
796
#                                          gobject.TYPE_STRING,    # [1] path to display
797
#                                          gobject.TYPE_STRING,    # [2] changes type
798
#                                          gobject.TYPE_STRING)    # [3] real path
799
#         self._treeview_files.set_model(self._file_store)
800
#         crt = gtk.CellRendererToggle()
801
#         crt.set_property("activatable", True)
802
#         crt.connect("toggled", self._toggle_commit, self._file_store)
803
#         self._treeview_files.append_column(gtk.TreeViewColumn(_('Commit'),
804
#                                      crt, active=0))
805
#         self._treeview_files.append_column(gtk.TreeViewColumn(_('Path'),
806
#                                      gtk.CellRendererText(), text=1))
807
#         self._treeview_files.append_column(gtk.TreeViewColumn(_('Type'),
808
#                                      gtk.CellRendererText(), text=2))
809
# 
810
#         for path, id, kind in self.delta.added:
811
#             marker = osutils.kind_marker(kind)
812
#             if self.selected is not None:
813
#                 if path == os.path.join(self.wtpath, self.selected):
814
#                     self._file_store.append([ True, path+marker, _('added'), path ])
815
#                 else:
816
#                     self._file_store.append([ False, path+marker, _('added'), path ])
817
#             else:
818
#                 self._file_store.append([ True, path+marker, _('added'), path ])
819
# 
820
#         for path, id, kind in self.delta.removed:
821
#             marker = osutils.kind_marker(kind)
822
#             if self.selected is not None:
823
#                 if path == os.path.join(self.wtpath, self.selected):
824
#                     self._file_store.append([ True, path+marker, _('removed'), path ])
825
#                 else:
826
#                     self._file_store.append([ False, path+marker, _('removed'), path ])
827
#             else:
828
#                 self._file_store.append([ True, path+marker, _('removed'), path ])
829
# 
830
#         for oldpath, newpath, id, kind, text_modified, meta_modified in self.delta.renamed:
831
#             marker = osutils.kind_marker(kind)
832
#             if text_modified or meta_modified:
833
#                 changes = _('renamed and modified')
834
#             else:
835
#                 changes = _('renamed')
836
#             if self.selected is not None:
837
#                 if newpath == os.path.join(self.wtpath, self.selected):
838
#                     self._file_store.append([ True,
839
#                                               oldpath+marker + '  =>  ' + newpath+marker,
840
#                                               changes,
841
#                                               newpath
842
#                                             ])
843
#                 else:
844
#                     self._file_store.append([ False,
845
#                                               oldpath+marker + '  =>  ' + newpath+marker,
846
#                                               changes,
847
#                                               newpath
848
#                                             ])
849
#             else:
850
#                 self._file_store.append([ True,
851
#                                           oldpath+marker + '  =>  ' + newpath+marker,
852
#                                           changes,
853
#                                           newpath
854
#                                         ])
855
# 
856
#         for path, id, kind, text_modified, meta_modified in self.delta.modified:
857
#             marker = osutils.kind_marker(kind)
858
#             if self.selected is not None:
859
#                 if path == os.path.join(self.wtpath, self.selected):
860
#                     self._file_store.append([ True, path+marker, _('modified'), path ])
861
#                 else:
862
#                     self._file_store.append([ False, path+marker, _('modified'), path ])
863
#             else:
864
#                 self._file_store.append([ True, path+marker, _('modified'), path ])
865
#     
866
#     def _create_pending_merges(self):
867
#         if not self.pending:
868
#             return
869
#         
870
#         liststore = gtk.ListStore(gobject.TYPE_STRING,
871
#                                   gobject.TYPE_STRING,
872
#                                   gobject.TYPE_STRING)
873
#         self._treeview_merges.set_model(liststore)
874
#         
875
#         self._treeview_merges.append_column(gtk.TreeViewColumn(_('Date'),
876
#                                             gtk.CellRendererText(), text=0))
877
#         self._treeview_merges.append_column(gtk.TreeViewColumn(_('Committer'),
878
#                                             gtk.CellRendererText(), text=1))
879
#         self._treeview_merges.append_column(gtk.TreeViewColumn(_('Summary'),
880
#                                             gtk.CellRendererText(), text=2))
881
#         
882
#         for item in self.pending:
883
#             liststore.append([ item['date'],
884
#                                item['committer'],
885
#                                item['summary'] ])
886
#     
887
# 
888
#     def _create_diff_view(self):
278.1.12 by John Arbash Meinel
Delay computing the delta, and clean up some of the diff view names.
889
#         from diff import DiffView
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
890
# 
278.1.12 by John Arbash Meinel
Delay computing the delta, and clean up some of the diff view names.
891
#         self._diff_display = DiffView()
278.1.5 by John Arbash Meinel
Starting to flesh out the dialog with actual windows.
892
#         self._diff_display.set_trees(self.wt, self.wt.basis_tree())
893
#         self._diff_display.show_diff(None)
894
#         self._diff_display.show()
895
#         self._hpane.pack2(self._diff_display)
896
# 
897
#     def _get_specific_files(self):
898
#         ret = []
899
#         it = self._file_store.get_iter_first()
900
#         while it:
901
#             if self._file_store.get_value(it, 0):
902
#                 # get real path from hidden column 3
903
#                 ret.append(self._file_store.get_value(it, 3))
904
#             it = self._file_store.iter_next(it)
905
# 
906
#         return ret
907
#     
908
#     def _toggle_commit(self, cell, path, model):
909
#         model[path][0] = not model[path][0]
910
#         return