/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-18 15:19:21 UTC
  • mfrom: (533.11.1 trunk)
  • Revision ID: jelmer@samba.org-20080718151921-lzf632mlqhups3io
Merge asking the user whether to create an index.

Show diffs side-by-side

added added

removed removed

Lines of Context:
477
477
        _mod_index.index_url(self.branch.base)
478
478
 
479
479
    def _branch_search_cb(self, w):
 
480
        from bzrlib.plugins.search import index as _mod_index
480
481
        from bzrlib.plugins.gtk.search import SearchDialog
481
 
        dialog = SearchDialog(self.branch)
 
482
        from bzrlib.plugins.search import errors as search_errors
 
483
 
 
484
        try:
 
485
            index = _mod_index.open_index_url(self.branch.base)
 
486
        except search_errors.NoSearchIndex:
 
487
            dialog = gtk.MessageDialog(self, type=gtk.MESSAGE_QUESTION, 
 
488
                buttons=gtk.BUTTONS_OK_CANCEL, 
 
489
                message_format="This branch has not been indexed yet. "
 
490
                               "Index now?")
 
491
            if dialog.run() == gtk.RESPONSE_OK:
 
492
                dialog.destroy()
 
493
                index = _mod_index.index_url(self.branch.base)
 
494
            else:
 
495
                dialog.destroy()
 
496
                return
 
497
 
 
498
        dialog = SearchDialog(index)
482
499
        
483
500
        if dialog.run() == gtk.RESPONSE_OK:
484
501
            self.set_revision(dialog.get_revision())