MythTV  master
mythtv/programs/mythtv-setup/main.cpp
Go to the documentation of this file.
1 #include <unistd.h>
2 #include <fcntl.h>
3 
4 #include <iostream>
5 #include <memory>
6 
7 #include <QString>
8 #include <QDir>
9 #include <QMap>
10 #include <QApplication>
11 #include <QFileInfo>
12 
13 #include "mythconfig.h"
14 #include "mythcontext.h"
15 #include "mythdbcon.h"
16 #include "dbutil.h"
17 #include "loggingserver.h"
18 #include "mythlogging.h"
19 #include "mythversion.h"
20 #include "langsettings.h"
21 #include "mythtranslation.h"
22 #include "exitcodes.h"
23 #include "exitprompt.h"
24 #include "storagegroupeditor.h"
25 #include "myththemedmenu.h"
26 #include "mythuihelper.h"
27 #include "mythdirs.h"
28 #include "channelscanner_cli.h"
29 #include "scanwizardconfig.h"
30 #include "scaninfo.h"
31 #include "channelimporter.h"
32 #include "cardutil.h"
33 #include "dbcheck.h"
34 #include "videosource.h"
35 #include "channeleditor.h"
36 #include "remoteutil.h"
37 #include "backendsettings.h"
38 #include "checksetup.h"
39 #include "startprompt.h"
40 #include "mythsystemevent.h"
41 #include "expertsettingseditor.h"
42 #include "commandlineparser.h"
43 #include "profilegroup.h"
44 #include "signalhandling.h"
45 #include "mythmiscutil.h"
46 #include "ssdp.h"
47 #include "cleanupguard.h"
48 #include "mythdisplay.h"
49 
52 
54 static QString logfile;
55 
56 static void cleanup()
57 {
59 
60  delete gContext;
61  gContext = nullptr;
62 
64 }
65 
66 static void SetupMenuCallback(void* /* data */, QString& selection)
67 {
68  QString sel = selection.toLower();
69 
70  if (sel == "general")
71  {
73  auto *ssd = new StandardSettingDialog(mainStack, "generalsettings",
74  new BackendSettings());
75 
76  if (ssd->Create())
77  mainStack->AddScreen(ssd);
78  else
79  delete ssd;
80  }
81  else if (sel == "capture cards")
82  {
84  auto *ssd = new StandardSettingDialog(mainStack, "capturecardeditor",
85  new CaptureCardEditor());
86 
87  if (ssd->Create())
88  mainStack->AddScreen(ssd);
89  else
90  delete ssd;
91  }
92  else if (sel == "video sources")
93  {
95  auto *ssd = new StandardSettingDialog(mainStack, "videosourceeditor",
96  new VideoSourceEditor());
97  if (ssd->Create())
98  mainStack->AddScreen(ssd);
99  else
100  delete ssd;
101  }
102  else if (sel == "card inputs")
103  {
105  auto *ssd = new StandardSettingDialog(mainStack, "cardinputeditor",
106  new CardInputEditor());
107 
108  if (ssd->Create())
109  mainStack->AddScreen(ssd);
110  else
111  delete ssd;
112  }
113  else if (sel == "recording profile")
114  {
116  auto *ssd = new StandardSettingDialog(mainStack, "recordingprofileeditor",
117  new ProfileGroupEditor());
118 
119  if (ssd->Create())
120  mainStack->AddScreen(ssd);
121  else
122  delete ssd;
123  }
124  else if (sel == "channel editor")
125  {
127 
128  auto *chanedit = new ChannelEditor(mainStack);
129 
130  if (chanedit->Create())
131  mainStack->AddScreen(chanedit);
132  else
133  delete chanedit;
134  }
135  else if (sel == "storage groups")
136  {
138  auto *ssd = new StandardSettingDialog(mainStack, "storagegroupeditor",
139  new StorageGroupListEditor());
140 
141  if (ssd->Create())
142  mainStack->AddScreen(ssd);
143  else
144  delete ssd;
145  }
146  else if (sel == "systemeventeditor")
147  {
149 
150  auto *msee = new MythSystemEventEditor(mainStack, "System Event Editor");
151 
152  if (msee->Create())
153  mainStack->AddScreen(msee);
154  else
155  delete msee;
156  }
157  else if (sel.startsWith("exiting_app") || (sel == "standby_mode"))
158  {
159  if (!exitPrompt)
160  exitPrompt = new ExitPrompter();
162  }
163  else
164  LOG(VB_GENERAL, LOG_ERR, "Unknown menu action: " + selection);
165 }
166 
167 static bool RunMenu(const QString& themedir, const QString& themename)
168 {
169  QByteArray tmp = themedir.toLocal8Bit();
170  menu = new MythThemedMenu(
171  QString(tmp.constData()), "setup.xml",
172  GetMythMainWindow()->GetMainStack(), "mainmenu", false);
173 
174  if (menu->foundTheme())
175  {
178  return true;
179  }
180 
181  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't use theme '%1'").arg(themename));
182  delete menu;
183  menu = nullptr;
184 
185  return false;
186 }
187 
188 // If the theme specified in the DB is somehow broken, try a standard one:
189 //
190 static bool resetTheme(QString themedir, const QString &badtheme)
191 {
192  QString themename = DEFAULT_UI_THEME;
193 
194  if (badtheme == DEFAULT_UI_THEME)
195  themename = FALLBACK_UI_THEME;
196 
197  LOG(VB_GENERAL, LOG_ERR,
198  QString("Overriding broken theme '%1' with '%2'")
199  .arg(badtheme).arg(themename));
200 
201  gCoreContext->OverrideSettingForSession("Theme", themename);
202  themedir = GetMythUI()->FindThemeDir(themename);
203 
205  GetMythMainWindow()->Init();
207 
208  return RunMenu(themedir, themename);
209 }
210 
211 static int reloadTheme(void)
212 {
214  QString themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
215  QString themedir = GetMythUI()->FindThemeDir(themename);
216  if (themedir.isEmpty())
217  {
218  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
219  .arg(themename));
220  return GENERIC_EXIT_NO_THEME;
221  }
222 
224 
226  if (menu)
227  menu->Close();
228  GetMythMainWindow()->Init();
231 
232  if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename))
233  return GENERIC_EXIT_NO_THEME;
234 
235  return 0;
236 }
237 
238 int main(int argc, char *argv[])
239 {
240  QString geometry;
241  bool doScan = false;
242  bool doScanList = false;
243  bool doScanSaveOnly = false;
244  bool scanInteractive = true;
245  bool expertMode = false;
246  uint scanImport = 0;
247  bool scanFTAOnly = false;
248  bool scanLCNOnly = false;
249  bool scanCompleteOnly = false;
250  bool scanFullChannelSearch = false;
251  bool scanRemoveDuplicates = false;
252  bool addFullTS = false;
253  ServiceRequirements scanServiceRequirements = kRequireAV;
254  uint scanCardId = 0;
255  QString frequencyStandard = "atsc";
256  QString modulation = "vsb8";
257  QString region = "us";
258  QString scanInputName = "";
259 
261  if (!cmdline.Parse(argc, argv))
262  {
263  cmdline.PrintHelp();
265  }
266 
267  if (cmdline.toBool("showhelp"))
268  {
269  cmdline.PrintHelp();
270  return GENERIC_EXIT_OK;
271  }
272 
273  if (cmdline.toBool("showversion"))
274  {
276  return GENERIC_EXIT_OK;
277  }
278 
279  bool quiet = false;
280  bool use_display = true;
281  if (cmdline.toBool("scan"))
282  {
283  quiet = true;
284  use_display = false;
285  }
286 
287  std::unique_ptr<QCoreApplication> app {nullptr};
288  CleanupGuard callCleanup(cleanup);
289 
290  if (use_display)
291  {
293  app = std::make_unique<QApplication>(argc, argv);
294  }
295  else
296  {
297  app = std::make_unique<QCoreApplication>(argc, argv);
298  }
299  QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHTV_SETUP);
300 
301 #ifndef _WIN32
302  QList<int> signallist;
303  signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
304  << SIGILL;
305 #if ! CONFIG_DARWIN
306  signallist << SIGRTMIN;
307 #endif
308  SignalHandler::Init(signallist);
309  SignalHandler::SetHandler(SIGHUP, logSigHup);
310 #endif
311 
312  if (cmdline.toBool("geometry"))
313  geometry = cmdline.toString("geometry");
314 
315  QString mask("general");
316  int retval = cmdline.ConfigureLogging(mask, quiet);
317  if (retval != GENERIC_EXIT_OK)
318  return retval;
319 
320  if (cmdline.toBool("expert"))
321  expertMode = true;
322  if (cmdline.toBool("scanlist"))
323  doScanList = true;
324  if (cmdline.toBool("savescan"))
325  doScanSaveOnly = true;
326  if (cmdline.toBool("scannoninteractive"))
327  scanInteractive = false;
328 
329  if (cmdline.toBool("importscan"))
330  scanImport = cmdline.toUInt("importscan");
331  if (cmdline.toBool("ftaonly"))
332  scanFTAOnly = true;
333  if (cmdline.toBool("lcnonly"))
334  scanLCNOnly = true;
335  if (cmdline.toBool("completeonly"))
336  scanCompleteOnly = true;
337  if (cmdline.toBool("fullsearch"))
338  scanFullChannelSearch = true;
339  if (cmdline.toBool("removeduplicates"))
340  scanRemoveDuplicates = true;
341  if (cmdline.toBool("addfullts"))
342  addFullTS = true;
343  if (cmdline.toBool("servicetype"))
344  {
345  scanServiceRequirements = kRequireNothing;
346  if (cmdline.toString("servicetype").contains("radio"))
347  scanServiceRequirements = kRequireAudio;
348  if (cmdline.toString("servicetype").contains("tv"))
349  scanServiceRequirements = kRequireAV;
350  if (cmdline.toString("servicetype").contains("tv+radio") ||
351  cmdline.toString("servicetype").contains("radio+tv"))
352  scanServiceRequirements = kRequireAudio;
353  if (cmdline.toString("servicetype").contains("all"))
354  scanServiceRequirements = kRequireNothing;
355  }
356 
357  if (!cmdline.toBool("noupnp"))
358  {
359  // start looking for any uPnP devices we can use like VBoxes
360  SSDP::Instance()->PerformSearch("ssdp:all");
361  }
362  if (cmdline.toBool("scan"))
363  {
364  scanCardId = cmdline.toUInt("scan");
365  doScan = true;
366  }
367  if (cmdline.toBool("freqstd"))
368  frequencyStandard = cmdline.toString("freqstd").toLower();
369  if (cmdline.toBool("modulation"))
370  modulation = cmdline.toString("modulation").toLower();
371  if (cmdline.toBool("region"))
372  region = cmdline.toString("region").toLower();
373  if (cmdline.toBool("inputname"))
374  scanInputName = cmdline.toString("inputname");
375 
376  if (!geometry.isEmpty())
378 
380 
382  if (!gContext->Init(use_display,false,true)) // No Upnp, Prompt for db
383  {
384  LOG(VB_GENERAL, LOG_ERR, "Failed to init MythContext, exiting.");
386  }
387 
389 
390  if (!GetMythDB()->HaveSchema())
391  {
392  if (!InitializeMythSchema())
393  return GENERIC_EXIT_DB_ERROR;
394  }
395 
396  setHttpProxy();
397 
398  if (use_display)
399  {
400  QString fileprefix = GetConfDir();
401  QDir dir(fileprefix);
402  if (!dir.exists())
403  dir.mkdir(fileprefix);
404  }
405 
406  if (doScan)
407  {
408  bool okCardID = scanCardId != 0U;
409 
410  if (scanInputName.isEmpty())
411  scanInputName = CardUtil::GetInputName(scanCardId);
412 
413  bool okInputName = (scanInputName == CardUtil::GetInputName(scanCardId)
414  && scanInputName != "None");
415 
416  doScan = (okCardID && okInputName);
417 
418  if (!okCardID)
419  {
420  std::cerr << "You must enter a valid cardid to scan." << std::endl;
421  vector<uint> cardids = CardUtil::GetInputIDs();
422  if (cardids.empty())
423  {
424  std::cerr << "But no cards have been defined on this host"
425  << std::endl;
427  }
428  std::cerr << "Valid cards: " << std::endl;
429  for (uint id : cardids)
430  {
431  fprintf(stderr, "%5u: %s %s\n", id,
432  CardUtil::GetRawInputType(id).toLatin1().constData(),
433  CardUtil::GetVideoDevice(id).toLatin1().constData());
434  }
436  }
437 
438  if (!okInputName)
439  {
440  std::cerr << "You must enter a valid input to scan this card."
441  << std::endl;
442  std::cerr << "Valid input: "
443  << CardUtil::GetInputName(scanCardId).toLatin1().constData()
444  << std::endl;
446  }
447  }
448 
449  if (doScan)
450  {
451  int ret = 0;
452  uint inputid = scanCardId;
453  uint sourceid = CardUtil::GetSourceID(inputid);
454  QMap<QString,QString> startChan;
455  {
456  ChannelScannerCLI scanner(doScanSaveOnly, scanInteractive);
457 
458  int scantype { ScanTypeSetting::FullScan_ATSC };
459  if (frequencyStandard == "atsc")
460  scantype = ScanTypeSetting::FullScan_ATSC; // NOLINT(bugprone-branch-clone)
461  else if (frequencyStandard == "dvbt")
463  else if (frequencyStandard == "mpeg")
465  else if (frequencyStandard == "iptv")
466  {
468  scanner.ImportM3U(scanCardId, scanInputName, sourceid, true);
469  }
470  else if (frequencyStandard == "extern")
472  else
474 
475  scanner.Scan(scantype,
476  /* cardid */ scanCardId,
477  /* inputname */ scanInputName,
478  /* sourceid */ sourceid,
479  /* ignore signal timeout */ false,
480  /* follow_nit */ true,
481  /* test decryption */ true,
482  scanFTAOnly,
483  scanLCNOnly,
484  scanCompleteOnly,
485  scanFullChannelSearch,
486  scanRemoveDuplicates,
487  addFullTS,
488  scanServiceRequirements,
489  // stuff needed for particular scans
490  /* mplexid */ 0,
491  startChan, frequencyStandard, modulation, region);
492  ret = QCoreApplication::exec();
493  }
494  return (ret) ? GENERIC_EXIT_NOT_OK : GENERIC_EXIT_OK;
495  }
496 
497  if (doScanList)
498  {
499  vector<ScanInfo> scans = LoadScanList();
500 
501  std::cout<<" scanid cardid sourceid processed date"<<std::endl;
502  for (auto & scan : scans)
503  {
504  printf("%5i %6i %8i %8s %20s\n",
505  scan.m_scanid, scan.m_cardid,
506  scan.m_sourceid, (scan.m_processed) ? "yes" : "no",
507  scan.m_scandate.toString(Qt::ISODate)
508  .toLatin1().constData());
509  }
510  std::cout<<std::endl;
511 
512  return GENERIC_EXIT_OK;
513  }
514 
515  if (scanImport)
516  {
517  std::cout<<"*** SCAN IMPORT START ***"<<std::endl;
518  {
519  ScanDTVTransportList list = LoadScan(scanImport);
520  ChannelImporter ci(false, true, true, true, false,
521  scanFTAOnly, scanLCNOnly,
522  scanCompleteOnly,
523  scanFullChannelSearch,
524  scanRemoveDuplicates,
525  scanServiceRequirements);
526  ci.Process(list);
527  }
528  std::cout<<"*** SCAN IMPORT END ***"<<std::endl;
529  return GENERIC_EXIT_OK;
530  }
531 
532  MythTranslation::load("mythfrontend");
533 
534  QString themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
535  QString themedir = GetMythUI()->FindThemeDir(themename);
536  if (themedir.isEmpty())
537  {
538  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
539  .arg(themename));
540  return GENERIC_EXIT_NO_THEME;
541  }
542 
543  MythMainWindow *mainWindow = GetMythMainWindow();
544  mainWindow->Init();
545  mainWindow->setWindowTitle(QObject::tr("MythTV Setup"));
546 
547  // We must reload the translation after a language change and this
548  // also means clearing the cached/loaded theme strings, so reload the
549  // theme which also triggers a translation reload
551  {
552  if (!reloadTheme())
553  return GENERIC_EXIT_NO_THEME;
554  }
555 
557  {
558  LOG(VB_GENERAL, LOG_ERR,
559  "MySQL time zone support is missing. "
560  "Please install it and try again. "
561  "See 'mysql_tzinfo_to_sql' for assistance.");
563  }
564 
565  if (!UpgradeTVDatabaseSchema(true))
566  {
567  LOG(VB_GENERAL, LOG_ERR, "Couldn't upgrade database to new schema.");
569  }
570 
571  // Refresh Global/Main Menu keys after DB update in case there was no DB
572  // when they were written originally
573  mainWindow->ReloadKeys();
574 
575  if (!startPrompt)
576  startPrompt = new StartPrompter();
578 
579  // Let the user select buttons, type values, scan for channels, etc.
580  if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename))
581  return GENERIC_EXIT_NO_THEME;
582 
583  ExpertSettingsEditor *expertEditor = nullptr;
584  if (expertMode)
585  {
587  expertEditor =
588  new ExpertSettingsEditor(mainStack, "Expert Settings Editor");
589  if (expertEditor->Create())
590  mainStack->AddScreen(expertEditor);
591  else
592  {
593  delete expertEditor;
594  expertEditor = nullptr;
595  LOG(VB_GENERAL, LOG_ERR,
596  "Unable to create expert settings editor window");
597  return GENERIC_EXIT_OK;
598  }
599  }
600 
601  QCoreApplication::exec();
602 }
603 
604 /* vim: set expandtab tabstop=4 shiftwidth=4: */
themedir
static QString themedir
Definition: mythdirs.cpp:21
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:317
SetupMenuCallback
static void SetupMenuCallback(void *, QString &selection)
Definition: mythtv/programs/mythtv-setup/main.cpp:66
channelscanner_cli.h
CardUtil::GetInputIDs
static std::vector< uint > GetInputIDs(const QString &videodevice=QString(), const QString &rawtype=QString(), const QString &inputname=QString(), QString hostname=QString())
Returns all inputids of inputs that uses the specified videodevice if specified, and optionally rawty...
Definition: cardutil.cpp:1271
GENERIC_EXIT_OK
#define GENERIC_EXIT_OK
Exited with no error.
Definition: exitcodes.h:10
kRequireAV
@ kRequireAV
Definition: channelscantypes.h:9
reloadTheme
static int reloadTheme(void)
Definition: mythtv/programs/mythtv-setup/main.cpp:211
setHttpProxy
void setHttpProxy(void)
Get network proxy settings from OS, and use for [Q]Http[Comms].
Definition: mythmiscutil.cpp:854
dbutil.h
MythMainWindow::Init
void Init(bool MayReInit=true)
Definition: mythmainwindow.cpp:640
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:959
LoadScanList
std::vector< ScanInfo > LoadScanList(void)
Definition: scaninfo.cpp:266
VideoSourceEditor
Definition: videosource.h:842
storagegroupeditor.h
expertsettingseditor.h
SSDP::PerformSearch
void PerformSearch(const QString &sST, std::chrono::seconds timeout=2s)
Definition: ssdp.cpp:200
MythTranslation::reload
static void reload()
Reload all active translators based on the current language setting.
Definition: mythtranslation.cpp:98
ScanTypeSetting::FullScan_DVBT
@ FullScan_DVBT
Definition: scanwizardconfig.h:79
CardUtil::GetInputName
static QString GetInputName(uint inputid)
Definition: cardutil.cpp:1700
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
channelimporter.h
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:402
ssdp.h
commandlineparser.h
MythContext
Startup context for MythTV.
Definition: mythcontext.h:43
ExitPrompter
Definition: mythfrontend/exitprompt.h:6
RawSettingsEditor::Create
bool Create(void) override
Creates the UI screen.
Definition: rawsettingseditor.cpp:29
MythCoreContext::OverrideSettingForSession
void OverrideSettingForSession(const QString &key, const QString &value)
Definition: mythcorecontext.cpp:1345
ExpertSettingsEditor
Definition: expertsettingseditor.h:8
GENERIC_EXIT_DB_NOTIMEZONE
#define GENERIC_EXIT_DB_NOTIMEZONE
Missing DB time zone support.
Definition: exitcodes.h:36
MYTH_APPNAME_MYTHTV_SETUP
#define MYTH_APPNAME_MYTHTV_SETUP
Definition: mythcorecontext.h:22
MythScreenStack
Definition: mythscreenstack.h:16
arg
arg(title).arg(filename).arg(doDelete))
mythdbcon.h
ChannelScannerCLI
Definition: channelscanner_cli.h:40
MythMainWindow::ReloadKeys
void ReloadKeys()
Definition: mythmainwindow.cpp:951
StartPrompter::handleStart
void handleStart()
Definition: startprompt.cpp:35
checksetup.h
scanwizardconfig.h
ScanTypeSetting::FullScan_ATSC
@ FullScan_ATSC
Definition: scanwizardconfig.h:77
startPrompt
StartPrompter * startPrompt
Definition: mythtv/programs/mythtv-setup/main.cpp:51
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
startprompt.h
MythThemedMenu::foundTheme
bool foundTheme(void) const
Returns true iff a theme has been found by a previous call to SetMenuTheme().
Definition: myththemedmenu.cpp:144
GetMythDB
MythDB * GetMythDB(void)
Definition: mythdb.cpp:45
mythsystemevent.h
mythdirs.h
GENERIC_EXIT_INVALID_CMDLINE
#define GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
Definition: exitcodes.h:15
CaptureCardEditor
Definition: videosource.h:820
MythTVSetupCommandLineParser
Definition: mythtv-setup/commandlineparser.h:6
menu
static MythThemedMenu * menu
Definition: mythtv/programs/mythtv-setup/main.cpp:53
remoteutil.h
BackendSettings
Definition: backendsettings.h:7
ChannelImporter::Process
void Process(const ScanDTVTransportList &_transports, int sourceid=-1)
Definition: channelimporter.cpp:42
hardwareprofile.scan.scan
def scan(profile, smoonURL, gate)
Definition: scan.py:57
kRequireAudio
@ kRequireAudio
Definition: channelscantypes.h:8
langsettings.h
tmp
static guint32 * tmp
Definition: goom_core.cpp:31
MythMainWindow::SetEffectsEnabled
void SetEffectsEnabled(bool Enable)
Definition: mythmainwindow.cpp:1033
mythversion.h
MythDisplay::ConfigureQtGUI
static void ConfigureQtGUI(int SwapInterval, const MythCommandLineParser &CmdLine)
Shared static initialistaion code for all MythTV GUI applications.
Definition: mythdisplay.cpp:1087
SSDP::Instance
static SSDP * Instance()
Definition: ssdp.cpp:53
ProfileGroupEditor
Definition: profilegroup.h:120
MythCommandLineParser::Parse
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
Definition: mythcommandlineparser.cpp:1435
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
mythdisplay.h
mythlogging.h
GetConfDir
QString GetConfDir(void)
Definition: mythdirs.cpp:224
dbcheck.h
signalhandling.h
CleanupGuard
Definition: cleanupguard.h:6
ChannelScanner::Scan
void Scan(int scantype, uint cardid, const QString &inputname, uint sourceid, bool do_ignore_signal_timeout, bool do_follow_nit, bool do_test_decryption, bool do_fta_only, bool do_lcn_only, bool do_complete_only, bool do_full_channel_search, bool do_remove_duplicates, bool do_add_full_ts, ServiceRequirements service_requirements, uint mplexid, const QMap< QString, QString > &startChan, const QString &freq_std, const QString &mod, const QString &tbl, const QString &tbl_start=QString(), const QString &tbl_end=QString())
Definition: channelscanner.cpp:111
FALLBACK_UI_THEME
#define FALLBACK_UI_THEME
Definition: mythuithemehelper.h:8
ScanTypeSetting::IPTVImportMPTS
@ IPTVImportMPTS
Definition: scanwizardconfig.h:97
ChannelEditor
Definition: channeleditor.h:13
DestroyMythMainWindow
void DestroyMythMainWindow(void)
Definition: mythmainwindow.cpp:114
exitPrompt
ExitPrompter * exitPrompt
Definition: mythtv/programs/mythtv-setup/main.cpp:50
SIGHUP
#define SIGHUP
Definition: compat.h:214
MythUIThemeHelper::FindThemeDir
QString FindThemeDir(const QString &ThemeName, bool Fallback=true)
Returns the full path to the theme denoted by themename.
Definition: mythuithemehelper.cpp:47
MythCommandLineParser::PrintVersion
static void PrintVersion(void)
Print application version information.
Definition: mythcommandlineparser.cpp:1263
mythtranslation.h
scaninfo.h
MythCommandLineParser::toUInt
uint toUInt(const QString &key) const
Returns stored QVariant as an unsigned integer, falling to default if not provided.
Definition: mythcommandlineparser.cpp:2116
DBUtil::CheckTimeZoneSupport
static bool CheckTimeZoneSupport(void)
Check if MySQL has working timz zone support.
Definition: dbutil.cpp:870
ExitPrompter::handleExit
void handleExit(void)
Definition: mythtv-setup/exitprompt.cpp:61
MythCommandLineParser::PrintHelp
void PrintHelp(void) const
Print command line option help.
Definition: mythcommandlineparser.cpp:1279
logfile
static QString logfile
Definition: mythtv/programs/mythtv-setup/main.cpp:54
MythSystemEventEditor
An editor for MythSystemEvent handler commands.
Definition: mythsystemevent.h:50
quiet
int quiet
Definition: mythtv/programs/mythcommflag/main.cpp:71
uint
unsigned int uint
Definition: compat.h:140
ScanTypeSetting::CurrentTransportScan
@ CurrentTransportScan
Scans the transport when there is no tuner (for ASI)
Definition: scanwizardconfig.h:93
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
ScanDTVTransportList
std::vector< ScanDTVTransport > ScanDTVTransportList
Definition: dtvmultiplex.h:143
kRequireNothing
@ kRequireNothing
Definition: channelscantypes.h:6
MythCommandLineParser::ApplySettingsOverride
void ApplySettingsOverride(void)
Apply all overrides to the global context.
Definition: mythcommandlineparser.cpp:2787
DEFAULT_UI_THEME
#define DEFAULT_UI_THEME
Definition: mythuithemehelper.h:7
channeleditor.h
MythUIThemeHelper::InitThemeHelper
void InitThemeHelper()
Definition: mythuithemehelper.cpp:13
RunMenu
static bool RunMenu(const QString &themedir, const QString &themename)
Definition: mythtv/programs/mythtv-setup/main.cpp:167
resetTheme
static bool resetTheme(QString themedir, const QString &badtheme)
Definition: mythtv/programs/mythtv-setup/main.cpp:190
CardUtil::GetRawInputType
static QString GetRawInputType(uint inputid)
Definition: cardutil.h:282
mythuihelper.h
MYTH_BINARY_VERSION
#define MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
Definition: mythversion.h:15
main
int main(int argc, char *argv[])
Definition: mythtv/programs/mythtv-setup/main.cpp:238
backendsettings.h
GENERIC_EXIT_DB_ERROR
#define GENERIC_EXIT_DB_ERROR
Database error.
Definition: exitcodes.h:17
cmdline
MythCommFlagCommandLineParser cmdline
Definition: mythtv/programs/mythcommflag/main.cpp:75
mythmiscutil.h
MythCommandLineParser::toString
QString toString(const QString &key) const
Returns stored QVariant as a QString, falling to default if not provided.
Definition: mythcommandlineparser.cpp:2224
GENERIC_EXIT_NOT_OK
#define GENERIC_EXIT_NOT_OK
Exited with error.
Definition: exitcodes.h:11
StartPrompter
Definition: startprompt.h:6
MythCommandLineParser::toBool
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
Definition: mythcommandlineparser.cpp:2067
cardutil.h
dir
QDir dir
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1174
cleanupguard.h
LanguageSelection::prompt
static bool prompt(bool force=false)
Ask the user for the language to use.
Definition: langsettings.cpp:173
MythDate::ISODate
@ ISODate
Default UTC.
Definition: mythdate.h:17
ChannelImporter
Definition: channelimporter.h:69
ScanTypeSetting::ExternRecImport
@ ExternRecImport
Definition: scanwizardconfig.h:105
mythcontext.h
ttvdb.stderr
stderr
Definition: ttvdb.py:1426
LoadScan
ScanDTVTransportList LoadScan(uint scanid)
Definition: scaninfo.cpp:77
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
GENERIC_EXIT_NO_MYTHCONTEXT
#define GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.
Definition: exitcodes.h:13
CardUtil::GetSourceID
static uint GetSourceID(uint inputid)
Definition: cardutil.cpp:1769
SignalHandler::SetHandler
static void SetHandler(int signum, SigHandlerFunc handler)
Definition: signalhandling.cpp:138
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:104
MythThemedMenu
Themed menu class, used for main menus in MythTV frontend.
Definition: myththemedmenu.h:57
myththemedmenu.h
MythCommandLineParser::ConfigureLogging
int ConfigureLogging(const QString &mask="general", bool progress=false)
Read in logging options and initialize the logging interface.
Definition: mythcommandlineparser.cpp:2718
profilegroup.h
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
ServiceRequirements
ServiceRequirements
Definition: channelscantypes.h:4
StorageGroupListEditor
Definition: storagegroupeditor.h:29
GENERIC_EXIT_NO_THEME
#define GENERIC_EXIT_NO_THEME
No Theme available.
Definition: exitcodes.h:14
loggingserver.h
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:50
cleanup
static void cleanup()
Definition: mythtv/programs/mythtv-setup/main.cpp:56
gContext
MythContext * gContext
This global variable contains the MythContext instance for the application.
Definition: mythcontext.cpp:64
videosource.h
MythContext::Init
bool Init(bool gui=true, bool promptForBackend=false, bool disableAutoDiscovery=false, bool ignoreDB=false)
Definition: mythcontext.cpp:1569
MythMainWindow
Definition: mythmainwindow.h:35
ChannelScanner::ImportM3U
virtual bool ImportM3U(uint cardid, const QString &inputname, uint sourceid, bool is_mpts)
Definition: channelscanner.cpp:335
SignalHandler::Done
static void Done(void)
Definition: signalhandling.cpp:131
CardUtil::GetVideoDevice
static QString GetVideoDevice(uint inputid)
Definition: cardutil.h:284
exitprompt.h
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:918
CardInputEditor
Definition: videosource.h:864
SignalHandler::Init
static void Init(QList< int > &signallist, QObject *parent=nullptr)
Definition: signalhandling.cpp:124
GENERIC_EXIT_DB_OUTOFDATE
#define GENERIC_EXIT_DB_OUTOFDATE
Database needs upgrade.
Definition: exitcodes.h:16