summaryrefslogtreecommitdiff
path: root/src/prefplaylist.cpp
diff options
context:
space:
mode:
authorMateusz Łukasik <mati75@linuxmint.pl>2014-04-21 11:53:35 +0200
committerMateusz Łukasik <mati75@linuxmint.pl>2014-04-21 11:53:35 +0200
commit2a117cc570574099839da41a5ae9fbb2a5ca9e55 (patch)
tree6107da409f9c7f07c0ffa0869a26a161b097aea7 /src/prefplaylist.cpp
parentaa68b7bd585a157e8952881e87e2c09de6ec742f (diff)
Imported Upstream version 14.3.0
Diffstat (limited to 'src/prefplaylist.cpp')
-rw-r--r--src/prefplaylist.cpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/prefplaylist.cpp b/src/prefplaylist.cpp
index d2f83cf..8aecd12 100644
--- a/src/prefplaylist.cpp
+++ b/src/prefplaylist.cpp
@@ -1,5 +1,5 @@
/* smplayer, GUI front-end for mplayer.
- Copyright (C) 2006-2013 Ricardo Villalba <rvm@users.sourceforge.net>
+ Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,6 +25,12 @@ PrefPlaylist::PrefPlaylist(QWidget * parent, Qt::WindowFlags f)
{
setupUi(this);
+ media_to_add_combo->addItem(tr("None"), Preferences::NoFiles);
+ media_to_add_combo->addItem(tr("Video files"), Preferences::VideoFiles);
+ media_to_add_combo->addItem(tr("Audio files"), Preferences::AudioFiles);
+ media_to_add_combo->addItem(tr("Video and audio files"), Preferences::MultimediaFiles);
+ media_to_add_combo->addItem(tr("Consecutive files"), Preferences::ConsecutiveFiles);
+
createHelp();
}
@@ -47,14 +53,14 @@ void PrefPlaylist::retranslateStrings() {
void PrefPlaylist::setData(Preferences * pref) {
setAutoAddFilesToPlaylist( pref->auto_add_to_playlist );
- setAddConsecutiveFiles( pref->add_to_playlist_consecutive_files );
+ setMediaToAdd( pref->media_to_add_to_playlist );
}
void PrefPlaylist::getData(Preferences * pref) {
requires_restart = false;
pref->auto_add_to_playlist = autoAddFilesToPlaylist();
- pref->add_to_playlist_consecutive_files = addConsecutiveFiles();
+ pref->media_to_add_to_playlist = (Preferences::AutoAddToPlaylistFilter) mediaToAdd();
}
void PrefPlaylist::setAutoAddFilesToPlaylist(bool b) {
@@ -65,12 +71,14 @@ bool PrefPlaylist::autoAddFilesToPlaylist() {
return auto_add_to_playlist_check->isChecked();
}
-void PrefPlaylist::setAddConsecutiveFiles(bool b) {
- add_consecutive_files_check->setChecked(b);
+void PrefPlaylist::setMediaToAdd(int type) {
+ int i = media_to_add_combo->findData(type);
+ if (i < 0) i = 0;
+ media_to_add_combo->setCurrentIndex(i);
}
-bool PrefPlaylist::addConsecutiveFiles() {
- return add_consecutive_files_check->isChecked();
+int PrefPlaylist::mediaToAdd() {
+ return media_to_add_combo->itemData( media_to_add_combo->currentIndex() ).toInt();
}
void PrefPlaylist::setDirectoryRecursion(bool b) {
@@ -114,10 +122,13 @@ void PrefPlaylist::createHelp() {
"case of DVDs, CDs and VCDs, all titles in the disc will be added "
"to the playlist.") );
- setWhatsThis(add_consecutive_files_check, tr("Add consecutive files"),
- tr("If this option is enabled, SMPlayer will look for consecutive "
- "files (e.g. video_1.avi, video_2.avi...) and if found, they'll be "
- "added to the playlist.") );
+ setWhatsThis(media_to_add_combo, tr("Add files from folder"),
+ tr("This option allows to add files automatically to the playlist:") +"<br>"+
+ tr("<b>None</b>: no files will be added") +"<br>"+
+ tr("<b>Video files</b>: all video files found in the folder will be added") +"<br>"+
+ tr("<b>Audio files</b>: all audio files found in the folder will be added") +"<br>"+
+ tr("<b>Video and audio files</b>: all video and audio files found in the folder will be added") +"<br>"+
+ tr("<b>Consecutive files</b>: consecutive files (like video_1.avi, video_2.avi) will be added") );
setWhatsThis(play_from_start_check, tr("Play files from start"),
tr("If this option is enabled, all files from the playlist will "