Go to the documentation of this file.
15 #include <QApplication>
18 #include <QProcessEnvironment>
22 #include <QtAndroidExtras>
28 #include "mythconfig.h"
116 #ifdef USING_LIBDNS_SD
117 #include <QScopedPointer>
120 #if CONFIG_SYSTEMD_NOTIFY
121 #include <systemd/sd-daemon.h>
122 #define fe_sd_notify(x) \
123 (void)sd_notify(0, x);
125 #define fe_sd_notify(x)
141 static bool gLoaded =
false;
144 static const QString
sLocation = QCoreApplication::translate(
"(Common)",
149 class RunSettingsCompletion :
public QObject
154 static void Create(
bool check)
156 new RunSettingsCompletion(check);
160 explicit RunSettingsCompletion(
bool check)
165 this, &RunSettingsCompletion::OnPasswordResultReady);
174 ~RunSettingsCompletion()
override =
default;
177 void OnPasswordResultReady(
bool passwordValid,
198 LOG(VB_GENERAL, LOG_WARNING,
199 "Aggressive Parental Controls Warning: "
200 "invalid password. An attempt to enter a "
201 "MythVideo settings screen was prevented.");
213 Q_DECLARE_TR_FUNCTIONS(BookmarkDialog)
224 QString msg = tr(
"DVD/Video contains a bookmark");
225 QString btn0msg = tr(
"Play from bookmark");
226 QString btn1msg = tr(
"Play from beginning");
229 if (!popup->Create())
237 popup->SetReturnEvent(
this,
"bookmarkdialog");
238 popup->AddButton(btn0msg);
239 popup->AddButton(btn1msg);
248 int buttonnum = dce->GetResult();
250 if (dce->GetId() ==
"bookmarkdialog")
257 else if (buttonnum != 0)
276 QCoreApplication::processEvents();
288 LOG(VB_GENERAL, LOG_INFO,
"Shutting down UPnP client...");
328 ShowOkPopup(QCoreApplication::translate(
"(MythFrontendMain)",
329 "The ScreenSetupWizard cannot be used while "
330 "mythfrontend is operating in windowed mode."));
367 auto *mythcontrols =
new MythControls(mainStack,
"mythcontrols");
369 if (mythcontrols->Create())
494 if (viewsched->Create())
506 if (progRecPrior->Create())
518 if (chanRecPrior->Create())
530 if (custom->Create())
540 auto *pbb =
new PlaybackBox(mainStack,
"playbackbox");
544 if (!recGroup.isEmpty())
545 pbb->setInitialRecGroup(recGroup);
583 if (custom->Create())
595 if (mansched->Create())
606 QString msg = QCoreApplication::translate(
"(Common)",
"All tuners are currently busy.");
609 msg = QCoreApplication::translate(
"(Common)",
"There are no configured tuners.");
624 while (keylist.size() < 2)
647 auto *statusbox =
new StatusBox(mainStack);
649 if (statusbox->Create())
662 if (idlescreen->Create())
670 QString message = QCoreApplication::translate(
"(MythFrontendMain)",
671 "Loading videos ...");
677 "mythvideobusydialog");
679 if (busyPopup->Create())
691 video_list = saved->GetSaved();
692 LOG(VB_GENERAL, LOG_INFO,
693 QString(
"Reusing saved video list because MythVideo was resumed"
708 if (mythvideo->Create())
727 if (galleryView->Create())
730 galleryView->Start();
746 QString command_string =
748 QString bluray_mountpoint =
750 QDir bdtest(bluray_mountpoint +
"/BDMV");
759 QString
filename = QString(
"bd:/%1").arg(bluray_mountpoint);
762 0, 0,
"", 0,
"",
"",
true);
770 if (dvd_device.isEmpty())
775 if ((command_string.indexOf(
"internal", 0, Qt::CaseInsensitive) > -1) ||
776 (command_string.length() < 1))
788 command_string =
"Internal";
790 "",
"", 0, 0,
"", 0,
"",
"",
true);
796 if (command_string.contains(
"%d"))
802 command_string.replace(QRegExp(
"%d"), dvd_device);
838 LOG(VB_GENERAL, LOG_ERR,
839 "mythdvd main.o: handleMedia() does not know what to do");
851 QVector<MythScreenType*> screens;
855 for (
const auto *screen : qAsConst(screens))
857 if (qobject_cast<const GalleryThumbView*>(screen))
860 LOG(VB_MEDIA, LOG_INFO,
"Main: Ignoring new gallery media - already running");
867 LOG(VB_GUI, LOG_INFO,
"Main: Autostarting Gallery for new media");
871 LOG(VB_MEDIA, LOG_INFO,
"Main: Ignoring new gallery media - autorun not set");
877 QString sel = selection.toLower();
879 if (sel.startsWith(
"settings ") || sel ==
"video_settings_general")
887 if (sel ==
"tv_watch_live")
889 else if (sel.startsWith(
"tv_watch_recording"))
892 if ((selection.length() > 19) && (selection.mid(18, 1) ==
" "))
897 else if (sel ==
"tv_schedule")
899 else if (sel ==
"tv_manualschedule")
901 else if (sel ==
"tv_custom_record")
903 else if (sel ==
"tv_fix_conflicts")
905 else if (sel ==
"tv_manage_recording_rules")
907 else if (sel ==
"tv_progfind")
909 else if (sel ==
"tv_search_title")
911 else if (sel ==
"tv_search_keyword")
913 else if (sel ==
"tv_search_people")
915 else if (sel ==
"tv_search_power")
917 else if (sel ==
"tv_search_stored")
919 else if (sel ==
"tv_search_channel")
921 else if (sel ==
"tv_search_category")
923 else if (sel ==
"tv_search_movie")
925 else if (sel ==
"tv_search_new")
927 else if (sel ==
"tv_search_time")
929 else if (sel ==
"tv_previous")
931 else if (sel ==
"tv_previous_old")
933 else if (sel ==
"settings appearance")
946 else if (sel ==
"settings themechooser")
956 else if (sel ==
"settings setupwizard")
966 else if (sel ==
"settings grabbers")
976 else if (sel ==
"screensetupwizard")
980 else if (sel ==
"setup_keys")
984 else if (sel ==
"settings playgroup")
997 else if (sel ==
"settings general")
1010 else if (sel ==
"settings audiogeneral")
1024 else if (sel ==
"settings maingeneral")
1037 else if (sel ==
"settings playback")
1050 else if (sel ==
"settings osd")
1063 else if (sel ==
"settings epg")
1076 else if (sel ==
"settings channelgroups")
1089 else if (sel ==
"settings generalrecpriorities")
1093 "generalrecprioritiessettings",
1103 else if (sel ==
"settings channelrecpriorities")
1107 else if (sel ==
"settings custompriority")
1111 else if (sel ==
"system_events")
1122 else if (sel ==
"video_settings_general")
1125 GetBoolSetting(
"VideoAggressivePC",
false));
1127 else if (sel ==
"video_settings_player")
1138 else if (sel ==
"video_settings_metadata")
1149 else if (sel ==
"video_settings_associations")
1158 else if (sel ==
"manager")
1160 else if (sel ==
"browser")
1162 else if (sel ==
"listing")
1164 else if (sel ==
"gallery")
1166 else if (sel ==
"disc_play")
1170 else if (sel ==
"tv_status")
1172 else if (sel ==
"exiting_app_prompt")
1174 else if (sel ==
"exiting_app")
1176 else if (sel ==
"standby_mode")
1178 else if (sel ==
"exiting_menu")
1183 LOG(VB_GENERAL, LOG_ERR,
"Unknown menu action: " + selection);
1185 if (sel.startsWith(
"settings ") || sel ==
"video_settings_general")
1201 prompter->HandleExit();
1217 LOG(VB_GENERAL, LOG_NOTICE, QString(
"Found mainmenu.xml for theme '%1'")
1224 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find mainmenu.xml for theme '%1'")
1264 const QString &
title,
const QString &subtitle,
1265 const QString &director,
int season,
int episode,
1266 const QString &inetref,
int lenMins,
const QString &year,
1267 const QString &
id,
const bool useBookmark)
1271 QFile checkFile(mrl);
1272 if ((!checkFile.exists() && !mrl.startsWith(
"dvd:")
1273 && !mrl.startsWith(
"bd:")
1274 && !mrl.startsWith(
"myth:")
1275 && !mrl.startsWith(
"http://")
1276 && !mrl.startsWith(
"https://")))
1278 QString errorText = QCoreApplication::translate(
"(MythFrontendMain)",
1279 "Failed to open \n '%1' in %2 \n"
1280 "Check if the video exists")
1281 .arg(mrl.section(
'/', -1))
1282 .arg(mrl.section(
'/', 0, -2));
1289 mrl, plot,
title, QString(), subtitle, QString(),
1290 director, season, episode, inetref, lenMins,
1291 (year.toUInt()) ? year.toUInt() : 1900,
id);
1293 pginfo->SetProgramInfoType(pginfo->DiscoverProgramInfoType());
1295 bool bookmarkPresent =
false;
1297 if (pginfo->IsVideoDVD())
1299 auto *dvd =
new MythDVDInfo(pginfo->GetPlaybackURL());
1304 if (dvd->GetNameAndSerialNum(name, serialid))
1306 QStringList fields = pginfo->QueryDVDBookmark(serialid);
1307 bookmarkPresent = (fields.count() > 0);
1315 dvd->GetLastError());
1322 else if (pginfo->IsVideoBD())
1331 QStringList fields = pginfo->QueryBDBookmark(serialid);
1332 bookmarkPresent = (fields.count() > 0);
1346 else if (pginfo->IsVideo())
1347 bookmarkPresent = (pginfo->QueryBookmark() > 0);
1349 if (useBookmark && bookmarkPresent)
1352 auto *bookmarkdialog =
new BookmarkDialog(pginfo, mainStack);
1353 if (!bookmarkdialog->Create())
1355 delete bookmarkdialog;
1375 auto *lmenu = qobject_cast<MythThemedMenuState *>
1378 lmenu->m_buttonList->SetItemCurrent(0);
1390 LOG(VB_GENERAL, LOG_WARNING, QString(
"Overriding broken theme '%1' with '%2'")
1391 .
arg(badtheme).
arg(themename));
1411 auto activity = QtAndroid::androidActivity();
1412 auto packageManager = activity.callObjectMethod
1413 (
"getPackageManager",
1414 "()Landroid/content/pm/PackageManager;" );
1416 auto activityIntent = packageManager.callObjectMethod
1417 (
"getLaunchIntentForPackage",
1418 "(Ljava/lang/String;)Landroid/content/Intent;",
1419 activity.callObjectMethod(
"getPackageName",
1420 "()Ljava/lang/String;").object() );
1422 auto pendingIntent = QAndroidJniObject::callStaticObjectMethod
1423 (
"android/app/PendingIntent",
1425 "(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;",
1428 activityIntent.object(),
1429 QAndroidJniObject::getStaticField<jint>(
"android/content/Intent",
1430 "FLAG_ACTIVITY_CLEAR_TOP") );
1432 auto alarmManager = activity.callObjectMethod
1433 (
"getSystemService",
1434 "(Ljava/lang/String;)Ljava/lang/Object;",
1435 QAndroidJniObject::getStaticObjectField(
"android/content/Context",
1437 "Ljava/lang/String;").
object() );
1439 alarmManager.callMethod<
void>
1441 "(IJLandroid/app/PendingIntent;)V",
1442 QAndroidJniObject::getStaticField<jint>(
"android/app/AlarmManager",
"RTC"),
1443 jlong(QDateTime::currentMSecsSinceEpoch() + 100),
1444 pendingIntent.object() );
1460 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find theme '%1'").
arg(themename));
1513 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Reload Theme"),
1515 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Main Menu"),
1517 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"Program Guide"),
1519 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"Program Finder"),
1523 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"Manage Recordings / "
1524 "Fix Conflicts"),
"",
"",
startManaged,
"VIEWSCHEDULED");
1525 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Manage Recording Rules"),
1527 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Channel Recording "
1529 REG_JUMPLOC(QT_TRANSLATE_NOOP(
"MythControls",
"TV Recording Playback"),
1531 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Live TV"),
1533 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Status Screen"),
1535 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Previously Recorded"),
1538 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Standby Mode"),
1553 REG_JUMP(
"Play Disc", QT_TRANSLATE_NOOP(
"MythControls",
1554 "Play an Optical Disc"),
"",
playDisc);
1561 REG_JUMPEX(QT_TRANSLATE_NOOP(
"MythControls",
"Toggle Show Widget Borders"),
1563 REG_JUMPEX(QT_TRANSLATE_NOOP(
"MythControls",
"Toggle Show Widget Names"),
1565 REG_JUMPEX(QT_TRANSLATE_NOOP(
"MythControls",
"Reset All Keys"),
1566 QT_TRANSLATE_NOOP(
"MythControls",
"Reset all keys to defaults"),
1579 REG_KEY(
"Video",
"PLAYALT", QT_TRANSLATE_NOOP(
"MythControls",
1580 "Play selected item in alternate player"),
"ALT+P");
1581 REG_KEY(
"Video",
"FILTER", QT_TRANSLATE_NOOP(
"MythControls",
1582 "Open video filter dialog"),
"F");
1583 REG_KEY(
"Video",
"INCPARENT", QT_TRANSLATE_NOOP(
"MythControls",
1584 "Increase Parental Level"),
"],},F11");
1585 REG_KEY(
"Video",
"DECPARENT", QT_TRANSLATE_NOOP(
"MythControls",
1586 "Decrease Parental Level"),
"[,{,F10");
1587 REG_KEY(
"Video",
"INCSEARCH", QT_TRANSLATE_NOOP(
"MythControls",
1588 "Show Incremental Search Dialog"),
"Ctrl+S");
1589 REG_KEY(
"Video",
"DOWNLOADDATA", QT_TRANSLATE_NOOP(
"MythControls",
1590 "Download metadata for current item"),
"W");
1591 REG_KEY(
"Video",
"ITEMDETAIL", QT_TRANSLATE_NOOP(
"MythControls",
1592 "Display Item Detail Popup"),
"");
1595 REG_KEY(
"Images",
"PLAY", QT_TRANSLATE_NOOP(
"MythControls",
1596 "Start/Stop Slideshow"),
"P");
1597 REG_KEY(
"Images",
"RECURSIVESHOW", QT_TRANSLATE_NOOP(
"MythControls",
1598 "Start Recursive Slideshow"),
"R");
1599 REG_KEY(
"Images",
"ROTRIGHT", QT_TRANSLATE_NOOP(
"MythControls",
1600 "Rotate image right 90 degrees"),
"],3");
1601 REG_KEY(
"Images",
"ROTLEFT", QT_TRANSLATE_NOOP(
"MythControls",
1602 "Rotate image left 90 degrees"),
"[,1");
1603 REG_KEY(
"Images",
"FLIPHORIZONTAL", QT_TRANSLATE_NOOP(
"MythControls",
1604 "Flip image horizontally"),
"");
1605 REG_KEY(
"Images",
"FLIPVERTICAL", QT_TRANSLATE_NOOP(
"MythControls",
1606 "Flip image vertically"),
"");
1607 REG_KEY(
"Images",
"ZOOMOUT", QT_TRANSLATE_NOOP(
"MythControls",
1608 "Zoom image out"),
"7");
1609 REG_KEY(
"Images",
"ZOOMIN", QT_TRANSLATE_NOOP(
"MythControls",
1610 "Zoom image in"),
"9");
1611 REG_KEY(
"Images",
"FULLSIZE", QT_TRANSLATE_NOOP(
"MythControls",
1612 "Full-size (un-zoom) image"),
"0");
1613 REG_KEY(
"Images",
"MARK", QT_TRANSLATE_NOOP(
"MythControls",
1614 "Mark image"),
"T");
1615 REG_KEY(
"Images",
"SCROLLUP", QT_TRANSLATE_NOOP(
"MythControls",
1616 "Scroll image up"),
"2");
1617 REG_KEY(
"Images",
"SCROLLLEFT", QT_TRANSLATE_NOOP(
"MythControls",
1618 "Scroll image left"),
"4");
1619 REG_KEY(
"Images",
"SCROLLRIGHT", QT_TRANSLATE_NOOP(
"MythControls",
1620 "Scroll image right"),
"6");
1621 REG_KEY(
"Images",
"SCROLLDOWN", QT_TRANSLATE_NOOP(
"MythControls",
1622 "Scroll image down"),
"8");
1623 REG_KEY(
"Images",
"RECENTER", QT_TRANSLATE_NOOP(
"MythControls",
1624 "Recenter image"),
"5");
1625 REG_KEY(
"Images",
"COVER", QT_TRANSLATE_NOOP(
"MythControls",
1626 "Set or clear cover image"),
"C");
1656 "WHERE hostname = :HOSTNAME;");
1661 "WHERE hostname = :HOSTNAME;");
1706 "WHERE hostname = :HOSTNAME and recusage = 'player' ;");
1714 bool autoStart =
false;
1720 QDateTime startupTime = QDateTime();
1729 if (startupTime.isValid())
1737 std::max(startupSecs, 15 * 60))
1739 LOG(VB_GENERAL, LOG_INFO,
1740 "Close to auto-start time, AUTO-Startup assumed");
1745 std::max(startupSecs, 15 * 60))
1747 LOG(VB_GENERAL, LOG_INFO,
1748 "Close to MythFillDB suggested run time, AUTO-Startup to fetch guide data?");
1753 LOG(VB_GENERAL, LOG_DEBUG,
1754 "NOT close to auto-start time, USER-initiated startup assumed");
1763 if (!wakeupCmd.isEmpty())
1766 bool bConflicts =
false;
1767 QDateTime nextRecordingStart;
1774 for (
auto *prog : progList)
1778 (prog->GetHostname() ==
hostname) &&
1779 (nextRecordingStart.isNull() ||
1780 nextRecordingStart > prog->GetRecordingStartTime()))
1782 nextRecordingStart = prog->GetRecordingStartTime();
1786 if (!nextRecordingStart.isNull() &&
1789 LOG(VB_GENERAL, LOG_INFO,
1790 "Close to start time, AUTO-Startup assumed");
1797 LOG(VB_GENERAL, LOG_DEBUG,
1798 "NOT close to auto-start time, USER-initiated startup assumed");
1825 bool bPromptForBackend =
false;
1826 bool bBypassAutoDiscovery =
false;
1848 QApplication::setSetuidAllowed(
true);
1849 QApplication a(argc, argv);
1854 QString path = QCoreApplication::applicationDirPath();
1856 QString(
"%1/../Resources/lib/%2/site-packages:%3")
1858 .
arg(QFileInfo(PYTHON_EXE).fileName())
1859 .
arg(QProcessEnvironment::systemEnvironment().value(
"PYTHONPATH"))
1860 .toUtf8().constData(), 1);
1864 QList<int> signallist;
1865 signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
1868 signallist << SIGRTMIN;
1880 bool ResetSettings =
false;
1883 bPromptForBackend =
true;
1885 bBypassAutoDiscovery =
true;
1887 if (signal(
SIGPIPE, SIG_IGN) == SIG_ERR)
1888 std::cerr <<
"Unable to ignore SIGPIPE\n";
1898 if (!
gContext->
Init(
true, bPromptForBackend, bBypassAutoDiscovery))
1900 LOG(VB_GENERAL, LOG_ERR,
"Failed to init MythContext, exiting.");
1914 ResetSettings =
true;
1929 QDir
dir(fileprefix);
1931 dir.mkdir(fileprefix);
1944 LOG(VB_GENERAL, LOG_NOTICE,
"Appearance settings and language have "
1945 "been reset to defaults. You will need to "
1946 "restart the frontend.");
1951 QCoreApplication::setSetuidAllowed(
true);
1955 LOG(VB_GENERAL, LOG_ERR,
"Failed to revokeRoot(), exiting.");
1959 #ifdef USING_LIBDNS_SD
1965 fe_sd_notify(
"STATUS=Registering frontend with bonjour");
1968 QByteArray name(
"Mythfrontend on ");
1970 bonjour->Register(port,
"_mythfrontend._tcp",
1989 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find theme '%1'")
1998 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find theme '%1'")
2012 mainWindow->Init(
false);
2013 mainWindow->setWindowTitle(QCoreApplication::translate(
"(MythFrontendMain)",
2015 "Main window title"));
2017 #ifdef USING_AIRPLAY
2040 LOG(VB_GENERAL, LOG_ERR,
2041 "Couldn't upgrade database to new schema, exiting.");
2049 mainWindow->ReloadKeys();
2072 mainWindow->installEventFilter(mon);
2081 if (!networkControl->
listen(port))
2083 LOG(VB_GENERAL, LOG_ERR,
2084 QString(
"NetworkControl failed to bind to port %1.")
2101 std::unique_ptr<ThemeUpdateChecker> themeUpdateChecker;
2103 themeUpdateChecker = std::make_unique<ThemeUpdateChecker>();
2115 #ifdef CONFIG_BINDINGS_PYTHON
2132 LOG(VB_GENERAL, LOG_ERR,
2133 QString(
"Invalid plugin name supplied on command line: '%1'")
2135 LOG(VB_GENERAL, LOG_ERR,
2136 QString(
"Available plugins: %1")
2137 .
arg(plugins.join(
", ")));
2149 LOG(VB_GENERAL, LOG_ERR,
2150 QString(
"Invalid jump point supplied on the command line: %1")
2152 LOG(VB_GENERAL, LOG_ERR,
2153 QString(
"Available jump points: %2")
2171 int ret = QCoreApplication::exec();
2187 delete networkControl;
2193 LOG(VB_GENERAL, LOG_INFO,
"Reloading theme");
2202 LOG(VB_GENERAL, LOG_INFO,
"Restarting LIRC handler");
static void resetAllKeys(void)
Reset this host's key bindings and jump points to default values.
void SetPluginManager(MythPluginManager *pmanager)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
MythScreenStack * GetMainStack()
static void startSearchTime(void)
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)
uint myth_system(const QString &command, uint flags, uint timeout)
#define GENERIC_EXIT_OK
Exited with no error.
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.
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.
MythSystemEventHandler * sysEventHandler
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 startSearchStored(void)
static void startPreviousOld(void)
static void reload()
Reload all active translators based on the current language setting.
static void reloadTheme_void(void)
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 ClearSettingOnHost(const QString &key, const QString &host)
bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, const bool upgradeIfNoUI, const bool informSystemd)
Called from outside dbcheck.cpp to update the schema.
static void startKeysSetup()
static void startTVNormal(void)
static void ReloadKeys(void)
bool run_plugin(const QString &plugname)
static void setDebugShowBorders(void)
void emitTVPlaybackStopped(void)
static void jumpScreenVideoTree()
void RunProgramFinder(TV *player, bool embedVideo, bool allowEPG)
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, int lenMins, const QString &year, const QString &id, const bool useBookmark)
#define REG_MEDIAPLAYER(a, b, c)
void JumpTo(const QString &Destination, bool Pop=true)
static void startPlaybackWithGroup(const QString &recGroup="")
static int internal_media_init()
Startup context for MythTV.
void OverrideSettingForSession(const QString &key, const QString &value)
static void WriteDefaults()
int RemoteGetFreeRecorderCount(void)
virtual bool Create(void)
arg(title).arg(filename).arg(doDelete))
static void CleanupMyOldInUsePrograms(void)
static void jumpScreenVideoManager()
#define REG_JUMPLOC(a, b, c, d, e)
void emitTVPlaybackStarted(void)
void customEvent(QEvent *event) override
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
static bool isLiveTVAvailable(void)
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.
static const int kDelayTimeMS
#define MYTH_APPNAME_MYTHFRONTEND
static VideoListDeathDelayPtr & GetSavedVideoList()
void RegisterTask(HouseKeeperTask *task)
#define GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
static void Cleanup(void)
static void startManageRecordingRules(void)
MythPainter * GetPainter()
static void startSearchChannel(void)
static MediaRenderer * g_pUPnp
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
static void ReloadJumpPoints(void)
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 void ConfigureQtGUI(int SwapInterval, const MythCommandLineParser &CmdLine)
Shared static initialistaion code for all MythTV GUI applications.
int main(int argc, char **argv)
void GetScreenList(QVector< MythScreenType * > &screens)
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
static void startSearchKeyword(void)
bool InitializeMythSchema(void)
command to get the the initial database layout from an empty database:
bool Create(void) override
#define REG_KEY(a, b, c, d)
static void startAppearWiz(void)
bool ClearSetting(const QString &key)
static bool resetTheme(QString themedir, const QString &badtheme)
static MythPluginManager * g_pmanager
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 CreatePreviewGeneratorQueue(PreviewGenerator::Mode mode, uint maxAttempts, uint minBlockSeconds)
Create the singleton queue of preview generators.
void SetAsFrontend(bool frontend)
static void startGuide(void)
static void startSearchPeople(void)
static void startSearchPower(void)
QPointer< class VideoListDeathDelay > VideoListDeathDelayPtr
const QString JUMP_VIDEO_MANAGER
Basic menu dialog, message and a list of options.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
#define FALLBACK_UI_THEME
Main header for mythcontrols.
static void DBError(const QString &where, const MSqlQuery &query)
static void startSearchNew(void)
Implements Gallery Thumbnail screen.
bool DestinationExists(const QString &Destination) const
void DestroyMythMainWindow(void)
static QStringList SupportedImages()
Return recognised pictures.
static const QString sLocation
QString FindThemeDir(const QString &ThemeName, bool Fallback=true)
Returns the full path to the theme denoted by themename.
static MythThemedMenu * g_menu
static void PrintVersion(void)
Print application version information.
static void * RunScheduleEditor(ProgramInfo *proginfo, void *player=nullptr)
Callback.
const QString JUMP_VIDEO_GALLERY
static void startSearchCategory(void)
#define REG_JUMP(a, b, c, d)
static void TVMenuCallback(void *data, QString &selection)
bool GetNameAndSerialNum(QString &Name, QString &SerialNum)
static void RunVideoScreen(VideoDialog::DialogType type, bool fromJump=false)
void PrintHelp(void) const
Print command line option help.
An editor for MythSystemEvent handler commands.
static void handleExit(bool prompt)
const QString JUMP_VIDEO_BROWSER
static void startManualSchedule(void)
static void startCustomPriority(void)
static bool RunMenu(const QString &themedir, const QString &themename)
@ kMSPropagateLogs
add arguments for MythTV log propagation
static void setDebugShowNames(void)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
const QString JUMP_GALLERY_DEFAULT
void SigResultReady(bool passwordValid, ParentalLevel::Level newLevel)
void ApplySettingsOverride(void)
Apply all overrides to the global context.
static void startManaged(void)
QStringList EnumerateDestinations() const
static void handleDVDMedia(MythMediaDevice *dvd)
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 void handleGalleryMedia(MythMediaDevice *dev)
static QString cleanup(const QString &str)
static void jumpScreenVideoBrowser()
static void InitJumpPoints(void)
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
static void InitKeys(void)
HouseKeeper * housekeeping
bool ShowBorders(void) const
bool GetBoolSetting(const QString &key, bool defaultval=false)
static int reloadTheme(void)
Reports on various status items.
static void startPrevious(void)
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.
#define MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
static int revokeRoot(void)
bool ShowTypeNames(void) const
#define GENERIC_EXIT_DB_ERROR
Database error.
void SetDebugMode(bool showBorders, bool showNames)
MythCommFlagCommandLineParser cmdline
@ kMSDisableUDPListener
disable MythMessage UDP listener for the duration of application.
Holds information on recordings and videos.
QString toString(const QString &key) const
Returns stored QVariant as a QString, falling to default if not provided.
static void SetupLCD(void)
static void standbyScreen(void)
#define GENERIC_EXIT_NOT_OK
Exited with error.
static void gotoMainMenu(void)
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
static void startChannelRecPriorities(void)
static void jumpScreenVideoDefault()
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.
static void startSearchTitle(void)
QStringList EnumeratePlugins(void)
Screen for viewing and managing upcoming and conflicted recordings.
static void SetFuncPtr(const char *Name, void *Pointer)
Import pointers to functions used to embed the TV window into other containers e.g.
static void startPlayback(void)
#define GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.
static bool WasAutomaticStart(void)
QString GetAppBinDir(void)
static void SetHandler(int signum, SigHandlerFunc handler)
MythMainWindow * GetMythMainWindow(void)
static void startSearchMovie(void)
static void showStatus(void)
QString GetLastError(void) const
void ActivateSettingsCache(bool activate=true)
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="", int LenMins=120, const QString &Year="1895", const QString &Id="", bool UseBookmarks=false)
static SettingsHelper * g_settingsHelper
MythScreenStack * GetStack(const QString &Stackname)
#define REG_JUMPEX(a, b, c, d, e)
bool listen(QList< QHostAddress > addrs, quint16 port, bool requireall=true, PoolServerType type=kTCPServer)
void ClearKeyContext(const QString &Context)
QString GetHostName(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(""))
static void startFinder(void)
bool IsMasterHost(void)
is this the same host as the master
void AddCurrentLocation(const QString &Location)
void SaveSetting(const QString &key, int newValue)
static void SetFuncPtrs(void)
static void Cleanup(void)
static void load(const QString &module_name)
Load a QTranslator for the user's preferred language.
MythUIHelper * GetMythUI()
void RestartInputHandlers()
static void jumpScreenVideoGallery()
#define GENERIC_EXIT_NO_THEME
No Theme available.
Handles incoming MythSystemEvent messages.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
static void clearAllKeys(void)
Deletes all key bindings and jump points for this host.
MSqlQuery query(MSqlQuery::InitCon())
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
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 startCustomEdit(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 Init(QList< int > &signallist, QObject *parent=nullptr)
std::vector< ChannelInfo > ChannelInfoList
#define GENERIC_EXIT_DB_OUTOFDATE
Database needs upgrade.