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>
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
46
48
iconset_combo->addItem( "Default" );
49
QDir icon_dir = Helper::appHomePath() + "/themes";
51
QDir icon_dir = Paths::configPath() + "/themes";
50
52
qDebug("icon_dir: %s", icon_dir.absolutePath().toUtf8().data());
51
53
QStringList iconsets = icon_dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
52
54
for (int n=0; n < iconsets.count(); n++) {
53
55
iconset_combo->addItem( iconsets[n] );
56
icon_dir = Helper::themesPath();
58
icon_dir = Paths::themesPath();
57
59
qDebug("icon_dir: %s", icon_dir.absolutePath().toUtf8().data());
58
60
iconsets = icon_dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
59
61
for (int n=0; n < iconsets.count(); n++) {
83
89
void PrefInterface::createLanguageCombo() {
84
QMap <QString,QString> m;
85
m["bg"] = tr("Bulgarian");
86
m["ca"] = tr("Catalan");
87
m["cs"] = tr("Czech");
88
m["de"] = tr("German");
89
m["el_GR"] = tr("Greek");
90
m["en_US"] = tr("English");
91
m["es"] = tr("Spanish");
92
m["eu"] = tr("Basque");
93
m["fi"] = tr("Finnish");
94
m["fr"] = tr("French");
95
m["gl"] = tr("Galician");
96
m["hu"] = tr("Hungarian");
97
m["it"] = tr("Italian");
98
m["ja"] = tr("Japanese");
99
m["ka"] = tr("Georgian");
100
m["ko"] = tr("Korean");
101
m["mk"] = tr("Macedonian");
102
m["nl"] = tr("Dutch");
103
m["pl"] = tr("Polish");
104
m["pt_BR"] = tr("Portuguese - Brazil");
105
m["pt_PT"] = tr("Portuguese - Portugal");
106
m["ro_RO"] = tr("Romanian");
107
m["ru_RU"] = tr("Russian");
108
m["sk"] = tr("Slovak");
109
m["sr"] = tr("Serbian");
110
m["sv"] = tr("Swedish");
111
m["tr"] = tr("Turkish");
112
m["uk_UA"] = tr("Ukrainian");
113
m["zh_CN"] = tr("Simplified-Chinese");
114
m["zh_TW"] = tr("Traditional Chinese");
90
QMap <QString,QString> m = Languages::translations();
117
QDir translation_dir = Helper::translationPath();
93
QDir translation_dir = Paths::translationPath();
118
94
QStringList languages = translation_dir.entryList( QStringList() << "*.qm");
119
95
QRegExp rx_lang("smplayer_(.*)\\.qm");
120
96
language_combo->clear();
177
153
gui_combo->clear();
178
154
gui_combo->addItem( tr("Default GUI"), "DefaultGUI");
179
155
gui_combo->addItem( tr("Mini GUI"), "MiniGUI");
156
gui_combo->addItem( tr("Mpc GUI"), "MpcGUI");
180
157
gui_combo->setCurrentIndex(gui_index);
159
floating_width_label->setNum(floating_width_slider->value());
160
floating_margin_label->setNum(floating_margin_slider->value());
190
170
setSaveSize( pref->save_window_size_on_exit );
191
171
setUseSingleInstance(pref->use_single_instance);
192
172
setServerPort(pref->connection_port);
193
setRecentsMaxItems(pref->recents_max_items);
173
setUseAutoPort(pref->use_autoport);
174
setRecentsMaxItems(pref->history_recents->maxItems());
195
176
setSeeking1(pref->seeking1);
196
177
setSeeking2(pref->seeking2);
208
189
setGUI(pref->gui);
191
setFloatingAnimated(pref->floating_control_animated);
192
setFloatingWidth(pref->floating_control_width);
193
setFloatingMargin(pref->floating_control_margin);
194
setDisplayFloatingInCompactMode(pref->floating_display_in_compact_mode);
196
setFloatingBypassWindowManager(pref->bypass_window_manager);
211
200
void PrefInterface::getData(Preferences * pref) {
236
225
port_changed = true;
239
if (pref->recents_max_items != recentsMaxItems()) {
240
pref->recents_max_items = recentsMaxItems();
228
if (pref->use_autoport != useAutoPort()) {
229
pref->use_autoport = useAutoPort();
233
if (pref->history_recents->maxItems() != recentsMaxItems()) {
234
pref->history_recents->setMaxItems( recentsMaxItems() );
241
235
recents_changed = true;
260
254
pref->gui = GUI();
256
pref->floating_control_animated = floatingAnimated();
257
pref->floating_control_width = floatingWidth();
258
pref->floating_control_margin = floatingMargin();
259
pref->floating_display_in_compact_mode = displayFloatingInCompactMode();
261
pref->bypass_window_manager = floatingBypassWindowManager();
263
265
void PrefInterface::setLanguage(QString lang) {
352
354
return server_port_spin->value();
357
void PrefInterface::setUseAutoPort(bool b) {
358
automatic_port_button->setChecked(b);
359
manual_port_button->setChecked(!b);
362
bool PrefInterface::useAutoPort() {
363
return automatic_port_button->isChecked();
355
366
void PrefInterface::setRecentsMaxItems(int n) {
356
367
recents_max_items_spin->setValue(n);
433
444
instances_icon->setPixmap( Images::icon("instance2") );
448
void PrefInterface::setFloatingAnimated(bool b) {
449
floating_animated_check->setChecked(b);
452
bool PrefInterface::floatingAnimated() {
453
return floating_animated_check->isChecked();
456
void PrefInterface::setFloatingWidth(int percentage) {
457
floating_width_slider->setValue(percentage);
460
int PrefInterface::floatingWidth() {
461
return floating_width_slider->value();
464
void PrefInterface::setFloatingMargin(int pixels) {
465
floating_margin_slider->setValue(pixels);
468
int PrefInterface::floatingMargin() {
469
return floating_margin_slider->value();
472
void PrefInterface::setDisplayFloatingInCompactMode(bool b) {
473
floating_compact_check->setChecked(b);
476
bool PrefInterface::displayFloatingInCompactMode() {
477
return floating_compact_check->isChecked();
481
void PrefInterface::setFloatingBypassWindowManager(bool b) {
482
floating_bypass_wm_check->setChecked(b);
485
bool PrefInterface::floatingBypassWindowManager() {
486
return floating_bypass_wm_check->isChecked();
436
490
void PrefInterface::createHelp() {
501
555
tr("Check this option if you want to use an already running instance "
502
556
"of SMPlayer when opening other files.") );
504
setWhatsThis(server_port_spin, tr("Port"),
558
setWhatsThis(automatic_port_button, tr("Automatic port"),
559
tr("SMPlayer needs to listen to a port to receive commands from other "
560
"instances. If you select this option, a port will be "
561
"automatically chosen.") );
563
setWhatsThis(server_port_spin, tr("Manual port"),
505
564
tr("SMPlayer needs to listen to a port to receive commands from other "
506
565
"instances. You can change the port in case the default one is "
507
566
"used by another application.") );
568
manual_port_button->setWhatsThis( server_port_spin->whatsThis() );
570
addSectionTitle(tr("Floating control"));
572
setWhatsThis(floating_animated_check, tr("Animated"),
573
tr("If this option is enabled, the floating control will appear "
574
"with an animation.") );
576
setWhatsThis(floating_width_slider, tr("Width"),
577
tr("Specifies the width of the control (as a percentage).") );
579
setWhatsThis(floating_margin_slider, tr("Margin"),
580
tr("This option sets the number of pixels that the floating control "
581
"will be away from the bottom of the screen. Useful when the "
582
"screen is a TV, as the overscan might prevent the control to be "
585
setWhatsThis(floating_compact_check, tr("Display in compact mode too"),
586
tr("If this option is enabled, the floating control will appear "
587
"in compact mode too. <b>Warning:</b> the floating control has not been "
588
"designed for compact mode and it might not work properly.") );
591
setWhatsThis(floating_bypass_wm_check, tr("Bypass window manager"),
592
tr("If this option is checked, the control is displayed bypassing the "
593
"window manager. Disable this option if the floating control "
594
"doesn't work well with your window manager.") );
510
598
#include "moc_prefinterface.cpp"