~ubuntu-branches/ubuntu/wily/smplayer/wily

« back to all changes in this revision

Viewing changes to src/prefsubtitles.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2009-03-31 23:05:43 UTC
  • mfrom: (1.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20090331230543-0h2hfwpwlu9opbv2
* New upstream release. (Closes: #523791)
  - Reworked subtitle font preferences. (Closes: #503295)
  - No longer installs qt_fr.qm. (Closes: #486314)
* debian/control:
  - Bumped Standards-Version to 3.8.1.
  - Changed maintainer name (still the same person and GPG key).
  - Changed section to video.
  - Build-depend on zlib1g-dev for findsubtitles.
  - Require Qt >= 4.3 per readme.
  - Added ${misc:Depends}.
  - Make smplayer-translations depend on smplayer and smplayer recommend
    smplayer-translations, not the other way round. (Closes: #489375)
* debian/copyright:
  - Significantly expanded per-file with new upstream authors.
* debian/rules:
  - Make make use correct uic in install.
  - Clean svn_revision.
  - Removed get-orig-source - not needed with uscan --repack.
* debian/patches/01_gl_translation.patch:
  - Added patch to fix lrelease error on smplayer_gl.ts.
* Added debian/README.source for simple-patchsys.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*  smplayer, GUI front-end for mplayer.
2
 
    Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
 
2
    Copyright (C) 2006-2009 Ricardo Villalba <rvm@escomposlinux.org>
3
3
 
4
4
    This program is free software; you can redistribute it and/or modify
5
5
    it under the terms of the GNU General Public License as published by
20
20
#include "prefsubtitles.h"
21
21
#include "images.h"
22
22
#include "preferences.h"
23
 
#include "encodings.h"
24
 
#include "helper.h"
 
23
#include "paths.h"
 
24
#include "assstyles.h"
25
25
#include "filedialog.h"
 
26
#include "languages.h"
26
27
 
27
 
#include <QColorDialog>
 
28
#include <QInputDialog>
28
29
 
29
30
PrefSubtitles::PrefSubtitles(QWidget * parent, Qt::WindowFlags f)
30
31
        : PrefWidget(parent, f )
36
37
        ttf_font_edit->setOptions(QFileDialog::DontUseNativeDialog);
37
38
#endif
38
39
 
39
 
        encodings = new Encodings(this);
40
 
        font_encoding_combo->insertItems( 0, encodings->list() );
 
40
        connect( style_border_style_combo, SIGNAL(currentIndexChanged(int)),
 
41
             this, SLOT(checkBorderStyleCombo(int)) );
41
42
 
42
43
        retranslateStrings();
43
44
}
65
66
        font_autoload_combo->setCurrentIndex(font_autoload_item);
66
67
 
67
68
        // Encodings combo
68
 
        int font_encoding_item = font_encoding_combo->currentIndex();
 
69
        //int font_encoding_item = font_encoding_combo->currentIndex();
 
70
        QString current_encoding = fontEncoding();
 
71
        QString current_enca_lang = encaLang();
69
72
        font_encoding_combo->clear();
70
 
        encodings->retranslate();
71
 
        font_encoding_combo->insertItems( 0, encodings->list() );
72
 
        font_encoding_combo->setCurrentIndex(font_encoding_item);
 
73
        enca_lang_combo->clear();
 
74
 
 
75
        QMap<QString,QString> l = Languages::encodings();
 
76
        QMapIterator<QString, QString> i(l);
 
77
        while (i.hasNext()) {
 
78
                i.next();
 
79
                font_encoding_combo->addItem( i.value() + " (" + i.key() + ")", i.key() );
 
80
        }
 
81
        l = Languages::list(); i = l;
 
82
        while (i.hasNext()) {
 
83
                i.next();
 
84
                enca_lang_combo->addItem( i.value() + " (" + i.key() + ")", i.key() );
 
85
        }
 
86
        font_encoding_combo->model()->sort(0);
 
87
        enca_lang_combo->model()->sort(0);
 
88
        //font_encoding_combo->setCurrentIndex(font_encoding_item);
 
89
        setFontEncoding(current_encoding);
 
90
        setEncaLang(current_enca_lang);
73
91
 
74
92
        sub_pos_label->setNum( sub_pos_slider->value() );
75
93
 
76
94
        ttf_font_edit->setCaption(tr("Choose a ttf file"));
77
95
        ttf_font_edit->setFilter(tr("Truetype Fonts") + " (*.ttf)");
78
96
 
 
97
        // Ass styles
 
98
        int alignment_item = style_alignment_combo->currentIndex();
 
99
        style_alignment_combo->clear();
 
100
        style_alignment_combo->addItem(tr("Left", "horizontal alignment"), 1);
 
101
        style_alignment_combo->addItem(tr("Centered", "horizontal alignment"), 2);
 
102
        style_alignment_combo->addItem(tr("Right", "horizontal alignment"), 3);
 
103
        style_alignment_combo->setCurrentIndex(alignment_item);
 
104
 
 
105
        int valignment_item = style_valignment_combo->currentIndex();
 
106
        style_valignment_combo->clear();
 
107
        style_valignment_combo->addItem(tr("Bottom", "vertical alignment"));
 
108
        style_valignment_combo->addItem(tr("Middle", "vertical alignment"));
 
109
        style_valignment_combo->addItem(tr("Top", "vertical alignment"));
 
110
        style_valignment_combo->setCurrentIndex(valignment_item);
 
111
 
 
112
        int borderstyle_item = style_border_style_combo->currentIndex();
 
113
        style_border_style_combo->clear();
 
114
        style_border_style_combo->addItem(tr("Outline", "border style"), 1);
 
115
        style_border_style_combo->addItem(tr("Opaque box", "border style"), 3);
 
116
        style_border_style_combo->setCurrentIndex(borderstyle_item);
 
117
 
79
118
        createHelp();
80
119
}
81
120
 
89
128
        setAutoloadSub( pref->autoload_sub );
90
129
        setFontFuzziness( pref->subfuzziness );
91
130
        setFontEncoding( pref->subcp );
 
131
        setUseEnca( pref->use_enca );
 
132
        setEncaLang( pref->enca_lang );
92
133
        setUseFontASS( pref->use_ass_subtitles );
93
 
        setAssColor( pref->ass_color );
94
 
        setAssBorderColor( pref->ass_border_color );
95
 
        setAssStyles( pref->ass_styles );
 
134
        setAssLineSpacing( pref->ass_line_spacing );
96
135
        setSubPos( pref->initial_sub_pos );
97
136
        setSubtitlesOnScreenshots( pref->subtitles_on_screenshots );
 
137
        setFreetypeSupport( pref->freetype_support );
 
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);
98
158
}
99
159
 
100
160
void PrefSubtitles::getData(Preferences * pref) {
109
169
        TEST_AND_SET(pref->autoload_sub, autoloadSub());
110
170
        TEST_AND_SET(pref->subfuzziness, fontFuzziness());
111
171
        TEST_AND_SET(pref->subcp, fontEncoding());
 
172
        TEST_AND_SET(pref->use_enca, useEnca());
 
173
        TEST_AND_SET(pref->enca_lang, encaLang());
112
174
        TEST_AND_SET(pref->use_ass_subtitles, useFontASS());
113
 
        TEST_AND_SET(pref->ass_color, assColor());
114
 
        TEST_AND_SET(pref->ass_border_color, assBorderColor());
115
 
        TEST_AND_SET(pref->ass_styles, assStyles());
 
175
        TEST_AND_SET(pref->ass_line_spacing, assLineSpacing());
116
176
        pref->initial_sub_pos = subPos();
117
177
        TEST_AND_SET(pref->subtitles_on_screenshots, subtitlesOnScreenshots());
118
 
}
 
178
        TEST_AND_SET(pref->freetype_support, freetypeSupport());
 
179
 
 
180
        // Save ass styles
 
181
        TEST_AND_SET(pref->ass_styles.fontname, style_font_combo->currentText());
 
182
        TEST_AND_SET(pref->ass_styles.fontsize, style_size_spin->value());
 
183
        TEST_AND_SET(pref->ass_styles.primarycolor, style_text_color_button->color().rgb());
 
184
        TEST_AND_SET(pref->ass_styles.outlinecolor, style_border_color_button->color().rgb());
 
185
        TEST_AND_SET(pref->ass_styles.backcolor, style_shadow_color_button->color().rgb());
 
186
        TEST_AND_SET(pref->ass_styles.bold, style_bold_check->isChecked());
 
187
        TEST_AND_SET(pref->ass_styles.italic, style_italic_check->isChecked());
 
188
        TEST_AND_SET(pref->ass_styles.halignment, style_alignment_combo->itemData(style_alignment_combo->currentIndex()).toInt());
 
189
        TEST_AND_SET(pref->ass_styles.valignment, style_valignment_combo->currentIndex());
 
190
        TEST_AND_SET(pref->ass_styles.borderstyle, style_border_style_combo->itemData(style_border_style_combo->currentIndex()).toInt());
 
191
        TEST_AND_SET(pref->ass_styles.outline, style_outline_spin->value());
 
192
        TEST_AND_SET(pref->ass_styles.shadow, style_shadow_spin->value());
 
193
        TEST_AND_SET(pref->ass_styles.marginl, style_marginl_spin->value());
 
194
        TEST_AND_SET(pref->ass_styles.marginr, style_marginr_spin->value());
 
195
        TEST_AND_SET(pref->ass_styles.marginv, style_marginv_spin->value());
 
196
 
 
197
        pref->ass_styles.exportStyles( Paths::subtitleStyleFile() );
 
198
 
 
199
        TEST_AND_SET(pref->force_ass_styles, forceAssStyles());
 
200
        TEST_AND_SET(pref->user_forced_ass_style, customizedAssStyle());
 
201
}
 
