Rev 524: Add search dialog. in file:///data/jelmer/bzr-gtk/trunk/
Jelmer Vernooij
jelmer at samba.org
Tue Jul 1 15:06:58 BST 2008
At file:///data/jelmer/bzr-gtk/trunk/
------------------------------------------------------------
revno: 524
revision-id: jelmer at samba.org-20080701140655-x5vui3c95jpwzjtc
parent: jelmer at samba.org-20080630121506-7l9g0ve3z9sumxm7
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Tue 2008-07-01 16:06:55 +0200
message:
Add search dialog.
added:
search.py search.py-20080701140205-dvpvrtf7n1qp2t8a-1
modified:
viz/branchwin.py branchwin.py-20051016222514-15fd120652fcf25c
=== added file 'search.py'
--- a/search.py 1970-01-01 00:00:00 +0000
+++ b/search.py 2008-07-01 14:06:55 +0000
@@ -0,0 +1,38 @@
+# Copyright (C) 2008 by Jelmer Vernooij <jelmer at samba.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+try:
+ import pygtk
+ pygtk.require("2.0")
+except:
+ pass
+
+import gtk
+from bzrlib.plugins.search import index as _mod_index
+
+class SearchDialog(gtk.Dialog):
+ """Search dialog."""
+ def __init__(self, branch, parent=None):
+ gtk.Dialog.__init__(self, title="Search Revisions",
+ parent=parent,
+ flags=gtk.DIALOG_MODAL,
+ buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
+
+ # Get arguments
+ self.branch = branch
+
+ # Show the dialog
+ self.show_all()
=== modified file 'viz/branchwin.py'
--- a/viz/branchwin.py 2008-06-29 19:34:29 +0000
+++ b/viz/branchwin.py 2008-07-01 14:06:55 +0000
@@ -238,6 +238,10 @@
branch_index_menuitem.connect('activate', self._branch_index_cb)
branch_menu.add(branch_index_menuitem)
+ branch_search_menuitem = gtk.MenuItem("_Search")
+ branch_search_menuitem.connect('activate', self._branch_search_cb)
+ branch_menu.add(branch_search_menuitem)
+
help_menu = gtk.Menu()
help_menuitem = gtk.MenuItem("_Help")
help_menuitem.set_submenu(help_menu)
@@ -470,6 +474,10 @@
from bzrlib.plugins.search import index as _mod_index
_mod_index.index_url(self.branch.base)
+ def _branch_search_cb(self, w):
+ from bzrlib.plugins.gtk.search import SearchDialog
+ SearchDialog(self).run()
+
def _about_dialog_cb(self, w):
from bzrlib.plugins.gtk.about import AboutDialog
More information about the bazaar-commits
mailing list