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

Some general clean up

parent 183dd67e
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
AUTOMAKE_OPTIONS = subdir-objects AUTOMAKE_OPTIONS = subdir-objects
TOUI = ui/input_stats TOUI = ui/input_stats ui/main_interface
UIH = $(TOUI:%=%.h) UIH = $(TOUI:%=%.h)
TOMOC = main_interface \ TOMOC = main_interface \
......
...@@ -69,12 +69,12 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -69,12 +69,12 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
setAll(); setAll();
QObject::connect( adv_chk, SIGNAL( toggled(bool) ), this, connect( adv_chk, SIGNAL( toggled(bool) ),
SLOT( setAdvanced( bool ) ) ); this, SLOT( setAdvanced( bool ) ) );
setLayout( main_layout ); setLayout( main_layout );
QObject::connect( small, SIGNAL( clicked() ), this, SLOT( setSmall()) ); connect( small, SIGNAL( clicked() ), this, SLOT( setSmall()) );
QObject::connect( all, SIGNAL( clicked() ), this, SLOT( setAll()) ); connect( all, SIGNAL( clicked() ), this, SLOT( setAll()) );
} }
void PrefsDialog::setAdvanced( bool advanced ) void PrefsDialog::setAdvanced( bool advanced )
...@@ -92,10 +92,9 @@ void PrefsDialog::setAll() ...@@ -92,10 +92,9 @@ void PrefsDialog::setAll()
if( !advanced_tree ) if( !advanced_tree )
{ {
advanced_tree = new PrefsTree( p_intf, this ); advanced_tree = new PrefsTree( p_intf, this );
QObject::connect( advanced_tree, connect( advanced_tree,
SIGNAL( currentItemChanged( QTreeWidgetItem *, SIGNAL( currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem *) ),
QTreeWidgetItem *) ), this, this, SLOT( changePanel( QTreeWidgetItem * ) ) );
SLOT( changePanel( QTreeWidgetItem * ) ) );
} }
advanced_tree->show(); advanced_tree->show();
setAdvanced( adv_chk->isChecked() ); setAdvanced( adv_chk->isChecked() );
......
...@@ -26,23 +26,14 @@ ...@@ -26,23 +26,14 @@
#include "components/infopanels.hpp" #include "components/infopanels.hpp"
#include "qt4.hpp" #include "qt4.hpp"
StreamInfoDialog *StreamInfoDialog::instance = NULL; StreamInfoDialog *StreamInfoDialog::instance = NULL;
StreamInfoDialog::StreamInfoDialog( intf_thread_t *_p_intf ) : QVLCFrame( p_intf ) StreamInfoDialog::StreamInfoDialog( intf_thread_t *_p_intf ) :
QVLCFrame( p_intf )
{ {
setWindowTitle( _("Stream information" ) ); setWindowTitle( _("Stream information" ) );
// InputStatsPanel *ISP = new InputStatsPanel( this, p_intf ); InputStatsPanel *ISP = new InputStatsPanel( this, p_intf );
connect( DialogsProvider::getInstance(NULL)->fixed_timer,
fprintf( stderr, "CONNECTING\n");
fprintf( stderr, "Done\n");
}
void StreamInfoDialog::init()
{
QObject::connect( DialogsProvider::getInstance(NULL)->fixed_timer,
SIGNAL( timeout() ), this, SLOT(update() ) ); SIGNAL( timeout() ), this, SLOT(update() ) );
} }
......
...@@ -32,22 +32,16 @@ public: ...@@ -32,22 +32,16 @@ public:
static StreamInfoDialog * getInstance( intf_thread_t *p_intf ) static StreamInfoDialog * getInstance( intf_thread_t *p_intf )
{ {
if( !instance) if( !instance)
{
instance = new StreamInfoDialog( p_intf ); instance = new StreamInfoDialog( p_intf );
instance->init();
}
return instance; return instance;
} }
virtual ~StreamInfoDialog(); virtual ~StreamInfoDialog();
private: private:
StreamInfoDialog( intf_thread_t * ); StreamInfoDialog( intf_thread_t * );
void init();
intf_thread_t *p_intf; intf_thread_t *p_intf;
static StreamInfoDialog *instance; static StreamInfoDialog *instance;
public slots: public slots:
void update(); void update();
}; };
#endif #endif
...@@ -41,8 +41,6 @@ public: ...@@ -41,8 +41,6 @@ public:
return instance; return instance;
} }
virtual ~DialogsProvider(); virtual ~DialogsProvider();
void init();
QTimer *idle_timer; QTimer *idle_timer;
QTimer *fixed_timer; QTimer *fixed_timer;
protected: protected:
......
...@@ -30,7 +30,7 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) : ...@@ -30,7 +30,7 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
{ {
p_input = NULL; p_input = NULL;
/* Subscribe to updates */ /* Subscribe to updates */
QObject::connect( DialogsProvider::getInstance( p_intf )->fixed_timer, connect( DialogsProvider::getInstance( p_intf )->fixed_timer,
SIGNAL( timeout() ), this, SLOT( update() ) ); SIGNAL( timeout() ), this, SLOT( update() ) );
} }
......
...@@ -37,27 +37,21 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -37,27 +37,21 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
p_input = NULL; p_input = NULL;
main_input_manager = new InputManager( this, p_intf ); 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 */ /* Get timer updates */
QObject::connect( DialogsProvider::getInstance(NULL)->fixed_timer, connect( DialogsProvider::getInstance(NULL)->fixed_timer,
SIGNAL( timeout() ), this, SLOT(updateOnTimer() ) ); SIGNAL( timeout() ), this, SLOT(updateOnTimer() ) );
/* Tell input manager about the input changes */ /* Tell input manager about the input changes */
QObject::connect( this, SIGNAL( inputChanged( input_thread_t * ) ), connect( this, SIGNAL( inputChanged( input_thread_t * ) ),
main_input_manager, SLOT( setInput( input_thread_t * ) ) ); main_input_manager, SLOT( setInput( input_thread_t * ) ) );
/* Connect the slider and the input manager (both ways) */ /* Connect the slider and the input manager (both ways) */
QObject::connect( main_input_manager, SIGNAL(positionUpdated( connect( main_input_manager, SIGNAL(positionUpdated( float, int, int ) ),
float, int, int ) ), slider, SLOT( setPosition( float,int, slider, SLOT( setPosition( float,int, int ) ) );
int ) ) ); connect( slider, SIGNAL( sliderDragged( float ) ),
QObject::connect( slider, SIGNAL( sliderDragged( float ) ),
main_input_manager, SLOT( sliderUpdate( float ) ) ); main_input_manager, SLOT( sliderUpdate( float ) ) );
/* Connect the display and the input manager */ /* Connect the display and the input manager */
......
...@@ -36,7 +36,6 @@ class MainInterface : public QVLCFrame ...@@ -36,7 +36,6 @@ class MainInterface : public QVLCFrame
public: public:
MainInterface( intf_thread_t *); MainInterface( intf_thread_t *);
virtual ~MainInterface(); virtual ~MainInterface();
void init();
protected: protected:
void closeEvent( QCloseEvent *); void closeEvent( QCloseEvent *);
private: private:
......
...@@ -124,7 +124,6 @@ static void Init( intf_thread_t *p_intf ) ...@@ -124,7 +124,6 @@ static void Init( intf_thread_t *p_intf )
{ {
MainInterface *p_mi = new MainInterface( p_intf ); MainInterface *p_mi = new MainInterface( p_intf );
p_intf->p_sys->p_mi = p_mi; p_intf->p_sys->p_mi = p_mi;
p_mi->init();
p_mi->show(); 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,8 +37,7 @@ InputSlider::InputSlider( Qt::Orientation q,QWidget *_parent ) : ...@@ -37,8 +37,7 @@ InputSlider::InputSlider( Qt::Orientation q,QWidget *_parent ) :
setSingleStep( 2 ); setSingleStep( 2 );
setPageStep( 1000 ); setPageStep( 1000 );
setTracking( true ); setTracking( true );
QObject::connect( this, SIGNAL( valueChanged(int) ), this, connect( this, SIGNAL( valueChanged(int) ), this, SLOT( userDrag( int ) ) );
SLOT( userDrag( int ) ) );
} }
void InputSlider::setPosition( float pos, int a, int b ) void InputSlider::setPosition( float pos, int a, int b )
......
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