202
 
 
203
void PrefSubtitles::checkBorderStyleCombo( int index ) {
 
204
        bool b = (index == 0);
 
205
        style_outline_spin->setEnabled(b);
 
206
        style_shadow_spin->setEnabled(b);
 
207
        style_outline_label->setEnabled(b);
 
208
        style_shadow_label->setEnabled(b);
 
209
}
 
210
 
119
211
 
120
212
void PrefSubtitles::setFontName(QString font_name) {
121
213
        fontCombo->setCurrentText(font_name);
152
244
}
153
245
 
154
246
void PrefSubtitles::setFontTextscale(double n) {
155
 
        font_text_scale->setValue(n);
 
247
        font_text_scale_spin->setValue(n);
156
248
}
157
249
 
158
250
double PrefSubtitles::fontTextscale() {
159
 
        return font_text_scale->value();
 
251
        return font_text_scale_spin->value();
160
252
}
161
253
 
162
254
void PrefSubtitles::setAssFontScale(double n) {
163
 
        ass_font_scale->setValue(n);
 
255
        ass_font_scale_spin->setValue(n);
164
256
}
165
257
 
166
258
double PrefSubtitles::assFontScale() {
167
 
        return ass_font_scale->value();
 
259
        return ass_font_scale_spin->value();
168
260
}
169
261
 
170
262
void PrefSubtitles::setAutoloadSub(bool v) {
176
268
}
177
269
 
178
270
void PrefSubtitles::setFontEncoding(QString s) {
179
 
        int n = encodings->findEncoding( s );
180
 
        if (n != -1) 
181
 
                font_encoding_combo->setCurrentIndex(n);
182
 
        else
183
 
                font_encoding_combo->setCurrentText(s);
 
271
        int i = font_encoding_combo->findData(s);
 
272
        font_encoding_combo->setCurrentIndex(i);
184
273
}
185
274
 
186
275
QString PrefSubtitles::fontEncoding() {
187
 
        qDebug("PrefSubtitles::fontEncoding");
188
 
        QString res = encodings->parseEncoding( font_encoding_combo->currentText() );
189
 
        qDebug(" * res: '%s'", res.toUtf8().data() );
190
 
        return res;
 
276
        int index = font_encoding_combo->currentIndex();
 
277
        return font_encoding_combo->itemData(index).toString();
 
278
}
 
279
 
 
280
void PrefSubtitles::setEncaLang(QString s) {
 
281
        int i = enca_lang_combo->findData(s);
 
282
        enca_lang_combo->setCurrentIndex(i);
 
283
}
 
284
 
 
285
QString PrefSubtitles::encaLang() {
 
286
        int index = enca_lang_combo->currentIndex();
 
287
        return enca_lang_combo->itemData(index).toString();
 
288
}
 
