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