Skip to content
Snippets Groups Projects
Commit c09617c7 authored by Marlin Frickenschmidt's avatar Marlin Frickenschmidt
Browse files

Fixed minor bugs in snapshot dialog and added better display for light sources (on or off).

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10255 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0cbd4e65
Branches
Tags
No related merge requests found
...@@ -60,8 +60,9 @@ ...@@ -60,8 +60,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void Core::startVideoCapture(QString _baseName, int _fps, bool _captureViewers) { void Core::startVideoCapture(QString _baseName, int _fps, bool _captureViewers) {
connect( &videoTimer_ , SIGNAL(timeout()), this, SLOT( viewUpdated() ) ,Qt::DirectConnection ); connect( &videoTimer_ , SIGNAL(timeout()), this, SLOT( viewUpdated() ) ,Qt::DirectConnection );
// set track auf true; // set track to true;
videoTimer_.setSingleShot(false); videoTimer_.setSingleShot(false);
// 25 fps // 25 fps
...@@ -85,7 +86,7 @@ void Core::startVideoCapture(QString _baseName, int _fps, bool _captureViewers) ...@@ -85,7 +86,7 @@ void Core::startVideoCapture(QString _baseName, int _fps, bool _captureViewers)
void Core::captureVideo() { void Core::captureVideo() {
int elapsed = lastVideoTime_.elapsed(); int elapsed = lastVideoTime_.elapsed();
if ( elapsed < 40 ) { if ( elapsed < videoTimer_.interval() ) {
// std::cerr << "Too early to capture" << std::endl; // std::cerr << "Too early to capture" << std::endl;
return; return;
} }
......
...@@ -64,6 +64,7 @@ SnapshotDialog::SnapshotDialog(QString _suggest, bool _captureViewers, int _w, i ...@@ -64,6 +64,7 @@ SnapshotDialog::SnapshotDialog(QString _suggest, bool _captureViewers, int _w, i
resButton->setDisabled(captureViewers_); resButton->setDisabled(captureViewers_);
keepAspect->setDisabled(!captureViewers_); keepAspect->setDisabled(!captureViewers_);
transparent->setDisabled(!captureViewers_); transparent->setDisabled(!captureViewers_);
hideCoordsys->setDisabled(!captureViewers_);
multisampling->setDisabled(!captureViewers_); multisampling->setDisabled(!captureViewers_);
num_samples->setDisabled(!captureViewers_); num_samples->setDisabled(!captureViewers_);
...@@ -75,6 +76,8 @@ SnapshotDialog::SnapshotDialog(QString _suggest, bool _captureViewers, int _w, i ...@@ -75,6 +76,8 @@ SnapshotDialog::SnapshotDialog(QString _suggest, bool _captureViewers, int _w, i
connect(snapWidth, SIGNAL(valueChanged(int)), this, SLOT(snapWidthChanged(int)) ); connect(snapWidth, SIGNAL(valueChanged(int)), this, SLOT(snapWidthChanged(int)) );
connect(snapHeight, SIGNAL(valueChanged(int)), this, SLOT(snapHeightChanged(int)) ); connect(snapHeight, SIGNAL(valueChanged(int)), this, SLOT(snapHeightChanged(int)) );
connect(keepAspect, SIGNAL(stateChanged(int)), this, SLOT(keepAspectChanged()) );
connect(multisampling, SIGNAL(stateChanged(int)), this, SLOT(multisampleChanged()) );
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()) ); connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()) );
connect(findButton, SIGNAL(clicked()), this, SLOT(findFile()) ); connect(findButton, SIGNAL(clicked()), this, SLOT(findFile()) );
...@@ -126,6 +129,18 @@ void SnapshotDialog::snapHeightChanged(int _h) { ...@@ -126,6 +129,18 @@ void SnapshotDialog::snapHeightChanged(int _h) {
} }
} }
void SnapshotDialog::keepAspectChanged() {
if(keepAspect->isChecked()) {
blockSpinBox_ = true;
snapHeight->setValue((int)((double)snapWidth->value() / aspect_));
blockSpinBox_ = false;
}
}
void SnapshotDialog::multisampleChanged() {
num_samples->setDisabled (!multisampling->isChecked());
}
void SnapshotDialog::slotChangeResolution() void SnapshotDialog::slotChangeResolution()
{ {
if ( !captureViewers_ ) if ( !captureViewers_ )
......
...@@ -63,6 +63,8 @@ class SnapshotDialog : public QDialog, public Ui::SnapshotDialog ...@@ -63,6 +63,8 @@ class SnapshotDialog : public QDialog, public Ui::SnapshotDialog
void snapWidthChanged(int _w); void snapWidthChanged(int _w);
void snapHeightChanged(int _h); void snapHeightChanged(int _h);
void keepAspectChanged();
void multisampleChanged();
void saveStates(); void saveStates();
void loadStates(); void loadStates();
......
...@@ -129,6 +129,17 @@ ...@@ -129,6 +129,17 @@
</item> </item>
<item row="3" column="2"> <item row="3" column="2">
<widget class="QPushButton" name="resButton"> <widget class="QPushButton" name="resButton">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Changes the resolution of the application window and thus of the snapshot taken. It will be reset to its original value when this dialog is closed.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;This will not work when the application is maximized or fullscreen.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Only available when taking application snapshots.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text"> <property name="text">
<string>Change Resolution</string> <string>Change Resolution</string>
</property> </property>
...@@ -170,6 +181,10 @@ ...@@ -170,6 +181,10 @@
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QCheckBox" name="multisampling"> <widget class="QCheckBox" name="multisampling">
<property name="toolTip">
<string>Activating this option will render the image with the given number of samples.
Deactivating this option will use only one sample.</string>
</property>
<property name="text"> <property name="text">
<string>Multisampling:</string> <string>Multisampling:</string>
</property> </property>
...@@ -180,6 +195,10 @@ ...@@ -180,6 +195,10 @@
</item> </item>
<item> <item>
<widget class="QSpinBox" name="num_samples"> <widget class="QSpinBox" name="num_samples">
<property name="toolTip">
<string>Number of samples for multisampling.
Allowed values: any number between 2 and 16.</string>
</property>
<property name="minimum"> <property name="minimum">
<number>2</number> <number>2</number>
</property> </property>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment