Ticket #12689: Revert-20b621e5733-MediaMon-UI-to-select-preferred-m.patch

File Revert-20b621e5733-MediaMon-UI-to-select-preferred-m.patch, 6.9 KB (added by Roger Siddons, 4 years ago)
  • mythplugins/mythgallery/mythgallery/main.cpp

    From 902aac39ac181dc88554819b67dccbf9abd98dc7 Mon Sep 17 00:00:00 2001
    From: Roger Siddons <rsiddons@mythtv.org>
    Date: Mon, 11 Apr 2016 12:27:42 +0100
    Subject: [PATCH] Revert 20b621e5733 MediaMon: UI to select preferred media
     handler
    
    The pop-ups don't cater for multiple media, nor respect the autoplay settings
    
    Fixes #12689
    
    diff --git a/mythplugins/mythgallery/mythgallery/main.cpp b/mythplugins/mythgallery/mythgallery/main.cpp
    index 3237dfe..3aab56b 100644
    a b static void setupKeys(void) 
    137137        "Mark image"), "T");
    138138    REG_KEY("Gallery", "FULLSCREEN", QT_TRANSLATE_NOOP("MythControls",
    139139        "Toggle scale to fullscreen/scale to fit"), "W");
    140     REG_MEDIA_HANDLER(
    141         QT_TRANSLATE_NOOP("MythControls", "MythGallery Media Handler 1/3"),
    142         QT_TRANSLATE_NOOP("MythControls", "MythGallery mixed data"),
    143         "", handleMedia, MEDIATYPE_DATA | MEDIATYPE_MIXED, QString::null);
     140    REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
     141        "MythGallery Media Handler 1/3"), "", "", handleMedia,
     142        MEDIATYPE_DATA | MEDIATYPE_MIXED, QString::null);
    144143    QString filt;
    145144    Q_FOREACH(QString format, GalleryUtil::GetImageFilter())
    146145    {
    static void setupKeys(void) 
    150149        else
    151150            filt += "," + format;
    152151    }
    153     REG_MEDIA_HANDLER(
    154         QT_TRANSLATE_NOOP("MythControls", "MythGallery Media Handler 2/3"),
    155         QT_TRANSLATE_NOOP("MythControls", "MythGallery images"),
    156         "", handleMedia, MEDIATYPE_MGALLERY, filt);
     152    REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
     153        "MythGallery Media Handler 2/3"), "", "", handleMedia,
     154        MEDIATYPE_MGALLERY, filt);
    157155    filt.clear();
    158156    Q_FOREACH(QString format, GalleryUtil::GetMovieFilter())
    159157    {
    static void setupKeys(void) 
    163161        else
    164162            filt += "," + format;
    165163    }
    166     REG_MEDIA_HANDLER(
    167         QT_TRANSLATE_NOOP("MythControls", "MythGallery Media Handler 3/3"),
    168         QT_TRANSLATE_NOOP("MythControls", "MythGallery movies"),
    169         "", handleMedia, MEDIATYPE_MVIDEO, filt);
     164    REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
     165        "MythGallery Media Handler 3/3"), "", "", handleMedia,
     166        MEDIATYPE_MVIDEO, filt);
    170167}
    171168
    172169int mythplugin_init(const char *libversion)
  • mythplugins/mythmusic/mythmusic/main.cpp

    diff --git a/mythplugins/mythmusic/mythmusic/main.cpp b/mythplugins/mythmusic/mythmusic/main.cpp
    index 0460f0c..ec54f5d 100644
    a b static void setupKeys(void) 
    868868    REG_KEY("Music", "SWITCHTORADIO",                 QT_TRANSLATE_NOOP("MythControls",
    869869        "Switch to the radio stream view"), "");
    870870
    871     REG_MEDIA_HANDLER(
    872         QT_TRANSLATE_NOOP("MythControls", "MythMusic Media Handler 1/2"),
    873         QT_TRANSLATE_NOOP("MythControls", "MythMusic audio CD"),
    874         "", handleCDMedia, MEDIATYPE_AUDIO | MEDIATYPE_MIXED, QString::null);
     871    REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
     872        "MythMusic Media Handler 1/2"), "", "", handleCDMedia,
     873        MEDIATYPE_AUDIO | MEDIATYPE_MIXED, QString::null);
    875874    QString filt = MetaIO::ValidFileExtensions;
    876875    filt.replace('|',',');
    877876    filt.remove('.');
    878     REG_MEDIA_HANDLER(
    879         QT_TRANSLATE_NOOP("MythControls", "MythMusic Media Handler 2/2"),
    880         QT_TRANSLATE_NOOP("MythControls", "MythMusic audio files"),
    881          "", handleMedia, MEDIATYPE_MMUSIC, filt);
     877    REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
     878        "MythMusic Media Handler 2/2"), "", "", handleMedia,
     879        MEDIATYPE_MMUSIC, filt);
    882880}
    883881
    884882int mythplugin_init(const char *libversion)
  • mythtv/libs/libmyth/mythmediamonitor.cpp

    diff --git a/mythtv/libs/libmyth/mythmediamonitor.cpp b/mythtv/libs/libmyth/mythmediamonitor.cpp
    index 1eee655..f459dfe 100644
    a b void MediaMonitor::JumpToMediaHandler(MythMediaDevice* pMedia) 
    664664        return;
    665665    }
    666666
    667     int selected = 0;
    668     if (handlers.size() > 1)
    669     {
    670         QStringList buttonmsgs;
    671         for (QList<MHData>::const_iterator it = handlers.begin(); it != handlers.end(); ++it)
    672             buttonmsgs << ((!it->description.isEmpty()) ? it->description : it->destination);
    673         buttonmsgs << tr("Cancel");
    674 
    675         const DialogCode cancelbtn = DialogCode(
    676             int(kDialogCodeButton0) + buttonmsgs.size() - 1);
    677 
    678         DialogCode ret = MythPopupBox::ShowButtonPopup(GetMythMainWindow(),
    679                                 tr("Media Handler Selection"),
    680                                 tr("The new media contains mixed content "
    681                                    "that can be rendered in different ways. "
    682                                    "Select your preferred method."),
    683                                 buttonmsgs, cancelbtn);
    684         if (kDialogCodeRejected == ret || cancelbtn == ret)
    685         {
    686             LOG(VB_MEDIA, LOG_INFO, "User cancelled media handler selection");
    687             return;
    688         }
    689667
    690         selected = MythDialog::CalcItemIndex(ret);
    691         LOG(VB_MEDIA, LOG_NOTICE, QString("User selected '%1'")
    692             .arg(handlers.at(selected).destination) );
    693     }
     668    // TODO - Generate a dialog, add buttons for each description,
     669    // if user didn't cancel, selected = handlers.at(choice);
     670    int selected = 0;
    694671
    695672    handlers.at(selected).callback(pMedia);
    696673}
  • mythtv/libs/libmythbase/mythmedia.cpp

    diff --git a/mythtv/libs/libmythbase/mythmedia.cpp b/mythtv/libs/libmythbase/mythmedia.cpp
    index 527c7af..9f5da10 100644
    a b MythMediaType MythMediaDevice::DetectMediaType(void) 
    237237        else
    238238        {
    239239            LOG(VB_MEDIA, LOG_NOTICE, QString(
    240                     "DetectMediaType(this=0x%1) unknown file type %2")
     240                    "DetectMediaType(this=0x%1) unknown file type %1")
    241241                .arg(quintptr(this),0,16).arg(it.key()));
    242242        }
    243243    }
  • mythtv/programs/mythfrontend/main.cpp

    diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp
    index f8d7dd1..b6ca85e 100644
    a b static int internal_media_init() 
    15291529{
    15301530    REG_MEDIAPLAYER("Internal", QT_TRANSLATE_NOOP("MythControls",
    15311531        "MythTV's native media player."), internal_play_media);
    1532 
    1533     REG_MEDIA_HANDLER(
    1534         QT_TRANSLATE_NOOP("MythControls", "MythDVD DVD Media Handler"),
    1535         QT_TRANSLATE_NOOP("MythControls", "MythDVD media"),
    1536         "", handleDVDMedia, MEDIATYPE_DVD, QString::null);
    1537 
     1532    REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
     1533        "MythDVD DVD Media Handler"), "", "", handleDVDMedia,
     1534        MEDIATYPE_DVD, QString::null);
    15381535    REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
    15391536        "MythImage Media Handler 1/2"), "", "", handleGalleryMedia,
    15401537        MEDIATYPE_DATA | MEDIATYPE_MIXED, QString::null);