Go to the documentation of this file.
12 #include <QtAndroidExtras>
14 #include <QApplication>
22 #include <QProcessEnvironment>
38 #include "libmythbase/mythconfig.h"
46 #include "libmythbase/mythversion.h"
116 #ifdef USING_LIBDNS_SD
117 #include <QScopedPointer>
120 #if CONFIG_SYSTEMD_NOTIFY
121 #include <systemd/sd-daemon.h>
122 static inline void fe_sd_notify(
const char *str) { sd_notify(0, str); };
144 static bool gLoaded =
false;
147 static const QString
sLocation = QCoreApplication::translate(
"(Common)",
152 class RunSettingsCompletion :
public QObject
157 static void Create(
bool check)
159 new RunSettingsCompletion(check);
163 explicit RunSettingsCompletion(
bool check)
168 this, &RunSettingsCompletion::OnPasswordResultReady);
177 ~RunSettingsCompletion()
override =
default;
180 void OnPasswordResultReady(
bool passwordValid,
201 LOG(VB_GENERAL, LOG_WARNING,
202 "Aggressive Parental Controls Warning: "
203 "invalid password. An attempt to enter a "
204 "MythVideo settings screen was prevented.");
219 Q_DECLARE_TR_FUNCTIONS(BookmarkDialog)
223 bool bookmarkPresent,
bool lastPlayPresent) :
226 m_bookmarked(bookmarkPresent),
227 m_lastPlayed(lastPlayPresent),
228 m_btnPlayBookmark(tr(
"Play from bookmark")),
229 m_btnClearBookmark(tr(
"Clear bookmark")),
230 m_btnPlayBegin(tr(
"Play from beginning")),
231 m_btnPlayLast(tr(
"Play from last played position")),
232 m_btnClearLast(tr(
"Clear last played position")) {
237 QString msg = tr(
"DVD/Video contains a bookmark");
240 if (!popup->Create())
248 popup->SetReturnEvent(
this,
"bookmarkdialog");
250 popup->AddButton(m_btnPlayLast);
252 popup->AddButton(m_btnPlayBookmark);
253 popup->AddButton(m_btnPlayBegin);
255 popup->AddButton(m_btnClearLast);
257 popup->AddButton(m_btnClearBookmark);
267 QString buttonText = dce->GetResultText();
269 if (dce->GetId() !=
"bookmarkdialog")
272 if (buttonText == m_btnPlayLast)
274 else if (buttonText == m_btnPlayBookmark)
276 else if (buttonText == m_btnPlayBegin)
278 else if (buttonText == m_btnClearBookmark)
279 m_pgi->SaveBookmark(0);
280 else if (buttonText == m_btnClearLast)
281 m_pgi->SaveLastPlayPos(0);
287 bool m_bookmarked {
false};
288 bool m_lastPlayed {
false};
289 QString m_btnPlayBookmark;
290 QString m_btnClearBookmark;
291 QString m_btnPlayBegin;
292 QString m_btnPlayLast;
293 QString m_btnClearLast;
298 QCoreApplication::processEvents();
310 LOG(VB_GENERAL, LOG_INFO,
"Shutting down UPnP client...");
350 ShowOkPopup(QCoreApplication::translate(
"(MythFrontendMain)",
351 "The ScreenSetupWizard cannot be used while "
352 "mythfrontend is operating in windowed mode."));
389 auto *mythcontrols =
new MythControls(mainStack,
"mythcontrols");
391 if (mythcontrols->Create())
516 if (viewsched->Create())
528 if (progRecPrior->Create())
540 if (chanRecPrior->Create())
552 if (custom->Create())
562 auto *pbb =
new PlaybackBox(mainStack,
"playbackbox");
566 if (!recGroup.isEmpty())
567 pbb->setInitialRecGroup(recGroup);
605 if (custom->Create())
617 if (mansched->Create())
628 QString msg = QCoreApplication::translate(
"(Common)",
"All tuners are currently busy.");
631 msg = QCoreApplication::translate(
"(Common)",
"There are no configured tuners.");
646 while (keylist.size() < 2)
669 auto *statusbox =
new StatusBox(mainStack);
671 if (statusbox->Create())
684 if (idlescreen->Create())
692 QString message = QCoreApplication::translate(
"(MythFrontendMain)",
693 "Loading videos ...");
699 "mythvideobusydialog");
701 if (busyPopup->Create())
713 video_list = saved->GetSaved();
714 LOG(VB_GENERAL, LOG_INFO,
715 QString(
"Reusing saved video list because MythVideo was resumed"
730 if (mythvideo->Create())
749 if (galleryView->Create())
752 galleryView->Start();
768 QString command_string =
770 QString bluray_mountpoint =
772 QDir bdtest(bluray_mountpoint +
"/BDMV");
781 QString
filename = QString(
"bd:/%1").arg(bluray_mountpoint);
784 0, 0,
"", 0min,
"",
"",
true);
792 if (dvd_device.isEmpty())
797 if ((command_string.indexOf(
"internal", 0, Qt::CaseInsensitive) > -1) ||
798 (command_string.length() < 1))
803 #elif defined(_WIN32)
810 command_string =
"Internal";
812 "",
"", 0, 0,
"", 0min,
"",
"",
true);
818 if (command_string.contains(
"%d"))
823 command_string = command_string.replace(
"%d", dvd_device);
859 LOG(VB_GENERAL, LOG_ERR,
860 "mythdvd main.o: handleMedia() does not know what to do");
872 QVector<MythScreenType*> screens;
876 for (
const auto *screen : qAsConst(screens))
878 if (qobject_cast<const GalleryThumbView*>(screen))
881 LOG(VB_MEDIA, LOG_INFO,
"Main: Ignoring new gallery media - already running");
888 LOG(VB_GUI, LOG_INFO,
"Main: Autostarting Gallery for new media");
892 LOG(VB_MEDIA, LOG_INFO,
"Main: Ignoring new gallery media - autorun not set");
898 QString sel = selection.toLower();
900 if (sel.startsWith(
"settings ") || sel ==
"video_settings_general")
908 if (sel ==
"tv_watch_live")
910 else if (sel.startsWith(
"tv_watch_recording"))
913 if ((selection.length() > 19) && (selection.mid(18, 1) ==
" "))
918 else if (sel ==
"tv_schedule")
920 else if (sel ==
"tv_manualschedule")
922 else if (sel ==
"tv_custom_record")
924 else if (sel ==
"tv_fix_conflicts")
926 else if (sel ==
"tv_manage_recording_rules")
928 else if (sel ==
"tv_progfind")
930 else if (sel ==
"tv_search_title")
932 else if (sel ==
"tv_search_keyword")
934 else if (sel ==
"tv_search_people")
936 else if (sel ==
"tv_search_power")
938 else if (sel ==
"tv_search_stored")
940 else if (sel ==
"tv_search_channel")
942 else if (sel ==
"tv_search_category")
944 else if (sel ==
"tv_search_movie")
946 else if (sel ==
"tv_search_new")
948 else if (sel ==
"tv_search_time")
950 else if (sel ==
"tv_previous")
952 else if (sel ==
"tv_previous_old")
954 else if (sel ==
"settings appearance")
967 else if (sel ==
"settings themechooser")
977 else if (sel ==
"settings setupwizard")
987 else if (sel ==
"settings grabbers")
997 else if (sel ==
"screensetupwizard")
1001 else if (sel ==
"setup_keys")
1005 else if (sel ==
"settings playgroup")
1018 else if (sel ==
"settings general")
1031 else if (sel ==
"settings audiogeneral")
1045 else if (sel ==
"settings maingeneral")
1058 else if (sel ==
"settings playback")
1071 else if (sel ==
"settings osd")
1084 else if (sel ==
"settings epg")
1097 else if (sel ==
"settings channelgroups")
1110 else if (sel ==
"settings generalrecpriorities")
1114 "generalrecprioritiessettings",
1124 else if (sel ==
"settings channelrecpriorities")
1128 else if (sel ==
"settings custompriority")
1132 else if (sel ==
"system_events")
1143 else if (sel ==
"video_settings_general")
1146 GetBoolSetting(
"VideoAggressivePC",
false));
1148 else if (sel ==
"video_settings_player")
1159 else if (sel ==
"video_settings_metadata")
1170 else if (sel ==
"video_settings_associations")
1179 else if (sel ==
"manager")
1181 else if (sel ==
"browser")
1183 else if (sel ==
"listing")
1185 else if (sel ==
"gallery")
1187 else if (sel ==
"disc_play")
1191 else if (sel ==
"tv_status")
1193 else if (sel ==
"exiting_app_prompt")
1195 else if (sel ==
"exiting_app")
1197 else if (sel ==
"standby_mode")
1199 else if (sel ==
"exiting_menu")
1204 LOG(VB_GENERAL, LOG_ERR,
"Unknown menu action: " + selection);
1206 if (sel.startsWith(
"settings ") || sel ==
"video_settings_general")
1222 prompter->HandleExit();
1238 LOG(VB_GENERAL, LOG_NOTICE, QString(
"Found mainmenu.xml for theme '%1'")
1245 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find mainmenu.xml for theme '%1'")
1285 const QString &title,
const QString &subtitle,
1286 const QString &director,
int season,
int episode,
1287 const QString &inetref, std::chrono::minutes lenMins,
1288 const QString &year,
1289 const QString &
id,
const bool useBookmark)
1293 QFile checkFile(mrl);
1294 if ((!checkFile.exists() && !mrl.startsWith(
"dvd:")
1295 && !mrl.startsWith(
"bd:")
1296 && !mrl.startsWith(
"myth:")
1297 && !mrl.startsWith(
"http://")
1298 && !mrl.startsWith(
"https://")))
1300 QString errorText = QCoreApplication::translate(
"(MythFrontendMain)",
1301 "Failed to open \n '%1' in %2 \n"
1302 "Check if the video exists")
1303 .arg(mrl.section(
'/', -1),
1304 mrl.section(
'/', 0, -2));
1311 mrl, plot, title, QString(), subtitle, QString(),
1312 director, season, episode, inetref, lenMins,
1313 (year.toUInt()) ? year.toUInt() : 1900,
id);
1315 pginfo->SetProgramInfoType(pginfo->DiscoverProgramInfoType());
1317 bool bookmarkPresent =
false;
1318 bool lastPlayPresent =
false;
1320 if (pginfo->IsVideoDVD())
1322 auto *dvd =
new MythDVDInfo(pginfo->GetPlaybackURL());
1327 if (dvd->GetNameAndSerialNum(name, serialid))
1329 QStringList fields = pginfo->QueryDVDBookmark(serialid);
1330 bookmarkPresent = (fields.count() > 0);
1338 dvd->GetLastError());
1345 else if (pginfo->IsVideoBD())
1354 QStringList fields = pginfo->QueryBDBookmark(serialid);
1355 bookmarkPresent = (fields.count() > 0);
1368 else if (useBookmark && pginfo->IsVideo())
1370 pginfo->SetIgnoreLastPlayPos(
false);
1371 pginfo->SetIgnoreBookmark(
false);
1372 bookmarkPresent = pginfo->QueryBookmark() > 0;
1373 lastPlayPresent = pginfo->QueryLastPlayPos() > 0;
1376 if (useBookmark && (bookmarkPresent || lastPlayPresent))
1379 auto *bookmarkdialog =
new BookmarkDialog(pginfo, mainStack,
1382 if (!bookmarkdialog->Create())
1384 delete bookmarkdialog;
1404 auto *lmenu = qobject_cast<MythThemedMenuState *>
1407 lmenu->m_buttonList->SetItemCurrent(0);
1419 LOG(VB_GENERAL, LOG_WARNING, QString(
"Overriding broken theme '%1' with '%2'")
1420 .arg(badtheme, themename));
1439 auto activity = QtAndroid::androidActivity();
1440 auto packageManager = activity.callObjectMethod
1441 (
"getPackageManager",
1442 "()Landroid/content/pm/PackageManager;" );
1444 auto activityIntent = packageManager.callObjectMethod
1445 (
"getLaunchIntentForPackage",
1446 "(Ljava/lang/String;)Landroid/content/Intent;",
1447 activity.callObjectMethod(
"getPackageName",
1448 "()Ljava/lang/String;").object() );
1450 auto pendingIntent = QAndroidJniObject::callStaticObjectMethod
1451 (
"android/app/PendingIntent",
1453 "(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;",
1456 activityIntent.object(),
1457 QAndroidJniObject::getStaticField<jint>(
"android/content/Intent",
1458 "FLAG_ACTIVITY_CLEAR_TOP") );
1460 auto alarmManager = activity.callObjectMethod
1461 (
"getSystemService",
1462 "(Ljava/lang/String;)Ljava/lang/Object;",
1463 QAndroidJniObject::getStaticObjectField(
"android/content/Context",
1465 "Ljava/lang/String;").
object() );
1467 alarmManager.callMethod<
void>
1469 "(IJLandroid/app/PendingIntent;)V",
1470 QAndroidJniObject::getStaticField<jint>(
"android/app/AlarmManager",
"RTC"),
1471 jlong(QDateTime::currentMSecsSinceEpoch() + 100),
1472 pendingIntent.object() );
1488 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find theme '%1'").arg(themename));
1540 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Reload Theme"),
1542 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Main Menu"),
1544 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"Program Guide"),
1546 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"Program Finder"),
1550 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"Manage Recordings / "
1551 "Fix Conflicts"),
"",
"",
startManaged,
"VIEWSCHEDULED");
1552 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Manage Recording Rules"),
1554 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Channel Recording "
1556 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"TV Recording Playback"),
1558 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Live TV"),
1560 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Status Screen"),
1562 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Previously Recorded"),
1565 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Standby Mode"),
1580 REG_JUMP(
"Play Disc", QT_TRANSLATE_NOOP(
"MythControls",
1581 "Play an Optical Disc"),
"",
playDisc);
1588 REG_JUMPEX(QT_TRANSLATE_NOOP(
"MythControls",
"Toggle Show Widget Borders"),
1590 REG_JUMPEX(QT_TRANSLATE_NOOP(
"MythControls",
"Toggle Show Widget Names"),
1592 REG_JUMPEX(QT_TRANSLATE_NOOP(
"MythControls",
"Reset All Keys"),
1593 QT_TRANSLATE_NOOP(
"MythControls",
"Reset all keys to defaults"),
1606 REG_KEY(
"Video",
"PLAYALT", QT_TRANSLATE_NOOP(
"MythControls",
1607 "Play selected item in alternate player"),
"ALT+P");
1608 REG_KEY(
"Video",
"FILTER", QT_TRANSLATE_NOOP(
"MythControls",
1609 "Open video filter dialog"),
"F");
1610 REG_KEY(
"Video",
"INCPARENT", QT_TRANSLATE_NOOP(
"MythControls",
1611 "Increase Parental Level"),
"],},F11");
1612 REG_KEY(
"Video",
"DECPARENT", QT_TRANSLATE_NOOP(
"MythControls",
1613 "Decrease Parental Level"),
"[,{,F10");
1614 REG_KEY(
"Video",
"INCSEARCH", QT_TRANSLATE_NOOP(
"MythControls",
1615 "Show Incremental Search Dialog"),
"Ctrl+S");
1616 REG_KEY(
"Video",
"DOWNLOADDATA", QT_TRANSLATE_NOOP(
"MythControls",
1617 "Download metadata for current item"),
"W");
1618 REG_KEY(
"Video",
"ITEMDETAIL", QT_TRANSLATE_NOOP(
"MythControls",
1619 "Display Item Detail Popup"),
"");
1622 REG_KEY(
"Images",
"PLAY", QT_TRANSLATE_NOOP(
"MythControls",
1623 "Start/Stop Slideshow"),
"P");
1624 REG_KEY(
"Images",
"RECURSIVESHOW", QT_TRANSLATE_NOOP(
"MythControls",
1625 "Start Recursive Slideshow"),
"R");
1626 REG_KEY(
"Images",
"ROTRIGHT", QT_TRANSLATE_NOOP(
"MythControls",
1627 "Rotate image right 90 degrees"),
"],3");
1628 REG_KEY(
"Images",
"ROTLEFT", QT_TRANSLATE_NOOP(
"MythControls",
1629 "Rotate image left 90 degrees"),
"[,1");
1630 REG_KEY(
"Images",
"FLIPHORIZONTAL", QT_TRANSLATE_NOOP(
"MythControls",
1631 "Flip image horizontally"),
"");
1632 REG_KEY(
"Images",
"FLIPVERTICAL", QT_TRANSLATE_NOOP(
"MythControls",
1633 "Flip image vertically"),
"");
1634 REG_KEY(
"Images",
"ZOOMOUT", QT_TRANSLATE_NOOP(
"MythControls",
1635 "Zoom image out"),
"7");
1636 REG_KEY(
"Images",
"ZOOMIN", QT_TRANSLATE_NOOP(
"MythControls",
1637 "Zoom image in"),
"9");
1638 REG_KEY(
"Images",
"FULLSIZE", QT_TRANSLATE_NOOP(
"MythControls",
1639 "Full-size (un-zoom) image"),
"0");
1640 REG_KEY(
"Images",
"MARK", QT_TRANSLATE_NOOP(
"MythControls",
1641 "Mark image"),
"T");
1642 REG_KEY(
"Images",
"SCROLLUP", QT_TRANSLATE_NOOP(
"MythControls",
1643 "Scroll image up"),
"2");
1644 REG_KEY(
"Images",
"SCROLLLEFT", QT_TRANSLATE_NOOP(
"MythControls",
1645 "Scroll image left"),
"4");
1646 REG_KEY(
"Images",
"SCROLLRIGHT", QT_TRANSLATE_NOOP(
"MythControls",
1647 "Scroll image right"),
"6");
1648 REG_KEY(
"Images",
"SCROLLDOWN", QT_TRANSLATE_NOOP(
"MythControls",
1649 "Scroll image down"),
"8");
1650 REG_KEY(
"Images",
"RECENTER", QT_TRANSLATE_NOOP(
"MythControls",
1651 "Recenter image"),
"5");
1652 REG_KEY(
"Images",
"COVER", QT_TRANSLATE_NOOP(
"MythControls",
1653 "Set or clear cover image"),
"C");
1682 query.
prepare(
"DELETE FROM keybindings "
1683 "WHERE hostname = :HOSTNAME;");
1687 query.
prepare(
"DELETE FROM jumppoints "
1688 "WHERE hostname = :HOSTNAME;");
1732 query.
prepare(
"DELETE FROM inuseprograms "
1733 "WHERE hostname = :HOSTNAME and recusage = 'player' ;");
1741 bool autoStart =
false;
1747 QDateTime startupTime = QDateTime();
1756 if (startupTime.isValid())
1759 startupSecs = std::max(startupSecs, 15 * 60s);
1766 LOG(VB_GENERAL, LOG_INFO,
1767 "Close to auto-start time, AUTO-Startup assumed");
1773 LOG(VB_GENERAL, LOG_INFO,
1774 "Close to MythFillDB suggested run time, AUTO-Startup to fetch guide data?");
1779 LOG(VB_GENERAL, LOG_DEBUG,
1780 "NOT close to auto-start time, USER-initiated startup assumed");
1789 if (!wakeupCmd.isEmpty())
1792 bool bConflicts =
false;
1793 QDateTime nextRecordingStart;
1800 for (
auto *prog : progList)
1804 (prog->GetHostname() ==
hostname) &&
1805 (nextRecordingStart.isNull() ||
1806 nextRecordingStart > prog->GetRecordingStartTime()))
1808 nextRecordingStart = prog->GetRecordingStartTime();
1812 if (!nextRecordingStart.isNull() &&
1815 LOG(VB_GENERAL, LOG_INFO,
1816 "Close to start time, AUTO-Startup assumed");
1823 LOG(VB_GENERAL, LOG_DEBUG,
1824 "NOT close to auto-start time, USER-initiated startup assumed");
1849 Q_DECL_EXPORT
int main(
int argc,
char **argv)
1851 bool bPromptForBackend =
false;
1852 bool bBypassAutoDiscovery =
false;
1874 QApplication::setSetuidAllowed(
true);
1875 QApplication a(argc, argv);
1880 QString path = QCoreApplication::applicationDirPath();
1882 QString(
"%1/../Resources/lib/%2/site-packages:%3")
1884 .arg(QFileInfo(PYTHON_EXE).fileName())
1885 .arg(QProcessEnvironment::systemEnvironment().value(
"PYTHONPATH"))
1886 .toUtf8().constData(), 1);
1895 #if defined(Q_OS_ANDROID)
1896 auto config = QSslConfiguration::defaultConfiguration();
1897 config.setCaCertificates(QSslConfiguration::systemCaCertificates());
1898 QSslConfiguration::setDefaultConfiguration(config);
1905 bool ResetSettings =
false;
1908 bPromptForBackend =
true;
1910 bBypassAutoDiscovery =
true;
1912 if (signal(
SIGPIPE, SIG_IGN) == SIG_ERR)
1913 std::cerr <<
"Unable to ignore SIGPIPE\n";
1923 if (!
gContext->
Init(
true, bPromptForBackend, bBypassAutoDiscovery))
1925 LOG(VB_GENERAL, LOG_ERR,
"Failed to init MythContext, exiting.");
1939 ResetSettings =
true;
1954 QDir dir(fileprefix);
1956 dir.mkdir(fileprefix);
1969 LOG(VB_GENERAL, LOG_NOTICE,
"Appearance settings and language have "
1970 "been reset to defaults. You will need to "
1971 "restart the frontend.");
1976 #if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
1978 if (maxImageSize >=0)
1979 QImageReader::setAllocationLimit(maxImageSize);
1981 QCoreApplication::setSetuidAllowed(
true);
1985 LOG(VB_GENERAL, LOG_ERR,
"Failed to revokeRoot(), exiting.");
1989 #ifdef USING_LIBDNS_SD
1995 fe_sd_notify(
"STATUS=Registering frontend with bonjour");
1998 QByteArray name(
"Mythfrontend on ");
2000 bonjour->Register(port,
"_mythfrontend._tcp",
2019 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find theme '%1'")
2028 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find theme '%1'")
2042 mainWindow->Init(
false);
2043 mainWindow->setWindowTitle(QCoreApplication::translate(
"(MythFrontendMain)",
2045 "Main window title"));
2047 #ifdef USING_AIRPLAY
2070 LOG(VB_GENERAL, LOG_ERR,
2071 "Couldn't upgrade database to new schema, exiting.");
2079 mainWindow->ReloadKeys();
2102 mainWindow->installEventFilter(mon);
2111 if (!networkControl->
listen(port))
2113 LOG(VB_GENERAL, LOG_ERR,
2114 QString(
"NetworkControl failed to bind to port %1.")
2130 std::unique_ptr<ThemeUpdateChecker> themeUpdateChecker;
2132 themeUpdateChecker = std::make_unique<ThemeUpdateChecker>();
2144 #ifdef CONFIG_BINDINGS_PYTHON
2148 housekeeping->Start();
2161 LOG(VB_GENERAL, LOG_ERR,
2162 QString(
"Invalid plugin name supplied on command line: '%1'")
2164 LOG(VB_GENERAL, LOG_ERR,
2165 QString(
"Available plugins: %1")
2166 .arg(plugins.join(
", ")));
2178 LOG(VB_GENERAL, LOG_ERR,
2179 QString(
"Invalid jump point supplied on the command line: %1")
2181 LOG(VB_GENERAL, LOG_ERR,
2182 QString(
"Available jump points: %2")
2206 ret = QCoreApplication::exec();
2216 delete housekeeping;
2223 delete networkControl;
2229 LOG(VB_GENERAL, LOG_INFO,
"Reloading theme");
2238 LOG(VB_GENERAL, LOG_INFO,
"Restarting LIRC handler");
2246 #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.
bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, const bool upgradeIfNoUI, const bool informSystemd)
Called from outside dbcheck.cpp to update the schema.
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)
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 void TVMenuCallback(void *data, QString &selection)
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.
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 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.
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 startKeysSetup()
static void InitKeys(void)
std::vector< ChannelInfo > ChannelInfoList
@ GENERIC_EXIT_DB_ERROR
Database error.