289
 
 
290
void PrefSubtitles::setUseEnca(bool b) {
 
291
        use_enca_check->setChecked(b);
 
292
}
 
293
 
 
294
bool PrefSubtitles::useEnca() {
 
295
        return use_enca_check->isChecked();
191
296
}
192
297
 
193
298
void PrefSubtitles::setSubPos(int pos) {
199
304
}
200
305
 
201
306
void PrefSubtitles::setUseFontASS(bool v) {
202
 
        font_ass_check->setChecked(v);
203
 
        //assButtonToggled(v);
 
307
        ass_subs_button->setChecked(v);
 
308
        normal_subs_button->setChecked(!v);
204
309
}
205
310
 
206
311
bool PrefSubtitles::useFontASS() {
207
 
        return font_ass_check->isChecked();
208
 
}
209
 
 
210
 
void PrefSubtitles::setAssColor( unsigned int color ) {
211
 
        ass_color = color;
212
 
#ifdef Q_OS_WIN
213
 
        colorButton->setStyleSheet( "border-width: 1px; border-style: solid; border-color: #000000; background: #" + Helper::colorToRRGGBB(ass_color) + ";");
214
 
#else
215
 
        //colorButton->setAutoFillBackground(true);
216
 
        Helper::setBackgroundColor( colorButton, color );
217
 
#endif
218
 
}
219
 
 
220
 
unsigned int PrefSubtitles::assColor() {
221
 
        return ass_color;
222
 
}
223
 
 
224
 
void PrefSubtitles::setAssBorderColor( unsigned int color ) {
225
 
        ass_border_color = color;
226
 
 
227
 
#ifdef Q_OS_WIN
228
 
        borderButton->setStyleSheet( "border-width: 1px; border-style: solid; border-color: #000000; background: #" + Helper::colorToRRGGBB(ass_border_color) + ";");
229
 
#else
230
 
        //borderButton->setAutoFillBackground(true);
231
 
        Helper::setBackgroundColor( borderButton, color );
232
 
#endif
233
 
}
234
 
 
235
 
unsigned int PrefSubtitles::assBorderColor() {
236
 
        return ass_border_color;
237
 
}
238
 
 
239
 
void PrefSubtitles::setAssStyles(QString styles) {
240
 
        ass_styles_edit->setText(styles);
241
 
}
242
 
 
243
 
QString PrefSubtitles::assStyles() {
244
 
        return ass_styles_edit->text();
 
312
        return ass_subs_button->isChecked();
245
313
}
246
314
 
247
315
void PrefSubtitles::setFontFuzziness(int n) {
260
328
        return subtitles_on_screeshots_check->isChecked();
261
329
}
262
330
 
263
 
 
264
 
void PrefSubtitles::on_colorButton_clicked() {
265
 
        QColor c = QColorDialog::getColor ( ass_color, this );
266
 
        if (c.isValid()) {
267
 
                setAssColor( c.rgb() );
268
 
        }
269
 
}
270
 
 
271
 
