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 | |||
@@ -112,34 +112,33 @@ PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidg | |||
112 | 112 | ||
113 | gammaMenu->insertItem( gammaSlider ); | 113 | gammaMenu->insertItem( gammaSlider ); |
114 | gammaMenu->insertItem( gammaLCD ); | 114 | gammaMenu->insertItem( gammaLCD ); |
115 | 115 | ||
116 | connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); | 116 | connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); |
117 | 117 | ||
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 ); |
140 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); | 139 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); |
141 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch | 140 | QVBox *stretch1 = new QVBox( vbox1 ); // add stretch |
142 | 141 | ||
143 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); | 142 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); |
144 | 143 | ||
145 | QWidget *aTab; | 144 | QWidget *aTab; |
@@ -195,12 +194,35 @@ void PlayListWidgetGui::setView( char view ) { | |||
195 | hide(); | 194 | hide(); |
196 | } | 195 | } |
197 | 196 | ||
198 | 197 | ||
199 | void PlayListWidgetGui::setActiveWindow() { | 198 | void PlayListWidgetGui::setActiveWindow() { |
200 | // qDebug("SETTING active window"); | 199 | // qDebug("SETTING active window"); |
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 | |||