author | bipolar <bipolar> | 2002-03-09 03:10:23 (UTC) |
---|---|---|
committer | bipolar <bipolar> | 2002-03-09 03:10:23 (UTC) |
commit | 3d03d0e3f679578080bbbf7d8b7f9eba1b9560db (patch) (side-by-side diff) | |
tree | 8ff01a8fad92869e97ba7983d16bcf7de531d69f /core/multimedia/opieplayer/playlistwidget.cpp | |
parent | cb1d684a68565ff70fedd184eedf1ef4f2b71079 (diff) | |
download | opie-3d03d0e3f679578080bbbf7d8b7f9eba1b9560db.zip opie-3d03d0e3f679578080bbbf7d8b7f9eba1b9560db.tar.gz opie-3d03d0e3f679578080bbbf7d8b7f9eba1b9560db.tar.bz2 |
ljp:added playlist in caption, startup playlist, and saving currentplaylist to config file
something like that
Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 48 |
1 files changed, 36 insertions, 12 deletions
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,2 +290,6 @@ 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 ); @@ -299,2 +303,3 @@ PlayListWidget::~PlayListWidget() { + if ( d->current ) @@ -316,3 +321,2 @@ void PlayListWidget::initializeStates() { 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) { @@ -538,6 +543,15 @@ void PlayListWidget::saveList() { 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; @@ -551,3 +565,6 @@ void PlayListWidget::saveList() { } - + 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"); + QString name= lnk.name(); +// qDebug("currentList is "+name); + if( name.length()>1) { + setCaption("OpiePlayer: "+name); +// qDebug("load list "+ name+".playlist"); clearList(); - Config cfg( lnk.name()+".playlist"); + Config cfg( name+".playlist"); readConfig(cfg); tabWidget->setCurrentPage(0); - setCaption("OpiePlayer: "+lnk.name()); + Config config( "MediaPlayer" ); + config.writeEntry("CurrentPlaylist", name); + d->selectedFiles->first(); + } } |