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

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

SMPlayer: update trunk to latest 0.8.7

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