Ignore:
Timestamp:
Dec 22, 2011, 6:27:52 PM (14 years ago)
Author:
Silvan Scherrer
Message:

smplayer vendor udate

File:
1 edited

Legend:

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

    r90 r118  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2010 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
     
    8585#include "prefinput.h"
    8686#include "prefadvanced.h"
     87
    8788
    8889#include "myaction.h"
    8990#include "myactiongroup.h"
     91
    9092
    9193#include "constants.h"
     
    9597#ifdef Q_OS_WIN
    9698#include "deviceinfo.h"
     99
    97100#endif
    98101
     
    104107                near_bottom(false)
    105108{
    106 #ifdef Q_OS_WIN
     109#if
    107110        /* Disable screensaver by event */
    108111        just_stopped = false;
     
    208211        connect(server, SIGNAL(receivedLoadSubtitle(QString)), 
    209212            this, SLOT(remoteLoadSubtitle(QString)));
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
     223
     224
     225
     226
     227
     228
     229
     230
     231
     232
    210233
    211234        if (pref->use_single_instance) {
     
    222245}
    223246
     247
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
     258
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
     269
     270
     271
     272
     273
     274
     275
     276
     277
     278
     279
     280
     281
     282
     283
     284
     285
    224286void BaseGui::remoteOpen(QString file) {
    225287        qDebug("BaseGui::remoteOpen: '%s'", file.toUtf8().data());
     
    259321                core->loadSub(file);
    260322        }
     323
     324
     325
     326
     327
     328
     329
     330
     331
     332
     333
     334
     335
     336
     337
     338
     339
     340
     341
     342
     343
     344
     345
     346
     347
     348
     349
     350
     351
     352
     353
     354
     355
     356
     357
     358
     359
     360
     361
     362
     363
     364
     365
     366
     367
     368
     369
     370
     371
    261372}
    262373
     
    512623             core, SLOT(toggleMirror(bool)) );
    513624
    514         motionVectorsAct = new MyAction( this, "motion_vectors" );
    515         motionVectorsAct->setCheckable( true );
    516         connect( motionVectorsAct, SIGNAL(toggled(bool)),
    517              core, SLOT(visualizeMotionVectors(bool)) );
    518 
    519625
    520626        // Submenu filter
     
    670776        connect( useAssAct, SIGNAL(toggled(bool)), core, SLOT(changeUseAss(bool)) );
    671777
    672         useClosedCaptionAct = new MyAction(this, "use_closed_caption");
    673         useClosedCaptionAct->setCheckable(true);
    674         connect( useClosedCaptionAct, SIGNAL(toggled(bool)), core, SLOT(toggleClosedCaption(bool)) );
    675 
    676778        useForcedSubsOnlyAct = new MyAction(this, "use_forced_subs_only");
    677779        useForcedSubsOnlyAct->setCheckable(true);
     
    726828        connect( showTipsAct, SIGNAL(triggered()),
    727829             this, SLOT(helpTips()) );
     830
     831
     832
     833
    728834
    729835        aboutQtAct = new MyAction( this, "about_qt" );
     
    10261132                 core, SLOT(changeSubtitle(int)) );
    10271133
     1134
     1135
     1136
     1137
     1138
     1139
     1140
     1141
     1142
    10281143        // Titles
    10291144        titleGroup = new MyActionGroup(this);
     
    12781393#ifndef Q_OS_WIN
    12791394        // Disable video filters if using vdpau
    1280         if ((pref->disable_video_filters_with_vdpau) && (pref->vo.startsWith("vdpau"))) {
     1395        if ((pref->) && (pref->vo.startsWith("vdpau"))) {
    12811396                screenshotAct->setEnabled(false);
    12821397                screenshotsAct->setEnabled(false);
     
    14081523        flipAct->change( Images::icon("flip"), tr("Fli&p image") );
    14091524        mirrorAct->change( Images::icon("mirror"), tr("Mirr&or image") );
    1410         motionVectorsAct->change( Images::icon("motion_vectors"),
    1411                               tr("Visualize &motion vectors") );
    14121525
    14131526        decZoomAct->change( tr("Zoom &-") );
     
    14691582                           tr("N&ext line in subtitles") );
    14701583        useAssAct->change( Images::icon("use_ass_lib"), tr("Use SSA/&ASS library") );
    1471         useClosedCaptionAct->change( Images::icon("closed_caption"), tr("Enable &closed caption") );
    14721584        useForcedSubsOnlyAct->change( Images::icon("forced_subs"), tr("&Forced subtitles only") );
    14731585
     
    14761588        showFindSubtitlesDialogAct->change( Images::icon("download_subs"), tr("Find subtitles on &OpenSubtitles.org...") );
    14771589        openUploadSubtitlesPageAct->change( Images::icon("upload_subs"), tr("Upload su&btitles to OpenSubtitles.org...") );
     1590
     1591
     1592
     1593
     1594
     1595
    14781596
    14791597        // Menu Options
     
    14901608        showCLOptionsAct->change( Images::icon("cl_help"), tr("&Command line options") );
    14911609        showTipsAct->change( Images::icon("tips"), tr("&Tips") );
     1610
    14921611        aboutQtAct->change( QPixmap(":/icons-png/qt.png"), tr("About &Qt") );
    14931612        aboutThisAct->change( Images::icon("logo_small"), tr("About &SMPlayer") );
     
    16911810        subtitlestrack_menu->menuAction()->setIcon( Images::icon("sub") );
    16921811
     1812
     1813
     1814
    16931815        // Menu Browse
    16941816        titles_menu->menuAction()->setText( tr("&Title") );
     
    21812303        videoMenu->addSeparator();
    21822304        videoMenu->addAction(videoPreviewAct);
    2183         videoMenu->addSeparator();
    2184         videoMenu->addAction(motionVectorsAct);
    21852305
    21862306
     
    22412361        subtitlesMenu->addAction(unloadSubsAct);
    22422362        subtitlesMenu->addSeparator();
     2363
     2364
     2365
     2366
     2367
     2368
     2369
     2370
     2371
     2372
     2373
    22432374        subtitlesMenu->addAction(decSubDelayAct);
    22442375        subtitlesMenu->addAction(incSubDelayAct);
     
    22552386        subtitlesMenu->addAction(incSubStepAct);
    22562387        subtitlesMenu->addSeparator();
    2257         subtitlesMenu->addAction(useClosedCaptionAct);
    22582388        subtitlesMenu->addAction(useForcedSubsOnlyAct);
    22592389        subtitlesMenu->addSeparator();
     
    23292459        helpMenu->addAction(showCLOptionsAct);
    23302460        helpMenu->addAction(showTipsAct);
     2461
    23312462        helpMenu->addSeparator();
    23322463        helpMenu->addAction(aboutQtAct);
     
    24402571        pref_dialog->mod_input()->actions_editor->addActions(playlist);
    24412572#endif
     2573
     2574
     2575
     2576
     2577
     2578
     2579
     2580
    24422581        pref_dialog->show();
    24432582}
     
    25162655        }
    25172656
     2657
     2658
     2659
     2660
     2661
     2662
     2663
     2664
    25182665        if (need_update_language) {
    25192666                translator->load(pref->language);
     
    26472794        }
    26482795
    2649         setWindowCaption( core->mdat.displayName() + " - SMPlayer" );
     2796        setWindowCaption( core->mdat.displayName() + " - SMPlayer" );
    26502797
    26512798        emit videoInfoChanged(core->mdat.video_width, core->mdat.video_height, core->mdat.video_fps.toDouble());
     
    29613108        // Disable the unload subs action if there's no external subtitles
    29623109        unloadSubsAct->setEnabled( !core->mset.external_subtitles.isEmpty() );
     3110
     3111
     3112
    29633113       
    29643114        // Audio menu
     
    30843234#endif
    30853235
    3086         // Motion vectors
    3087         motionVectorsAct->setChecked( pref->show_motion_vectors );
    3088 
    30893236        // Compact mode
    30903237        compactAct->setChecked( pref->compact_mode );
     
    31023249        useAssAct->setChecked( pref->use_ass_subtitles );
    31033250
    3104         // Closed caption and forces subs
    3105         useClosedCaptionAct->setChecked( pref->use_closed_caption_subs );
     3251        // Forced subs
    31063252        useForcedSubsOnlyAct->setChecked( pref->use_forced_subs_only );
    31073253
     
    31133259              (core->mset.current_sub_id != MediaSettings::NoneSelected));
    31143260
    3115         if (pref->use_closed_caption_subs) e = true; // Enable if using closed captions
     3261        if () e = true; // Enable if using closed captions
    31163262
    31173263        decSubDelayAct->setEnabled(e);
     
    35143660
    35153661void BaseGui::helpTips() {
    3516         QDesktopServices::openUrl( QUrl("http://smplayer.berlios.de/forum/viewforum.php?f=12") );
     3662        QDesktopServices::openUrl( QUrl("http://smplayer.sf.net/forum/viewforum.php?f=12") );
     3663}
     3664
     3665void BaseGui::helpDonate() {
     3666        QMessageBox d(QMessageBox::NoIcon, tr("Donate"),
     3667                tr("If you like SMPlayer, a really good way to support it is by sending a donation, even the smallest one is highly appreciated.") + "<br>" +
     3668        tr("You can send your donation using %1.").arg("<a href=\"https://sourceforge.net/donate/index.php?group_id=185512\">"+tr("this form")),
     3669                QMessageBox::Ok, this);
     3670        d.setIconPixmap( Images::icon("logo", 64) );
     3671        d.exec();
    35173672}
    35183673
     
    36033758
    36043759                #ifdef Q_OS_WIN
    3605                 // Avoid the video to pause
    3606                 if (!pref->pause_when_hidden) hide();
     3760                // Hack to avoid the windows taskbar to be visible on Windows XP
     3761                if (QSysInfo::WindowsVersion < QSysInfo::WV_VISTA) {
     3762                        if (!pref->pause_when_hidden) hide();
     3763                }
    36073764                #endif
    36083765
     
    36103767
    36113768        } else {
    3612                 #ifdef Q_OS_WIN
    3613                 // Avoid the video to pause
    3614                 if (!pref->pause_when_hidden) hide();
    3615                 #endif
    3616 
    36173769                showNormal();
    36183770
     
    37073859        qDebug("BaseGui::processFunction: '%s'", function.toUtf8().data());
    37083860
     3861
     3862
     3863
     3864
     3865
     3866
     3867
     3868
     3869
     3870
     3871
    37093872        QAction * action = ActionsEditor::findAction(this, function);
    37103873        if (!action) action = ActionsEditor::findAction(playlist, function);
     
    37123875        if (action) {
    37133876                qDebug("BaseGui::processFunction: action found");
    3714                 if (action->isCheckable())
    3715                         //action->toggle();
     3877
     3878                if (!action->isEnabled()) {
     3879                        qDebug("BaseGui::processFunction: action is disabled, doing nothing");
     3880                        return;
     3881                }
     3882
     3883                if (action->isCheckable()){
     3884                        if(checkableFunction)
     3885                                action->setChecked(value);
     3886                        else
     3887                                //action->toggle();
     3888                                action->trigger();
     3889                }else{
    37163890                        action->trigger();
    3717                 else
    3718                         action->trigger();
     3891                }
    37193892        }
    37203893}
     
    37263899
    37273900        QAction * action;
    3728         QStringList l = actions.split(" ");
    3729 
    3730         for (int n = 0; n < l.count(); n++) {
    3731                 QString a = l[n];
    3732                 QString par = "";
    3733 
    3734                 if ( (n+1) < l.count() ) {
    3735                         if ( (l[n+1].toLower() == "true") || (l[n+1].toLower() == "false") ) {
    3736                                 par = l[n+1].toLower();
     3901        QStringList actionsList = actions.split(" ");
     3902
     3903        for (int n = 0; n < actionsList.count(); n++) {
     3904                QString actionStr = actionsList[n];
     3905                QString par = ""; //the parameter which the action takes
     3906
     3907                //set par if the next word is a boolean value
     3908                if ( (n+1) < actionsList.count() ) {
     3909                        if ( (actionsList[n+1].toLower() == "true") || (actionsList[n+1].toLower() == "false") ) {
     3910                                par = actionsList[n+1].toLower();
    37373911                                n++;
    3738                         }
    3739                 }
    3740 
    3741                 action = ActionsEditor::findAction(this, a);
    3742                 if (!action) action = ActionsEditor::findAction(playlist, a);
     3912                        }
     3913                }
     3914
     3915                action = ActionsEditor::findAction(this, a);
     3916                if (!action) action = ActionsEditor::findAction(playlist, a);
    37433917
    37443918                if (action) {
    37453919                        qDebug("BaseGui::runActions: running action: '%s' (par: '%s')",
    3746                    a.toUtf8().data(), par.toUtf8().data() );
     3920.toUtf8().data(), par.toUtf8().data() );
    37473921
    37483922                        if (action->isCheckable()) {
     
    37523926                                } else {
    37533927                                        action->setChecked( (par == "true") );
    3754                                 }
    3755                         }
    3756                         else {
     3928                                } //end if
     3929                        } else {
    37573930                                action->trigger();
    3758                         }
     3931                        }
    37593932                } else {
    3760                         qWarning("BaseGui::runActions: action: '%s' not found",a.toUtf8().data());
    3761                 }
    3762         }
     3933                        qWarning("BaseGui::runActions: action: '%s' not found",a.toUtf8().data());
     3934                }
     3935        }
    37633936}
    37643937
     
    39834156        if (state == Core::Stopped) setWindowCaption( "SMPlayer" );
    39844157
    3985 #ifdef Q_OS_WIN
     4158#if
    39864159        /* Disable screensaver by event */
    39874160        just_stopped = false;
     
    44984671        return false;
    44994672}
    4500 
     4673#endif
     4674
     4675#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    45014676void BaseGui::clear_just_stopped() {
    45024677        qDebug("BaseGui::clear_just_stopped");
Note: See TracChangeset for help on using the changeset viewer.