Commit 6ec9392d authored by Mathieu Westphal's avatar Mathieu Westphal

Enable use of continuous flush

Continous flush options was available, however not accessible.
This commit add a checkbox to control this options,
Modify slughtly the signal api so it is standardized and actually use the signal
in the only provided observer.
When true, continuous flush ensure that events are written on file
as sson as they are recorded.
parent e16e3c0c
......@@ -74,7 +74,8 @@ public slots:
signals:
void eventRecorded(const QString& Widget,
const QString& Command,
const QString& Arguments);
const QString& Arguments,
const int& eventType);
protected:
QTextStream* Stream;
......
......@@ -68,13 +68,13 @@ void pqEventRecorder::setContinuousFlush(bool value)
if (value)
{
QObject::connect(this->ActiveObserver,
SIGNAL(eventRecorded(QString,QString,QString)),
SIGNAL(eventRecorded(QString,QString,QString, int)),
this, SLOT(flush()));
}
else
{
QObject::disconnect(this->ActiveObserver,
SIGNAL(eventRecorded(QString,QString,QString)),
SIGNAL(eventRecorded(QString,QString,QString, int)),
this, SLOT(flush()));
}
this->ContinuousFlush = value;
......
......@@ -63,7 +63,6 @@ public:
explicit pqEventRecorder(QObject *parent = 0);
~pqEventRecorder();
void setContinuousFlush(bool value);
bool continuousFlush() const;
void setFile(QIODevice* file);
......@@ -105,6 +104,13 @@ public slots:
// Connection signal into the correct slots
void check(bool value);
// Set the continuous flush value
// and connect/disconnect the current observer with
// this recorder
// If true, events are written on file as soon
// as they are recorded.
void setContinuousFlush(bool value);
protected:
pqEventObserver* ActiveObserver;
pqEventTranslator* ActiveTranslator;
......
......@@ -7,7 +7,7 @@
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
......@@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
////////////////////////////////////////////////////////////////////////////////////
// pqPythonEventObserver
pqPythonEventObserver::pqPythonEventObserver(QObject* p)
pqPythonEventObserver::pqPythonEventObserver(QObject* p)
: pqEventObserver(p)
{
}
......@@ -81,5 +81,7 @@ void pqPythonEventObserver::onRecordEvent(
pycommand = pycommand.arg(Arguments);
pycommand = pycommand.arg(eventType);
*this->Stream << pycommand << "\n";
emit eventRecorded(widget, command, arguments, eventType);
}
}
......@@ -107,6 +107,11 @@ pqRecordEventsDialog::pqRecordEventsDialog(pqEventRecorder* recorder,
this->Implementation->Recorder,
SLOT(unpause(bool)));
QObject::connect(this->Implementation->Ui.continuousFlush,
SIGNAL(toggled(bool)),
this->Implementation->Recorder,
SLOT(setContinuousFlush(bool)));
QObject::connect(this->Implementation->Recorder,
SIGNAL(started()),
this,
......
......@@ -241,6 +241,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="continuousFlush">
<property name="text">
<string>Continuous Flush</string>
</property>
<property name="toolTip">
<string>Write events to file as soon as they are recorded</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<property name="spacing">
......
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