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