Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS2
-rw-r--r--activity.py24
-rw-r--r--chat/box.py2
3 files changed, 27 insertions, 1 deletions
diff --git a/AUTHORS b/AUTHORS
index dc8d225..a28fd77 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -12,10 +12,12 @@ Gonzalo Odiard <godiard@gmail.com>
Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
John (J5) Palmieri <johnp@redhat.com>
Justin Gallardo <justin.gallardo@gmail.com>
+Manuel Kaufmann <humitos@gmail.com>
Marco Pesenti Gritti <mpg@redhat.com>
Morgan Collett <morgan.collett@gmail.com>
Mukesh Gupta <mukeshgupta.2006@gmail.com>
Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
+Rafael Ortiz <rafael@activitycentral.com>
Simon Schampijer <simon@schampijer.de>
Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>
diff --git a/activity.py b/activity.py
index 297d57b..dac1b26 100644
--- a/activity.py
+++ b/activity.py
@@ -264,6 +264,7 @@ class Chat(activity.Activity):
style.COLOR_WHITE.get_gdk_color())
entry.set_sensitive(False)
entry.connect('activate', self.entry_activate_cb)
+ entry.connect('key-press-event', self.entry_key_press_cb)
self.entry = entry
self.chatbox = ChatBox()
@@ -277,7 +278,30 @@ class Chat(activity.Activity):
return box
+ def entry_key_press_cb(self, widget, event):
+ """Check for scrolling keys.
+
+ Check if the user pressed Page Up, Page Down, Home or End and
+ scroll the window according the pressed key.
+ """
+ vadj = self.chatbox.get_vadjustment()
+ if event.keyval == gtk.keysyms.Page_Down:
+ value = vadj.get_value() + vadj.page_size
+ if value > vadj.upper - vadj.page_size:
+ value = vadj.upper - vadj.page_size
+ vadj.set_value(value)
+ elif event.keyval == gtk.keysyms.Page_Up:
+ vadj.set_value(vadj.get_value() - vadj.page_size)
+ elif event.keyval == gtk.keysyms.Home and \
+ event.state & gtk.gdk.CONTROL_MASK:
+ vadj.set_value(vadj.lower)
+ elif event.keyval == gtk.keysyms.End and \
+ event.state & gtk.gdk.CONTROL_MASK:
+ vadj.set_value(vadj.upper - vadj.page_size)
+
def entry_activate_cb(self, entry):
+ self.chatbox._scroll_auto = True
+
text = entry.props.text
logger.debug('Entry: %s' % text)
if text:
diff --git a/chat/box.py b/chat/box.py
index 91c33b9..bd8625b 100644
--- a/chat/box.py
+++ b/chat/box.py
@@ -210,7 +210,7 @@ class TextBox(gtk.TextView):
words = text.split()
for word in words:
- if _URL_REGEXP.search(word) is not None:
+ if _URL_REGEXP.match(word) is not None:
tag = buf.create_tag(None,
foreground="blue", underline=pango.UNDERLINE_SINGLE)
tag.set_data("url", word)