[112] | 1 | /* smplayer, GUI front-end for mplayer.
|
---|
[188] | 2 | Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
[112] | 3 |
|
---|
| 4 | This program is free software; you can redistribute it and/or modify
|
---|
| 5 | it under the terms of the GNU General Public License as published by
|
---|
| 6 | the Free Software Foundation; either version 2 of the License, or
|
---|
| 7 | (at your option) any later version.
|
---|
| 8 |
|
---|
| 9 | This program is distributed in the hope that it will be useful,
|
---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 12 | GNU General Public License for more details.
|
---|
| 13 |
|
---|
| 14 | You should have received a copy of the GNU General Public License
|
---|
| 15 | along with this program; if not, write to the Free Software
|
---|
| 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
| 17 | */
|
---|
| 18 |
|
---|
| 19 |
|
---|
| 20 | #include "prefsubtitles.h"
|
---|
| 21 | #include "images.h"
|
---|
| 22 | #include "preferences.h"
|
---|
| 23 | #include "paths.h"
|
---|
| 24 | #include "assstyles.h"
|
---|
| 25 | #include "filedialog.h"
|
---|
| 26 | #include "languages.h"
|
---|
[176] | 27 | #include "playerid.h"
|
---|
[112] | 28 |
|
---|
| 29 | #include <QInputDialog>
|
---|
| 30 |
|
---|
| 31 | PrefSubtitles::PrefSubtitles(QWidget * parent, Qt::WindowFlags f)
|
---|
| 32 | : PrefWidget(parent, f )
|
---|
| 33 | {
|
---|
| 34 | setupUi(this);
|
---|
| 35 |
|
---|
[176] | 36 | ass_subs->setEnabled(false);
|
---|
[112] | 37 |
|
---|
[176] | 38 | connect(ass_custom_check, SIGNAL(toggled(bool)),
|
---|
| 39 | ass_subs, SLOT(setEnabled(bool)));
|
---|
| 40 |
|
---|
| 41 | /*
|
---|
| 42 | connect(use_ass_check, SIGNAL(toggled(bool)),
|
---|
| 43 | tab2, SLOT(setEnabled(bool)));
|
---|
| 44 | */
|
---|
| 45 |
|
---|
[112] | 46 | connect( style_border_style_combo, SIGNAL(currentIndexChanged(int)),
|
---|
| 47 | this, SLOT(checkBorderStyleCombo(int)) );
|
---|
| 48 |
|
---|
[176] | 49 | #ifndef FONTS_HACK
|
---|
[165] | 50 | windowsfontdir_check->hide();
|
---|
| 51 | #endif
|
---|
| 52 |
|
---|
[112] | 53 | retranslateStrings();
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 | PrefSubtitles::~PrefSubtitles()
|
---|
| 57 | {
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | QString PrefSubtitles::sectionName() {
|
---|
| 61 | return tr("Subtitles");
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | QPixmap PrefSubtitles::sectionIcon() {
|
---|
[181] | 65 | return Images::icon("pref_subtitles");
|
---|
[112] | 66 | }
|
---|
| 67 |
|
---|
| 68 |
|
---|
| 69 | void PrefSubtitles::retranslateStrings() {
|
---|
| 70 | int font_autoload_item = font_autoload_combo->currentIndex();
|
---|
| 71 |
|
---|
| 72 | retranslateUi(this);
|
---|
| 73 |
|
---|
| 74 | font_autoload_combo->setCurrentIndex(font_autoload_item);
|
---|
| 75 |
|
---|
| 76 | // Encodings combo
|
---|
| 77 | //int font_encoding_item = font_encoding_combo->currentIndex();
|
---|
| 78 | QString current_encoding = fontEncoding();
|
---|
| 79 | QString current_enca_lang = encaLang();
|
---|
| 80 | font_encoding_combo->clear();
|
---|
| 81 | enca_lang_combo->clear();
|
---|
| 82 |
|
---|
| 83 | QMap<QString,QString> l = Languages::encodings();
|
---|
| 84 | QMapIterator<QString, QString> i(l);
|
---|
| 85 | while (i.hasNext()) {
|
---|
| 86 | i.next();
|
---|
| 87 | font_encoding_combo->addItem( i.value() + " (" + i.key() + ")", i.key() );
|
---|
| 88 | }
|
---|
[176] | 89 |
|
---|
| 90 | l = Languages::enca();
|
---|
| 91 | i = l;
|
---|
[112] | 92 | while (i.hasNext()) {
|
---|
| 93 | i.next();
|
---|
| 94 | enca_lang_combo->addItem( i.value() + " (" + i.key() + ")", i.key() );
|
---|
| 95 | }
|
---|
[176] | 96 |
|
---|
[112] | 97 | font_encoding_combo->model()->sort(0);
|
---|
| 98 | enca_lang_combo->model()->sort(0);
|
---|
| 99 | //font_encoding_combo->setCurrentIndex(font_encoding_item);
|
---|
| 100 | setFontEncoding(current_encoding);
|
---|
| 101 | setEncaLang(current_enca_lang);
|
---|
| 102 |
|
---|
| 103 | // Ass styles
|
---|
| 104 | int alignment_item = style_alignment_combo->currentIndex();
|
---|
| 105 | style_alignment_combo->clear();
|
---|
[176] | 106 | style_alignment_combo->addItem(tr("Left", "horizontal alignment"), AssStyles::Left);
|
---|
| 107 | style_alignment_combo->addItem(tr("Centered", "horizontal alignment"), AssStyles::HCenter);
|
---|
| 108 | style_alignment_combo->addItem(tr("Right", "horizontal alignment"), AssStyles::Right);
|
---|
[112] | 109 | style_alignment_combo->setCurrentIndex(alignment_item);
|
---|
| 110 |
|
---|
| 111 | int valignment_item = style_valignment_combo->currentIndex();
|
---|
| 112 | style_valignment_combo->clear();
|
---|
[176] | 113 | style_valignment_combo->addItem(tr("Bottom", "vertical alignment"), AssStyles::Bottom);
|
---|
| 114 | style_valignment_combo->addItem(tr("Middle", "vertical alignment"), AssStyles::VCenter);
|
---|
| 115 | style_valignment_combo->addItem(tr("Top", "vertical alignment"), AssStyles::Top);
|
---|
[112] | 116 | style_valignment_combo->setCurrentIndex(valignment_item);
|
---|
| 117 |
|
---|
| 118 | int borderstyle_item = style_border_style_combo->currentIndex();
|
---|
| 119 | style_border_style_combo->clear();
|
---|
[176] | 120 | style_border_style_combo->addItem(tr("Outline", "border style"), AssStyles::Outline);
|
---|
| 121 | style_border_style_combo->addItem(tr("Opaque box", "border style"), AssStyles::Opaque);
|
---|
[112] | 122 | style_border_style_combo->setCurrentIndex(borderstyle_item);
|
---|
| 123 |
|
---|
| 124 | createHelp();
|
---|
| 125 | }
|
---|
| 126 |
|
---|
| 127 | void PrefSubtitles::setData(Preferences * pref) {
|
---|
| 128 | setAssFontScale( pref->initial_sub_scale_ass );
|
---|
| 129 | setAutoloadSub( pref->autoload_sub );
|
---|
| 130 | setFontFuzziness( pref->subfuzziness );
|
---|
| 131 | setFontEncoding( pref->subcp );
|
---|
| 132 | setUseEnca( pref->use_enca );
|
---|
| 133 | setEncaLang( pref->enca_lang );
|
---|
| 134 | setAssLineSpacing( pref->ass_line_spacing );
|
---|
| 135 | setSubtitlesOnScreenshots( pref->subtitles_on_screenshots );
|
---|
| 136 | setFreetypeSupport( pref->freetype_support );
|
---|
[176] | 137 | use_ass_check->setChecked( pref->use_ass_subtitles );
|
---|
[112] | 138 |
|
---|
| 139 | // Load ass styles
|
---|
| 140 | style_font_combo->setCurrentText(pref->ass_styles.fontname);
|
---|
| 141 | style_size_spin->setValue(pref->ass_styles.fontsize);
|
---|
| 142 | style_text_color_button->setColor(pref->ass_styles.primarycolor);
|
---|
| 143 | style_border_color_button->setColor(pref->ass_styles.outlinecolor);
|
---|
| 144 | style_shadow_color_button->setColor(pref->ass_styles.backcolor);
|
---|
| 145 | style_bold_check->setChecked(pref->ass_styles.bold);
|
---|
| 146 | style_italic_check->setChecked(pref->ass_styles.italic);
|
---|
| 147 | style_alignment_combo->setCurrentIndex(style_alignment_combo->findData(pref->ass_styles.halignment));
|
---|
| 148 | style_valignment_combo->setCurrentIndex(pref->ass_styles.valignment);
|
---|
| 149 | style_border_style_combo->setCurrentIndex(style_border_style_combo->findData(pref->ass_styles.borderstyle));
|
---|
| 150 | style_outline_spin->setValue(pref->ass_styles.outline);
|
---|
| 151 | style_shadow_spin->setValue(pref->ass_styles.shadow);
|
---|
| 152 | style_marginl_spin->setValue(pref->ass_styles.marginl);
|
---|
| 153 | style_marginr_spin->setValue(pref->ass_styles.marginr);
|
---|
| 154 | style_marginv_spin->setValue(pref->ass_styles.marginv);
|
---|
| 155 |
|
---|
| 156 | setForceAssStyles(pref->force_ass_styles);
|
---|
| 157 | setCustomizedAssStyle(pref->user_forced_ass_style);
|
---|
[165] | 158 |
|
---|
[176] | 159 | ass_custom_check->setChecked(pref->enable_ass_styles);
|
---|
| 160 |
|
---|
| 161 | #ifdef FONTS_HACK
|
---|
[165] | 162 | windowsfontdir_check->setChecked(pref->use_windowsfontdir);
|
---|
| 163 | if (!windowsfontdir_check->isChecked()) on_windowsfontdir_check_toggled(false);
|
---|
| 164 | #endif
|
---|
[112] | 165 | }
|
---|
| 166 |
|
---|
| 167 | void PrefSubtitles::getData(Preferences * pref) {
|
---|
| 168 | requires_restart = false;
|
---|
| 169 |
|
---|
| 170 | pref->initial_sub_scale_ass = assFontScale();
|
---|
| 171 | TEST_AND_SET(pref->autoload_sub, autoloadSub());
|
---|
| 172 | TEST_AND_SET(pref->subfuzziness, fontFuzziness());
|
---|
| 173 | TEST_AND_SET(pref->subcp, fontEncoding());
|
---|
| 174 | TEST_AND_SET(pref->use_enca, useEnca());
|
---|
| 175 | TEST_AND_SET(pref->enca_lang, encaLang());
|
---|
| 176 | TEST_AND_SET(pref->ass_line_spacing, assLineSpacing());
|
---|
| 177 | TEST_AND_SET(pref->subtitles_on_screenshots, subtitlesOnScreenshots());
|
---|
| 178 | TEST_AND_SET(pref->freetype_support, freetypeSupport());
|
---|
[176] | 179 | TEST_AND_SET(pref->use_ass_subtitles, use_ass_check->isChecked());
|
---|
[112] | 180 |
|
---|
| 181 | // Save ass styles
|
---|
| 182 | TEST_AND_SET(pref->ass_styles.fontname, style_font_combo->currentText());
|
---|
| 183 | TEST_AND_SET(pref->ass_styles.fontsize, style_size_spin->value());
|
---|
[188] | 184 | TEST_AND_SET(pref->ass_styles.primarycolor, style_text_color_button->color());
|
---|
| 185 | TEST_AND_SET(pref->ass_styles.outlinecolor, style_border_color_button->color());
|
---|
| 186 | TEST_AND_SET(pref->ass_styles.backcolor, style_shadow_color_button->color());
|
---|
[112] | 187 | TEST_AND_SET(pref->ass_styles.bold, style_bold_check->isChecked());
|
---|
| 188 | TEST_AND_SET(pref->ass_styles.italic, style_italic_check->isChecked());
|
---|
| 189 | TEST_AND_SET(pref->ass_styles.halignment, style_alignment_combo->itemData(style_alignment_combo->currentIndex()).toInt());
|
---|
| 190 | TEST_AND_SET(pref->ass_styles.valignment, style_valignment_combo->currentIndex());
|
---|
| 191 | TEST_AND_SET(pref->ass_styles.borderstyle, style_border_style_combo->itemData(style_border_style_combo->currentIndex()).toInt());
|
---|
| 192 | TEST_AND_SET(pref->ass_styles.outline, style_outline_spin->value());
|
---|
| 193 | TEST_AND_SET(pref->ass_styles.shadow, style_shadow_spin->value());
|
---|
| 194 | TEST_AND_SET(pref->ass_styles.marginl, style_marginl_spin->value());
|
---|
| 195 | TEST_AND_SET(pref->ass_styles.marginr, style_marginr_spin->value());
|
---|
| 196 | TEST_AND_SET(pref->ass_styles.marginv, style_marginv_spin->value());
|
---|
| 197 |
|
---|
| 198 | pref->ass_styles.exportStyles( Paths::subtitleStyleFile() );
|
---|
| 199 |
|
---|
| 200 | TEST_AND_SET(pref->force_ass_styles, forceAssStyles());
|
---|
| 201 | TEST_AND_SET(pref->user_forced_ass_style, customizedAssStyle());
|
---|
[165] | 202 |
|
---|
[176] | 203 | TEST_AND_SET(pref->enable_ass_styles, ass_custom_check->isChecked());
|
---|
| 204 |
|
---|
| 205 | #ifdef FONTS_HACK
|
---|
[165] | 206 | pref->use_windowsfontdir = windowsfontdir_check->isChecked();
|
---|
| 207 | #endif
|
---|
[112] | 208 | }
|
---|
| 209 |
|
---|
| 210 | void PrefSubtitles::checkBorderStyleCombo( int index ) {
|
---|
| 211 | bool b = (index == 0);
|
---|
| 212 | style_outline_spin->setEnabled(b);
|
---|
| 213 | style_shadow_spin->setEnabled(b);
|
---|
| 214 | style_outline_label->setEnabled(b);
|
---|
| 215 | style_shadow_label->setEnabled(b);
|
---|
| 216 | }
|
---|
| 217 |
|
---|
| 218 |
|
---|
| 219 |
|
---|
| 220 | void PrefSubtitles::setAssFontScale(double n) {
|
---|
| 221 | ass_font_scale_spin->setValue(n);
|
---|
| 222 | }
|
---|
| 223 |
|
---|
| 224 | double PrefSubtitles::assFontScale() {
|
---|
| 225 | return ass_font_scale_spin->value();
|
---|
| 226 | }
|
---|
| 227 |
|
---|
| 228 | void PrefSubtitles::setAutoloadSub(bool v) {
|
---|
| 229 | font_autoload_check->setChecked(v);
|
---|
| 230 | }
|
---|
| 231 |
|
---|
| 232 | bool PrefSubtitles::autoloadSub() {
|
---|
| 233 | return font_autoload_check->isChecked();
|
---|
| 234 | }
|
---|
| 235 |
|
---|
| 236 | void PrefSubtitles::setFontEncoding(QString s) {
|
---|
| 237 | int i = font_encoding_combo->findData(s);
|
---|
| 238 | font_encoding_combo->setCurrentIndex(i);
|
---|
| 239 | }
|
---|
| 240 |
|
---|
| 241 | QString PrefSubtitles::fontEncoding() {
|
---|
| 242 | int index = font_encoding_combo->currentIndex();
|
---|
| 243 | return font_encoding_combo->itemData(index).toString();
|
---|
| 244 | }
|
---|
| 245 |
|
---|
| 246 | void PrefSubtitles::setEncaLang(QString s) {
|
---|
| 247 | int i = enca_lang_combo->findData(s);
|
---|
| 248 | enca_lang_combo->setCurrentIndex(i);
|
---|
| 249 | }
|
---|
| 250 |
|
---|
| 251 | QString PrefSubtitles::encaLang() {
|
---|
| 252 | int index = enca_lang_combo->currentIndex();
|
---|
| 253 | return enca_lang_combo->itemData(index).toString();
|
---|
| 254 | }
|
---|
| 255 |
|
---|
| 256 | void PrefSubtitles::setUseEnca(bool b) {
|
---|
| 257 | use_enca_check->setChecked(b);
|
---|
| 258 | }
|
---|
| 259 |
|
---|
| 260 | bool PrefSubtitles::useEnca() {
|
---|
| 261 | return use_enca_check->isChecked();
|
---|
| 262 | }
|
---|
| 263 |
|
---|
| 264 | void PrefSubtitles::setFontFuzziness(int n) {
|
---|
| 265 | font_autoload_combo->setCurrentIndex(n);
|
---|
| 266 | }
|
---|
| 267 |
|
---|
| 268 | int PrefSubtitles::fontFuzziness() {
|
---|
| 269 | return font_autoload_combo->currentIndex();
|
---|
| 270 | }
|
---|
| 271 |
|
---|
| 272 | void PrefSubtitles::setSubtitlesOnScreenshots(bool b) {
|
---|
| 273 | subtitles_on_screeshots_check->setChecked(b);
|
---|
| 274 | }
|
---|
| 275 |
|
---|
| 276 | bool PrefSubtitles::subtitlesOnScreenshots() {
|
---|
| 277 | return subtitles_on_screeshots_check->isChecked();
|
---|
| 278 | }
|
---|
| 279 |
|
---|
| 280 | void PrefSubtitles::setAssLineSpacing(int spacing) {
|
---|
| 281 | ass_line_spacing_spin->setValue(spacing);
|
---|
| 282 | }
|
---|
| 283 |
|
---|
| 284 | int PrefSubtitles::assLineSpacing() {
|
---|
| 285 | return ass_line_spacing_spin->value();
|
---|
| 286 | }
|
---|
| 287 |
|
---|
| 288 | void PrefSubtitles::setForceAssStyles(bool b) {
|
---|
| 289 | force_ass_styles->setChecked(b);
|
---|
| 290 | }
|
---|
| 291 |
|
---|
| 292 | bool PrefSubtitles::forceAssStyles() {
|
---|
| 293 | return force_ass_styles->isChecked();
|
---|
| 294 | }
|
---|
| 295 |
|
---|
[176] | 296 | /*
|
---|
[112] | 297 | void PrefSubtitles::on_ass_subs_button_toggled(bool b) {
|
---|
[176] | 298 | if (b)
|
---|
[112] | 299 | stackedWidget->setCurrentIndex(1);
|
---|
| 300 | else
|
---|
| 301 | stackedWidget->setCurrentIndex(0);
|
---|
| 302 | }
|
---|
[176] | 303 | */
|
---|
[112] | 304 |
|
---|
| 305 | void PrefSubtitles::on_ass_customize_button_clicked() {
|
---|
| 306 | bool ok;
|
---|
| 307 |
|
---|
| 308 | QString edit = forced_ass_style;
|
---|
| 309 |
|
---|
| 310 | // A copy with the current values in the dialog
|
---|
| 311 | AssStyles ass_styles;
|
---|
| 312 | ass_styles.fontname = style_font_combo->currentText();
|
---|
| 313 | ass_styles.fontsize = style_size_spin->value();
|
---|
[188] | 314 | ass_styles.primarycolor = style_text_color_button->color();
|
---|
| 315 | ass_styles.outlinecolor = style_border_color_button->color();
|
---|
| 316 | ass_styles.backcolor = style_shadow_color_button->color();
|
---|
[112] | 317 | ass_styles.bold = style_bold_check->isChecked();
|
---|
| 318 | ass_styles.italic = style_italic_check->isChecked();
|
---|
| 319 | ass_styles.halignment = style_alignment_combo->itemData(style_alignment_combo->currentIndex()).toInt();
|
---|
| 320 | ass_styles.valignment = style_valignment_combo->currentIndex();
|
---|
| 321 | ass_styles.borderstyle = style_border_style_combo->itemData(style_border_style_combo->currentIndex()).toInt();
|
---|
| 322 | ass_styles.outline = style_outline_spin->value();
|
---|
| 323 | ass_styles.shadow = style_shadow_spin->value();
|
---|
| 324 | ass_styles.marginl = style_marginl_spin->value();
|
---|
| 325 | ass_styles.marginr = style_marginr_spin->value();
|
---|
| 326 | ass_styles.marginv = style_marginv_spin->value();
|
---|
| 327 |
|
---|
| 328 | if (edit.isEmpty()) {
|
---|
| 329 | edit = ass_styles.toString();
|
---|
| 330 | }
|
---|
| 331 |
|
---|
| 332 | QString s = QInputDialog::getText(this, tr("Customize SSA/ASS style"),
|
---|
| 333 | tr("Here you can enter your customized SSA/ASS style.") +"<br>"+
|
---|
| 334 | tr("Clear the edit line to disable the customized style."),
|
---|
| 335 | QLineEdit::Normal,
|
---|
| 336 | edit, &ok );
|
---|
| 337 | if (ok) {
|
---|
| 338 | if (s == ass_styles.toString()) s.clear(); // Clear string if it wasn't changed by the user
|
---|
| 339 | setCustomizedAssStyle(s);
|
---|
| 340 | }
|
---|
| 341 | }
|
---|
| 342 |
|
---|
| 343 | void PrefSubtitles::setFreetypeSupport(bool b) {
|
---|
| 344 | freetype_check->setChecked(b);
|
---|
| 345 | }
|
---|
| 346 |
|
---|
| 347 | bool PrefSubtitles::freetypeSupport() {
|
---|
| 348 | return freetype_check->isChecked();
|
---|
| 349 | }
|
---|
| 350 |
|
---|
| 351 | void PrefSubtitles::on_freetype_check_toggled(bool b) {
|
---|
| 352 | qDebug("PrefSubtitles:on_freetype_check_toggled: %d", b);
|
---|
| 353 | }
|
---|
| 354 |
|
---|
[176] | 355 | #ifdef FONTS_HACK
|
---|
[165] | 356 | void PrefSubtitles::on_windowsfontdir_check_toggled(bool b) {
|
---|
| 357 | qDebug("PrefSubtitles::on_windowsfontdir_check_toggled: %d", b);
|
---|
| 358 |
|
---|
| 359 | if (b) {
|
---|
| 360 | style_font_combo->setFontsFromDir(QString::null);
|
---|
| 361 | } else {
|
---|
| 362 | QString fontdir = Paths::fontPath();
|
---|
| 363 | //QString fontdir = "/tmp/fonts/";
|
---|
| 364 | style_font_combo->setFontsFromDir(fontdir);
|
---|
[170] | 365 |
|
---|
| 366 | // Calling setFontsFromDir resets the fonts in other comboboxes!
|
---|
| 367 | // So the font list is copied from the previous combobox
|
---|
[176] | 368 | /*
|
---|
[170] | 369 | QString current_text = fontCombo->currentText();
|
---|
| 370 | fontCombo->clear();
|
---|
| 371 | for (int n=0; n < style_font_combo->count(); n++) {
|
---|
| 372 | fontCombo->addItem( style_font_combo->itemText(n) );
|
---|
| 373 | }
|
---|
| 374 | fontCombo->setCurrentText(current_text);
|
---|
[176] | 375 | */
|
---|
[165] | 376 | }
|
---|
[176] | 377 | }
|
---|
[165] | 378 | #endif
|
---|
| 379 |
|
---|
[112] | 380 | void PrefSubtitles::createHelp() {
|
---|
| 381 | clearHelp();
|
---|
| 382 |
|
---|
| 383 | addSectionTitle(tr("Subtitles"));
|
---|
| 384 |
|
---|
| 385 | setWhatsThis(font_autoload_combo, tr("Autoload"),
|
---|
| 386 | tr("Select the subtitle autoload method.") );
|
---|
| 387 |
|
---|
| 388 | setWhatsThis(font_autoload_check, tr("Select first available subtitle"),
|
---|
| 389 | tr("If there are one or more subtitle tracks available, one of them "
|
---|
| 390 | "will be automatically selected, usually the first one, although if "
|
---|
| 391 | "one of them matches the user's preferred language that one will "
|
---|
| 392 | "be used instead.") );
|
---|
| 393 |
|
---|
| 394 | setWhatsThis(font_encoding_combo, tr("Default subtitle encoding"),
|
---|
| 395 | tr("Select the encoding which will be used for subtitle files "
|
---|
| 396 | "by default.") );
|
---|
| 397 |
|
---|
| 398 | setWhatsThis(use_enca_check, tr("Try to autodetect for this language"),
|
---|
| 399 | tr("When this option is on, the encoding of the subtitles will be "
|
---|
| 400 | "tried to be autodetected for the given language. "
|
---|
| 401 | "It will fall back to the default encoding if the autodetection "
|
---|
[176] | 402 | "fails. This option requires a %1 with ENCA "
|
---|
| 403 | "support.").arg(PLAYER_NAME) );
|
---|
[112] | 404 |
|
---|
| 405 | setWhatsThis(enca_lang_combo, tr("Subtitle language"),
|
---|
| 406 | tr("Select the language for which you want the encoding to be guessed "
|
---|
| 407 | "automatically.") );
|
---|
| 408 |
|
---|
| 409 | setWhatsThis(subtitles_on_screeshots_check,
|
---|
| 410 | tr("Include subtitles on screenshots"),
|
---|
| 411 | tr("If this option is checked, the subtitles will appear in the "
|
---|
| 412 | "screenshots. <b>Note:</b> it may cause some troubles sometimes." ) );
|
---|
| 413 |
|
---|
[176] | 414 | setWhatsThis(use_ass_check, tr("Use the ASS library"),
|
---|
| 415 | tr("This option enables the ASS library, which allows to display "
|
---|
| 416 | "subtitles with multiple colors, fonts...") );
|
---|
| 417 |
|
---|
[112] | 418 | setWhatsThis(freetype_check, tr("Freetype support"),
|
---|
| 419 | tr("You should normally not disable this option. Do it only if your "
|
---|
[176] | 420 | "%1 is compiled without freetype support. "
|
---|
| 421 | "<b>Disabling this option could make subtitles not to work "
|
---|
| 422 | "at all!</b>").arg(PLAYER_NAME));
|
---|
[112] | 423 |
|
---|
[176] | 424 | #ifdef FONTS_HACK
|
---|
| 425 | setWhatsThis(windowsfontdir_check, tr("Enable Windows fonts"),
|
---|
[165] | 426 | tr("If this option is enabled the Windows system fonts will be "
|
---|
| 427 | "available for subtitles. There's an inconvenience: a font cache have "
|
---|
| 428 | "to be created which can take some time.") +"<br>"+
|
---|
| 429 | tr("If this option is not checked then only a few fonts bundled with SMPlayer "
|
---|
| 430 | "can be used, but this is faster.") );
|
---|
| 431 | #endif
|
---|
| 432 |
|
---|
[112] | 433 | addSectionTitle(tr("Font"));
|
---|
| 434 |
|
---|
| 435 | QString scale_note = tr("This option does NOT change the size of the "
|
---|
[176] | 436 | "subtitles in the current video. To do so, use the options "
|
---|
[112] | 437 | "<i>Size+</i> and <i>Size-</i> in the subtitles menu.");
|
---|
| 438 |
|
---|
| 439 | setWhatsThis(ass_font_scale_spin, tr("Default scale"),
|
---|
| 440 | tr("This option specifies the default font scale for SSA/ASS "
|
---|
| 441 | "subtitles which will be used for new opened files.") +"<br>"+
|
---|
| 442 | scale_note);
|
---|
| 443 |
|
---|
| 444 | setWhatsThis(ass_line_spacing_spin, tr("Line spacing"),
|
---|
| 445 | tr("This specifies the spacing that will be used to separate "
|
---|
| 446 | "multiple lines. It can have negative values.") );
|
---|
| 447 |
|
---|
| 448 | setWhatsThis(styles_container, tr("SSA/ASS style"),
|
---|
| 449 | tr("The following options allows you to define the style to "
|
---|
| 450 | "be used for non-styled subtitles (srt, sub...).") );
|
---|
| 451 |
|
---|
| 452 | setWhatsThis(style_font_combo, tr("Font"),
|
---|
| 453 | tr("Select the font for the subtitles.") );
|
---|
| 454 |
|
---|
| 455 | setWhatsThis(style_size_spin, tr("Size"),
|
---|
| 456 | tr("The size in pixels.") );
|
---|
| 457 |
|
---|
| 458 | setWhatsThis(style_bold_check, tr("Bold"),
|
---|
| 459 | tr("If checked, the text will be displayed in <b>bold</b>.") );
|
---|
| 460 |
|
---|
| 461 | setWhatsThis(style_italic_check, tr("Italic"),
|
---|
| 462 | tr("If checked, the text will be displayed in <i>italic</i>.") );
|
---|
| 463 |
|
---|
| 464 | setWhatsThis(style_text_color_button, tr("Text color"),
|
---|
| 465 | tr("Select the color for the text of the subtitles.") );
|
---|
| 466 |
|
---|
| 467 | setWhatsThis(style_border_color_button, tr("Border color"),
|
---|
| 468 | tr("Select the color for the border of the subtitles.") );
|
---|
| 469 |
|
---|
| 470 | setWhatsThis(style_shadow_color_button, tr("Shadow color"),
|
---|
| 471 | tr("This color will be used for the shadow of the subtitles.") );
|
---|
| 472 |
|
---|
| 473 | setWhatsThis(style_marginl_spin, tr("Left margin"),
|
---|
| 474 | tr("Specifies the left margin in pixels.") );
|
---|
| 475 |
|
---|
| 476 | setWhatsThis(style_marginr_spin, tr("Right margin"),
|
---|
| 477 | tr("Specifies the right margin in pixels.") );
|
---|
| 478 |
|
---|
| 479 | setWhatsThis(style_marginv_spin, tr("Vertical margin"),
|
---|
| 480 | tr("Specifies the vertical margin in pixels.") );
|
---|
| 481 |
|
---|
| 482 | setWhatsThis(style_alignment_combo, tr("Horizontal alignment"),
|
---|
| 483 | tr("Specifies the horizontal alignment. Possible values are "
|
---|
| 484 | "left, centered and right.") );
|
---|
| 485 |
|
---|
| 486 | setWhatsThis(style_valignment_combo, tr("Vertical alignment"),
|
---|
| 487 | tr("Specifies the vertical alignment. Possible values: "
|
---|
| 488 | "bottom, middle and top.") );
|
---|
| 489 |
|
---|
| 490 | setWhatsThis(style_border_style_combo, tr("Border style"),
|
---|
| 491 | tr("Specifies the border style. Possible values: outline "
|
---|
| 492 | "and opaque box.") );
|
---|
| 493 |
|
---|
| 494 | setWhatsThis(style_outline_spin, tr("Outline"),
|
---|
| 495 | tr("If border style is set to <i>outline</i>, this option specifies "
|
---|
| 496 | "the width of the outline around the text in pixels.") );
|
---|
| 497 |
|
---|
| 498 | setWhatsThis(style_shadow_spin, tr("Shadow"),
|
---|
| 499 | tr("If border style is set to <i>outline</i>, this option specifies "
|
---|
| 500 | "the depth of the drop shadow behind the text in pixels.") );
|
---|
| 501 |
|
---|
[176] | 502 | setWhatsThis(force_ass_styles, tr("Apply style to ASS files too"),
|
---|
[112] | 503 | tr("If this option is checked, the style defined above will be "
|
---|
| 504 | "applied to ass subtitles too.") );
|
---|
| 505 | }
|
---|
| 506 |
|
---|
| 507 | #include "moc_prefsubtitles.cpp"
|
---|