Ignore:
Timestamp:
May 3, 2016, 5:25:45 PM (10 years ago)
Author:
Silvan Scherrer
Message:

smplayer: update trunk to version 16.4

Location:
smplayer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk

  • smplayer/trunk/src/basegui.cpp

    r170 r176  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2014 Ricardo Villalba <[email protected]>
     2    Copyright (C) 2006-201 Ricardo Villalba <[email protected]>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    4040#include <QClipboard>
    4141#include <QMimeData>
     42
    4243
    4344#include <cmath>
     
    6869#include "errordialog.h"
    6970#include "timedialog.h"
     71
     72
     73
     74
     75
     76
     77
    7078#include "clhelp.h"
    7179#include "mplayerversion.h"
     
    98106
    99107#include "constants.h"
     108
     109
     110
     111
     112
    100113
    101114#include "extensions.h"
     
    107120#endif
    108121
     122
    109123#include "updatechecker.h"
    110 
    111 #ifdef YT_USE_SCRIPT
    112 #include "codedownloader.h"
    113 #endif
    114 
    115 #ifdef REMINDER_ACTIONS
     124#endif
     125
     126#ifdef YOUTUBE_SUPPORT
     127  #ifdef YT_USE_YTSIG
     128  #include "codedownloader.h"
     129  #endif
     130#endif
     131
     132#ifdef SHARE_ACTIONS
    116133#include "sharedialog.h"
     134
     135
     136
     137
    117138#endif
    118139
     
    126147BaseGui::BaseGui( QWidget* parent, Qt::WindowFlags flags )
    127148        : QMainWindow( parent, flags )
     149
     150
     151
     152
     153
     154
     155
     156
     157
     158
    128159{
    129160#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
     
    174205             core, SLOT(wheelDown()) );
    175206
    176         // Set style before changing color of widgets:
    177         // Set style
    178207#if STYLE_SWITCHING
    179         qDebug( "Style name: '%s'", qApp->style()->objectName().toUtf8().data() );
    180         qDebug( "Style class name: '%s'", qApp->style()->metaObject()->className() );
    181 
     208        qApp->setStyleSheet("");
    182209        default_style = qApp->style()->objectName();
    183         if (!pref->style.isEmpty()) {
    184                 qApp->setStyle( pref->style );
    185         }
     210        #ifdef Q_OS_LINUX
     211        // Some controls aren't displayed correctly with the adwaita style
     212        // so try to prevent to use it as the default style
     213        if (default_style.toLower() == "adwaita") default_style = "gtk+";
     214        #endif
     215        qDebug() << "BaseGui::BaseGui: default_style:" << default_style;
     216        //qDebug() << "BaseGui::BaseGui: qApp->style:" << qApp->style();
    186217#endif
    187218
     
    216247        panel->setFocus();
    217248
     249
    218250        initializeGui();
    219251
    220252#ifdef UPDATE_CHECKER
    221253        update_checker = new UpdateChecker(this, &pref->update_checker_data);
    222         connect(update_checker, SIGNAL(newVersionFound(QString)),
    223             this, SLOT(reportNewVersionAvailable(QString)));
    224254#endif
    225255
     
    228258#endif
    229259
    230 #ifdef REMINDER_ACTIONS
     260#if
    231261        QTimer::singleShot(1000, this, SLOT(checkReminder()));
     262
     263
     264
     265
    232266#endif
    233267}
     
    236270        if (pref->compact_mode) toggleCompactMode(true);
    237271        changeStayOnTop(pref->stay_on_top);
    238 
    239 #if ALLOW_CHANGE_STYLESHEET
    240         changeStyleSheet(pref->iconset);
    241 #endif
    242272
    243273        updateRecents();
     
    250280        // Single instance
    251281        /* Deleted */
     282
     283
     284
     285
     286
     287
     288
     289
     290
     291
     292
     293
     294
     295
     296
     297
     298
     299
     300
     301
     302
     303
     304
     305
    252306}
    253307
     
    278332                        /* if (core->state() == Core::Stopped) { emit openFileRequested(); } */
    279333                        playlist->addFiles(file_list);
     334
     335
     336
     337
     338
    280339                }
    281340                else
     
    453512             core, SLOT(frameStep()) );
    454513
     514
     515
     516
     517
    455518        rewind1Act = new MyAction( Qt::Key_Left, this, "rewind1" );
    456519        rewind1Act->addShortcut(QKeySequence("Shift+Ctrl+B")); // MCE remote key
     
    565628             core, SLOT(screenshots()) );
    566629
     630
     631
     632
     633
     634
     635
    567636#ifdef VIDEOPREVIEW
    568637        videoPreviewAct = new MyAction( this, "video_preview" );
     
    581650             core, SLOT(toggleMirror(bool)) );
    582651
     652
     653
     654
    583655
    584656        // Submenu filter
     
    684756             core, SLOT(toggleExtrastereo(bool)) );
    685757
     758
    686759        karaokeAct = new MyAction( this, "karaoke_filter" );
    687760        karaokeAct->setCheckable( true );
    688761        connect( karaokeAct, SIGNAL(toggled(bool)),
    689762             core, SLOT(toggleKaraoke(bool)) );
     763
    690764
    691765        volnormAct = new MyAction( this, "volnorm_filter" );
     
    730804        connect( incSubScaleAct, SIGNAL(triggered()),
    731805             core, SLOT(incSubScale()) );
    732    
     806
    733807        decSubStepAct = new MyAction( Qt::Key_G, this, "dec_sub_step" );
    734808        connect( decSubStepAct, SIGNAL(triggered()),
     
    739813             core, SLOT(incSubStep()) );
    740814
    741         useAssAct = new MyAction(this, "use_ass_lib");
    742         useAssAct->setCheckable(true);
    743         connect( useAssAct, SIGNAL(toggled(bool)), core, SLOT(changeUseAss(bool)) );
     815#ifdef MPV_SUPPORT
     816        seekNextSubAct = new MyAction(Qt::CTRL | Qt::Key_Right, this, "seek_next_sub");
     817        connect(seekNextSubAct, SIGNAL(triggered()),
     818            core, SLOT(seekToNextSub()));
     819
     820        seekPrevSubAct = new MyAction(Qt::CTRL | Qt::Key_Left, this, "seek_prev_sub");
     821        connect(seekPrevSubAct, SIGNAL(triggered()),
     822            core, SLOT(seekToPrevSub()));
     823#endif
     824
     825        useCustomSubStyleAct = new MyAction(this, "use_custom_sub_style");
     826        useCustomSubStyleAct->setCheckable(true);
     827        connect( useCustomSubStyleAct, SIGNAL(toggled(bool)), core, SLOT(changeUseCustomSubStyle(bool)) );
    744828
    745829        useForcedSubsOnlyAct = new MyAction(this, "use_forced_subs_only");
     
    811895             this, SLOT(helpCheckUpdates()) );
    812896
    813 #if defined(YOUTUBE_SUPPORT) && defined(YT_USE_SCRIPT)
     897#if defined(YOUTUBE_SUPPORT) && defined(YT_USE_)
    814898        updateYTAct = new MyAction( this, "update_youtube" );
    815899        connect( updateYTAct, SIGNAL(triggered()),
     
    821905             this, SLOT(helpShowConfig()) );
    822906
    823 #ifdef REMINDER_ACTIONS
     907#ifdef _ACTIONS
    824908        donateAct = new MyAction( this, "donate" );
    825909        connect( donateAct, SIGNAL(triggered()),
     
    850934#endif
    851935
     936
     937
     938
     939
     940
     941
     942
     943
    852944        // Playlist
    853945        playNextAct = new MyAction(Qt::Key_Greater, this, "play_next");
     
    890982        autoZoom235Act = new MyAction(Qt::SHIFT | Qt::Key_S, this, "zoom_235");
    891983        connect( autoZoom235Act, SIGNAL(triggered()), core, SLOT(autoZoomFor235()) );
    892 
    893 #if USE_MPLAYER_PANSCAN
    894         incPanscanAct = new MyAction(Qt::SHIFT | Qt::Key_M, this, "inc_panscan");
    895         connect( incPanscanAct, SIGNAL(triggered()), core, SLOT(incPanscan()) );
    896 
    897         decPanscanAct = new MyAction(Qt::SHIFT | Qt::Key_N, this, "dec_panscan");
    898         connect( decPanscanAct, SIGNAL(triggered()), core, SLOT(decPanscan()) );
    899 #endif
    900984
    901985
     
    9841068        showFilenameAct = new MyAction(Qt::SHIFT | Qt::Key_I, this, "show_filename");
    9851069        connect( showFilenameAct, SIGNAL(triggered()), core, SLOT(showFilenameOnOSD()) );
     1070
     1071
     1072
    9861073
    9871074        toggleDeinterlaceAct = new MyAction(Qt::Key_D, this, "toggle_deinterlacing");
     
    11521239        // Subtitle track
    11531240        subtitleTrackGroup = new MyActionGroup(this);
    1154     connect( subtitleTrackGroup, SIGNAL(activated(int)),
     1241connect( subtitleTrackGroup, SIGNAL(activated(int)),
    11551242                 core, SLOT(changeSubtitle(int)) );
     1243
     1244
     1245
     1246
     1247
     1248
     1249
    11561250
    11571251        ccGroup = new MyActionGroup(this);
     
    11901284                         core, SLOT(changeChapter(int)) );
    11911285
     1286
     1287
     1288
     1289
     1290
     1291
     1292
     1293
     1294
     1295
     1296
     1297
     1298
     1299
     1300
     1301
     1302
     1303
     1304
    11921305#if DVDNAV_SUPPORT
    11931306        dvdnavUpAct = new MyAction(Qt::SHIFT | Qt::Key_Up, this, "dvdnav_up");
     
    12271340        stopAct->setEnabled(b);
    12281341        frameStepAct->setEnabled(b);
     1342
    12291343        rewind1Act->setEnabled(b);
    12301344        rewind2Act->setEnabled(b);
     
    12511365        screenshotAct->setEnabled(b);
    12521366        screenshotsAct->setEnabled(b);
     1367
     1368
     1369
    12531370        flipAct->setEnabled(b);
    12541371        mirrorAct->setEnabled(b);
     1372
    12551373        postProcessingAct->setEnabled(b);
    12561374        phaseAct->setEnabled(b);
     
    12711389        audioDelayAct->setEnabled(b);
    12721390        extrastereoAct->setEnabled(b);
     1391
    12731392        karaokeAct->setEnabled(b);
     1393
    12741394        volnormAct->setEnabled(b);
    12751395        loadAudioAct->setEnabled(b);
     
    12881408        incSubScaleAct->setEnabled(b);
    12891409        decSubScaleAct->setEnabled(b);
     1410
     1411
     1412
     1413
    12901414
    12911415        // Actions not in menus
     
    13631487        screenshotsAct->setEnabled( screenshots_enabled );
    13641488
     1489
     1490
     1491
     1492
    13651493        // Disable the compact action if not using video window
    13661494        compactAct->setEnabled( panel->isVisible() );
     
    13791507                audioDelayAct->setEnabled(false);
    13801508                extrastereoAct->setEnabled(false);
     1509
    13811510                karaokeAct->setEnabled(false);
     1511
    13821512                volnormAct->setEnabled(false);
    13831513                channelsGroup->setActionsEnabled(false);
     
    13901520                screenshotAct->setEnabled(false);
    13911521                screenshotsAct->setEnabled(false);
     1522
     1523
     1524
    13921525                flipAct->setEnabled(false);
    13931526                mirrorAct->setEnabled(false);
     1527
    13941528                postProcessingAct->setEnabled(false);
    13951529                phaseAct->setEnabled(false);
     
    14361570                flipAct->setEnabled(false);
    14371571                mirrorAct->setEnabled(false);
     1572
    14381573                postProcessingAct->setEnabled(false);
    14391574                phaseAct->setEnabled(false);
     
    14661601        }
    14671602#endif
     1603
     1604
     1605
     1606
     1607
     1608
     1609
     1610
     1611
     1612
     1613
    14681614}
    14691615
     
    14771623        stopAct->setEnabled(true);
    14781624}
     1625
    14791626
    14801627void BaseGui::togglePlayAction(Core::State state) {
    14811628        qDebug("BaseGui::togglePlayAction");
     1629
     1630
    14821631        if (state == Core::Playing)
    14831632                playAct->setEnabled(false);
    14841633        else
    14851634                playAct->setEnabled(true);
    1486 }
    1487 #endif // AUTODISABLE_ACTIONS
     1635#endif
     1636}
    14881637
    14891638void BaseGui::retranslateStrings() {
     
    15341683        stopAct->change( Images::icon("stop"), tr("&Stop") );
    15351684        frameStepAct->change( Images::icon("frame_step"), tr("&Frame step") );
     1685
    15361686
    15371687        playOrPauseAct->change( tr("Play / Pause") );
     
    15671717        screenshotAct->change( Images::icon("screenshot"), tr("&Screenshot") );
    15681718        screenshotsAct->change( Images::icon("screenshots"), tr("Start/stop takin&g screenshots") );
     1719
     1720
     1721
    15691722#ifdef VIDEOPREVIEW
    15701723        videoPreviewAct->change( Images::icon("video_preview"), tr("Thumb&nail Generator...") );
     
    15721725        flipAct->change( Images::icon("flip"), tr("Fli&p image") );
    15731726        mirrorAct->change( Images::icon("mirror"), tr("Mirr&or image") );
     1727
    15741728
    15751729        decZoomAct->change( tr("Zoom &-") );
     
    15831737        moveUpAct->change( tr("Move &up") );
    15841738        moveDownAct->change( tr("Move &down") );
    1585 
    1586 #if USE_MPLAYER_PANSCAN
    1587         decPanscanAct->change( "Panscan -" );
    1588         incPanscanAct->change( "Panscan +" );
    1589 #endif
    15901739
    15911740        // Submenu Filters
     
    16141763        // Submenu Filters
    16151764        extrastereoAct->change( tr("&Extrastereo") );
     1765
    16161766        karaokeAct->change( tr("&Karaoke") );
     1767
    16171768        volnormAct->change( tr("Volume &normalization") );
    16181769
     
    16311782        incSubStepAct->change( Images::icon("inc_sub_step"),
    16321783                           tr("N&ext line in subtitles") );
    1633         useAssAct->change( Images::icon("use_ass_lib"), tr("Use SSA/&ASS library") );
     1784#ifdef MPV_SUPPORT
     1785        seekNextSubAct->change(Images::icon("seek_next_sub"), tr("Seek to next subtitle"));
     1786        seekPrevSubAct->change(Images::icon("seek_prev_sub"), tr("Seek to previous subtitle"));
     1787#endif
     1788        useCustomSubStyleAct->change( Images::icon("use_custom_sub_style"), tr("Use custo&m style") );
    16341789        useForcedSubsOnlyAct->change( Images::icon("forced_subs"), tr("&Forced subtitles only") );
    16351790
     
    16651820        // Submenu Logs
    16661821#ifdef LOG_MPLAYER
    1667         showLogMplayerAct->change( "MPlayer" );
     1822        showLogMplayerAct->change();
    16681823#endif
    16691824#ifdef LOG_SMPLAYER
     
    16771832        showCheckUpdatesAct->change( Images::icon("check_updates"), tr("Check for &updates") );
    16781833
    1679 #if defined(YOUTUBE_SUPPORT) && defined(YT_USE_SCRIPT)
     1834#if defined(YOUTUBE_SUPPORT) && defined(YT_USE_)
    16801835        updateYTAct->change( Images::icon("update_youtube"), tr("Update &Youtube code") );
    16811836#endif
    16821837
    16831838        showConfigAct->change( Images::icon("show_config"), tr("&Open configuration folder") );
    1684 #ifdef REMINDER_ACTIONS
     1839#ifdef _ACTIONS
    16851840        donateAct->change( Images::icon("donate"), tr("&Donate / Share with your friends") );
    16861841#endif
     
    16941849        yahooAct->change("&Yahoo!");
    16951850#endif
     1851
     1852
     1853
     1854
    16961855
    16971856        // Playlist
     
    17361895
    17371896        showFilenameAct->change( tr("Show filename on OSD") );
     1897
    17381898        toggleDeinterlaceAct->change( tr("Toggle deinterlacing") );
    17391899
     
    19022062
    19032063        // Menu Subtitle
    1904         subtitlestrack_menu->menuAction()->setText( tr("&Select") );
    1905         subtitlestrack_menu->menuAction()->setIcon( Images::icon("sub") );
     2064#ifdef MPV_SUPPORT
     2065        subtitles_track_menu->menuAction()->setText( tr("Prim&ary track") );
     2066#else
     2067        subtitles_track_menu->menuAction()->setText( tr("&Select") );
     2068#endif
     2069        subtitles_track_menu->menuAction()->setIcon( Images::icon("sub") );
     2070
     2071#ifdef MPV_SUPPORT
     2072        secondary_subtitles_track_menu->menuAction()->setText( tr("Secondary trac&k") );
     2073        secondary_subtitles_track_menu->menuAction()->setIcon( Images::icon("secondary_sub") );
     2074#endif
    19062075
    19072076        closed_captions_menu->menuAction()->setText( tr("&Closed captions") );
     
    19212090        angles_menu->menuAction()->setIcon( Images::icon("angle") );
    19222091
     2092
     2093
     2094
     2095
     2096
    19232097#if PROGRAM_SWITCH
    19242098        programtrack_menu->menuAction()->setText( tr("P&rogram", "program") );
     
    19262100#endif
    19272101
     2102
     2103
     2104
     2105
     2106
     2107
    19282108
    19292109#if DVDNAV_SUPPORT
     
    19572137        // Other things
    19582138#ifdef LOG_MPLAYER
    1959         mplayer_log_window->setWindowTitle( tr("SMPlayer - MPlayer log") );
     2139        mplayer_log_window->setWindowTitle( tr(") );
    19602140#endif
    19612141#ifdef LOG_SMPLAYER
    1962         smplayer_log_window->setWindowTitle( tr("SMPlayer - SMPlayer log") );
     2142        smplayer_log_window->setWindowTitle( tr("SMPlayer log") );
    19632143#endif
    19642144
     
    20192199             this, SLOT(resizeWindow(int,int)) );
    20202200
     2201
     2202
     2203
    20212204        connect( core, SIGNAL(showMessage(QString,int)),
    20222205             this, SLOT(displayMessage(QString,int)) );
     
    20992282        connect(core, SIGNAL(signatureNotFound(const QString &)),
    21002283            this, SLOT(YTNoSignature(const QString &)));
     2284
     2285
    21012286#endif
    21022287        connect(core, SIGNAL(receivedForbidden()), this, SLOT(gotForbidden()));
     
    21142299#if LOGO_ANIMATION
    21152300        mplayerwindow->setAnimatedLogo( pref->animated_logo);
     2301
     2302
     2303
     2304
     2305
     2306
     2307
     2308
    21162309#endif
    21172310
     
    21432336
    21442337        connect( mplayerwindow, SIGNAL(mouseMovedDiff(QPoint)),
    2145              this, SLOT(moveWindowDiff(QPoint)), Qt::QueuedConnection );
    2146         mplayerwindow->activateMouseDragTracking(pref->move_when_dragging);
     2338             this, SLOT(processMouseMovedDiff(QPoint)), Qt::QueuedConnection );
     2339#ifdef MOUSE_GESTURES
     2340        mplayerwindow->activateMouseDragTracking(true);
     2341#else
     2342        mplayerwindow->activateMouseDragTracking(pref->drag_function == Preferences::MoveWindow);
     2343#endif
    21472344}
    21482345
     
    21972394             core, SLOT(setAudioAudioEqualizerRestart(AudioEqualizerList)) );
    21982395
     2396
     2397
     2398
    21992399        connect( audio_equalizer, SIGNAL(visibilityChanged()),
    22002400             this, SLOT(updateWidgets()) );
     
    22502450
    22512451void BaseGui::createFilePropertiesDialog() {
     2452
    22522453        QApplication::setOverrideCursor(Qt::WaitCursor);
    22532454        file_dialog = new FilePropertiesDialog(this);
     
    22752476
    22762477        recentfiles_menu = new QMenu(this);
     2478
    22772479        recentfiles_menu->addAction( clearRecentsAct );
    22782480        recentfiles_menu->addSeparator();
     2481
    22792482
    22802483        openMenu->addMenu( recentfiles_menu );
     
    23112514        playMenu->addAction(stopAct);
    23122515        playMenu->addAction(frameStepAct);
     2516
    23132517        playMenu->addSeparator();
    23142518        playMenu->addAction(rewind1Act);
     
    24552659        videoMenu->addAction(flipAct);
    24562660        videoMenu->addAction(mirrorAct);
     2661
    24572662        videoMenu->addSeparator();
    24582663        videoMenu->addAction(videoEqualizerAct);
     
    24882693        audiofilter_menu->menuAction()->setObjectName("audiofilter_menu");
    24892694        audiofilter_menu->addAction(extrastereoAct);
     2695
    24902696        audiofilter_menu->addAction(karaokeAct);
     2697
    24912698        audiofilter_menu->addAction(volnormAct);
    24922699
     
    25212728        // SUBTITLES MENU
    25222729        // Track submenu
    2523         subtitlestrack_menu = new QMenu(this);
    2524         subtitlestrack_menu->menuAction()->setObjectName("subtitlestrack_menu");
    2525 
    2526         subtitlesMenu->addMenu(subtitlestrack_menu);
     2730        subtitles_track_menu = new QMenu(this);
     2731        subtitles_track_menu->menuAction()->setObjectName("subtitlestrack_menu");
     2732
     2733#ifdef MPV_SUPPORT
     2734        secondary_subtitles_track_menu = new QMenu(this);
     2735        secondary_subtitles_track_menu->menuAction()->setObjectName("secondary_subtitles_track_menu");
     2736#endif
     2737
     2738        subtitlesMenu->addMenu(subtitles_track_menu);
     2739#ifdef MPV_SUPPORT
     2740        subtitlesMenu->addMenu(secondary_subtitles_track_menu);
     2741#endif
    25272742        subtitlesMenu->addSeparator();
    25282743
     
    25652780        subtitlesMenu->addAction(decSubStepAct);
    25662781        subtitlesMenu->addAction(incSubStepAct);
     2782
     2783
     2784
     2785
     2786
    25672787        subtitlesMenu->addSeparator();
    25682788        subtitlesMenu->addAction(useForcedSubsOnlyAct);
     
    25702790        subtitlesMenu->addAction(subVisibilityAct);
    25712791        subtitlesMenu->addSeparator();
    2572         subtitlesMenu->addAction(useAssAct);
     2792        subtitlesMenu->addAction(useAct);
    25732793#ifdef FIND_SUBTITLES
    25742794        subtitlesMenu->addSeparator(); //turbos
     
    25952815
    25962816        browseMenu->addMenu(angles_menu);
     2817
     2818
     2819
     2820
     2821
     2822
     2823
     2824
    25972825
    25982826#if DVDNAV_SUPPORT
     
    26382866        osd_menu->menuAction()->setObjectName("osd_menu");
    26392867        osd_menu->addActions(osdGroup->actions());
     2868
     2869
     2870
     2871
    26402872
    26412873        optionsMenu->addMenu(osd_menu);
     
    26802912        helpMenu->addSeparator();
    26812913        helpMenu->addAction(showCheckUpdatesAct);
    2682 #if defined(YOUTUBE_SUPPORT) && defined(YT_USE_SCRIPT)
     2914#if defined(YOUTUBE_SUPPORT) && defined(YT_USE_)
    26832915        helpMenu->addAction(updateYTAct);
    26842916#endif
     
    26862918        helpMenu->addAction(showConfigAct);
    26872919        helpMenu->addSeparator();
    2688 #ifdef REMINDER_ACTIONS
     2920#ifdef _ACTIONS
    26892921        helpMenu->addAction(donateAct);
    26902922        helpMenu->addSeparator();
     
    28073039        pl->setSavePlaylistOnExit(playlist->savePlaylistOnExit());
    28083040        pl->setPlayFilesFromStart(playlist->playFilesFromStart());
     3041
    28093042
    28103043        pref_dialog->show();
     
    28173050        bool need_update_language = false;
    28183051
     3052
     3053
    28193054        pref_dialog->getData(pref);
     3055
     3056
     3057
    28203058
    28213059        // Change application font
     
    28453083                need_update_language = true;
    28463084                // Stylesheet
    2847 #if ALLOW_CHANGE_STYLESHEET
    2848                 changeStyleSheet(pref->iconset);
    2849 #endif
    2850         }
    2851 
    2852         mplayerwindow->activateMouseDragTracking(pref->move_when_dragging);
     3085                #if ALLOW_CHANGE_STYLESHEET
     3086                if (!_interface->guiChanged()) applyStyles();
     3087                #endif
     3088        }
     3089
     3090#ifdef MOUSE_GESTURES
     3091        mplayerwindow->activateMouseDragTracking(true);
     3092#else
     3093        mplayerwindow->activateMouseDragTracking(pref->drag_function == Preferences::MoveWindow);
     3094#endif
    28533095        mplayerwindow->delayLeftClick(pref->delay_left_click);
    28543096
     
    28813123                mplayerwindow->setMonitorAspect( pref->monitor_aspect_double() );
    28823124        }
     3125
    28833126        if (advanced->lavfDemuxerChanged()) {
    28843127                core->mset.forced_demuxer = pref->use_lavf_demuxer ? "lavf" : "";
    28853128        }
     3129
    28863130
    28873131        // Update playlist preferences
     
    28913135        playlist->setSavePlaylistOnExit(pl->savePlaylistOnExit());
    28923136        playlist->setPlayFilesFromStart(pl->playFilesFromStart());
     3137
    28933138
    28943139
     
    29023147#if STYLE_SWITCHING
    29033148        if (_interface->styleChanged()) {
    2904                 qDebug( "selected style: '%s'", pref->style.toUtf8().data() );
    2905                 if ( !pref->style.isEmpty()) {
    2906                         qApp->setStyle( pref->style );
    2907                 } else {
    2908                         qDebug("setting default style: '%s'", default_style.toUtf8().data() );
    2909                         qApp->setStyle( default_style );
    2910                 }
     3149                applyStyles();
    29113150        }
    29123151#endif
     
    29343173#endif
    29353174        }
     3175
     3176
     3177
     3178
     3179
     3180
     3181
     3182
     3183
     3184
    29363185}
    29373186
     
    29523201
    29533202void BaseGui::setDataToFileProperties() {
     3203
     3204
     3205
     3206
     3207
    29543208        // Save a copy of the original values
    29553209        if (core->mset.original_demuxer.isEmpty())
     
    29743228        file_dialog->setAudioCodec(ac, core->mset.original_audio_codec);
    29753229        file_dialog->setVideoCodec(vc, core->mset.original_video_codec);
     3230
    29763231
    29773232        file_dialog->setMplayerAdditionalArguments( core->mset.mplayer_additional_options );
     
    29863241
    29873242        bool need_restart = false;
    2988         bool demuxer_changed = false;
    29893243
    29903244#undef TEST_AND_SET
    29913245#define TEST_AND_SET( Pref, Dialog ) \
    29923246        if ( Pref != Dialog ) { Pref = Dialog; need_restart = true; }
     3247
     3248
     3249
    29933250
    29943251        QString prev_demuxer = core->mset.forced_demuxer;
     
    30123269        if (vc == core->mset.original_video_codec) vc="";
    30133270        TEST_AND_SET(core->mset.forced_video_codec, vc);
     3271
    30143272
    30153273        TEST_AND_SET(core->mset.mplayer_additional_options, file_dialog->mplayerAdditionalArguments());
     
    30173275        TEST_AND_SET(core->mset.mplayer_additional_audio_filters, file_dialog->mplayerAdditionalAudioFilters());
    30183276
     3277
    30193278        // Restart the video to apply
    30203279        if (need_restart) {
     
    30253284                }
    30263285        }
     3286
    30273287}
    30283288
    30293289
    30303290void BaseGui::updateMediaInfo() {
    3031     qDebug("BaseGui::updateMediaInfo");
     3291qDebug("BaseGui::updateMediaInfo");
    30323292
    30333293        if (file_dialog) {
     
    31463406
    31473407void BaseGui::showMplayerLog() {
    3148     qDebug("BaseGui::showMplayerLog");
     3408qDebug("BaseGui::showMplayerLog");
    31493409
    31503410        exitFullscreenIfNeeded();
    31513411
    3152     mplayer_log_window->setText( mplayer_log );
     3412mplayer_log_window->setText( mplayer_log );
    31533413        mplayer_log_window->show();
    31543414}
     
    31933453                a->setData(n);
    31943454        }
    3195         subtitlestrack_menu->addActions( subtitleTrackGroup->actions() );
     3455        subtitles_track_menu->addActions( subtitleTrackGroup->actions() );
     3456
     3457#ifdef MPV_SUPPORT
     3458        // Secondary Subtitles
     3459        secondarySubtitleTrackGroup->clear(true);
     3460        QAction * subSecNoneAct = secondarySubtitleTrackGroup->addAction( tr("&None") );
     3461        subSecNoneAct->setData(MediaSettings::SubNone);
     3462        subSecNoneAct->setCheckable(true);
     3463        for (n=0; n < core->mdat.subs.numItems(); n++) {
     3464                QAction *a = new QAction(secondarySubtitleTrackGroup);
     3465                a->setCheckable(true);
     3466                a->setText(core->mdat.subs.itemAt(n).displayName());
     3467                a->setData(n);
     3468        }
     3469        secondary_subtitles_track_menu->addActions( secondarySubtitleTrackGroup->actions() );
     3470#endif
    31963471
    31973472        // Audio
     
    32673542        // Chapters
    32683543        chapterGroup->clear(true);
     3544
    32693545        if (core->mdat.chapters.numItems() > 0) {
    32703546                for (n=0; n < core->mdat.chapters.numItems(); n++) {
    32713547                        QAction *a = new QAction(chapterGroup);
    32723548                        //a->setCheckable(true);
     3549
    32733550                        a->setText(core->mdat.chapters.itemAt(n).name());
    32743551                        a->setData(core->mdat.chapters.itemAt(n).ID());
     
    33093586        }
    33103587        angles_menu->addActions( angleGroup->actions() );
    3311 }
     3588
     3589#ifdef BOOKMARKS
     3590        updateBookmarks();
     3591#endif
     3592}
     3593
     3594#ifdef BOOKMARKS
     3595void BaseGui::updateBookmarks() {
     3596        qDebug("BaseGui::updateBookmarks");
     3597
     3598        // Bookmarks
     3599        bookmarkGroup->clear(true);
     3600        int n_bookmarks = core->mset.bookmarks.size();
     3601        if (n_bookmarks > 0) {
     3602                QMap<int, QString>::const_iterator i = core->mset.bookmarks.constBegin();
     3603                while (i != core->mset.bookmarks.constEnd()) {
     3604                        QString name = i.value();
     3605                        int time = i.key();
     3606                        QAction *a = new QAction(bookmarkGroup);
     3607                        QString text;
     3608                        if (name.isEmpty()) {
     3609                                text = Helper::formatTime(time);
     3610                        } else {
     3611                                text = QString("%1 (%2)").arg(name).arg(Helper::formatTime(time));
     3612                        }
     3613                        a->setCheckable(false);
     3614                        a->setText(text);
     3615                        a->setData(time);
     3616                        i++;
     3617                }
     3618        }
     3619        bookmark_menu->clear();
     3620        bookmark_menu->addAction(addBookmarkAct);
     3621        bookmark_menu->addAction(editBookmarksAct);
     3622        bookmark_menu->addSeparator();
     3623        bookmark_menu->addActions(bookmarkGroup->actions());
     3624}
     3625#endif
    33123626
    33133627void BaseGui::updateRecents() {
    33143628        qDebug("BaseGui::updateRecents");
    33153629
    3316         // Not clear the first 2 items
    3317         while (recentfiles_menu->actions().count() > 2) {
    3318                 QAction * a = recentfiles_menu->actions()[2];
    3319                 recentfiles_menu->removeAction( a );
    3320                 a->deleteLater();
    3321         }
     3630        recentfiles_menu->clear();
    33223631
    33233632        int current_items = 0;
     
    33543663
    33553664        recentfiles_menu->menuAction()->setVisible( current_items > 0 );
     3665
     3666
     3667
     3668
    33563669}
    33573670
     
    33733686        // Subtitles menu
    33743687        subtitleTrackGroup->setChecked( core->mset.current_sub_id );
     3688
     3689
     3690
     3691
     3692
    33753693
    33763694        // Disable the unload subs action if there's no external subtitles
     
    34163734        titleGroup->setChecked( core->mset.current_title_id );
    34173735
    3418         // Chapters
    3419         chapterGroup->setChecked( core->mset.current_chapter_id );
    3420 
    34213736        // Angles
    34223737        angleGroup->setChecked( core->mset.current_angle_id );
     
    34773792        muteAct->setChecked( (pref->global_volume ? pref->mute : core->mset.mute) );
    34783793
     3794
    34793795        // Karaoke menu option
    34803796        karaokeAct->setChecked( core->mset.karaoke_filter );
     3797
    34813798
    34823799        // Extrastereo menu option
     
    35263843        mirrorAct->setChecked( core->mset.mirror );
    35273844
    3528         // Use ass lib
    3529         useAssAct->setChecked( pref->use_ass_subtitles );
     3845        // Use
     3846        useles );
    35303847
    35313848        // Forced subs
     
    35503867        decSubStepAct->setEnabled(e);
    35513868        incSubStepAct->setEnabled(e);
     3869
     3870
     3871
     3872
    35523873}
    35533874
     
    36423963                playlist->load_pls(file);
    36433964        }
    3644         else
     3965        else
     3966        if (extension=="xspf") {
     3967                playlist->loadXSPF(file);
     3968        }
     3969        else
    36453970        if (QFileInfo(file).isDir()) {
    36463971                openDirectory(file);
     
    37914116                }
    37924117                else
     4118
     4119
     4120
     4121
    37934122                if (extension=="iso") {
    37944123                        if (playlist->maybeSave()) {
     
    38604189                if (playlist->maybeSave()) {
    38614190#if DVDNAV_SUPPORT
    3862                         core->openDVD( DiscName::joinDVD(pref->use_dvdnav ? 0: 1, pref->dvd_device, pref->use_dvdnav) );
     4191                        int first_title = 0;
     4192                        if (!pref->use_dvdnav) first_title = core->firstDVDTitle();
     4193                        core->openDVD( DiscName::joinDVD(first_title, pref->dvd_device, pref->use_dvdnav) );
    38634194#else
    3864                         core->openDVD( DiscName::joinDVD(1, pref->dvd_device, false) );
     4195                        core->openDVD( DiscName::joinDVD(, pref->dvd_device, false) );
    38654196#endif
    38664197                }
     
    38874218        pref->last_dvd_directory = directory;
    38884219#if DVDNAV_SUPPORT
    3889         core->openDVD( DiscName::joinDVD(pref->use_dvdnav ? 0: 1, directory, pref->use_dvdnav) );
     4220        int first_title = 0;
     4221        if (!pref->use_dvdnav) first_title = core->firstDVDTitle();
     4222        core->openDVD( DiscName::joinDVD(first_title, directory, pref->use_dvdnav) );
    38904223#else
    3891         core->openDVD( DiscName::joinDVD(1, directory, false) );
     4224        core->openDVD( DiscName::joinDVD(, directory, false) );
    38924225#endif
    38934226}
     
    39004233void BaseGui::openBluRayFromFolder(QString directory) {
    39014234        pref->last_dvd_directory = directory;
    3902         core->openBluRay( DiscName::join(DiscName::BLURAY, 1, directory) );
     4235        core->openBluRay( DiscName::join(DiscName::BLURAY, , directory) );
    39034236}
    39044237
     
    39154248                configureDiscDevices();
    39164249        } else {
    3917                 core->openBluRay( DiscName::join(DiscName::BLURAY, 1, pref->bluray_device) );
     4250                core->openBluRay( DiscName::join(DiscName::BLURAY, , pref->bluray_device) );
    39184251        }
    39194252}
     
    40004333
    40014334void BaseGui::helpFirstSteps() {
    4002         QDesktopServices::openUrl(QString("http://smplayer.sourceforge.net/first-steps.php?version=%1").arg(Version::printable()));
     4335        QDesktopServices::openUrl(QString(?version=%1").arg(Version::printable()));
    40034336}
    40044337
    40054338void BaseGui::helpFAQ() {
    4006         QString url = "http://smplayer.sourceforge.net/faq.php";
     4339        QString url = ;
    40074340        /* if (!pref->language.isEmpty()) url += QString("?tr_lang=%1").arg(pref->language); */
    40084341        QDesktopServices::openUrl( QUrl(url) );
     
    40194352
    40204353void BaseGui::helpCheckUpdates() {
    4021         QString url = "http://smplayer.sourceforge.net/changes.php";
    4022         /* if (!pref->language.isEmpty()) url += QString("?tr_lang=%1").arg(pref->language); */
     4354#ifdef UPDATE_CHECKER
     4355        update_checker->check();
     4356#else
     4357        QString url = QString(URL_CHANGES "?version=%1").arg(Version::with_revision());
    40234358        QDesktopServices::openUrl( QUrl(url) );
     4359
    40244360}
    40254361
     
    40284364}
    40294365
    4030 #ifdef REMINDER_ACTIONS
     4366#ifdef _ACTIONS
    40314367void BaseGui::helpDonate() {
    40324368        ShareDialog d(this);
    40334369        d.showRemindCheck(false);
     4370
     4371
     4372
     4373
     4374
    40344375        d.exec();
    40354376        int action = d.actions();
     
    40374378
    40384379        if (action > 0) {
     4380
     4381
     4382
    40394383                QSettings * set = Global::settings;
    40404384                set->beginGroup("reminder");
    40414385                set->setValue("action", action);
    40424386                set->endGroup();
     4387
    40434388        }
    40444389}
     
    40534398void BaseGui::shareSMPlayer() {
    40544399        QString text = QString("SMPlayer - Free Media Player with built-in codecs that can play and download Youtube videos").replace(" ","+");
    4055         QString url = "http://smplayer.sourceforge.net";
     4400        QString url = ;
    40564401
    40574402        if (sender() == twitterAct) {
     
    40744419                QDesktopServices::openUrl(QUrl("http://www.facebook.com/sharer.php?u=" + url + "&t=" + text));
    40754420
    4076                 #ifdef REMINDER_ACTIONS
     4421                #ifdef _ACTIONS
    40774422                QSettings * set = Global::settings;
    40784423                set->beginGroup("reminder");
     
    41274472}
    41284473
     4474
     4475
     4476
     4477
     4478
     4479
     4480
     4481
     4482
     4483
     4484
     4485
     4486
     4487
     4488
     4489
     4490
     4491
     4492
     4493
     4494
     4495
     4496
     4497
     4498
     4499
     4500
     4501
     4502
     4503
     4504
    41294505void BaseGui::exitFullscreen() {
    41304506        if (pref->fullscreen) {
     
    41524528        // If using mplayer window
    41534529        if (pref->use_mplayer_window) {
    4154                 core->tellmp("vo_fullscreen " + QString::number(b) );
     4530                core->);
    41554531                updateWidgets();
    41564532                return;
     
    42014577        (!core->mset.add_letterbox))
    42024578        {
    4203                 core->restart();
     4579                core->changeLetterboxOnFullscreen(b);
     4580                /* core->restart(); */
    42044581        }
    42054582
     
    42094586
    42104587void BaseGui::aboutToEnterFullscreen() {
     4588
     4589
     4590
     4591
    42114592        if (!pref->compact_mode) {
    42124593                menuBar()->hide();
     
    42194600                menuBar()->show();
    42204601                statusBar()->show();
     4602
     4603
     4604
     4605
     4606
     4607
     4608
    42214609        }
    42224610}
     
    44044792#endif
    44054793
    4406 #ifdef UPDATE_CHECKER
    4407 void BaseGui::reportNewVersionAvailable(QString new_version) {
    4408         QMessageBox::StandardButton button = QMessageBox::information(this, tr("New version available"),
    4409                 tr("A new version of SMPlayer is available.") + "<br><br>" +
    4410                 tr("Installed version: %1").arg(Version::with_revision()) + "<br>" +
    4411                 tr("Available version: %1").arg(new_version) + "<br><br>" +
    4412                 tr("Would you like to know more about this new version?"),
    4413                 QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
    4414 
    4415         if (button == QMessageBox::Yes) {
    4416                 QDesktopServices::openUrl(QUrl("http://smplayer.sourceforge.net/changes.php"));
    4417         }
    4418 
    4419         update_checker->saveVersion(new_version);
    4420 }
    4421 #endif
    4422 
    44234794#ifdef CHECK_UPGRADED
    44244795void BaseGui::checkIfUpgraded() {
     
    44354806                os = "linux";
    44364807                #endif
    4437                 QDesktopServices::openUrl(QString("http://smplayer.sourceforge.net/thank-you.php?version=%1&so=%2").arg(Version::printable()).arg(os));
     4808                QDesktopServices::openUrl(QString(?version=%1&so=%2").arg(Version::printable()).arg(os));
    44384809        }
    44394810        pref->smplayer_stable_version = Version::stable();
     
    44414812#endif
    44424813
    4443 #ifdef REMINDER_ACTIONS
     4814#if
    44444815void BaseGui::checkReminder() {
    44454816        qDebug("BaseGui::checkReminder");
     
    44864857
    44874858#ifdef YOUTUBE_SUPPORT
     4859
     4860
     4861
     4862
     4863
     4864
     4865
     4866
     4867
    44884868void BaseGui::YTNoSignature(const QString & title) {
    44894869        qDebug("BaseGui::YTNoSignature: %s", title.toUtf8().constData());
     
    44994879        }
    45004880
    4501         #ifdef YT_USE_SCRIPT
     4881        #ifdef YT_USE_
    45024882        int ret = QMessageBox::question(this, tr("Problems with Youtube"),
    45034883                                info_text + "<br><br>" +
     
    45144894}
    45154895
    4516 #ifdef YT_USE_SCRIPT
     4896#ifdef YT_USE_
    45174897void BaseGui::YTUpdateScript() {
    45184898        static CodeDownloader * downloader = 0;
     
    45204900        downloader->saveAs(Paths::configPath() + "/yt.js");
    45214901        downloader->show();
    4522         downloader->download(QUrl("http://updates.smplayer.info/yt.js"));
    4523 }
    4524 #endif // YT_USE_SCRIPT
     4902        downloader->download(QUrl());
     4903}
     4904#endif // YT_USE_
    45254905#endif //YOUTUBE_SUPPORT
    45264906
    45274907void BaseGui::gotForbidden() {
    45284908        qDebug("BaseGui::gotForbidden");
     4909
     4910
     4911
     4912
     4913
     4914
    45294915        static bool busy = false;
    45304916
     
    47255111
    47265112void BaseGui::displayState(Core::State state) {
    4727         qDebug("BaseGui::displayState: %s", core->stateToString().toUtf8().data());
     5113        qDebug() << "BaseGui::displayState:" << core->stateToString();
     5114
    47285115        switch (state) {
    4729                 case Core::Playing:     statusBar()->showMessage( tr("Playing %1").arg(core->mdat.filename), 2000); break;
     5116                //case Core::Playing:   statusBar()->showMessage( tr("Playing %1").arg(core->mdat.filename), 2000); break;
     5117                case Core::Playing:     statusBar()->showMessage(""); break;
    47305118                case Core::Paused:      statusBar()->showMessage( tr("Pause") ); break;
    47315119                case Core::Stopped:     statusBar()->showMessage( tr("Stop") , 2000); break;
    4732         }
     5120                case Core::Buffering: /* statusBar()->showMessage(tr("Buffering...")); */ break;
     5121        }
     5122
    47335123        if (state == Core::Stopped) setWindowCaption( "SMPlayer" );
    47345124
     
    48355225#endif
    48365226
     5227
     5228
     5229
     5230
     5231
     5232
     5233
     5234
     5235
     5236
     5237
     5238
     5239
     5240
     5241
     5242
     5243
     5244
     5245
     5246
     5247
    48375248        resize(new_width, new_height);
    48385249
     
    48425253           panel->size().height() );
    48435254        qDebug("BaseGui::resizeWindow: done: mplayerwindow->size: %d, %d",
    4844            mplayerwindow->size().width(), 
     5255           mplayerwindow->size().width(),
    48455256           mplayerwindow->size().height() );
     5257
     5258
     5259
     5260
     5261
     5262
     5263
     5264
     5265
     5266
     5267
     5268
     5269
     5270
     5271
     5272
    48465273}
    48475274
     
    48515278        if (panel->isVisible()) {
    48525279                // Exit from fullscreen mode
    4853             if (pref->fullscreen) { toggleFullscreen(false); update(); }
     5280        if (pref->fullscreen) { toggleFullscreen(false); update(); }
    48545281
    48555282                // Exit from compact mode first
     
    48645291                // Disable compact mode
    48655292                //compactAct->setEnabled(false);
     5293
     5294
     5295
     5296
     5297
     5298
     5299
     5300
     5301
     5302
     5303
     5304
    48665305        }
    48675306}
     
    49745413void BaseGui::checkStayOnTop(Core::State state) {
    49755414        qDebug("BaseGui::checkStayOnTop");
    4976     if ((!pref->fullscreen) && (pref->stay_on_top == Preferences::WhilePlayingOnTop)) {
     5415if ((!pref->fullscreen) && (pref->stay_on_top == Preferences::WhilePlayingOnTop)) {
    49775416                setStayOnTop((state == Core::Playing));
    49785417        }
     
    49975436
    49985437#if ALLOW_CHANGE_STYLESHEET
    4999 void BaseGui::loadQss(QString filename) {
     5438QString BaseGui::loadQss(QString filename) {
     5439        qDebug("BaseGui::loadQss: %s", filename.toUtf8().constData());
     5440
    50005441        QFile file( filename );
    50015442        file.open(QFile::ReadOnly);
    5002         QString styleSheet = QLatin1String(file.readAll());
     5443        QString styleheet = QLatin1String(file.readAll());
    50035444
    50045445#ifdef USE_RESOURCES
    50055446        Images::setTheme(pref->iconset);
    5006         QString path = ":/" + pref->iconset;
     5447        QString path;
     5448        if (Images::has_rcc) {
     5449                path = ":/" + pref->iconset;
     5450        } else {
     5451                QDir current = QDir::current();
     5452                QString td = Images::themesDirectory();
     5453                path = current.relativeFilePath(td);
     5454        }
    50075455#else
    50085456        QDir current = QDir::current();
     
    50105458        QString path = current.relativeFilePath(td);
    50115459#endif
    5012         styleSheet.replace(QRegExp("url\\s*\\(\\s*([^\\);]+)\\s*\\)", Qt::CaseSensitive, QRegExp::RegExp2),
     5460        styleheet.replace(QRegExp("url\\s*\\(\\s*([^\\);]+)\\s*\\)", Qt::CaseSensitive, QRegExp::RegExp2),
    50135461                                                QString("url(%1\\1)").arg(path + "/"));
    5014         //qDebug("BaseGui::loadQss: styeSheet: %s", styleSheet.toUtf8().constData());
    5015         qApp->setStyleSheet(styleSheet);
     5462        //qDebug("BaseGui::loadQss: styheet.toUtf8().constData());
     5463        ;
    50165464}
    50175465
    50185466void BaseGui::changeStyleSheet(QString style) {
    5019         if (style.isEmpty())  {
    5020                 qApp->setStyleSheet("");
    5021         }
    5022         else {
    5023                 QString qss_file = Paths::configPath() + "/themes/" + pref->iconset +"/style.qss";
    5024                 //qDebug("BaseGui::changeStyleSheet: '%s'", qss_file.toUtf8().data());
     5467        qDebug("BaseGui::changeStyleSheet: %s", style.toUtf8().constData());
     5468
     5469        // Load default stylesheet
     5470        QString stylesheet = loadQss(":/default-theme/style.qss");
     5471
     5472        if (!style.isEmpty()) {
     5473                // Check main.css
     5474                QString qss_file = Paths::configPath() + "/themes/" + pref->iconset + "/main.css";
    50255475                if (!QFile::exists(qss_file)) {
    5026                         qss_file = Paths::themesPath() +"/"+ pref->iconset +"/style.qss";
    5027                 }
     5476                        qss_file = Paths::themesPath() +"/"+ pref->iconset + "/main.css";
     5477                }
     5478
     5479                // Check style.qss
     5480                if (!QFile::exists(qss_file)) {
     5481                        qss_file = Paths::configPath() + "/themes/" + pref->iconset + "/style.qss";
     5482                        if (!QFile::exists(qss_file)) {
     5483                                qss_file = Paths::themesPath() +"/"+ pref->iconset + "/style.qss";
     5484                        }
     5485                }
     5486
     5487                // Load style file
    50285488                if (QFile::exists(qss_file)) {
    50295489                        qDebug("BaseGui::changeStyleSheet: '%s'", qss_file.toUtf8().data());
    5030                         loadQss(qss_file);
    5031                 } else {
    5032                         qApp->setStyleSheet("");
    5033                 }
    5034         }
    5035 }
    5036 #endif
     5490                        stylesheet += loadQss(qss_file);
     5491                }
     5492        }
     5493
     5494        //qDebug("BaseGui::changeStyleSheet: styleSheet: %s", stylesheet.toUtf8().constData());
     5495        qApp->setStyleSheet(stylesheet);
     5496}
     5497#endif
     5498
     5499void BaseGui::applyStyles() {
     5500        qDebug("BaseGui::applyStyles");
     5501
     5502#if ALLOW_CHANGE_STYLESHEET
     5503        qDebug() << "BaseGui::applyStyles: stylesheet:" << pref->iconset;
     5504        changeStyleSheet(pref->iconset);
     5505#endif
     5506
     5507#if STYLE_SWITCHING
     5508        QString style = pref->style;
     5509        if (style.isEmpty()) style = default_style;
     5510        qDebug() << "BaseGui::applyStyles: style:" << style;
     5511        if (!style.isEmpty()) qApp->setStyle(style);
     5512#endif
     5513
     5514}
    50375515
    50385516void BaseGui::loadActions() {
     
    50585536}
    50595537
     5538
     5539
     5540
     5541
     5542
     5543
     5544
     5545
     5546
     5547
     5548
     5549
     5550
     5551
     5552
     5553
     5554
     5555
     5556
     5557
     5558
     5559
     5560
     5561
     5562
     5563
     5564
     5565
     5566
     5567
     5568
     5569
     5570
     5571
     5572
     5573
     5574
     5575
     5576
     5577
     5578
     5579
     5580
     5581
     5582
     5583
     5584
     5585
     5586
     5587
     5588
     5589
     5590
     5591
     5592
     5593
     5594
     5595
     5596
     5597
     5598
     5599
     5600
     5601
     5602
     5603
     5604
     5605
    50605606void BaseGui::moveWindowDiff(QPoint diff) {
     5607
     5608
    50615609        if (pref->fullscreen || isMaximized()) {
    50625610                return;
     
    50895637}
    50905638
     5639
     5640
     5641
     5642
     5643
     5644
     5645
     5646
     5647
     5648
     5649
     5650
    50915651void BaseGui::showEvent( QShowEvent * ) {
    50925652        qDebug("BaseGui::showEvent");
     
    51125672        }
    51135673}
     5674
     5675
     5676
     5677
     5678
     5679
     5680
     5681
     5682
     5683
     5684
     5685
     5686
     5687
     5688
     5689
     5690
     5691
     5692
     5693
     5694
     5695
     5696
     5697
     5698
     5699
     5700
     5701
     5702
     5703
     5704
     5705
     5706
     5707
     5708
    51145709
    51155710void BaseGui::askForMplayerVersion(QString line) {
     
    51395734        if (exit_code != 255 ) {
    51405735                ErrorDialog d(this);
    5141                 d.setText(tr("MPlayer has finished unexpectedly.") + " " +
     5736                d.setWindowTitle(tr("%1 Error").arg(PLAYER_NAME));
     5737                d.setText(tr("%1 has finished unexpectedly.").arg(PLAYER_NAME) + " " +
    51425738                      tr("Exit code: %1").arg(exit_code));
    51435739#ifdef LOG_MPLAYER
     
    51525748
    51535749        if (!pref->report_mplayer_crashes) {
    5154                 qDebug("showErrorFromMplayer: not displaying error dialog");
     5750                qDebug("showErrorFromMplayer: not displaying error dialog");
    51555751                return;
    51565752        }
     
    51585754        if ((e == QProcess::FailedToStart) || (e == QProcess::Crashed)) {
    51595755                ErrorDialog d(this);
     5756
    51605757                if (e == QProcess::FailedToStart) {
    5161                         d.setText(tr("MPlayer failed to start.") + " " +
    5162                          tr("Please check the MPlayer path in preferences."));
     5758                        d.setText(tr(") + " " +
     5759                         tr("Please check the ));
    51635760                } else {
    5164                         d.setText(tr("MPlayer has crashed.") + " " +
     5761                        d.setText(tr(") + " " +
    51655762                      tr("See the log for more info."));
    51665763                }
     
    52365833void BaseGui::showTubeBrowser() {
    52375834        qDebug("BaseGui::showTubeBrowser");
    5238         QString exec = Paths::appPath() + "/smtube";
    5239         qDebug("BaseGui::showTubeBrowser: '%s'", exec.toUtf8().constData());
    5240         if (!QProcess::startDetached(exec, QStringList())) {
     5835        #ifdef Q_OS_WIN
     5836        QString exec = Paths::appPath() + "/smtube.exe";
     5837        #else
     5838        QString exec = Helper::findExecutable("smtube");
     5839        #endif
     5840
     5841        if (exec.isEmpty() || !QFile::exists(exec)) {
    52415842                QMessageBox::warning(this, "SMPlayer",
    5242                         tr("The YouTube Browser couldn't be launched.") +"<br>"+
    5243                         tr("Be sure %1 is installed.").arg("SMTube"));
     5843                        tr("The YouTube Browser is not installed.") +"<br>"+
     5844                        tr("Visit %1 to get it.").arg("<a href=http://www.smtube.org>http://www.smtube.org</a>"));
     5845                return;
     5846        }
     5847
     5848        QStringList args;
     5849        if (!pref->language.isEmpty()) args << "-lang" << pref->language;
     5850        qDebug() << "BaseGui::showTubeBrowser: exec:" << exec << "args:" << args;
     5851
     5852        if (!QProcess::startDetached(exec, args)) {
     5853                QMessageBox::warning(this, "SMPlayer",
     5854                        tr("The YouTube Browser failed to run.") +"<br>"+
     5855                        tr("Be sure it's installed correctly.") +"<br>"+
     5856                        tr("Visit %1 to get it.").arg("<a href=http://www.smtube.org>http://www.smtube.org</a>"));
    52445857        }
    52455858}
Note: See TracChangeset for help on using the changeset viewer.