Ignore:
Timestamp:
May 15, 2014, 7:53:54 PM (11 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer: update vendor to 0.8.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • smplayer/vendor/current/src/preferences.cpp

    r154 r163  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2013 Ricardo Villalba <rvm@users.sourceforge.net>
     2    Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    2424#include "urlhistory.h"
    2525#include "filters.h"
     26#include "autohidewidget.h"
    2627
    2728#include <QSettings>
     
    3031#include <QDir>
    3132#include <QLocale>
     33
     34#if QT_VERSION >= 0x050000
     35#include <QStandardPaths>
     36#endif
    3237
    3338#if QT_VERSION >= 0x040400
     
    109114
    110115#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
     116        #ifdef SCREENSAVER_OFF
    111117        turn_screensaver_off = false;
     118        #endif
     119        #ifdef AVOID_SCREENSAVER
    112120        avoid_screensaver = true;
     121        #endif
    113122#else
    114123        disable_screensaver = true;
     
    134143        mute = false;
    135144
     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
    136148        autosync = false;
    137149        autosync_factor = 100;
     
    139151        use_mc = false;
    140152        mc_value = 0;
     153
     154        autoload_m4a = true;
     155        min_step = 4;
    141156
    142157        osd = None;
     
    152167        dvd_device = "";
    153168        cdrom_device = "";
     169#ifdef BLURAY_SUPPORT
     170        bluray_device = "";
     171#endif
    154172
    155173#ifndef Q_OS_WIN
     
    238256
    239257        freetype_support = true;
     258#ifdef Q_OS_WIN
     259        use_windowsfontdir = false;
     260#endif
    240261
    241262
     
    257278
    258279        use_idx = false;
     280        use_lavf_demuxer = false;
    259281
    260282        mplayer_additional_options="";
     
    353375
    354376        reset_stop = false;
     377        delay_left_click = false;
    355378
    356379        language = "";
     
    398421
    399422        auto_add_to_playlist = true;
    400         add_to_playlist_consecutive_files = false;
     423        media_to_add_to_playlist = NoFiles;
    401424
    402425#if LOGO_ANIMATION
     
    479502        floating_control_animated = true;
    480503        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;
    484506
    485507
     
    523545       ******* */
    524546
    525         set->beginGroup( "general");
     547        set->beginGroup("General");
    526548
    527549        set->setValue("config_version", config_version);
     
    552574
    553575#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
     576        #ifdef SCREENSAVER_OFF
    554577        set->setValue("turn_screensaver_off", turn_screensaver_off);
     578        #endif
     579        #ifdef AVOID_SCREENSAVER
    555580        set->setValue("avoid_screensaver", avoid_screensaver);
     581        #endif
    556582#else
    557583        set->setValue("disable_screensaver", disable_screensaver);
     
    577603        set->setValue("mute", mute);
    578604
     605        set->setValue("global_audio_equalizer", global_audio_equalizer);
     606        set->setValue("audio_equalizer", audio_equalizer);
     607
    579608        set->setValue("autosync", autosync);
    580609        set->setValue("autosync_factor", autosync_factor);
     
    583612        set->setValue("mc_value", mc_value);
    584613
     614        set->setValue("autoload_m4a", autoload_m4a);
     615        set->setValue("min_step", min_step);
     616
    585617        set->setValue("osd", osd);
    586618        set->setValue("osd_delay", osd_delay);
     
    588620        set->setValue("file_settings_method", file_settings_method);
    589621
    590         set->endGroup(); // general
     622        set->endGroup(); // General
    591623
    592624
     
    599631        set->setValue("dvd_device", dvd_device);
    600632        set->setValue("cdrom_device", cdrom_device);
     633#ifdef BLURAY_SUPPORT
     634        set->setValue("bluray_device", bluray_device);
     635#endif
    601636
    602637#ifdef Q_OS_WIN
     
    686721
    687722        set->setValue("freetype_support", freetype_support);
     723#ifdef Q_OS_WIN
     724        set->setValue("use_windowsfontdir", use_windowsfontdir);
     725#endif
    688726
    689727        set->endGroup(); // subtitles
     
    709747
    710748        set->setValue("use_idx", use_idx);
     749        set->setValue("use_lavf_demuxer", use_lavf_demuxer);
    711750
    712751        set->setValue("mplayer_additional_options", mplayer_additional_options);
     
    796835
    797836        set->setValue("reset_stop", reset_stop);
     837        set->setValue("delay_left_click", delay_left_click);
    798838
    799839        set->setValue("language", language);
     
    831871
    832872        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);
    834874
    835875#if LOGO_ANIMATION
     
    932972        set->setValue("animated", floating_control_animated);
    933973        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);
    937976        set->endGroup(); // floating_control
    938977
     
    9931032       ******* */
    9941033
    995         set->beginGroup( "general");
     1034        set->beginGroup("General");
    9961035
    9971036        config_version = set->value("config_version", 0).toInt();
     
    10241063
    10251064#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
     1065        #ifdef SCREENSAVER_OFF
    10261066        turn_screensaver_off = set->value("turn_screensaver_off", turn_screensaver_off).toBool();
     1067        #endif
     1068        #ifdef AVOID_SCREENSAVER
    10271069        avoid_screensaver = set->value("avoid_screensaver", avoid_screensaver).toBool();
     1070        #endif
    10281071#else
    10291072        disable_screensaver = set->value("disable_screensaver", disable_screensaver).toBool();
     
    10491092        mute = set->value("mute", mute).toBool();
    10501093
     1094        global_audio_equalizer = set->value("global_audio_equalizer", global_audio_equalizer).toBool();
     1095        audio_equalizer = set->value("audio_equalizer", audio_equalizer).toList();
     1096
    10511097        autosync = set->value("autosync", autosync).toBool();
    10521098        autosync_factor = set->value("autosync_factor", autosync_factor).toInt();
     
    10551101        mc_value = set->value("mc_value", mc_value).toDouble();
    10561102
     1103        autoload_m4a = set->value("autoload_m4a", autoload_m4a).toBool();
     1104        min_step = set->value("min_step", min_step).toInt();
     1105
    10571106        osd = set->value("osd", osd).toInt();
    10581107        osd_delay = set->value("osd_delay", osd_delay).toInt();
     
    10601109        file_settings_method = set->value("file_settings_method", file_settings_method).toString();
    10611110
    1062         set->endGroup(); // general
     1111        set->endGroup(); // General
    10631112
    10641113
     
    10711120        dvd_device = set->value("dvd_device", dvd_device).toString();
    10721121        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
    10731125
    10741126#ifdef Q_OS_WIN
     
    11591211
    11601212        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
    11611216
    11621217        set->endGroup(); // subtitles
     
    11871242
    11881243        use_idx = set->value("use_idx", use_idx).toBool();
     1244        use_lavf_demuxer = set->value("use_lavf_demuxer", use_lavf_demuxer).toBool();
    11891245
    11901246        mplayer_additional_options = set->value("mplayer_additional_options", mplayer_additional_options).toString();
     
    12541310        mouse_xbutton2_click_function = set->value("mouse_xbutton2_click_function", mouse_xbutton2_click_function).toString();
    12551311        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        }
    12581316        wheel_function_seeking_reverse = set->value("wheel_function_seeking_reverse", wheel_function_seeking_reverse).toBool();
    12591317
     
    12731331
    12741332        reset_stop = set->value("reset_stop", reset_stop).toBool();
     1333        delay_left_click = set->value("delay_left_click", delay_left_click).toBool();
    12751334
    12761335        language = set->value("language", language).toString();
     
    13081367
    13091368        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();
    13111370
    13121371#if LOGO_ANIMATION
     
    14081467        floating_control_animated = set->value("animated", floating_control_animated).toBool();
    14091468        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();
    14131471        set->endGroup(); // floating_control
    14141472
     
    14601518
    14611519
     1520        qDebug("Preferences::load: config_version: %d, CURRENT_CONFIG_VERSION: %d", config_version, CURRENT_CONFIG_VERSION);
    14621521        // Fix some values if config is old
    14631522        if (config_version < CURRENT_CONFIG_VERSION) {
     
    15371596#if QT_VERSION >= 0x040400
    15381597        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
    15391603                QString pdir = QDesktopServices::storageLocation(QDesktopServices::PicturesLocation);
    15401604                if (pdir.isEmpty()) pdir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
    15411605                if (pdir.isEmpty()) pdir = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
     1606                #endif
    15421607                if (pdir.isEmpty()) pdir = "/tmp";
    15431608                if (!QFile::exists(pdir)) {
Note: See TracChangeset for help on using the changeset viewer.