Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 262b685..6299328 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -125,49 +125,48 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
125 | this , SLOT(removeSelected()) ); | 125 | this , SLOT(removeSelected()) ); |
126 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", | 126 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", |
127 | this , SLOT( btnPlay(bool) ), TRUE ); | 127 | this , SLOT( btnPlay(bool) ), TRUE ); |
128 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", | 128 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", |
129 | mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); | 129 | mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); |
130 | d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer2/loop", | 130 | d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer2/loop", |
131 | mediaPlayerState, SLOT(setLooping(bool)), TRUE ); | 131 | mediaPlayerState, SLOT(setLooping(bool)), TRUE ); |
132 | tbDeletePlaylist->hide(); | 132 | tbDeletePlaylist->hide(); |
133 | 133 | ||
134 | QPopupMenu *pmPlayList = new QPopupMenu( this ); | 134 | QPopupMenu *pmPlayList = new QPopupMenu( this ); |
135 | menu->insertItem( tr( "File" ), pmPlayList ); | 135 | menu->insertItem( tr( "File" ), pmPlayList ); |
136 | (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); | 136 | (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); |
137 | (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); | 137 | (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); |
138 | (void)new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); | 138 | (void)new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); |
139 | (void)new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); | 139 | (void)new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); |
140 | pmPlayList->insertSeparator(-1); | 140 | pmPlayList->insertSeparator(-1); |
141 | (void)new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); | 141 | (void)new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); |
142 | (void)new MenuItem( pmPlayList, tr( "Export playlist to m3u" ), this, SLOT(writem3u() ) ); | 142 | (void)new MenuItem( pmPlayList, tr( "Export playlist to m3u" ), this, SLOT(writem3u() ) ); |
143 | pmPlayList->insertSeparator(-1); | 143 | pmPlayList->insertSeparator(-1); |
144 | (void)new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); | 144 | (void)new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); |
145 | pmPlayList->insertSeparator(-1); | 145 | pmPlayList->insertSeparator(-1); |
146 | (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); | 146 | (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); |
147 | (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); | 147 | (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); |
148 | 148 | ||
149 | |||
150 | pmView = new QPopupMenu( this ); | 149 | pmView = new QPopupMenu( this ); |
151 | menu->insertItem( tr( "View" ), pmView ); | 150 | menu->insertItem( tr( "View" ), pmView ); |
152 | pmView->isCheckable(); | 151 | pmView->isCheckable(); |
153 | 152 | ||
154 | pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), mediaPlayerState, SLOT( toggleFullscreen() ) ); | 153 | pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), mediaPlayerState, SLOT( toggleFullscreen() ) ); |
155 | 154 | ||
156 | Config cfg( "OpiePlayer" ); | 155 | Config cfg( "OpiePlayer" ); |
157 | bool b= cfg.readBoolEntry("FullScreen", 0); | 156 | bool b= cfg.readBoolEntry("FullScreen", 0); |
158 | mediaPlayerState->setFullscreen( b ); | 157 | mediaPlayerState->setFullscreen( b ); |
159 | pmView->setItemChecked( -16, b ); | 158 | pmView->setItemChecked( -16, b ); |
160 | 159 | ||
161 | // pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) ); | 160 | // pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) ); |
162 | 161 | ||
163 | pmView->insertSeparator(-1); | 162 | pmView->insertSeparator(-1); |
164 | 163 | ||
165 | skinsMenu = new QPopupMenu( this ); | 164 | skinsMenu = new QPopupMenu( this ); |
166 | pmView->insertItem( tr( "Skins" ), skinsMenu ); | 165 | pmView->insertItem( tr( "Skins" ), skinsMenu ); |
167 | skinsMenu->isCheckable(); | 166 | skinsMenu->isCheckable(); |
168 | populateSkinsMenu(); | 167 | populateSkinsMenu(); |
169 | 168 | ||
170 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); | 169 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); |
171 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); | 170 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); |
172 | 171 | ||
173 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); | 172 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); |
@@ -563,49 +562,49 @@ bool PlayListWidget::next() { | |||
563 | return mediaPlayerState->looping(); | 562 | return mediaPlayerState->looping(); |
564 | } | 563 | } |
565 | } | 564 | } |
566 | 565 | ||
567 | 566 | ||
568 | bool PlayListWidget::first() { | 567 | bool PlayListWidget::first() { |
569 | if ( mediaPlayerState->playlist() ) | 568 | if ( mediaPlayerState->playlist() ) |
570 | return d->selectedFiles->first(); | 569 | return d->selectedFiles->first(); |
571 | else | 570 | else |
572 | return mediaPlayerState->looping(); | 571 | return mediaPlayerState->looping(); |
573 | } | 572 | } |
574 | 573 | ||
575 | 574 | ||
576 | bool PlayListWidget::last() { | 575 | bool PlayListWidget::last() { |
577 | if ( mediaPlayerState->playlist() ) | 576 | if ( mediaPlayerState->playlist() ) |
578 | return d->selectedFiles->last(); | 577 | return d->selectedFiles->last(); |
579 | else | 578 | else |
580 | return mediaPlayerState->looping(); | 579 | return mediaPlayerState->looping(); |
581 | } | 580 | } |
582 | 581 | ||
583 | 582 | ||
584 | void PlayListWidget::saveList() { | 583 | void PlayListWidget::saveList() { |
585 | 584 | ||
586 | QString filename; | 585 | QString filename; |
587 | InputDialog *fileDlg; | 586 | InputDialog *fileDlg = 0l; |
588 | fileDlg = new InputDialog(this,tr("Save Playlist"),TRUE, 0); | 587 | fileDlg = new InputDialog(this,tr("Save Playlist"),TRUE, 0); |
589 | fileDlg->exec(); | 588 | fileDlg->exec(); |
590 | if( fileDlg->result() == 1 ) { | 589 | if( fileDlg->result() == 1 ) { |
591 | if ( d->current ) | 590 | if ( d->current ) |
592 | delete d->current; | 591 | delete d->current; |
593 | filename = fileDlg->LineEdit1->text();//+".playlist"; | 592 | filename = fileDlg->LineEdit1->text();//+".playlist"; |
594 | // qDebug("saving playlist "+filename+".playlist"); | 593 | // qDebug("saving playlist "+filename+".playlist"); |
595 | Config cfg( filename +".playlist"); | 594 | Config cfg( filename +".playlist"); |
596 | writeConfig( cfg ); | 595 | writeConfig( cfg ); |
597 | 596 | ||
598 | DocLnk lnk; | 597 | DocLnk lnk; |
599 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property | 598 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property |
600 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D | 599 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D |
601 | lnk.setIcon("opieplayer2/playlist2"); | 600 | lnk.setIcon("opieplayer2/playlist2"); |
602 | lnk.setName( filename); //sets file name | 601 | lnk.setName( filename); //sets file name |
603 | // qDebug(filename); | 602 | // qDebug(filename); |
604 | if(!lnk.writeLink()) { | 603 | if(!lnk.writeLink()) { |
605 | qDebug("Writing doclink did not work"); | 604 | qDebug("Writing doclink did not work"); |
606 | } | 605 | } |
607 | } | 606 | } |
608 | Config config( "OpiePlayer" ); | 607 | Config config( "OpiePlayer" ); |
609 | config.writeEntry("CurrentPlaylist",filename); | 608 | config.writeEntry("CurrentPlaylist",filename); |
610 | setCaption(tr("OpiePlayer: ")+filename); | 609 | setCaption(tr("OpiePlayer: ")+filename); |
611 | d->selectedFiles->first(); | 610 | d->selectedFiles->first(); |