summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp32
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h1
2 files changed, 0 insertions, 33 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 6299328..10f1792 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -816,106 +816,74 @@ void PlayListWidget::btnPlay(bool b) {
816} 816}
817 817
818void PlayListWidget::deletePlaylist() { 818void PlayListWidget::deletePlaylist() {
819 switch( QMessageBox::information( this, (tr("Remove Playlist?")), 819 switch( QMessageBox::information( this, (tr("Remove Playlist?")),
820 (tr("You really want to delete\nthis playlist?")), 820 (tr("You really want to delete\nthis playlist?")),
821 (tr("Yes")), (tr("No")), 0 )){ 821 (tr("Yes")), (tr("No")), 0 )){
822 case 0: // Yes clicked, 822 case 0: // Yes clicked,
823 QFile().remove(playLists->selected()->file()); 823 QFile().remove(playLists->selected()->file());
824 QFile().remove(playLists->selected()->linkFile()); 824 QFile().remove(playLists->selected()->linkFile());
825 playLists->reread(); 825 playLists->reread();
826 break; 826 break;
827 case 1: // Cancel 827 case 1: // Cancel
828 break; 828 break;
829 }; 829 };
830} 830}
831 831
832void PlayListWidget::viewPressed( int mouse, QListViewItem *, const QPoint& , int) { 832void PlayListWidget::viewPressed( int mouse, QListViewItem *, const QPoint& , int) {
833 switch (mouse) { 833 switch (mouse) {
834 case 1: 834 case 1:
835 break; 835 break;
836 case 2:{ 836 case 2:{
837 QPopupMenu m; 837 QPopupMenu m;
838 m.insertItem( tr( "Play" ), this, SLOT( playSelected() )); 838 m.insertItem( tr( "Play" ), this, SLOT( playSelected() ));
839 m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() )); 839 m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() ));
840 m.insertSeparator();
841 m.insertItem( tr( "Properties" ), this, SLOT( listDelete() ));
842 m.exec( QCursor::pos() ); 840 m.exec( QCursor::pos() );
843 } 841 }
844 break; 842 break;
845 }; 843 };
846} 844}
847 845
848void PlayListWidget::playSelected() { 846void PlayListWidget::playSelected() {
849 btnPlay( TRUE); 847 btnPlay( TRUE);
850} 848}
851 849
852void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *, const QPoint& , int ) { 850void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *, const QPoint& , int ) {
853 switch (mouse) { 851 switch (mouse) {
854 case 1: 852 case 1:
855 853
856 break; 854 break;
857 case 2: 855 case 2:
858 { 856 {
859 QPopupMenu m; 857 QPopupMenu m;
860 m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() )); 858 m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() ));
861 m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() )); 859 m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() ));
862 m.exec( QCursor::pos() ); 860 m.exec( QCursor::pos() );
863 } 861 }
864 break; 862 break;
865 }; 863 };
866} 864}
867 865
868void PlayListWidget::listDelete() {
869 Config cfg( "OpiePlayer" );
870 cfg.setGroup("PlayList");
871 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","");
872 QString file;
873 // int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
874 switch ( tabWidget->currentPageIndex()) {
875 case 0:
876 break;
877 case 1:
878 {
879 file = audioView->currentItem()->text(0);
880 QListIterator<DocLnk> Pdit( files.children() );
881 for ( ; Pdit.current(); ++Pdit ) {
882 if( Pdit.current()->name() == file) {
883 LnkProperties prop( Pdit.current() );
884 prop.showMaximized();
885 prop.exec();
886 }
887 }
888 populateAudioView();
889 }
890 break;
891 case 2:
892 {
893
894 }
895 break;
896 };
897}
898 866
899void PlayListWidget::scanForAudio() { 867void PlayListWidget::scanForAudio() {
900 qDebug("scan for audio"); 868 qDebug("scan for audio");
901 files.detachChildren(); 869 files.detachChildren();
902 QListIterator<DocLnk> sdit( files.children() ); 870 QListIterator<DocLnk> sdit( files.children() );
903 for ( ; sdit.current(); ++sdit ) { 871 for ( ; sdit.current(); ++sdit ) {
904 delete sdit.current(); 872 delete sdit.current();
905 } 873 }
906 Global::findDocuments(&files, "audio/*"); 874 Global::findDocuments(&files, "audio/*");
907 audioScan = TRUE; 875 audioScan = TRUE;
908} 876}
909 877
910void PlayListWidget::scanForVideo() { 878void PlayListWidget::scanForVideo() {
911 qDebug("scan for video"); 879 qDebug("scan for video");
912 vFiles.detachChildren(); 880 vFiles.detachChildren();
913 QListIterator<DocLnk> sdit( vFiles.children() ); 881 QListIterator<DocLnk> sdit( vFiles.children() );
914 for ( ; sdit.current(); ++sdit ) { 882 for ( ; sdit.current(); ++sdit ) {
915 delete sdit.current(); 883 delete sdit.current();
916 } 884 }
917 Global::findDocuments(&vFiles, "video/*"); 885 Global::findDocuments(&vFiles, "video/*");
918 videoScan = TRUE; 886 videoScan = TRUE;
919} 887}
920 888
921void PlayListWidget::populateAudioView() { 889void PlayListWidget::populateAudioView() {
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index dd4bee0..8076707 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -77,36 +77,35 @@ private slots:
77 void scanForVideo(); 77 void scanForVideo();
78 void openFile(); 78 void openFile();
79 void setDocument( const QString& fileref ); 79 void setDocument( const QString& fileref );
80 void addToSelection( const DocLnk& ); // Add a media file to the playlist 80 void addToSelection( const DocLnk& ); // Add a media file to the playlist
81 void addToSelection( QListViewItem* ); // Add a media file to the playlist 81 void addToSelection( QListViewItem* ); // Add a media file to the playlist
82 void setActiveWindow(); // need to handle this to show the right view 82 void setActiveWindow(); // need to handle this to show the right view
83 void setPlaylist( bool ); // Show/Hide the playlist 83 void setPlaylist( bool ); // Show/Hide the playlist
84 void setView( char ); 84 void setView( char );
85 void clearList(); 85 void clearList();
86 void addAllToList(); 86 void addAllToList();
87 void addAllMusicToList(); 87 void addAllMusicToList();
88 void addAllVideoToList(); 88 void addAllVideoToList();
89 void saveList(); // Save the playlist 89 void saveList(); // Save the playlist
90 void loadList( const DocLnk &); // Load a playlist 90 void loadList( const DocLnk &); // Load a playlist
91 void playIt( QListViewItem *); 91 void playIt( QListViewItem *);
92 92
93 void btnPlay(bool); 93 void btnPlay(bool);
94 void deletePlaylist(); 94 void deletePlaylist();
95 void addSelected(); 95 void addSelected();
96 void removeSelected(); 96 void removeSelected();
97 void tabChanged(QWidget*); 97 void tabChanged(QWidget*);
98 void viewPressed( int, QListViewItem *, const QPoint&, int); 98 void viewPressed( int, QListViewItem *, const QPoint&, int);
99 void playlistViewPressed( int, QListViewItem *, const QPoint&, int); 99 void playlistViewPressed( int, QListViewItem *, const QPoint&, int);
100 void playSelected(); 100 void playSelected();
101 void listDelete();
102 101
103protected slots: 102protected slots:
104/* void cancelMenuTimer(); */ 103/* void cancelMenuTimer(); */
105/* void showFileMenu(); */ 104/* void showFileMenu(); */
106 105
107 106
108}; 107};
109 108
110 109
111#endif // PLAY_LIST_WIDGET_H 110#endif // PLAY_LIST_WIDGET_H
112 111