Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidgetgui.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 32 |
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 | |||
@@ -118,22 +118,21 @@ PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidg | |||
118 | vbox5 = new QVBox( this ); | 118 | vbox5 = new QVBox( this ); |
119 | QVBox *vbox4 = new QVBox( vbox5 ); | 119 | QVBox *vbox4 = new QVBox( vbox5 ); |
120 | QHBox *hbox6 = new QHBox( vbox4 ); | 120 | QHBox *hbox6 = new QHBox( vbox4 ); |
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 ); |
137 | d->selectedFiles = new PlayListSelection( hbox2 ); | 136 | d->selectedFiles = new PlayListSelection( hbox2 ); |
138 | 137 | ||
139 | vbox1 = new QVBox( hbox2 ); | 138 | vbox1 = new QVBox( hbox2 ); |
@@ -201,6 +200,29 @@ void PlayListWidgetGui::setActiveWindow() { | |||
201 | // When we get raised we need to ensure that it switches views | 200 | // When we get raised we need to ensure that it switches views |
202 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState.displayType(); | 201 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState.displayType(); |
203 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); // invalidate | 202 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); // invalidate |
204 | mediaPlayerState.setDisplayType( origDisplayType ); // now switch back | 203 | mediaPlayerState.setDisplayType( origDisplayType ); // now switch back |
205 | } | 204 | } |
206 | 205 | ||
206 | PlayButton::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 | |||
215 | void PlayButton::setEnabled( bool enable ) | ||
216 | { | ||
217 | m_lastEnableStatus = enable; | ||
218 | |||
219 | enable &= mediaPlayerState.isInitialized(); | ||
220 | |||
221 | ToolButton::setEnabled( enable ); | ||
222 | } | ||
223 | |||
224 | void PlayButton::checkInitializationStatus() | ||
225 | { | ||
226 | setEnabled( m_lastEnableStatus ); | ||
227 | } | ||
228 | |||