Go to the documentation of this file.
12 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
13 #include <QtAndroidExtras>
15 #include <QCoreApplication>
17 #define QAndroidJniObject QJniObject
20 #include <QApplication>
28 #include <QProcessEnvironment>
44 #include "libmythbase/mythconfig.h"
52 #include "libmythbase/mythversion.h"
122 #ifdef USING_LIBDNS_SD
123 #include <QScopedPointer>
126 #if CONFIG_SYSTEMD_NOTIFY
127 #include <systemd/sd-daemon.h>
128 static inline void fe_sd_notify(
const char *str) { sd_notify(0, str); };
151 static bool gLoaded =
false;
154 static const QString
sLocation = QCoreApplication::translate(
"(Common)",
159 class RunSettingsCompletion :
public QObject
164 static void Create(
bool check)
166 new RunSettingsCompletion(check);
170 explicit RunSettingsCompletion(
bool check)
175 this, &RunSettingsCompletion::OnPasswordResultReady);
184 ~RunSettingsCompletion()
override =
default;
187 void OnPasswordResultReady(
bool passwordValid,
208 LOG(VB_GENERAL, LOG_WARNING,
209 "Aggressive Parental Controls Warning: "
210 "invalid password. An attempt to enter a "
211 "MythVideo settings screen was prevented.");
226 Q_DECLARE_TR_FUNCTIONS(BookmarkDialog)
230 bool bookmarkPresent,
bool lastPlayPresent) :
233 m_bookmarked(bookmarkPresent),
234 m_lastPlayed(lastPlayPresent),
235 m_btnPlayBookmark(tr(
"Play from bookmark")),
236 m_btnClearBookmark(tr(
"Clear bookmark")),
237 m_btnPlayBegin(tr(
"Play from beginning")),
238 m_btnPlayLast(tr(
"Play from last played position")),
239 m_btnClearLast(tr(
"Clear last played position")) {
244 QString msg = tr(
"DVD/Video contains a bookmark");
248 if (!popup->Create())
256 popup->SetReturnEvent(
this,
"bookmarkdialog");
258 popup->AddButton(m_btnPlayLast);
260 popup->AddButton(m_btnPlayBookmark);
261 popup->AddButton(m_btnPlayBegin);
263 popup->AddButton(m_btnClearLast);
265 popup->AddButton(m_btnClearBookmark);
275 QString buttonText = dce->GetResultText();
277 if (dce->GetId() !=
"bookmarkdialog")
280 if (buttonText == m_btnPlayLast)
282 else if (buttonText == m_btnPlayBookmark)
284 else if (buttonText == m_btnPlayBegin)
286 else if (buttonText == m_btnClearBookmark)
288 m_pgi->SaveBookmark(0);
291 m_videoDlg->playbackStateChanged(m_pgi->GetBasename());
294 else if (buttonText == m_btnClearLast)
296 m_pgi->SaveLastPlayPos(0);
299 m_videoDlg->playbackStateChanged(m_pgi->GetBasename());
307 bool m_bookmarked {
false};
308 bool m_lastPlayed {
false};
309 QString m_btnPlayBookmark;
310 QString m_btnClearBookmark;
311 QString m_btnPlayBegin;
312 QString m_btnPlayLast;
313 QString m_btnClearLast;
319 QCoreApplication::processEvents();
331 LOG(VB_GENERAL, LOG_INFO,
"Shutting down UPnP client...");
371 ShowOkPopup(QCoreApplication::translate(
"(MythFrontendMain)",
372 "The ScreenSetupWizard cannot be used while "
373 "mythfrontend is operating in windowed mode."));
410 auto *mythcontrols =
new MythControls(mainStack,
"mythcontrols");
412 if (mythcontrols->Create())
537 if (viewsched->Create())
549 if (progRecPrior->Create())
561 if (chanRecPrior->Create())
573 if (custom->Create())
583 auto *pbb =
new PlaybackBox(mainStack,
"playbackbox");
587 if (!recGroup.isEmpty())
588 pbb->setInitialRecGroup(recGroup);
626 if (custom->Create())
638 if (mansched->Create())
649 QString msg = QCoreApplication::translate(
"(Common)",
"All tuners are currently busy.");
652 msg = QCoreApplication::translate(
"(Common)",
"There are no configured tuners.");
667 while (keylist.size() < 2)
690 auto *statusbox =
new StatusBox(mainStack);
692 if (statusbox->Create())
705 if (idlescreen->Create())
713 QString message = QCoreApplication::translate(
"(MythFrontendMain)",
714 "Loading videos ...");
720 "mythvideobusydialog");
722 if (busyPopup->Create())
734 video_list = saved->GetSaved();
735 LOG(VB_GENERAL, LOG_INFO,
736 QString(
"Reusing saved video list because MythVideo was resumed"
751 if (mythvideo->Create())
770 if (galleryView->Create())
773 galleryView->Start();
789 QString command_string =
791 QString bluray_mountpoint =
793 QDir bdtest(bluray_mountpoint +
"/BDMV");
802 QString
filename = QString(
"bd:/%1").arg(bluray_mountpoint);
805 0, 0,
"", 0min,
"",
"",
true);
813 if (dvd_device.isEmpty())
818 if ((command_string.indexOf(
"internal", 0, Qt::CaseInsensitive) > -1) ||
819 (command_string.length() < 1))
824 #elif defined(_WIN32)
831 command_string =
"Internal";
833 "",
"", 0, 0,
"", 0min,
"",
"",
true);
839 if (command_string.contains(
"%d"))
844 command_string = command_string.replace(
"%d", dvd_device);
880 LOG(VB_GENERAL, LOG_ERR,
881 "mythdvd main.o: handleMedia() does not know what to do");
893 QVector<MythScreenType*> screens;
897 for (
const auto *screen : std::as_const(screens))
899 if (qobject_cast<const GalleryThumbView*>(screen))
902 LOG(VB_MEDIA, LOG_INFO,
"Main: Ignoring new gallery media - already running");
909 LOG(VB_GUI, LOG_INFO,
"Main: Autostarting Gallery for new media");
913 LOG(VB_MEDIA, LOG_INFO,
"Main: Ignoring new gallery media - autorun not set");
918 QString sel = selection.toLower();
920 if (sel.startsWith(
"settings ") || sel ==
"video_settings_general")
928 if (sel ==
"tv_watch_live")
930 else if (sel.startsWith(
"tv_watch_recording"))
933 if ((selection.length() > 19) && (selection.mid(18, 1) ==
" "))
938 else if (sel ==
"tv_schedule")
940 else if (sel ==
"tv_manualschedule")
942 else if (sel ==
"tv_custom_record")
944 else if (sel ==
"tv_fix_conflicts")
946 else if (sel ==
"tv_manage_recording_rules")
948 else if (sel ==
"tv_progfind")
950 else if (sel ==
"tv_search_title")
952 else if (sel ==
"tv_search_keyword")
954 else if (sel ==
"tv_search_people")
956 else if (sel ==
"tv_search_power")
958 else if (sel ==
"tv_search_stored")
960 else if (sel ==
"tv_search_channel")
962 else if (sel ==
"tv_search_category")
964 else if (sel ==
"tv_search_movie")
966 else if (sel ==
"tv_search_new")
968 else if (sel ==
"tv_search_time")
970 else if (sel ==
"tv_previous")
972 else if (sel ==
"tv_previous_old")
974 else if (sel ==
"settings appearance")
987 else if (sel ==
"settings themechooser")
997 else if (sel ==
"settings setupwizard")
1007 else if (sel ==
"settings grabbers")
1017 else if (sel ==
"screensetupwizard")
1021 else if (sel ==
"setup_keys")
1025 else if (sel ==
"settings playgroup")
1038 else if (sel ==
"settings general")
1051 else if (sel ==
"settings audiogeneral")
1065 else if (sel ==
"settings maingeneral")
1078 else if (sel ==
"settings playback")
1091 else if (sel ==
"settings osd")
1104 else if (sel ==
"settings epg")
1117 else if (sel ==
"settings channelgroups")
1130 else if (sel ==
"settings generalrecpriorities")
1134 "generalrecprioritiessettings",
1144 else if (sel ==
"settings channelrecpriorities")
1148 else if (sel ==
"settings custompriority")
1152 else if (sel ==
"system_events")
1163 else if (sel ==
"video_settings_general")
1166 GetBoolSetting(
"VideoAggressivePC",
false));
1168 else if (sel ==
"video_settings_player")
1179 else if (sel ==
"video_settings_metadata")
1190 else if (sel ==
"video_settings_associations")
1199 else if (sel ==
"manager")
1201 else if (sel ==
"browser")
1203 else if (sel ==
"listing")
1205 else if (sel ==
"gallery")
1207 else if (sel ==
"disc_play")
1211 else if (sel ==
"tv_status")
1213 else if (sel ==
"exiting_app_prompt")
1215 else if (sel ==
"exiting_app")
1217 else if (sel ==
"standby_mode")
1219 else if (sel ==
"exiting_menu")
1224 LOG(VB_GENERAL, LOG_ERR,
"Unknown menu action: " + selection);
1226 if (sel.startsWith(
"settings ") || sel ==
"video_settings_general")
1242 prompter->HandleExit();
1258 LOG(VB_GENERAL, LOG_NOTICE, QString(
"Found mainmenu.xml for theme '%1'")
1265 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find mainmenu.xml for theme '%1'")
1305 const QString &title,
const QString &subtitle,
1306 const QString &director,
int season,
int episode,
1307 const QString &inetref, std::chrono::minutes lenMins,
1308 const QString &year,
1309 const QString &
id,
const bool useBookmark)
1313 QFile checkFile(mrl);
1314 if ((!checkFile.exists() && !mrl.startsWith(
"dvd:")
1315 && !mrl.startsWith(
"bd:")
1316 && !mrl.startsWith(
"myth:")
1317 && !mrl.startsWith(
"http://")
1318 && !mrl.startsWith(
"https://")))
1320 QString errorText = QCoreApplication::translate(
"(MythFrontendMain)",
1321 "Failed to open \n '%1' in %2 \n"
1322 "Check if the video exists")
1323 .arg(mrl.section(
'/', -1),
1324 mrl.section(
'/', 0, -2));
1331 mrl, plot, title, QString(), subtitle, QString(),
1332 director, season, episode, inetref, lenMins,
1333 (year.toUInt()) ? year.toUInt() : 1900,
id);
1335 pginfo->SetProgramInfoType(pginfo->DiscoverProgramInfoType());
1337 bool bookmarkPresent =
false;
1338 bool lastPlayPresent =
false;
1340 if (pginfo->IsVideoDVD())
1342 auto *dvd =
new MythDVDInfo(pginfo->GetPlaybackURL());
1347 if (dvd->GetNameAndSerialNum(name, serialid))
1349 QStringList fields = pginfo->QueryDVDBookmark(serialid);
1350 bookmarkPresent = (fields.count() > 0);
1358 dvd->GetLastError());
1365 else if (pginfo->IsVideoBD())
1374 QStringList fields = pginfo->QueryBDBookmark(serialid);
1375 bookmarkPresent = (fields.count() > 0);
1388 else if (useBookmark && pginfo->IsVideo())
1390 pginfo->SetIgnoreLastPlayPos(
false);
1391 pginfo->SetIgnoreBookmark(
false);
1392 bookmarkPresent = pginfo->QueryBookmark() > 0;
1393 lastPlayPresent = pginfo->QueryLastPlayPos() > 0;
1396 if (useBookmark && (bookmarkPresent || lastPlayPresent))
1399 auto *bookmarkdialog =
new BookmarkDialog(pginfo, mainStack,
1402 if (!bookmarkdialog->Create())
1404 delete bookmarkdialog;
1424 auto *lmenu = qobject_cast<MythThemedMenuState *>
1427 lmenu->m_buttonList->SetItemCurrent(0);
1439 LOG(VB_GENERAL, LOG_WARNING, QString(
"Overriding broken theme '%1' with '%2'")
1440 .arg(badtheme, themename));
1459 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
1460 auto activity = QtAndroid::androidActivity();
1462 QJniObject activity = QNativeInterface::QAndroidApplication::context();
1464 auto packageManager = activity.callObjectMethod
1465 (
"getPackageManager",
1466 "()Landroid/content/pm/PackageManager;" );
1468 auto activityIntent = packageManager.callObjectMethod
1469 (
"getLaunchIntentForPackage",
1470 "(Ljava/lang/String;)Landroid/content/Intent;",
1471 activity.callObjectMethod(
"getPackageName",
1472 "()Ljava/lang/String;").object() );
1474 auto pendingIntent = QAndroidJniObject::callStaticObjectMethod
1475 (
"android/app/PendingIntent",
1477 "(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;",
1480 activityIntent.object(),
1481 QAndroidJniObject::getStaticField<jint>(
"android/content/Intent",
1482 "FLAG_ACTIVITY_CLEAR_TOP") );
1484 auto alarmManager = activity.callObjectMethod
1485 (
"getSystemService",
1486 "(Ljava/lang/String;)Ljava/lang/Object;",
1487 QAndroidJniObject::getStaticObjectField(
"android/content/Context",
1489 "Ljava/lang/String;").
object() );
1491 alarmManager.callMethod<
void>
1493 "(IJLandroid/app/PendingIntent;)V",
1494 QAndroidJniObject::getStaticField<jint>(
"android/app/AlarmManager",
"RTC"),
1495 jlong(QDateTime::currentMSecsSinceEpoch() + 100),
1496 pendingIntent.object() );
1512 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find theme '%1'").arg(themename));
1564 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Reload Theme"),
1566 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Main Menu"),
1568 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"Program Guide"),
1570 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"Program Finder"),
1574 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"Manage Recordings / "
1575 "Fix Conflicts"),
"",
"",
startManaged,
"VIEWSCHEDULED");
1576 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Manage Recording Rules"),
1578 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Channel Recording "
1580 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"TV Recording Playback"),
1582 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Live TV"),
1584 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Status Screen"),
1586 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Previously Recorded"),
1589 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Standby Mode"),
1604 REG_JUMP(
"Play Disc", QT_TRANSLATE_NOOP(
"MythControls",
1605 "Play an Optical Disc"),
"",
playDisc);
1612 REG_JUMPEX(QT_TRANSLATE_NOOP(
"MythControls",
"Toggle Show Widget Borders"),
1614 REG_JUMPEX(QT_TRANSLATE_NOOP(
"MythControls",
"Toggle Show Widget Names"),
1616 REG_JUMPEX(QT_TRANSLATE_NOOP(
"MythControls",
"Reset All Keys"),
1617 QT_TRANSLATE_NOOP(
"MythControls",
"Reset all keys to defaults"),
1630 REG_KEY(
"Video",
"PLAYALT", QT_TRANSLATE_NOOP(
"MythControls",
1631 "Play selected item in alternate player"),
"ALT+P");
1632 REG_KEY(
"Video",
"FILTER", QT_TRANSLATE_NOOP(
"MythControls",
1633 "Open video filter dialog"),
"F");
1634 REG_KEY(
"Video",
"INCPARENT", QT_TRANSLATE_NOOP(
"MythControls",
1635 "Increase Parental Level"),
"],},F11");
1636 REG_KEY(
"Video",
"DECPARENT", QT_TRANSLATE_NOOP(
"MythControls",
1637 "Decrease Parental Level"),
"[,{,F10");
1638 REG_KEY(
"Video",
"INCSEARCH", QT_TRANSLATE_NOOP(
"MythControls",
1639 "Show Incremental Search Dialog"),
"Ctrl+S");
1640 REG_KEY(
"Video",
"DOWNLOADDATA", QT_TRANSLATE_NOOP(
"MythControls",
1641 "Download metadata for current item"),
"W");
1642 REG_KEY(
"Video",
"ITEMDETAIL", QT_TRANSLATE_NOOP(
"MythControls",
1643 "Display Item Detail Popup"),
"");
1646 REG_KEY(
"Images",
"PLAY", QT_TRANSLATE_NOOP(
"MythControls",
1647 "Start/Stop Slideshow"),
"P");
1648 REG_KEY(
"Images",
"RECURSIVESHOW", QT_TRANSLATE_NOOP(
"MythControls",
1649 "Start Recursive Slideshow"),
"R");
1650 REG_KEY(
"Images",
"ROTRIGHT", QT_TRANSLATE_NOOP(
"MythControls",
1651 "Rotate image right 90 degrees"),
"],3");
1652 REG_KEY(
"Images",
"ROTLEFT", QT_TRANSLATE_NOOP(
"MythControls",
1653 "Rotate image left 90 degrees"),
"[,1");
1654 REG_KEY(
"Images",
"FLIPHORIZONTAL", QT_TRANSLATE_NOOP(
"MythControls",
1655 "Flip image horizontally"),
"");
1656 REG_KEY(
"Images",
"FLIPVERTICAL", QT_TRANSLATE_NOOP(
"MythControls",
1657 "Flip image vertically"),
"");
1658 REG_KEY(
"Images",
"ZOOMOUT", QT_TRANSLATE_NOOP(
"MythControls",
1659 "Zoom image out"),
"7");
1660 REG_KEY(
"Images",
"ZOOMIN", QT_TRANSLATE_NOOP(
"MythControls",
1661 "Zoom image in"),
"9");
1662 REG_KEY(
"Images",
"FULLSIZE", QT_TRANSLATE_NOOP(
"MythControls",
1663 "Full-size (un-zoom) image"),
"0");
1664 REG_KEY(
"Images",
"MARK", QT_TRANSLATE_NOOP(
"MythControls",
1665 "Mark image"),
"T");
1666 REG_KEY(
"Images",
"SCROLLUP", QT_TRANSLATE_NOOP(
"MythControls",
1667 "Scroll image up"),
"2");
1668 REG_KEY(
"Images",
"SCROLLLEFT", QT_TRANSLATE_NOOP(
"MythControls",
1669 "Scroll image left"),
"4");
1670 REG_KEY(
"Images",
"SCROLLRIGHT", QT_TRANSLATE_NOOP(
"MythControls",
1671 "Scroll image right"),
"6");
1672 REG_KEY(
"Images",
"SCROLLDOWN", QT_TRANSLATE_NOOP(
"MythControls",
1673 "Scroll image down"),
"8");
1674 REG_KEY(
"Images",
"RECENTER", QT_TRANSLATE_NOOP(
"MythControls",
1675 "Recenter image"),
"5");
1676 REG_KEY(
"Images",
"COVER", QT_TRANSLATE_NOOP(
"MythControls",
1677 "Set or clear cover image"),
"C");
1706 query.
prepare(
"DELETE FROM keybindings "
1707 "WHERE hostname = :HOSTNAME;");
1711 query.
prepare(
"DELETE FROM jumppoints "
1712 "WHERE hostname = :HOSTNAME;");
1756 query.
prepare(
"DELETE FROM inuseprograms "
1757 "WHERE hostname = :HOSTNAME and recusage = 'player' ;");
1765 bool autoStart =
false;
1771 QDateTime startupTime = QDateTime();
1780 if (startupTime.isValid())
1783 startupSecs = std::max(startupSecs, 15 * 60s);
1790 LOG(VB_GENERAL, LOG_INFO,
1791 "Close to auto-start time, AUTO-Startup assumed");
1797 LOG(VB_GENERAL, LOG_INFO,
1798 "Close to MythFillDB suggested run time, AUTO-Startup to fetch guide data?");
1803 LOG(VB_GENERAL, LOG_DEBUG,
1804 "NOT close to auto-start time, USER-initiated startup assumed");
1813 if (!wakeupCmd.isEmpty())
1816 bool bConflicts =
false;
1817 QDateTime nextRecordingStart;
1824 for (
auto *prog : progList)
1828 (prog->GetHostname() ==
hostname) &&
1829 (nextRecordingStart.isNull() ||
1830 nextRecordingStart > prog->GetRecordingStartTime()))
1832 nextRecordingStart = prog->GetRecordingStartTime();
1836 if (!nextRecordingStart.isNull() &&
1839 LOG(VB_GENERAL, LOG_INFO,
1840 "Close to start time, AUTO-Startup assumed");
1847 LOG(VB_GENERAL, LOG_DEBUG,
1848 "NOT close to auto-start time, USER-initiated startup assumed");
1873 Q_DECL_EXPORT
int main(
int argc,
char **argv)
1875 bool bPromptForBackend =
false;
1876 bool bBypassAutoDiscovery =
false;
1898 QApplication::setSetuidAllowed(
true);
1899 QApplication a(argc, argv);
1904 QString path = QCoreApplication::applicationDirPath();
1906 QString(
"%1/../Resources/lib/%2/site-packages:%3")
1908 .arg(QFileInfo(PYTHON_EXE).fileName())
1909 .arg(QProcessEnvironment::systemEnvironment().value(
"PYTHONPATH"))
1910 .toUtf8().constData(), 1);
1919 #if defined(Q_OS_ANDROID)
1920 auto config = QSslConfiguration::defaultConfiguration();
1921 config.setCaCertificates(QSslConfiguration::systemCaCertificates());
1922 QSslConfiguration::setDefaultConfiguration(config);
1929 bool ResetSettings =
false;
1932 bPromptForBackend =
true;
1934 bBypassAutoDiscovery =
true;
1936 if (signal(
SIGPIPE, SIG_IGN) == SIG_ERR)
1937 std::cerr <<
"Unable to ignore SIGPIPE\n";
1947 if (!
gContext->
Init(
true, bPromptForBackend, bBypassAutoDiscovery))
1949 LOG(VB_GENERAL, LOG_ERR,
"Failed to init MythContext, exiting.");
1963 ResetSettings =
true;
1978 QDir dir(fileprefix);
1980 dir.mkdir(fileprefix);
1993 LOG(VB_GENERAL, LOG_NOTICE,
"Appearance settings and language have "
1994 "been reset to defaults. You will need to "
1995 "restart the frontend.");
2000 #if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
2002 if (maxImageSize >=0)
2003 QImageReader::setAllocationLimit(maxImageSize);
2005 QCoreApplication::setSetuidAllowed(
true);
2009 LOG(VB_GENERAL, LOG_ERR,
"Failed to revokeRoot(), exiting.");
2013 #ifdef USING_LIBDNS_SD
2019 fe_sd_notify(
"STATUS=Registering frontend with bonjour");
2024 QByteArray name(
"Mythfrontend on ");
2026 bonjour->Register(port,
"_mythfrontend._tcp",
2045 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find theme '%1'")
2054 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find theme '%1'")
2068 mainWindow->Init(
false);
2069 mainWindow->setWindowTitle(QCoreApplication::translate(
"(MythFrontendMain)",
2071 "Main window title"));
2073 #ifdef USING_AIRPLAY
2096 LOG(VB_GENERAL, LOG_ERR,
2097 "Couldn't upgrade database to new schema, exiting.");
2105 mainWindow->ReloadKeys();
2128 mainWindow->installEventFilter(mon);
2137 if (!networkControl->
listen(port))
2139 LOG(VB_GENERAL, LOG_ERR,
2140 QString(
"NetworkControl failed to bind to port %1.")
2156 std::unique_ptr<ThemeUpdateChecker> themeUpdateChecker;
2158 themeUpdateChecker = std::make_unique<ThemeUpdateChecker>();
2170 #ifdef CONFIG_BINDINGS_PYTHON
2174 housekeeping->Start();
2187 LOG(VB_GENERAL, LOG_ERR,
2188 QString(
"Invalid plugin name supplied on command line: '%1'")
2190 LOG(VB_GENERAL, LOG_ERR,
2191 QString(
"Available plugins: %1")
2192 .arg(plugins.join(
", ")));
2204 LOG(VB_GENERAL, LOG_ERR,
2205 QString(
"Invalid jump point supplied on the command line: %1")
2207 LOG(VB_GENERAL, LOG_ERR,
2208 QString(
"Available jump points: %2")
2237 ret = QCoreApplication::exec();
2247 delete housekeeping;
2254 delete networkControl;
2260 LOG(VB_GENERAL, LOG_INFO,
"Reloading theme");
2269 LOG(VB_GENERAL, LOG_INFO,
"Restarting LIRC handler");
2277 #include "mythfrontend.moc"
static void startChannelRecPriorities(void)
void SetPluginManager(MythPluginManager *pmanager)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
static void startAppearWiz(void)
MythScreenStack * GetMainStack()
static void InitStatics(bool Reinit=false)
static void * RunPlaybackBox(void *player, bool showTV)
Manages registered HouseKeeperTasks and queues tasks for operation.
void SendMessage(const QString &message)
QString RemoveCurrentLocation()
static void RunProgramGuide(uint startChanId, const QString &startChanNum, const QDateTime &startTime, TV *player=nullptr, bool embedVideo=false, bool allowFinder=true, int changrpid=-1)
View and select installed themes.
static void REG_KEY(const QString &Context, const QString &Action, const QString &Description, const QString &Key)
void setHttpProxy(void)
Get network proxy settings from OS, and use for [Q]Http[Comms].
void Init(bool MayReInit=true)
static void ParseGeometryOverride(const QString &Geometry)
Parse an X11 style command line geometry string.
static void startManageRecordingRules(void)
@ kStartTVIgnoreLastPlayPos
bool LoadFromScheduler(AutoDeleteDeque< TYPE * > &destination, bool &hasConflicts, const QString &altTable="", int recordid=-1)
void ShowNotificationError(const QString &msg, const QString &from, const QString &detail, const VNMask visibility, const MythNotification::Priority priority)
convenience utility to display error message as notification
static void jumpScreenVideoManager()
static void handleExit(bool prompt)
static void reload()
Reload all active translators based on the current language setting.
static ChannelInfoList LoadChannels(uint startIndex, uint count, uint &totalAvailable, bool ignoreHidden=true, OrderBy orderBy=kChanOrderByChanNum, GroupBy groupBy=kChanGroupByChanid, uint sourceID=0, uint channelGroupID=0, bool liveTVOnly=false, const QString &callsign="", const QString &channum="", bool ignoreUntunable=true)
Load channels from database into a list of ChannelInfo objects.
static int reloadTheme(void)
MythCommFlagCommandLineParser cmdline
static void ReloadKeys(void)
bool run_plugin(const QString &plugname)
void emitTVPlaybackStopped(void)
static int internal_play_media(const QString &mrl, const QString &plot, const QString &title, const QString &subtitle, const QString &director, int season, int episode, const QString &inetref, std::chrono::minutes lenMins, const QString &year, const QString &id, const bool useBookmark)
void RunProgramFinder(TV *player, bool embedVideo, bool allowEPG)
static void startSearchPower(void)
static void startSearchTitle(void)
void JumpTo(const QString &Destination, bool Pop=true)
static void startSearchNew(void)
Startup context for MythTV.
void OverrideSettingForSession(const QString &key, const QString &value)
int RemoteGetFreeRecorderCount(void)
static void jumpScreenVideoDefault()
virtual bool Create(void)
static void jumpScreenVideoTree()
static void standbyScreen(void)
static void CreatePreviewGeneratorQueue(PreviewGenerator::Mode mode, uint maxAttempts, std::chrono::seconds minBlockSeconds)
Create the singleton queue of preview generators.
void emitTVPlaybackStarted(void)
void customEvent(QEvent *event) override
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
static void PrintDebug(void)
Print out any leaks if that level of debugging is enabled.
int RemoteGetRecordingMask(void)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Screen in which all other widgets are contained and rendered.
Q_DECL_EXPORT int main(int argc, char **argv)
static void SetFuncPtrs(void)
static VideoListDeathDelayPtr & GetSavedVideoList()
static void Cleanup(void)
static void startSearchStored(void)
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
@ GENERIC_EXIT_OK
Exited with no error.
MythPainter * GetPainter()
static void startPlayback(void)
static void startSearchCategory(void)
static void startManaged(void)
bool HandleMedia(const QString &Handler, const QString &Mrl, const QString &Plot="", const QString &Title="", const QString &Subtitle="", const QString &Director="", int Season=0, int Episode=0, const QString &Inetref="", std::chrono::minutes LenMins=2h, const QString &Year="1895", const QString &Id="", bool UseBookmarks=false)
static SettingsHelper * g_settingsHelper
static bool StartTV(ProgramInfo *TVRec, uint Flags, const ChannelInfoList &Selection=ChannelInfoList())
Start playback of media.
const QString JUMP_VIDEO_TREE
void SetEffectsEnabled(bool Enable)
static bool RunMenu(const QString &themedir, const QString &themename)
static void startPreviousOld(void)
static void ConfigureQtGUI(int SwapInterval, const MythCommandLineParser &CmdLine)
Shared static initialisation code for all MythTV GUI applications.
static void fe_sd_notify(const char *)
void GetScreenList(QVector< MythScreenType * > &screens)
static void startSearchChannel(void)
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
static const QString sLocation
bool InitializeMythSchema(void)
command to get the the initial database layout from an empty database:
bool Create(void) override
static void handleGalleryMedia(MythMediaDevice *dev)
static void startCustomEdit(void)
static void Addservices(const HTTPServices &Services)
static void InitJumpPoints(void)
@ GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.
static int ConfiguredTunerCards()
If any cards are configured, return the number.
static bool BackendIsRunning(void)
a backend process is running on this host
static void jumpScreenVideoGallery()
void SetAsFrontend(bool frontend)
bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, const bool upgradeIfNoUI, [[maybe_unused]] const bool informSystemd)
Called from outside dbcheck.cpp to update the schema.
QPointer< class VideoListDeathDelay > VideoListDeathDelayPtr
const QString JUMP_VIDEO_MANAGER
Basic menu dialog, message and a list of options.
static void startPlaybackWithGroup(const QString &recGroup="")
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
static void WriteDefaults()
Main header for mythcontrols.
static void DBError(const QString &where, const MSqlQuery &query)
static void startSearchTime(void)
std::enable_if_t< std::chrono::__is_duration< T >::value, T > GetDurSetting(const QString &key, T defaultval=T::zero())
static void gotoMainMenu(void)
Implements Gallery Thumbnail screen.
bool DestinationExists(const QString &Destination) const
void DestroyMythMainWindow(void)
static QStringList SupportedImages()
Return recognised pictures.
static bool isLiveTVAvailable(void)
static void showStatus(void)
QString FindThemeDir(const QString &ThemeName, bool Fallback=true)
Returns the full path to the theme denoted by themename.
static void clearAllKeys(void)
Deletes all key bindings and jump points for this host.
static void PrintVersion(void)
Print application version information.
static void * RunScheduleEditor(ProgramInfo *proginfo, void *player=nullptr)
Callback.
const QString JUMP_VIDEO_GALLERY
static int internal_media_init()
bool GetNameAndSerialNum(QString &Name, QString &SerialNum)
void PrintHelp(void) const
Print command line option help.
An editor for MythSystemEvent handler commands.
@ GENERIC_EXIT_NO_THEME
No Theme available.
const QString JUMP_VIDEO_BROWSER
@ GENERIC_EXIT_NOT_OK
Exited with error.
@ kMSPropagateLogs
add arguments for MythTV log propagation
static void startCustomPriority(void)
static HTTPResponse RedirectRoot(const HTTPRequest2 &Request, const QString &File)
A convenience method to seemlessly redirect requests for index.html to a context specific file.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
const QString JUMP_GALLERY_DEFAULT
static MythPluginManager * g_pmanager
void SigResultReady(bool passwordValid, ParentalLevel::Level newLevel)
void ApplySettingsOverride(void)
Apply all overrides to the global context.
QStringList EnumerateDestinations() const
A screen to create a fully custom recording.
int GetNumSetting(const QString &key, int defaultval=0)
MythScreenStack * GetScreenStack() const
static void * RunViewScheduled(void *player, bool showTv)
static QString cleanup(const QString &str)
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
bool ShowBorders(void) const
static int revokeRoot(void)
bool GetBoolSetting(const QString &key, bool defaultval=false)
Reports on various status items.
static ImageType inspectImage(const QString &path)
static void TeardownPreviewGeneratorQueue()
Destroy the singleton queue of preview generators.
Screen for managing channel priorities in recording scheduling decisions.
static void Init(QObject *parent=nullptr)
static constexpr const char * DEFAULT_UI_THEME
static void setDebugShowBorders(void)
static void startSearchMovie(void)
bool ShowTypeNames(void) const
void SetDebugMode(bool showBorders, bool showNames)
static constexpr const char * MYTH_APPNAME_MYTHFRONTEND
static void startManualSchedule(void)
@ kMSDisableUDPListener
disable MythMessage UDP listener for the duration of application.
static void ReloadJumpPoints(void)
Holds information on recordings and videos.
static void RunVideoScreen(VideoDialog::DialogType type, bool fromJump=false)
static void startTVNormal(void)
std::chrono::seconds secsInPast(const QDateTime &past)
QString toString(const QString &key) const
Returns stored QVariant as a QString, falling to default if not provided.
static void SetupLCD(void)
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
static void handleDVDMedia(MythMediaDevice *dvd)
QString GetSettingOnHost(const QString &key, const QString &host, const QString &defaultval="")
static bool prompt(bool force=false)
Ask the user for the language to use.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
static void Cleanup(void)
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
QStringList EnumeratePlugins(void)
@ GENERIC_EXIT_DB_OUTOFDATE
Database needs upgrade.
Screen for viewing and managing upcoming and conflicted recordings.
static void REG_JUMP(const QString &Destination, const QString &Description, const QString &Key, void(*Callback)(void))
static void SetFuncPtr(const char *Name, void *Pointer)
Import pointers to functions used to embed the TV window into other containers e.g.
static const Type kEventType
QString GetAppBinDir(void)
static void jumpScreenVideoBrowser()
static bool resetTheme(QString themedir, const QString &badtheme)
static void SetHandler(int signum, SigHandlerFunc handler)
static void REG_MEDIAPLAYER(const QString &Name, const QString &Desc, MediaPlayCallback Func)
MythMainWindow * GetMythMainWindow(void)
static MediaRenderer * g_pUPnp
static void startPrevious(void)
QString GetLastError(void) const
static void REG_JUMPEX(const QString &Destination, const QString &Description, const QString &Key, void(*Callback)(void), bool ExitToMain)
void ActivateSettingsCache(bool activate=true)
static void startGuide(void)
MythScreenStack * GetStack(const QString &Stackname)
static constexpr std::chrono::milliseconds kDelayTimeMS
static void resetAllKeys(void)
Reset this host's key bindings and jump points to default values.
bool listen(QList< QHostAddress > addrs, quint16 port, bool requireall=true, PoolServerType type=kTCPServer)
void ClearKeyContext(const QString &Context)
QString GetHostName(void)
static void CleanupMyOldInUsePrograms(void)
void RunProlog(const QString &settingsPage)
int ConfigureLogging(const QString &mask="general", bool progress=false)
Read in logging options and initialize the logging interface.
Screen for managing and configuring keyboard input bindings.
void ClearSettingsCache(const QString &myKey=QString(""))
bool IsMasterHost(void)
is this the same host as the master
static constexpr const char * FALLBACK_UI_THEME
void AddCurrentLocation(const QString &Location)
static void setDebugShowNames(void)
void SaveSetting(const QString &key, int newValue)
static void TVMenuCallback([[maybe_unused]] void *data, QString &selection)
static bool WasAutomaticStart(void)
static void Cleanup(void)
static void load(const QString &module_name)
Load a QTranslator for the user's preferred language.
MythUIHelper * GetMythUI()
static MythThemedMenu * g_menu
void RestartInputHandlers()
@ GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
Handles incoming MythSystemEvent messages.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
static void startFinder(void)
static void startSearchPeople(void)
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
static void reloadTheme_void(void)
static void REG_JUMPLOC(const QString &Destination, const QString &Description, const QString &Key, void(*Callback)(void), const QString &LocalAction)
MythContext * gContext
This global variable contains the MythContext instance for the application.
static HTTPResponse RewriteToSPA(const HTTPRequest2 &Request, const QString &File)
A convenience method to seemlessly redirect requests to a Single Page web app (SPA)
bool Init(bool gui=true, bool promptForBackend=false, bool disableAutoDiscovery=false, bool ignoreDB=false)
void SetExiting(bool exiting=true)
static void startSearchKeyword(void)
const QString JUMP_VIDEO_DEFAULT
void PauseIdleTimer(bool Pause)
Pause the idle timeout timer.
QString GetSetting(const QString &key, const QString &defaultval="")
static QStringList SupportedVideos()
Return recognised video extensions.
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
virtual MythScreenType * GetTopScreen(void) const
static void AddErrorPageHandler(const HTTPHandler &Handler)
static void startKeysSetup()
static void InitKeys(void)
std::vector< ChannelInfo > ChannelInfoList
@ GENERIC_EXIT_DB_ERROR
Database error.