diff --git a/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp b/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp index 29628c4c31b..942a6ada10e 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp @@ -46,9 +46,8 @@ namespace QmlJSDebugger { QmlToolBar::QmlToolBar(QWidget *parent) : QToolBar(parent) , m_emitSignals(true) - , m_isRunning(false) + , m_paused(false) , m_animationSpeed(1.0f) - , m_previousAnimationSpeed(0.0f) , ui(new Ui) { ui->playIcon = QIcon(QLatin1String(":/qml/images/play-24.png")); @@ -99,40 +98,35 @@ QmlToolBar::QmlToolBar(QWidget *parent) setWindowFlags(Qt::Tool); QMenu *playSpeedMenu = new QMenu(this); - QActionGroup *playSpeedMenuActions = new QActionGroup(this); - playSpeedMenuActions->setExclusive(true); - playSpeedMenu->addAction(tr("Animation Speed")); - playSpeedMenu->addSeparator(); - ui->defaultAnimSpeedAction = playSpeedMenu->addAction(tr("1x"), this, - SLOT(changeToDefaultAnimSpeed())); - ui->defaultAnimSpeedAction->setCheckable(true); - ui->defaultAnimSpeedAction->setChecked(true); - playSpeedMenuActions->addAction(ui->defaultAnimSpeedAction); + ui->playSpeedMenuActions = new QActionGroup(this); + ui->playSpeedMenuActions->setExclusive(true); - ui->halfAnimSpeedAction = playSpeedMenu->addAction(tr("0.5x"), this, - SLOT(changeToHalfAnimSpeed())); - ui->halfAnimSpeedAction->setCheckable(true); - playSpeedMenuActions->addAction(ui->halfAnimSpeedAction); + QAction *speedAction = playSpeedMenu->addAction(tr("1x"), this, SLOT(changeAnimationSpeed())); + speedAction->setCheckable(true); + speedAction->setChecked(true); + speedAction->setData(1.0f); + ui->playSpeedMenuActions->addAction(speedAction); - ui->fourthAnimSpeedAction = playSpeedMenu->addAction(tr("0.25x"), this, - SLOT(changeToFourthAnimSpeed())); - ui->fourthAnimSpeedAction->setCheckable(true); - playSpeedMenuActions->addAction(ui->fourthAnimSpeedAction); + speedAction = playSpeedMenu->addAction(tr("0.5x"), this, SLOT(changeAnimationSpeed())); + speedAction->setCheckable(true); + speedAction->setData(2.0f); + ui->playSpeedMenuActions->addAction(speedAction); - ui->eighthAnimSpeedAction = playSpeedMenu->addAction(tr("0.125x"), this, - SLOT(changeToEighthAnimSpeed())); - ui->eighthAnimSpeedAction->setCheckable(true); - playSpeedMenuActions->addAction(ui->eighthAnimSpeedAction); + speedAction = playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeAnimationSpeed())); + speedAction->setCheckable(true); + speedAction->setData(4.0f); + ui->playSpeedMenuActions->addAction(speedAction); - ui->tenthAnimSpeedAction = playSpeedMenu->addAction(tr("0.1x"), this, - SLOT(changeToTenthAnimSpeed())); - ui->tenthAnimSpeedAction->setCheckable(true); - playSpeedMenuActions->addAction(ui->tenthAnimSpeedAction); + speedAction = playSpeedMenu->addAction(tr("0.125x"), this, SLOT(changeAnimationSpeed())); + speedAction->setCheckable(true); + speedAction->setData(8.0f); + ui->playSpeedMenuActions->addAction(speedAction); + + speedAction = playSpeedMenu->addAction(tr("0.1x"), this, SLOT(changeAnimationSpeed())); + speedAction->setCheckable(true); + speedAction->setData(10.0f); + ui->playSpeedMenuActions->addAction(speedAction); - ui->menuPauseAction = playSpeedMenu->addAction(tr("Pause"), this, SLOT(updatePauseAction())); - ui->menuPauseAction->setCheckable(true); - ui->menuPauseAction->setIcon(ui->pauseIcon); - playSpeedMenuActions->addAction(ui->menuPauseAction); ui->play->setMenu(playSpeedMenu); connect(ui->designmode, SIGNAL(toggled(bool)), SLOT(setDesignModeBehaviorOnClick(bool))); @@ -183,63 +177,40 @@ void QmlToolBar::activateZoom() m_emitSignals = true; } -void QmlToolBar::setAnimationSpeed(qreal slowdownFactor) +void QmlToolBar::setAnimationSpeed(qreal slowDownFactor) { - m_emitSignals = false; - if (slowdownFactor != 0) { - m_animationSpeed = slowdownFactor; + if (m_animationSpeed == slowDownFactor) + return; - if (slowdownFactor == 1.0f) { - ui->defaultAnimSpeedAction->setChecked(true); - } else if (slowdownFactor == 2.0f) { - ui->halfAnimSpeedAction->setChecked(true); - } else if (slowdownFactor == 4.0f) { - ui->fourthAnimSpeedAction->setChecked(true); - } else if (slowdownFactor == 8.0f) { - ui->eighthAnimSpeedAction->setChecked(true); - } else if (slowdownFactor == 10.0f) { - ui->tenthAnimSpeedAction->setChecked(true); + m_emitSignals = false; + m_animationSpeed = slowDownFactor; + + foreach (QAction *action, ui->playSpeedMenuActions->actions()) { + if (action->data().toReal() == slowDownFactor) { + action->setChecked(true); + break; } - updatePlayAction(); - } else { - ui->menuPauseAction->setChecked(true); - updatePauseAction(); } m_emitSignals = true; } -void QmlToolBar::changeToDefaultAnimSpeed() +void QmlToolBar::setExecutionPaused(bool paused) { - m_animationSpeed = 1.0f; + if (m_paused == paused) + return; + + m_paused = paused; updatePlayAction(); } -void QmlToolBar::changeToHalfAnimSpeed() +void QmlToolBar::changeAnimationSpeed() { - m_animationSpeed = 2.0f; - updatePlayAction(); + QAction *action = qobject_cast(sender()); + m_animationSpeed = action->data().toReal(); + emit animationSpeedChanged(m_animationSpeed); } -void QmlToolBar::changeToFourthAnimSpeed() -{ - m_animationSpeed = 4.0f; - updatePlayAction(); -} - -void QmlToolBar::changeToEighthAnimSpeed() -{ - m_animationSpeed = 8.0f; - updatePlayAction(); -} - -void QmlToolBar::changeToTenthAnimSpeed() -{ - m_animationSpeed = 10.0f; - updatePlayAction(); -} - - void QmlToolBar::setDesignModeBehavior(bool inDesignMode) { m_emitSignals = false; @@ -268,30 +239,14 @@ void QmlToolBar::setColorBoxColor(const QColor &color) void QmlToolBar::activatePlayOnClick() { - if (m_isRunning) { - updatePauseAction(); - } else { - updatePlayAction(); - } + m_paused = !m_paused; + emit executionPausedChanged(m_paused); + updatePlayAction(); } void QmlToolBar::updatePlayAction() { - m_isRunning = true; - ui->play->setIcon(ui->pauseIcon); - if (m_animationSpeed != m_previousAnimationSpeed) - m_previousAnimationSpeed = m_animationSpeed; - - if (m_emitSignals) - emit animationSpeedChanged(m_animationSpeed); -} - -void QmlToolBar::updatePauseAction() -{ - m_isRunning = false; - ui->play->setIcon(ui->playIcon); - if (m_emitSignals) - emit animationSpeedChanged(0.0f); + ui->play->setIcon(m_paused ? ui->playIcon : ui->pauseIcon); } void QmlToolBar::activateColorPickerOnClick() diff --git a/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.h b/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.h index 2eecc586e84..de2186956b4 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.h @@ -39,6 +39,8 @@ #include "qmlobserverconstants.h" +QT_FORWARD_DECLARE_CLASS(QActionGroup) + namespace QmlJSDebugger { class ToolBarColorBox; @@ -58,10 +60,13 @@ public slots: void activateSelectTool(); void activateMarqueeSelectTool(); void activateZoom(); - void setAnimationSpeed(qreal slowdownFactor = 0.0f); + + void setAnimationSpeed(qreal slowDownFactor); + void setExecutionPaused(bool paused); signals: - void animationSpeedChanged(qreal slowdownFactor = 1.0f); + void animationSpeedChanged(qreal factor); + void executionPausedChanged(bool paused); void designModeBehaviorChanged(bool inDesignMode); void colorPickerSelected(); @@ -83,14 +88,9 @@ private slots: void activateFromQml(); void activateToQml(); - void changeToDefaultAnimSpeed(); - void changeToHalfAnimSpeed(); - void changeToFourthAnimSpeed(); - void changeToEighthAnimSpeed(); - void changeToTenthAnimSpeed(); + void changeAnimationSpeed(); void updatePlayAction(); - void updatePauseAction(); private: class Ui { @@ -107,18 +107,12 @@ private: QIcon pauseIcon; ToolBarColorBox *colorBox; - QAction *defaultAnimSpeedAction; - QAction *halfAnimSpeedAction; - QAction *fourthAnimSpeedAction; - QAction *eighthAnimSpeedAction; - QAction *tenthAnimSpeedAction; - QAction *menuPauseAction; + QActionGroup *playSpeedMenuActions; }; bool m_emitSignals; - bool m_isRunning; + bool m_paused; qreal m_animationSpeed; - qreal m_previousAnimationSpeed; Constants::DesignTool m_activeTool; diff --git a/share/qtcreator/qml/qmljsdebugger/include/qdeclarativeviewobserver.h b/share/qtcreator/qml/qmljsdebugger/include/qdeclarativeviewobserver.h index 68c99fbb862..162545235e6 100644 --- a/share/qtcreator/qml/qmljsdebugger/include/qdeclarativeviewobserver.h +++ b/share/qtcreator/qml/qmljsdebugger/include/qdeclarativeviewobserver.h @@ -73,9 +73,8 @@ public Q_SLOTS: void setShowAppOnTop(bool appOnTop); - void changeAnimationSpeed(qreal slowdownFactor); - void continueExecution(qreal slowdownFactor = 1.0f); - void pauseExecution(); + void setAnimationSpeed(qreal factor); + void setExecutionPaused(bool paused); void setObserverContext(int contextIndex); @@ -89,8 +88,8 @@ Q_SIGNALS: void colorPickerActivated(); void selectedColorChanged(const QColor &color); - void executionStarted(qreal slowdownFactor); - void executionPaused(); + void animationSpeedChanged(qreal factor); + void executionPausedChanged(bool paused); void inspectorContextCleared(); void inspectorContextPushed(const QString &contextTitle); @@ -110,6 +109,9 @@ protected: void setSelectedItemsForTools(QList items); +private slots: + void onAnimationSpeedChangeRequested(qreal factor); + private: Q_DISABLE_COPY(QDeclarativeViewObserver) diff --git a/share/qtcreator/qml/qmljsdebugger/qdeclarativeobserverservice.cpp b/share/qtcreator/qml/qmljsdebugger/qdeclarativeobserverservice.cpp index 43a8cc183a8..d64e1c69d6f 100644 --- a/share/qtcreator/qml/qmljsdebugger/qdeclarativeobserverservice.cpp +++ b/share/qtcreator/qml/qmljsdebugger/qdeclarativeobserverservice.cpp @@ -224,7 +224,6 @@ void QDeclarativeObserverService::setCurrentTool(QmlJSDebugger::Constants::Desig void QDeclarativeObserverService::setAnimationSpeed(qreal slowdownFactor) { - QByteArray message; QDataStream ds(&message, QIODevice::WriteOnly); diff --git a/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp b/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp index 130b1a89f7f..ef5bd71598c 100644 --- a/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp +++ b/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp @@ -106,7 +106,7 @@ QDeclarativeViewObserverPrivate::QDeclarativeViewObserverPrivate(QDeclarativeVie designModeBehavior(false), showAppOnTop(false), executionPaused(false), - slowdownFactor(1.0f), + slowDownFactor(1.0f), toolBox(0) { } @@ -147,7 +147,7 @@ QDeclarativeViewObserver::QDeclarativeViewObserver(QDeclarativeView *view, QObje connect(data->debugService, SIGNAL(currentObjectsChanged(QList)), data.data(), SLOT(_q_onCurrentObjectsChanged(QList))); connect(data->debugService, SIGNAL(animationSpeedChangeRequested(qreal)), - SLOT(changeAnimationSpeed(qreal))); + SLOT(onAnimationSpeedChangeRequested(qreal))); connect(data->debugService, SIGNAL(colorPickerToolRequested()), data.data(), SLOT(_q_changeToColorPickerTool())); connect(data->debugService, SIGNAL(selectMarqueeToolRequested()), @@ -384,11 +384,7 @@ bool QDeclarativeViewObserver::keyReleaseEvent(QKeyEvent *event) data->subcomponentEditorTool->setCurrentItem(data->selectedItems().first()); break; case Qt::Key_Space: - if (data->executionPaused) { - continueExecution(data->slowdownFactor); - } else { - pauseExecution(); - } + setExecutionPaused(!data->executionPaused); break; default: break; @@ -757,43 +753,46 @@ void QDeclarativeViewObserverPrivate::_q_changeContextPathIndex(int index) subcomponentEditorTool->setContext(index); } -void QDeclarativeViewObserver::changeAnimationSpeed(qreal slowdownFactor) +void QDeclarativeViewObserver::setAnimationSpeed(qreal factor) { - data->slowdownFactor = slowdownFactor; + Q_ASSERT(factor > 0); + if (data->slowDownFactor == factor) + return; - if (data->slowdownFactor != 0) - continueExecution(data->slowdownFactor); - else - pauseExecution(); + data->slowDownFactor = factor; + emit animationSpeedChanged(factor); + + const float effectiveFactor = data->executionPaused ? 0 : factor; + onAnimationSpeedChangeRequested(effectiveFactor); + data->debugService->setAnimationSpeed(effectiveFactor); } -void QDeclarativeViewObserver::continueExecution(qreal slowdownFactor) +void QDeclarativeViewObserver::setExecutionPaused(bool paused) { - Q_ASSERT(slowdownFactor > 0); + if (data->executionPaused == paused) + return; - data->slowdownFactor = slowdownFactor; - static const qreal animSpeedSnapDelta = 0.01f; + const float effectiveFactor = paused ? 0 : data->slowDownFactor; + onAnimationSpeedChangeRequested(effectiveFactor); + data->debugService->setAnimationSpeed(effectiveFactor); +} - qreal slowDownFactor = data->slowdownFactor; - if (qAbs(1.0f - slowDownFactor) < animSpeedSnapDelta) { - slowDownFactor = 1.0f; +void QDeclarativeViewObserver::onAnimationSpeedChangeRequested(qreal factor) +{ + const bool paused = factor == 0; + + if (!paused && data->slowDownFactor != factor) { + data->slowDownFactor = factor; + emit animationSpeedChanged(factor); + } + if (data->executionPaused != paused) { + data->executionPaused = paused; + emit executionPausedChanged(paused); } - QDeclarativeDebugHelper::setAnimationSlowDownFactor(slowDownFactor); - data->executionPaused = false; - - emit executionStarted(data->slowdownFactor); - data->debugService->setAnimationSpeed(data->slowdownFactor); + QDeclarativeDebugHelper::setAnimationSlowDownFactor(factor); } -void QDeclarativeViewObserver::pauseExecution() -{ - QDeclarativeDebugHelper::setAnimationSlowDownFactor(0.0f); - data->executionPaused = true; - - emit executionPaused(); - data->debugService->setAnimationSpeed(0); -} void QDeclarativeViewObserverPrivate::_q_applyChangesFromClient() { @@ -850,8 +849,6 @@ void QDeclarativeViewObserverPrivate::_q_onStatusChanged(QDeclarativeView::Statu if (subcomponentEditorTool->contextIndex() != -1) subcomponentEditorTool->clear(); subcomponentEditorTool->pushContext(view->rootObject()); - emit q->executionStarted(1.0f); - } debugService->reloaded(); } @@ -917,8 +914,8 @@ void QDeclarativeViewObserverPrivate::createToolBox() QObject::connect(toolBar, SIGNAL(designModeBehaviorChanged(bool)), q, SLOT(setDesignModeBehavior(bool))); - QObject::connect(toolBar, SIGNAL(animationSpeedChanged(qreal)), - q, SLOT(changeAnimationSpeed(qreal))); + QObject::connect(toolBar, SIGNAL(animationSpeedChanged(qreal)), q, SLOT(setAnimationSpeed(qreal))); + QObject::connect(toolBar, SIGNAL(executionPausedChanged(bool)), q, SLOT(setExecutionPaused(bool))); QObject::connect(toolBar, SIGNAL(colorPickerSelected()), this, SLOT(_q_changeToColorPickerTool())); QObject::connect(toolBar, SIGNAL(zoomToolSelected()), this, SLOT(_q_changeToZoomTool())); QObject::connect(toolBar, SIGNAL(selectToolSelected()), this, SLOT(_q_changeToSingleSelectTool())); @@ -928,8 +925,8 @@ void QDeclarativeViewObserverPrivate::createToolBox() QObject::connect(toolBar, SIGNAL(applyChangesFromQmlFileSelected()), this, SLOT(_q_applyChangesFromClient())); - QObject::connect(q, SIGNAL(executionStarted(qreal)), toolBar, SLOT(setAnimationSpeed(qreal))); - QObject::connect(q, SIGNAL(executionPaused()), toolBar, SLOT(setAnimationSpeed())); + QObject::connect(q, SIGNAL(animationSpeedChanged(qreal)), toolBar, SLOT(setAnimationSpeed(qreal))); + QObject::connect(q, SIGNAL(executionPausedChanged(bool)), toolBar, SLOT(setExecutionPaused(bool))); QObject::connect(q, SIGNAL(selectToolActivated()), toolBar, SLOT(activateSelectTool())); diff --git a/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h b/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h index fc15a2dbdbe..7ed1103a7c8 100644 --- a/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h +++ b/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h @@ -89,7 +89,7 @@ public: bool showAppOnTop; bool executionPaused; - qreal slowdownFactor; + qreal slowDownFactor; ToolBox *toolBox; diff --git a/share/qtcreator/qml/qmlobserver/qmlruntime.cpp b/share/qtcreator/qml/qmlobserver/qmlruntime.cpp index 45e07ba9b32..a21318ed818 100644 --- a/share/qtcreator/qml/qmlobserver/qmlruntime.cpp +++ b/share/qtcreator/qml/qmlobserver/qmlruntime.cpp @@ -114,7 +114,6 @@ #include -#include #include "jsdebuggeragent.h" QT_BEGIN_NAMESPACE @@ -759,13 +758,12 @@ void QDeclarativeViewer::createMenu() connect(recordOptions, SIGNAL(triggered()), this, SLOT(chooseRecordingOptions())); QMenu *playSpeedMenu = new QMenu(tr("Animation Speed"), this); - QActionGroup *playSpeedMenuActions = new QActionGroup(this); + playSpeedMenuActions = new QActionGroup(this); playSpeedMenuActions->setExclusive(true); QAction *speedAction = playSpeedMenu->addAction(tr("1x"), this, SLOT(changeAnimationSpeed())); speedAction->setCheckable(true); speedAction->setChecked(true); - animationSpeed = 1.0f; speedAction->setData(1.0f); playSpeedMenuActions->addAction(speedAction); @@ -776,7 +774,6 @@ void QDeclarativeViewer::createMenu() speedAction = playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeAnimationSpeed())); speedAction->setCheckable(true); - speedAction->setCheckable(true); speedAction->setData(4.0f); playSpeedMenuActions->addAction(speedAction); @@ -790,7 +787,7 @@ void QDeclarativeViewer::createMenu() speedAction->setData(10.0f); playSpeedMenuActions->addAction(speedAction); - pauseAnimationsAction = playSpeedMenu->addAction(tr("Pause"), this, SLOT(setAnimationsPaused(bool))); + pauseAnimationsAction = playSpeedMenu->addAction(tr("Pause"), observer, SLOT(setExecutionPaused(bool))); pauseAnimationsAction->setCheckable(true); pauseAnimationsAction->setShortcut(QKeySequence("Ctrl+.")); @@ -803,6 +800,9 @@ void QDeclarativeViewer::createMenu() QAction *playSpeedAction = new QAction(tr("Animations"), this); playSpeedAction->setMenu(playSpeedMenu); + connect(observer, SIGNAL(animationSpeedChanged(qreal)), SLOT(animationSpeedChanged(qreal))); + connect(observer, SIGNAL(executionPausedChanged(bool)), pauseAnimationsAction, SLOT(setChecked(bool))); + showWarningsWindow = new QAction(tr("Show Warnings"), this); showWarningsWindow->setCheckable((true)); showWarningsWindow->setChecked(loggerWindow->isVisible()); @@ -1078,24 +1078,15 @@ void QDeclarativeViewer::toggleRecording() #endif } -void QDeclarativeViewer::setAnimationsPaused(bool enable) +void QDeclarativeViewer::pauseAnimations() { - if (enable) { - setAnimationSpeed(0.0); - } else { - setAnimationSpeed(animationSpeed); - } -} - -void QDeclarativeViewer::pauseAnimations() { - pauseAnimationsAction->setChecked(true); - setAnimationsPaused(true); + observer->setExecutionPaused(true); } void QDeclarativeViewer::stepAnimations() { - setAnimationSpeed(1.0); - QTimer::singleShot(m_stepSize, this, SLOT(pauseAnimations())); + observer->setExecutionPaused(false); + QTimer::singleShot(m_stepSize, this, SLOT(pauseAnimations())); } void QDeclarativeViewer::setAnimationStep() @@ -1108,13 +1099,8 @@ void QDeclarativeViewer::setAnimationStep() void QDeclarativeViewer::changeAnimationSpeed() { - QAction *action = qobject_cast(sender()); - if (action) { - float f = action->data().toFloat(); - animationSpeed = f; - if (!pauseAnimationsAction->isChecked()) - setAnimationSpeed(animationSpeed); - } + if (QAction *action = qobject_cast(sender())) + observer->setAnimationSpeed(action->data().toFloat()); } void QDeclarativeViewer::addLibraryPath(const QString& lib) @@ -1574,6 +1560,16 @@ void QDeclarativeViewer::orientationChanged() updateSizeHints(); } +void QDeclarativeViewer::animationSpeedChanged(qreal factor) +{ + foreach (QAction *action, playSpeedMenuActions->actions()) { + if (action->data().toFloat() == factor) { + action->setChecked(true); + break; + } + } +} + void QDeclarativeViewer::setDeviceKeys(bool on) { devicemode = on; @@ -1625,11 +1621,6 @@ void QDeclarativeViewer::setStayOnTop(bool stayOnTop) appOnTopAction->setChecked(stayOnTop); } -void QDeclarativeViewer::setAnimationSpeed(float f) -{ - QDeclarativeDebugHelper::setAnimationSlowDownFactor(f); -} - void QDeclarativeViewer::updateSizeHints(bool initial) { static bool isRecursive = false; diff --git a/share/qtcreator/qml/qmlobserver/qmlruntime.h b/share/qtcreator/qml/qmlobserver/qmlruntime.h index 858f5b9a36e..efd4a3ef077 100644 --- a/share/qtcreator/qml/qmlobserver/qmlruntime.h +++ b/share/qtcreator/qml/qmlobserver/qmlruntime.h @@ -130,7 +130,6 @@ public slots: void proxySettingsChanged (); void rotateOrientation(); void statusChanged(); - void setAnimationsPaused(bool); void pauseAnimations(); void stepAnimations(); void setAnimationStep(); @@ -154,12 +153,13 @@ private slots: void changeOrientation(QAction*); void orientationChanged(); + void animationSpeedChanged(qreal factor); + void showWarnings(bool show); void warningsWidgetOpened(); void warningsWidgetClosed(); private: - void setAnimationSpeed(float f); void updateSizeHints(bool initial = false); QString getVideoFileName(); @@ -192,8 +192,8 @@ private: bool ffmpegAvailable; bool convertAvailable; - float animationSpeed; int m_stepSize; + QActionGroup *playSpeedMenuActions; QAction *pauseAnimationsAction; QAction *animationStepAction; QAction *animationSetStepAction;