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