source: smplayer/trunk/src/prefinterface.cpp@ 175

Last change on this file since 175 was 170, checked in by Silvan Scherrer, 11 years ago

SMPlayer: updated trunk to 14.9.0

  • Property svn:eol-style set to LF
File size: 22.4 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
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 "prefinterface.h"
21#include "images.h"
22#include "preferences.h"
23#include "paths.h"
24#include "languages.h"
25#include "recents.h"
26#include "urlhistory.h"
27#include "autohidewidget.h"
28
29#include <QDir>
30#include <QStyleFactory>
31#include <QFontDialog>
32
33#define SINGLE_INSTANCE_TAB 2
34
35PrefInterface::PrefInterface(QWidget * parent, Qt::WindowFlags f)
36 : PrefWidget(parent, f )
37{
38 setupUi(this);
39 /* volume_icon->hide(); */
40
41 // Style combo
42#if !STYLE_SWITCHING
43 style_label->hide();
44 style_combo->hide();
45#else
46 style_combo->addItem( "<default>" );
47 style_combo->addItems( QStyleFactory::keys() );
48#endif
49
50 // Icon set combo
51 iconset_combo->addItem( "Default" );
52
53#ifdef SKINS
54 n_skins = 0;
55#endif
56
57 // User
58 QDir icon_dir = Paths::configPath() + "/themes";
59 qDebug("icon_dir: %s", icon_dir.absolutePath().toUtf8().data());
60 QStringList iconsets = icon_dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
61 for (int n=0; n < iconsets.count(); n++) {
62 QString theme_dir = Paths::configPath() + "/themes/" + iconsets[n];
63 #ifdef USE_RESOURCES
64 if (!QFile::exists(theme_dir + "/" + iconsets[n] + ".rcc")) continue;
65 #endif
66
67 #ifdef SKINS
68 QString css_file = theme_dir + "/main.css";
69 bool is_skin = QFile::exists(css_file);
70 //qDebug("***** %s %d", css_file.toUtf8().constData(), is_skin);
71 if (is_skin) {
72 skin_combo->addItem( iconsets[n] );
73 n_skins++;
74 }
75 else
76 #endif
77 iconset_combo->addItem( iconsets[n] );
78 }
79 // Global
80 icon_dir = Paths::themesPath();
81 qDebug("icon_dir: %s", icon_dir.absolutePath().toUtf8().data());
82 iconsets = icon_dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
83 for (int n=0; n < iconsets.count(); n++) {
84 QString theme_dir = Paths::themesPath() + "/" + iconsets[n];
85 #ifdef USE_RESOURCES
86 if (!QFile::exists(theme_dir + "/" + iconsets[n] + ".rcc")) continue;
87 #endif
88
89 #ifdef SKINS
90 QString css_file = theme_dir + "/main.css";
91 bool is_skin = QFile::exists(css_file);
92 //qDebug("***** %s %d", css_file.toUtf8().constData(), is_skin);
93 if ((is_skin) && (skin_combo->findText( iconsets[n] ) == -1)) {
94 skin_combo->addItem( iconsets[n] );
95 n_skins++;
96 }
97 else
98 #endif
99 if (iconset_combo->findText( iconsets[n] ) == -1) {
100 iconset_combo->addItem( iconsets[n] );
101 }
102 }
103 #ifdef SKINS
104 if (skin_combo->itemText(0) == "Black") {
105 skin_combo->removeItem(0);
106 skin_combo->addItem("Black");
107 }
108 #endif
109
110#ifdef SINGLE_INSTANCE
111 connect(single_instance_check, SIGNAL(toggled(bool)),
112 this, SLOT(changeInstanceImages()));
113#else
114 tabWidget->setTabEnabled(SINGLE_INSTANCE_TAB, false);
115#endif
116
117#ifdef SKINS
118 connect(gui_combo, SIGNAL(currentIndexChanged(int)),
119 this, SLOT(GUIChanged(int)));
120#endif
121
122#ifndef SEEKBAR_RESOLUTION
123 seeking_method_group->hide();
124#endif
125
126#ifndef SKINS
127 skin_combo->hide();
128 skin_label->hide();
129 skin_sp->hide();
130#endif
131
132 retranslateStrings();
133}
134
135PrefInterface::~PrefInterface()
136{
137}
138
139QString PrefInterface::sectionName() {
140 return tr("Interface");
141}
142
143QPixmap PrefInterface::sectionIcon() {
144 return Images::icon("pref_gui", 22);
145}
146
147void PrefInterface::createLanguageCombo() {
148 QMap <QString,QString> m = Languages::translations();
149
150 // Language combo
151 QDir translation_dir = Paths::translationPath();
152 QStringList languages = translation_dir.entryList( QStringList() << "*.qm");
153 QRegExp rx_lang("smplayer_(.*)\\.qm");
154 language_combo->clear();
155 language_combo->addItem( tr("<Autodetect>") );
156 for (int n=0; n < languages.count(); n++) {
157 if (rx_lang.indexIn(languages[n]) > -1) {
158 QString l = rx_lang.cap(1);
159 QString text = l;
160 if (m.contains(l)) text = m[l] + " ("+l+")";
161 language_combo->addItem( text, l );
162 }
163 }
164}
165
166void PrefInterface::retranslateStrings() {
167 int mainwindow_resize = mainwindow_resize_combo->currentIndex();
168 int timeslider_pos = timeslider_behaviour_combo->currentIndex();
169
170 retranslateUi(this);
171
172 mainwindow_resize_combo->setCurrentIndex(mainwindow_resize);
173 timeslider_behaviour_combo->setCurrentIndex(timeslider_pos);
174
175 // Icons
176 resize_window_icon->setPixmap( Images::icon("resize_window") );
177 /* volume_icon->setPixmap( Images::icon("speaker") ); */
178
179#ifdef SINGLE_INSTANCE
180 changeInstanceImages();
181#endif
182
183 // Seek widgets
184 seek1->setLabel( tr("&Short jump") );
185 seek2->setLabel( tr("&Medium jump") );
186 seek3->setLabel( tr("&Long jump") );
187 seek4->setLabel( tr("Mouse &wheel jump") );
188
189 if (qApp->isLeftToRight()) {
190 seek1->setIcon( Images::icon("forward10s") );
191 seek2->setIcon( Images::icon("forward1m") );
192 seek3->setIcon( Images::icon("forward10m") );
193 } else {
194 seek1->setIcon( Images::flippedIcon("forward10s") );
195 seek2->setIcon( Images::flippedIcon("forward1m") );
196 seek3->setIcon( Images::flippedIcon("forward10m") );
197 }
198 seek4->setIcon( Images::icon("mouse", seek1->icon()->width()) );
199
200 // Language combo
201 int language_item = language_combo->currentIndex();
202 createLanguageCombo();
203 language_combo->setCurrentIndex( language_item );
204
205 // Iconset combo
206 iconset_combo->setItemText( 0, tr("Default") );
207
208#if STYLE_SWITCHING
209 style_combo->setItemText( 0, tr("Default") );
210#endif
211
212 int gui_index = gui_combo->currentIndex();
213 gui_combo->clear();
214 gui_combo->addItem( tr("Basic GUI"), "DefaultGUI");
215 gui_combo->addItem( tr("Mini GUI"), "MiniGUI");
216#ifdef MPCGUI
217 gui_combo->addItem( tr("Mpc GUI"), "MpcGUI");
218#endif
219#ifdef SKINS
220 gui_combo->addItem( tr("Skinnable GUI"), "SkinGUI");
221 if (n_skins == 0) {
222 QModelIndex index = gui_combo->model()->index(gui_combo->count()-1,0);
223 gui_combo->model()->setData(index, QVariant(0), Qt::UserRole -1);
224 }
225#endif
226 gui_combo->setCurrentIndex(gui_index);
227
228 floating_width_label->setNum(floating_width_slider->value());
229 floating_margin_label->setNum(floating_margin_slider->value());
230
231 createHelp();
232}
233
234void PrefInterface::setData(Preferences * pref) {
235 setLanguage( pref->language );
236 setIconSet( pref->iconset );
237
238 setResizeMethod( pref->resize_method );
239 setSaveSize( pref->save_window_size_on_exit );
240
241 move_when_dragging_check->setChecked(pref->move_when_dragging);
242
243#ifdef SINGLE_INSTANCE
244 setUseSingleInstance(pref->use_single_instance);
245#endif
246 setSeeking1(pref->seeking1);
247 setSeeking2(pref->seeking2);
248 setSeeking3(pref->seeking3);
249 setSeeking4(pref->seeking4);
250
251 setUpdateWhileDragging(pref->update_while_seeking);
252#ifdef SEEKBAR_RESOLUTION
253 setRelativeSeeking(pref->relative_seeking);
254#endif
255 setPreciseSeeking(pref->precise_seeking);
256
257 reset_stop_check->setChecked(pref->reset_stop);
258
259 setDefaultFont(pref->default_font);
260
261 setHideVideoOnAudioFiles(pref->hide_video_window_on_audio_files);
262
263#if STYLE_SWITCHING
264 setStyle( pref->style );
265#endif
266
267 setGUI(pref->gui);
268
269 setFloatingAnimated(pref->floating_control_animated);
270 setFloatingWidth(pref->floating_control_width);
271 setFloatingMargin(pref->floating_control_margin);
272 setDisplayFloatingInCompactMode(pref->floating_display_in_compact_mode);
273 floating_move_bottom_check->setChecked(pref->floating_activation_area == AutohideWidget::Bottom);
274 floating_hide_delay_spin->setValue(pref->floating_hide_delay);
275
276 setRecentsMaxItems(pref->history_recents->maxItems());
277 setURLMaxItems(pref->history_urls->maxItems());
278 setRememberDirs(pref->save_dirs);
279}
280
281void PrefInterface::getData(Preferences * pref) {
282 requires_restart = false;
283 language_changed = false;
284 iconset_changed = false;
285 gui_changed = false;
286 style_changed = false;
287 recents_changed = false;
288
289 if (pref->language != language()) {
290 pref->language = language();
291 language_changed = true;
292 qDebug("PrefInterface::getData: chosen language: '%s'", pref->language.toUtf8().data());
293 }
294
295 if (pref->iconset != iconSet()) {
296 pref->iconset = iconSet();
297 iconset_changed = true;
298 }
299
300 if (pref->gui != GUI()) {
301 pref->gui = GUI();
302 gui_changed = true;
303 }
304
305 pref->resize_method = resizeMethod();
306 pref->save_window_size_on_exit = saveSize();
307
308 pref->move_when_dragging = move_when_dragging_check->isChecked();
309
310#ifdef SINGLE_INSTANCE
311 pref->use_single_instance = useSingleInstance();
312#endif
313
314 pref->seeking1 = seeking1();
315 pref->seeking2 = seeking2();
316 pref->seeking3 = seeking3();
317 pref->seeking4 = seeking4();
318
319 pref->update_while_seeking = updateWhileDragging();
320#ifdef SEEKBAR_RESOLUTION
321 pref->relative_seeking= relativeSeeking();
322#endif
323 pref->precise_seeking = preciseSeeking();
324
325 pref->reset_stop = reset_stop_check->isChecked();
326
327 pref->default_font = defaultFont();
328
329 pref->hide_video_window_on_audio_files = hideVideoOnAudioFiles();
330
331#if STYLE_SWITCHING
332 if ( pref->style != style() ) {
333 pref->style = style();
334 style_changed = true;
335 }
336#endif
337
338 pref->floating_control_animated = floatingAnimated();
339 pref->floating_control_width = floatingWidth();
340 pref->floating_control_margin = floatingMargin();
341 pref->floating_display_in_compact_mode = displayFloatingInCompactMode();
342 pref->floating_activation_area = floating_move_bottom_check->isChecked() ? AutohideWidget::Bottom : AutohideWidget::Anywhere;
343 pref->floating_hide_delay = floating_hide_delay_spin->value();
344
345 if (pref->history_recents->maxItems() != recentsMaxItems()) {
346 pref->history_recents->setMaxItems( recentsMaxItems() );
347 recents_changed = true;
348 }
349
350 if (pref->history_urls->maxItems() != urlMaxItems()) {
351 pref->history_urls->setMaxItems( urlMaxItems() );
352 url_max_changed = true;
353 }
354
355 pref->save_dirs = rememberDirs();
356}
357
358void PrefInterface::setLanguage(QString lang) {
359 if (lang.isEmpty()) {
360 language_combo->setCurrentIndex(0);
361 }
362 else {
363 int pos = language_combo->findData(lang);
364 if (pos != -1)
365 language_combo->setCurrentIndex( pos );
366 else
367 language_combo->setCurrentText(lang);
368 }
369}
370
371QString PrefInterface::language() {
372 if (language_combo->currentIndex()==0)
373 return "";
374 else
375 return language_combo->itemData( language_combo->currentIndex() ).toString();
376}
377
378void PrefInterface::setIconSet(QString set) {
379 /*
380 if (set.isEmpty())
381 iconset_combo->setCurrentIndex(0);
382 else
383 iconset_combo->setCurrentText(set);
384 */
385 iconset_combo->setCurrentIndex(0);
386 for (int n=0; n < iconset_combo->count(); n++) {
387 if (iconset_combo->itemText(n) == set) {
388 iconset_combo->setCurrentIndex(n);
389 break;
390 }
391 }
392#ifdef SKINS
393 skin_combo->setCurrentIndex(0);
394 for (int n=0; n < skin_combo->count(); n++) {
395 if (skin_combo->itemText(n) == set) {
396 skin_combo->setCurrentIndex(n);
397 break;
398 }
399 }
400#endif
401}
402
403QString PrefInterface::iconSet() {
404#ifdef SKINS
405 QString GUI = gui_combo->itemData(gui_combo->currentIndex()).toString();
406 if (GUI == "SkinGUI") {
407 return skin_combo->currentText();
408 }
409 else
410#endif
411 if (iconset_combo->currentIndex()==0)
412 return "";
413 else
414 return iconset_combo->currentText();
415}
416
417void PrefInterface::setResizeMethod(int v) {
418 mainwindow_resize_combo->setCurrentIndex(v);
419}
420
421int PrefInterface::resizeMethod() {
422 return mainwindow_resize_combo->currentIndex();
423}
424
425void PrefInterface::setSaveSize(bool b) {
426 save_size_check->setChecked(b);
427}
428
429bool PrefInterface::saveSize() {
430 return save_size_check->isChecked();
431}
432
433
434void PrefInterface::setStyle(QString style) {
435 if (style.isEmpty())
436 style_combo->setCurrentIndex(0);
437 else
438 style_combo->setCurrentText(style);
439}
440
441QString PrefInterface::style() {
442 if (style_combo->currentIndex()==0)
443 return "";
444 else
445 return style_combo->currentText();
446}
447
448void PrefInterface::setGUI(QString gui_name) {
449#ifdef SKINS
450 if ((n_skins == 0) && (gui_name == "SkinGUI")) gui_name = "DefaultGUI";
451#endif
452 int i = gui_combo->findData(gui_name);
453 if (i < 0) i=0;
454 gui_combo->setCurrentIndex(i);
455}
456
457QString PrefInterface::GUI() {
458 return gui_combo->itemData(gui_combo->currentIndex()).toString();
459}
460
461#ifdef SKINS
462void PrefInterface::GUIChanged(int index) {
463 if (gui_combo->itemData(index).toString() == "SkinGUI") {
464 iconset_combo->hide();
465 iconset_label->hide();
466 iconset_sp->hide();
467 skin_combo->show();
468 skin_label->show();
469 skin_sp->show();
470 } else {
471 iconset_combo->show();
472 iconset_label->show();
473 iconset_sp->show();
474 skin_combo->hide();
475 skin_label->hide();
476 skin_sp->hide();
477 }
478}
479#endif
480
481#ifdef SINGLE_INSTANCE
482void PrefInterface::setUseSingleInstance(bool b) {
483 single_instance_check->setChecked(b);
484 //singleInstanceButtonToggled(b);
485}
486
487bool PrefInterface::useSingleInstance() {
488 return single_instance_check->isChecked();
489}
490#endif
491
492void PrefInterface::setSeeking1(int n) {
493 seek1->setTime(n);
494}
495
496int PrefInterface::seeking1() {
497 return seek1->time();
498}
499
500void PrefInterface::setSeeking2(int n) {
501 seek2->setTime(n);
502}
503
504int PrefInterface::seeking2() {
505 return seek2->time();
506}
507
508void PrefInterface::setSeeking3(int n) {
509 seek3->setTime(n);
510}
511
512int PrefInterface::seeking3() {
513 return seek3->time();
514}
515
516void PrefInterface::setSeeking4(int n) {
517 seek4->setTime(n);
518}
519
520int PrefInterface::seeking4() {
521 return seek4->time();
522}
523
524void PrefInterface::setUpdateWhileDragging(bool b) {
525 if (b)
526 timeslider_behaviour_combo->setCurrentIndex(0);
527 else
528 timeslider_behaviour_combo->setCurrentIndex(1);
529}
530
531bool PrefInterface::updateWhileDragging() {
532 return (timeslider_behaviour_combo->currentIndex() == 0);
533}
534
535#ifdef SEEKBAR_RESOLUTION
536void PrefInterface::setRelativeSeeking(bool b) {
537 relative_seeking_button->setChecked(b);
538 absolute_seeking_button->setChecked(!b);
539}
540
541bool PrefInterface::relativeSeeking() {
542 return relative_seeking_button->isChecked();
543}
544#endif
545
546void PrefInterface::setPreciseSeeking(bool b) {
547 precise_seeking_check->setChecked(b);
548}
549
550bool PrefInterface::preciseSeeking() {
551 return precise_seeking_check->isChecked();
552}
553
554void PrefInterface::setDefaultFont(QString font_desc) {
555 default_font_edit->setText(font_desc);
556}
557
558QString PrefInterface::defaultFont() {
559 return default_font_edit->text();
560}
561
562void PrefInterface::on_changeFontButton_clicked() {
563 QFont f = qApp->font();
564
565 if (!default_font_edit->text().isEmpty()) {
566 f.fromString(default_font_edit->text());
567 }
568
569 bool ok;
570 f = QFontDialog::getFont( &ok, f, this);
571
572 if (ok) {
573 default_font_edit->setText( f.toString() );
574 }
575}
576
577#ifdef SINGLE_INSTANCE
578void PrefInterface::changeInstanceImages() {
579 if (single_instance_check->isChecked())
580 instances_icon->setPixmap( Images::icon("instance1") );
581 else
582 instances_icon->setPixmap( Images::icon("instance2") );
583}
584#endif
585
586void PrefInterface::setHideVideoOnAudioFiles(bool b) {
587 hide_video_window_on_audio_check->setChecked(b);
588}
589
590bool PrefInterface::hideVideoOnAudioFiles() {
591 return hide_video_window_on_audio_check->isChecked();
592}
593
594// Floating tab
595void PrefInterface::setFloatingAnimated(bool b) {
596 floating_animated_check->setChecked(b);
597}
598
599bool PrefInterface::floatingAnimated() {
600 return floating_animated_check->isChecked();
601}
602
603void PrefInterface::setFloatingWidth(int percentage) {
604 floating_width_slider->setValue(percentage);
605}
606
607int PrefInterface::floatingWidth() {
608 return floating_width_slider->value();
609}
610
611void PrefInterface::setFloatingMargin(int pixels) {
612 floating_margin_slider->setValue(pixels);
613}
614
615int PrefInterface::floatingMargin() {
616 return floating_margin_slider->value();
617}
618
619void PrefInterface::setDisplayFloatingInCompactMode(bool b) {
620 floating_compact_check->setChecked(b);
621}
622
623bool PrefInterface::displayFloatingInCompactMode() {
624 return floating_compact_check->isChecked();
625}
626
627void PrefInterface::setRecentsMaxItems(int n) {
628 recents_max_items_spin->setValue(n);
629}
630
631int PrefInterface::recentsMaxItems() {
632 return recents_max_items_spin->value();
633}
634
635void PrefInterface::setURLMaxItems(int n) {
636 url_max_items_spin->setValue(n);
637}
638
639int PrefInterface::urlMaxItems() {
640 return url_max_items_spin->value();
641}
642
643void PrefInterface::setRememberDirs(bool b) {
644 save_dirs_check->setChecked(b);
645}
646
647bool PrefInterface::rememberDirs() {
648 return save_dirs_check->isChecked();
649}
650
651void PrefInterface::createHelp() {
652 clearHelp();
653
654 addSectionTitle(tr("Interface"));
655
656 setWhatsThis(mainwindow_resize_combo, tr("Autoresize"),
657 tr("The main window can be resized automatically. Select the option "
658 "you prefer.") );
659
660 setWhatsThis(save_size_check, tr("Remember position and size"),
661 tr("If you check this option, the position and size of the main "
662 "window will be saved and restored when you run SMPlayer again.") );
663
664 setWhatsThis(hide_video_window_on_audio_check, tr("Hide video window when playing audio files"),
665 tr("If this option is enabled the video window will be hidden when playing audio files.") );
666
667 setWhatsThis(move_when_dragging_check, tr("Move the window when the video area is dragged"),
668 tr("If this option is checked, the main window will be moved if you drag the mouse over the video area.") );
669
670 setWhatsThis(language_combo, tr("Language"),
671 tr("Here you can change the language of the application.") );
672
673 setWhatsThis(gui_combo, tr("GUI"),
674 tr("Select the graphic interface you prefer for the application.") +"<br>"+
675 tr("The <b>Basic GUI</b> provides the traditional interface, with the "
676 "toolbar and control bar.") +" "+
677 tr("The <b>Mini GUI</b> provides a more simple interface, without toolbar and a control bar with few "
678 "buttons.") +" "+
679 tr("The <b>Skinnable GUI</b> provides an interface where several skins are available.")
680#ifdef MPCGUI
681 +" "+
682 tr("The <b>Mpc GUI</b> looks like the interface in Media Player Classic.")
683#endif
684 );
685
686 setWhatsThis(iconset_combo, tr("Icon set"),
687 tr("Select the icon set you prefer for the application.") );
688
689#ifdef SKINS
690 setWhatsThis(skin_combo, tr("Skin"),
691 tr("Select the skin you prefer for the application. Only available with the skinnable GUI.") );
692#endif
693
694 setWhatsThis(style_combo, tr("Style"),
695 tr("Select the style you prefer for the application.") );
696
697
698 setWhatsThis(changeFontButton, tr("Default font"),
699 tr("You can change here the application's font.") );
700
701 addSectionTitle(tr("Seeking"));
702
703 setWhatsThis(seek1, tr("Short jump"),
704 tr("Select the time that should be go forward or backward when you "
705 "choose the %1 action.").arg(tr("short jump")) );
706
707 setWhatsThis(seek2, tr("Medium jump"),
708 tr("Select the time that should be go forward or backward when you "
709 "choose the %1 action.").arg(tr("medium jump")) );
710
711 setWhatsThis(seek3, tr("Long jump"),
712 tr("Select the time that should be go forward or backward when you "
713 "choose the %1 action.").arg(tr("long jump")) );
714
715 setWhatsThis(seek4, tr("Mouse wheel jump"),
716 tr("Select the time that should be go forward or backward when you "
717 "move the mouse wheel.") );
718
719 setWhatsThis(timeslider_behaviour_combo, tr("Behaviour of time slider"),
720 tr("Select what to do when dragging the time slider.") );
721
722#ifdef SEEKBAR_RESOLUTION
723 setWhatsThis(seeking_method_group, tr("Seeking method"),
724 tr("Sets the method to be used when seeking with the slider. "
725 "Absolute seeking may be a little bit more accurate, while "
726 "relative seeking may work better with files with a wrong length.") );
727#endif
728
729 setWhatsThis(precise_seeking_check, tr("Precise seeking"),
730 tr("If this option is enabled, seeks are more accurate but they "
731 "can be a little bit slower. May not work with some video formats.") +"<br>"+
732 tr("Note: this option only works with MPlayer2") );
733
734 setWhatsThis(reset_stop_check, tr("Pressing the stop button once resets the time position"),
735 tr("By default when the stop button is pressed the time position is remembered "
736 "so if you press play button the media will resume at the same point. You need "
737 "to press the stop button twice to reset the time position, but if this "
738 "option is checked the time position will be set to 0 with only once "
739 "press of the stop button.") );
740
741#ifdef SINGLE_INSTANCE
742 addSectionTitle(tr("Instances"));
743
744 setWhatsThis(single_instance_check,
745 tr("Use only one running instance of SMPlayer"),
746 tr("Check this option if you want to use an already running instance "
747 "of SMPlayer when opening other files.") );
748#endif
749
750 addSectionTitle(tr("Floating control"));
751
752 setWhatsThis(floating_animated_check, tr("Animated"),
753 tr("If this option is enabled, the floating control will appear "
754 "with an animation.") );
755
756 setWhatsThis(floating_width_slider, tr("Width"),
757 tr("Specifies the width of the control (as a percentage).") );
758
759 setWhatsThis(floating_margin_slider, tr("Margin"),
760 tr("This option sets the number of pixels that the floating control "
761 "will be away from the bottom of the screen. Useful when the "
762 "screen is a TV, as the overscan might prevent the control to be "
763 "visible.") );
764
765 setWhatsThis(floating_move_bottom_check, tr("Show only when moving the mouse to the bottom of the screen"),
766 tr("If this option is checked, the floating control will only be displayed when the mouse is moved "
767 "to the bottom of the screen. Otherwise the control will appear whenever the mouse is moved, no matter "
768 "its position.") );
769
770 setWhatsThis(floating_compact_check, tr("Display in compact mode too"),
771 tr("If this option is enabled, the floating control will appear "
772 "in compact mode too.") +" " +
773 tr("This option only works with the basic GUI.") +" "+
774 tr("<b>Warning:</b> the floating control has not been "
775 "designed for compact mode and it might not work properly.") );
776
777 setWhatsThis(floating_hide_delay_spin, tr("Time to hide the control"),
778 tr("Sets the time (in milliseconds) to hide the control after the mouse went away from the control."));
779
780 addSectionTitle(tr("Privacy"));
781
782 setWhatsThis(recents_max_items_spin, tr("Recent files"),
783 tr("Select the maximum number of items that will be shown in the "
784 "<b>Open->Recent files</b> submenu. If you set it to 0 that "
785 "menu won't be shown at all.") );
786
787 setWhatsThis(url_max_items_spin, tr("Max. URLs"),
788 tr("Select the maximum number of items that the <b>Open->URL</b> "
789 "dialog will remember. Set it to 0 if you don't want any URL "
790 "to be stored.") );
791
792 setWhatsThis(save_dirs_check, tr("Remember last directory"),
793 tr("If this option is checked, SMPlayer will remember the last folder you use to open a file.") );
794}
795
796#include "moc_prefinterface.cpp"
Note: See TracBrowser for help on using the repository browser.