/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-01 14:42:56 UTC
  • Revision ID: jelmer@samba.org-20080701144256-x17f3oumt80tgl9j
Show results in search window.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from bzrlib.plugins.gtk.tags import AddTagDialog
19
19
from bzrlib.plugins.gtk.preferences import PreferencesWindow
20
20
from bzrlib.plugins.gtk.branchview import TreeView, treemodel
 
21
 
 
22
from bzrlib.config import BranchConfig, GlobalConfig
21
23
from bzrlib.revision import Revision, NULL_REVISION
22
 
from bzrlib.config import BranchConfig
23
 
from bzrlib.config import GlobalConfig
 
24
from bzrlib.trace import mutter
24
25
 
25
26
class BranchWindow(Window):
26
27
    """Branch window.
228
229
        branch_menu.add(gtk.MenuItem("Pu_ll Revisions"))
229
230
        branch_menu.add(gtk.MenuItem("Pu_sh Revisions"))
230
231
 
 
232
        try:
 
233
            from bzrlib.plugins import search
 
234
        except ImportError:
 
235
            mutter("Didn't find search plugin")
 
236
        else:
 
237
            branch_index_menuitem = gtk.MenuItem("_Index")
 
238
            branch_index_menuitem.connect('activate', self._branch_index_cb)
 
239
            branch_menu.add(branch_index_menuitem)
 
240
 
 
241
            branch_search_menuitem = gtk.MenuItem("_Search")
 
242
            branch_search_menuitem.connect('activate', self._branch_search_cb)
 
243
            branch_menu.add(branch_search_menuitem)
 
244
 
231
245
        help_menu = gtk.Menu()
232
246
        help_menuitem = gtk.MenuItem("_Help")
233
247
        help_menuitem.set_submenu(help_menu)
456
470
        finally:
457
471
            self.treeview.set_sensitive(True)
458
472
 
 
473
    def _branch_index_cb(self, w):
 
474
        from bzrlib.plugins.search import index as _mod_index
 
475
        _mod_index.index_url(self.branch.base)
 
476
 
 
477
    def _branch_search_cb(self, w):
 
478
        from bzrlib.plugins.gtk.search import SearchDialog
 
479
        SearchDialog(self.branch).run()
 
480
 
459
481
    def _about_dialog_cb(self, w):
460
482
        from bzrlib.plugins.gtk.about import AboutDialog
461
483