author | simon <simon> | 2002-12-02 22:51:21 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 22:51:21 (UTC) |
commit | b3bf297da8836a678a21f2ebe83e0f1961f91d97 (patch) (unidiff) | |
tree | fa5fa20421d833816d355c109458661b2f245177 | |
parent | 649ea9e9586ce51847ebeb9c062290137c9248f4 (diff) | |
download | opie-b3bf297da8836a678a21f2ebe83e0f1961f91d97.zip opie-b3bf297da8836a678a21f2ebe83e0f1961f91d97.tar.gz opie-b3bf297da8836a678a21f2ebe83e0f1961f91d97.tar.bz2 |
- centralized closeEvent implementation
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 1 |
6 files changed, 7 insertions, 12 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 3070bc3..f6e6086 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -433,21 +433,16 @@ void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { | |||
433 | 433 | ||
434 | 434 | ||
435 | void AudioWidget::showEvent( QShowEvent* ) { | 435 | void AudioWidget::showEvent( QShowEvent* ) { |
436 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | 436 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); |
437 | mouseMoveEvent( &event ); | 437 | mouseMoveEvent( &event ); |
438 | } | 438 | } |
439 | 439 | ||
440 | 440 | ||
441 | void AudioWidget::closeEvent( QCloseEvent* ) { | ||
442 | mediaPlayerState.setList(); | ||
443 | } | ||
444 | |||
445 | |||
446 | void AudioWidget::paintEvent( QPaintEvent * pe ) { | 441 | void AudioWidget::paintEvent( QPaintEvent * pe ) { |
447 | if ( !pe->erased() ) { | 442 | if ( !pe->erased() ) { |
448 | // Combine with background and double buffer | 443 | // Combine with background and double buffer |
449 | QPixmap pix( pe->rect().size() ); | 444 | QPixmap pix( pe->rect().size() ); |
450 | QPainter p( &pix ); | 445 | QPainter p( &pix ); |
451 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 446 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); |
452 | p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); | 447 | p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); |
453 | for ( int i = 0; i < numButtons; i++ ) | 448 | for ( int i = 0; i < numButtons; i++ ) |
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 1778a30..f092699 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h | |||
@@ -80,17 +80,16 @@ protected: | |||
80 | void doUnblank(); | 80 | void doUnblank(); |
81 | void paintEvent( QPaintEvent *pe ); | 81 | void paintEvent( QPaintEvent *pe ); |
82 | void showEvent( QShowEvent *se ); | 82 | void showEvent( QShowEvent *se ); |
83 | void resizeEvent( QResizeEvent *re ); | 83 | void resizeEvent( QResizeEvent *re ); |
84 | void mouseMoveEvent( QMouseEvent *event ); | 84 | void mouseMoveEvent( QMouseEvent *event ); |
85 | void mousePressEvent( QMouseEvent *event ); | 85 | void mousePressEvent( QMouseEvent *event ); |
86 | void mouseReleaseEvent( QMouseEvent *event ); | 86 | void mouseReleaseEvent( QMouseEvent *event ); |
87 | void timerEvent( QTimerEvent *event ); | 87 | void timerEvent( QTimerEvent *event ); |
88 | void closeEvent( QCloseEvent *event ); | ||
89 | void keyReleaseEvent( QKeyEvent *e); | 88 | void keyReleaseEvent( QKeyEvent *e); |
90 | private slots: | 89 | private slots: |
91 | void skipFor(); | 90 | void skipFor(); |
92 | void skipBack(); | 91 | void skipBack(); |
93 | void stopSkip(); | 92 | void stopSkip(); |
94 | private: | 93 | private: |
95 | void toggleButton( int ); | 94 | void toggleButton( int ); |
96 | void setToggleButton( int, bool ); | 95 | void setToggleButton( int, bool ); |
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 01a7295..2992fd6 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -33,16 +33,21 @@ MediaWidget::MediaWidget( MediaPlayerState &_mediaPlayerState, QWidget *parent, | |||
33 | connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), | 33 | connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), |
34 | this, SLOT( setPlaying( bool ) ) ); | 34 | this, SLOT( setPlaying( bool ) ) ); |
35 | } | 35 | } |
36 | 36 | ||
37 | MediaWidget::~MediaWidget() | 37 | MediaWidget::~MediaWidget() |
38 | { | 38 | { |
39 | } | 39 | } |
40 | 40 | ||
41 | void MediaWidget::closeEvent( QCloseEvent * ) | ||
42 | { | ||
43 | mediaPlayerState.setList(); | ||
44 | } | ||
45 | |||
41 | void MediaWidget::handleCommand( Command command, bool buttonDown ) | 46 | void MediaWidget::handleCommand( Command command, bool buttonDown ) |
42 | { | 47 | { |
43 | switch ( command ) { | 48 | switch ( command ) { |
44 | case Play: mediaPlayerState.togglePaused(); | 49 | case Play: mediaPlayerState.togglePaused(); |
45 | case Stop: mediaPlayerState.setPlaying(FALSE); return; | 50 | case Stop: mediaPlayerState.setPlaying(FALSE); return; |
46 | case Next: if( playList->currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; | 51 | case Next: if( playList->currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; |
47 | case Previous: if( playList->currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; | 52 | case Previous: if( playList->currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; |
48 | case Loop: mediaPlayerState.setLooping( buttonDown ); return; | 53 | case Loop: mediaPlayerState.setLooping( buttonDown ); return; |
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index 550f0fc..e3f09ce 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h | |||
@@ -40,16 +40,18 @@ public slots: | |||
40 | 40 | ||
41 | signals: | 41 | signals: |
42 | void moreReleased(); | 42 | void moreReleased(); |
43 | void lessReleased(); | 43 | void lessReleased(); |
44 | void forwardReleased(); | 44 | void forwardReleased(); |
45 | void backReleased(); | 45 | void backReleased(); |
46 | 46 | ||
47 | protected: | 47 | protected: |
48 | virtual void closeEvent( QCloseEvent * ); | ||
49 | |||
48 | void handleCommand( Command command, bool buttonDown ); | 50 | void handleCommand( Command command, bool buttonDown ); |
49 | 51 | ||
50 | MediaPlayerState &mediaPlayerState; | 52 | MediaPlayerState &mediaPlayerState; |
51 | }; | 53 | }; |
52 | 54 | ||
53 | #endif // MEDIAWIDGET_H | 55 | #endif // MEDIAWIDGET_H |
54 | /* vim: et sw=4 ts=4 | 56 | /* vim: et sw=4 ts=4 |
55 | */ | 57 | */ |
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index b4ecb4c..41dddb7 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -442,21 +442,16 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { | |||
442 | for ( int i = 0; i < numVButtons; i++ ) | 442 | for ( int i = 0; i < numVButtons; i++ ) |
443 | paintButton( &p, i ); | 443 | paintButton( &p, i ); |
444 | } | 444 | } |
445 | //slider->repaint( TRUE ); | 445 | //slider->repaint( TRUE ); |
446 | } | 446 | } |
447 | } | 447 | } |
448 | 448 | ||
449 | 449 | ||
450 | void VideoWidget::closeEvent( QCloseEvent* ) { | ||
451 | mediaPlayerState.setList(); | ||
452 | } | ||
453 | |||
454 | |||
455 | void VideoWidget::keyReleaseEvent( QKeyEvent *e) { | 450 | void VideoWidget::keyReleaseEvent( QKeyEvent *e) { |
456 | switch ( e->key() ) { | 451 | switch ( e->key() ) { |
457 | ////////////////////////////// Zaurus keys | 452 | ////////////////////////////// Zaurus keys |
458 | case Key_Home: | 453 | case Key_Home: |
459 | break; | 454 | break; |
460 | case Key_F9: //activity | 455 | case Key_F9: //activity |
461 | break; | 456 | break; |
462 | case Key_F10: //contacts | 457 | case Key_F10: //contacts |
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index 38eb726..149c78e 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h | |||
@@ -86,17 +86,16 @@ signals: | |||
86 | protected: | 86 | protected: |
87 | 87 | ||
88 | void resizeEvent( QResizeEvent * ); | 88 | void resizeEvent( QResizeEvent * ); |
89 | void paintEvent( QPaintEvent *pe ); | 89 | void paintEvent( QPaintEvent *pe ); |
90 | void showEvent( QShowEvent *se ); | 90 | void showEvent( QShowEvent *se ); |
91 | void mouseMoveEvent( QMouseEvent *event ); | 91 | void mouseMoveEvent( QMouseEvent *event ); |
92 | void mousePressEvent( QMouseEvent *event ); | 92 | void mousePressEvent( QMouseEvent *event ); |
93 | void mouseReleaseEvent( QMouseEvent *event ); | 93 | void mouseReleaseEvent( QMouseEvent *event ); |
94 | void closeEvent( QCloseEvent *event ); | ||
95 | void keyReleaseEvent( QKeyEvent *e); | 94 | void keyReleaseEvent( QKeyEvent *e); |
96 | 95 | ||
97 | private: | 96 | private: |
98 | // Ticker songInfo; | 97 | // Ticker songInfo; |
99 | QPixmap *pixBg; | 98 | QPixmap *pixBg; |
100 | QImage *imgUp; | 99 | QImage *imgUp; |
101 | QImage *imgDn; | 100 | QImage *imgDn; |
102 | QImage *imgButtonMask; | 101 | QImage *imgButtonMask; |