Commit 150d6125 authored by Dirk Wilden's avatar Dirk Wilden
Browse files

added option to specify dimension for snapshots

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6345 383ad7c9-94d9-4d36-a494-682f7c89f535
parent de35b2cd
......@@ -874,6 +874,7 @@ void
CoreWidget::startVideoCaptureDialog(){
VideoCaptureDialog* dialog = new VideoCaptureDialog();
dialog->setModal(false);
connect(dialog, SIGNAL(startVideoCapture(QString,int,bool)), this, SIGNAL(startVideoCapture(QString,int,bool)) );
connect(dialog, SIGNAL(resizeViewers(int,int)), this, SIGNAL(resizeViewers(int,int)) );
......
......@@ -268,7 +268,7 @@ void CoreWidget::applicationSnapshotDialog() {
suggest += format;
SnapshotDialog dialog(suggest, false, this);
SnapshotDialog dialog(suggest, false, 0);
int w = width();
int h = height();
......@@ -291,9 +291,9 @@ void CoreWidget::applicationSnapshotDialog() {
QPixmap pic = QPixmap::grabWindow( winId() );
pic.save(newName);
emit resizeApplication(w,h);
}
emit resizeApplication(w,h);
}
///Take a snapshot of the whole application
......@@ -348,7 +348,7 @@ void CoreWidget::viewerSnapshotDialog() {
suggest += format;
SnapshotDialog dialog(suggest, true, this);
SnapshotDialog dialog(suggest, true, 0);
int w = glView_->width();
int h = glView_->height();
......@@ -432,9 +432,8 @@ void CoreWidget::viewerSnapshotDialog() {
default: break;
}
glView_->resize(w, h);
}
glView_->resize(w, h);
}
///Take a snapshot of all viewers
......
......@@ -16,9 +16,18 @@ SnapshotDialog::SnapshotDialog(QString _suggest, bool _captureViewers, QWidget *
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()) );
connect(findButton, SIGNAL(clicked()), this, SLOT(findFile()) );
connect(resButton, SIGNAL(clicked()), this, SLOT(slotChangeResolution()) );
connect(okButton, SIGNAL(clicked()), this, SLOT(slotOk()) );
}
void SnapshotDialog::slotChangeResolution()
{
if ( captureViewers_ )
emit resizeViewers(snapWidth->value(), snapHeight->value());
else
emit resizeApplication(snapWidth->value(), snapHeight->value());
}
void SnapshotDialog::slotOk()
{
......
......@@ -14,6 +14,7 @@ class SnapshotDialog : public QDialog, public Ui::SnapshotDialog
private slots:
void slotOk();
void findFile();
void slotChangeResolution();
signals:
void resizeViewers(int _width, int _height);
......
......@@ -14,7 +14,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Start Video Capturing</string>
<string>Take Snapshot</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
......@@ -48,19 +48,6 @@
<string> Resolution </string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
......@@ -101,6 +88,26 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="resButton">
<property name="text">
<string>Change now</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......@@ -137,8 +144,6 @@
</item>
</layout>
</widget>
<resources>
<include location="../../../resources.qrc"/>
</resources>
<resources/>
<connections/>
</ui>
......@@ -11,9 +11,18 @@ VideoCaptureDialog::VideoCaptureDialog(QWidget *parent) : QDialog(parent)
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()) );
connect(findButton, SIGNAL(clicked()), this, SLOT(findFile()) );
connect(resButton, SIGNAL(clicked()), this, SLOT(slotChangeResolution()) );
connect(startButton, SIGNAL(clicked()), this, SLOT(slotStartVideoCapture()) );
}
void VideoCaptureDialog::slotChangeResolution()
{
if ( captureViewers->isChecked() )
emit resizeViewers(videoWidth->value(), videoHeight->value());
else
emit resizeApplication(videoWidth->value(), videoHeight->value());
}
void VideoCaptureDialog::slotStartVideoCapture()
{
......
......@@ -11,6 +11,7 @@ class VideoCaptureDialog : public QDialog, public Ui::VideoCaptureDialog
private slots:
void slotStartVideoCapture();
void findFile();
void slotChangeResolution();
signals:
void startVideoCapture(QString _baseName, int _fps, bool _captureViewers);
......
......@@ -9,7 +9,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>443</width>
<width>441</width>
<height>283</height>
</rect>
</property>
......@@ -93,15 +93,15 @@
<property name="title">
<string> Video Resolution </string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Width:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<item>
<widget class="QSpinBox" name="videoWidth">
<property name="minimum">
<number>100</number>
......@@ -114,14 +114,14 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Height:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item>
<widget class="QSpinBox" name="videoHeight">
<property name="minimum">
<number>100</number>
......@@ -134,6 +134,26 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="resButton">
<property name="text">
<string>Change now</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......@@ -170,8 +190,6 @@
</item>
</layout>
</widget>
<resources>
<include location="../../../resources.qrc"/>
</resources>
<resources/>
<connections/>
</ui>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment