Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activity.py1
-rw-r--r--activity/activity.info6
-rw-r--r--chat/box.py33
-rw-r--r--chat/roundbox.py8
-rw-r--r--chat/smilies.py2
5 files changed, 31 insertions, 19 deletions
diff --git a/activity.py b/activity.py
index 18ce996..297d57b 100644
--- a/activity.py
+++ b/activity.py
@@ -46,6 +46,7 @@ logger = logging.getLogger('chat-activity')
SMILIES_COLUMNS = 5
+# pylint: disable-msg=W0223
class Chat(activity.Activity):
def __init__(self, handle):
diff --git a/activity/activity.info b/activity/activity.info
index 1863af6..789b9c2 100644
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -5,10 +5,12 @@ summary = Text chat
homepage = http://wiki.sugarlabs.org/go/Activities/Chat
license = GPLv2+
+version = %(activity_version)s
+stability = stable
+
icon = activity-icon
exec = sugar-activity activity.Chat
-version = 73
-stability = stable
+requires = sdk/sugar-toolkit
# original activity.info options
activity_version = 73
diff --git a/chat/box.py b/chat/box.py
index 77f2bf5..bfc8156 100644
--- a/chat/box.py
+++ b/chat/box.py
@@ -81,12 +81,14 @@ class TextBox(gtk.TextView):
if event.type != gtk.gdk.BUTTON_RELEASE:
return False
if event.button == 2:
- palette = tag.get_data('palette')
+ # XXX `tag` is not defined
+ #palette = tag.get_data('palette')
#xw, yw = self.get_toplevel().get_pointer()
- logging.error('Popop palette by secondary button click')
- palette.move(event.x, event.y)
- palette.popup()
- return False
+ #logging.debug('Popop palette by secondary button click')
+ #palette.move(event.x, event.y)
+ #palette.popup()
+ #return False
+ pass
x, y = self.window_to_buffer_coords(gtk.TEXT_WINDOW_WIDGET,
int(event.x), int(event.y))
@@ -120,9 +122,10 @@ class TextBox(gtk.TextView):
jobject.destroy()
os.unlink(file_path)
- # Looks at all tags covering the position (x, y) in the text view,
- # and if one of them is a link return True
def check_url_hovering(self, x, y):
+ # Looks at all tags covering the position (x, y) in the text view,
+ # and if one of them is a link return True
+
hovering = False
self.palette = None
iter_tags = self.get_iter_at_location(x, y)
@@ -136,9 +139,10 @@ class TextBox(gtk.TextView):
break
return hovering
- # Looks at all tags covering the position (x, y) in the text view,
- # and if one of them is a link, change the cursor to the "hands" cursor
def set_cursor_if_appropriate(self, x, y):
+ # Looks at all tags covering the position (x, y) in the text view,
+ # and if one of them is a link, change the cursor to the "hands" cursor
+
hovering_over_link = self.check_url_hovering(x, y)
win = self.get_window(gtk.TEXT_WINDOW_TEXT)
if hovering_over_link:
@@ -154,7 +158,7 @@ class TextBox(gtk.TextView):
if hovering_over_link:
if self.palette is not None:
xw, yw = self.get_toplevel().get_pointer()
- logging.error('move palette to %d %d' % (xw, yw))
+ logging.debug('move palette to %d %d', xw, yw)
self.palette.move(xw, yw)
self.palette.popup()
else:
@@ -169,10 +173,11 @@ class TextBox(gtk.TextView):
self.window.get_pointer()
return False
- # Also update the cursor image if the window becomes visible
- # (e.g. when a window covering it got iconified).
def visibility_notify_event(self, widget, event):
- wx, wy, mod = self.window.get_pointer()
+ # Also update the cursor image if the window becomes visible
+ # (e.g. when a window covering it got iconified).
+
+ wx, wy, __ = self.window.get_pointer()
bx, by = self.window_to_buffer_coords(gtk.TEXT_WINDOW_WIDGET, wx, wy)
self.set_cursor_if_appropriate(bx, by)
return False
@@ -446,7 +451,7 @@ class _URLMenu(Palette):
self._clipboard_data_get_cb,
self._clipboard_clear_cb,
(self.url)):
- logging.error('GtkClipboard.set_with_data failed!')
+ logging.debug('GtkClipboard.set_with_data failed!')
else:
self.owns_clipboard = True
diff --git a/chat/roundbox.py b/chat/roundbox.py
index 71298dd..35d5f7c 100644
--- a/chat/roundbox.py
+++ b/chat/roundbox.py
@@ -11,6 +11,10 @@ class RoundBox(gtk.HBox):
def __init__(self, **kwargs):
gtk.HBox.__init__(self, **kwargs)
+ self._x = None
+ self._y = None
+ self._width = None
+ self._height = None
self._radius = style.zoom(10)
self.border = self._BORDER_DEFAULT
self.border_color = style.COLOR_BLACK
@@ -58,12 +62,12 @@ class RoundBox(gtk.HBox):
cr.close_path()
if self.background_color is not None:
- r, g, b, a = self.background_color.get_rgba()
+ r, g, b, __ = self.background_color.get_rgba()
cr.set_source_rgb(r, g, b)
cr.fill_preserve()
if self.border_color is not None:
- r, g, b, a = self.border_color.get_rgba()
+ r, g, b, __ = self.border_color.get_rgba()
cr.set_source_rgb(r, g, b)
cr.set_line_width(self.border)
cr.stroke()
diff --git a/chat/smilies.py b/chat/smilies.py
index dfb608a..4c41ac9 100644
--- a/chat/smilies.py
+++ b/chat/smilies.py
@@ -98,7 +98,7 @@ _catalog = None
def get_pixbuf(word):
"""Return a pixbuf associated to a smile, or None if not available"""
- for (name, hint, codes) in THEME:
+ for (name, __, codes) in THEME:
if word in codes:
return gtk.gdk.pixbuf_new_from_file(name)
return None