Commit b96f2920 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 : remove useless files.

Fix some segfaults by disabling functions.
Slower, faster are on the side of the slider now.
parent f3c5b0ad
......@@ -212,20 +212,11 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i ) :
QHBoxLayout *layout = new QHBoxLayout( this );
layout->setMargin( 0 );
slowerButton = new QPushButton( "S" );
BUTTON_SET_ACT( slowerButton, "S", qtr("Slower" ), slower() );
layout->addWidget( slowerButton );
slowerButton->setMaximumWidth( 35 );
normalButton = new QPushButton( "N" );
BUTTON_SET_ACT( normalButton, "N", qtr("Normal rate"), normal() );
layout->addWidget( normalButton );
normalButton->setMaximumWidth( 35 );
fasterButton = new QPushButton( "F" );
BUTTON_SET_ACT( fasterButton, "F", qtr("Faster" ), faster() );
layout->addWidget( fasterButton );
fasterButton->setMaximumWidth( 35 );
layout->addItem( new QSpacerItem( 100,20,
QSizePolicy::Expanding, QSizePolicy::Minimum) );
......@@ -247,9 +238,9 @@ AdvControlsWidget::~AdvControlsWidget()
void AdvControlsWidget::enableInput( bool enable )
{
slowerButton->setEnabled( enable );
// slowerButton->setEnabled( enable );
normalButton->setEnabled( enable );
fasterButton->setEnabled( enable );
// fasterButton->setEnabled( enable );
}
void AdvControlsWidget::enableVideo( bool enable )
{
......@@ -257,16 +248,6 @@ void AdvControlsWidget::enableVideo( bool enable )
fullscreenButton->setEnabled( enable );
}
void AdvControlsWidget::slower()
{
THEMIM->getIM()->slower();
}
void AdvControlsWidget::faster()
{
THEMIM->getIM()->faster();
}
void AdvControlsWidget::normal()
{
THEMIM->getIM()->normalRate();
......@@ -289,7 +270,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i ) :
/** The main Slider **/
slider = new InputSlider( Qt::Horizontal, NULL );
controlLayout->addWidget( slider, 0, 1, 1, 14 );
controlLayout->addWidget( slider, 0, 1, 1, 15 );
/* Update the position when the IM has changed */
CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ),
slider, setPosition( float,int, int ) );
......@@ -297,6 +278,17 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i ) :
CONNECT( slider, sliderDragged( float ),
THEMIM->getIM(), sliderUpdate( float ) );
/** Slower and faster Buttons **/
slowerButton = new QPushButton( "S" );
BUTTON_SET_ACT( slowerButton, "S", qtr("Slower" ), slower() );
controlLayout->addWidget( slowerButton, 0, 0 );
slowerButton->setMaximumSize( QSize( 26, 26 ) );
fasterButton = new QPushButton( "F" );
BUTTON_SET_ACT( fasterButton, "F", qtr("Faster" ), faster() );
controlLayout->addWidget( fasterButton, 0, 16 );
fasterButton->setMaximumSize( QSize( 26, 26 ) );
/** Disc and Menus handling */
discFrame = new QFrame( this );
QHBoxLayout *discLayout = new QHBoxLayout( discFrame );
......@@ -338,8 +330,8 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i ) :
/* Play */
QPushButton *playButton = new QPushButton;
playButton->setSizePolicy( sizePolicy );
playButton->setMaximumSize( QSize( 45, 45 ) );
playButton->setIconSize( QSize( 30, 30 ) );
playButton->setMaximumSize( QSize( 26, 26 ) );
playButton->setIconSize( QSize( 20, 20 ) );
controlLayout->addWidget( playButton, 2, 0, 2, 2 );
......@@ -516,13 +508,22 @@ void ControlsWidget::updateOnTimer()
b_my_volume = false;
}
}
/* FIXME */
void ControlsWidget::setStatus( int status )
{
if( status == 1 ) // Playing
playButton->setIcon( QIcon( ":/pixmaps/pause.png" ) );
{
msg_Dbg( p_intf, "I was here %i", status );
// playButton->setIcon( QIcon( ":/pixmaps/pause.png" ) );
}
else
playButton->setIcon( QIcon( ":/pixmaps/play.png" ) );
{
msg_Dbg( p_intf, "I was here %i", status );
// playButton->setIcon( QIcon( ":/pixmaps/play.png" ) );
}
}
/*
* This functions toggle the fullscreen mode
* If there is no video, it should first activate Visualisations... TODO
......@@ -541,6 +542,23 @@ void ControlsWidget::prefs()
THEDP->prefsDialog();
}
void ControlsWidget::slower()
{
THEMIM->getIM()->slower();
}
void ControlsWidget::faster()
{
THEMIM->getIM()->faster();
}
void ControlsWidget::enableInput( bool enable )
{
slowerButton->setEnabled( enable );
slider->setEnabled( enable );
fasterButton->setEnabled( enable );
}
/**********************************************************************
* Playlist Widget. The embedded playlist
**********************************************************************/
......
......@@ -110,11 +110,9 @@ public:
void enableVideo( bool );
private:
intf_thread_t *p_intf;
QPushButton *slowerButton, *normalButton, *fasterButton;
QPushButton *normalButton;
QPushButton *fullscreenButton, *snapshotButton;
private slots:
void faster();
void slower();
void normal();
void snapshot();
void fullscreen();
......@@ -134,6 +132,7 @@ public:
QPushButton *playlistButton;
QSlider *volumeSlider;
void setStatus( int );
void enableInput( bool );
public slots:
void setNavigation( int );
void updateOnTimer();
......@@ -147,6 +146,7 @@ private:
InputSlider *slider;
QPushButton *prevSectionButton, *nextSectionButton, *menuButton;
QPushButton *playButton;
QPushButton *slowerButton, *fasterButton;
private slots:
void play();
void stop();
......@@ -156,6 +156,8 @@ private slots:
void fullscreen();
void extSettings();
void prefs();
void faster();
void slower();
};
class VolumeClickHandler : public QObject
......
......@@ -887,6 +887,7 @@ void MainInterface::updateOnTimer()
/* \todo Make this event-driven */
// TO MOVE TO controls
advControls->enableInput( THEMIM->getIM()->hasInput() );
controls->enableInput( THEMIM->getIM()->hasInput() );
advControls->enableVideo( THEMIM->getIM()->hasVideo() );
if( intf_ShouldDie( p_intf ) )
......
<ui version="4.0" >
<class>MainInterfaceUI</class>
<widget class="QWidget" name="MainInterfaceUI" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>502</width>
<height>201</height>
</rect>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QFrame" name="sliderFrame" />
</item>
<item>
<widget class="QFrame" name="discFrame" >
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="menuButton" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="prevSectionButton" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="nextSectionButton" >
<property name="text" >
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QPushButton" name="prevButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="iconSize" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="playButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="text" >
<string/>
</property>
<property name="iconSize" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="stopButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="text" >
<string/>
</property>
<property name="iconSize" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="nextButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="text" >
<string/>
</property>
<property name="iconSize" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>80</width>
<height>27</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="volMuteLabel" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="volumeSlider" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="playlistButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
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