summaryrefslogtreecommitdiff
path: root/src/prefgeneral.cpp
diff options
context:
space:
mode:
authorMateusz Łukasik <mati75@linuxmint.pl>2018-02-09 21:15:25 +0100
committerMateusz Łukasik <mati75@linuxmint.pl>2018-02-09 21:15:25 +0100
commit2a89e521054ca07840269f4c9457c664497e12bd (patch)
tree106ec003fc51e0de45bcb2bb760dd9d94eeefd47 /src/prefgeneral.cpp
parent458e01ecbd3fe8ad87920bfffd113c1c87dfc637 (diff)
New upstream version 18.2.0~ds0
Diffstat (limited to 'src/prefgeneral.cpp')
-rw-r--r--src/prefgeneral.cpp57
1 files changed, 39 insertions, 18 deletions
diff --git a/src/prefgeneral.cpp b/src/prefgeneral.cpp
index 3b32386..a2fd72e 100644
--- a/src/prefgeneral.cpp
+++ b/src/prefgeneral.cpp
@@ -104,6 +104,11 @@ PrefGeneral::PrefGeneral(QWidget * parent, Qt::WindowFlags f)
blackborders_check->hide();
#endif
+#if SIMPLE_TRACK_SELECTION
+ tracks_frame->hide();
+ tracks_separator->hide();
+#endif
+
#ifdef MPV_SUPPORT
screenshot_format_combo->addItems(QStringList() << "png" << "ppm" << "pgm" << "pgmyuv" << "tga" << "jpg" << "jpeg");
#else
@@ -206,9 +211,7 @@ void PrefGeneral::retranslateStrings() {
"subtitle streams is found, SMPlayer will try to use your "
"preferred language. This only will work with media that offer "
"info about the language of audio and subtitle streams, like DVDs "
- "or mkv files.<br>These fields accept regular expressions. "
- "Example: <b>es|esp|spa</b> will select the track if it matches with "
- "<i>es</i>, <i>esp</i> or <i>spa</i>."));
+ "or mkv files.") );
#ifndef MPLAYER_MPV_SELECTION
executable_label->setText( tr("%1 &executable:").arg(PLAYER_NAME) );
@@ -235,10 +238,17 @@ void PrefGeneral::setData(Preferences * pref) {
remember_streams_check->setChecked(pref->remember_stream_settings);
setFileSettingsMethod( pref->file_settings_method );
+
+#if SIMPLE_TRACK_SELECTION
+ setAudioLang( pref->alang );
+ setSubtitleLang( pref->slang );
+#else
setAudioLang( pref->audio_lang );
setSubtitleLang( pref->subtitle_lang );
setAudioTrack( pref->initial_audio_track );
setSubtitleTrack( pref->initial_subtitle_track );
+#endif
+
setCloseOnFinish( pref->close_on_finish );
setPauseWhenHidden( pref->pause_when_hidden );
#ifdef AUTO_SHUTDOWN_PC
@@ -333,11 +343,16 @@ void PrefGeneral::getData(Preferences * pref) {
filesettings_method_changed = true;
}
+#if SIMPLE_TRACK_SELECTION
+ pref->alang = audioLang();
+ pref->slang = subtitleLang();
+#else
pref->audio_lang = audioLang();
pref->subtitle_lang = subtitleLang();
pref->initial_audio_track = audioTrack();
pref->initial_subtitle_track = subtitleTrack();
+#endif
pref->close_on_finish = closeOnFinish();
pref->pause_when_hidden = pauseWhenHidden();
@@ -672,6 +687,7 @@ QString PrefGeneral::subtitleLang() {
return subtitle_lang_edit->text();
}
+#if !SIMPLE_TRACK_SELECTION
void PrefGeneral::setAudioTrack(int track) {
audio_track_spin->setValue(track);
}
@@ -687,6 +703,7 @@ void PrefGeneral::setSubtitleTrack(int track) {
int PrefGeneral::subtitleTrack() {
return subtitle_track_spin->value();
}
+#endif
void PrefGeneral::setCloseOnFinish(bool b) {
close_on_finish_check->setChecked(b);
@@ -1239,25 +1256,29 @@ void PrefGeneral::createHelp() {
addSectionTitle(tr("Preferred audio and subtitles"));
setWhatsThis(audio_lang_edit, tr("Preferred audio language"),
- tr("Here you can type your preferred language for the audio streams. "
- "When a media with multiple audio streams is found, SMPlayer will "
- "try to use your preferred language.<br>"
- "This only will work with media that offer info about the language "
- "of the audio streams, like DVDs or mkv files.<br>"
- "This field accepts regular expressions. Example: <b>es|esp|spa</b> "
+#if SIMPLE_TRACK_SELECTION
+ tr("You can specify here a priority list of audio language codes, separated by commas. "
+ "For example: spa,eng,jpn")
+
+#else
+ tr("This field accepts regular expressions. Example: <b>es|esp|spa</b> "
"will select the audio track if it matches with <i>es</i>, "
- "<i>esp</i> or <i>spa</i>.") );
+ "<i>esp</i> or <i>spa</i>.")
+#endif
+ );
setWhatsThis(subtitle_lang_edit, tr("Preferred subtitle language"),
- tr("Here you can type your preferred language for the subtitle stream. "
- "When a media with multiple subtitle streams is found, SMPlayer will "
- "try to use your preferred language.<br>"
- "This only will work with media that offer info about the language "
- "of the subtitle streams, like DVDs or mkv files.<br>"
- "This field accepts regular expressions. Example: <b>es|esp|spa</b> "
+#if SIMPLE_TRACK_SELECTION
+ tr("You can specify here a priority list of subtitle language codes, separated by commas. "
+ "For example: spa,eng,jpn")
+#else
+ tr("This field accepts regular expressions. Example: <b>es|esp|spa</b> "
"will select the subtitle stream if it matches with <i>es</i>, "
- "<i>esp</i> or <i>spa</i>.") );
+ "<i>esp</i> or <i>spa</i>.")
+#endif
+ );
+#if !SIMPLE_TRACK_SELECTION
setWhatsThis(audio_track_spin, tr("Audio track"),
tr("Specifies the default audio track which will be used when playing "
"new files. If the track doesn't exist, the first one will be used. "
@@ -1269,7 +1290,7 @@ void PrefGeneral::createHelp() {
"playing new files. If the track doesn't exist, the first one "
"will be used. <br><b>Note:</b> the <i>\"preferred subtitle "
"language\"</i> has preference over this option.") );
-
+#endif
}
#include "moc_prefgeneral.cpp"