author | simon <simon> | 2002-12-11 00:03:47 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-11 00:03:47 (UTC) |
commit | e9d1213578b83f8380c4681186246a2b32ae6375 (patch) (side-by-side diff) | |
tree | 8d18cd8172ff45c85c8438cf5f16d630a7bb5aeb /noncore/multimedia/opieplayer2/playlistwidgetgui.h | |
parent | 7f4bd526d59aacbf750e9ee58337b6cf640ba28b (diff) | |
download | opie-e9d1213578b83f8380c4681186246a2b32ae6375.zip opie-e9d1213578b83f8380c4681186246a2b32ae6375.tar.gz opie-e9d1213578b83f8380c4681186246a2b32ae6375.tar.bz2 |
- added initialize states to MediaPlayerState
- the play button is now of type PlayButton, inheritting from ToolButton
and checking the media player initialization state in setEnabled
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidgetgui.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.h b/noncore/multimedia/opieplayer2/playlistwidgetgui.h index 0d8af43..1aa8ac8 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.h +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.h @@ -61,37 +61,55 @@ class QAction; class QLabel; class PlayListWidgetPrivate { public: QToolButton *tbPlay, *tbFull, *tbLoop, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; QFrame *playListFrame; PlayListSelection *selectedFiles; bool setDocumentUsed; }; class ToolButton : public QToolButton { + Q_OBJECT public: ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) : QToolButton( parent, name ) { setTextLabel( name ); setPixmap( Resource::loadPixmap( icon ) ); setAutoRaise( TRUE ); setFocusPolicy( QWidget::NoFocus ); setToggleButton( t ); connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); QPEMenuToolFocusManager::manager()->addWidget( this ); } }; +class PlayButton : public ToolButton +{ + Q_OBJECT +public: + PlayButton( MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name, + const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ); + +protected: + virtual void setEnabled( bool enable ); + +private slots: + void checkInitializationStatus(); + +private: + MediaPlayerState &mediaPlayerState; + bool m_lastEnableStatus : 1; +}; class MenuItem : public QAction { public: MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) : QAction( text, QString::null, 0, 0 ) { connect( this, SIGNAL( activated() ), handler, slot ); addTo( parent ); } }; class PlayListWidgetGui : public QMainWindow { @@ -113,20 +131,21 @@ protected: bool insanityBool; QString setDocFileRef; // retrieve the current playlist entry (media file link) QPushButton *tbDeletePlaylist; int selected; QPopupMenu *pmPlayList; FileSelector* playLists; QPopupMenu *skinsMenu; PlayListWidgetPrivate *d; // Private implementation data QVBox *vbox1; QVBox *vbox5; QPEToolBar *bar; + QWidget *playListTab; void setActiveWindow(); // need to handle this to show the right view void setView( char ); MediaPlayerState &mediaPlayerState; }; #endif |