From 0c1dd44cd66dde63bfd33b6eb58d90342cefcb64 Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Wed, 14 Nov 2012 20:58:48 -0500 Subject: [PATCH] Simplify cross-platform clipboard code in gtk add torrent dialog. --- deluge/ui/gtkui/addtorrentdialog.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py index 256710565..84ea16e57 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -647,15 +647,8 @@ class AddTorrentDialog(component.Component): dialog.set_transient_for(self.dialog) entry.grab_focus() - if deluge.common.windows_check(): - import win32clipboard as clip - import win32con - clip.OpenClipboard() - text = clip.GetClipboardData(win32con.CF_UNICODETEXT) - clip.CloseClipboard() - else: - clip = gtk.clipboard_get(selection='PRIMARY') - text = clip.wait_for_text() + text = (gtk.clipboard_get(selection='PRIMARY').wait_for_text() or + gtk.clipboard_get().wait_for_text()) if text: text = text.strip() if deluge.common.is_url(text) or deluge.common.is_magnet(text):