Commit 7ab98f85 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

Qt: rename a class

parent 71b6f892
......@@ -37,7 +37,7 @@
#include "input_manager.hpp"
#include "actions_manager.hpp"
#include "util/input_slider.hpp" /* InputSlider */
#include "util/input_slider.hpp" /* SeekSlider */
#include "util/customwidgets.hpp" /* qEventToKey */
#include <QSpacerItem>
......@@ -289,7 +289,7 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
}
break;
case INPUT_SLIDER: {
InputSlider *slider = new InputSlider( Qt::Horizontal, NULL );
SeekSlider *slider = new SeekSlider( Qt::Horizontal, NULL );
/* Update the position when the IM has changed */
CONNECT( THEMIM->getIM(), positionUpdated( float, int64_t, int ),
......
......@@ -50,7 +50,7 @@ class QBoxLayout;
class QAbstractSlider;
class QAbstractButton;
class InputSlider;
class SeekSlider;
class QToolButton;
class VolumeClickHandler;
......
......@@ -333,7 +333,7 @@ WidgetListing::WidgetListing( intf_thread_t *p_intf, QWidget *_parent )
break;
case INPUT_SLIDER:
{
InputSlider *slider = new InputSlider( Qt::Horizontal, this );
SeekSlider *slider = new SeekSlider( Qt::Horizontal, this );
widget = slider;
}
widgetItem->setText( qtr("Time Slider") );
......
......@@ -39,12 +39,12 @@
#define MINIMUM 0
#define MAXIMUM 1000
InputSlider::InputSlider( QWidget *_parent ) : QSlider( _parent )
SeekSlider::SeekSlider( QWidget *_parent ) : QSlider( _parent )
{
InputSlider( Qt::Horizontal, _parent );
SeekSlider( Qt::Horizontal, _parent );
}
InputSlider::InputSlider( Qt::Orientation q, QWidget *_parent )
SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent )
: QSlider( q, _parent )
{
b_isSliding = false;
......@@ -72,7 +72,7 @@ InputSlider::InputSlider( Qt::Orientation q, QWidget *_parent )
/***
* \brief Public interface, like setValue, but disabling the slider too
***/
void InputSlider::setPosition( float pos, int64_t a, int b )
void SeekSlider::setPosition( float pos, int64_t a, int b )
{
if( pos == -1.0 )
{
......@@ -88,20 +88,20 @@ void InputSlider::setPosition( float pos, int64_t a, int b )
inputLength = b;
}
void InputSlider::startSeekTimer( int new_value )
void SeekSlider::startSeekTimer( int new_value )
{
/* Only fire one update, when sliding, every 150ms */
if( b_isSliding && !seekLimitTimer->isActive() )
seekLimitTimer->start( 150 );
}
void InputSlider::updatePos()
void SeekSlider::updatePos()
{
float f_pos = (float)(value())/1000.0;
emit sliderDragged( f_pos ); /* Send new position to VLC's core */
}
void InputSlider::mouseReleaseEvent( QMouseEvent *event )
void SeekSlider::mouseReleaseEvent( QMouseEvent *event )
{
event->accept();
b_isSliding = false;
......@@ -110,7 +110,7 @@ void InputSlider::mouseReleaseEvent( QMouseEvent *event )
updatePos();
}
void InputSlider::mousePressEvent(QMouseEvent* event)
void SeekSlider::mousePressEvent(QMouseEvent* event)
{
/* Right-click */
if( event->button() != Qt::LeftButton &&
......@@ -125,7 +125,7 @@ void InputSlider::mousePressEvent(QMouseEvent* event)
event->accept();
}
void InputSlider::mouseMoveEvent(QMouseEvent *event)
void SeekSlider::mouseMoveEvent(QMouseEvent *event)
{
if( b_isSliding )
{
......@@ -138,7 +138,7 @@ void InputSlider::mouseMoveEvent(QMouseEvent *event)
event->accept();
}
void InputSlider::wheelEvent( QWheelEvent *event)
void SeekSlider::wheelEvent( QWheelEvent *event)
{
/* Don't do anything if we are for somehow reason sliding */
if( !b_isSliding )
......@@ -154,19 +154,19 @@ void InputSlider::wheelEvent( QWheelEvent *event)
event->accept();
}
QSize InputSlider::sizeHint() const
QSize SeekSlider::sizeHint() const
{
return ( orientation() == Qt::Horizontal ) ? QSize( 100, 18 )
: QSize( 18, 100 );
}
QSize InputSlider::handleSize() const
QSize SeekSlider::handleSize() const
{
const int size = ( orientation() == Qt::Horizontal ? height() : width() );
return QSize( size, size );
}
void InputSlider::paintEvent( QPaintEvent *event )
void SeekSlider::paintEvent( QPaintEvent *event )
{
Q_UNUSED( event );
......
......@@ -34,12 +34,12 @@
#include <QTimer>
/* Input Slider derived from QSlider */
class InputSlider : public QSlider
class SeekSlider : public QSlider
{
Q_OBJECT
public:
InputSlider( QWidget *_parent );
InputSlider( Qt::Orientation q, QWidget *_parent );
SeekSlider( QWidget *_parent );
SeekSlider( Qt::Orientation q, QWidget *_parent );
protected:
virtual void mouseMoveEvent(QMouseEvent *event);
......
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