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) |
137 | 137 | "Mark image"), "T"); |
138 | 138 | REG_KEY("Gallery", "FULLSCREEN", QT_TRANSLATE_NOOP("MythControls", |
139 | 139 | "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); |
144 | 143 | QString filt; |
145 | 144 | Q_FOREACH(QString format, GalleryUtil::GetImageFilter()) |
146 | 145 | { |
… |
… |
static void setupKeys(void) |
150 | 149 | else |
151 | 150 | filt += "," + format; |
152 | 151 | } |
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); |
157 | 155 | filt.clear(); |
158 | 156 | Q_FOREACH(QString format, GalleryUtil::GetMovieFilter()) |
159 | 157 | { |
… |
… |
static void setupKeys(void) |
163 | 161 | else |
164 | 162 | filt += "," + format; |
165 | 163 | } |
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); |
170 | 167 | } |
171 | 168 | |
172 | 169 | int mythplugin_init(const char *libversion) |
diff --git a/mythplugins/mythmusic/mythmusic/main.cpp b/mythplugins/mythmusic/mythmusic/main.cpp
index 0460f0c..ec54f5d 100644
a
|
b
|
static void setupKeys(void) |
868 | 868 | REG_KEY("Music", "SWITCHTORADIO", QT_TRANSLATE_NOOP("MythControls", |
869 | 869 | "Switch to the radio stream view"), ""); |
870 | 870 | |
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); |
875 | 874 | QString filt = MetaIO::ValidFileExtensions; |
876 | 875 | filt.replace('|',','); |
877 | 876 | 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); |
882 | 880 | } |
883 | 881 | |
884 | 882 | int mythplugin_init(const char *libversion) |
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) |
664 | 664 | return; |
665 | 665 | } |
666 | 666 | |
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 | | } |
689 | 667 | |
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; |
694 | 671 | |
695 | 672 | handlers.at(selected).callback(pMedia); |
696 | 673 | } |
diff --git a/mythtv/libs/libmythbase/mythmedia.cpp b/mythtv/libs/libmythbase/mythmedia.cpp
index 527c7af..9f5da10 100644
a
|
b
|
MythMediaType MythMediaDevice::DetectMediaType(void) |
237 | 237 | else |
238 | 238 | { |
239 | 239 | LOG(VB_MEDIA, LOG_NOTICE, QString( |
240 | | "DetectMediaType(this=0x%1) unknown file type %2") |
| 240 | "DetectMediaType(this=0x%1) unknown file type %1") |
241 | 241 | .arg(quintptr(this),0,16).arg(it.key())); |
242 | 242 | } |
243 | 243 | } |
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() |
1529 | 1529 | { |
1530 | 1530 | REG_MEDIAPLAYER("Internal", QT_TRANSLATE_NOOP("MythControls", |
1531 | 1531 | "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); |
1538 | 1535 | REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls", |
1539 | 1536 | "MythImage Media Handler 1/2"), "", "", handleGalleryMedia, |
1540 | 1537 | MEDIATYPE_DATA | MEDIATYPE_MIXED, QString::null); |