Commit a2dbfd13 authored by Clément Stenac's avatar Clément Stenac

Some general clean up

parent 183dd67e
......@@ -11,7 +11,7 @@
AUTOMAKE_OPTIONS = subdir-objects
TOUI = ui/input_stats
TOUI = ui/input_stats ui/main_interface
UIH = $(TOUI:%=%.h)
TOMOC = main_interface \
......
......@@ -69,12 +69,12 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
setAll();
QObject::connect( adv_chk, SIGNAL( toggled(bool) ), this,
SLOT( setAdvanced( bool ) ) );
connect( adv_chk, SIGNAL( toggled(bool) ),
this, SLOT( setAdvanced( bool ) ) );
setLayout( main_layout );
QObject::connect( small, SIGNAL( clicked() ), this, SLOT( setSmall()) );
QObject::connect( all, SIGNAL( clicked() ), this, SLOT( setAll()) );
connect( small, SIGNAL( clicked() ), this, SLOT( setSmall()) );
connect( all, SIGNAL( clicked() ), this, SLOT( setAll()) );
}
void PrefsDialog::setAdvanced( bool advanced )
......@@ -92,10 +92,9 @@ void PrefsDialog::setAll()
if( !advanced_tree )
{
advanced_tree = new PrefsTree( p_intf, this );
QObject::connect( advanced_tree,
SIGNAL( currentItemChanged( QTreeWidgetItem *,
QTreeWidgetItem *) ), this,
SLOT( changePanel( QTreeWidgetItem * ) ) );
connect( advanced_tree,
SIGNAL( currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem *) ),
this, SLOT( changePanel( QTreeWidgetItem * ) ) );
}
advanced_tree->show();
setAdvanced( adv_chk->isChecked() );
......
......@@ -26,24 +26,15 @@
#include "components/infopanels.hpp"
#include "qt4.hpp"
StreamInfoDialog *StreamInfoDialog::instance = NULL;
StreamInfoDialog::StreamInfoDialog( intf_thread_t *_p_intf ) : QVLCFrame( p_intf )
{
setWindowTitle( _("Stream information" ) );
// InputStatsPanel *ISP = new InputStatsPanel( this, p_intf );
fprintf( stderr, "CONNECTING\n");
fprintf( stderr, "Done\n");
}
void StreamInfoDialog::init()
StreamInfoDialog::StreamInfoDialog( intf_thread_t *_p_intf ) :
QVLCFrame( p_intf )
{
QObject::connect( DialogsProvider::getInstance(NULL)->fixed_timer,
SIGNAL( timeout() ), this, SLOT(update() ) );
setWindowTitle( _("Stream information" ) );
InputStatsPanel *ISP = new InputStatsPanel( this, p_intf );
connect( DialogsProvider::getInstance(NULL)->fixed_timer,
SIGNAL( timeout() ), this, SLOT(update() ) );
}
void StreamInfoDialog::update()
......
......@@ -32,22 +32,16 @@ public:
static StreamInfoDialog * getInstance( intf_thread_t *p_intf )
{
if( !instance)
{
instance = new StreamInfoDialog( p_intf );
instance->init();
}
instance = new StreamInfoDialog( p_intf );
return instance;
}
virtual ~StreamInfoDialog();
private:
StreamInfoDialog( intf_thread_t * );
void init();
intf_thread_t *p_intf;
static StreamInfoDialog *instance;
public slots:
void update();
};
#endif
......@@ -41,8 +41,6 @@ public:
return instance;
}
virtual ~DialogsProvider();
void init();
QTimer *idle_timer;
QTimer *fixed_timer;
protected:
......
......@@ -30,8 +30,8 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
{
p_input = NULL;
/* Subscribe to updates */
QObject::connect( DialogsProvider::getInstance( p_intf )->fixed_timer,
SIGNAL( timeout() ), this, SLOT( update() ) );
connect( DialogsProvider::getInstance( p_intf )->fixed_timer,
SIGNAL( timeout() ), this, SLOT( update() ) );
}
InputManager::~InputManager()
......
......@@ -37,28 +37,22 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
p_input = NULL;
main_input_manager = new InputManager( this, p_intf );
QPushButton *button = new QPushButton( "prefs", this );
// QPushButton *button = new QPushButton( "prefs", this );
// connect( button, SIGNAL( clicked() ),
// DialogsProvider::getInstance(p_intf), SLOT( prefsDialog() ) );
QObject::connect( button, SIGNAL( clicked() ),
DialogsProvider::getInstance(p_intf), SLOT( prefsDialog() ) );
}
void MainInterface::init()
{
/* Get timer updates */
QObject::connect( DialogsProvider::getInstance(NULL)->fixed_timer,
SIGNAL( timeout() ), this, SLOT(updateOnTimer() ) );
connect( DialogsProvider::getInstance(NULL)->fixed_timer,
SIGNAL( timeout() ), this, SLOT(updateOnTimer() ) );
/* Tell input manager about the input changes */
QObject::connect( this, SIGNAL( inputChanged( input_thread_t * ) ),
main_input_manager, SLOT( setInput( input_thread_t * ) ) );
connect( this, SIGNAL( inputChanged( input_thread_t * ) ),
main_input_manager, SLOT( setInput( input_thread_t * ) ) );
/* Connect the slider and the input manager (both ways) */
QObject::connect( main_input_manager, SIGNAL(positionUpdated(
float, int, int ) ), slider, SLOT( setPosition( float,int,
int ) ) );
QObject::connect( slider, SIGNAL( sliderDragged( float ) ),
main_input_manager, SLOT( sliderUpdate( float ) ) );
connect( main_input_manager, SIGNAL(positionUpdated( float, int, int ) ),
slider, SLOT( setPosition( float,int, int ) ) );
connect( slider, SIGNAL( sliderDragged( float ) ),
main_input_manager, SLOT( sliderUpdate( float ) ) );
/* Connect the display and the input manager */
}
......
......@@ -36,7 +36,6 @@ class MainInterface : public QVLCFrame
public:
MainInterface( intf_thread_t *);
virtual ~MainInterface();
void init();
protected:
void closeEvent( QCloseEvent *);
private:
......
......@@ -124,7 +124,6 @@ static void Init( intf_thread_t *p_intf )
{
MainInterface *p_mi = new MainInterface( p_intf );
p_intf->p_sys->p_mi = p_mi;
p_mi->init();
p_mi->show();
}
......
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>MainInterfaceUI</class>
<widget class="QWidget" name="MainInterfaceUI" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>560</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QFrame" name="sliderFrame" />
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFrame" name="volumeFrame" />
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="prevButton" >
<property name="text" >
<string>Prev</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="playButton_2" >
<property name="text" >
<string>Play</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="stopButton" >
<property name="text" >
<string>Stop</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="nextButton" >
<property name="text" >
<string>Next</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="playlistButton" >
<property name="text" >
<string>Playlist</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>
......@@ -37,22 +37,21 @@ InputSlider::InputSlider( Qt::Orientation q,QWidget *_parent ) :
setSingleStep( 2 );
setPageStep( 1000 );
setTracking( true );
QObject::connect( this, SIGNAL( valueChanged(int) ), this,
SLOT( userDrag( int ) ) );
connect( this, SIGNAL( valueChanged(int) ), this, SLOT( userDrag( int ) ) );
}
void InputSlider::setPosition( float pos, int a, int b )
{
if( pos == 0.0 )
{
setEnabled( false );
setEnabled( false );
}
else
{
setEnabled( true );
mymove = true;
setValue( (int)(pos * 1000.0 ) );
mymove = false;
setEnabled( true );
mymove = true;
setValue( (int)(pos * 1000.0 ) );
mymove = false;
}
}
......
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