Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 395037f..19c8056 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -250,24 +250,25 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
250 | audioView->setMinimumSize(233,260); | 250 | audioView->setMinimumSize(233,260); |
251 | audioView->addColumn( tr("Title"),140); | 251 | audioView->addColumn( tr("Title"),140); |
252 | audioView->addColumn(tr("Size"), -1); | 252 | audioView->addColumn(tr("Size"), -1); |
253 | audioView->addColumn(tr("Media"),-1); | 253 | audioView->addColumn(tr("Media"),-1); |
254 | audioView->addColumn( tr( "Path" ), 0 ); | 254 | audioView->addColumn( tr( "Path" ), 0 ); |
255 | 255 | ||
256 | audioView->setColumnAlignment(1, Qt::AlignRight); | 256 | audioView->setColumnAlignment(1, Qt::AlignRight); |
257 | audioView->setColumnAlignment(2, Qt::AlignRight); | 257 | audioView->setColumnAlignment(2, Qt::AlignRight); |
258 | audioView->setAllColumnsShowFocus(TRUE); | 258 | audioView->setAllColumnsShowFocus(TRUE); |
259 | 259 | ||
260 | audioView->setMultiSelection( TRUE ); | 260 | audioView->setMultiSelection( TRUE ); |
261 | audioView->setSelectionMode( QListView::Extended); | 261 | audioView->setSelectionMode( QListView::Extended); |
262 | audioView->setSorting( 3, TRUE ); | ||
262 | 263 | ||
263 | tabWidget->insertTab(aTab,tr("Audio")); | 264 | tabWidget->insertTab(aTab,tr("Audio")); |
264 | 265 | ||
265 | QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); | 266 | QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); |
266 | 267 | ||
267 | // audioView | 268 | // audioView |
268 | // populateAudioView(); | 269 | // populateAudioView(); |
269 | // videowidget | 270 | // videowidget |
270 | 271 | ||
271 | QWidget *vTab; | 272 | QWidget *vTab; |
272 | vTab = new QWidget( tabWidget, "vTab" ); | 273 | vTab = new QWidget( tabWidget, "vTab" ); |
273 | videoView = new QListView( vTab, "Videoview" ); | 274 | videoView = new QListView( vTab, "Videoview" ); |
@@ -291,37 +292,43 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
291 | LTab = new QWidget( tabWidget, "LTab" ); | 292 | LTab = new QWidget( tabWidget, "LTab" ); |
292 | playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy | 293 | playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy |
293 | playLists->setMinimumSize(233,260); | 294 | playLists->setMinimumSize(233,260); |
294 | tabWidget->insertTab(LTab,tr("Lists")); | 295 | tabWidget->insertTab(LTab,tr("Lists")); |
295 | 296 | ||
296 | connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); | 297 | connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); |
297 | connect( fullScreenButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleFullscreen()) ); | 298 | connect( fullScreenButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleFullscreen()) ); |
298 | connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled()) ); | 299 | connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled()) ); |
299 | 300 | ||
300 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 301 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
301 | this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) ); | 302 | this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) ); |
302 | 303 | ||
304 | |||
305 | ///audioView | ||
303 | connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 306 | connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
304 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); | 307 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); |
305 | 308 | ||
306 | connect( audioView, SIGNAL( returnPressed( QListViewItem *)), | 309 | connect( audioView, SIGNAL( returnPressed( QListViewItem *)), |
307 | this,SLOT( playIt( QListViewItem *)) ); | 310 | this,SLOT( playIt( QListViewItem *)) ); |
308 | connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); | 311 | connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); |
309 | 312 | ||
313 | |||
314 | //videoView | ||
310 | connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 315 | connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
311 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); | 316 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); |
312 | connect( videoView, SIGNAL( returnPressed( QListViewItem *)), | 317 | connect( videoView, SIGNAL( returnPressed( QListViewItem *)), |
313 | this,SLOT( playIt( QListViewItem *)) ); | 318 | this,SLOT( playIt( QListViewItem *)) ); |
314 | connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); | 319 | connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); |
315 | 320 | ||
321 | |||
322 | //playlists | ||
316 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); | 323 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); |
317 | 324 | ||
318 | 325 | ||
319 | connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); | 326 | connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); |
320 | 327 | ||
321 | // connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); | 328 | // connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); |
322 | connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) ); | 329 | connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) ); |
323 | connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); | 330 | connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); |
324 | connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); | 331 | connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); |
325 | 332 | ||
326 | connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); | 333 | connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); |
327 | 334 | ||
@@ -798,42 +805,43 @@ void PlayListWidget::btnPlay(bool b) { | |||
798 | // if( d->selectedFiles->current()->file().find("%20",0,TRUE) != -1) { | 805 | // if( d->selectedFiles->current()->file().find("%20",0,TRUE) != -1) { |
799 | // QMessageBox::message("Note","You are trying to play\na malformed url."); | 806 | // QMessageBox::message("Note","You are trying to play\na malformed url."); |
800 | // } else { | 807 | // } else { |
801 | mediaPlayerState->setPlaying(b); | 808 | mediaPlayerState->setPlaying(b); |
802 | insanityBool=FALSE; | 809 | insanityBool=FALSE; |
803 | qDebug("insanity"); | 810 | qDebug("insanity"); |
804 | // } | 811 | // } |
805 | } | 812 | } |
806 | break; | 813 | break; |
807 | case 1: | 814 | case 1: |
808 | { | 815 | { |
809 | qDebug("2"); | 816 | qDebug("2"); |
817 | // d->selectedFiles->unSelect(); | ||
810 | addToSelection( audioView->currentItem() ); | 818 | addToSelection( audioView->currentItem() ); |
811 | mediaPlayerState->setPlaying(b); | 819 | mediaPlayerState->setPlaying(true); |
812 | d->selectedFiles->removeSelected( ); | 820 | d->selectedFiles->removeSelected( ); |
813 | tabWidget->setCurrentPage(1); | 821 | d->selectedFiles->unSelect(); |
814 | d->selectedFiles->unSelect(); | 822 | tabWidget->setCurrentPage(1); |
815 | insanityBool=FALSE; | 823 | insanityBool=FALSE; |
816 | }// audioView->clearSelection(); | 824 | }// audioView->clearSelection(); |
817 | break; | 825 | break; |
818 | case 2: | 826 | case 2: |
819 | { | 827 | { |
820 | qDebug("3"); | 828 | qDebug("3"); |
821 | 829 | ||
822 | addToSelection( videoView->currentItem() ); | 830 | addToSelection( videoView->currentItem() ); |
823 | mediaPlayerState->setPlaying(b); | 831 | mediaPlayerState->setPlaying(true); |
824 | qApp->processEvents(); | 832 | // qApp->processEvents(); |
825 | d->selectedFiles->removeSelected( ); | 833 | d->selectedFiles->removeSelected( ); |
826 | tabWidget->setCurrentPage(2); | ||
827 | d->selectedFiles->unSelect(); | 834 | d->selectedFiles->unSelect(); |
835 | tabWidget->setCurrentPage(2); | ||
828 | insanityBool=FALSE; | 836 | insanityBool=FALSE; |
829 | }// videoView->clearSelection(); | 837 | }// videoView->clearSelection(); |
830 | break; | 838 | break; |
831 | }; | 839 | }; |
832 | 840 | ||
833 | } | 841 | } |
834 | 842 | ||
835 | void PlayListWidget::deletePlaylist() { | 843 | void PlayListWidget::deletePlaylist() { |
836 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), | 844 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), |
837 | (tr("You really want to delete\nthis playlist?")), | 845 | (tr("You really want to delete\nthis playlist?")), |
838 | (tr("Yes")), (tr("No")), 0 )){ | 846 | (tr("Yes")), (tr("No")), 0 )){ |
839 | case 0: // Yes clicked, | 847 | case 0: // Yes clicked, |