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