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
=== modified file 'gwibber/client.py'
--- gwibber/client.py 2010-03-31 04:25:33 +0000
+++ gwibber/client.py 2010-05-15 16:58:23 +0000
@@ -106,6 +106,7 @@
106 self.input = gwui.Input()106 self.input = gwui.Input()
107 self.input.connect("submit", self.on_input_activate)107 self.input.connect("submit", self.on_input_activate)
108 self.input.connect("changed", self.on_input_changed)108 self.input.connect("changed", self.on_input_changed)
109 self.input.connect("clear", self.on_input_cleared)
109110
110 self.input_splitter = gtk.VPaned()111 self.input_splitter = gtk.VPaned()
111 self.input_splitter.pack1(self.stream_view, resize=True)112 self.input_splitter.pack1(self.stream_view, resize=True)
@@ -384,6 +385,10 @@
384 def on_input_changed(self, w, text, cnt):385 def on_input_changed(self, w, text, cnt):
385 self.input.textview.set_overlay_text(str(MAX_MESSAGE_LENGTH - cnt))386 self.input.textview.set_overlay_text(str(MAX_MESSAGE_LENGTH - cnt))
386387
388 def on_input_cleared(self, seq):
389 self.message_target.end()
390 self.input.clear()
391
387 def on_input_activate(self, w, text, cnt):392 def on_input_activate(self, w, text, cnt):
388 self.send_message(text)393 self.send_message(text)
389 self.input.clear()394 self.input.clear()
390395
=== modified file 'gwibber/gwui.py'
--- gwibber/gwui.py 2010-05-03 04:25:30 +0000
+++ gwibber/gwui.py 2010-05-15 16:58:23 +0000
@@ -782,7 +782,8 @@
782class Input(gtk.Frame):782class Input(gtk.Frame):
783 __gsignals__ = {783 __gsignals__ = {
784 "submit": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, (str, int)),784 "submit": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, (str, int)),
785 "changed": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, (str, int))785 "changed": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, (str, int)),
786 "clear": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, ())
786 }787 }
787788
788 def __init__(self):789 def __init__(self):
@@ -790,6 +791,7 @@
790791
791 self.textview = InputTextView()792 self.textview = InputTextView()
792 self.textview.connect("submit", self.do_submit_event)793 self.textview.connect("submit", self.do_submit_event)
794 self.textview.connect("clear", self.do_clear_event)
793 self.textview.get_buffer().connect("changed", self.do_changed_event)795 self.textview.get_buffer().connect("changed", self.do_changed_event)
794796
795 scroll = gtk.ScrolledWindow()797 scroll = gtk.ScrolledWindow()
@@ -809,6 +811,9 @@
809 def clear(self):811 def clear(self):
810 self.set_text("")812 self.set_text("")
811813
814 def do_clear_event(self, seq):
815 self.emit("clear")
816
812 def do_changed_event(self, tb):817 def do_changed_event(self, tb):
813 text = self.textview.get_text()818 text = self.textview.get_text()
814 chars = self.textview.get_char_count()819 chars = self.textview.get_char_count()
@@ -821,7 +826,8 @@
821826
822class InputTextView(gtk.TextView):827class InputTextView(gtk.TextView):
823 __gsignals__ = {828 __gsignals__ = {
824 "submit": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, ())829 "submit": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, ()),
830 "clear": (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, ())
825 }831 }
826832
827 def __init__(self):833 def __init__(self):
@@ -935,3 +941,4 @@
935941
936gtk.binding_entry_add_signal(InputTextView, gtk.keysyms.Return, 0, "submit")942gtk.binding_entry_add_signal(InputTextView, gtk.keysyms.Return, 0, "submit")
937gtk.binding_entry_add_signal(InputTextView, gtk.keysyms.KP_Enter, 0, "submit")943gtk.binding_entry_add_signal(InputTextView, gtk.keysyms.KP_Enter, 0, "submit")
944gtk.binding_entry_add_signal(InputTextView, gtk.keysyms.Escape, 0, "clear")