Snapshot/SnapWidget.py

branch
Py2 comp.
changeset 3142
55030c09e142
parent 3060
5883ce99ee12
parent 3129
138331f6b0a0
child 3145
a9de05d4a22f
equal deleted inserted replaced
3141:72f3bde98c58 3142:55030c09e142
49 self.setupUi(self) 49 self.setupUi(self)
50 50
51 self.saveButton.setIcon(UI.PixmapCache.getIcon("fileSaveAs.png")) 51 self.saveButton.setIcon(UI.PixmapCache.getIcon("fileSaveAs.png"))
52 self.takeButton.setIcon(UI.PixmapCache.getIcon("cameraPhoto.png")) 52 self.takeButton.setIcon(UI.PixmapCache.getIcon("cameraPhoto.png"))
53 self.copyButton.setIcon(UI.PixmapCache.getIcon("editCopy.png")) 53 self.copyButton.setIcon(UI.PixmapCache.getIcon("editCopy.png"))
54 self.copyPreviewButton.setIcon(UI.PixmapCache.getIcon("editCopy.png"))
54 self.setWindowIcon(UI.PixmapCache.getIcon("ericSnap.png")) 55 self.setWindowIcon(UI.PixmapCache.getIcon("ericSnap.png"))
55 56
56 self.modeCombo.addItem(self.trUtf8("Fullscreen"), 57 self.modeCombo.addItem(self.trUtf8("Fullscreen"),
57 SnapWidget.ModeFullscreen) 58 SnapWidget.ModeFullscreen)
58 self.modeCombo.addItem(self.trUtf8("Rectangular Selection"), 59 self.modeCombo.addItem(self.trUtf8("Rectangular Selection"),
402 self.show() 403 self.show()
403 self.raise_() 404 self.raise_()
404 405
405 self.saveButton.setEnabled(not self.__snapshot.isNull()) 406 self.saveButton.setEnabled(not self.__snapshot.isNull())
406 self.copyButton.setEnabled(not self.__snapshot.isNull()) 407 self.copyButton.setEnabled(not self.__snapshot.isNull())
408 self.copyPreviewButton.setEnabled(not self.__snapshot.isNull())
407 409
408 @pyqtSlot() 410 @pyqtSlot()
409 def on_copyButton_clicked(self): 411 def on_copyButton_clicked(self):
410 """ 412 """
411 Private slot to copy the snapshot to the clipboard. 413 Private slot to copy the snapshot to the clipboard.
414 """
415 if not self.__snapshot.isNull():
416 QApplication.clipboard().setPixmap(QPixmap(self.__snapshot))
417
418 @pyqtSlot()
419 def on_copyPreviewButton_clicked(self):
420 """
421 Private slot to copy the snapshot preview to the clipboard.
412 """ 422 """
413 QApplication.clipboard().setPixmap(self.preview.pixmap()) 423 QApplication.clipboard().setPixmap(self.preview.pixmap())
414 424
415 def __captured(self, pixmap): 425 def __captured(self, pixmap):
416 """ 426 """

eric ide

mercurial