summaryrefslogtreecommitdiff
path: root/src/prefsubtitles.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/prefsubtitles.cpp
parentaa68b7bd585a157e8952881e87e2c09de6ec742f (diff)
Imported Upstream version 14.3.0
Diffstat (limited to 'src/prefsubtitles.cpp')
-rw-r--r--src/prefsubtitles.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/prefsubtitles.cpp b/src/prefsubtitles.cpp
index 73d68ed..571acd6 100644
--- a/src/prefsubtitles.cpp
+++ b/src/prefsubtitles.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
@@ -40,6 +40,10 @@ PrefSubtitles::PrefSubtitles(QWidget * parent, Qt::WindowFlags f)
connect( style_border_style_combo, SIGNAL(currentIndexChanged(int)),
this, SLOT(checkBorderStyleCombo(int)) );
+#ifndef Q_OS_WIN
+ windowsfontdir_check->hide();
+#endif
+
retranslateStrings();
}
@@ -155,6 +159,11 @@ void PrefSubtitles::setData(Preferences * pref) {
setForceAssStyles(pref->force_ass_styles);
setCustomizedAssStyle(pref->user_forced_ass_style);
+
+#ifdef Q_OS_WIN
+ windowsfontdir_check->setChecked(pref->use_windowsfontdir);
+ if (!windowsfontdir_check->isChecked()) on_windowsfontdir_check_toggled(false);
+#endif
}
void PrefSubtitles::getData(Preferences * pref) {
@@ -198,6 +207,10 @@ void PrefSubtitles::getData(Preferences * pref) {
TEST_AND_SET(pref->force_ass_styles, forceAssStyles());
TEST_AND_SET(pref->user_forced_ass_style, customizedAssStyle());
+
+#ifdef Q_OS_WIN
+ pref->use_windowsfontdir = windowsfontdir_check->isChecked();
+#endif
}
void PrefSubtitles::checkBorderStyleCombo( int index ) {
@@ -405,6 +418,20 @@ void PrefSubtitles::on_freetype_check_toggled(bool b) {
}
}
+void PrefSubtitles::on_windowsfontdir_check_toggled(bool b) {
+ qDebug("PrefSubtitles::on_windowsfontdir_check_toggled: %d", b);
+
+#ifdef Q_OS_WIN
+ if (b) {
+ style_font_combo->setFontsFromDir(QString::null);
+ } else {
+ QString fontdir = Paths::fontPath();
+ //QString fontdir = "/tmp/fonts/";
+ style_font_combo->setFontsFromDir(fontdir);
+ }
+#endif
+}
+
void PrefSubtitles::createHelp() {
clearHelp();
@@ -445,6 +472,15 @@ void PrefSubtitles::createHelp() {
"<b>Disabling this option could make that subtitles won't work "
"at all!</b>") );
+#ifdef Q_OS_WIN
+ setWhatsThis(windowsfontdir_check, tr("Enable Windows fonts"),
+ tr("If this option is enabled the Windows system fonts will be "
+ "available for subtitles. There's an inconvenience: a font cache have "
+ "to be created which can take some time.") +"<br>"+
+ tr("If this option is not checked then only a few fonts bundled with SMPlayer "
+ "can be used, but this is faster.") );
+#endif
+
addSectionTitle(tr("Font"));
setWhatsThis(normal_subs_button, tr("Enable normal subtitles"),