author | bipolar <bipolar> | 2002-03-09 03:10:23 (UTC) |
---|---|---|
committer | bipolar <bipolar> | 2002-03-09 03:10:23 (UTC) |
commit | 3d03d0e3f679578080bbbf7d8b7f9eba1b9560db (patch) (unidiff) | |
tree | 8ff01a8fad92869e97ba7983d16bcf7de531d69f /core | |
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
-rw-r--r-- | core/multimedia/opieplayer/main.cpp | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 48 |
2 files changed, 37 insertions, 13 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) { | |||
49 | 49 | ||
50 | pl.setCaption( MediaPlayer::tr("OpiePlayer") ); | 50 | // pl.setCaption( MediaPlayer::tr("OpiePlayer") ); |
51 | a.showMainDocumentWidget(&pl); | 51 | 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 @@ | |||
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 | |||
22 | #include <qpe/qpemenubar.h> | 21 | #include <qpe/qpemenubar.h> |
@@ -258,2 +257,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
258 | tabWidget->insertTab(LTab,"Lists"); | 257 | tabWidget->insertTab(LTab,"Lists"); |
258 | |||
259 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); | 259 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); |
@@ -266,6 +266,6 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
266 | 266 | ||
267 | connect( audioView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)), | 267 | // connect( audioView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)), |
268 | this, SLOT( fauxPlay( QListViewItem *) ) ); | 268 | // this, SLOT( fauxPlay( QListViewItem *) ) ); |
269 | connect( videoView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)), | 269 | // connect( videoView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)), |
270 | this, SLOT( fauxPlay( QListViewItem *)) ); | 270 | // this, SLOT( fauxPlay( QListViewItem *)) ); |
271 | 271 | ||
@@ -290,2 +290,6 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
290 | readConfig( cfg ); | 290 | readConfig( cfg ); |
291 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); | ||
292 | // qDebug("currentList is "+currentPlaylist); | ||
293 | loadList(DocLnk( currentPlaylist)); | ||
294 | setCaption("OpiePlayer: "+ currentPlaylist ); | ||
291 | 295 | ||
@@ -299,2 +303,3 @@ PlayListWidget::~PlayListWidget() { | |||
299 | 303 | ||
304 | |||
300 | if ( d->current ) | 305 | if ( d->current ) |
@@ -316,3 +321,2 @@ void PlayListWidget::initializeStates() { | |||
316 | d->selectedFiles->first(); | 321 | d->selectedFiles->first(); |
317 | |||
318 | } | 322 | } |
@@ -374,3 +378,3 @@ void PlayListWidget::writeConfig( Config& cfg ) const { | |||
374 | void PlayListWidget::addToSelection( const DocLnk& lnk ) { | 378 | void PlayListWidget::addToSelection( const DocLnk& lnk ) { |
375 | qDebug("add"); | 379 | // qDebug("add"); |
376 | d->setDocumentUsed = FALSE; | 380 | d->setDocumentUsed = FALSE; |
@@ -421,2 +425,3 @@ void PlayListWidget::setDocument(const QString& fileref) { | |||
421 | } | 425 | } |
426 | // qDebug("setDocument"); | ||
422 | if(fileref.find("playlist",0,TRUE) == -1) { | 427 | if(fileref.find("playlist",0,TRUE) == -1) { |
@@ -538,6 +543,15 @@ void PlayListWidget::saveList() { | |||
538 | if( fileDlg->result() == 1 ) { | 543 | if( fileDlg->result() == 1 ) { |
544 | if ( d->current ) | ||
545 | delete d->current; | ||
539 | filename = fileDlg->LineEdit1->text();//+".playlist"; | 546 | filename = fileDlg->LineEdit1->text();//+".playlist"; |
540 | qDebug("saving playlist "+filename+".playlist"); | 547 | // qDebug("saving playlist "+filename+".playlist"); |
541 | Config cfg( filename +".playlist"); | 548 | Config cfg( filename +".playlist"); |
542 | writeConfig( cfg ); | 549 | writeConfig( cfg ); |
550 | if( playLists->selected()->name() == filename) { | ||
551 | // qDebug("same name so delete lnk"); | ||
552 | QFile().remove(playLists->selected()->file()); | ||
553 | QFile().remove(playLists->selected()->linkFile()); | ||
554 | playLists->reread(); | ||
555 | } | ||
556 | |||
543 | DocLnk lnk; | 557 | DocLnk lnk; |
@@ -551,3 +565,6 @@ void PlayListWidget::saveList() { | |||
551 | } | 565 | } |
552 | 566 | Config config( "MediaPlayer" ); | |
567 | config.writeEntry("CurrentPlaylist",filename); | ||
568 | setCaption("OpiePlayer: "+filename); | ||
569 | d->selectedFiles->first(); | ||
553 | if(fileDlg) | 570 | if(fileDlg) |
@@ -559,8 +576,15 @@ void PlayListWidget::saveList() { | |||
559 | void PlayListWidget::loadList( const DocLnk & lnk) { | 576 | void PlayListWidget::loadList( const DocLnk & lnk) { |
560 | qDebug("load list "+ lnk.name()+".playlist"); | 577 | QString name= lnk.name(); |
578 | // qDebug("currentList is "+name); | ||
579 | if( name.length()>1) { | ||
580 | setCaption("OpiePlayer: "+name); | ||
581 | // qDebug("load list "+ name+".playlist"); | ||
561 | clearList(); | 582 | clearList(); |
562 | Config cfg( lnk.name()+".playlist"); | 583 | Config cfg( name+".playlist"); |
563 | readConfig(cfg); | 584 | readConfig(cfg); |
564 | tabWidget->setCurrentPage(0); | 585 | tabWidget->setCurrentPage(0); |
565 | setCaption("OpiePlayer: "+lnk.name()); | 586 | Config config( "MediaPlayer" ); |
587 | config.writeEntry("CurrentPlaylist", name); | ||
588 | d->selectedFiles->first(); | ||
589 | } | ||
566 | } | 590 | } |