Merge lp:~ncb000gt/gwibber/esc into lp:gwibber

Proposed by Nick Campbell
Status: Merged
Merged at revision: 899
Proposed branch: lp:~ncb000gt/gwibber/esc
Merge into: lp:gwibber
Diff against target: 69 lines (+14/-2)
2 files modified
gwibber/client.py (+5/-0)
gwibber/gwui.py (+9/-2)
To merge this branch: bzr merge lp:~ncb000gt/gwibber/esc
Reviewer Review Type Date Requested Status
Ken VanDine Approve
Vadim Rutkovsky (community) Approve
Review via email: mp+25376@code.launchpad.net

Description of the change

The purpose of this branch was purely to bring in the ability to hit escape if typing a message to "cancel" the reply, message, etc. This removes text from the input and removes links to reply/retweet/etc type messages.

Small, but makes a huge difference to my normal usage. :)

To post a comment you must log in.
Revision history for this message
Vadim Rutkovsky (roignac) wrote :

I've tried merging it to 842 - works correctly.

review: Approve
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Approve!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gwibber/client.py'
2--- gwibber/client.py 2010-03-31 04:25:33 +0000
3+++ gwibber/client.py 2010-05-15 16:58:23 +0000
4@@ -106,6 +106,7 @@
5 self.input = gwui.Input()
6 self.input.connect("submit", self.on_input_activate)
7 self.input.connect("changed", self.on_input_changed)
8+ self.input.connect("clear", self.on_input_cleared)
9
10 self.input_splitter = gtk.VPaned()
11 self.input_splitter.pack1(self.stream_view, resize=True)
12@@ -384,6 +385,10 @@
13 def on_input_changed(self, w, text, cnt):
14 self.input.textview.set_overlay_text(str(MAX_MESSAGE_LENGTH - cnt))
15
16+ def on_input_cleared(self, seq):
17+ self.message_target.end()
18+ self.input.clear()
19+
20 def on_input_activate(self, w, text, cnt):
21 self.send_message(text)
22 self.input.clear()
23
24=== modified file 'gwibber/gwui.py'
25--- gwibber/gwui.py 2010-05-03 04:25:30 +0000
26+++ gwibber/gwui.py 2010-05-15 16:58:23 +0000
27@@ -782,7 +782,8 @@
28 class Input(gtk.Frame):
29 __gsignals__ = {
30 "submit": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, (str, int)),
31- "changed": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, (str, int))
32+ "changed": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, (str, int)),
33+ "clear": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, ())
34 }
35
36 def __init__(self):
37@@ -790,6 +791,7 @@
38
39 self.textview = InputTextView()
40 self.textview.connect("submit", self.do_submit_event)
41+ self.textview.connect("clear", self.do_clear_event)
42 self.textview.get_buffer().connect("changed", self.do_changed_event)
43
44 scroll = gtk.ScrolledWindow()
45@@ -809,6 +811,9 @@
46 def clear(self):
47 self.set_text("")
48
49+ def do_clear_event(self, seq):
50+ self.emit("clear")
51+
52 def do_changed_event(self, tb):
53 text = self.textview.get_text()
54 chars = self.textview.get_char_count()
55@@ -821,7 +826,8 @@
56
57 class InputTextView(gtk.TextView):
58 __gsignals__ = {
59- "submit": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, ())
60+ "submit": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, ()),
61+ "clear": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, ())
62 }
63
64 def __init__(self):
65@@ -935,3 +941,4 @@
66
67 gtk.binding_entry_add_signal(InputTextView, gtk.keysyms.Return, 0, "submit")
68 gtk.binding_entry_add_signal(InputTextView, gtk.keysyms.KP_Enter, 0, "submit")
69+gtk.binding_entry_add_signal(InputTextView, gtk.keysyms.Escape, 0, "clear")