summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-06 22:53:11 (UTC)
committer llornkcor <llornkcor>2002-04-06 22:53:11 (UTC)
commit014a5c29fc8a1b2e6bc2ec550134163bea86443c (patch) (unidiff)
treeedad7dd5cabe8891b02875c879b31a15c8251053
parentf79c6b3e3407a4263e7210b52638c4426dea825b (diff)
downloadopie-014a5c29fc8a1b2e6bc2ec550134163bea86443c.zip
opie-014a5c29fc8a1b2e6bc2ec550134163bea86443c.tar.gz
opie-014a5c29fc8a1b2e6bc2ec550134163bea86443c.tar.bz2
translations stuff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp172
-rw-r--r--core/multimedia/opieplayer/playlistwidget.h36
2 files changed, 131 insertions, 77 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index db6533a..3b8f6d7 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -19,8 +19,11 @@
19**********************************************************************/ 19**********************************************************************/
20// code added by L. J. Potter Sat 03-02-2002 06:17:54 20// code added by L. J. Potter Sat 03-02-2002 06:17:54
21#define QTOPIA_INTERNAL_FSLP
22
21#include <qpe/qpemenubar.h> 23#include <qpe/qpemenubar.h>
22#include <qpe/qpetoolbar.h> 24#include <qpe/qpetoolbar.h>
23#include <qpe/fileselector.h> 25#include <qpe/fileselector.h>
24#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
27#include <qpe/lnkproperties.h>
25 28
26#include <qpe/applnk.h> 29#include <qpe/applnk.h>
@@ -208,11 +211,11 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
208 audioView = new QListView( aTab, "Audioview" ); 211 audioView = new QListView( aTab, "Audioview" );
209 audioView->setMinimumSize(233,260); 212 audioView->setMinimumSize(233,260);
210 audioView->addColumn( "Title",140); 213 audioView->addColumn( tr("Title"),140);
211 audioView->addColumn("Size", -1); 214 audioView->addColumn(tr("Size"), -1);
212 audioView->addColumn("Media",-1); 215 audioView->addColumn(tr("Media"),-1);
213 audioView->setColumnAlignment(1, Qt::AlignRight); 216 audioView->setColumnAlignment(1, Qt::AlignRight);
214 audioView->setColumnAlignment(2, Qt::AlignRight); 217 audioView->setColumnAlignment(2, Qt::AlignRight);
215 audioView->setAllColumnsShowFocus(TRUE); 218 audioView->setAllColumnsShowFocus(TRUE);
216 tabWidget->insertTab(aTab,"Audio"); 219 tabWidget->insertTab(aTab,tr("Audio"));
217 220
218 QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); 221 QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold);
@@ -222,18 +225,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
222 225
223// audioView 226// audioView
224 Global::findDocuments(&files, "audio/*"); 227 populateAudioView();
225 QListIterator<DocLnk> dit( files.children() );
226 QString storage;
227 for ( ; dit.current(); ++dit ) {
228 QListViewItem * newItem;
229 if(dit.current()->file().find("/mnt/cf") != -1 ) storage="CF";
230 else if(dit.current()->file().find("/mnt/hda") != -1 ) storage="CF";
231 else if(dit.current()->file().find("/mnt/card") != -1 ) storage="SD";
232 else storage="RAM";
233 if ( QFile( dit.current()->file()).exists() ) {
234 newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage);
235 newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/musicfile" ));
236 }
237 }
238// videowidget 228// videowidget
239 229
@@ -243,7 +233,7 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
243 videoView->setMinimumSize(233,260); 233 videoView->setMinimumSize(233,260);
244 234
245 videoView->addColumn("Title",140); 235 videoView->addColumn(tr("Title"),140);
246 videoView->addColumn("Size",-1); 236 videoView->addColumn(tr("Size"),-1);
247 videoView->addColumn("Media",-1); 237 videoView->addColumn(tr("Media"),-1);
248 videoView->setColumnAlignment(1, Qt::AlignRight); 238 videoView->setColumnAlignment(1, Qt::AlignRight);
249 videoView->setColumnAlignment(2, Qt::AlignRight); 239 videoView->setColumnAlignment(2, Qt::AlignRight);
@@ -253,19 +243,6 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
253 this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); 243 this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) );
254 244
255 tabWidget->insertTab( vTab,"Video"); 245 tabWidget->insertTab( vTab,tr("Video"));
256 246
257 Global::findDocuments(&vFiles, "video/*");
258 QListIterator<DocLnk> Vdit( vFiles.children() );
259 for ( ; Vdit.current(); ++Vdit ) {
260 if( Vdit.current()->file().find("/mnt/cf") != -1 ) storage="CF";
261 else if( Vdit.current()->file().find("/mnt/hda") != -1 ) storage="CF";
262 else if( Vdit.current()->file().find("/mnt/card") != -1 ) storage="SD";
263 else storage="RAM";
264 QListViewItem * newItem;
265 if ( QFile( Vdit.current()->file()).exists() ) {
266 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage);
267 newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/videofile" ));
268 }
269 }
270 247
271//playlists list 248//playlists list
@@ -274,5 +251,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
274 playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy 251 playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy
275 playLists->setMinimumSize(233,260);; 252 playLists->setMinimumSize(233,260);;
276 tabWidget->insertTab(LTab,"Lists"); 253 tabWidget->insertTab(LTab,tr("Lists"));
277 254
278 connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); 255 connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) );
@@ -309,5 +286,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
309// qDebug("currentList is "+currentPlaylist); 286// qDebug("currentList is "+currentPlaylist);
310 loadList(DocLnk( currentPlaylist)); 287 loadList(DocLnk( currentPlaylist));
311 setCaption("OpiePlayer: "+ currentPlaylist ); 288 setCaption(tr("OpiePlayer: ")+ currentPlaylist );
312 289
313 initializeStates(); 290 initializeStates();
@@ -451,5 +428,5 @@ void PlayListWidget::setDocument(const QString& fileref) {
451 mediaPlayerState->setPlaying( TRUE ); 428 mediaPlayerState->setPlaying( TRUE );
452 qApp->processEvents(); 429 qApp->processEvents();
453 setCaption("OpiePlayer"); 430 setCaption(tr("OpiePlayer"));
454 431
455 } else { //is playlist 432 } else { //is playlist
@@ -494,5 +471,5 @@ const DocLnk *PlayListWidget::current() { // this is fugly
494 qDebug("playlist"); 471 qDebug("playlist");
495 if ( mediaPlayerState->playlist() ) { 472 if ( mediaPlayerState->playlist() ) {
496 return d->selectedFiles->current(); 473 return d->selectedFiles->current();
497 } 474 }
498 else if ( d->setDocumentUsed && d->current ) { 475 else if ( d->setDocumentUsed && d->current ) {
@@ -603,5 +580,5 @@ void PlayListWidget::saveList() {
603 QString filename; 580 QString filename;
604 InputDialog *fileDlg; 581 InputDialog *fileDlg;
605 fileDlg = new InputDialog(this,"Save Playlist",TRUE, 0); 582 fileDlg = new InputDialog(this,tr("Save Playlist"),TRUE, 0);
606 fileDlg->exec(); 583 fileDlg->exec();
607 if( fileDlg->result() == 1 ) { 584 if( fileDlg->result() == 1 ) {
@@ -630,5 +607,5 @@ void PlayListWidget::saveList() {
630 Config config( "MediaPlayer" ); 607 Config config( "MediaPlayer" );
631 config.writeEntry("CurrentPlaylist",filename); 608 config.writeEntry("CurrentPlaylist",filename);
632 setCaption("OpiePlayer: "+filename); 609 setCaption(tr("OpiePlayer: ")+filename);
633 d->selectedFiles->first(); 610 d->selectedFiles->first();
634 if(fileDlg) 611 if(fileDlg)
@@ -682,5 +659,5 @@ void PlayListWidget::addSelected() {
682 QString linkFile = cfg.readEntry( entryName ); 659 QString linkFile = cfg.readEntry( entryName );
683 if( DocLnk( linkFile).name() == audioView->selectedItem()->text(0) ) { 660 if( DocLnk( linkFile).name() == audioView->selectedItem()->text(0) ) {
684 int result= QMessageBox::warning(this,"OpiePlayer", 661 int result= QMessageBox::warning(this,tr("OpiePlayer"),
685 tr("This is all ready in your playlist.\nContinue?"), 662 tr("This is all ready in your playlist.\nContinue?"),
686 tr("Yes"),tr("No"),0,0,1); 663 tr("Yes"),tr("No"),0,0,1);
@@ -699,5 +676,5 @@ void PlayListWidget::addSelected() {
699 QString linkFile = cfg.readEntry( entryName ); 676 QString linkFile = cfg.readEntry( entryName );
700 if( DocLnk( linkFile).name() == videoView->selectedItem()->text(0) ) { 677 if( DocLnk( linkFile).name() == videoView->selectedItem()->text(0) ) {
701 int result= QMessageBox::warning(this,"OpiePlayer", 678 int result= QMessageBox::warning(this,tr("OpiePlayer"),
702 tr("This is all ready in your playlist.\nContinue?"), 679 tr("This is all ready in your playlist.\nContinue?"),
703 tr("Yes"),tr("No"),0,0,1); 680 tr("Yes"),tr("No"),0,0,1);
@@ -717,5 +694,4 @@ void PlayListWidget::removeSelected() {
717} 694}
718 695
719
720void PlayListWidget::playIt( QListViewItem *it) { 696void PlayListWidget::playIt( QListViewItem *it) {
721// d->setDocumentUsed = FALSE; 697// d->setDocumentUsed = FALSE;
@@ -727,11 +703,8 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
727 703
728 if(it) { 704 if(it) {
729// qDebug("add to selection");
730 switch (tabWidget->currentPageIndex()) { 705 switch (tabWidget->currentPageIndex()) {
731 case 1: { 706 case 1: {
732// qDebug("case 1");
733 QListIterator<DocLnk> dit( files.children() ); 707 QListIterator<DocLnk> dit( files.children() );
734 for ( ; dit.current(); ++dit ) { 708 for ( ; dit.current(); ++dit ) {
735// qDebug(dit.current()->name());
736 if( dit.current()->name() == it->text(0)) { 709 if( dit.current()->name() == it->text(0)) {
737 d->selectedFiles->addToSelection( **dit ); 710 d->selectedFiles->addToSelection( **dit );
@@ -741,8 +714,6 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
741 break; 714 break;
742 case 2: { 715 case 2: {
743// qDebug("case 2");
744 QListIterator<DocLnk> dit( vFiles.children() ); 716 QListIterator<DocLnk> dit( vFiles.children() );
745 for ( ; dit.current(); ++dit ) { 717 for ( ; dit.current(); ++dit ) {
746// qDebug(dit.current()->name());
747 if( dit.current()->name() == it->text(0)) { 718 if( dit.current()->name() == it->text(0)) {
748 d->selectedFiles->addToSelection( **dit ); 719 d->selectedFiles->addToSelection( **dit );
@@ -755,5 +726,4 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
755 }; 726 };
756 tabWidget->setCurrentPage(0); 727 tabWidget->setCurrentPage(0);
757// mediaPlayerState->setPlaying( TRUE );
758 } 728 }
759} 729}
@@ -797,7 +767,7 @@ void PlayListWidget::tabChanged(QWidget *widg) {
797 767
798 768
799/* 769
800 play button is pressed*/
801void PlayListWidget::btnPlay(bool b) { 770void PlayListWidget::btnPlay(bool b) {
771
802// mediaPlayerState->setPlaying(b); 772// mediaPlayerState->setPlaying(b);
803 switch ( tabWidget->currentPageIndex()) { 773 switch ( tabWidget->currentPageIndex()) {
@@ -814,5 +784,5 @@ void PlayListWidget::btnPlay(bool b) {
814 d->selectedFiles->removeSelected( ); 784 d->selectedFiles->removeSelected( );
815 tabWidget->setCurrentPage(1); 785 tabWidget->setCurrentPage(1);
816 d->selectedFiles->unSelect(); 786 d->selectedFiles->unSelect();
817// mediaPlayerState->setPlaying(FALSE); 787// mediaPlayerState->setPlaying(FALSE);
818 } 788 }
@@ -825,13 +795,9 @@ void PlayListWidget::btnPlay(bool b) {
825 d->selectedFiles->removeSelected( ); 795 d->selectedFiles->removeSelected( );
826 tabWidget->setCurrentPage(2); 796 tabWidget->setCurrentPage(2);
827 d->selectedFiles->unSelect(); 797 d->selectedFiles->unSelect();
828// mediaPlayerState->setPlaying(FALSE); 798// mediaPlayerState->setPlaying(FALSE);
829 } 799 }
830 break; 800 break;
831 }; 801 };
832
833
834
835
836} 802}
837 803
@@ -860,11 +826,10 @@ void PlayListWidget::viewPressed( int mouse, QListViewItem *item, const QPoint&
860 m.insertItem( tr( "Play" ), this, SLOT( playSelected() )); 826 m.insertItem( tr( "Play" ), this, SLOT( playSelected() ));
861 m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() )); 827 m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() ));
862// m.insertSeparator(); 828 m.insertSeparator();
863// m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); 829 m.insertItem( tr( "Properties" ), this, SLOT( listDelete() ));
864 m.exec( QCursor::pos() ); 830 m.exec( QCursor::pos() );
865 } 831 }
866 break; 832 break;
867 }; 833 };
868
869} 834}
870 835
@@ -890,2 +855,87 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const
890 855
891} 856}
857
858void PlayListWidget::listDelete() {
859 Config cfg( "MediaPlayer" );
860 cfg.setGroup("PlayList");
861 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","");
862 QString file;
863 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
864 switch ( tabWidget->currentPageIndex()) {
865 case 0:
866 break;
867 case 1:
868 {
869 file = audioView->selectedItem()->text(0);
870// Global::findDocuments(&files, "audio/*");
871// AppLnkSet appFiles;
872 QListIterator<DocLnk> dit( files.children() );
873 for ( ; dit.current(); ++dit ) {
874 if( dit.current()->name() == file) {
875 qDebug(file);
876 LnkProperties prop( dit.current() );
877// connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *)));
878 prop.showMaximized();
879 prop.exec();
880 }
881 }
882 populateAudioView();
883 }
884 break;
885 case 2:
886 {
887// file = videoView->selectedItem()->text(0);
888// for ( int i = 0; i < noOfFiles; i++ ) {
889// QString entryName;
890// entryName.sprintf( "File%i", i + 1 );
891// QString linkFile = cfg.readEntry( entryName );
892// AppLnk lnk( AppLnk(linkFile));
893// if( lnk.name() == file ) {
894// LnkProperties prop( &lnk);
895// // connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *)));
896// prop.showMaximized();
897// prop.exec();
898// }
899// }
900 }
901 break;
902 };
903}
904
905void PlayListWidget::populateAudioView() {
906// if(files)
907// files.~DocLnkSet();
908 Global::findDocuments(&files, "audio/*");
909 QListIterator<DocLnk> dit( files.children() );
910 audioView->clear();
911 QString storage;
912 for ( ; dit.current(); ++dit ) {
913 QListViewItem * newItem;
914 if(dit.current()->file().find("/mnt/cf") != -1 ) storage=tr("CF");
915 else if(dit.current()->file().find("/mnt/hda") != -1 ) storage=tr("CF");
916 else if(dit.current()->file().find("/mnt/card") != -1 ) storage=tr("SD");
917 else storage=tr("RAM");
918 if ( QFile( dit.current()->file()).exists() ) {
919 newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage);
920 newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/musicfile" ));
921 }
922 }
923}
924
925void PlayListWidget::populateVideoView() {
926 Global::findDocuments(&vFiles, "video/*");
927 QListIterator<DocLnk> Vdit( vFiles.children() );
928 videoView->clear();
929 QString storage;
930 for ( ; Vdit.current(); ++Vdit ) {
931 if( Vdit.current()->file().find("/mnt/cf") != -1 ) storage=tr("CF");
932 else if( Vdit.current()->file().find("/mnt/hda") != -1 ) storage=tr("CF");
933 else if( Vdit.current()->file().find("/mnt/card") != -1 ) storage=tr("SD");
934 else storage=tr("RAM");
935 QListViewItem * newItem;
936 if ( QFile( Vdit.current()->file()).exists() ) {
937 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage);
938 newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/videofile" ));
939 }
940 }
941}
diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h
index 10a42df..186ca1b 100644
--- a/core/multimedia/opieplayer/playlistwidget.h
+++ b/core/multimedia/opieplayer/playlistwidget.h
@@ -59,4 +59,22 @@ public:
59 QPushButton *tbDeletePlaylist; 59 QPushButton *tbDeletePlaylist;
60public slots: 60public slots:
61 bool first();
62 bool last();
63 bool next();
64 bool prev();
65/* void setFullScreen(); */
66/* void setScaled(); */
67protected:
68/* void contentsMousePressEvent( QMouseEvent * e ); */
69/* void contentsMouseReleaseEvent( QMouseEvent * e ); */
70
71private:
72 void initializeStates();
73 void readConfig( Config& cfg );
74 void writeConfig( Config& cfg ) const;
75 PlayListWidgetPrivate *d; // Private implementation data
76 void populateAudioView();
77 void populateVideoView();
78private slots:
61 void setDocument( const QString& fileref ); 79 void setDocument( const QString& fileref );
62 void addToSelection( const DocLnk& ); // Add a media file to the playlist 80 void addToSelection( const DocLnk& ); // Add a media file to the playlist
@@ -75,8 +93,4 @@ public slots:
75 void btnPlay(bool); 93 void btnPlay(bool);
76 void deletePlaylist(); 94 void deletePlaylist();
77 bool first();
78 bool last();
79 bool next();
80 bool prev();
81 void addSelected(); 95 void addSelected();
82 void removeSelected(); 96 void removeSelected();
@@ -85,16 +99,6 @@ public slots:
85 void playlistViewPressed( int, QListViewItem *, const QPoint&, int); 99 void playlistViewPressed( int, QListViewItem *, const QPoint&, int);
86 void playSelected(); 100 void playSelected();
87/* void setFullScreen(); */ 101 void listDelete();
88/* void setScaled(); */ 102
89protected:
90/* void contentsMousePressEvent( QMouseEvent * e ); */
91/* void contentsMouseReleaseEvent( QMouseEvent * e ); */
92
93private:
94 void initializeStates();
95 void readConfig( Config& cfg );
96 void writeConfig( Config& cfg ) const;
97 PlayListWidgetPrivate *d; // Private implementation data
98
99protected slots: 103protected slots:
100/* void cancelMenuTimer(); */ 104/* void cancelMenuTimer(); */