Index: libs/libmythui/myththemedmenu.cpp
===================================================================
--- libs/libmythui/myththemedmenu.cpp	(revision 19163)
+++ libs/libmythui/myththemedmenu.cpp	(working copy)
@@ -2,6 +2,7 @@
 #include <QDir>
 #include <QKeyEvent>
 #include <QDomDocument>
+#include <QProcess>
 
 #include "myththemedmenu.h"
 #include "mythmainwindow.h"
@@ -410,41 +409,79 @@
  */
 bool MythThemedMenu::parseMenu(const QString &menuname)
 {
-    QString filename = findMenuFile(menuname);
-
     QDomDocument doc;
-    QFile f(filename);
 
-    if (!f.exists() || !f.open(QIODevice::ReadOnly))
+    if (menuname.startsWith('`'))
     {
-        VERBOSE(VB_IMPORTANT, QString("MythThemedMenu: Couldn't read "
-                                      "menu file %1").arg(menuname));
+        QString command = menuname.mid(1);
+        
+        QProcess process;
+        process.start(command);
+        if (!process.waitForFinished())
+        {
+            process.kill();
+            VERBOSE(VB_IMPORTANT,
+                    QString("Command \"%1\" returned error\n").arg(command));
+            ShowOkPopup(QObject::tr("Couldn't execute %1")
+                        .arg(command));
+            return false;
+        }
+        else
+        {
+            QString errorMsg;
+            int errorLine = 0;
+            int errorColumn = 0;
 
-        if (menuname != "mainmenu.xml")
-            ShowOkPopup(QObject::tr("Myth could not locate the menu file %1")
-                        .arg(menuname));
-        return false;
+            if (!doc.setContent(process.readAllStandardOutput(), false,
+                &errorMsg, &errorLine, &errorColumn))
+            {
+                VERBOSE(VB_IMPORTANT,
+                        QString("Error parsing output of: %1\nat line: %2  column: %3 msg: %4").
+                        arg(command).arg(errorLine).arg(errorColumn).arg(errorMsg));
+
+                ShowOkPopup(QObject::tr("Command %1 returned incomplete menu.")
+                        .arg(command));
+                return false;
+            }
+        }
     }
+    else
+    {
+        QString filename = findMenuFile(menuname);
 
-    QString errorMsg;
-    int errorLine = 0;
-    int errorColumn = 0;
+        QFile f(filename);
 
-    if (!doc.setContent(&f, false, &errorMsg, &errorLine, &errorColumn))
-    {
-        VERBOSE(VB_IMPORTANT,
-                QString("Error parsing: %1\nat line: %2  column: %3 msg: %4").
-                arg(filename).arg(errorLine).arg(errorColumn).arg(errorMsg));
+        if (!f.exists() || !f.open(QIODevice::ReadOnly))
+        {
+            VERBOSE(VB_IMPORTANT, QString("MythThemedMenu: Couldn't read "
+                                          "menu file %1").arg(menuname));
+
+            if (menuname != "mainmenu.xml")
+                ShowOkPopup(QObject::tr("Myth could not locate the menu file %1")
+                            .arg(menuname));
+            return false;
+        }
+
+        QString errorMsg;
+        int errorLine = 0;
+        int errorColumn = 0;
+
+        if (!doc.setContent(&f, false, &errorMsg, &errorLine, &errorColumn))
+        {
+            VERBOSE(VB_IMPORTANT,
+                    QString("Error parsing: %1\nat line: %2  column: %3 msg: %4").
+                    arg(filename).arg(errorLine).arg(errorColumn).arg(errorMsg));
+            f.close();
+
+            if (menuname != "mainmenu.xml")
+                ShowOkPopup(QObject::tr("The menu file %1 is incomplete.")
+                            .arg(menuname));
+            return false;
+        }
+
         f.close();
-
-        if (menuname != "mainmenu.xml")
-            ShowOkPopup(QObject::tr("The menu file %1 is incomplete.")
-                        .arg(menuname));
-        return false;
     }
 
-    f.close();
-
     QDomElement docElem = doc.documentElement();
 
     m_menumode = docElem.attribute("name", "MAIN");
