summaryrefslogtreecommitdiffstats
path: root/ksnapshot/ksnapshotwidget.ui.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit47d455dd55be855e4cc691c32f687f723d9247ee (patch)
tree52e236aaa2576bdb3840ebede26619692fed6d7d /ksnapshot/ksnapshotwidget.ui.h
downloadtdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.tar.gz
tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksnapshot/ksnapshotwidget.ui.h')
-rw-r--r--ksnapshot/ksnapshotwidget.ui.h138
1 files changed, 138 insertions, 0 deletions
diff --git a/ksnapshot/ksnapshotwidget.ui.h b/ksnapshot/ksnapshotwidget.ui.h
new file mode 100644
index 00000000..d7e757f5
--- /dev/null
+++ b/ksnapshot/ksnapshotwidget.ui.h
@@ -0,0 +1,138 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions or slots use
+** Qt Designer which will update this file, preserving your code. Create an
+** init() function in place of a constructor, and a destroy() function in
+** place of a destructor.
+*****************************************************************************/
+
+
+void KSnapshotWidget::slotModeChanged( int mode )
+{
+ switch ( mode )
+ {
+ case 0:
+ cbIncludeDecorations->setEnabled(false);
+ break;
+ case 1:
+ cbIncludeDecorations->setEnabled(true);
+ break;
+ case 2:
+ cbIncludeDecorations->setEnabled(false);
+ break;
+ case 3:
+ cbIncludeDecorations->setEnabled(false);
+ break;
+ default:
+ break;
+ }
+
+ spinDelay->setEnabled(mode != 2);
+}
+
+
+void KSnapshotWidget::setPreview( const QPixmap &pm )
+{
+ QImage img = pm.convertToImage();
+ double r1 = ( ( double ) pm.height() ) / pm.width();
+ if ( r1 * previewWidth() < previewHeight() )
+ img = img.smoothScale( previewWidth(),
+ int( previewWidth() * r1 ),
+ QImage::ScaleMin );
+ else
+ img = img.smoothScale( ( int ) ( ( ( double )previewHeight() ) / r1 ),
+ previewHeight(), QImage::ScaleMin );
+
+ QToolTip::remove( lblImage );
+ QToolTip::add( lblImage,
+ QString( "Preview of the snapshot image (%1 x %2)" )
+ .arg( pm.width() ).arg( pm.height() ) );
+
+ lblImage->setPixmap( img );
+ lblImage->adjustSize();
+}
+
+
+void KSnapshotWidget::setDelay( int i )
+{
+ spinDelay->setValue(i);
+}
+
+
+void KSnapshotWidget::setIncludeDecorations( bool b )
+{
+ cbIncludeDecorations->setChecked(b);
+}
+
+
+void KSnapshotWidget::setMode( int mode )
+{
+ comboMode->setCurrentItem(mode);
+ slotModeChanged(mode);
+}
+
+
+int KSnapshotWidget::delay()
+{
+ return spinDelay->value();
+}
+
+
+bool KSnapshotWidget::includeDecorations()
+{
+ return cbIncludeDecorations->isChecked();
+}
+
+
+int KSnapshotWidget::mode()
+{
+ return comboMode->currentItem();
+}
+
+
+void KSnapshotWidget::slotNewClicked()
+{
+ emit newClicked();
+}
+
+
+void KSnapshotWidget::slotSaveClicked()
+{
+ emit saveClicked();
+}
+
+
+void KSnapshotWidget::slotPrintClicked()
+{
+ emit printClicked();
+}
+
+
+void KSnapshotWidget::slotStartDrag()
+{
+ emit startImageDrag();
+}
+
+
+QPixmap KSnapshotWidget::preview()
+{
+ return *lblImage->pixmap();
+}
+
+
+int KSnapshotWidget::previewWidth()
+{
+ return lblImage->width();
+}
+
+
+int KSnapshotWidget::previewHeight()
+{
+ return lblImage->height();
+}
+
+void KSnapshotWidget::slotCopyClicked()
+{
+ emit copyClicked();
+}