diff options
author | Philipp Hörist <forenjunkie@chello.at> | 2017-03-01 00:41:05 +0300 |
---|---|---|
committer | Philipp Hörist <forenjunkie@chello.at> | 2017-03-01 00:41:05 +0300 |
commit | 547fda1b667312a2b3d8e201cd42efd30571ddf7 (patch) | |
tree | 96888046c42ff221df23157d4f8590cd3934a163 /omemo | |
parent | 11fb760a4df23f63a78cb63de565b54ae9a75556 (diff) |
[omemo] Fix 'Copy to clipboard'
Diffstat (limited to 'omemo')
-rw-r--r-- | omemo/fpr_dialog.ui | 2 | ||||
-rw-r--r-- | omemo/ui.py | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/omemo/fpr_dialog.ui b/omemo/fpr_dialog.ui index 969aebe..73c18d4 100644 --- a/omemo/fpr_dialog.ui +++ b/omemo/fpr_dialog.ui @@ -292,6 +292,8 @@ <object class="GtkMenuItem" id="copyfprclipboard_item"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="label" translatable="yes">Copy to clipboard</property> + <property name="use_underline">True</property> <signal name="activate" handler="clipboard_button_cb" swapped="no"/> </object> </child> diff --git a/omemo/ui.py b/omemo/ui.py index 464913c..1da35f0 100644 --- a/omemo/ui.py +++ b/omemo/ui.py @@ -23,7 +23,7 @@ import logging import os
import message_control
-from gi.repository import GObject, Gtk, GdkPixbuf
+from gi.repository import GObject, Gtk, GdkPixbuf, Gdk
# pylint: disable=import-error
import gtkgui_helpers
@@ -539,7 +539,7 @@ class OMEMOConfigDialog(GajimPluginConfigDialog): keep_selection = tw.get_selection().path_is_selected(pthinfo[0])
pop = self.B.get_object('fprclipboard_menu')
- pop.popup(None, None, None, event.button, event.time)
+ pop.popup(None, None, None, None, event.button, event.time)
# keep_selection=True -> no further processing of click event
# keep_selection=False-> further processing -> GTK usually selects
@@ -553,9 +553,9 @@ class OMEMOConfigDialog(GajimPluginConfigDialog): for path in paths:
it = mod.get_iter(path)
jid, fpr = mod.get(it, 1, 3)
- fprs.append('%s: %s' % (jid, fpr[4:-5]))
- Gtk.Clipboard().set_text('\n'.join(fprs))
- Gtk.Clipboard(selection='PRIMARY').set_text('\n'.join(fprs))
+ fprs.append('%s: %s' % (jid, fpr[31:-12]))
+ clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
+ clipboard.set_text('\n'.join(fprs), -1)
def update_context_list(self):
self.fpr_model.clear()
@@ -744,7 +744,7 @@ class FingerprintWindow(Gtk.Dialog): keep_selection = tw.get_selection().path_is_selected(pthinfo[0])
pop = self.xml.get_object('fprclipboard_menu')
- pop.popup(None, None, None, event.button, event.time)
+ pop.popup(None, None, None, None, event.button, event.time)
# keep_selection=True -> no further processing of click event
# keep_selection=False-> further processing -> GTK usually selects
@@ -762,8 +762,8 @@ class FingerprintWindow(Gtk.Dialog): it = mod.get_iter(path)
jid, fpr = mod.get(it, 1, 3)
fprs.append('%s: %s' % (jid, fpr[31:-12]))
- Gtk.Clipboard().set_text('\n'.join(fprs))
- Gtk.Clipboard(selection='PRIMARY').set_text('\n'.join(fprs))
+ clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
+ clipboard.set_text('\n'.join(fprs), -1)
def update_context_list(self, *args):
self.fpr_model.clear()
|