changeset 113:04f8cf1558c1

Add a menu item to copy the selected article's link to the clipboard
author Dirk Olmes <dirk@xanthippe.ping.de>
date Fri, 29 Apr 2011 12:15:57 +0200
parents e4038dd8cc0e
children b0290ab29483
files MainWindow.py Ui_MainWindow.ui
diffstat 2 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MainWindow.py	Thu Mar 31 03:50:46 2011 +0200
+++ b/MainWindow.py	Fri Apr 29 12:15:57 2011 +0200
@@ -8,6 +8,7 @@
 from Preferences import Preferences
 from PreferencesDialog import PreferencesDialog
 from PyQt4.QtCore import QUrl
+from PyQt4.QtGui import QApplication
 from PyQt4.QtGui import QMainWindow
 from PyQt4.QtGui import QWidget
 from Ui_MainWindow import Ui_MainWindow
@@ -179,3 +180,7 @@
         # save all uncommitted state, just in case
         self.session.commit()
         QMainWindow.close(self)
+
+    def copyArticleURLToClipboard(self):
+        clipboard = QApplication.clipboard()
+        clipboard.setText(self.selectedEntry.link)
--- a/Ui_MainWindow.ui	Thu Mar 31 03:50:46 2011 +0200
+++ b/Ui_MainWindow.ui	Fri Apr 29 12:15:57 2011 +0200
@@ -95,6 +95,7 @@
     <addaction name="actionMarkSelectedRead"/>
     <addaction name="actionOpenLink"/>
     <addaction name="actionOpenInBrowser"/>
+    <addaction name="actionCopyArticleURL"/>
    </widget>
    <widget class="QMenu" name="menuFeedworm">
     <property name="title">
@@ -229,6 +230,14 @@
     <string>Mark selected read</string>
    </property>
   </action>
+  <action name="actionCopyArticleURL">
+   <property name="text">
+    <string>Copy article URL</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Shift+C</string>
+   </property>
+  </action>
  </widget>
  <customwidgets>
   <customwidget>
@@ -449,6 +458,22 @@
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>actionCopyArticleURL</sender>
+   <signal>activated()</signal>
+   <receiver>MainWindow</receiver>
+   <slot>copyArticleURLToClipboard()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>495</x>
+     <y>374</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>addFeed()</slot>
@@ -463,5 +488,6 @@
   <slot>deleteFeed()</slot>
   <slot>feedEntryDoubleClicked()</slot>
   <slot>markSelectedEntriesRead()</slot>
+  <slot>copyArticleURLToClipboard()</slot>
  </slots>
 </ui>