MythTV  master
mythfrontend.cpp
Go to the documentation of this file.
1 // C/C++
2 #include <cerrno>
3 #include <csignal>
4 #include <cstdlib>
5 #include <fcntl.h>
6 #include <iostream>
7 #include <memory>
8 
9 // Qt
10 #include <QtGlobal>
11 #ifdef Q_OS_ANDROID
12 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
13 #include <QtAndroidExtras>
14 #else
15 #include <QCoreApplication>
16 #include <QJniObject>
17 #define QAndroidJniObject QJniObject
18 #endif
19 #endif
20 #include <QApplication>
21 #include <QDir>
22 #include <QEvent>
23 #include <QFile>
24 #include <QFileInfo>
25 #include <QKeyEvent>
26 #include <QMap>
27 #ifdef Q_OS_DARWIN
28 #include <QProcessEnvironment>
29 #endif
30 #include <QTimer>
31 
32 // MythTV
34 #include "libmyth/langsettings.h"
35 #include "libmyth/mythcontext.h"
39 #include "libmythbase/compat.h" // For SIG* on MinGW
40 #include "libmythbase/exitcodes.h"
42 #include "libmythbase/lcddevice.h"
43 #include "libmythbase/mythcdrom.h"
44 #include "libmythbase/mythconfig.h"
45 #include "libmythbase/mythdb.h"
46 #include "libmythbase/mythdbcon.h"
47 #include "libmythbase/mythdirs.h"
49 #include "libmythbase/mythplugin.h"
52 #include "libmythbase/mythversion.h"
55 #include "libmythbase/remoteutil.h"
59 #include "libmythtv/channelutil.h"
60 #include "libmythtv/dbcheck.h"
62 #include "libmythtv/playgroup.h"
65 #include "libmythtv/tv.h"
66 #include "libmythtv/tvremoteutil.h"
69 #include "libmythui/mythuihelper.h"
70 #include "libmythupnp/taskqueue.h"
71 
72 // MythFrontend
73 #include "audiogeneralsettings.h"
75 #include "channelrecpriority.h"
76 #include "customedit.h"
77 #include "custompriority.h"
78 #include "exitprompt.h"
79 #include "globalsettings.h"
80 #include "grabbersettings.h"
81 #include "guidegrid.h"
82 #include "idlescreen.h"
83 #include "manualschedule.h"
84 #include "mediarenderer.h"
85 #include "mythcontrols.h"
87 #include "networkcontrol.h"
88 #include "playbackbox.h"
89 #include "prevreclist.h"
90 #include "progfind.h"
91 #include "proglist.h"
92 #include "programrecpriority.h"
93 #include "scheduleeditor.h"
94 #include "settingshelper.h"
95 #include "setupwizard_general.h"
96 #include "statusbox.h"
97 #include "themechooser.h"
98 #include "viewscheduled.h"
99 
100 // Video
101 #include "videodlg.h"
102 #include "videoglobalsettings.h"
103 #include "videofileassoc.h"
104 #include "videoplayersettings.h"
105 #include "videometadatasettings.h"
106 #include "videolist.h"
107 
108 // Gallery
109 #include "gallerythumbview.h"
110 
111 // DVD & Bluray
115 
116 // AirPlay
117 #ifdef USING_AIRPLAY
120 #endif
121 
122 #ifdef USING_LIBDNS_SD
123 #include <QScopedPointer>
125 #endif
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); };
129 #else
130 static inline void fe_sd_notify(const char */*str*/) {};
131 #endif
132 
137 
138 static MythThemedMenu *g_menu;
139 
140 static MediaRenderer *g_pUPnp = nullptr;
141 static MythPluginManager *g_pmanager = nullptr;
142 
144 
145 static void handleExit(bool prompt);
146 static void resetAllKeys(void);
147 void handleSIGUSR1(void);
148 void handleSIGUSR2(void);
149 
150 #ifdef Q_OS_DARWIN
151 static bool gLoaded = false;
152 #endif
153 
154 static const QString sLocation = QCoreApplication::translate("(Common)",
155  "MythFrontend");
156 
157 namespace
158 {
159  class RunSettingsCompletion : public QObject
160  {
161  Q_OBJECT
162 
163  public:
164  static void Create(bool check)
165  {
166  new RunSettingsCompletion(check);
167  }
168 
169  private:
170  explicit RunSettingsCompletion(bool check)
171  {
172  if (check)
173  {
175  this, &RunSettingsCompletion::OnPasswordResultReady);
177  }
178  else
179  {
180  OnPasswordResultReady(true, ParentalLevel::plHigh);
181  }
182  }
183 
184  ~RunSettingsCompletion() override = default;
185 
186  private slots:
187  void OnPasswordResultReady(bool passwordValid,
188  ParentalLevel::Level newLevel)
189  {
190  (void) newLevel;
191 
192  if (passwordValid)
193  {
195  auto *ssd =
196  new StandardSettingDialog(mainStack, "videogeneralsettings",
197  new VideoGeneralSettings());
198 
199  if (ssd->Create())
200  {
201  mainStack->AddScreen(ssd);
202  }
203  else
204  delete ssd;
205  }
206  else
207  {
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.");
212  }
213 
214  deleteLater();
215  }
216 
217  public:
219  };
220 
224  class BookmarkDialog : MythScreenType
225  {
226  Q_DECLARE_TR_FUNCTIONS(BookmarkDialog)
227 
228  public:
229  BookmarkDialog(ProgramInfo *pginfo, MythScreenStack *parent,
230  bool bookmarkPresent, bool lastPlayPresent) :
231  MythScreenType(parent, "bookmarkdialog"),
232  m_pgi(pginfo),
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")) {
240  }
241 
242  bool Create() override // MythScreenType
243  {
244  QString msg = tr("DVD/Video contains a bookmark");
245 
246  m_videoDlg = dynamic_cast<VideoDialog*>(GetScreenStack()->GetTopScreen());
247  auto *popup = new MythDialogBox(msg, GetScreenStack(), "bookmarkdialog");
248  if (!popup->Create())
249  {
250  delete popup;
251  return false;
252  }
253 
254  GetScreenStack()->AddScreen(popup);
255 
256  popup->SetReturnEvent(this, "bookmarkdialog");
257  if (m_lastPlayed)
258  popup->AddButton(m_btnPlayLast);
259  if (m_bookmarked)
260  popup->AddButton(m_btnPlayBookmark);
261  popup->AddButton(m_btnPlayBegin);
262  if (m_lastPlayed)
263  popup->AddButton(m_btnClearLast);
264  if (m_bookmarked)
265  popup->AddButton(m_btnClearBookmark);
266  return true;
267  }
268 
269  void customEvent(QEvent *event) override // MythUIType
270  {
271  if (event->type() != DialogCompletionEvent::kEventType)
272  return;
273 
274  auto *dce = (DialogCompletionEvent*)(event);
275  QString buttonText = dce->GetResultText();
276 
277  if (dce->GetId() != "bookmarkdialog")
278  return;
279 
280  if (buttonText == m_btnPlayLast)
282  else if (buttonText == m_btnPlayBookmark)
284  else if (buttonText == m_btnPlayBegin)
286  else if (buttonText == m_btnClearBookmark)
287  {
288  m_pgi->SaveBookmark(0);
289  if (m_videoDlg)
290  {
291  m_videoDlg->playbackStateChanged(m_pgi->GetBasename());
292  }
293  }
294  else if (buttonText == m_btnClearLast)
295  {
296  m_pgi->SaveLastPlayPos(0);
297  if (m_videoDlg)
298  {
299  m_videoDlg->playbackStateChanged(m_pgi->GetBasename());
300  }
301  }
302  delete m_pgi;
303  }
304 
305  private:
306  ProgramInfo* m_pgi {nullptr};
307  bool m_bookmarked {false};
308  bool m_lastPlayed {false};
309  QString m_btnPlayBookmark;
310  QString m_btnClearBookmark;
311  QString m_btnPlayBegin;
312  QString m_btnPlayLast;
313  QString m_btnClearLast;
314  VideoDialog *m_videoDlg {nullptr};
315  };
316 
317  void cleanup()
318  {
319  QCoreApplication::processEvents();
321 #ifdef USING_AIRPLAY
324 #endif
325 
327 
328  if (g_pUPnp)
329  {
330  // This takes a few seconds, so inform the user:
331  LOG(VB_GENERAL, LOG_INFO, "Shutting down UPnP client...");
332  delete g_pUPnp;
333  g_pUPnp = nullptr;
334  }
335 
336  if (g_pmanager)
337  {
338  delete g_pmanager;
339  g_pmanager = nullptr;
340  }
341 
342  if (g_settingsHelper)
343  {
344  delete g_settingsHelper;
345  g_settingsHelper = nullptr;
346  }
347 
348  delete gContext;
349  gContext = nullptr;
350 
352 
354  }
355 }
356 
357 static void startAppearWiz(void)
358 {
359  int curX = gCoreContext->GetNumSetting("GuiOffsetX", 0);
360  int curY = gCoreContext->GetNumSetting("GuiOffsetY", 0);
361  int curW = gCoreContext->GetNumSetting("GuiWidth", 0);
362  int curH = gCoreContext->GetNumSetting("GuiHeight", 0);
363 
364  bool isWindowed =
365  (gCoreContext->GetNumSetting("RunFrontendInWindow", 0) == 1);
366 
367  bool reload = false;
368 
369  if (isWindowed)
370  {
371  ShowOkPopup(QCoreApplication::translate("(MythFrontendMain)",
372  "The ScreenSetupWizard cannot be used while "
373  "mythfrontend is operating in windowed mode."));
374  }
375  else
376  {
377  auto *wizard = new MythSystemLegacy(
378  GetAppBinDir() + "mythscreenwizard",
379  QStringList(),
381  wizard->Run();
382 
383  if (!wizard->Wait())
384  {
385  // no reported errors, check for changed geometry parameters
386  gCoreContext->ClearSettingsCache("GuiOffsetX");
387  gCoreContext->ClearSettingsCache("GuiOffsetY");
388  gCoreContext->ClearSettingsCache("GuiWidth");
389  gCoreContext->ClearSettingsCache("GuiHeight");
390 
391  if ((curX != gCoreContext->GetNumSetting("GuiOffsetX", 0)) ||
392  (curY != gCoreContext->GetNumSetting("GuiOffsetY", 0)) ||
393  (curW != gCoreContext->GetNumSetting("GuiWidth", 0)) ||
394  (curH != gCoreContext->GetNumSetting("GuiHeight", 0)))
395  reload = true;
396  }
397 
398  delete wizard;
399  wizard = nullptr;
400  }
401 
402  if (reload)
403  GetMythMainWindow()->JumpTo("Reload Theme");
404 }
405 
406 static void startKeysSetup()
407 {
409 
410  auto *mythcontrols = new MythControls(mainStack, "mythcontrols");
411 
412  if (mythcontrols->Create())
413  mainStack->AddScreen(mythcontrols);
414  else
415  delete mythcontrols;
416 }
417 
418 static void startGuide(void)
419 {
420  uint chanid = 0;
421  QString channum = gCoreContext->GetSetting("DefaultTVChannel");
422  QDateTime startTime;
423  GuideGrid::RunProgramGuide(chanid, channum, startTime, nullptr, false, true, -2);
424 }
425 
426 static void startFinder(void)
427 {
429 }
430 
431 static void startSearchTitle(void)
432 {
434  auto *pl = new ProgLister(mainStack, plTitleSearch, "", "");
435  if (pl->Create())
436  mainStack->AddScreen(pl);
437  else
438  delete pl;
439 }
440 
441 static void startSearchKeyword(void)
442 {
444  auto *pl = new ProgLister(mainStack, plKeywordSearch, "", "");
445  if (pl->Create())
446  mainStack->AddScreen(pl);
447  else
448  delete pl;
449 }
450 
451 static void startSearchPeople(void)
452 {
454  auto *pl = new ProgLister(mainStack, plPeopleSearch, "", "");
455  if (pl->Create())
456  mainStack->AddScreen(pl);
457  else
458  delete pl;
459 }
460 
461 static void startSearchPower(void)
462 {
464  auto *pl = new ProgLister(mainStack, plPowerSearch, "", "");
465  if (pl->Create())
466  mainStack->AddScreen(pl);
467  else
468  delete pl;
469 }
470 
471 static void startSearchStored(void)
472 {
474  auto *pl = new ProgLister(mainStack, plStoredSearch, "", "");
475  if (pl->Create())
476  mainStack->AddScreen(pl);
477  else
478  delete pl;
479 }
480 
481 static void startSearchChannel(void)
482 {
484  auto *pl = new ProgLister(mainStack, plChannel, "", "");
485  if (pl->Create())
486  mainStack->AddScreen(pl);
487  else
488  delete pl;
489 }
490 
491 static void startSearchCategory(void)
492 {
494  auto *pl = new ProgLister(mainStack, plCategory, "", "");
495  if (pl->Create())
496  mainStack->AddScreen(pl);
497  else
498  delete pl;
499 }
500 
501 static void startSearchMovie(void)
502 {
504  auto *pl = new ProgLister(mainStack, plMovies, "", "");
505  if (pl->Create())
506  mainStack->AddScreen(pl);
507  else
508  delete pl;
509 }
510 
511 static void startSearchNew(void)
512 {
514  auto *pl = new ProgLister(mainStack, plNewListings, "", "");
515  if (pl->Create())
516  mainStack->AddScreen(pl);
517  else
518  delete pl;
519 }
520 
521 static void startSearchTime(void)
522 {
524  auto *pl = new ProgLister(mainStack, plTime, "", "");
525  if (pl->Create())
526  mainStack->AddScreen(pl);
527  else
528  delete pl;
529 }
530 
531 static void startManaged(void)
532 {
534 
535  auto *viewsched = new ViewScheduled(mainStack);
536 
537  if (viewsched->Create())
538  mainStack->AddScreen(viewsched);
539  else
540  delete viewsched;
541 }
542 
543 static void startManageRecordingRules(void)
544 {
546 
547  auto *progRecPrior = new ProgramRecPriority(mainStack, "ManageRecRules");
548 
549  if (progRecPrior->Create())
550  mainStack->AddScreen(progRecPrior);
551  else
552  delete progRecPrior;
553 }
554 
555 static void startChannelRecPriorities(void)
556 {
558 
559  auto *chanRecPrior = new ChannelRecPriority(mainStack);
560 
561  if (chanRecPrior->Create())
562  mainStack->AddScreen(chanRecPrior);
563  else
564  delete chanRecPrior;
565 }
566 
567 static void startCustomPriority(void)
568 {
570 
571  auto *custom = new CustomPriority(mainStack);
572 
573  if (custom->Create())
574  mainStack->AddScreen(custom);
575  else
576  delete custom;
577 }
578 
579 static void startPlaybackWithGroup(const QString& recGroup = "")
580 {
582 
583  auto *pbb = new PlaybackBox(mainStack, "playbackbox");
584 
585  if (pbb->Create())
586  {
587  if (!recGroup.isEmpty())
588  pbb->setInitialRecGroup(recGroup);
589 
590  mainStack->AddScreen(pbb);
591  }
592  else
593  delete pbb;
594 }
595 
596 static void startPlayback(void)
597 {
599 }
600 
601 static void startPrevious(void)
602 {
604  auto *pl = new PrevRecordedList(mainStack);
605  if (pl->Create())
606  mainStack->AddScreen(pl);
607  else
608  delete pl;
609 }
610 
611 static void startPreviousOld(void)
612 {
614  auto *pl = new ProgLister(mainStack);
615  if (pl->Create())
616  mainStack->AddScreen(pl);
617  else
618  delete pl;
619 }
620 
621 static void startCustomEdit(void)
622 {
624  auto *custom = new CustomEdit(mainStack);
625 
626  if (custom->Create())
627  mainStack->AddScreen(custom);
628  else
629  delete custom;
630 }
631 
632 static void startManualSchedule(void)
633 {
635 
636  auto *mansched= new ManualSchedule(mainStack);
637 
638  if (mansched->Create())
639  mainStack->AddScreen(mansched);
640  else
641  delete mansched;
642 }
643 
644 static bool isLiveTVAvailable(void)
645 {
646  if (RemoteGetFreeRecorderCount() > 0)
647  return true;
648 
649  QString msg = QCoreApplication::translate("(Common)", "All tuners are currently busy.");
650 
651  if (TV::ConfiguredTunerCards() < 1)
652  msg = QCoreApplication::translate("(Common)", "There are no configured tuners.");
653 
654  ShowOkPopup(msg);
655  return false;
656 }
657 
658 static void startTVNormal(void)
659 {
660  if (!isLiveTVAvailable())
661  return;
662 
663  // Get the default channel keys (callsign(0) and channum(1)) and
664  // use them to generate the ordered list of channels.
665  QStringList keylist = gCoreContext->GetSettingOnHost(
666  "DefaultChanKeys", gCoreContext->GetHostName()).split("[]:[]");
667  while (keylist.size() < 2)
668  keylist << "";
669  uint dummy = 0;
671  0, // startIndex
672  0, // count
673  dummy, // totalAvailable
674  true, // ignoreHidden
677  0, // sourceID
678  0, // channelGroupID
679  true, // liveTVOnly
680  keylist[0], // callsign
681  keylist[1]); // channum
682 
683  TV::StartTV(nullptr, kStartTVNoFlags, livetvchannels);
684 }
685 
686 static void showStatus(void)
687 {
689 
690  auto *statusbox = new StatusBox(mainStack);
691 
692  if (statusbox->Create())
693  mainStack->AddScreen(statusbox);
694  else
695  delete statusbox;
696 }
697 
698 
699 static void standbyScreen(void)
700 {
702 
703  auto *idlescreen = new IdleScreen(mainStack);
704 
705  if (idlescreen->Create())
706  mainStack->AddScreen(idlescreen);
707  else
708  delete idlescreen;
709 }
710 
711 static void RunVideoScreen(VideoDialog::DialogType type, bool fromJump = false)
712 {
713  QString message = QCoreApplication::translate("(MythFrontendMain)",
714  "Loading videos ...");
715 
716  MythScreenStack *popupStack =
717  GetMythMainWindow()->GetStack("popup stack");
718 
719  auto *busyPopup = new MythUIBusyDialog(message, popupStack,
720  "mythvideobusydialog");
721 
722  if (busyPopup->Create())
723  popupStack->AddScreen(busyPopup, false);
724 
726 
727  VideoDialog::VideoListPtr video_list;
728  if (fromJump)
729  {
732  if (!saved.isNull())
733  {
734  video_list = saved->GetSaved();
735  LOG(VB_GENERAL, LOG_INFO,
736  QString("Reusing saved video list because MythVideo was resumed"
737  " within %1ms").arg(VideoListDeathDelay::kDelayTimeMS.count()));
738  }
739  }
740 
741  VideoDialog::BrowseType browse = static_cast<VideoDialog::BrowseType>(
742  gCoreContext->GetNumSetting("mythvideo.db_group_type",
744 
745  if (!video_list)
746  video_list = new VideoList;
747 
748  auto *mythvideo =
749  new VideoDialog(mainStack, "mythvideo", video_list, type, browse);
750 
751  if (mythvideo->Create())
752  {
753  busyPopup->Close();
754  mainStack->AddScreen(mythvideo);
755  }
756  else
757  busyPopup->Close();
758 }
759 
765 
766 static void RunGallery()
767 {
769  auto *galleryView = new GalleryThumbView(mainStack, "galleryview");
770  if (galleryView->Create())
771  {
772  mainStack->AddScreen(galleryView);
773  galleryView->Start();
774  }
775  else
776  {
777  delete galleryView;
778  }
779 }
780 
781 static void playDisc()
782 {
783  //
784  // Get the command string to play a DVD
785  //
786 
787  bool isBD = false;
788 
789  QString command_string =
790  gCoreContext->GetSetting("mythdvd.DVDPlayerCommand");
791  QString bluray_mountpoint =
792  gCoreContext->GetSetting("BluRayMountpoint", "/media/cdrom");
793  QDir bdtest(bluray_mountpoint + "/BDMV");
794 
795  if (bdtest.exists() || MythCDROM::inspectImage(bluray_mountpoint) == MythCDROM::kBluray)
796  isBD = true;
797 
798  if (isBD)
799  {
800  GetMythUI()->AddCurrentLocation("playdisc");
801 
802  QString filename = QString("bd:/%1").arg(bluray_mountpoint);
803 
804  GetMythMainWindow()->HandleMedia("Internal", filename, "", "", "", "",
805  0, 0, "", 0min, "", "", true);
806 
808  }
809  else
810  {
811  QString dvd_device = MediaMonitor::defaultDVDdevice();
812 
813  if (dvd_device.isEmpty())
814  return; // User cancelled in the Popup
815 
816  GetMythUI()->AddCurrentLocation("playdisc");
817 
818  if ((command_string.indexOf("internal", 0, Qt::CaseInsensitive) > -1) ||
819  (command_string.length() < 1))
820  {
821 #ifdef Q_OS_DARWIN
822  // Convert a BSD 'leaf' name into a raw device path
823  QString filename = "dvd://dev/r"; // e.g. 'dvd://dev/rdisk2'
824 #elif defined(_WIN32)
825  QString filename = "dvd:"; // e.g. 'dvd:E\\'
826 #else
827  QString filename = "dvd:/"; // e.g. 'dvd://dev/sda'
828 #endif
829  filename += dvd_device;
830 
831  command_string = "Internal";
832  GetMythMainWindow()->HandleMedia(command_string, filename, "", "",
833  "", "", 0, 0, "", 0min, "", "", true);
835 
836  return;
837  }
838 
839  if (command_string.contains("%d"))
840  {
841  //
842  // Need to do device substitution
843  //
844  command_string = command_string.replace("%d", dvd_device);
845  }
848  myth_system(command_string);
851  if (GetMythMainWindow())
852  {
853  GetMythMainWindow()->raise();
854  GetMythMainWindow()->activateWindow();
855  }
857  }
858 }
859 
864 {
865  if (!dvd)
866  return;
867 
868  if (!dvd->isUsable()) // This isn't infallible, on some drives both a mount and libudf fail
869  return;
870 
871  switch (gCoreContext->GetNumSetting("DVDOnInsertDVD", 1))
872  {
873  case 0 : // Do nothing
874  case 1 : // Display menu (mythdvd)*/
875  break;
876  case 2 : // play DVD or Blu-ray
877  playDisc();
878  break;
879  default:
880  LOG(VB_GENERAL, LOG_ERR,
881  "mythdvd main.o: handleMedia() does not know what to do");
882  }
883 }
884 
886 {
887  // Only handle events for media that are newly mounted
888  if (!dev || (dev->getStatus() != MEDIASTAT_MOUNTED
889  && dev->getStatus() != MEDIASTAT_USEABLE))
890  return;
891 
892  // Check if gallery is already running
893  QVector<MythScreenType*> screens;
895 
896 
897  for (const auto *screen : std::as_const(screens))
898  {
899  if (qobject_cast<const GalleryThumbView*>(screen))
900  {
901  // Running gallery will receive this event later
902  LOG(VB_MEDIA, LOG_INFO, "Main: Ignoring new gallery media - already running");
903  return;
904  }
905  }
906 
907  if (gCoreContext->GetBoolSetting("GalleryAutoLoad", false))
908  {
909  LOG(VB_GUI, LOG_INFO, "Main: Autostarting Gallery for new media");
911  }
912  else
913  LOG(VB_MEDIA, LOG_INFO, "Main: Ignoring new gallery media - autorun not set");
914 }
915 
916 static void TVMenuCallback([[maybe_unused]] void *data, QString &selection)
917 {
918  QString sel = selection.toLower();
919 
920  if (sel.startsWith("settings ") || sel == "video_settings_general")
921  {
922  if (!g_settingsHelper)
924 
926  }
927 
928  if (sel == "tv_watch_live")
929  startTVNormal();
930  else if (sel.startsWith("tv_watch_recording"))
931  {
932  // use selection here because its case is untouched
933  if ((selection.length() > 19) && (selection.mid(18, 1) == " "))
934  startPlaybackWithGroup(selection.mid(19));
935  else
936  startPlayback();
937  }
938  else if (sel == "tv_schedule")
939  startGuide();
940  else if (sel == "tv_manualschedule")
942  else if (sel == "tv_custom_record")
943  startCustomEdit();
944  else if (sel == "tv_fix_conflicts")
945  startManaged();
946  else if (sel == "tv_manage_recording_rules")
948  else if (sel == "tv_progfind")
949  startFinder();
950  else if (sel == "tv_search_title")
952  else if (sel == "tv_search_keyword")
954  else if (sel == "tv_search_people")
956  else if (sel == "tv_search_power")
958  else if (sel == "tv_search_stored")
960  else if (sel == "tv_search_channel")
962  else if (sel == "tv_search_category")
964  else if (sel == "tv_search_movie")
966  else if (sel == "tv_search_new")
967  startSearchNew();
968  else if (sel == "tv_search_time")
969  startSearchTime();
970  else if (sel == "tv_previous")
971  startPrevious();
972  else if (sel == "tv_previous_old")
974  else if (sel == "settings appearance")
975  {
977  auto *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings",
978  new AppearanceSettings());
979 
980  if (ssd->Create())
981  {
982  mainStack->AddScreen(ssd);
983  }
984  else
985  delete ssd;
986  }
987  else if (sel == "settings themechooser")
988  {
990  auto *tp = new ThemeChooser(mainStack);
991 
992  if (tp->Create())
993  mainStack->AddScreen(tp);
994  else
995  delete tp;
996  }
997  else if (sel == "settings setupwizard")
998  {
1000  auto *sw = new GeneralSetupWizard(mainStack, "setupwizard");
1001 
1002  if (sw->Create())
1003  mainStack->AddScreen(sw);
1004  else
1005  delete sw;
1006  }
1007  else if (sel == "settings grabbers")
1008  {
1010  auto *gs = new GrabberSettings(mainStack, "grabbersettings");
1011 
1012  if (gs->Create())
1013  mainStack->AddScreen(gs);
1014  else
1015  delete gs;
1016  }
1017  else if (sel == "screensetupwizard")
1018  {
1019  startAppearWiz();
1020  }
1021  else if (sel == "setup_keys")
1022  {
1023  startKeysSetup();
1024  }
1025  else if (sel == "settings playgroup")
1026  {
1028  auto *ssd = new StandardSettingDialog(mainStack, "playbackgroupsetting",
1029  new PlayGroupEditor());
1030 
1031  if (ssd->Create())
1032  {
1033  mainStack->AddScreen(ssd);
1034  }
1035  else
1036  delete ssd;
1037  }
1038  else if (sel == "settings general")
1039  {
1041  auto *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings",
1042  new GeneralSettings());
1043 
1044  if (ssd->Create())
1045  {
1046  mainStack->AddScreen(ssd);
1047  }
1048  else
1049  delete ssd;
1050  }
1051  else if (sel == "settings audiogeneral")
1052  {
1054  StandardSettingDialog *ssd =
1055  new AudioConfigScreen(mainStack, "audiogeneralsettings",
1056  new AudioConfigSettings());
1057 
1058  if (ssd->Create())
1059  {
1060  mainStack->AddScreen(ssd);
1061  }
1062  else
1063  delete ssd;
1064  }
1065  else if (sel == "settings maingeneral")
1066  {
1068  auto *ssd = new StandardSettingDialog(mainStack, "maingeneralsettings",
1069  new MainGeneralSettings());
1070 
1071  if (ssd->Create())
1072  {
1073  mainStack->AddScreen(ssd);
1074  }
1075  else
1076  delete ssd;
1077  }
1078  else if (sel == "settings playback")
1079  {
1081  StandardSettingDialog *ssd =
1082  new PlaybackSettingsDialog(mainStack);
1083 
1084  if (ssd->Create())
1085  {
1086  mainStack->AddScreen(ssd);
1087  }
1088  else
1089  delete ssd;
1090  }
1091  else if (sel == "settings osd")
1092  {
1094  auto *ssd = new StandardSettingDialog(mainStack, "osdsettings",
1095  new OSDSettings());
1096 
1097  if (ssd->Create())
1098  {
1099  mainStack->AddScreen(ssd);
1100  }
1101  else
1102  delete ssd;
1103  }
1104  else if (sel == "settings epg")
1105  {
1107  auto *ssd = new StandardSettingDialog(mainStack, "epgsettings",
1108  new EPGSettings());
1109 
1110  if (ssd->Create())
1111  {
1112  mainStack->AddScreen(ssd);
1113  }
1114  else
1115  delete ssd;
1116  }
1117  else if (sel == "settings channelgroups")
1118  {
1120  auto *ssd = new StandardSettingDialog(mainStack, "channelgroupssettings",
1121  new ChannelGroupsSetting());
1122 
1123  if (ssd->Create())
1124  {
1125  mainStack->AddScreen(ssd);
1126  }
1127  else
1128  delete ssd;
1129  }
1130  else if (sel == "settings generalrecpriorities")
1131  {
1133  auto *ssd = new StandardSettingDialog(mainStack,
1134  "generalrecprioritiessettings",
1136 
1137  if (ssd->Create())
1138  {
1139  mainStack->AddScreen(ssd);
1140  }
1141  else
1142  delete ssd;
1143  }
1144  else if (sel == "settings channelrecpriorities")
1145  {
1147  }
1148  else if (sel == "settings custompriority")
1149  {
1151  }
1152  else if (sel == "system_events")
1153  {
1155 
1156  auto *msee = new MythSystemEventEditor(mainStack, "System Event Editor");
1157 
1158  if (msee->Create())
1159  mainStack->AddScreen(msee);
1160  else
1161  delete msee;
1162  }
1163  else if (sel == "video_settings_general")
1164  {
1165  RunSettingsCompletion::Create(gCoreContext->
1166  GetBoolSetting("VideoAggressivePC", false));
1167  }
1168  else if (sel == "video_settings_player")
1169  {
1171 
1172  auto *ps = new PlayerSettings(mainStack, "player settings");
1173 
1174  if (ps->Create())
1175  mainStack->AddScreen(ps);
1176  else
1177  delete ps;
1178  }
1179  else if (sel == "video_settings_metadata")
1180  {
1182 
1183  auto *ms = new MetadataSettings(mainStack, "metadata settings");
1184 
1185  if (ms->Create())
1186  mainStack->AddScreen(ms);
1187  else
1188  delete ms;
1189  }
1190  else if (sel == "video_settings_associations")
1191  {
1193 
1194  auto *fa = new FileAssocDialog(mainStack, "fa dialog");
1195 
1196  if (fa->Create())
1197  mainStack->AddScreen(fa);
1198  }
1199  else if (sel == "manager")
1201  else if (sel == "browser")
1203  else if (sel == "listing")
1205  else if (sel == "gallery")
1207  else if (sel == "disc_play")
1208  {
1209  playDisc();
1210  }
1211  else if (sel == "tv_status")
1212  showStatus();
1213  else if (sel == "exiting_app_prompt")
1214  handleExit(true);
1215  else if (sel == "exiting_app")
1216  handleExit(false);
1217  else if (sel == "standby_mode")
1218  standbyScreen();
1219  else if (sel == "exiting_menu")
1220  {
1221  //ignore
1222  }
1223  else
1224  LOG(VB_GENERAL, LOG_ERR, "Unknown menu action: " + selection);
1225 
1226  if (sel.startsWith("settings ") || sel == "video_settings_general")
1227  {
1228  if (g_settingsHelper)
1229  {
1230  QObject::connect(GetMythMainWindow()->GetMainStack()->GetTopScreen(),
1233  }
1234  }
1235 }
1236 
1237 static void handleExit(bool prompt)
1238 {
1239  if (prompt)
1240  {
1241  auto * prompter = new ExitPrompter();
1242  prompter->HandleExit();
1243  }
1244  else
1245  {
1247  }
1248 }
1249 
1250 static bool RunMenu(const QString& themedir, const QString& themename)
1251 {
1252  QByteArray tmp = themedir.toLocal8Bit();
1253  g_menu = new MythThemedMenu(QString(tmp.constData()), "mainmenu.xml",
1254  GetMythMainWindow()->GetMainStack(), "mainmenu");
1255 
1256  if (g_menu->foundTheme())
1257  {
1258  LOG(VB_GENERAL, LOG_NOTICE, QString("Found mainmenu.xml for theme '%1'")
1259  .arg(themename));
1262  return true;
1263  }
1264 
1265  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find mainmenu.xml for theme '%1'")
1266  .arg(themename));
1267  delete g_menu;
1268  g_menu = nullptr;
1269  return false;
1270 }
1271 
1272 // If any settings are missing from the database, this will write
1273 // the default values
1274 static void WriteDefaults()
1275 {
1276  PlaybackSettings ps;
1277  ps.Load();
1278  ps.Save();
1279  OSDSettings os;
1280  os.Load();
1281  os.Save();
1282  GeneralSettings gs;
1283  gs.Load();
1284  gs.Save();
1285  EPGSettings es;
1286  es.Load();
1287  es.Save();
1288  AppearanceSettings as;
1289  as.Load();
1290  as.Save();
1291  MainGeneralSettings mgs;
1292  mgs.Load();
1293  mgs.Save();
1295  grs.Load();
1296  grs.Save();
1298  vgs.Load();
1299  vgs.Save();
1300  //TODo Playback group not loaded?
1301  //TODo Channel group not loaded?
1302 }
1303 
1304 static int internal_play_media(const QString &mrl, const QString &plot,
1305  const QString &title, const QString &subtitle,
1306  const QString &director, int season, int episode,
1307  const QString &inetref, std::chrono::minutes lenMins,
1308  const QString &year,
1309  const QString &id, const bool useBookmark)
1310 {
1311  int res = -1;
1312 
1313  QFile checkFile(mrl);
1314  if ((!checkFile.exists() && !mrl.startsWith("dvd:")
1315  && !mrl.startsWith("bd:")
1316  && !mrl.startsWith("myth:")
1317  && !mrl.startsWith("http://")
1318  && !mrl.startsWith("https://")))
1319  {
1320  QString errorText = QCoreApplication::translate("(MythFrontendMain)",
1321  "Failed to open \n '%1' in %2 \n"
1322  "Check if the video exists")
1323  .arg(mrl.section('/', -1),
1324  mrl.section('/', 0, -2));
1325 
1326  ShowOkPopup(errorText);
1327  return res;
1328  }
1329 
1330  auto *pginfo = new ProgramInfo(
1331  mrl, plot, title, QString(), subtitle, QString(),
1332  director, season, episode, inetref, lenMins,
1333  (year.toUInt()) ? year.toUInt() : 1900, id);
1334 
1335  pginfo->SetProgramInfoType(pginfo->DiscoverProgramInfoType());
1336 
1337  bool bookmarkPresent = false;
1338  bool lastPlayPresent = false;
1339 
1340  if (pginfo->IsVideoDVD())
1341  {
1342  auto *dvd = new MythDVDInfo(pginfo->GetPlaybackURL());
1343  if (dvd->IsValid())
1344  {
1345  QString name;
1346  QString serialid;
1347  if (dvd->GetNameAndSerialNum(name, serialid))
1348  {
1349  QStringList fields = pginfo->QueryDVDBookmark(serialid);
1350  bookmarkPresent = (fields.count() > 0);
1351  }
1352  }
1353  else
1354  {
1355  ShowNotificationError(QCoreApplication::translate("(MythFrontendMain)",
1356  "DVD Failure"),
1357  sLocation,
1358  dvd->GetLastError());
1359  delete dvd;
1360  delete pginfo;
1361  return res;
1362  }
1363  delete dvd;
1364  }
1365  else if (pginfo->IsVideoBD())
1366  {
1367  MythBDInfo bd(pginfo->GetPlaybackURL());
1368  if (bd.IsValid())
1369  {
1370  QString name;
1371  QString serialid;
1372  if (bd.GetNameAndSerialNum(name, serialid))
1373  {
1374  QStringList fields = pginfo->QueryBDBookmark(serialid);
1375  bookmarkPresent = (fields.count() > 0);
1376  }
1377  }
1378  else
1379  {
1380  ShowNotificationError(QCoreApplication::translate("(MythFrontendMain)",
1381  "BD Failure"),
1382  sLocation,
1383  bd.GetLastError());
1384  delete pginfo;
1385  return res;
1386  }
1387  }
1388  else if (useBookmark && pginfo->IsVideo())
1389  {
1390  pginfo->SetIgnoreLastPlayPos(false);
1391  pginfo->SetIgnoreBookmark(false);
1392  bookmarkPresent = pginfo->QueryBookmark() > 0;
1393  lastPlayPresent = pginfo->QueryLastPlayPos() > 0;
1394  }
1395 
1396  if (useBookmark && (bookmarkPresent || lastPlayPresent))
1397  {
1399  auto *bookmarkdialog = new BookmarkDialog(pginfo, mainStack,
1400  bookmarkPresent,
1401  lastPlayPresent);
1402  if (!bookmarkdialog->Create())
1403  {
1404  delete bookmarkdialog;
1405  delete pginfo;
1406  return res;
1407  }
1408  }
1409  else
1410  {
1412 
1413  res = 0;
1414 
1415  delete pginfo;
1416  }
1417 
1418  return res;
1419 }
1420 
1421 static void gotoMainMenu(void)
1422 {
1423  // Reset the selected button to the first item.
1424  auto *lmenu = qobject_cast<MythThemedMenuState *>
1425  (GetMythMainWindow()->GetMainStack()->GetTopScreen());
1426  if (lmenu)
1427  lmenu->m_buttonList->SetItemCurrent(0);
1428 }
1429 
1430 // If the theme specified in the DB is somehow broken, try a standard one:
1431 //
1432 static bool resetTheme(QString themedir, const QString &badtheme)
1433 {
1434  QString themename = DEFAULT_UI_THEME;
1435 
1436  if (badtheme == DEFAULT_UI_THEME)
1437  themename = FALLBACK_UI_THEME;
1438 
1439  LOG(VB_GENERAL, LOG_WARNING, QString("Overriding broken theme '%1' with '%2'")
1440  .arg(badtheme, themename));
1441 
1442  gCoreContext->OverrideSettingForSession("Theme", themename);
1443  themedir = GetMythUI()->FindThemeDir(themename);
1444 
1447  GetMythMainWindow()->Init();
1448 
1449  return RunMenu(themedir, themename);
1450 }
1451 
1452 static int reloadTheme(void)
1453 {
1454 #ifdef Q_OS_ANDROID
1455  // jni code to launch the application again
1456  // reinitializing the main windows causes a segfault
1457  // with android
1458 
1459 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
1460  auto activity = QtAndroid::androidActivity();
1461 #else
1462  QJniObject activity = QNativeInterface::QAndroidApplication::context();
1463 #endif
1464  auto packageManager = activity.callObjectMethod
1465  ( "getPackageManager",
1466  "()Landroid/content/pm/PackageManager;" );
1467 
1468  auto activityIntent = packageManager.callObjectMethod
1469  ( "getLaunchIntentForPackage",
1470  "(Ljava/lang/String;)Landroid/content/Intent;",
1471  activity.callObjectMethod("getPackageName",
1472  "()Ljava/lang/String;").object() );
1473 
1474  auto pendingIntent = QAndroidJniObject::callStaticObjectMethod
1475  ( "android/app/PendingIntent",
1476  "getActivity",
1477  "(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;",
1478  activity.object(),
1479  0,
1480  activityIntent.object(),
1481  QAndroidJniObject::getStaticField<jint>("android/content/Intent",
1482  "FLAG_ACTIVITY_CLEAR_TOP") );
1483 
1484  auto alarmManager = activity.callObjectMethod
1485  ( "getSystemService",
1486  "(Ljava/lang/String;)Ljava/lang/Object;",
1487  QAndroidJniObject::getStaticObjectField("android/content/Context",
1488  "ALARM_SERVICE",
1489  "Ljava/lang/String;").object() );
1490 
1491  alarmManager.callMethod<void>
1492  ( "set",
1493  "(IJLandroid/app/PendingIntent;)V",
1494  QAndroidJniObject::getStaticField<jint>("android/app/AlarmManager", "RTC"),
1495  jlong(QDateTime::currentMSecsSinceEpoch() + 100),
1496  pendingIntent.object() );
1497 
1498  qApp->quit();
1499  // QString title = QObject::tr("Your change will take effect the next time "
1500  // "mythfrontend is started.");
1501  // MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythConfirmationDialog *okPopup =
1502  // new MythConfirmationDialog(popupStack, title, false);
1503  // if (okPopup->Create())
1504  // popupStack->AddScreen(okPopup);
1505  return 0;
1506 #else
1508  QString themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
1509  QString themedir = GetMythUI()->FindThemeDir(themename);
1510  if (themedir.isEmpty())
1511  {
1512  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'").arg(themename));
1513  return GENERIC_EXIT_NO_THEME;
1514  }
1515 
1519  if (g_menu)
1520  g_menu->Close();
1521  GetMythMainWindow()->Init();
1523  if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename))
1524  return GENERIC_EXIT_NO_THEME;
1525 
1526  LCD::SetupLCD();
1527  if (LCD *lcd = LCD::Get())
1528  {
1529  lcd->setupLEDs(RemoteGetRecordingMask);
1530  lcd->resetServer();
1531  }
1532 
1533  return 0;
1534 #endif
1535 }
1536 
1537 static void reloadTheme_void(void)
1538 {
1539  int err = reloadTheme();
1540  if (err)
1541  exit(err);
1542 }
1543 
1544 static void setDebugShowBorders(void)
1545 {
1546  MythMainWindow* window = GetMythMainWindow();
1547  MythPainter* painter = window->GetPainter();
1548  painter->SetDebugMode(!painter->ShowBorders(), painter->ShowTypeNames());
1549  if (window->GetMainStack()->GetTopScreen())
1550  window->GetMainStack()->GetTopScreen()->SetRedraw();
1551 }
1552 
1553 static void setDebugShowNames(void)
1554 {
1555  MythMainWindow* window = GetMythMainWindow();
1556  MythPainter* painter = window->GetPainter();
1557  painter->SetDebugMode(painter->ShowBorders(), !painter->ShowTypeNames());
1558  if (window->GetMainStack()->GetTopScreen())
1559  window->GetMainStack()->GetTopScreen()->SetRedraw();
1560 }
1561 
1562 static void InitJumpPoints(void)
1563 {
1564  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Reload Theme"),
1565  "", "", reloadTheme_void);
1566  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Main Menu"),
1567  "", "", gotoMainMenu);
1568  REG_JUMPLOC(QT_TRANSLATE_NOOP("MythControls", "Program Guide"),
1569  "", "", startGuide, "GUIDE");
1570  REG_JUMPLOC(QT_TRANSLATE_NOOP("MythControls", "Program Finder"),
1571  "", "", startFinder, "FINDER");
1572  //REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Search Listings"),
1573  // "", "", startSearch);
1574  REG_JUMPLOC(QT_TRANSLATE_NOOP("MythControls", "Manage Recordings / "
1575  "Fix Conflicts"), "", "", startManaged, "VIEWSCHEDULED");
1576  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Manage Recording Rules"),
1577  "", "", startManageRecordingRules);
1578  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Channel Recording "
1579  "Priorities"), "", "", startChannelRecPriorities);
1580  REG_JUMPLOC(QT_TRANSLATE_NOOP("MythControls", "TV Recording Playback"),
1581  "", "", startPlayback, "JUMPREC");
1582  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Live TV"),
1583  "", "", startTVNormal);
1584  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Status Screen"),
1585  "", "", showStatus);
1586  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Previously Recorded"),
1587  "", "", startPrevious);
1588 
1589  REG_JUMP(QT_TRANSLATE_NOOP("MythControls", "Standby Mode"),
1590  "", "", standbyScreen);
1591 
1592  // Video
1593 
1594  REG_JUMP(JUMP_VIDEO_DEFAULT, QT_TRANSLATE_NOOP("MythControls",
1595  "The Video Default View"), "", jumpScreenVideoDefault);
1596  REG_JUMP(JUMP_VIDEO_MANAGER, QT_TRANSLATE_NOOP("MythControls",
1597  "The Video Manager"), "", jumpScreenVideoManager);
1598  REG_JUMP(JUMP_VIDEO_BROWSER, QT_TRANSLATE_NOOP("MythControls",
1599  "The Video Browser"), "", jumpScreenVideoBrowser);
1600  REG_JUMP(JUMP_VIDEO_TREE, QT_TRANSLATE_NOOP("MythControls",
1601  "The Video Listings"), "", jumpScreenVideoTree);
1602  REG_JUMP(JUMP_VIDEO_GALLERY, QT_TRANSLATE_NOOP("MythControls",
1603  "The Video Gallery"), "", jumpScreenVideoGallery);
1604  REG_JUMP("Play Disc", QT_TRANSLATE_NOOP("MythControls",
1605  "Play an Optical Disc"), "", playDisc);
1606 
1607  // Gallery
1608 
1609  REG_JUMP(JUMP_GALLERY_DEFAULT, QT_TRANSLATE_NOOP("MythControls",
1610  "Image Gallery"), "", RunGallery);
1611 
1612  REG_JUMPEX(QT_TRANSLATE_NOOP("MythControls", "Toggle Show Widget Borders"),
1613  "", "", setDebugShowBorders, false);
1614  REG_JUMPEX(QT_TRANSLATE_NOOP("MythControls", "Toggle Show Widget Names"),
1615  "", "", setDebugShowNames, false);
1616  REG_JUMPEX(QT_TRANSLATE_NOOP("MythControls", "Reset All Keys"),
1617  QT_TRANSLATE_NOOP("MythControls", "Reset all keys to defaults"),
1618  "", resetAllKeys, false);
1619 }
1620 
1621 static void ReloadJumpPoints(void)
1622 {
1623  MythMainWindow *mainWindow = GetMythMainWindow();
1624  mainWindow->ClearAllJumps();
1625  InitJumpPoints();
1626 }
1627 
1628 static void InitKeys(void)
1629 {
1630  REG_KEY("Video","PLAYALT", QT_TRANSLATE_NOOP("MythControls",
1631  "Play selected item in alternate player"), "ALT+P");
1632  REG_KEY("Video","FILTER", QT_TRANSLATE_NOOP("MythControls",
1633  "Open video filter dialog"), "F");
1634  REG_KEY("Video","INCPARENT", QT_TRANSLATE_NOOP("MythControls",
1635  "Increase Parental Level"), "],},F11");
1636  REG_KEY("Video","DECPARENT", QT_TRANSLATE_NOOP("MythControls",
1637  "Decrease Parental Level"), "[,{,F10");
1638  REG_KEY("Video","INCSEARCH", QT_TRANSLATE_NOOP("MythControls",
1639  "Show Incremental Search Dialog"), "Ctrl+S");
1640  REG_KEY("Video","DOWNLOADDATA", QT_TRANSLATE_NOOP("MythControls",
1641  "Download metadata for current item"), "W");
1642  REG_KEY("Video","ITEMDETAIL", QT_TRANSLATE_NOOP("MythControls",
1643  "Display Item Detail Popup"), "");
1644 
1645  // Gallery keybindings
1646  REG_KEY("Images", "PLAY", QT_TRANSLATE_NOOP("MythControls",
1647  "Start/Stop Slideshow"), "P");
1648  REG_KEY("Images", "RECURSIVESHOW", QT_TRANSLATE_NOOP("MythControls",
1649  "Start Recursive Slideshow"), "R");
1650  REG_KEY("Images", "ROTRIGHT", QT_TRANSLATE_NOOP("MythControls",
1651  "Rotate image right 90 degrees"), "],3");
1652  REG_KEY("Images", "ROTLEFT", QT_TRANSLATE_NOOP("MythControls",
1653  "Rotate image left 90 degrees"), "[,1");
1654  REG_KEY("Images", "FLIPHORIZONTAL", QT_TRANSLATE_NOOP("MythControls",
1655  "Flip image horizontally"), "");
1656  REG_KEY("Images", "FLIPVERTICAL", QT_TRANSLATE_NOOP("MythControls",
1657  "Flip image vertically"), "");
1658  REG_KEY("Images", "ZOOMOUT", QT_TRANSLATE_NOOP("MythControls",
1659  "Zoom image out"), "7");
1660  REG_KEY("Images", "ZOOMIN", QT_TRANSLATE_NOOP("MythControls",
1661  "Zoom image in"), "9");
1662  REG_KEY("Images", "FULLSIZE", QT_TRANSLATE_NOOP("MythControls",
1663  "Full-size (un-zoom) image"), "0");
1664  REG_KEY("Images", "MARK", QT_TRANSLATE_NOOP("MythControls",
1665  "Mark image"), "T");
1666  REG_KEY("Images", "SCROLLUP", QT_TRANSLATE_NOOP("MythControls",
1667  "Scroll image up"), "2");
1668  REG_KEY("Images", "SCROLLLEFT", QT_TRANSLATE_NOOP("MythControls",
1669  "Scroll image left"), "4");
1670  REG_KEY("Images", "SCROLLRIGHT", QT_TRANSLATE_NOOP("MythControls",
1671  "Scroll image right"), "6");
1672  REG_KEY("Images", "SCROLLDOWN", QT_TRANSLATE_NOOP("MythControls",
1673  "Scroll image down"), "8");
1674  REG_KEY("Images", "RECENTER", QT_TRANSLATE_NOOP("MythControls",
1675  "Recenter image"), "5");
1676  REG_KEY("Images", "COVER", QT_TRANSLATE_NOOP("MythControls",
1677  "Set or clear cover image"), "C");
1678 }
1679 
1680 static void ReloadKeys(void)
1681 {
1682  MythMainWindow* mainwindow = GetMythMainWindow();
1683  if (mainwindow)
1684  mainwindow->ClearKeyContext("Video");
1685  InitKeys();
1686  if (mainwindow)
1687  mainwindow->ReloadKeys();
1688 }
1689 
1690 static void SetFuncPtrs(void)
1691 {
1692  TV::SetFuncPtr("playbackbox", (void *)PlaybackBox::RunPlaybackBox);
1693  TV::SetFuncPtr("viewscheduled", (void *)ViewScheduled::RunViewScheduled);
1694  TV::SetFuncPtr("programguide", (void *)GuideGrid::RunProgramGuide);
1695  TV::SetFuncPtr("programfinder", (void *)RunProgramFinder);
1696  TV::SetFuncPtr("scheduleeditor", (void *)ScheduleEditor::RunScheduleEditor);
1697 }
1698 
1702 static void clearAllKeys(void)
1703 {
1704  MSqlQuery query(MSqlQuery::InitCon());
1705 
1706  query.prepare("DELETE FROM keybindings "
1707  "WHERE hostname = :HOSTNAME;");
1708  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
1709  if (!query.exec())
1710  MythDB::DBError("Deleting keybindings", query);
1711  query.prepare("DELETE FROM jumppoints "
1712  "WHERE hostname = :HOSTNAME;");
1713  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
1714  if (!query.exec())
1715  MythDB::DBError("Deleting jumppoints", query);
1716 }
1717 
1721 static void resetAllKeys(void)
1722 {
1723  clearAllKeys();
1724  // Reload MythMainWindow bindings
1726  // Reload Jump Points
1727  ReloadJumpPoints();
1728  // Reload mythfrontend and TV bindings
1729  ReloadKeys();
1730 }
1731 
1733 {
1734  REG_MEDIAPLAYER("Internal", QT_TRANSLATE_NOOP("MythControls",
1735  "MythTV's native media player."), internal_play_media);
1736  REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
1737  "MythDVD DVD Media Handler"), "", handleDVDMedia,
1738  MEDIATYPE_DVD, QString());
1739  REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
1740  "MythImage Media Handler 1/2"), "", handleGalleryMedia,
1741  MEDIATYPE_DATA | MEDIATYPE_MIXED, QString());
1742 
1743  QStringList extensions(ImageAdapterBase::SupportedImages()
1745 
1746  REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
1747  "MythImage Media Handler 2/2"), "", handleGalleryMedia,
1748  MEDIATYPE_MGALLERY | MEDIATYPE_MVIDEO, extensions.join(","));
1749  return 0;
1750 }
1751 
1752 static void CleanupMyOldInUsePrograms(void)
1753 {
1754  MSqlQuery query(MSqlQuery::InitCon());
1755 
1756  query.prepare("DELETE FROM inuseprograms "
1757  "WHERE hostname = :HOSTNAME and recusage = 'player' ;");
1758  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
1759  if (!query.exec())
1760  MythDB::DBError("CleanupMyOldInUsePrograms", query);
1761 }
1762 
1763 static bool WasAutomaticStart(void)
1764 {
1765  bool autoStart = false;
1766 
1767  // Is backend running?
1768  //
1770  {
1771  QDateTime startupTime = QDateTime();
1772 
1773  if( gCoreContext->IsMasterHost() )
1774  {
1775  QString s = gCoreContext->GetSetting("MythShutdownWakeupTime", "");
1776  if (!s.isEmpty())
1777  startupTime = MythDate::fromString(s);
1778 
1779  // if we don't have a valid startup time assume we were started manually
1780  if (startupTime.isValid())
1781  {
1782  auto startupSecs = gCoreContext->GetDurSetting<std::chrono::seconds>("StartupSecsBeforeRecording");
1783  startupSecs = std::max(startupSecs, 15 * 60s);
1784  // If we started within 'StartupSecsBeforeRecording' OR 15 minutes
1785  // of the saved wakeup time assume we either started automatically
1786  // to record, to obtain guide data or or for a
1787  // daily wakeup/shutdown period
1788  if (abs(MythDate::secsInPast(startupTime)) < startupSecs)
1789  {
1790  LOG(VB_GENERAL, LOG_INFO,
1791  "Close to auto-start time, AUTO-Startup assumed");
1792 
1793  QString str = gCoreContext->GetSetting("MythFillSuggestedRunTime");
1794  QDateTime guideRunTime = MythDate::fromString(str);
1795  if (MythDate::secsInPast(guideRunTime) < startupSecs)
1796  {
1797  LOG(VB_GENERAL, LOG_INFO,
1798  "Close to MythFillDB suggested run time, AUTO-Startup to fetch guide data?");
1799  }
1800  autoStart = true;
1801  }
1802  else
1803  LOG(VB_GENERAL, LOG_DEBUG,
1804  "NOT close to auto-start time, USER-initiated startup assumed");
1805  }
1806  }
1807  else
1808  {
1809  QString wakeupCmd = gCoreContext->GetSetting("WakeUpCommand");
1810 
1811  // A slave backend that has no wakeup command cannot be woken
1812  // automatically so can be ignored.
1813  if (!wakeupCmd.isEmpty())
1814  {
1815  ProgramList progList;
1816  bool bConflicts = false;
1817  QDateTime nextRecordingStart;
1818 
1819  if (LoadFromScheduler(progList, bConflicts))
1820  {
1821  // Find the first recording to be recorded
1822  // on this machine
1823  QString hostname = gCoreContext->GetHostName();
1824  for (auto *prog : progList)
1825  {
1826  if ((prog->GetRecordingStatus() == RecStatus::WillRecord ||
1827  prog->GetRecordingStatus() == RecStatus::Pending) &&
1828  (prog->GetHostname() == hostname) &&
1829  (nextRecordingStart.isNull() ||
1830  nextRecordingStart > prog->GetRecordingStartTime()))
1831  {
1832  nextRecordingStart = prog->GetRecordingStartTime();
1833  }
1834  }
1835 
1836  if (!nextRecordingStart.isNull() &&
1837  (abs(MythDate::secsInPast(nextRecordingStart)) < 4min))
1838  {
1839  LOG(VB_GENERAL, LOG_INFO,
1840  "Close to start time, AUTO-Startup assumed");
1841 
1842  // If we started within 4 minutes of the next recording,
1843  // we almost certainly started automatically.
1844  autoStart = true;
1845  }
1846  else
1847  LOG(VB_GENERAL, LOG_DEBUG,
1848  "NOT close to auto-start time, USER-initiated startup assumed");
1849 
1850  }
1851  }
1852  }
1853  }
1854 
1855  return autoStart;
1856 }
1857 
1858 // from https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=16897
1859 // The old way of revoking root with setuid(getuid())
1860 // causes system hang in certain cases on raspberry pi
1861 
1862 static int revokeRoot (void)
1863 {
1864  if (getuid () == 0 && geteuid () == 0) // Really running as root
1865  return 0;
1866 
1867  if (geteuid () == 0) // Running setuid root
1868  return seteuid (getuid ()) ; // Change effective uid to the uid of the caller
1869  return 0;
1870 }
1871 
1872 
1873 Q_DECL_EXPORT int main(int argc, char **argv)
1874 {
1875  bool bPromptForBackend = false;
1876  bool bBypassAutoDiscovery = false;
1877 
1879  if (!cmdline.Parse(argc, argv))
1880  {
1881  cmdline.PrintHelp();
1883  }
1884 
1885  if (cmdline.toBool("showhelp"))
1886  {
1887  cmdline.PrintHelp();
1888  return GENERIC_EXIT_OK;
1889  }
1890 
1891  if (cmdline.toBool("showversion"))
1892  {
1894  return GENERIC_EXIT_OK;
1895  }
1896 
1898  QApplication::setSetuidAllowed(true);
1899  QApplication a(argc, argv);
1900  QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHFRONTEND);
1901  CleanupGuard callCleanup(cleanup);
1902 
1903 #ifdef Q_OS_DARWIN
1904  QString path = QCoreApplication::applicationDirPath();
1905  setenv("PYTHONPATH",
1906  QString("%1/../Resources/lib/%2/site-packages:%3")
1907  .arg(path)
1908  .arg(QFileInfo(PYTHON_EXE).fileName())
1909  .arg(QProcessEnvironment::systemEnvironment().value("PYTHONPATH"))
1910  .toUtf8().constData(), 1);
1911 #endif
1912 
1913 #ifndef _WIN32
1917 #endif
1918 
1919 #if defined(Q_OS_ANDROID)
1920  auto config = QSslConfiguration::defaultConfiguration();
1921  config.setCaCertificates(QSslConfiguration::systemCaCertificates());
1922  QSslConfiguration::setDefaultConfiguration(config);
1923 #endif
1924 
1925  int retval = cmdline.ConfigureLogging();
1926  if (retval != GENERIC_EXIT_OK)
1927  return retval;
1928 
1929  bool ResetSettings = false;
1930 
1931  if (cmdline.toBool("prompt"))
1932  bPromptForBackend = true;
1933  if (cmdline.toBool("noautodiscovery"))
1934  bBypassAutoDiscovery = true;
1935 
1936  if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
1937  std::cerr << "Unable to ignore SIGPIPE\n";
1938 
1939  if (!cmdline.toString("geometry").isEmpty())
1941 
1942  fe_sd_notify("STATUS=Connecting to database.");
1943  gContext = new MythContext(MYTH_BINARY_VERSION, true);
1944  gCoreContext->SetAsFrontend(true);
1945 
1947  if (!gContext->Init(true, bPromptForBackend, bBypassAutoDiscovery))
1948  {
1949  LOG(VB_GENERAL, LOG_ERR, "Failed to init MythContext, exiting.");
1950  gCoreContext->SetExiting(true);
1952  }
1953 
1955 
1956  if (!GetMythDB()->HaveSchema())
1957  {
1958  if (!InitializeMythSchema())
1959  return GENERIC_EXIT_DB_ERROR;
1960  }
1961 
1962  if (cmdline.toBool("reset"))
1963  ResetSettings = true;
1964 
1965  if (!cmdline.toBool("noupnp"))
1966  {
1967  fe_sd_notify("STATUS=Creating UPnP media renderer");
1968  g_pUPnp = new MediaRenderer();
1969  if (!g_pUPnp->isInitialized())
1970  {
1971  delete g_pUPnp;
1972  g_pUPnp = nullptr;
1973  }
1974  }
1975 
1976  QString fileprefix = GetConfDir();
1977 
1978  QDir dir(fileprefix);
1979  if (!dir.exists())
1980  dir.mkdir(fileprefix);
1981 
1982  if (ResetSettings)
1983  {
1984  AppearanceSettings as;
1985  as.Save();
1986 
1988  gCoreContext->GetDB()->ClearSetting("Language");
1989  gCoreContext->GetDB()->ClearSettingOnHost("Language", nullptr);
1990  gCoreContext->GetDB()->ClearSetting("Country");
1991  gCoreContext->GetDB()->ClearSettingOnHost("Country", nullptr);
1992 
1993  LOG(VB_GENERAL, LOG_NOTICE, "Appearance settings and language have "
1994  "been reset to defaults. You will need to "
1995  "restart the frontend.");
1996  gContext-> saveSettingsCache();
1997  return GENERIC_EXIT_OK;
1998  }
1999 
2000 #if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
2001  int maxImageSize = gCoreContext->GetNumSetting("ImageMaximumSize", -1);
2002  if (maxImageSize >=0)
2003  QImageReader::setAllocationLimit(maxImageSize);
2004 #endif
2005  QCoreApplication::setSetuidAllowed(true);
2006 
2007  if (revokeRoot() != 0)
2008  {
2009  LOG(VB_GENERAL, LOG_ERR, "Failed to revokeRoot(), exiting.");
2010  return GENERIC_EXIT_NOT_OK;
2011  }
2012 
2013 #ifdef USING_LIBDNS_SD
2014  // this needs to come after gCoreContext has been initialised
2015  // (for hostname) - hence it is not in MediaRenderer
2016  QScopedPointer<BonjourRegister> bonjour(new BonjourRegister());
2017  if (bonjour.data())
2018  {
2019  fe_sd_notify("STATUS=Registering frontend with bonjour");
2020  QByteArray dummy;
2021  int port = gCoreContext->GetNumSetting("UPnP/MythFrontend/ServicePort", 6547);
2022  // frontend upnp server is now ServicePort + 4 (default 6551)
2023  port += 4;
2024  QByteArray name("Mythfrontend on ");
2025  name.append(gCoreContext->GetHostName().toUtf8());
2026  bonjour->Register(port, "_mythfrontend._tcp",
2027  name, dummy);
2028  }
2029 #endif
2030 
2031  fe_sd_notify("STATUS=Initializing LCD");
2032  LCD::SetupLCD();
2033  if (LCD *lcd = LCD::Get())
2034  lcd->setupLEDs(RemoteGetRecordingMask);
2035 
2036  fe_sd_notify("STATUS=Loading translation");
2037  MythTranslation::load("mythfrontend");
2038 
2039  fe_sd_notify("STATUS=Loading themes");
2040  QString themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
2041 
2042  QString themedir = GetMythUI()->FindThemeDir(themename);
2043  if (themedir.isEmpty())
2044  {
2045  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
2046  .arg(themename));
2047  return GENERIC_EXIT_NO_THEME;
2048  }
2049 
2050  themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
2051  themedir = GetMythUI()->FindThemeDir(themename);
2052  if (themedir.isEmpty())
2053  {
2054  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
2055  .arg(themename));
2056  return GENERIC_EXIT_NO_THEME;
2057  }
2058 
2059  auto * mainWindow = GetMythMainWindow();
2060 
2061  // Force an update of our hardware decoder/render support once the window is
2062  // ready and we have a render device (and after each window re-initialisation
2063  // when we may have a new render device). This also ensures the support checks
2064  // are done immediately and are not reliant on semi-random settings initialisation.
2065  QObject::connect(mainWindow, &MythMainWindow::SignalWindowReady,
2066  []() { MythVideoProfile::InitStatics(true); } );
2067 
2068  mainWindow->Init(false);
2069  mainWindow->setWindowTitle(QCoreApplication::translate("(MythFrontendMain)",
2070  "MythTV Frontend",
2071  "Main window title"));
2072 
2073 #ifdef USING_AIRPLAY
2074  if (gCoreContext->GetBoolSetting("AirPlayEnabled", true))
2075  {
2076  fe_sd_notify("STATUS=Initializing AirPlay");
2078  if (!gCoreContext->GetBoolSetting("AirPlayAudioOnly", false))
2079  {
2081  }
2082  }
2083 #endif
2084 
2085  // We must reload the translation after a language change and this
2086  // also means clearing the cached/loaded theme strings, so reload the
2087  // theme which also triggers a translation reload
2089  {
2090  if (!reloadTheme())
2091  return GENERIC_EXIT_NO_THEME;
2092  }
2093 
2094  if (!UpgradeTVDatabaseSchema(false, false, true))
2095  {
2096  LOG(VB_GENERAL, LOG_ERR,
2097  "Couldn't upgrade database to new schema, exiting.");
2099  }
2100 
2101  WriteDefaults();
2102 
2103  // Refresh Global/Main Menu keys after DB update in case there was no DB
2104  // when they were written originally
2105  mainWindow->ReloadKeys();
2106 
2107  fe_sd_notify("STATUS=Initializing jump points");
2108  InitJumpPoints();
2109  InitKeys();
2110  TV::InitKeys();
2111  SetFuncPtrs();
2112 
2114 
2116 
2117  setHttpProxy();
2118 
2119  fe_sd_notify("STATUS=Initializing plugins");
2120  g_pmanager = new MythPluginManager();
2122 
2123  fe_sd_notify("STATUS=Initializing media monitor");
2125  if (mon)
2126  {
2127  mon->StartMonitoring();
2128  mainWindow->installEventFilter(mon);
2129  }
2130 
2131  fe_sd_notify("STATUS=Initializing network control");
2132  NetworkControl *networkControl = nullptr;
2133  if (gCoreContext->GetBoolSetting("NetworkControlEnabled", false))
2134  {
2135  int port = gCoreContext->GetNumSetting("NetworkControlPort", 6546);
2136  networkControl = new NetworkControl();
2137  if (!networkControl->listen(port))
2138  {
2139  LOG(VB_GENERAL, LOG_ERR,
2140  QString("NetworkControl failed to bind to port %1.")
2141  .arg(port));
2142  }
2143  }
2144 
2145 #ifdef Q_OS_DARWIN
2147  GetMythMainWindow()->Init();
2149  gLoaded = true;
2150 #endif
2151  if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename))
2152  {
2153  return GENERIC_EXIT_NO_THEME;
2154  }
2155  fe_sd_notify("STATUS=Loading theme updates");
2156  std::unique_ptr<ThemeUpdateChecker> themeUpdateChecker;
2157  if (gCoreContext->GetBoolSetting("ThemeUpdateNofications", true))
2158  themeUpdateChecker = std::make_unique<ThemeUpdateChecker>();
2159 
2160  MythSystemEventHandler sysEventHandler {};
2161 
2163 
2165  PreviewGenerator::kRemote, 50, 60s);
2166 
2167  fe_sd_notify("STATUS=Creating housekeeper");
2168  auto *housekeeping = new HouseKeeper();
2169 #ifdef __linux__
2170  #ifdef CONFIG_BINDINGS_PYTHON
2171  housekeeping->RegisterTask(new HardwareProfileTask());
2172  #endif
2173 #endif
2174  housekeeping->Start();
2175 
2176 
2177  if (cmdline.toBool("runplugin"))
2178  {
2179  QStringList plugins = g_pmanager->EnumeratePlugins();
2180 
2181  if (plugins.contains(cmdline.toString("runplugin")))
2182  g_pmanager->run_plugin(cmdline.toString("runplugin"));
2183  else if (plugins.contains("myth" + cmdline.toString("runplugin")))
2184  g_pmanager->run_plugin("myth" + cmdline.toString("runplugin"));
2185  else
2186  {
2187  LOG(VB_GENERAL, LOG_ERR,
2188  QString("Invalid plugin name supplied on command line: '%1'")
2189  .arg(cmdline.toString("runplugin")));
2190  LOG(VB_GENERAL, LOG_ERR,
2191  QString("Available plugins: %1")
2192  .arg(plugins.join(", ")));
2194  }
2195  }
2196  else if (cmdline.toBool("jumppoint"))
2197  {
2199 
2200  if (mmw->DestinationExists(cmdline.toString("jumppoint")))
2201  mmw->JumpTo(cmdline.toString("jumppoint"));
2202  else
2203  {
2204  LOG(VB_GENERAL, LOG_ERR,
2205  QString("Invalid jump point supplied on the command line: %1")
2206  .arg(cmdline.toString("jumppoint")));
2207  LOG(VB_GENERAL, LOG_ERR,
2208  QString("Available jump points: %2")
2209  .arg(mmw->EnumerateDestinations().join(", ")));
2211  }
2212  }
2213 
2214  if (WasAutomaticStart())
2215  {
2216  // We appear to have been started automatically
2217  // so enter standby so that the machine can
2218  // shutdown again as soon as possible if necessary.
2219  standbyScreen();
2220  }
2221 
2222  // Provide systemd ready notification (for type=notify units)
2223  fe_sd_notify("STATUS=");
2224  fe_sd_notify("READY=1");
2225 
2226 
2227  int ret = 0;
2228  {
2229  MythHTTPInstance::Addservices({{ FRONTEND_SERVICE, &MythHTTPService::Create<MythFrontendService> }});
2230 
2231  // Send all unknown requests into the web app. make bookmarks and direct access work.
2232  auto spa_index = [](auto && PH1) { return MythHTTPRewrite::RewriteToSPA(std::forward<decltype(PH1)>(PH1), "mythfrontend.html"); };
2233  MythHTTPInstance::AddErrorPageHandler({ "=404", spa_index });
2234 
2235  auto root = [](auto && PH1) { return MythHTTPRoot::RedirectRoot(std::forward<decltype(PH1)>(PH1), "mythfrontend.html"); };
2236  MythHTTPScopedInstance webserver({{ "/", root}});
2237  ret = QCoreApplication::exec();
2238  }
2239 
2240  fe_sd_notify("STOPPING=1\nSTATUS=Exiting");
2241  if (ret==0)
2242  gContext-> saveSettingsCache();
2243 
2244  DestroyMythUI();
2246 
2247  delete housekeeping;
2248 
2250 
2251  if (mon)
2252  mon->deleteLater();
2253 
2254  delete networkControl;
2255  return ret;
2256 }
2257 
2258 void handleSIGUSR1(void)
2259 {
2260  LOG(VB_GENERAL, LOG_INFO, "Reloading theme");
2261  gCoreContext->SendMessage("CLEAR_SETTINGS_CACHE");
2263  GetMythMainWindow()->JumpTo("Reload Theme");
2265 }
2266 
2267 void handleSIGUSR2(void)
2268 {
2269  LOG(VB_GENERAL, LOG_INFO, "Restarting LIRC handler");
2271 }
2272 
2273 /*
2274 include Qt MOC output for Q_OBJECT class defined in this file;
2275 filenames must match.
2276 */
2277 #include "mythfrontend.moc"
2278 /* vim: set expandtab tabstop=4 shiftwidth=4: */
startChannelRecPriorities
static void startChannelRecPriorities(void)
Definition: mythfrontend.cpp:555
MythMediaDevice::isUsable
bool isUsable() const
Is this device "ready", for a plugin to access?
Definition: mythmedia.h:84
scheduleeditor.h
MythCoreContext::SetPluginManager
void SetPluginManager(MythPluginManager *pmanager)
Definition: mythcorecontext.cpp:2093
themedir
static QString themedir
Definition: mythdirs.cpp:23
globalsettings.h
MEDIATYPE_MIXED
@ MEDIATYPE_MIXED
Definition: mythmedia.h:27
TV::InitKeys
static void InitKeys()
Definition: tv_play.cpp:457
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:127
startAppearWiz
static void startAppearWiz(void)
Definition: mythfrontend.cpp:357
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:318
hardwareprofile.h
MythVideoProfile::InitStatics
static void InitStatics(bool Reinit=false)
Definition: mythvideoprofile.cpp:1311
PlaybackBox::RunPlaybackBox
static void * RunPlaybackBox(void *player, bool showTV)
Definition: playbackbox.cpp:371
mythfrontendservice.h
HouseKeeper
Manages registered HouseKeeperTasks and queues tasks for operation.
Definition: housekeeper.h:149
MythCoreContext::SendMessage
void SendMessage(const QString &message)
Definition: mythcorecontext.cpp:1517
tv.h
MEDIATYPE_DVD
@ MEDIATYPE_DVD
Definition: mythmedia.h:29
plPeopleSearch
@ plPeopleSearch
Definition: proglist.h:20
videometadatasettings.h
MythHTTPScopedInstance
Definition: mythhttpinstance.h:35
MythUILocation::RemoveCurrentLocation
QString RemoveCurrentLocation()
Definition: mythuilocation.cpp:12
GuideGrid::RunProgramGuide
static void RunProgramGuide(uint startChanId, const QString &startChanNum, const QDateTime &startTime, TV *player=nullptr, bool embedVideo=false, bool allowFinder=true, int changrpid=-1)
Definition: guidegrid.cpp:411
ThemeChooser
View and select installed themes.
Definition: themechooser.h:27
GeneralSetupWizard
Definition: setupwizard_general.h:14
REG_KEY
static void REG_KEY(const QString &Context, const QString &Action, const QString &Description, const QString &Key)
Definition: mythmainwindow.h:175
setHttpProxy
void setHttpProxy(void)
Get network proxy settings from OS, and use for [Q]Http[Comms].
Definition: mythmiscutil.cpp:800
MythPluginManager
Definition: mythplugin.h:62
MythMainWindow::Init
void Init(bool MayReInit=true)
Definition: mythmainwindow.cpp:642
MythUIScreenBounds::ParseGeometryOverride
static void ParseGeometryOverride(const QString &Geometry)
Parse an X11 style command line geometry string.
Definition: mythuiscreenbounds.cpp:40
startManageRecordingRules
static void startManageRecordingRules(void)
Definition: mythfrontend.cpp:543
kStartTVIgnoreLastPlayPos
@ kStartTVIgnoreLastPlayPos
Definition: tv_play.h:116
LoadFromScheduler
bool LoadFromScheduler(AutoDeleteDeque< TYPE * > &destination, bool &hasConflicts, const QString &altTable="", int recordid=-1)
Definition: programinfo.h:912
ShowNotificationError
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
Definition: mythnotificationcenter.cpp:1426
ManualSchedule
Definition: manualschedule.h:20
customedit.h
jumpScreenVideoManager
static void jumpScreenVideoManager()
Definition: mythfrontend.cpp:760
guidegrid.h
mythdb.h
handleExit
static void handleExit(bool prompt)
Definition: mythfrontend.cpp:1237
MythTranslation::reload
static void reload()
Reload all active translators based on the current language setting.
Definition: mythtranslation.cpp:97
PlaybackSettingsDialog
Definition: globalsettings.h:18
MythSystemLegacy
Definition: mythsystemlegacy.h:67
MythAirplayServer::Create
static bool Create(void)
Definition: mythairplayserver.cpp:352
exitprompt.h
RunGallery
static void RunGallery()
Definition: mythfrontend.cpp:766
ChannelUtil::LoadChannels
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.
Definition: channelutil.cpp:2455
reloadTheme
static int reloadTheme(void)
Definition: mythfrontend.cpp:1452
PreviewGenerator::kRemote
@ kRemote
Definition: previewgenerator.h:44
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:386
MediaMonitor::GetMediaMonitor
static MediaMonitor * GetMediaMonitor(void)
Definition: mythmediamonitor.cpp:75
cmdline
MythCommFlagCommandLineParser cmdline
Definition: mythcommflag.cpp:72
MythCDROM::kBluray
@ kBluray
Definition: mythcdrom.h:29
ReloadKeys
static void ReloadKeys(void)
Definition: mythfrontend.cpp:1680
GrabberSettings
Definition: grabbersettings.h:13
MythMainWindow::SignalWindowReady
void SignalWindowReady()
MythPluginManager::run_plugin
bool run_plugin(const QString &plugname)
Definition: mythplugin.cpp:160
simple_ref_ptr< class VideoList >
MythCoreContext::emitTVPlaybackStopped
void emitTVPlaybackStopped(void)
Definition: mythcorecontext.h:291
internal_play_media
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)
Definition: mythfrontend.cpp:1304
RunProgramFinder
void RunProgramFinder(TV *player, bool embedVideo, bool allowEPG)
Definition: progfind.cpp:31
startSearchPower
static void startSearchPower(void)
Definition: mythfrontend.cpp:461
ProgramRecPriority
Definition: programrecpriority.h:64
mythplugin.h
startSearchTitle
static void startSearchTitle(void)
Definition: mythfrontend.cpp:431
MythMainWindow::JumpTo
void JumpTo(const QString &Destination, bool Pop=true)
Definition: mythmainwindow.cpp:1458
mythcdrom.h
plChannel
@ plChannel
Definition: proglist.h:26
NetworkControl
Definition: networkcontrol.h:95
startSearchNew
static void startSearchNew(void)
Definition: mythfrontend.cpp:511
ChannelGroupsSetting
Definition: globalsettings.h:326
ParentalLevel::plMedium
@ plMedium
Definition: parentalcontrols.h:12
MythContext
Startup context for MythTV.
Definition: mythcontext.h:43
PlaybackSettings
Definition: globalsettings.h:33
ExitPrompter
Definition: mythfrontend/exitprompt.h:6
ParentalLevel::plHigh
@ plHigh
Definition: parentalcontrols.h:13
MythCoreContext::OverrideSettingForSession
void OverrideSettingForSession(const QString &key, const QString &value)
Definition: mythcorecontext.cpp:1337
VideoDialog::DLG_BROWSER
@ DLG_BROWSER
Definition: videodlg.h:37
ChannelUtil::kChanGroupByChanid
@ kChanGroupByChanid
Definition: channelutil.h:217
MediaMonitor::StartMonitoring
virtual void StartMonitoring(void)
Start the monitoring thread if needed.
Definition: mythmediamonitor.cpp:442
playDisc
static void playDisc()
Definition: mythfrontend.cpp:781
MythMainWindow::ClearAllJumps
void ClearAllJumps()
Definition: mythmainwindow.cpp:1450
mythhttpinstance.h
mythdvdbuffer.h
RemoteGetFreeRecorderCount
int RemoteGetFreeRecorderCount(void)
Definition: tvremoteutil.cpp:168
jumpScreenVideoDefault
static void jumpScreenVideoDefault()
Definition: mythfrontend.cpp:764
setupwizard_general.h
BackendConnectionManager
Definition: backendconnectionmanager.h:7
setenv
#define setenv(x, y, z)
Definition: compat.h:89
MythScreenStack
Definition: mythscreenstack.h:16
MythScreenType::Create
virtual bool Create(void)
Definition: mythscreentype.cpp:266
mythdbcon.h
jumpScreenVideoTree
static void jumpScreenVideoTree()
Definition: mythfrontend.cpp:762
standbyScreen
static void standbyScreen(void)
Definition: mythfrontend.cpp:699
plCategory
@ plCategory
Definition: proglist.h:25
ProgLister
Definition: proglist.h:33
mythmediamonitor.h
MEDIASTAT_USEABLE
@ MEDIASTAT_USEABLE
Definition: mythmedia.h:19
MythMainWindow::ReloadKeys
void ReloadKeys()
Definition: mythmainwindow.cpp:954
PreviewGeneratorQueue::CreatePreviewGeneratorQueue
static void CreatePreviewGeneratorQueue(PreviewGenerator::Mode mode, uint maxAttempts, std::chrono::seconds minBlockSeconds)
Create the singleton queue of preview generators.
Definition: previewgeneratorqueue.cpp:42
MythCoreContext::emitTVPlaybackStarted
void emitTVPlaybackStarted(void)
Definition: mythcorecontext.h:290
MythUIType::customEvent
void customEvent(QEvent *event) override
Definition: mythuitype.cpp:1008
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:619
grabbersettings.h
ReferenceCounter::PrintDebug
static void PrintDebug(void)
Print out any leaks if that level of debugging is enabled.
Definition: referencecounter.cpp:72
RemoteGetRecordingMask
int RemoteGetRecordingMask(void)
Definition: remoteutil.cpp:392
MythMediaDevice::getStatus
MythMediaStatus getStatus() const
Definition: mythmedia.h:70
ChannelUtil::kChanOrderByLiveTV
@ kChanOrderByLiveTV
Definition: channelutil.h:210
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
BonjourRegister
Definition: bonjourregister.h:11
playgroup.h
SettingsHelper::RunEpilog
void RunEpilog(void)
Definition: settingshelper.h:31
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MythThemedMenu::foundTheme
bool foundTheme(void) const
Returns true iff a theme has been found by a previous call to SetMenuTheme().
Definition: myththemedmenu.cpp:142
cleanup.h
statusbox.h
GetMythDB
MythDB * GetMythDB(void)
Definition: mythdb.cpp:50
mythsystemevent.h
MEDIASTAT_MOUNTED
@ MEDIASTAT_MOUNTED
Definition: mythmedia.h:21
main
Q_DECL_EXPORT int main(int argc, char **argv)
Definition: mythfrontend.cpp:1873
SetFuncPtrs
static void SetFuncPtrs(void)
Definition: mythfrontend.cpp:1690
VideoDialog::GetSavedVideoList
static VideoListDeathDelayPtr & GetSavedVideoList()
Definition: videodlg.cpp:873
mythdirs.h
MythAirplayServer::Cleanup
static void Cleanup(void)
Definition: mythairplayserver.cpp:391
startSearchStored
static void startSearchStored(void)
Definition: mythfrontend.cpp:471
progfind.h
myth_system
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
Definition: mythsystemlegacy.cpp:506
GENERIC_EXIT_OK
@ GENERIC_EXIT_OK
Exited with no error.
Definition: exitcodes.h:11
MythMainWindow::GetPainter
MythPainter * GetPainter()
Definition: mythmainwindow.cpp:258
MythBDInfo::IsValid
bool IsValid(void) const
Definition: mythbdinfo.cpp:161
startPlayback
static void startPlayback(void)
Definition: mythfrontend.cpp:596
startSearchCategory
static void startSearchCategory(void)
Definition: mythfrontend.cpp:491
ParentalLevelChangeChecker
Definition: parentalcontrols.h:43
networkcontrol.h
remoteutil.h
LCD::Get
static LCD * Get(void)
Definition: lcddevice.cpp:69
OSDSettings
Definition: globalsettings.h:126
startManaged
static void startManaged(void)
Definition: mythfrontend.cpp:531
MythMainWindow::HandleMedia
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)
Definition: mythmainwindow.cpp:1497
g_settingsHelper
static SettingsHelper * g_settingsHelper
Definition: mythfrontend.cpp:143
AudioConfigScreen
Definition: audiogeneralsettings.h:24
TV::StartTV
static bool StartTV(ProgramInfo *TVRec, uint Flags, const ChannelInfoList &Selection=ChannelInfoList())
Start playback of media.
Definition: tv_play.cpp:254
VideoDialog::DialogType
DialogType
Definition: videodlg.h:37
JUMP_VIDEO_TREE
const QString JUMP_VIDEO_TREE
Definition: globals.cpp:38
proglist.h
langsettings.h
tmp
static guint32 * tmp
Definition: goom_core.cpp:26
mythairplayserver.h
channelrecpriority.h
MythMainWindow::SetEffectsEnabled
void SetEffectsEnabled(bool Enable)
Definition: mythmainwindow.cpp:1029
prevreclist.h
RunMenu
static bool RunMenu(const QString &themedir, const QString &themename)
Definition: mythfrontend.cpp:1250
mythsystemlegacy.h
startPreviousOld
static void startPreviousOld(void)
Definition: mythfrontend.cpp:611
MythDisplay::ConfigureQtGUI
static void ConfigureQtGUI(int SwapInterval, const MythCommandLineParser &CmdLine)
Shared static initialisation code for all MythTV GUI applications.
Definition: mythdisplay.cpp:1158
handleSIGUSR2
void handleSIGUSR2(void)
Definition: mythfrontend.cpp:2267
PlayGroupEditor
Definition: playgroup.h:25
RecStatus::WillRecord
@ WillRecord
Definition: recordingstatus.h:30
fe_sd_notify
static void fe_sd_notify(const char *)
Definition: mythfrontend.cpp:130
MythScreenStack::GetScreenList
void GetScreenList(QVector< MythScreenType * > &screens)
Definition: mythscreenstack.cpp:200
quit
@ quit
Definition: lirc_client.h:30
startSearchChannel
static void startSearchChannel(void)
Definition: mythfrontend.cpp:481
MythCommandLineParser::Parse
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
Definition: mythcommandlineparser.cpp:1544
sLocation
static const QString sLocation
Definition: mythfrontend.cpp:154
playbackbox.h
IdleScreen
Definition: idlescreen.h:12
StandardSettingDialog
Definition: standardsettings.h:468
InitializeMythSchema
bool InitializeMythSchema(void)
command to get the the initial database layout from an empty database:
Definition: dbcheck.cpp:4079
kStartTVNoFlags
@ kStartTVNoFlags
Definition: tv_play.h:111
StandardSettingDialog::Create
bool Create(void) override
Definition: standardsettings.cpp:774
handleGalleryMedia
static void handleGalleryMedia(MythMediaDevice *dev)
Definition: mythfrontend.cpp:885
plTitleSearch
@ plTitleSearch
Definition: proglist.h:18
startCustomEdit
static void startCustomEdit(void)
Definition: mythfrontend.cpp:621
MythFrontendCommandLineParser
Definition: mythfrontend_commandlineparser.h:6
MythHTTPInstance::Addservices
static void Addservices(const HTTPServices &Services)
Definition: mythhttpinstance.cpp:102
programinfo.h
InitJumpPoints
static void InitJumpPoints(void)
Definition: mythfrontend.cpp:1562
programrecpriority.h
GENERIC_EXIT_NO_MYTHCONTEXT
@ GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.
Definition: exitcodes.h:14
GetConfDir
QString GetConfDir(void)
Definition: mythdirs.cpp:256
TV::ConfiguredTunerCards
static int ConfiguredTunerCards()
If any cards are configured, return the number.
Definition: tv_play.cpp:85
videolist.h
FileAssocDialog
Definition: videofileassoc.h:13
MythCoreContext::BackendIsRunning
static bool BackendIsRunning(void)
a backend process is running on this host
Definition: mythcorecontext.cpp:700
jumpScreenVideoGallery
static void jumpScreenVideoGallery()
Definition: mythfrontend.cpp:763
MythCoreContext::SetAsFrontend
void SetAsFrontend(bool frontend)
Definition: mythcorecontext.cpp:649
UpgradeTVDatabaseSchema
bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, const bool upgradeIfNoUI, [[maybe_unused]] const bool informSystemd)
Called from outside dbcheck.cpp to update the schema.
Definition: dbcheck.cpp:361
VideoDialog::VideoListDeathDelayPtr
QPointer< class VideoListDeathDelay > VideoListDeathDelayPtr
Definition: videodlg.h:46
dbcheck.h
ParentalLevel::Level
Level
Definition: parentalcontrols.h:12
JUMP_VIDEO_MANAGER
const QString JUMP_VIDEO_MANAGER
Definition: globals.cpp:36
signalhandling.h
globals.h
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
startPlaybackWithGroup
static void startPlaybackWithGroup(const QString &recGroup="")
Definition: mythfrontend.cpp:579
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:551
CleanupGuard
Definition: cleanupguard.h:6
compat.h
WriteDefaults
static void WriteDefaults()
Definition: mythfrontend.cpp:1274
VideoDialog::DLG_GALLERY
@ DLG_GALLERY
Definition: videodlg.h:37
mythcontrols.h
Main header for mythcontrols.
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:226
mythhttprewrite.h
startSearchTime
static void startSearchTime(void)
Definition: mythfrontend.cpp:521
bonjourregister.h
custompriority.h
MythCoreContext::GetDurSetting
std::enable_if_t< std::chrono::__is_duration< T >::value, T > GetDurSetting(const QString &key, T defaultval=T::zero())
Definition: mythcorecontext.h:168
PrevRecordedList
Definition: prevreclist.h:31
StandardSetting::Load
virtual void Load(void)
Definition: standardsettings.cpp:214
SIGUSR1
#define SIGUSR1
Definition: compat.h:137
gotoMainMenu
static void gotoMainMenu(void)
Definition: mythfrontend.cpp:1421
gallerythumbview.h
Implements Gallery Thumbnail screen.
VideoGeneralSettings
Definition: videoglobalsettings.h:10
mediarenderer.h
MythMainWindow::DestinationExists
bool DestinationExists(const QString &Destination) const
Definition: mythmainwindow.cpp:1471
DestroyMythMainWindow
void DestroyMythMainWindow(void)
Definition: mythmainwindow.cpp:114
MediaRenderer
Definition: mediarenderer.h:29
UPnp::isInitialized
bool isInitialized()
Definition: upnp.h:120
ImageAdapterBase::SupportedImages
static QStringList SupportedImages()
Return recognised pictures.
Definition: imagemanager.cpp:308
isLiveTVAvailable
static bool isLiveTVAvailable(void)
Definition: mythfrontend.cpp:644
handleSIGUSR1
void handleSIGUSR1(void)
Definition: mythfrontend.cpp:2258
showStatus
static void showStatus(void)
Definition: mythfrontend.cpp:686
FRONTEND_SERVICE
#define FRONTEND_SERVICE
Definition: mythfrontendservice.h:7
videofileassoc.h
MythCoreContext::GetDB
MythDB * GetDB(void)
Definition: mythcorecontext.cpp:1753
MythUIThemeHelper::FindThemeDir
QString FindThemeDir(const QString &ThemeName, bool Fallback=true)
Returns the full path to the theme denoted by themename.
Definition: mythuithemehelper.cpp:48
clearAllKeys
static void clearAllKeys(void)
Deletes all key bindings and jump points for this host.
Definition: mythfrontend.cpp:1702
SIGPIPE
#define SIGPIPE
Definition: compat.h:139
MythCommandLineParser::PrintVersion
static void PrintVersion(void)
Print application version information.
Definition: mythcommandlineparser.cpp:1372
ScheduleEditor::RunScheduleEditor
static void * RunScheduleEditor(ProgramInfo *proginfo, void *player=nullptr)
Callback.
Definition: scheduleeditor.cpp:59
PlaybackSettings::Load
void Load(void) override
Definition: globalsettings.cpp:4446
mythtranslation.h
StandardSetting::Save
virtual void Save(void)
Definition: standardsettings.cpp:233
JUMP_VIDEO_GALLERY
const QString JUMP_VIDEO_GALLERY
Definition: globals.cpp:39
HardwareProfileTask
Definition: hardwareprofile.h:52
scheduledrecording.h
plPowerSearch
@ plPowerSearch
Definition: proglist.h:21
internal_media_init
static int internal_media_init()
Definition: mythfrontend.cpp:1732
MEDIATYPE_MVIDEO
@ MEDIATYPE_MVIDEO
Definition: mythmedia.h:32
MythUIBusyDialog
Definition: mythprogressdialog.h:36
MythBDInfo::GetNameAndSerialNum
bool GetNameAndSerialNum(QString &Name, QString &SerialNum)
Definition: mythbdinfo.cpp:166
VideoDialog::BRS_FOLDER
@ BRS_FOLDER
Definition: videodlg.h:40
MythCommandLineParser::PrintHelp
void PrintHelp(void) const
Print command line option help.
Definition: mythcommandlineparser.cpp:1388
MythSystemEventEditor
An editor for MythSystemEvent handler commands.
Definition: mythsystemevent.h:50
GENERIC_EXIT_NO_THEME
@ GENERIC_EXIT_NO_THEME
No Theme available.
Definition: exitcodes.h:15
JUMP_VIDEO_BROWSER
const QString JUMP_VIDEO_BROWSER
Definition: globals.cpp:37
GeneralRecPrioritiesSettings
Definition: globalsettings.h:204
GeneralSettings
Definition: globalsettings.h:134
audiogeneralsettings.h
GENERIC_EXIT_NOT_OK
@ GENERIC_EXIT_NOT_OK
Exited with error.
Definition: exitcodes.h:12
getuid
#define getuid()
Definition: compat.h:183
VideoDialog
Definition: videodlg.h:32
kMSPropagateLogs
@ kMSPropagateLogs
add arguments for MythTV log propagation
Definition: mythsystem.h:52
uint
unsigned int uint
Definition: compat.h:81
startCustomPriority
static void startCustomPriority(void)
Definition: mythfrontend.cpp:567
MythHTTPRoot::RedirectRoot
static HTTPResponse RedirectRoot(const HTTPRequest2 &Request, const QString &File)
A convenience method to seemlessly redirect requests for index.html to a context specific file.
Definition: mythhttproot.cpp:24
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
JUMP_GALLERY_DEFAULT
const QString JUMP_GALLERY_DEFAULT
Definition: globals.cpp:42
videoglobalsettings.h
g_pmanager
static MythPluginManager * g_pmanager
Definition: mythfrontend.cpp:141
ParentalLevelChangeChecker::SigResultReady
void SigResultReady(bool passwordValid, ParentalLevel::Level newLevel)
MythCommandLineParser::ApplySettingsOverride
void ApplySettingsOverride(void)
Apply all overrides to the global context.
Definition: mythcommandlineparser.cpp:2916
MediaMonitor
Definition: mythmediamonitor.h:45
MythMainWindow::EnumerateDestinations
QStringList EnumerateDestinations() const
Definition: mythmainwindow.cpp:1476
VideoList
Definition: videolist.h:23
CustomEdit
A screen to create a fully custom recording.
Definition: customedit.h:17
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:912
MythScreenType::GetScreenStack
MythScreenStack * GetScreenStack() const
Definition: mythscreentype.cpp:217
kStartTVIgnoreBookmark
@ kStartTVIgnoreBookmark
Definition: tv_play.h:114
ViewScheduled::RunViewScheduled
static void * RunViewScheduled(void *player, bool showTv)
Definition: viewscheduled.cpp:25
cleanup
static QString cleanup(const QString &str)
Definition: remoteencoder.cpp:673
referencecounter.h
plStoredSearch
@ plStoredSearch
Definition: proglist.h:29
MythUIThemeHelper::InitThemeHelper
void InitThemeHelper()
Definition: mythuithemehelper.cpp:14
channelutil.h
tvremoteutil.h
mythraopdevice.h
MythDate::fromString
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:34
settingshelper.h
RecStatus::Pending
@ Pending
Definition: recordingstatus.h:16
taskqueue.h
MythPainter::ShowBorders
bool ShowBorders(void) const
Definition: mythpainter.h:102
revokeRoot
static int revokeRoot(void)
Definition: mythfrontend.cpp:1862
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:906
SettingsHelper
Definition: settingshelper.h:9
standardsettings.h
AutoDeleteDeque< ProgramInfo * >
StatusBox
Reports on various status items.
Definition: statusbox.h:37
MythCDROM::inspectImage
static ImageType inspectImage(const QString &path)
Definition: mythcdrom.cpp:188
PreviewGeneratorQueue::TeardownPreviewGeneratorQueue
static void TeardownPreviewGeneratorQueue()
Destroy the singleton queue of preview generators.
Definition: previewgeneratorqueue.cpp:55
mythuihelper.h
ChannelRecPriority
Screen for managing channel priorities in recording scheduling decisions.
Definition: channelrecpriority.h:21
SignalHandler::Init
static void Init(QObject *parent=nullptr)
Definition: signalhandling.cpp:127
DEFAULT_UI_THEME
static constexpr const char * DEFAULT_UI_THEME
Definition: mythuithemehelper.h:7
setDebugShowBorders
static void setDebugShowBorders(void)
Definition: mythfrontend.cpp:1544
mythbdbuffer.h
startSearchMovie
static void startSearchMovie(void)
Definition: mythfrontend.cpp:501
MythPainter::ShowTypeNames
bool ShowTypeNames(void) const
Definition: mythpainter.h:103
MythPainter::SetDebugMode
void SetDebugMode(bool showBorders, bool showNames)
Definition: mythpainter.h:96
MYTH_APPNAME_MYTHFRONTEND
static constexpr const char * MYTH_APPNAME_MYTHFRONTEND
Definition: mythcorecontext.h:21
PlaybackBox
Definition: playbackbox.h:61
startManualSchedule
static void startManualSchedule(void)
Definition: mythfrontend.cpp:632
kMSDisableUDPListener
@ kMSDisableUDPListener
disable MythMessage UDP listener for the duration of application.
Definition: mythsystem.h:50
ReloadJumpPoints
static void ReloadJumpPoints(void)
Definition: mythfrontend.cpp:1621
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
RunVideoScreen
static void RunVideoScreen(VideoDialog::DialogType type, bool fromJump=false)
Definition: mythfrontend.cpp:711
startTVNormal
static void startTVNormal(void)
Definition: mythfrontend.cpp:658
mythmiscutil.h
seteuid
#define seteuid(x)
Definition: compat.h:186
MythDate::secsInPast
std::chrono::seconds secsInPast(const QDateTime &past)
Definition: mythdate.cpp:203
MetadataSettings
Definition: videometadatasettings.h:12
themechooser.h
VideoDialog::DLG_DEFAULT
@ DLG_DEFAULT
Definition: videodlg.h:37
MythCommandLineParser::toString
QString toString(const QString &key) const
Returns stored QVariant as a QString, falling to default if not provided.
Definition: mythcommandlineparser.cpp:2344
LCD::SetupLCD
static void SetupLCD(void)
Definition: lcddevice.cpp:76
MythBDInfo
Definition: mythbdinfo.h:16
mythhttproot.h
MythCommandLineParser::toBool
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
Definition: mythcommandlineparser.cpp:2187
handleDVDMedia
static void handleDVDMedia(MythMediaDevice *dvd)
Definition: mythfrontend.cpp:863
MythPainter
Definition: mythpainter.h:34
MEDIATYPE_MGALLERY
@ MEDIATYPE_MGALLERY
Definition: mythmedia.h:33
plTime
@ plTime
Definition: proglist.h:27
cleanupguard.h
MythCoreContext::GetSettingOnHost
QString GetSettingOnHost(const QString &key, const QString &host, const QString &defaultval="")
Definition: mythcorecontext.cpp:926
EPGSettings
Definition: globalsettings.h:142
LanguageSelection::prompt
static bool prompt(bool force=false)
Ask the user for the language to use.
Definition: langsettings.cpp:173
MainGeneralSettings
Definition: globalsettings.h:185
VideoDialog::BrowseType
BrowseType
Definition: videodlg.h:40
VideoDialog::DLG_MANAGER
@ DLG_MANAGER
Definition: videodlg.h:38
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:889
MythRAOPDevice::Cleanup
static void Cleanup(void)
Definition: mythraopdevice.cpp:72
MythRAOPDevice::Create
static bool Create(void)
Definition: mythraopdevice.cpp:26
AppearanceSettings
Definition: globalsettings.h:151
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
audiooutput.h
MythPluginManager::EnumeratePlugins
QStringList EnumeratePlugins(void)
Definition: mythplugin.cpp:233
SIGUSR2
#define SIGUSR2
Definition: compat.h:138
GENERIC_EXIT_DB_OUTOFDATE
@ GENERIC_EXIT_DB_OUTOFDATE
Database needs upgrade.
Definition: exitcodes.h:17
AudioConfigSettings
Definition: audiogeneralsettings.h:36
mythfrontend_commandlineparser.h
ViewScheduled
Screen for viewing and managing upcoming and conflicted recordings.
Definition: viewscheduled.h:29
REG_JUMP
static void REG_JUMP(const QString &Destination, const QString &Description, const QString &Key, void(*Callback)(void))
Definition: mythmainwindow.h:188
mythcontext.h
TV::SetFuncPtr
static void SetFuncPtr(const char *Name, void *Pointer)
Import pointers to functions used to embed the TV window into other containers e.g.
Definition: tv_play.cpp:442
MythThemedMenu::setCallback
void setCallback(void(*lcallback)(void *, QString &), void *data)
Set the themed menus callback function and data for that function.
Definition: myththemedmenu.cpp:156
DialogCompletionEvent::kEventType
static const Type kEventType
Definition: mythdialogbox.h:57
plMovies
@ plMovies
Definition: proglist.h:24
GetAppBinDir
QString GetAppBinDir(void)
Definition: mythdirs.cpp:253
jumpScreenVideoBrowser
static void jumpScreenVideoBrowser()
Definition: mythfrontend.cpp:761
resetTheme
static bool resetTheme(QString themedir, const QString &badtheme)
Definition: mythfrontend.cpp:1432
SignalHandler::SetHandler
static void SetHandler(int signum, SigHandlerFunc handler)
Definition: signalhandling.cpp:141
REG_MEDIAPLAYER
static void REG_MEDIAPLAYER(const QString &Name, const QString &Desc, MediaPlayCallback Func)
Definition: mythmainwindow.h:209
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:104
previewgeneratorqueue.h
g_pUPnp
static MediaRenderer * g_pUPnp
Definition: mythfrontend.cpp:140
startPrevious
static void startPrevious(void)
Definition: mythfrontend.cpp:601
MythBDInfo::GetLastError
QString GetLastError(void) const
Definition: mythbdinfo.cpp:173
REG_JUMPEX
static void REG_JUMPEX(const QString &Destination, const QString &Description, const QString &Key, void(*Callback)(void), bool ExitToMain)
Definition: mythmainwindow.h:202
MythCoreContext::ActivateSettingsCache
void ActivateSettingsCache(bool activate=true)
Definition: mythcorecontext.cpp:833
MythScreenType::Exiting
void Exiting()
startGuide
static void startGuide(void)
Definition: mythfrontend.cpp:418
MediaMonitor::defaultDVDdevice
static QString defaultDVDdevice()
DVDDeviceLocation, user-selected drive, or /dev/dvd.
Definition: mythmediamonitor.cpp:903
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:323
VideoListDeathDelay::kDelayTimeMS
static constexpr std::chrono::milliseconds kDelayTimeMS
Definition: videodlg.h:237
resetAllKeys
static void resetAllKeys(void)
Reset this host's key bindings and jump points to default values.
Definition: mythfrontend.cpp:1721
ServerPool::listen
bool listen(QList< QHostAddress > addrs, quint16 port, bool requireall=true, PoolServerType type=kTCPServer)
Definition: serverpool.cpp:391
MythMainWindow::ClearKeyContext
void ClearKeyContext(const QString &Context)
Definition: mythmainwindow.cpp:1205
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:838
MythThemedMenu
Themed menu class, used for main menus in MythTV frontend.
Definition: myththemedmenu.h:57
CleanupMyOldInUsePrograms
static void CleanupMyOldInUsePrograms(void)
Definition: mythfrontend.cpp:1752
MythCoreContext::ReInitLocale
void ReInitLocale(void)
Definition: mythcorecontext.cpp:1861
SettingsHelper::RunProlog
void RunProlog(const QString &settingsPage)
Definition: settingshelper.h:20
MythMediaDevice
Definition: mythmedia.h:48
VideoDialog::DLG_TREE
@ DLG_TREE
Definition: videodlg.h:38
myththemedmenu.h
manualschedule.h
plNewListings
@ plNewListings
Definition: proglist.h:23
MythCommandLineParser::ConfigureLogging
int ConfigureLogging(const QString &mask="general", bool progress=false)
Read in logging options and initialize the logging interface.
Definition: mythcommandlineparser.cpp:2849
MythControls
Screen for managing and configuring keyboard input bindings.
Definition: mythcontrols.h:48
MythCoreContext::ClearSettingsCache
void ClearSettingsCache(const QString &myKey=QString(""))
Definition: mythcorecontext.cpp:828
MythCoreContext::IsMasterHost
bool IsMasterHost(void)
is this the same host as the master
Definition: mythcorecontext.cpp:659
musicbrainzngs.caa.hostname
string hostname
Definition: caa.py:17
FALLBACK_UI_THEME
static constexpr const char * FALLBACK_UI_THEME
Definition: mythuithemehelper.h:8
MythUILocation::AddCurrentLocation
void AddCurrentLocation(const QString &Location)
Definition: mythuilocation.cpp:5
setDebugShowNames
static void setDebugShowNames(void)
Definition: mythfrontend.cpp:1553
MediaMonitor::deleteLater
virtual void deleteLater(void)
Definition: mythmediamonitor.cpp:367
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:881
TVMenuCallback
static void TVMenuCallback([[maybe_unused]] void *data, QString &selection)
Definition: mythfrontend.cpp:916
WasAutomaticStart
static bool WasAutomaticStart(void)
Definition: mythfrontend.cpp:1763
lcddevice.h
REG_MEDIA_HANDLER
static void REG_MEDIA_HANDLER(const QString &destination, const QString &description, void(*callback)(MythMediaDevice *), int mediaType, const QString &extensions)
Definition: mythmediamonitor.h:138
AudioOutput::Cleanup
static void Cleanup(void)
Definition: audiooutput.cpp:49
CustomPriority
Definition: custompriority.h:13
MythPluginManager::DestroyAllPlugins
void DestroyAllPlugins()
Definition: mythplugin.cpp:221
geteuid
#define geteuid()
Definition: compat.h:184
MythTranslation::load
static void load(const QString &module_name)
Load a QTranslator for the user's preferred language.
Definition: mythtranslation.cpp:37
exitcodes.h
GetMythUI
MythUIHelper * GetMythUI()
Definition: mythuihelper.cpp:66
backendconnectionmanager.h
g_menu
static MythThemedMenu * g_menu
Definition: mythfrontend.cpp:130
build_compdb.filename
filename
Definition: build_compdb.py:21
MythMainWindow::RestartInputHandlers
void RestartInputHandlers()
Definition: mythmainwindow.cpp:2102
GENERIC_EXIT_INVALID_CMDLINE
@ GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
Definition: exitcodes.h:16
mythmainwindow.h
MythSystemEventHandler
Handles incoming MythSystemEvent messages.
Definition: mythsystemevent.h:24
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:52
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:310
startFinder
static void startFinder(void)
Definition: mythfrontend.cpp:426
MythDVDInfo
Definition: mythdvdinfo.h:19
startSearchPeople
static void startSearchPeople(void)
Definition: mythfrontend.cpp:451
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:562
reloadTheme_void
static void reloadTheme_void(void)
Definition: mythfrontend.cpp:1537
REG_JUMPLOC
static void REG_JUMPLOC(const QString &Destination, const QString &Description, const QString &Key, void(*Callback)(void), const QString &LocalAction)
Definition: mythmainwindow.h:195
gContext
MythContext * gContext
This global variable contains the MythContext instance for the application.
Definition: mythcontext.cpp:64
GalleryThumbView
Thumbnail screen.
Definition: gallerythumbview.h:23
MythHTTPRewrite::RewriteToSPA
static HTTPResponse RewriteToSPA(const HTTPRequest2 &Request, const QString &File)
A convenience method to seemlessly redirect requests to a Single Page web app (SPA)
Definition: mythhttprewrite.cpp:50
MythContext::Init
bool Init(bool gui=true, bool promptForBackend=false, bool disableAutoDiscovery=false, bool ignoreDB=false)
Definition: mythcontext.cpp:1603
MythMainWindow
Definition: mythmainwindow.h:28
LCD
Definition: lcddevice.h:169
idlescreen.h
SignalHandler::Done
static void Done(void)
Definition: signalhandling.cpp:134
MythCoreContext::SetExiting
void SetExiting(bool exiting=true)
Definition: mythcorecontext.cpp:2112
startSearchKeyword
static void startSearchKeyword(void)
Definition: mythfrontend.cpp:441
videodlg.h
mythbdinfo.h
DestroyMythUI
void DestroyMythUI()
Definition: mythuihelper.cpp:71
MEDIATYPE_DATA
@ MEDIATYPE_DATA
Definition: mythmedia.h:26
viewscheduled.h
JUMP_VIDEO_DEFAULT
const QString JUMP_VIDEO_DEFAULT
Definition: globals.cpp:40
MythMainWindow::PauseIdleTimer
void PauseIdleTimer(bool Pause)
Pause the idle timeout timer.
Definition: mythmainwindow.cpp:2155
plKeywordSearch
@ plKeywordSearch
Definition: proglist.h:19
videoplayersettings.h
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:898
ImageAdapterBase::SupportedVideos
static QStringList SupportedVideos()
Return recognised video extensions.
Definition: imagemanager.cpp:323
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:838
MythScreenStack::GetTopScreen
virtual MythScreenType * GetTopScreen(void) const
Definition: mythscreenstack.cpp:182
MythHTTPInstance::AddErrorPageHandler
static void AddErrorPageHandler(const HTTPHandler &Handler)
Definition: mythhttpinstance.cpp:112
startKeysSetup
static void startKeysSetup()
Definition: mythfrontend.cpp:406
InitKeys
static void InitKeys(void)
Definition: mythfrontend.cpp:1628
ChannelInfoList
std::vector< ChannelInfo > ChannelInfoList
Definition: channelinfo.h:131
GENERIC_EXIT_DB_ERROR
@ GENERIC_EXIT_DB_ERROR
Database error.
Definition: exitcodes.h:18
PlayerSettings
Definition: videoplayersettings.h:11