Merge lp:~mbp/bzr-gtk/201956-help into lp:bzr-gtk/gtk2

Proposed by Martin Pool
Status: Merged
Approved by: Robert Collins
Approved revision: 693
Merged at revision: 689
Proposed branch: lp:~mbp/bzr-gtk/201956-help
Merge into: lp:bzr-gtk/gtk2
Diff against target: 84 lines (+33/-2)
3 files modified
NEWS (+3/-0)
annotate/gannotate.py (+27/-2)
commands.py (+3/-0)
To merge this branch: bzr merge lp:~mbp/bzr-gtk/201956-help
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+26114@code.launchpad.net

This proposal supersedes a proposal from 2010-05-27.

Commit message

add buttons for find and goto-line, and also mention in help text

Description of the change

This has a very low-hanging fix for bug 201956, which is just to mention the search commands in the help.

... actually slightly higher fruit, to add discoverable buttons to open the search bar.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote : Posted in a previous version of this proposal

Just land it!

Revision history for this message
Robert Collins (lifeless) wrote :

looks fine

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2010-03-18 09:20:09 +0000
3+++ NEWS 2010-05-27 02:30:45 +0000
4@@ -12,6 +12,9 @@
5
6 FEATURES
7
8+ * Add 'Find' button to start text search.
9+ (Martin Pool, #556347)
10+
11 * Add 'glog' as an alias for visualize (aka viz) as too many
12 people are still confused.
13 (Vincent Ladeuil)
14
15=== modified file 'annotate/gannotate.py'
16--- annotate/gannotate.py 2009-06-05 12:18:50 +0000
17+++ annotate/gannotate.py 2010-05-27 02:30:45 +0000
18@@ -212,6 +212,10 @@
19 hbox.pack_start(self.back_button, expand=False, fill=True)
20 self.forward_button = self._create_forward_button()
21 hbox.pack_start(self.forward_button, expand=False, fill=True)
22+ self.find_button = self._create_find_button()
23+ hbox.pack_start(self.find_button, expand=False, fill=True)
24+ self.goto_button = self._create_goto_button()
25+ hbox.pack_start(self.goto_button, expand=False, fill=True)
26 hbox.show()
27 vbox.pack_start(hbox, expand=False, fill=True)
28
29@@ -234,11 +238,11 @@
30
31 self.add(vbox)
32
33- def _search_by_text(self, accel_group, window, key, modifiers):
34+ def _search_by_text(self, *ignored): # (accel_group, window, key, modifiers):
35 self._search.show_for('text')
36 self._search.set_target(self.annoview, TEXT_LINE_COL)
37
38- def _search_by_line(self, accel_group, window, key, modifiers):
39+ def _search_by_line(self, *ignored): # accel_group, window, key, modifiers):
40 self._search.show_for('line')
41 self._search.set_target(self.annoview, LINE_NUM_COL)
42
43@@ -344,6 +348,27 @@
44 button.set_sensitive(False)
45 return button
46
47+ def _create_find_button(self):
48+ button = gtk.Button()
49+ button.set_use_stock(True)
50+ button.set_label("gtk-find")
51+ button.set_tooltip_text("Search for text (Ctrl+F)")
52+ button.connect("clicked", self._search_by_text)
53+ button.set_relief(gtk.RELIEF_NONE)
54+ button.show()
55+ button.set_sensitive(True)
56+ return button
57+
58+ def _create_goto_button(self):
59+ button = gtk.Button()
60+ button.set_label("Goto Line")
61+ button.set_tooltip_text("Scroll to a line by entering its number (Ctrl+G)")
62+ button.connect("clicked", self._search_by_line)
63+ button.set_relief(gtk.RELIEF_NONE)
64+ button.show()
65+ button.set_sensitive(True)
66+ return button
67+
68 def go_back(self):
69 last_tree = self.tree
70 rev_id = self._selected_revision()
71
72=== modified file 'commands.py'
73--- commands.py 2010-01-26 16:54:44 +0000
74+++ commands.py 2010-05-27 02:30:45 +0000
75@@ -199,6 +199,9 @@
76 """GTK+ annotate.
77
78 Browse changes to FILENAME line by line in a GTK+ window.
79+
80+ Within the annotate window, you can use Ctrl-F to search for text, and
81+ Ctrl-G to jump to a line by number.
82 """
83
84 takes_args = ["filename", "line?"]

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: