summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
authorsimon <simon>2002-12-11 00:03:47 (UTC)
committer simon <simon>2002-12-11 00:03:47 (UTC)
commite9d1213578b83f8380c4681186246a2b32ae6375 (patch) (unidiff)
tree8d18cd8172ff45c85c8438cf5f16d630a7bb5aeb /noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
parent7f4bd526d59aacbf750e9ee58337b6cf640ba28b (diff)
downloadopie-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.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidgetgui.cpp32
1 files changed, 27 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
index 5886458..23b7a70 100644
--- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
@@ -121,16 +121,15 @@ PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidg
121 121
122 tabWidget = new QTabWidget( hbox6, "tabWidget" ); 122 tabWidget = new QTabWidget( hbox6, "tabWidget" );
123 123
124 QWidget *pTab; 124 playListTab = new QWidget( tabWidget, "PlayListTab" );
125 pTab = new QWidget( tabWidget, "pTab" ); 125 tabWidget->insertTab( playListTab, "Playlist");
126 tabWidget->insertTab( pTab, "Playlist");
127 126
128 QGridLayout *Playout = new QGridLayout( pTab ); 127 QGridLayout *Playout = new QGridLayout( playListTab );
129 Playout->setSpacing( 2); 128 Playout->setSpacing( 2);
130 Playout->setMargin( 2); 129 Playout->setMargin( 2);
131 130
132 // Add the playlist area 131 // Add the playlist area
133 QVBox *vbox3 = new QVBox( pTab ); 132 QVBox *vbox3 = new QVBox( playListTab );
134 d->playListFrame = vbox3; 133 d->playListFrame = vbox3;
135 134
136 QHBox *hbox2 = new QHBox( vbox3 ); 135 QHBox *hbox2 = new QHBox( vbox3 );
@@ -204,3 +203,26 @@ void PlayListWidgetGui::setActiveWindow() {
204 mediaPlayerState.setDisplayType( origDisplayType ); // now switch back 203 mediaPlayerState.setDisplayType( origDisplayType ); // now switch back
205} 204}
206 205
206PlayButton::PlayButton( MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name,
207 const QString &icon, QObject *handler, const QString &slot, bool t )
208 : ToolButton( parent, name, icon, handler, slot, t ), mediaPlayerState( _mediaPlayerState ),
209 m_lastEnableStatus( true )
210{
211 connect( &mediaPlayerState, SIGNAL( initialized() ),
212 this, SLOT( checkInitializationStatus() ) );
213}
214
215void PlayButton::setEnabled( bool enable )
216{
217 m_lastEnableStatus = enable;
218
219 enable &= mediaPlayerState.isInitialized();
220
221 ToolButton::setEnabled( enable );
222}
223
224void PlayButton::checkInitializationStatus()
225{
226 setEnabled( m_lastEnableStatus );
227}
228