Changeset 163 for smplayer/vendor/current/src/preferences.cpp
- Timestamp:
- May 15, 2014, 7:53:54 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/src/preferences.cpp
r154 r163 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 3Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 24 24 #include "urlhistory.h" 25 25 #include "filters.h" 26 #include "autohidewidget.h" 26 27 27 28 #include <QSettings> … … 30 31 #include <QDir> 31 32 #include <QLocale> 33 34 #if QT_VERSION >= 0x050000 35 #include <QStandardPaths> 36 #endif 32 37 33 38 #if QT_VERSION >= 0x040400 … … 109 114 110 115 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 116 #ifdef SCREENSAVER_OFF 111 117 turn_screensaver_off = false; 118 #endif 119 #ifdef AVOID_SCREENSAVER 112 120 avoid_screensaver = true; 121 #endif 113 122 #else 114 123 disable_screensaver = true; … … 134 143 mute = false; 135 144 145 global_audio_equalizer = true; 146 audio_equalizer << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0; // FIXME: use initial_audio_equalizer (but it's set later) 147 136 148 autosync = false; 137 149 autosync_factor = 100; … … 139 151 use_mc = false; 140 152 mc_value = 0; 153 154 autoload_m4a = true; 155 min_step = 4; 141 156 142 157 osd = None; … … 152 167 dvd_device = ""; 153 168 cdrom_device = ""; 169 #ifdef BLURAY_SUPPORT 170 bluray_device = ""; 171 #endif 154 172 155 173 #ifndef Q_OS_WIN … … 238 256 239 257 freetype_support = true; 258 #ifdef Q_OS_WIN 259 use_windowsfontdir = false; 260 #endif 240 261 241 262 … … 257 278 258 279 use_idx = false; 280 use_lavf_demuxer = false; 259 281 260 282 mplayer_additional_options=""; … … 353 375 354 376 reset_stop = false; 377 delay_left_click = false; 355 378 356 379 language = ""; … … 398 421 399 422 auto_add_to_playlist = true; 400 add_to_playlist_consecutive_files = false;423 media_to_add_to_playlist = NoFiles; 401 424 402 425 #if LOGO_ANIMATION … … 479 502 floating_control_animated = true; 480 503 floating_display_in_compact_mode = false; 481 #ifndef Q_OS_WIN 482 bypass_window_manager = true; 483 #endif 504 floating_activation_area = AutohideWidget::Anywhere; 505 floating_hide_delay = 3000; 484 506 485 507 … … 523 545 ******* */ 524 546 525 set->beginGroup( "general");547 set->beginGroup("General"); 526 548 527 549 set->setValue("config_version", config_version); … … 552 574 553 575 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 576 #ifdef SCREENSAVER_OFF 554 577 set->setValue("turn_screensaver_off", turn_screensaver_off); 578 #endif 579 #ifdef AVOID_SCREENSAVER 555 580 set->setValue("avoid_screensaver", avoid_screensaver); 581 #endif 556 582 #else 557 583 set->setValue("disable_screensaver", disable_screensaver); … … 577 603 set->setValue("mute", mute); 578 604 605 set->setValue("global_audio_equalizer", global_audio_equalizer); 606 set->setValue("audio_equalizer", audio_equalizer); 607 579 608 set->setValue("autosync", autosync); 580 609 set->setValue("autosync_factor", autosync_factor); … … 583 612 set->setValue("mc_value", mc_value); 584 613 614 set->setValue("autoload_m4a", autoload_m4a); 615 set->setValue("min_step", min_step); 616 585 617 set->setValue("osd", osd); 586 618 set->setValue("osd_delay", osd_delay); … … 588 620 set->setValue("file_settings_method", file_settings_method); 589 621 590 set->endGroup(); // general622 set->endGroup(); // General 591 623 592 624 … … 599 631 set->setValue("dvd_device", dvd_device); 600 632 set->setValue("cdrom_device", cdrom_device); 633 #ifdef BLURAY_SUPPORT 634 set->setValue("bluray_device", bluray_device); 635 #endif 601 636 602 637 #ifdef Q_OS_WIN … … 686 721 687 722 set->setValue("freetype_support", freetype_support); 723 #ifdef Q_OS_WIN 724 set->setValue("use_windowsfontdir", use_windowsfontdir); 725 #endif 688 726 689 727 set->endGroup(); // subtitles … … 709 747 710 748 set->setValue("use_idx", use_idx); 749 set->setValue("use_lavf_demuxer", use_lavf_demuxer); 711 750 712 751 set->setValue("mplayer_additional_options", mplayer_additional_options); … … 796 835 797 836 set->setValue("reset_stop", reset_stop); 837 set->setValue("delay_left_click", delay_left_click); 798 838 799 839 set->setValue("language", language); … … 831 871 832 872 set->setValue("auto_add_to_playlist", auto_add_to_playlist); 833 set->setValue(" add_to_playlist_consecutive_files", add_to_playlist_consecutive_files);873 set->setValue("media_to_add_to_playlist", media_to_add_to_playlist); 834 874 835 875 #if LOGO_ANIMATION … … 932 972 set->setValue("animated", floating_control_animated); 933 973 set->setValue("display_in_compact_mode", floating_display_in_compact_mode); 934 #ifndef Q_OS_WIN 935 set->setValue("bypass_window_manager", bypass_window_manager); 936 #endif 974 set->setValue("activation_area", floating_activation_area); 975 set->setValue("hide_delay", floating_hide_delay); 937 976 set->endGroup(); // floating_control 938 977 … … 993 1032 ******* */ 994 1033 995 set->beginGroup( "general");1034 set->beginGroup("General"); 996 1035 997 1036 config_version = set->value("config_version", 0).toInt(); … … 1024 1063 1025 1064 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 1065 #ifdef SCREENSAVER_OFF 1026 1066 turn_screensaver_off = set->value("turn_screensaver_off", turn_screensaver_off).toBool(); 1067 #endif 1068 #ifdef AVOID_SCREENSAVER 1027 1069 avoid_screensaver = set->value("avoid_screensaver", avoid_screensaver).toBool(); 1070 #endif 1028 1071 #else 1029 1072 disable_screensaver = set->value("disable_screensaver", disable_screensaver).toBool(); … … 1049 1092 mute = set->value("mute", mute).toBool(); 1050 1093 1094 global_audio_equalizer = set->value("global_audio_equalizer", global_audio_equalizer).toBool(); 1095 audio_equalizer = set->value("audio_equalizer", audio_equalizer).toList(); 1096 1051 1097 autosync = set->value("autosync", autosync).toBool(); 1052 1098 autosync_factor = set->value("autosync_factor", autosync_factor).toInt(); … … 1055 1101 mc_value = set->value("mc_value", mc_value).toDouble(); 1056 1102 1103 autoload_m4a = set->value("autoload_m4a", autoload_m4a).toBool(); 1104 min_step = set->value("min_step", min_step).toInt(); 1105 1057 1106 osd = set->value("osd", osd).toInt(); 1058 1107 osd_delay = set->value("osd_delay", osd_delay).toInt(); … … 1060 1109 file_settings_method = set->value("file_settings_method", file_settings_method).toString(); 1061 1110 1062 set->endGroup(); // general1111 set->endGroup(); // General 1063 1112 1064 1113 … … 1071 1120 dvd_device = set->value("dvd_device", dvd_device).toString(); 1072 1121 cdrom_device = set->value("cdrom_device", cdrom_device).toString(); 1122 #ifdef BLURAY_SUPPORT 1123 bluray_device = set->value("bluray_device", bluray_device).toString(); 1124 #endif 1073 1125 1074 1126 #ifdef Q_OS_WIN … … 1159 1211 1160 1212 freetype_support = set->value("freetype_support", freetype_support).toBool(); 1213 #ifdef Q_OS_WIN 1214 use_windowsfontdir = set->value("use_windowsfontdir", use_windowsfontdir).toBool(); 1215 #endif 1161 1216 1162 1217 set->endGroup(); // subtitles … … 1187 1242 1188 1243 use_idx = set->value("use_idx", use_idx).toBool(); 1244 use_lavf_demuxer = set->value("use_lavf_demuxer", use_lavf_demuxer).toBool(); 1189 1245 1190 1246 mplayer_additional_options = set->value("mplayer_additional_options", mplayer_additional_options).toString(); … … 1254 1310 mouse_xbutton2_click_function = set->value("mouse_xbutton2_click_function", mouse_xbutton2_click_function).toString(); 1255 1311 wheel_function = set->value("mouse_wheel_function", wheel_function).toInt(); 1256 int wheel_function_cycle_int = set->value("wheel_function_cycle", (int) wheel_function_cycle).toInt(); 1257 wheel_function_cycle = QFlags<Preferences::WheelFunctions> (QFlag(wheel_function_cycle_int)); 1312 { 1313 int wheel_function_cycle_int = set->value("wheel_function_cycle", (int) wheel_function_cycle).toInt(); 1314 wheel_function_cycle = (WheelFunctions) wheel_function_cycle_int; 1315 } 1258 1316 wheel_function_seeking_reverse = set->value("wheel_function_seeking_reverse", wheel_function_seeking_reverse).toBool(); 1259 1317 … … 1273 1331 1274 1332 reset_stop = set->value("reset_stop", reset_stop).toBool(); 1333 delay_left_click = set->value("delay_left_click", delay_left_click).toBool(); 1275 1334 1276 1335 language = set->value("language", language).toString(); … … 1308 1367 1309 1368 auto_add_to_playlist = set->value("auto_add_to_playlist", auto_add_to_playlist).toBool(); 1310 add_to_playlist_consecutive_files = set->value("add_to_playlist_consecutive_files", add_to_playlist_consecutive_files).toBool();1369 media_to_add_to_playlist = (AutoAddToPlaylistFilter) set->value("media_to_add_to_playlist", media_to_add_to_playlist).toInt(); 1311 1370 1312 1371 #if LOGO_ANIMATION … … 1408 1467 floating_control_animated = set->value("animated", floating_control_animated).toBool(); 1409 1468 floating_display_in_compact_mode = set->value("display_in_compact_mode", floating_display_in_compact_mode).toBool(); 1410 #ifndef Q_OS_WIN 1411 bypass_window_manager = set->value("bypass_window_manager", bypass_window_manager).toBool(); 1412 #endif 1469 floating_activation_area = set->value("activation_area", floating_activation_area).toInt(); 1470 floating_hide_delay = set->value("hide_delay", floating_hide_delay).toInt(); 1413 1471 set->endGroup(); // floating_control 1414 1472 … … 1460 1518 1461 1519 1520 qDebug("Preferences::load: config_version: %d, CURRENT_CONFIG_VERSION: %d", config_version, CURRENT_CONFIG_VERSION); 1462 1521 // Fix some values if config is old 1463 1522 if (config_version < CURRENT_CONFIG_VERSION) { … … 1537 1596 #if QT_VERSION >= 0x040400 1538 1597 if (screenshot_directory.isEmpty()) { 1598 #if QT_VERSION >= 0x050000 1599 QString pdir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); 1600 if (pdir.isEmpty()) pdir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); 1601 if (pdir.isEmpty()) pdir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation); 1602 #else 1539 1603 QString pdir = QDesktopServices::storageLocation(QDesktopServices::PicturesLocation); 1540 1604 if (pdir.isEmpty()) pdir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); 1541 1605 if (pdir.isEmpty()) pdir = QDesktopServices::storageLocation(QDesktopServices::HomeLocation); 1606 #endif 1542 1607 if (pdir.isEmpty()) pdir = "/tmp"; 1543 1608 if (!QFile::exists(pdir)) {
Note:
See TracChangeset
for help on using the changeset viewer.