void PrefSubtitles::on_borderButton_clicked() {
272
 
        QColor c = QColorDialog::getColor ( ass_border_color, this );
273
 
        if (c.isValid()) {
274
 
                setAssBorderColor( c.rgb() );
 
331
void PrefSubtitles::setAssLineSpacing(int spacing) {
 
332
        ass_line_spacing_spin->setValue(spacing);
 
333
}
 
334
 
 
335
int PrefSubtitles::assLineSpacing() {
 
336
        return ass_line_spacing_spin->value();
 
337
}
 
338
 
 
339
void PrefSubtitles::setForceAssStyles(bool b) {
 
340
        force_ass_styles->setChecked(b);
 
341
}
 
342
 
 
343
bool PrefSubtitles::forceAssStyles() {
 
344
        return force_ass_styles->isChecked();
 
345
}
 
346
 
 
347
void PrefSubtitles::on_ass_subs_button_toggled(bool b) {
 
348
        if (b) 
 
349
                stackedWidget->setCurrentIndex(1);
 
350
         else 
 
351
                stackedWidget->setCurrentIndex(0);
 
352
}
 
353
 
 
354
void PrefSubtitles::on_ass_customize_button_clicked() {
 
355
        bool ok;
 
356
 
 
357
        QString edit = forced_ass_style;
 
358
 
 
359
        // A copy with the current values in the dialog
 
360
        AssStyles ass_styles;
 
361
        ass_styles.fontname = style_font_combo->currentText();
 
362
        ass_styles.fontsize = style_size_spin->value();
 
363
        ass_styles.primarycolor = style_text_color_button->color().rgb();
 
364
        ass_styles.outlinecolor = style_border_color_button->color().rgb();
 
365
        ass_styles.backcolor = style_shadow_color_button->color().rgb();
 
366
        ass_styles.bold = style_bold_check->isChecked();
 
367
        ass_styles.italic = style_italic_check->isChecked();
 
368
        ass_styles.halignment = style_alignment_combo->itemData(style_alignment_combo->currentIndex()).toInt();
 
369
        ass_styles.valignment = style_valignment_combo->currentIndex();
 
370
        ass_styles.borderstyle = style_border_style_combo->itemData(style_border_style_combo->currentIndex()).toInt();
 
371
        ass_styles.outline = style_outline_spin->value();
 
372
        ass_styles.shadow = style_shadow_spin->value();
 
373
        ass_styles.marginl = style_marginl_spin->value();
 
374
        ass_styles.marginr = style_marginr_spin->value();
 
375
        ass_styles.marginv = style_marginv_spin->value();
 
376
 
 
377
        if (edit.isEmpty()) {
 
378
                edit = ass_styles.toString();
 
379
        }
 
380
 
 
381
        QString s = QInputDialog::getText(this, tr("Customize SSA/ASS style"),
 
382
                                      tr("Here you can enter your customized SSA/ASS style.") +"<br>"+
 
383
                                      tr("Clear the edit line to disable the customized style."), 
 
384
                                      QLineEdit::Normal, 
 
385
                                      edit, &ok );
 
386
        if (ok) {
 
387
                if (s == ass_styles.toString()) s.clear(); // Clear string if it wasn't changed by the user
 
388
                setCustomizedAssStyle(s);
 
389
        }
 
390
}
 
391
 
 
392
void PrefSubtitles::setFreetypeSupport(bool b) {
 
393
        freetype_check->setChecked(b);
 
394
}
 
395
 
 
396
bool PrefSubtitles::freetypeSupport() {
 
397
        return freetype_check->isChecked();
 
398
}
 
399
 
 
400
void PrefSubtitles::on_freetype_check_toggled(bool b) {
 
401
        qDebug("PrefSubtitles:on_freetype_check_toggled: %d", b);
 
402
        if (!b) {
 
403
                ass_subs_button->setChecked(false);
 
404
                normal_subs_button->setChecked(true);
275
405
        }
276
406
}
277
407
 
290
420
           "be used instead.") );
291
421
 
292
422
        setWhatsThis(font_encoding_combo, tr("Default subtitle encoding"), 
293
 
        tr("Select the encoding which will be used for subtitle files.") );
294
 
 
295
 
        setWhatsThis(sub_pos_slider, tr("Subtitle position"),
296
 
                tr("This option specifies the position of the subtitles over the "
297
 
           "video window. <i>100</i> means the bottom, while <i>0</i> means "
298
 
           "the top." ) );
 
423
        tr("Select the encoding which will be used for subtitle files "
 
424
           "by default.") );
 
425
 
 
426
        setWhatsThis(use_enca_check, tr("Try to autodetect for this language"),
 
427
                tr("When this option is on, the encoding of the subtitles will be "
 
428
           "tried to be autodetected for the given language. "
 
429
           "It will fall back to the default encoding if the autodetection "
 
430
           "fails. This option requires a MPlayer compiled with ENCA "
 
431
           "support.") );
 
