Commit 2e720a59 authored by Benjamin Long's avatar Benjamin Long

Fix Bug/Style into player widget:

--> Inverse minus and plus position - bug #144
--> Add ToolTip - bug #143
--> Fix Final value to progress bar - bug #141
--> Enable step by step mode from scratch
--> Modified icons, to have free icons
--> Fix Gui issues
parent 98b4a860
Resources/Icons/info.png

12.6 KB | W: | H:

Resources/Icons/info.png

413 Bytes | W: | H:

Resources/Icons/info.png
Resources/Icons/info.png
Resources/Icons/info.png
Resources/Icons/info.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -4,10 +4,9 @@ ...@@ -4,10 +4,9 @@
<file>Icons/pause.png</file> <file>Icons/pause.png</file>
<file>Icons/repeat.png</file> <file>Icons/repeat.png</file>
<file>Icons/timePlay.png</file> <file>Icons/timePlay.png</file>
<file>Icons/stop.png</file>
<file>Icons/clear.svg</file> <file>Icons/clear.svg</file>
<file>Icons/info.png</file>
<file>Icons/minus.png</file> <file>Icons/minus.png</file>
<file>Icons/plus.png</file> <file>Icons/plus.png</file>
<file>Icons/info.png</file>
</qresource> </qresource>
</RCC> </RCC>
...@@ -153,17 +153,18 @@ void pqEventDispatcher::setTimeStep(int value) ...@@ -153,17 +153,18 @@ void pqEventDispatcher::setTimeStep(int value)
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void pqEventDispatcher::pause() void pqEventDispatcher::run(bool value)
{ {
this->PlayBackPaused = true; qDebug() << "Dispatcher" << value;
emit this->paused(); this->PlayBackPaused = !value;
} if (value)
{
//----------------------------------------------------------------------------- emit this->restarted();
void pqEventDispatcher::restart() }
{ else
this->PlayBackPaused = false; {
emit this->restarted(); emit this->paused();
}
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -225,7 +226,6 @@ bool pqEventDispatcher::playEvents(pqEventSource& source, pqEventPlayer& player) ...@@ -225,7 +226,6 @@ bool pqEventDispatcher::playEvents(pqEventSource& source, pqEventPlayer& player)
this->PlayBackFinished = false; this->PlayBackFinished = false;
while (!this->PlayBackFinished) while (!this->PlayBackFinished)
{ {
// qDebug() << "while Loop";
if(!this->PlayBackPaused) if(!this->PlayBackPaused)
{ {
this->playEvent(); this->playEvent();
......
...@@ -128,8 +128,7 @@ public slots: ...@@ -128,8 +128,7 @@ public slots:
/// Change the TimeStep /// Change the TimeStep
void setTimeStep(int value); void setTimeStep(int value);
/// Method to be able to stop/pause/play the current playback script /// Method to be able to stop/pause/play the current playback script
void pause(); void run(bool value);
void restart();
void stop(); void stop();
void oneStep(); void oneStep();
......
...@@ -106,6 +106,8 @@ void pqPlayBackEventsDialog::pqImplementation::init(pqPlayBackEventsDialog* dial ...@@ -106,6 +106,8 @@ void pqPlayBackEventsDialog::pqImplementation::init(pqPlayBackEventsDialog* dial
this->Ui.loadFileButton->setIcon( this->Ui.loadFileButton->setIcon(
QApplication::style()->standardIcon(QStyle::SP_DirOpenIcon)); QApplication::style()->standardIcon(QStyle::SP_DirOpenIcon));
this->Ui.stopButton->setIcon(
QApplication::style()->standardIcon(QStyle::SP_MediaStop));
this->Ui.playerErrorTextLabel->setVisible(false); this->Ui.playerErrorTextLabel->setVisible(false);
this->Ui.playerErrorIconLabel->setVisible(false); this->Ui.playerErrorIconLabel->setVisible(false);
...@@ -140,18 +142,22 @@ void pqPlayBackEventsDialog::pqImplementation::init(pqPlayBackEventsDialog* dial ...@@ -140,18 +142,22 @@ void pqPlayBackEventsDialog::pqImplementation::init(pqPlayBackEventsDialog* dial
QObject::connect(this->Ui.minusButton, SIGNAL(clicked()), QObject::connect(this->Ui.minusButton, SIGNAL(clicked()),
dialog, SLOT(removeFiles())); dialog, SLOT(removeFiles()));
QObject::connect(this->Ui.playPauseButton, SIGNAL(clicked(bool)), QObject::connect(this->Ui.playPauseButton, SIGNAL(toggled(bool)),
dialog, SLOT(onPlayOrPause(bool))); dialog, SLOT(onPlayOrPause(bool)));
QObject::connect(this->Ui.playPauseButton, SIGNAL(toggled(bool)),
&this->Dispatcher, SLOT(run(bool)));
QObject::connect(this->Ui.stopButton, SIGNAL(clicked()), QObject::connect(this->Ui.stopButton, SIGNAL(clicked()),
this->TestUtility, SLOT(stopTests())); this->TestUtility, SLOT(stopTests()));
QObject::connect(this->Ui.stepButton, SIGNAL(clicked()), QObject::connect(this->Ui.stepButton, SIGNAL(clicked()),
&this->Dispatcher, SLOT(oneStep())); dialog, SLOT(onOneStep()));
QObject::connect(this->TestUtility, SIGNAL(started(QString)), QObject::connect(this->TestUtility, SIGNAL(started(QString)),
dialog, SLOT(onStarted(QString))); dialog, SLOT(onStarted(QString)));
QObject::connect(this->TestUtility, SIGNAL(started()),
dialog, SLOT(onStarted()));
QObject::connect(this->TestUtility, SIGNAL(stopped()), QObject::connect(this->TestUtility, SIGNAL(stopped()),
dialog, SLOT(updateUi())); dialog, SLOT(onStopped()));
QObject::connect(&this->Dispatcher, SIGNAL(paused()), QObject::connect(&this->Dispatcher, SIGNAL(paused()),
dialog, SLOT(updateUi())); dialog, SLOT(updateUi()));
QObject::connect(&this->Dispatcher, SIGNAL(restarted()), QObject::connect(&this->Dispatcher, SIGNAL(restarted()),
...@@ -292,6 +298,7 @@ void pqPlayBackEventsDialog::removeFiles() ...@@ -292,6 +298,7 @@ void pqPlayBackEventsDialog::removeFiles()
this->Implementation->Ui.tableWidget->removeRow(index); this->Implementation->Ui.tableWidget->removeRow(index);
this->Implementation->Filenames.removeAt(index); this->Implementation->Filenames.removeAt(index);
} }
this->updateUi();
} }
} }
...@@ -318,6 +325,7 @@ void pqPlayBackEventsDialog::addFile(const QString& filename) ...@@ -318,6 +325,7 @@ void pqPlayBackEventsDialog::addFile(const QString& filename)
this->Implementation->setProgressBarValue(newIndex, 0); this->Implementation->setProgressBarValue(newIndex, 0);
QCheckBox* check = new QCheckBox(this->Implementation->Ui.tableWidget); QCheckBox* check = new QCheckBox(this->Implementation->Ui.tableWidget);
check->setChecked(true); check->setChecked(true);
QObject::connect(check, SIGNAL(toggled(bool)), this, SLOT(updateUi()));
this->Implementation->Ui.tableWidget->setCellWidget(newIndex, 0, check); this->Implementation->Ui.tableWidget->setCellWidget(newIndex, 0, check);
this->updateUi(); this->updateUi();
} }
...@@ -325,21 +333,30 @@ void pqPlayBackEventsDialog::addFile(const QString& filename) ...@@ -325,21 +333,30 @@ void pqPlayBackEventsDialog::addFile(const QString& filename)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void pqPlayBackEventsDialog::onPlayOrPause(bool playOrPause) void pqPlayBackEventsDialog::onPlayOrPause(bool playOrPause)
{ {
if(playOrPause) if (this->Implementation->TestUtility->playingTest() ||
!playOrPause)
{ {
if(!this->Implementation->TestUtility->playingTest()) return;
{ }
QStringList newList = this->selectedFileNames();
this->Implementation->TestUtility->playTests(newList); QStringList newList = this->selectedFileNames();
} this->Implementation->TestUtility->playTests(newList);
else }
{
this->Implementation->Dispatcher.restart(); // ----------------------------------------------------------------------------
} void pqPlayBackEventsDialog::onOneStep()
{
this->Implementation->Ui.playPauseButton->setChecked(false);
if (!this->Implementation->TestUtility->playingTest())
{
this->Implementation->Dispatcher.run(false);
this->Implementation->Dispatcher.oneStep();
QStringList newList = this->selectedFileNames();
this->Implementation->TestUtility->playTests(newList);
} }
else else
{ {
this->Implementation->Dispatcher.pause(); this->Implementation->Dispatcher.oneStep();
} }
} }
...@@ -372,23 +389,33 @@ void pqPlayBackEventsDialog::onStarted(const QString& filename) ...@@ -372,23 +389,33 @@ void pqPlayBackEventsDialog::onStarted(const QString& filename)
} }
} }
// ----------------------------------------------------------------------------
void pqPlayBackEventsDialog::onStarted()
{
this->Implementation->setProgressBarsValue(0);
this->updateUi();
}
// ----------------------------------------------------------------------------
void pqPlayBackEventsDialog::onStopped()
{
this->Implementation->Ui.playPauseButton->setChecked(false);
this->updateUi();
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void pqPlayBackEventsDialog::updateUi() void pqPlayBackEventsDialog::updateUi()
{ {
// Update player buttons // Update player buttons
this->Implementation->Ui.playPauseButton->setEnabled( this->Implementation->Ui.playPauseButton->setEnabled(
!this->Implementation->Filenames.isEmpty()); !this->Implementation->Filenames.isEmpty() &&
this->selectedFileNames().count() > 0);
this->Implementation->Ui.stepButton->setEnabled( this->Implementation->Ui.stepButton->setEnabled(
this->Implementation->TestUtility->playingTest() && !this->Implementation->Filenames.isEmpty() &&
this->Implementation->Dispatcher.isPaused()); this->selectedFileNames().count() > 0);
this->Implementation->Ui.stopButton->setEnabled( this->Implementation->Ui.stopButton->setEnabled(
this->Implementation->TestUtility->playingTest()); this->Implementation->TestUtility->playingTest());
// Play or pause
this->Implementation->Ui.playPauseButton->setChecked(
this->Implementation->TestUtility->playingTest() &&
!this->Implementation->Dispatcher.isPaused());
// loadFile, plus and minus buttons // loadFile, plus and minus buttons
this->Implementation->Ui.loadFileButton->setEnabled( this->Implementation->Ui.loadFileButton->setEnabled(
!this->Implementation->TestUtility->playingTest()); !this->Implementation->TestUtility->playingTest());
...@@ -432,8 +459,8 @@ void pqPlayBackEventsDialog::updateUi() ...@@ -432,8 +459,8 @@ void pqPlayBackEventsDialog::updateUi()
{ {
this->Implementation->Ui.currentFileLabel->setText( this->Implementation->Ui.currentFileLabel->setText(
QString("No Test is playing ...")); QString("No Test is playing ..."));
this->Implementation->setProgressBarsValue(0);
} }
this->Implementation->Ui.commandLabel->setText(command); this->Implementation->Ui.commandLabel->setText(command);
this->Implementation->Ui.argumentsLabel->setText(argument); this->Implementation->Ui.argumentsLabel->setText(argument);
this->Implementation->Ui.objectLabel->setText(object); this->Implementation->Ui.objectLabel->setText(object);
......
...@@ -59,7 +59,10 @@ private slots: ...@@ -59,7 +59,10 @@ private slots:
void insertFiles(); void insertFiles();
void removeFiles(); void removeFiles();
void onPlayOrPause(bool); void onPlayOrPause(bool);
void onOneStep();
void onStarted();
void onStarted(const QString&); void onStarted(const QString&);
void onStopped();
public slots: public slots:
virtual void done(int); virtual void done(int);
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>378</width> <width>392</width>
<height>376</height> <height>319</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
...@@ -280,24 +280,16 @@ ...@@ -280,24 +280,16 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QPushButton" name="minusButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>:/Icons/minus.png</normaloff>:/Icons/minus.png</iconset>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="plusButton"> <widget class="QPushButton" name="plusButton">
<property name="toolTip">
<string>Add scripts to the list</string>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset> <iconset resource="Resources/QtTesting.qrc">
<normaloff>:/Icons/plus.png</normaloff>:/Icons/plus.png</iconset> <normaloff>:/Icons/plus.png</normaloff>:/Icons/plus.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
...@@ -311,6 +303,20 @@ ...@@ -311,6 +303,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="minusButton">
<property name="toolTip">
<string>Remove checked scripts</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="Resources/QtTesting.qrc">
<normaloff>:/Icons/minus.png</normaloff>:/Icons/minus.png</iconset>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="loadFileButton"> <widget class="QPushButton" name="loadFileButton">
<property name="sizePolicy"> <property name="sizePolicy">
...@@ -319,6 +325,9 @@ ...@@ -319,6 +325,9 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="toolTip">
<string>Open scripts</string>
</property>
<property name="text"> <property name="text">
<string>Open Scripts</string> <string>Open Scripts</string>
</property> </property>
...@@ -329,6 +338,9 @@ ...@@ -329,6 +338,9 @@
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="Info"> <widget class="QWidget" name="Info">
<property name="toolTip">
<string>Information about the current event</string>
</property>
<attribute name="icon"> <attribute name="icon">
<iconset resource="Resources/QtTesting.qrc"> <iconset resource="Resources/QtTesting.qrc">
<normaloff>:/Icons/info.png</normaloff>:/Icons/info.png</iconset> <normaloff>:/Icons/info.png</normaloff>:/Icons/info.png</iconset>
...@@ -578,6 +590,9 @@ ...@@ -578,6 +590,9 @@
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="toolTip">
<string>Play/Pause</string>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
...@@ -605,6 +620,9 @@ ...@@ -605,6 +620,9 @@
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="toolTip">
<string>Play step by step</string>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
...@@ -634,13 +652,12 @@ ...@@ -634,13 +652,12 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="toolTip">
<string>Stop</string>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="icon">
<iconset resource="Resources/QtTesting.qrc">
<normaloff>:/Icons/stop.png</normaloff>:/Icons/stop.png</iconset>
</property>
<property name="flat"> <property name="flat">
<bool>false</bool> <bool>false</bool>
</property> </property>
...@@ -677,6 +694,9 @@ ...@@ -677,6 +694,9 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="toolTip">
<string>Time step between each events</string>
</property>
<property name="suffix"> <property name="suffix">
<string> ms</string> <string> ms</string>
</property> </property>
...@@ -695,7 +715,10 @@ ...@@ -695,7 +715,10 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="radioButton"> <widget class="QCheckBox" name="checkBox">
<property name="toolTip">
<string>Show/Hide log browser</string>
</property>
<property name="text"> <property name="text">
<string>Logs</string> <string>Logs</string>
</property> </property>
...@@ -720,18 +743,18 @@ ...@@ -720,18 +743,18 @@
</resources> </resources>
<connections> <connections>
<connection> <connection>
<sender>radioButton</sender> <sender>checkBox</sender>
<signal>clicked(bool)</signal> <signal>toggled(bool)</signal>
<receiver>logBrowser</receiver> <receiver>logBrowser</receiver>
<slot>setVisible(bool)</slot> <slot>setVisible(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>51</x> <x>381</x>
<y>238</y> <y>220</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>130</x> <x>161</x>
<y>269</y> <y>270</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
......
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