/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 viz/branchwin.py

  • Committer: Jelmer Vernooij
  • Date: 2008-07-17 12:30:39 UTC
  • mto: This revision was merged to the branch mainline in revision 553.
  • Revision ID: jelmer@samba.org-20080717123039-rnpqwdwtwp2uz8br
Ask user whether to index if there is no index present yet.

Show diffs side-by-side

added added

removed removed

Lines of Context:
420
420
        _mod_index.index_url(self.branch.base)
421
421
 
422
422
    def _branch_search_cb(self, w):
 
423
        from bzrlib.plugins.search import index as _mod_index
423
424
        from bzrlib.plugins.gtk.search import SearchDialog
424
 
        dialog = SearchDialog(self.branch)
 
425
        from bzrlib.plugins.search import errors as search_errors
 
426
 
 
427
        try:
 
428
            index = _mod_index.open_index_url(self.branch.base)
 
429
        except search_errors.NoSearchIndex:
 
430
            dialog = gtk.MessageDialog(self, type=gtk.MESSAGE_QUESTION, 
 
431
                buttons=gtk.BUTTONS_OK_CANCEL, 
 
432
                message_format="This branch has not been indexed yet. "
 
433
                               "Index now?")
 
434
            if dialog.run() == gtk.RESPONSE_OK:
 
435
                index = _mod_index.index_url(self.branch.base)
 
436
            else:
 
437
                return
 
438
 
 
439
        dialog = SearchDialog(index)
425
440
        
426
441
        if dialog.run() == gtk.RESPONSE_OK:
427
442
            self.set_revision(dialog.get_revision())