Commit a587c752 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: trigger epg on program doubleclick

parent e6d4348b
...@@ -550,7 +550,7 @@ void CoverArtLabel::askForUpdate() ...@@ -550,7 +550,7 @@ void CoverArtLabel::askForUpdate()
} }
TimeLabel::TimeLabel( intf_thread_t *_p_intf, TimeLabel::Display _displayType ) TimeLabel::TimeLabel( intf_thread_t *_p_intf, TimeLabel::Display _displayType )
: QLabel(), p_intf( _p_intf ), bufTimer( new QTimer(this) ), : ClickableQLabel(), p_intf( _p_intf ), bufTimer( new QTimer(this) ),
buffering( false ), showBuffering(false), bufVal( -1 ), displayType( _displayType ) buffering( false ), showBuffering(false), bufVal( -1 ), displayType( _displayType )
{ {
b_remainingTime = false; b_remainingTime = false;
......
...@@ -118,7 +118,20 @@ private slots: ...@@ -118,7 +118,20 @@ private slots:
}; };
#endif #endif
class TimeLabel : public QLabel class ClickableQLabel : public QLabel
{
Q_OBJECT
public:
virtual void mouseDoubleClickEvent( QMouseEvent *event )
{
Q_UNUSED( event );
emit doubleClicked();
}
signals:
void doubleClicked();
};
class TimeLabel : public ClickableQLabel
{ {
Q_OBJECT Q_OBJECT
public: public:
...@@ -142,7 +155,7 @@ protected: ...@@ -142,7 +155,7 @@ protected:
if( displayType != TimeLabel::Both ) return; if( displayType != TimeLabel::Both ) return;
event->accept(); event->accept();
toggleTimeDisplay(); toggleTimeDisplay();
emit timeLabelDoubleClicked(); ClickableQLabel::mouseDoubleClickEvent( event );
} }
private: private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
...@@ -159,8 +172,6 @@ private: ...@@ -159,8 +172,6 @@ private:
char psz_time[MSTRTIME_MAX_SIZE]; char psz_time[MSTRTIME_MAX_SIZE];
void toggleTimeDisplay(); void toggleTimeDisplay();
void paintEvent( QPaintEvent* ); void paintEvent( QPaintEvent* );
signals:
void timeLabelDoubleClicked();
private slots: private slots:
void setDisplayPosition( float pos, int64_t time, int length ); void setDisplayPosition( float pos, int64_t time, int length );
void setDisplayPosition( float pos ); void setDisplayPosition( float pos );
......
...@@ -459,7 +459,7 @@ inline void MainInterface::createStatusBar() ...@@ -459,7 +459,7 @@ inline void MainInterface::createStatusBar()
QStatusBar *statusBarr = statusBar(); QStatusBar *statusBarr = statusBar();
TimeLabel *timeLabel = new TimeLabel( p_intf ); TimeLabel *timeLabel = new TimeLabel( p_intf );
nameLabel = new QLabel( this ); nameLabel = new ClickableQLabel();
nameLabel->setTextInteractionFlags( Qt::TextSelectableByMouse nameLabel->setTextInteractionFlags( Qt::TextSelectableByMouse
| Qt::TextSelectableByKeyboard ); | Qt::TextSelectableByKeyboard );
SpeedLabel *speedLabel = new SpeedLabel( p_intf, this ); SpeedLabel *speedLabel = new SpeedLabel( p_intf, this );
...@@ -480,11 +480,12 @@ inline void MainInterface::createStatusBar() ...@@ -480,11 +480,12 @@ inline void MainInterface::createStatusBar()
statusBarr->addPermanentWidget( speedLabel, 0 ); statusBarr->addPermanentWidget( speedLabel, 0 );
statusBarr->addPermanentWidget( timeLabel, 0 ); statusBarr->addPermanentWidget( timeLabel, 0 );
CONNECT( nameLabel, doubleClicked(), THEDP, epgDialog() );
/* timeLabel behaviour: /* timeLabel behaviour:
- double clicking opens the goto time dialog - double clicking opens the goto time dialog
- right-clicking and clicking just toggle between remaining and - right-clicking and clicking just toggle between remaining and
elapsed time.*/ elapsed time.*/
CONNECT( timeLabel, timeLabelDoubleClicked(), THEDP, gotoTimeDialog() ); CONNECT( timeLabel, doubleClicked(), THEDP, gotoTimeDialog() );
CONNECT( THEMIM->getIM(), encryptionChanged( bool ), CONNECT( THEMIM->getIM(), encryptionChanged( bool ),
this, showCryptedLabel( bool ) ); this, showCryptedLabel( bool ) );
......
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