author | llornkcor <llornkcor> | 2002-04-06 22:53:11 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-06 22:53:11 (UTC) |
commit | 014a5c29fc8a1b2e6bc2ec550134163bea86443c (patch) (unidiff) | |
tree | edad7dd5cabe8891b02875c879b31a15c8251053 /core/multimedia | |
parent | f79c6b3e3407a4263e7210b52638c4426dea825b (diff) | |
download | opie-014a5c29fc8a1b2e6bc2ec550134163bea86443c.zip opie-014a5c29fc8a1b2e6bc2ec550134163bea86443c.tar.gz opie-014a5c29fc8a1b2e6bc2ec550134163bea86443c.tar.bz2 |
translations stuff
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 172 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 36 |
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 | |||
@@ -20,2 +20,4 @@ | |||
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> |
@@ -24,2 +26,3 @@ | |||
24 | #include <qpe/qpeapplication.h> | 26 | #include <qpe/qpeapplication.h> |
27 | #include <qpe/lnkproperties.h> | ||
25 | 28 | ||
@@ -209,5 +212,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
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); |
@@ -215,3 +218,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
215 | audioView->setAllColumnsShowFocus(TRUE); | 218 | audioView->setAllColumnsShowFocus(TRUE); |
216 | tabWidget->insertTab(aTab,"Audio"); | 219 | tabWidget->insertTab(aTab,tr("Audio")); |
217 | 220 | ||
@@ -223,16 +226,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
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 |
@@ -244,5 +234,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
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); |
@@ -254,17 +244,4 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
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 | ||
@@ -275,3 +252,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
275 | playLists->setMinimumSize(233,260);; | 252 | playLists->setMinimumSize(233,260);; |
276 | tabWidget->insertTab(LTab,"Lists"); | 253 | tabWidget->insertTab(LTab,tr("Lists")); |
277 | 254 | ||
@@ -310,3 +287,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
310 | loadList(DocLnk( currentPlaylist)); | 287 | loadList(DocLnk( currentPlaylist)); |
311 | setCaption("OpiePlayer: "+ currentPlaylist ); | 288 | setCaption(tr("OpiePlayer: ")+ currentPlaylist ); |
312 | 289 | ||
@@ -452,3 +429,3 @@ void PlayListWidget::setDocument(const QString& fileref) { | |||
452 | qApp->processEvents(); | 429 | qApp->processEvents(); |
453 | setCaption("OpiePlayer"); | 430 | setCaption(tr("OpiePlayer")); |
454 | 431 | ||
@@ -495,3 +472,3 @@ const DocLnk *PlayListWidget::current() { // this is fugly | |||
495 | if ( mediaPlayerState->playlist() ) { | 472 | if ( mediaPlayerState->playlist() ) { |
496 | return d->selectedFiles->current(); | 473 | return d->selectedFiles->current(); |
497 | } | 474 | } |
@@ -604,3 +581,3 @@ void PlayListWidget::saveList() { | |||
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(); |
@@ -631,3 +608,3 @@ void PlayListWidget::saveList() { | |||
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(); |
@@ -683,3 +660,3 @@ void PlayListWidget::addSelected() { | |||
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?"), |
@@ -700,3 +677,3 @@ void PlayListWidget::addSelected() { | |||
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?"), |
@@ -718,3 +695,2 @@ void PlayListWidget::removeSelected() { | |||
718 | 695 | ||
719 | |||
720 | void PlayListWidget::playIt( QListViewItem *it) { | 696 | void PlayListWidget::playIt( QListViewItem *it) { |
@@ -728,9 +704,6 @@ void PlayListWidget::addToSelection( QListViewItem *it) { | |||
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)) { |
@@ -742,6 +715,4 @@ void PlayListWidget::addToSelection( QListViewItem *it) { | |||
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)) { |
@@ -756,3 +727,2 @@ void PlayListWidget::addToSelection( QListViewItem *it) { | |||
756 | tabWidget->setCurrentPage(0); | 727 | tabWidget->setCurrentPage(0); |
757 | // mediaPlayerState->setPlaying( TRUE ); | ||
758 | } | 728 | } |
@@ -798,5 +768,5 @@ void PlayListWidget::tabChanged(QWidget *widg) { | |||
798 | 768 | ||
799 | /* | 769 | |
800 | play button is pressed*/ | ||
801 | void PlayListWidget::btnPlay(bool b) { | 770 | void PlayListWidget::btnPlay(bool b) { |
771 | |||
802 | // mediaPlayerState->setPlaying(b); | 772 | // mediaPlayerState->setPlaying(b); |
@@ -815,3 +785,3 @@ void PlayListWidget::btnPlay(bool b) { | |||
815 | tabWidget->setCurrentPage(1); | 785 | tabWidget->setCurrentPage(1); |
816 | d->selectedFiles->unSelect(); | 786 | d->selectedFiles->unSelect(); |
817 | // mediaPlayerState->setPlaying(FALSE); | 787 | // mediaPlayerState->setPlaying(FALSE); |
@@ -826,3 +796,3 @@ void PlayListWidget::btnPlay(bool b) { | |||
826 | tabWidget->setCurrentPage(2); | 796 | tabWidget->setCurrentPage(2); |
827 | d->selectedFiles->unSelect(); | 797 | d->selectedFiles->unSelect(); |
828 | // mediaPlayerState->setPlaying(FALSE); | 798 | // mediaPlayerState->setPlaying(FALSE); |
@@ -831,6 +801,2 @@ void PlayListWidget::btnPlay(bool b) { | |||
831 | }; | 801 | }; |
832 | |||
833 | |||
834 | |||
835 | |||
836 | } | 802 | } |
@@ -861,4 +827,4 @@ void PlayListWidget::viewPressed( int mouse, QListViewItem *item, const QPoint& | |||
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() ); |
@@ -867,3 +833,2 @@ void PlayListWidget::viewPressed( int mouse, QListViewItem *item, const QPoint& | |||
867 | }; | 833 | }; |
868 | |||
869 | } | 834 | } |
@@ -891 +856,86 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const | |||
891 | } | 856 | } |
857 | |||
858 | void 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 | |||
905 | void 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 | |||
925 | void 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 | |||
@@ -60,2 +60,20 @@ public: | |||
60 | public slots: | 60 | public slots: |
61 | bool first(); | ||
62 | bool last(); | ||
63 | bool next(); | ||
64 | bool prev(); | ||
65 | /* void setFullScreen(); */ | ||
66 | /* void setScaled(); */ | ||
67 | protected: | ||
68 | /* void contentsMousePressEvent( QMouseEvent * e ); */ | ||
69 | /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ | ||
70 | |||
71 | private: | ||
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(); | ||
78 | private slots: | ||
61 | void setDocument( const QString& fileref ); | 79 | void setDocument( const QString& fileref ); |
@@ -76,6 +94,2 @@ public slots: | |||
76 | void deletePlaylist(); | 94 | void deletePlaylist(); |
77 | bool first(); | ||
78 | bool last(); | ||
79 | bool next(); | ||
80 | bool prev(); | ||
81 | void addSelected(); | 95 | void addSelected(); |
@@ -86,14 +100,4 @@ public slots: | |||
86 | void playSelected(); | 100 | void playSelected(); |
87 | /* void setFullScreen(); */ | 101 | void listDelete(); |
88 | /* void setScaled(); */ | 102 | |
89 | protected: | ||
90 | /* void contentsMousePressEvent( QMouseEvent * e ); */ | ||
91 | /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ | ||
92 | |||
93 | private: | ||
94 | void initializeStates(); | ||
95 | void readConfig( Config& cfg ); | ||
96 | void writeConfig( Config& cfg ) const; | ||
97 | PlayListWidgetPrivate *d; // Private implementation data | ||
98 | |||
99 | protected slots: | 103 | protected slots: |