summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 86130d5..040ef71 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -35,48 +35,50 @@
#include <qpe/qpeapplication.h>
#include <qpe/storage.h>
#include <qpe/mimetype.h>
#include <qpe/global.h>
#include <qpe/resource.h>
#include <qdir.h>
#include <qmessagebox.h>
#include <qregexp.h>
#include <qtextstream.h>
#include "playlistselection.h"
#include "playlistwidget.h"
#include "mediaplayerstate.h"
#include "inputDialog.h"
#include "om3u.h"
//only needed for the random play
#include <stdlib.h>
#include "audiowidget.h"
#include "videowidget.h"
extern MediaPlayerState *mediaPlayerState;
+// extern AudioWidget *audioUI;
+// extern VideoWidget *videoUI;
QString audioMimes ="audio/mpeg;audio/x-wav;audio/x-ogg";
// no m3u's here please
PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
: PlayListWidgetGui( parent, name, fl ) {
d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ),
"opieplayer2/add_to_playlist",
this , SLOT(addSelected() ) );
d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ),
"opieplayer2/remove_from_playlist",
this , SLOT(removeSelected() ) );
d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play",
this , SLOT( btnPlay( bool) ), TRUE );
d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle",
mediaPlayerState, SLOT( setShuffled( bool ) ), TRUE );
d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop",
mediaPlayerState, SLOT( setLooping( bool ) ), TRUE );
(void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) );
(void)new MenuItem( pmPlayList, tr( "Add all audio files" ),
this, SLOT( addAllMusicToList() ) );
(void)new MenuItem( pmPlayList, tr( "Add all video files" ),
@@ -276,49 +278,49 @@ void PlayListWidget::addAllMusicToList() {
d->selectedFiles->addToSelection( **dit );
}
}
writeCurrentM3u();
}
void PlayListWidget::addAllVideoToList() {
if(!videoScan)
scanForVideo();
QListIterator<DocLnk> dit( vFiles.children() );
for ( ; dit.current(); ++dit ) {
if( QFileInfo( dit.current()->file() ).exists() ) {
d->selectedFiles->addToSelection( **dit );
}
}
writeCurrentM3u();
}
void PlayListWidget::setDocument( const QString& fileref ) {
qDebug( "<<<<<<<<set document>>>>>>>>>> "+fileref );
fromSetDocument = TRUE;
if ( fileref.isNull() ) {
- QMessageBox::critical( 0, tr( "Invalid File" ),
+ QMessageBox::warning( this, tr( "Invalid File" ),
tr( "There was a problem in getting the file." ) );
return;
}
clearList();
if( fileref.find( "m3u", 0, TRUE) != -1 ) { //is m3u
readm3u( fileref );
} else if( DocLnk( fileref).file().find( "m3u", 0, TRUE) != -1 ) {
readm3u( DocLnk( fileref).file() );
} else if( fileref.find( "pls", 0, TRUE) != -1 ) { //is pls
readPls( fileref );
} else if( DocLnk( fileref).file().find( "pls", 0, TRUE) != -1 ) {
readPls( DocLnk( fileref).file() );
} else {
clearList();
addToSelection( DocLnk( fileref ) );
writeCurrentM3u();
d->setDocumentUsed = TRUE;
mediaPlayerState->setPlaying( FALSE );
mediaPlayerState->setPlaying( TRUE );
}
}
@@ -1042,41 +1044,43 @@ void PlayListWidget::populateSkinsMenu() {
skinName = fi->fileName();
// qDebug( fi->fileName() );
if( skinName != "." && skinName != ".." && skinName !="CVS" ) {
item = skinsMenu->insertItem( fi->fileName() ) ;
}
if( skinName == "default" ) {
defaultSkinIndex = item;
}
if( skinName == skin ) {
skinsMenu->setItemChecked( item, TRUE );
}
++it;
}
}
void PlayListWidget::skinsMenuActivated( int item ) {
for( int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) {
skinsMenu->setItemChecked( i, FALSE );
}
skinsMenu->setItemChecked( item, TRUE );
Config cfg( "OpiePlayer" );
cfg.setGroup("Options");
cfg.writeEntry("Skin", skinsMenu->text( item ) );
-}
+ QMessageBox::warning( this, tr( "OpiePlayer" ),
+ tr( "You must <b>restart</b> Opieplayer<br>to see your changes." ) );
+}
int PlayListWidget::whichList() {
return tabWidget->currentPageIndex();
}
QString PlayListWidget::currentFileListPathName() {
switch (whichList()) {
case 1:
return audioView->currentItem()->text(3);
break;
case 2:
return videoView->currentItem()->text(3);
break;
};
return "";
}