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");
247 if (!popup->Create())
255 popup->SetReturnEvent(
this,
"bookmarkdialog");
257 popup->AddButton(m_btnPlayLast);
259 popup->AddButton(m_btnPlayBookmark);
260 popup->AddButton(m_btnPlayBegin);
262 popup->AddButton(m_btnClearLast);
264 popup->AddButton(m_btnClearBookmark);
274 QString buttonText = dce->GetResultText();
276 if (dce->GetId() !=
"bookmarkdialog")
279 if (buttonText == m_btnPlayLast)
281 else if (buttonText == m_btnPlayBookmark)
283 else if (buttonText == m_btnPlayBegin)
285 else if (buttonText == m_btnClearBookmark)
286 m_pgi->SaveBookmark(0);
287 else if (buttonText == m_btnClearLast)
288 m_pgi->SaveLastPlayPos(0);
294 bool m_bookmarked {
false};
295 bool m_lastPlayed {
false};
296 QString m_btnPlayBookmark;
297 QString m_btnClearBookmark;
298 QString m_btnPlayBegin;
299 QString m_btnPlayLast;
300 QString m_btnClearLast;
305 QCoreApplication::processEvents();
317 LOG(VB_GENERAL, LOG_INFO,
"Shutting down UPnP client...");
357 ShowOkPopup(QCoreApplication::translate(
"(MythFrontendMain)",
358 "The ScreenSetupWizard cannot be used while "
359 "mythfrontend is operating in windowed mode."));
396 auto *mythcontrols =
new MythControls(mainStack,
"mythcontrols");
398 if (mythcontrols->Create())
523 if (viewsched->Create())
535 if (progRecPrior->Create())
547 if (chanRecPrior->Create())
559 if (custom->Create())
569 auto *pbb =
new PlaybackBox(mainStack,
"playbackbox");
573 if (!recGroup.isEmpty())
574 pbb->setInitialRecGroup(recGroup);
612 if (custom->Create())
624 if (mansched->Create())
635 QString msg = QCoreApplication::translate(
"(Common)",
"All tuners are currently busy.");
638 msg = QCoreApplication::translate(
"(Common)",
"There are no configured tuners.");
653 while (keylist.size() < 2)
676 auto *statusbox =
new StatusBox(mainStack);
678 if (statusbox->Create())
691 if (idlescreen->Create())
699 QString message = QCoreApplication::translate(
"(MythFrontendMain)",
700 "Loading videos ...");
706 "mythvideobusydialog");
708 if (busyPopup->Create())
720 video_list = saved->GetSaved();
721 LOG(VB_GENERAL, LOG_INFO,
722 QString(
"Reusing saved video list because MythVideo was resumed"
737 if (mythvideo->Create())
756 if (galleryView->Create())
759 galleryView->Start();
775 QString command_string =
777 QString bluray_mountpoint =
779 QDir bdtest(bluray_mountpoint +
"/BDMV");
788 QString
filename = QString(
"bd:/%1").arg(bluray_mountpoint);
791 0, 0,
"", 0min,
"",
"",
true);
799 if (dvd_device.isEmpty())
804 if ((command_string.indexOf(
"internal", 0, Qt::CaseInsensitive) > -1) ||
805 (command_string.length() < 1))
810 #elif defined(_WIN32)
817 command_string =
"Internal";
819 "",
"", 0, 0,
"", 0min,
"",
"",
true);
825 if (command_string.contains(
"%d"))
830 command_string = command_string.replace(
"%d", dvd_device);
866 LOG(VB_GENERAL, LOG_ERR,
867 "mythdvd main.o: handleMedia() does not know what to do");
879 QVector<MythScreenType*> screens;
883 for (
const auto *screen : qAsConst(screens))
885 if (qobject_cast<const GalleryThumbView*>(screen))
888 LOG(VB_MEDIA, LOG_INFO,
"Main: Ignoring new gallery media - already running");
895 LOG(VB_GUI, LOG_INFO,
"Main: Autostarting Gallery for new media");
899 LOG(VB_MEDIA, LOG_INFO,
"Main: Ignoring new gallery media - autorun not set");
904 QString sel = selection.toLower();
906 if (sel.startsWith(
"settings ") || sel ==
"video_settings_general")
914 if (sel ==
"tv_watch_live")
916 else if (sel.startsWith(
"tv_watch_recording"))
919 if ((selection.length() > 19) && (selection.mid(18, 1) ==
" "))
924 else if (sel ==
"tv_schedule")
926 else if (sel ==
"tv_manualschedule")
928 else if (sel ==
"tv_custom_record")
930 else if (sel ==
"tv_fix_conflicts")
932 else if (sel ==
"tv_manage_recording_rules")
934 else if (sel ==
"tv_progfind")
936 else if (sel ==
"tv_search_title")
938 else if (sel ==
"tv_search_keyword")
940 else if (sel ==
"tv_search_people")
942 else if (sel ==
"tv_search_power")
944 else if (sel ==
"tv_search_stored")
946 else if (sel ==
"tv_search_channel")
948 else if (sel ==
"tv_search_category")
950 else if (sel ==
"tv_search_movie")
952 else if (sel ==
"tv_search_new")
954 else if (sel ==
"tv_search_time")
956 else if (sel ==
"tv_previous")
958 else if (sel ==
"tv_previous_old")
960 else if (sel ==
"settings appearance")
973 else if (sel ==
"settings themechooser")
983 else if (sel ==
"settings setupwizard")
993 else if (sel ==
"settings grabbers")
1003 else if (sel ==
"screensetupwizard")
1007 else if (sel ==
"setup_keys")
1011 else if (sel ==
"settings playgroup")
1024 else if (sel ==
"settings general")
1037 else if (sel ==
"settings audiogeneral")
1051 else if (sel ==
"settings maingeneral")
1064 else if (sel ==
"settings playback")
1077 else if (sel ==
"settings osd")
1090 else if (sel ==
"settings epg")
1103 else if (sel ==
"settings channelgroups")
1116 else if (sel ==
"settings generalrecpriorities")
1120 "generalrecprioritiessettings",
1130 else if (sel ==
"settings channelrecpriorities")
1134 else if (sel ==
"settings custompriority")
1138 else if (sel ==
"system_events")
1149 else if (sel ==
"video_settings_general")
1152 GetBoolSetting(
"VideoAggressivePC",
false));
1154 else if (sel ==
"video_settings_player")
1165 else if (sel ==
"video_settings_metadata")
1176 else if (sel ==
"video_settings_associations")
1185 else if (sel ==
"manager")
1187 else if (sel ==
"browser")
1189 else if (sel ==
"listing")
1191 else if (sel ==
"gallery")
1193 else if (sel ==
"disc_play")
1197 else if (sel ==
"tv_status")
1199 else if (sel ==
"exiting_app_prompt")
1201 else if (sel ==
"exiting_app")
1203 else if (sel ==
"standby_mode")
1205 else if (sel ==
"exiting_menu")
1210 LOG(VB_GENERAL, LOG_ERR,
"Unknown menu action: " + selection);
1212 if (sel.startsWith(
"settings ") || sel ==
"video_settings_general")
1228 prompter->HandleExit();
1244 LOG(VB_GENERAL, LOG_NOTICE, QString(
"Found mainmenu.xml for theme '%1'")
1251 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find mainmenu.xml for theme '%1'")
1291 const QString &title,
const QString &subtitle,
1292 const QString &director,
int season,
int episode,
1293 const QString &inetref, std::chrono::minutes lenMins,
1294 const QString &year,
1295 const QString &
id,
const bool useBookmark)
1299 QFile checkFile(mrl);
1300 if ((!checkFile.exists() && !mrl.startsWith(
"dvd:")
1301 && !mrl.startsWith(
"bd:")
1302 && !mrl.startsWith(
"myth:")
1303 && !mrl.startsWith(
"http://")
1304 && !mrl.startsWith(
"https://")))
1306 QString errorText = QCoreApplication::translate(
"(MythFrontendMain)",
1307 "Failed to open \n '%1' in %2 \n"
1308 "Check if the video exists")
1309 .arg(mrl.section(
'/', -1),
1310 mrl.section(
'/', 0, -2));
1317 mrl, plot, title, QString(), subtitle, QString(),
1318 director, season, episode, inetref, lenMins,
1319 (year.toUInt()) ? year.toUInt() : 1900,
id);
1321 pginfo->SetProgramInfoType(pginfo->DiscoverProgramInfoType());
1323 bool bookmarkPresent =
false;
1324 bool lastPlayPresent =
false;
1326 if (pginfo->IsVideoDVD())
1328 auto *dvd =
new MythDVDInfo(pginfo->GetPlaybackURL());
1333 if (dvd->GetNameAndSerialNum(name, serialid))
1335 QStringList fields = pginfo->QueryDVDBookmark(serialid);
1336 bookmarkPresent = (fields.count() > 0);
1344 dvd->GetLastError());
1351 else if (pginfo->IsVideoBD())
1360 QStringList fields = pginfo->QueryBDBookmark(serialid);
1361 bookmarkPresent = (fields.count() > 0);
1374 else if (useBookmark && pginfo->IsVideo())
1376 pginfo->SetIgnoreLastPlayPos(
false);
1377 pginfo->SetIgnoreBookmark(
false);
1378 bookmarkPresent = pginfo->QueryBookmark() > 0;
1379 lastPlayPresent = pginfo->QueryLastPlayPos() > 0;
1382 if (useBookmark && (bookmarkPresent || lastPlayPresent))
1385 auto *bookmarkdialog =
new BookmarkDialog(pginfo, mainStack,
1388 if (!bookmarkdialog->Create())
1390 delete bookmarkdialog;
1410 auto *lmenu = qobject_cast<MythThemedMenuState *>
1413 lmenu->m_buttonList->SetItemCurrent(0);
1425 LOG(VB_GENERAL, LOG_WARNING, QString(
"Overriding broken theme '%1' with '%2'")
1426 .arg(badtheme, themename));
1445 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
1446 auto activity = QtAndroid::androidActivity();
1448 QJniObject activity = QNativeInterface::QAndroidApplication::context();
1450 auto packageManager = activity.callObjectMethod
1451 (
"getPackageManager",
1452 "()Landroid/content/pm/PackageManager;" );
1454 auto activityIntent = packageManager.callObjectMethod
1455 (
"getLaunchIntentForPackage",
1456 "(Ljava/lang/String;)Landroid/content/Intent;",
1457 activity.callObjectMethod(
"getPackageName",
1458 "()Ljava/lang/String;").object() );
1460 auto pendingIntent = QAndroidJniObject::callStaticObjectMethod
1461 (
"android/app/PendingIntent",
1463 "(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;",
1466 activityIntent.object(),
1467 QAndroidJniObject::getStaticField<jint>(
"android/content/Intent",
1468 "FLAG_ACTIVITY_CLEAR_TOP") );
1470 auto alarmManager = activity.callObjectMethod
1471 (
"getSystemService",
1472 "(Ljava/lang/String;)Ljava/lang/Object;",
1473 QAndroidJniObject::getStaticObjectField(
"android/content/Context",
1475 "Ljava/lang/String;").
object() );
1477 alarmManager.callMethod<
void>
1479 "(IJLandroid/app/PendingIntent;)V",
1480 QAndroidJniObject::getStaticField<jint>(
"android/app/AlarmManager",
"RTC"),
1481 jlong(QDateTime::currentMSecsSinceEpoch() + 100),
1482 pendingIntent.object() );
1498 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find theme '%1'").arg(themename));
1550 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Reload Theme"),
1552 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Main Menu"),
1554 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"Program Guide"),
1556 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"Program Finder"),
1560 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"Manage Recordings / "
1561 "Fix Conflicts"),
"",
"",
startManaged,
"VIEWSCHEDULED");
1562 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Manage Recording Rules"),
1564 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Channel Recording "
1566 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"TV Recording Playback"),
1568 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Live TV"),
1570 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Status Screen"),
1572 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Previously Recorded"),
1575 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Standby Mode"),
1590 REG_JUMP(
"Play Disc", QT_TRANSLATE_NOOP(
"MythControls",
1591 "Play an Optical Disc"),
"",
playDisc);
1598 REG_JUMPEX(QT_TRANSLATE_NOOP(
"MythControls",
"Toggle Show Widget Borders"),
1600 REG_JUMPEX(QT_TRANSLATE_NOOP(
"MythControls",
"Toggle Show Widget Names"),
1602 REG_JUMPEX(QT_TRANSLATE_NOOP(
"MythControls",
"Reset All Keys"),
1603 QT_TRANSLATE_NOOP(
"MythControls",
"Reset all keys to defaults"),
1616 REG_KEY(
"Video",
"PLAYALT", QT_TRANSLATE_NOOP(
"MythControls",
1617 "Play selected item in alternate player"),
"ALT+P");
1618 REG_KEY(
"Video",
"FILTER", QT_TRANSLATE_NOOP(
"MythControls",
1619 "Open video filter dialog"),
"F");
1620 REG_KEY(
"Video",
"INCPARENT", QT_TRANSLATE_NOOP(
"MythControls",
1621 "Increase Parental Level"),
"],},F11");
1622 REG_KEY(
"Video",
"DECPARENT", QT_TRANSLATE_NOOP(
"MythControls",
1623 "Decrease Parental Level"),
"[,{,F10");
1624 REG_KEY(
"Video",
"INCSEARCH", QT_TRANSLATE_NOOP(
"MythControls",
1625 "Show Incremental Search Dialog"),
"Ctrl+S");
1626 REG_KEY(
"Video",
"DOWNLOADDATA", QT_TRANSLATE_NOOP(
"MythControls",
1627 "Download metadata for current item"),
"W");
1628 REG_KEY(
"Video",
"ITEMDETAIL", QT_TRANSLATE_NOOP(
"MythControls",
1629 "Display Item Detail Popup"),
"");
1632 REG_KEY(
"Images",
"PLAY", QT_TRANSLATE_NOOP(
"MythControls",
1633 "Start/Stop Slideshow"),
"P");
1634 REG_KEY(
"Images",
"RECURSIVESHOW", QT_TRANSLATE_NOOP(
"MythControls",
1635 "Start Recursive Slideshow"),
"R");
1636 REG_KEY(
"Images",
"ROTRIGHT", QT_TRANSLATE_NOOP(
"MythControls",
1637 "Rotate image right 90 degrees"),
"],3");
1638 REG_KEY(
"Images",
"ROTLEFT", QT_TRANSLATE_NOOP(
"MythControls",
1639 "Rotate image left 90 degrees"),
"[,1");
1640 REG_KEY(
"Images",
"FLIPHORIZONTAL", QT_TRANSLATE_NOOP(
"MythControls",
1641 "Flip image horizontally"),
"");
1642 REG_KEY(
"Images",
"FLIPVERTICAL", QT_TRANSLATE_NOOP(
"MythControls",
1643 "Flip image vertically"),
"");
1644 REG_KEY(
"Images",
"ZOOMOUT", QT_TRANSLATE_NOOP(
"MythControls",
1645 "Zoom image out"),
"7");
1646 REG_KEY(
"Images",
"ZOOMIN", QT_TRANSLATE_NOOP(
"MythControls",
1647 "Zoom image in"),
"9");
1648 REG_KEY(
"Images",
"FULLSIZE", QT_TRANSLATE_NOOP(
"MythControls",
1649 "Full-size (un-zoom) image"),
"0");
1650 REG_KEY(
"Images",
"MARK", QT_TRANSLATE_NOOP(
"MythControls",
1651 "Mark image"),
"T");
1652 REG_KEY(
"Images",
"SCROLLUP", QT_TRANSLATE_NOOP(
"MythControls",
1653 "Scroll image up"),
"2");
1654 REG_KEY(
"Images",
"SCROLLLEFT", QT_TRANSLATE_NOOP(
"MythControls",
1655 "Scroll image left"),
"4");
1656 REG_KEY(
"Images",
"SCROLLRIGHT", QT_TRANSLATE_NOOP(
"MythControls",
1657 "Scroll image right"),
"6");
1658 REG_KEY(
"Images",
"SCROLLDOWN", QT_TRANSLATE_NOOP(
"MythControls",
1659 "Scroll image down"),
"8");
1660 REG_KEY(
"Images",
"RECENTER", QT_TRANSLATE_NOOP(
"MythControls",
1661 "Recenter image"),
"5");
1662 REG_KEY(
"Images",
"COVER", QT_TRANSLATE_NOOP(
"MythControls",
1663 "Set or clear cover image"),
"C");
1692 query.
prepare(
"DELETE FROM keybindings "
1693 "WHERE hostname = :HOSTNAME;");
1697 query.
prepare(
"DELETE FROM jumppoints "
1698 "WHERE hostname = :HOSTNAME;");
1742 query.
prepare(
"DELETE FROM inuseprograms "
1743 "WHERE hostname = :HOSTNAME and recusage = 'player' ;");
1751 bool autoStart =
false;
1757 QDateTime startupTime = QDateTime();
1766 if (startupTime.isValid())
1769 startupSecs = std::max(startupSecs, 15 * 60s);
1776 LOG(VB_GENERAL, LOG_INFO,
1777 "Close to auto-start time, AUTO-Startup assumed");
1783 LOG(VB_GENERAL, LOG_INFO,
1784 "Close to MythFillDB suggested run time, AUTO-Startup to fetch guide data?");
1789 LOG(VB_GENERAL, LOG_DEBUG,
1790 "NOT close to auto-start time, USER-initiated startup assumed");
1799 if (!wakeupCmd.isEmpty())
1802 bool bConflicts =
false;
1803 QDateTime nextRecordingStart;
1810 for (
auto *prog : progList)
1814 (prog->GetHostname() ==
hostname) &&
1815 (nextRecordingStart.isNull() ||
1816 nextRecordingStart > prog->GetRecordingStartTime()))
1818 nextRecordingStart = prog->GetRecordingStartTime();
1822 if (!nextRecordingStart.isNull() &&
1825 LOG(VB_GENERAL, LOG_INFO,
1826 "Close to start time, AUTO-Startup assumed");
1833 LOG(VB_GENERAL, LOG_DEBUG,
1834 "NOT close to auto-start time, USER-initiated startup assumed");
1859 Q_DECL_EXPORT
int main(
int argc,
char **argv)
1861 bool bPromptForBackend =
false;
1862 bool bBypassAutoDiscovery =
false;
1884 QApplication::setSetuidAllowed(
true);
1885 QApplication a(argc, argv);
1890 QString path = QCoreApplication::applicationDirPath();
1892 QString(
"%1/../Resources/lib/%2/site-packages:%3")
1894 .arg(QFileInfo(PYTHON_EXE).fileName())
1895 .arg(QProcessEnvironment::systemEnvironment().value(
"PYTHONPATH"))
1896 .toUtf8().constData(), 1);
1905 #if defined(Q_OS_ANDROID)
1906 auto config = QSslConfiguration::defaultConfiguration();
1907 config.setCaCertificates(QSslConfiguration::systemCaCertificates());
1908 QSslConfiguration::setDefaultConfiguration(config);
1915 bool ResetSettings =
false;
1918 bPromptForBackend =
true;
1920 bBypassAutoDiscovery =
true;
1922 if (signal(
SIGPIPE, SIG_IGN) == SIG_ERR)
1923 std::cerr <<
"Unable to ignore SIGPIPE\n";
1933 if (!
gContext->
Init(
true, bPromptForBackend, bBypassAutoDiscovery))
1935 LOG(VB_GENERAL, LOG_ERR,
"Failed to init MythContext, exiting.");
1949 ResetSettings =
true;
1964 QDir dir(fileprefix);
1966 dir.mkdir(fileprefix);
1979 LOG(VB_GENERAL, LOG_NOTICE,
"Appearance settings and language have "
1980 "been reset to defaults. You will need to "
1981 "restart the frontend.");
1986 #if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
1988 if (maxImageSize >=0)
1989 QImageReader::setAllocationLimit(maxImageSize);
1991 QCoreApplication::setSetuidAllowed(
true);
1995 LOG(VB_GENERAL, LOG_ERR,
"Failed to revokeRoot(), exiting.");
1999 #ifdef USING_LIBDNS_SD
2005 fe_sd_notify(
"STATUS=Registering frontend with bonjour");
2010 QByteArray name(
"Mythfrontend on ");
2012 bonjour->Register(port,
"_mythfrontend._tcp",
2031 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find theme '%1'")
2040 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find theme '%1'")
2054 mainWindow->Init(
false);
2055 mainWindow->setWindowTitle(QCoreApplication::translate(
"(MythFrontendMain)",
2057 "Main window title"));
2059 #ifdef USING_AIRPLAY
2082 LOG(VB_GENERAL, LOG_ERR,
2083 "Couldn't upgrade database to new schema, exiting.");
2091 mainWindow->ReloadKeys();
2114 mainWindow->installEventFilter(mon);
2123 if (!networkControl->
listen(port))
2125 LOG(VB_GENERAL, LOG_ERR,
2126 QString(
"NetworkControl failed to bind to port %1.")
2142 std::unique_ptr<ThemeUpdateChecker> themeUpdateChecker;
2144 themeUpdateChecker = std::make_unique<ThemeUpdateChecker>();
2156 #ifdef CONFIG_BINDINGS_PYTHON
2160 housekeeping->Start();
2173 LOG(VB_GENERAL, LOG_ERR,
2174 QString(
"Invalid plugin name supplied on command line: '%1'")
2176 LOG(VB_GENERAL, LOG_ERR,
2177 QString(
"Available plugins: %1")
2178 .arg(plugins.join(
", ")));
2190 LOG(VB_GENERAL, LOG_ERR,
2191 QString(
"Invalid jump point supplied on the command line: %1")
2193 LOG(VB_GENERAL, LOG_ERR,
2194 QString(
"Available jump points: %2")
2223 ret = QCoreApplication::exec();
2233 delete housekeeping;
2240 delete networkControl;
2246 LOG(VB_GENERAL, LOG_INFO,
"Reloading theme");
2255 LOG(VB_GENERAL, LOG_INFO,
"Restarting LIRC handler");
2263 #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)
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.
@ kStartTVIgnoreLastPlayPos
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.