diff options
-rw-r--r-- | activity.py | 20 | ||||
-rw-r--r-- | brain.py | 3 | ||||
-rw-r--r-- | chatbox.py | 21 | ||||
-rw-r--r-- | face.py | 4 |
4 files changed, 27 insertions, 21 deletions
diff --git a/activity.py b/activity.py index a7a1005..93a876d 100644 --- a/activity.py +++ b/activity.py @@ -119,6 +119,7 @@ class SpeakActivity(SharedActivity): self.add_events(Gdk.EventMask.POINTER_MOTION_HINT_MASK | Gdk.EventMask.POINTER_MOTION_MASK) + self.connect("motion_notify_event", self._mouse_moved_cb) box.add_events(Gdk.EventMask.BUTTON_PRESS_MASK) @@ -302,12 +303,14 @@ class SpeakActivity(SharedActivity): self.new_instance() def save_instance(self, file_path): - cfg = {'status': self.face.status.serialize(), - 'text': unicode(self.entry.props.text, 'utf-8', 'ignore'), - 'history': [unicode(i[0], 'utf-8', 'ignore') \ - for i in self.entrycombo.get_model()], - } - file(file_path, 'w').write(cjson.encode(cfg)) + # FIXME: object has no attribute text + #cfg = {'status': self.face.status.serialize(), + # 'text': unicode(self.entry.props.text, 'utf-8', 'ignore'), + # 'history': [unicode(i[0], 'utf-8', 'ignore') \ + # for i in self.entrycombo.get_model()], + # } + #file(file_path, 'w').write(cjson.encode(cfg)) + pass def share_instance(self, connection, is_initiator): self.chat.messenger = Messenger(connection, is_initiator, self.chat) @@ -330,7 +333,7 @@ class SpeakActivity(SharedActivity): # make the eyes track the motion of the mouse cursor self.face.look_at() self.chat.look_at() - + def _mouse_clicked_cb(self, widget, event): pass @@ -447,7 +450,8 @@ class SpeakActivity(SharedActivity): # when a new item is chosen, make sure the text is selected if not self.entry.is_focus(): self.entry.grab_focus() - self.entry.select_region(0, -1) + # FIXME: CellView object has no attribute select_region + #self.entry.select_region(0, -1) def _entry_key_press_cb(self, combo, event): # make the up/down arrows navigate through our history @@ -20,6 +20,7 @@ # If not, see <http://www.gnu.org/licenses/>. from gi.repository import Gtk +from gi.repository import Gdk from gi.repository import GObject from gettext import gettext as _ @@ -87,7 +88,7 @@ def load(activity, voice, sorry=None): return False old_cursor = activity._cursor - activity.set_cursor(Gdk.WATCH) + activity.set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH)) def load_brain(): global _kernel @@ -58,7 +58,7 @@ class TextBox(Gtk.TextView): rise=-7 * Pango.SCALE) # in pixels self._empty = True self.palette = None - self._mouse_detector = MouseSpeedDetector(self, 200, 5) + self._mouse_detector = MouseSpeedDetector(200, 5) self._mouse_detector.connect('motion-slow', self.__mouse_slow_cb) self.modify_base(Gtk.StateType.NORMAL, bg_color.get_gdk_color()) @@ -84,7 +84,7 @@ class TextBox(Gtk.TextView): # Links can be activated by clicking. def __event_after_cb(self, widget, event): - if event.type != Gdk.BUTTON_RELEASE: + if event.type != Gdk.EventType.BUTTON_RELEASE: return False x, y = self.window_to_buffer_coords(Gtk.TextWindowType.WIDGET, @@ -158,14 +158,13 @@ class TextBox(Gtk.TextView): x, y = self.window_to_buffer_coords(Gtk.TextWindowType.WIDGET, int(event.x), int(event.y)) self.set_cursor_if_appropriate(x, y) - self.window.get_pointer() return False def __visibility_notify_cb(self, widget, event): # 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() + wx, wy = self.get_pointer() bx, by = self.window_to_buffer_coords(Gtk.TextWindowType.WIDGET, wx, wy) self.set_cursor_if_appropriate(bx, by) return False @@ -284,7 +283,7 @@ class ChatBox(Gtk.ScrolledWindow): self._add_log(nick, color, text, status_message) # Check for Right-To-Left languages: - if Pango.find_base_dir(nick, -1) == Pango.DIRECTION_RTL: + if Pango.find_base_dir(nick, -1) == Pango.Direction.RTL: lang_rtl = True else: lang_rtl = False @@ -314,14 +313,14 @@ class ChatBox(Gtk.ScrolledWindow): if not status_message: name = ColorLabel(text=nick + ':', color=text_color) name_vbox = Gtk.VBox() - name_vbox.pack_start(name, False, False) - rb.pack_start(name_vbox, False, False) + name_vbox.pack_start(name, False, False, 0) + rb.pack_start(name_vbox, False, False, 0) message = TextBox(text_color, color_fill, lang_rtl) vbox = Gtk.VBox() - vbox.pack_start(message, True, True) - rb.pack_start(vbox, True, True) + vbox.pack_start(message, True, True, 0) + rb.pack_start(vbox, True, True, 0) self._last_msg = message - self._conversation.pack_start(rb, False, False) + self._conversation.pack_start(rb, False, False, 0) message.add_text(text) self._conversation.show_all() @@ -335,7 +334,7 @@ class ChatBox(Gtk.ScrolledWindow): """ if adj.get_value() < self._scroll_value: self._scroll_auto = False - elif adj.get_value() == adj.upper - adj.page_size: + elif adj.get_value() == adj.get_upper() - adj.get_page_size(): self._scroll_auto = True def _scroll_changed_cb(self, adj, scroll=None): @@ -141,7 +141,9 @@ class View(Gtk.EventBox): if self._eyes: if pos is None: display = Gdk.Display() - screen_, x, y, modifiers_ = display.get_pointer() + # FIXME: Bug in gi + # screen_, x, y, modifiers_ = display.get_pointer() + x, y = self.get_pointer() else: x, y = pos map(lambda e, x=x, y=y: e.look_at(x, y), self._eyes) |