-rw-r--r-- | core/multimedia/opieplayer/main.cpp | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 64 |
2 files changed, 45 insertions, 21 deletions
diff --git a/core/multimedia/opieplayer/main.cpp b/core/multimedia/opieplayer/main.cpp index 4f43ff6..18cd7a6 100644 --- a/core/multimedia/opieplayer/main.cpp +++ b/core/multimedia/opieplayer/main.cpp @@ -49,3 +49,3 @@ int main(int argc, char **argv) { - pl.setCaption( MediaPlayer::tr("OpiePlayer") ); +// pl.setCaption( MediaPlayer::tr("OpiePlayer") ); a.showMainDocumentWidget(&pl); diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index cb58888..9969526 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -20,3 +20,2 @@ // code added by L. J. Potter Sat 03-02-2002 06:17:54 - #include <qpe/qpemenubar.h> @@ -258,2 +257,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) tabWidget->insertTab(LTab,"Lists"); + connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); @@ -266,6 +266,6 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) - connect( audioView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)), - this, SLOT( fauxPlay( QListViewItem *) ) ); - connect( videoView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)), - this, SLOT( fauxPlay( QListViewItem *)) ); +// connect( audioView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)), +// this, SLOT( fauxPlay( QListViewItem *) ) ); +// connect( videoView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)), +// this, SLOT( fauxPlay( QListViewItem *)) ); @@ -290,3 +290,7 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) readConfig( cfg ); - + QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); +// qDebug("currentList is "+currentPlaylist); + loadList(DocLnk( currentPlaylist)); + setCaption("OpiePlayer: "+ currentPlaylist ); + initializeStates(); @@ -298,2 +302,3 @@ PlayListWidget::~PlayListWidget() { writeConfig( cfg ); + @@ -314,5 +319,4 @@ void PlayListWidget::initializeStates() { // setPlaylist( mediaPlayerState->playlist() ); - setPlaylist( true); - d->selectedFiles->first(); - + setPlaylist( true); + d->selectedFiles->first(); } @@ -374,3 +378,3 @@ void PlayListWidget::writeConfig( Config& cfg ) const { void PlayListWidget::addToSelection( const DocLnk& lnk ) { - qDebug("add"); +// qDebug("add"); d->setDocumentUsed = FALSE; @@ -421,2 +425,3 @@ void PlayListWidget::setDocument(const QString& fileref) { } +// qDebug("setDocument"); if(fileref.find("playlist",0,TRUE) == -1) { @@ -535,9 +540,18 @@ void PlayListWidget::saveList() { InputDialog *fileDlg; - fileDlg=new InputDialog(this,"Save Playlist",TRUE, 0); + fileDlg = new InputDialog(this,"Save Playlist",TRUE, 0); fileDlg->exec(); if( fileDlg->result() == 1 ) { + if ( d->current ) + delete d->current; filename = fileDlg->LineEdit1->text();//+".playlist"; - qDebug("saving playlist "+filename+".playlist"); +// qDebug("saving playlist "+filename+".playlist"); Config cfg( filename +".playlist"); writeConfig( cfg ); + if( playLists->selected()->name() == filename) { +// qDebug("same name so delete lnk"); + QFile().remove(playLists->selected()->file()); + QFile().remove(playLists->selected()->linkFile()); + playLists->reread(); + } + DocLnk lnk; @@ -550,4 +564,7 @@ void PlayListWidget::saveList() { qDebug("Writing doclink did not work"); - } - + } + Config config( "MediaPlayer" ); + config.writeEntry("CurrentPlaylist",filename); + setCaption("OpiePlayer: "+filename); + d->selectedFiles->first(); if(fileDlg) @@ -559,8 +576,15 @@ void PlayListWidget::saveList() { void PlayListWidget::loadList( const DocLnk & lnk) { - qDebug("load list "+ lnk.name()+".playlist"); - clearList(); - Config cfg( lnk.name()+".playlist"); - readConfig(cfg); - tabWidget->setCurrentPage(0); - setCaption("OpiePlayer: "+lnk.name()); + QString name= lnk.name(); +// qDebug("currentList is "+name); + if( name.length()>1) { + setCaption("OpiePlayer: "+name); +// qDebug("load list "+ name+".playlist"); + clearList(); + Config cfg( name+".playlist"); + readConfig(cfg); + tabWidget->setCurrentPage(0); + Config config( "MediaPlayer" ); + config.writeEntry("CurrentPlaylist", name); + d->selectedFiles->first(); + } } |