432
 
 
433
        setWhatsThis(enca_lang_combo, tr("Subtitle language"),
 
434
                tr("Select the language for which you want the encoding to be guessed "
 
435
           "automatically.") );
299
436
 
300
437
        setWhatsThis(subtitles_on_screeshots_check, 
301
438
        tr("Include subtitles on screenshots"), 
302
439
        tr("If this option is checked, the subtitles will appear in the "
303
 
           "screenshots. Note: it may cause some troubles sometimes." ) );
 
440
           "screenshots. <b>Note:</b> it may cause some troubles sometimes." ) );
 
441
 
 
442
        setWhatsThis(freetype_check, tr("Freetype support"), 
 
443
                tr("You should normally not disable this option. Do it only if your "
 
444
           "MPlayer is compiled without freetype support. "
 
445
           "<b>Disabling this option could make that subtitles won't work "
 
446
           "at all!</b>") );
304
447
 
305
448
        addSectionTitle(tr("Font"));
306
449
 
 
450
        setWhatsThis(normal_subs_button, tr("Enable normal subtitles"), 
 
451
        tr("Click this button to select the normal/traditional subtitles. "
 
452
           "This kind of subtitles can only display white subtitles."));
 
453
 
 
454
        setWhatsThis(ass_subs_button, tr("Enable SSA/ASS subtitles"), 
 
455
                tr("Click this button to enable the new SSA/ASS library. "
 
456
           "This allows to display subtitles with multiple colors, fonts..."));
 
457
 
 
458
        addSectionTitle(tr("Normal subtitles"));
 
459
 
307
460
        setWhatsThis(ttf_font_edit, tr("TTF font"), 
308
461
        tr("Here you can select a ttf font to be used for the subtitles. "
309
 
           "Usually you'll find a lot of ttf fonts in <i>%1</i>.")
 
462
           "Usually you'll find a lot of ttf fonts in %1")
310
463
#ifdef Q_OS_WIN
311
 
        .arg("C:\\Windows\\Fonts\\")
 
464
        .arg("<i>C:\\Windows\\Fonts\\</i>")
312
465
#else
313
 
        .arg("/usr/X11R6/lib/X11/fonts/truetype/")
 
466
        .arg("<i>/usr/X11R6/lib/X11/fonts/truetype/</i>")
314
467
#endif
315
468
        );
316
469
 
321
474
        setWhatsThis(font_autoscale_combo, tr("Autoscale"), 
322
475
        tr("Select the subtitle autoscaling method.") );
323
476
 
324
 
        setWhatsThis(font_text_scale, tr("Default scale for normal subtitles"),
325
 
                tr("This option specifies the default font scale for normal (white) "
326
 
           "subtitles which will be used for new videos."));
327
 
 
328
 
        setWhatsThis(ass_font_scale, tr("Default scale for SSA/ASS subtitles"),
 
477
        QString scale_note = tr("This option does NOT change the size of the "
 
478
                   "subtitles in the current video. To do so, use the options "
 
479
           "<i>Size+</i> and <i>Size-</i> in the subtitles menu.");
 
480
 
 
481
        setWhatsThis(font_text_scale_spin, tr("Default scale"),
 
482
                tr("This option specifies the default font scale for normal "
 
483
           "subtitles which will be used for new opened files.") +"<br>"+
 
484
                scale_note);
 
485
 
 
486
        setWhatsThis(sub_pos_slider, tr("Subtitle position"),
 
487
                tr("This option specifies the position of the subtitles over the "
 
488
           "video window. <i>100</i> means the bottom, while <i>0</i> means "
 
489
           "the top." ) );
 
490
 
 
491
        addSectionTitle(tr("SSA/ASS subtitles"));
 
492
 
 
493
        setWhatsThis(ass_font_scale_spin, tr("Default scale"),
329
494
                tr("This option specifies the default font scale for SSA/ASS "
330
 
           "subtitles which will be used for new videos."));
331
 
 
332
 
        addSectionTitle(tr("SSA/ASS library"));
333
 
 
334
 
        setWhatsThis(font_ass_check, tr("Use SSA/ASS library for subtitle rendering"), 
335
 
        tr("Check this option to activate the SSA/ASS library. It provides "
336
 
           "nicer subtitles, so it's a good idea to do it.") );
337
 
 
338
 
        setWhatsThis(colorButton, tr("Text color"), 
 
495
           "subtitles which will be used for new opened files.") +"<br>"+
 
496
                scale_note);
 
