fix clipbord

This commit is contained in:
Denis Fomin 2013-01-03 21:21:38 +04:00
parent 220d2d6434
commit 8214d37d21
2 changed files with 4 additions and 5 deletions

View File

@ -856,8 +856,7 @@ class ConversationTextview(GObject.GObject):
finish_sel = iter_.copy() finish_sel = iter_.copy()
if not finish_sel.ends_word(): if not finish_sel.ends_word():
finish_sel.forward_word_end() finish_sel.forward_word_end()
self.selected_phrase = buffer_.get_text(start_sel, finish_sel, True).decode( self.selected_phrase = buffer_.get_text(start_sel, finish_sel, True)
'utf-8')
def on_open_link_activate(self, widget, kind, text): def on_open_link_activate(self, widget, kind, text):
helpers.launch_browser_mailer(kind, text) helpers.launch_browser_mailer(kind, text)
@ -970,8 +969,7 @@ class ConversationTextview(GObject.GObject):
# it's a JID or mail # it's a JID or mail
kind = 'sth_at_sth' kind = 'sth_at_sth'
else: else:
word = self.tv.get_buffer().get_text(begin_iter, end_iter, True).decode( word = self.tv.get_buffer().get_text(begin_iter, end_iter, True)
'utf-8')
if event.button == 3: # right click if event.button == 3: # right click
self.make_link_menu(event, kind, word) self.make_link_menu(event, kind, word)

View File

@ -904,7 +904,8 @@ class HtmlTextView(Gtk.TextView):
# textview can be hidden while we add a new line in it. # textview can be hidden while we add a new line in it.
if self.has_screen(): if self.has_screen():
clipboard = self.get_clipboard(Gdk.SELECTION_PRIMARY) clipboard = self.get_clipboard(Gdk.SELECTION_PRIMARY)
clipboard.set_text(self.get_selected_text()) text = self.get_selected_text()
clipboard.set_text(text, len(text))
def get_selected_text(self): def get_selected_text(self):
bounds = self.get_buffer().get_selection_bounds() bounds = self.get_buffer().get_selection_bounds()