summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-06-18 21:01:43 (UTC)
committer harlekin <harlekin>2003-06-18 21:01:43 (UTC)
commiteff530015d448c27d060824c8ed58bbd7a4b40b9 (patch) (side-by-side diff)
treea5672a3ac374c5c501dbf93482692bcd4565bdb0
parent9bfda722eeba2f5861393e9f5f41170fab502da8 (diff)
downloadopie-eff530015d448c27d060824c8ed58bbd7a4b40b9.zip
opie-eff530015d448c27d060824c8ed58bbd7a4b40b9.tar.gz
opie-eff530015d448c27d060824c8ed58bbd7a4b40b9.tar.bz2
give save playlist the normal ofileselector too
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp46
1 files changed, 35 insertions, 11 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 4e31670..4ee784e 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -85,7 +85,2 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par
pmPlayList->insertSeparator(-1);
-// (void)new MenuItem( pmPlayList, tr( "Save PlayList" ),
-// this, SLOT( saveList() ) );
- (void)new MenuItem( pmPlayList, tr( "Save Playlist" ),
- this, SLOT(writem3u() ) );
- pmPlayList->insertSeparator(-1);
(void)new MenuItem( pmPlayList, tr( "Add File" ),
@@ -95,2 +90,5 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par
pmPlayList->insertSeparator(-1);
+ (void)new MenuItem( pmPlayList, tr( "Save Playlist" ),
+ this, SLOT(writem3u() ) );
+ pmPlayList->insertSeparator(-1);
(void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ),
@@ -782,5 +780,30 @@ void PlayListWidget::readListFromFile( const QString &filename ) {
void PlayListWidget::writem3u() {
- InputDialog *fileDlg;
- fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0);
- fileDlg->exec();
+ //InputDilog *fileDlg;
+ //fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0);
+ //fileDlg->exec();
+
+ Config cfg( "OpiePlayer" );
+ cfg.setGroup("Dialog");
+ MimeTypes types;
+ QStringList audio, video, all;
+ audio << "audio/*";
+ audio << "playlist/plain";
+ audio << "audio/x-mpegurl";
+
+ video << "video/*";
+ video << "playlist/plain";
+
+ all += audio;
+ all += video;
+ types.insert("All Media Files", all );
+ types.insert("Audio", audio );
+ types.insert("Video", video );
+
+ QString str = OFileDialog::getOpenFileName( 1,
+ cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"",
+ types, 0 );
+ if(str.left(2) == "//") str=str.right(str.length()-1);
+ cfg.writeEntry("LastDirectory" ,QFileInfo(str).dirPath());
+
+
QString name, filename, list;
@@ -788,4 +811,5 @@ void PlayListWidget::writem3u() {
- if( fileDlg->result() == 1 ) {
- name = fileDlg->text();
+ if( !str.isEmpty() ) {
+ name = str;
+ // name = fileDlg->text();
// qDebug( filename );
@@ -813,3 +837,3 @@ void PlayListWidget::writem3u() {
- delete fileDlg;
+ //delete fileDlg;