view->header()->hide();
view->setModel( model );
- connect( view, SIGNAL( activated( const QModelIndex& ) ),
- this, SLOT( setSource( const QModelIndex& ) ) );
- connect( view, SIGNAL( clicked( const QModelIndex& ) ),
- this, SLOT( setSource( const QModelIndex& ) ) );
+ CONNECT( view, activated( const QModelIndex& ),
+ this, setSource( const QModelIndex& ) );
+ CONNECT( view, clicked( const QModelIndex& ),
+ this, setSource( const QModelIndex& ) );
QVBoxLayout *layout = new QVBoxLayout();
layout->setSpacing( 0 ); layout->setMargin( 0 );
if( model->hasRepeat() ) repeatButton->setText( qtr( "Repeat One" ) );
else if( model->hasLoop() ) repeatButton->setText( qtr( "Repeat All" ) );
else repeatButton->setText( qtr( "No Repeat" ) );
- connect( repeatButton, SIGNAL( clicked() ), this, SLOT( toggleRepeat() ));
+ BUTTONACT( repeatButton, toggleRepeat() );
randomButton = new QPushButton( 0 ); buttons->addWidget( randomButton );
if( model->hasRandom() ) randomButton->setText( qtr( "Random" ) );
else randomButton->setText( qtr( "No random" ) );
- connect( randomButton, SIGNAL( clicked() ), this, SLOT( toggleRandom() ));
+ BUTTONACT( randomButton, toggleRandom() );
QSpacerItem *spacer = new QSpacerItem( 10, 20 );buttons->addItem( spacer );
QLabel *filter = new QLabel( qfu( "&Search:" ) + " " );
buttons->addWidget( filter );
searchLine = new ClickLineEdit( qfu( "Playlist filter" ), 0 );
- connect( searchLine, SIGNAL( textChanged(QString) ),
- this, SLOT( search(QString)) );
+ CONNECT( searchLine, textChanged(QString), this, search(QString));
buttons->addWidget( searchLine ); filter->setBuddy( searchLine );
QPushButton *clear = new QPushButton( qfu( "CL") );
buttons->addWidget( clear );
- connect( clear, SIGNAL( clicked() ), this, SLOT( clearFilter() ) );
+ BUTTONACT( clear, clearFilter() );
layout->addWidget( view );
layout->addLayout( buttons );
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
- connect( DialogsProvider::getInstance(NULL)->fixed_timer,
- SIGNAL( timeout() ), this, SLOT( update() ) );
+ ON_TIMEOUT( update() );
if( always )
{
- DrawBackground();
- connect( THEMIM->getIM(), SIGNAL( audioStarted() ),
- this, SLOT( hasAudio() ) );
- connect( THEMIM->getIM(), SIGNAL( audioStarted() ),
- this, SLOT( hasVideo() ) );
+ DrawBackground();
+ CONNECT( THEMIM->getIM(), audioStarted(), this, hasAudio() );
+ CONNECT( THEMIM->getIM(), audioStarted(), this, hasVideo() );
}
need_update = false;
}
layout->addWidget( clearButton, 2, 1 );
layout->addWidget( closeButton, 2, 2 );
- connect( closeButton, SIGNAL( clicked() ), this, SLOT( onClose() ));
- connect( clearButton, SIGNAL( clicked() ), this, SLOT( onClear() ));
- connect( stopShowing, SIGNAL( clicked() ), this, SLOT( dontShow() ) );
+ BUTTONACT( closeButton, close() );
+ BUTTONACT( clearButton, clear() );
+ BUTTONACT( stopShowing, dontShow() );
}
void ErrorsDialog::addError( QString title, QString text )
show();
}
-void ErrorsDialog::onClose()
+void ErrorsDialog::close()
{
hide();
}
-void ErrorsDialog::onClear()
+void ErrorsDialog::clear()
{
messages->clear();
}
QCheckBox *stopShowing;
QTextEdit *messages;
public slots:
- void onClose();
- void onClear();
+ void close();
+ void clear();
void dontShow();
};
&altButton, p_dialog->psz_alternate_button,
&otherButton, p_dialog->psz_other_button );
if( p_dialog->psz_default_button )
- connect( defaultButton, SIGNAL( clicked() ),
- this, SLOT( defaultB() ) );
+ BUTTONACT( defaultButton, defaultB );
if( p_dialog->psz_alternate_button )
- connect( altButton, SIGNAL( clicked() ), this, SLOT( altB() ) );
+ BUTTONACT( altButton, altB );
if( p_dialog->psz_other_button )
- connect( otherButton, SIGNAL( clicked() ), this, SLOT( otherB() ) );
+ BUTTONACT( otherButton, otherB );
setLayout( layout );
setWindowTitle( qfu( p_dialog->psz_title ) );
}
layout->addWidget(clearButton, 1, 4 );
layout->addWidget(closeButton, 1, 5 );
- CONNECT( closeButton, clicked(), this, close() );
- CONNECT( clearButton, clicked(), this, clear() );
- CONNECT( saveLogButton, clicked(), this, save() );
- CONNECT( THEDP->fixed_timer, timeout(), this, updateLog() );
+ BUTTONACT( closeButton, close() );
+ BUTTONACT( clearButton, clear() );
+ BUTTONACT( saveLogButton, save() );
+ ON_TIMEOUT( updateLog() );
}
MessagesDialog::~MessagesDialog()
i_start != i_stop;
i_start = (i_start+1) % VLC_MSG_QSIZE )
{
- // [FIXME] Does not work as the old one
- // Outputs too much data ?
- // if (p_sub->p_msg[i_start].i_type = VLC_MSG_ERR)
- // continue;
- // if( !b_verbose &&
- // VLC_MSG_ERR != p_sub->p_msg[i_start].i_type )
- // continue;
-
- /* Append all messages to log window */
-
if( p_sub->p_msg[i_start].i_type == VLC_MSG_INFO ||
p_sub->p_msg[i_start].i_type == VLC_MSG_ERR ||
p_sub->p_msg[i_start].i_type == VLC_MSG_WARN &&
setWindowTitle( qtr( "Playlist" ) );
SDMapper = new QSignalMapper();
- connect( SDMapper, SIGNAL( mapped (QString)), this,
- SLOT( SDMenuAction( QString ) ) );
+ CONNECT( SDMapper, mapped (QString), this, SDMenuAction( QString ) );
createPlMenuBar( menuBar(), p_intf );
selector = new PLSelector( centralWidget(), p_intf, THEPL );
rightPanel = qobject_cast<PLPanel *>(new StandardPLPanel( centralWidget(),
p_intf, THEPL, p_root ) );
- connect( selector, SIGNAL( activated( int ) ),
- rightPanel, SLOT( setRoot( int ) ) );
+ CONNECT( selector, activated( int ), rightPanel, setRoot( int ) );
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( selector, 0 );
{
a->setChecked( true );
}
- connect( a , SIGNAL( triggered() ), SDMapper, SLOT( map() ) );
+ CONNECT( a , trigerred(), SDMapper, map() );
SDMapper->setMapping( a, i>=0? p_parser->pp_shortcuts[i] :
p_parser->psz_object_name );
menu->addAction( a );
main_layout->addLayout( buttonsLayout, 2,0, 1 ,3 );
setLayout( main_layout );
- CONNECT( save, clicked(), this, save() );
- CONNECT( cancel, clicked(), this, cancel() );
- CONNECT( small, clicked(), this, setSmall() );
- CONNECT( all, clicked(), this, setAll() );
+ BUTTONACT( save, save() );
+ BUTTONACT( cancel, cancel() );
+ BUTTONACT( small, setSmall() );
+ BUTTONACT( all, setAll() );
for( int i = 0; i < SPrefsMax ; i++ ) simple_panels[i] = NULL;
}
if( !advanced_tree )
{
advanced_tree = new PrefsTree( p_intf, tree_panel );
- connect( advanced_tree,
- SIGNAL( currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem *) ),
- this, SLOT( changePanel( QTreeWidgetItem * ) ) );
+ CONNECT( advanced_tree,
+ currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem *),
+ this, changePanel( QTreeWidgetItem * ) );
}
tree_panel_l->addWidget( advanced_tree );
advanced_tree->show();
{
setWindowTitle( _("Stream information" ) );
ISP = new InputStatsPanel( this, p_intf );
- connect( DialogsProvider::getInstance(NULL)->fixed_timer,
- SIGNAL( timeout() ), this, SLOT(update() ) );
+ ON_TIMEOUT( update() );
p_input = NULL;
}
{
i_old_playing_status = END_S;
p_input = NULL;
- CONNECT( THEDP->fixed_timer, timeout(), this, update() );
+ ON_TIMEOUT( update() );
}
InputManager::~InputManager()
{
p_input = NULL;
im = new InputManager( this, p_intf );
- /* Get timer updates */
- CONNECT( THEDP->fixed_timer, timeout(), this, updateInput() );
+ ON_TIMEOUT( updateInput() );
/* Warn our embedded IM about input changes */
CONNECT( this, inputChanged( input_thread_t * ),
im, setInput( input_thread_t * ) );
/* Init input manager */
MainInputManager::getInstance( p_intf );
+ ON_TIMEOUT( updateOnTimer() );
/* Volume control */
- connect( ui.volumeSlider, SIGNAL( valueChanged(int) ),
- this, SLOT( updateVolume(int) ) );
-
- /* Get timer updates */
- connect( THEDP->fixed_timer, SIGNAL( timeout() ),
- this, SLOT(updateOnTimer() ) );
-
+ CONNECT( ui.volumeSlider, valueChanged(int), this, updateVolume(int) );
/* Connect the input manager to the GUI elements it manages */
- connect( THEMIM->getIM(),SIGNAL(positionUpdated( float, int, int ) ),
- slider, SLOT( setPosition( float,int, int ) ) );
- connect( THEMIM->getIM(), SIGNAL( positionUpdated( float, int, int ) ),
- this, SLOT( setDisplay( float, int, int ) ) );
- connect( THEMIM->getIM(), SIGNAL( nameChanged( QString ) ),
- this, SLOT( setName( QString ) ) );
- connect( THEMIM->getIM(), SIGNAL( statusChanged( int ) ),
- this, SLOT( setStatus( int ) ) );
- connect( slider, SIGNAL( sliderDragged( float ) ),
- THEMIM->getIM(),SLOT( sliderUpdate( float ) ) );
+ CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ),
+ slider, setPosition( float,int, int ) );
+ CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ),
+ this, setDisplay( float, int, int ) );
+ CONNECT( THEMIM->getIM(), nameChanged( QString ), this,setName( QString ) );
+ CONNECT( THEMIM->getIM(), statusChanged( int ), this, setStatus( int ) );
+ CONNECT( slider, sliderDragged( float ),
+ THEMIM->getIM(), sliderUpdate( float ) );
/* Actions */
- connect( ui.playButton, SIGNAL( clicked() ), this, SLOT( play() ) );
- connect( ui.stopButton, SIGNAL( clicked() ), this, SLOT( stop() ) );
- connect( ui.nextButton, SIGNAL( clicked() ), this, SLOT( next() ) );
- connect( ui.prevButton, SIGNAL( clicked() ), this, SLOT( prev() ) );
-
- connect( ui.playlistButton, SIGNAL(clicked()),
- THEDP, SLOT( playlistDialog() ) );
+ BUTTONACT( ui.playButton, play() );
+ BUTTONACT( ui.stopButton, stop() );
+ BUTTONACT( ui.nextButton, next() );
+ BUTTONACT( ui.prevButton, prev() );
+ CONNECT( ui.playlistButton, clicked(), THEDP, playlistDialog() );
var_Create( p_intf, "interaction", VLC_VAR_ADDRESS );
var_AddCallback( p_intf, "interaction", InteractCallback, this );
#define BAR_DADD( func, title, id ) { \
QMenu *menu = func; menu->setTitle( title ); bar->addMenu( menu ); \
MenuFunc *f = new MenuFunc( menu, id ); \
- connect( menu, SIGNAL( aboutToShow() ), \
- THEDP->menusUpdateMapper, SLOT(map()) ); \
+ CONNECT( menu, aboutToShow(), THEDP->menusUpdateMapper, map() ); \
THEDP->menusUpdateMapper->setMapping( menu, f ); }
void QVLCMenu::createMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
#define qta( i ) i.toAscii().data()
#define CONNECT( a, b, c, d ) connect( a, SIGNAL( b ), c, SLOT(d) )
+#define BUTTONACT( b, a ) connect( b, SIGNAL( clicked() ), this, SLOT(a) )
+#define ON_TIMEOUT( act ) CONNECT( THEDP->fixed_timer, timeout, this, act )
static int DialogEvent_Type = QEvent::User + 1;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+#include "qt4.hpp"
#include "util/input_slider.hpp"
InputSlider::InputSlider( QWidget *_parent ) : DirectSlider( _parent )
setSingleStep( 2 );
setPageStep( 10 );
setTracking( true );
- connect( this, SIGNAL( valueChanged(int) ), this, SLOT( userDrag( int ) ) );
+ CONNECT( this, valueChanged(int), this, userDrag( int ) );
}
void InputSlider::setPosition( float pos, int a, int b )