/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 commit.py

  • Committer: John Arbash Meinel
  • Date: 2007-10-12 18:10:24 UTC
  • mto: (322.1.1 trunk) (330.3.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 368.
  • Revision ID: john@arbash-meinel.com-20071012181024-t332b4l0338y419t
Make use of the 'selected' parameter to CommitDialog.
Also update the Olive interfaces to properly use CommitDialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
        #  changed_content, versioned, parent, name, kind,
178
178
        #  executable)
179
179
 
 
180
        all_enabled = (self._selected is None)
180
181
        # The first entry is always the 'whole tree'
181
 
        store.append([None, None, True, 'All Files', '', ''])
 
182
        all_iter = store.append([None, None, all_enabled, 'All Files', '', ''])
 
183
        initial_cursor = store.get_path(all_iter)
182
184
        # should we pass specific_files?
183
185
        self._wt.lock_read()
184
186
        self._basis_tree.lock_read()
186
188
            from diff import _iter_changes_to_status
187
189
            for (file_id, real_path, change_type, display_path
188
190
                ) in _iter_changes_to_status(self._basis_tree, self._wt):
189
 
                store.append([file_id, real_path.encode('UTF-8'),
190
 
                              True, display_path.encode('UTF-8'),
191
 
                              change_type, ''])
 
191
                if self._selected and real_path != self._selected:
 
192
                    enabled = False
 
193
                else:
 
194
                    enabled = True
 
195
                item_iter = store.append([
 
196
                    file_id,
 
197
                    real_path.encode('UTF-8'),
 
198
                    enabled,
 
199
                    display_path.encode('UTF-8'),
 
200
                    change_type,
 
201
                    '', # Initial comment
 
202
                    ])
 
203
                if self._selected and enabled:
 
204
                    initial_cursor = store.get_path(item_iter)
192
205
        finally:
193
206
            self._basis_tree.unlock()
194
207
            self._wt.unlock()
198
211
        # This sets the cursor, which causes the expander to close, which
199
212
        # causes the _file_message_text_view to never get realized. So we have
200
213
        # to give it a little kick, or it warns when we try to grab the focus
201
 
        self._treeview_files.set_cursor(0)
 
214
        self._treeview_files.set_cursor(initial_cursor)
202
215
 
203
216
        def _realize_file_message_tree_view(*args):
204
217
            self._file_message_text_view.realize()