Corrected and extended the screenshot tool.

Thu, 05 Dec 2013 18:57:27 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 05 Dec 2013 18:57:27 +0100
changeset 3129
138331f6b0a0
parent 3128
2d4ccc459f7e
child 3130
dedfdf09c4c3

Corrected and extended the screenshot tool.

Snapshot/SnapWidget.py file | annotate | diff | comparison | revisions
Snapshot/SnapWidget.ui file | annotate | diff | comparison | revisions
--- a/Snapshot/SnapWidget.py	Thu Dec 05 18:56:14 2013 +0100
+++ b/Snapshot/SnapWidget.py	Thu Dec 05 18:57:27 2013 +0100
@@ -49,6 +49,7 @@
         self.saveButton.setIcon(UI.PixmapCache.getIcon("fileSaveAs.png"))
         self.takeButton.setIcon(UI.PixmapCache.getIcon("cameraPhoto.png"))
         self.copyButton.setIcon(UI.PixmapCache.getIcon("editCopy.png"))
+        self.copyPreviewButton.setIcon(UI.PixmapCache.getIcon("editCopy.png"))
         self.setWindowIcon(UI.PixmapCache.getIcon("ericSnap.png"))
         
         self.modeCombo.addItem(self.trUtf8("Fullscreen"),
@@ -402,12 +403,21 @@
         
         self.saveButton.setEnabled(not self.__snapshot.isNull())
         self.copyButton.setEnabled(not self.__snapshot.isNull())
+        self.copyPreviewButton.setEnabled(not self.__snapshot.isNull())
     
     @pyqtSlot()
     def on_copyButton_clicked(self):
         """
         Private slot to copy the snapshot to the clipboard.
         """
+        if not self.__snapshot.isNull():
+            QApplication.clipboard().setPixmap(QPixmap(self.__snapshot))
+    
+    @pyqtSlot()
+    def on_copyPreviewButton_clicked(self):
+        """
+        Private slot to copy the snapshot preview to the clipboard.
+        """
         QApplication.clipboard().setPixmap(self.preview.pixmap())
     
     def __captured(self, pixmap):
--- a/Snapshot/SnapWidget.ui	Thu Dec 05 18:56:14 2013 +0100
+++ b/Snapshot/SnapWidget.ui	Thu Dec 05 18:57:27 2013 +0100
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>450</width>
-    <height>350</height>
+    <width>500</width>
+    <height>400</height>
    </rect>
   </property>
   <property name="minimumSize">
@@ -187,13 +187,26 @@
       </widget>
      </item>
      <item>
+      <widget class="QPushButton" name="copyPreviewButton">
+       <property name="enabled">
+        <bool>false</bool>
+       </property>
+       <property name="toolTip">
+        <string>Press to copy the snapshot preview to the clipboard</string>
+       </property>
+       <property name="text">
+        <string>Copy &amp;Preview</string>
+       </property>
+      </widget>
+     </item>
+     <item>
       <spacer name="horizontalSpacer_5">
        <property name="orientation">
         <enum>Qt::Horizontal</enum>
        </property>
        <property name="sizeHint" stdset="0">
         <size>
-         <width>40</width>
+         <width>28</width>
          <height>20</height>
         </size>
        </property>
@@ -224,9 +237,10 @@
   <tabstop>modeCombo</tabstop>
   <tabstop>delaySpin</tabstop>
   <tabstop>takeButton</tabstop>
+  <tabstop>pathNameEdit</tabstop>
   <tabstop>saveButton</tabstop>
   <tabstop>copyButton</tabstop>
-  <tabstop>pathNameEdit</tabstop>
+  <tabstop>copyPreviewButton</tabstop>
  </tabstops>
  <resources/>
  <connections/>

eric ide

mercurial