Skip to content

Commit

Permalink
QML UI: Copy feed URL to clipboard menu item (bug 1916)
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Jun 28, 2014
1 parent f35c546 commit 4c0bfa5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gpodder/qmlui/__init__.py
Expand Up @@ -21,7 +21,7 @@
# Thomas Perl <thp@gpodder.org>; 2011-02-06


from PySide.QtGui import QApplication
from PySide.QtGui import QApplication, QClipboard
from PySide.QtCore import Qt, QObject, Signal, Slot, Property, QUrl
from PySide.QtCore import QAbstractListModel, QModelIndex
from PySide.QtDeclarative import QDeclarativeView
Expand Down Expand Up @@ -491,6 +491,7 @@ def podcastContextMenu(self, podcast):
menu.append(helper.Action(_('Update'), 'update', podcast))
menu.append(helper.Action(_('Mark episodes as old'), 'mark-as-read', podcast))
menu.append(helper.Action(_('Rename'), 'rename-podcast', podcast))
menu.append(helper.Action(_('Copy URL to clipboard'), 'copy-url-clipboard', podcast))
menu.append(helper.Action(_('Change section'), 'change-section', podcast))
menu.append(helper.Action(_('Unsubscribe'), 'unsubscribe', podcast))

Expand Down Expand Up @@ -651,6 +652,10 @@ def title_changer(podcast):
self.root.resort_podcast_list()

self.start_input_dialog(title_changer(action.target))
elif action.action == 'copy-url-clipboard':
clipboard = QClipboard()
clipboard.setText(action.target.url)
self.showMessage.emit(_('Copied to clipboard: %(url)s') % {'url': action.target.url})

def confirm_action(self, message, affirmative, callback,
negative_callback=None):
Expand Down

0 comments on commit 4c0bfa5

Please sign in to comment.