497
 
 
498
        setWhatsThis(ass_line_spacing_spin, tr("Line spacing"),
 
499
                tr("This specifies the spacing that will be used to separate "
 
500
           "multiple lines. It can have negative values.") );
 
501
 
 
502
        setWhatsThis(styles_container, tr("SSA/ASS style"), 
 
503
                tr("The following options allows you to define the style to "
 
504
           "be used for non-styled subtitles (srt, sub...).") );
 
505
       
 
506
        setWhatsThis(style_font_combo, tr("Font"), 
 
507
                tr("Select the font for the subtitles.") );
 
508
 
 
509
        setWhatsThis(style_size_spin, tr("Size"), 
 
510
                tr("The size in pixels.") );
 
511
 
 
512
        setWhatsThis(style_bold_check, tr("Bold"), 
 
513
                tr("If checked, the text will be displayed in <b>bold</b>.") ); 
 
514
 
 
515
        setWhatsThis(style_italic_check, tr("Italic"), 
 
516
                tr("If checked, the text will be displayed in <i>italic</i>.") ); 
 
517
 
 
518
        setWhatsThis(style_text_color_button, tr("Text color"), 
339
519
        tr("Select the color for the text of the subtitles.") );
340
520
 
341
 
        setWhatsThis(borderButton, tr("Border color"), 
 
521
        setWhatsThis(style_border_color_button, tr("Border color"), 
342
522
        tr("Select the color for the border of the subtitles.") );
343
523
 
344
 
        setWhatsThis(ass_styles_edit, tr("SSA/ASS styles"), 
345
 
                tr("Here you can override styles for SSA/ASS subtitles. "
346
 
           "It can be also used for fine-tuning the rendering of SRT and SUB "
347
 
           "subtitles by the SSA/ASS library. "
348
 
           "Example: <b>Bold=1,Outline=2,Shadow=4</b>"));
 
524
        setWhatsThis(style_shadow_color_button, tr("Shadow color"), 
 
525
        tr("This color will be used for the shadow of the subtitles.") );
 
526
 
 
527
        setWhatsThis(style_marginl_spin, tr("Left margin"), 
 
528
        tr("Specifies the left margin in pixels.") );
 
529
 
 
530
        setWhatsThis(style_marginr_spin, tr("Right margin"), 
 
531
        tr("Specifies the right margin in pixels.") );
 
532
 
 
533
        setWhatsThis(style_marginv_spin, tr("Vertical margin"), 
 
534
        tr("Specifies the vertical margin in pixels.") );
 
535
 
 
536
        setWhatsThis(style_alignment_combo, tr("Horizontal alignment"), 
 
537
        tr("Specifies the horizontal alignment. Possible values are "
 
538
           "left, centered and right.") );
 
539
 
 
540
        setWhatsThis(style_valignment_combo, tr("Vertical alignment"), 
 
541
        tr("Specifies the vertical alignment. Possible values: "
 
542
           "bottom, middle and top.") );
 
543
 
 
544
        setWhatsThis(style_border_style_combo, tr("Border style"), 
 
545
        tr("Specifies the border style. Possible values: outline "
 
546
           "and opaque box.") );
 
547
 
 
548
        setWhatsThis(style_outline_spin, tr("Outline"), 
 
549
        tr("If border style is set to <i>outline</i>, this option specifies "
 
550
           "the width of the outline around the text in pixels.") );
 
551
 
 
552
        setWhatsThis(style_shadow_spin, tr("Shadow"), 
 
553
        tr("If border style is set to <i>outline</i>, this option specifies "
 
554
           "the depth of the drop shadow behind the text in pixels.") );
 
555
 
 
556
        setWhatsThis(force_ass_styles, tr("Apply style to ass files too"), 
 
557
        tr("If this option is checked, the style defined above will be "
 
558
           "applied to ass subtitles too.") );
349
559
}
350
560
 
351
561
#include "moc_prefsubtitles.cpp"