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, themename));
200 
201  gCoreContext->OverrideSettingForSession("Theme", themename);
202  themedir = GetMythUI()->FindThemeDir(themename);
203 
205  GetMythMainWindow()->Init();
206 
207  return RunMenu(themedir, themename);
208 }
209 
210 static int reloadTheme(void)
211 {
213  QString themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
214  QString themedir = GetMythUI()->FindThemeDir(themename);
215  if (themedir.isEmpty())
216  {
217  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
218  .arg(themename));
219  return GENERIC_EXIT_NO_THEME;
220  }
221 
223 
225  if (menu)
226  menu->Close();
227  GetMythMainWindow()->Init();
229 
230  if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename))
231  return GENERIC_EXIT_NO_THEME;
232 
233  return 0;
234 }
235 
236 int main(int argc, char *argv[])
237 {
238  QString geometry;
239  bool doScan = false;
240  bool doScanList = false;
241  bool doScanSaveOnly = false;
242  bool scanInteractive = true;
243  bool expertMode = false;
244  uint scanImport = 0;
245  bool scanFTAOnly = false;
246  bool scanLCNOnly = false;
247  bool scanCompleteOnly = false;
248  bool scanFullChannelSearch = false;
249  bool scanRemoveDuplicates = false;
250  bool addFullTS = false;
251  ServiceRequirements scanServiceRequirements = kRequireAV;
252  uint scanCardId = 0;
253  QString frequencyStandard = "atsc";
254  QString modulation = "vsb8";
255  QString region = "us";
256  QString scanInputName = "";
257 
259  if (!cmdline.Parse(argc, argv))
260  {
261  cmdline.PrintHelp();
263  }
264 
265  if (cmdline.toBool("showhelp"))
266  {
267  cmdline.PrintHelp();
268  return GENERIC_EXIT_OK;
269  }
270 
271  if (cmdline.toBool("showversion"))
272  {
274  return GENERIC_EXIT_OK;
275  }
276 
277  bool quiet = false;
278  bool use_display = true;
279  if (cmdline.toBool("scan"))
280  {
281  quiet = true;
282  use_display = false;
283  }
284 
285  std::unique_ptr<QCoreApplication> app {nullptr};
286  CleanupGuard callCleanup(cleanup);
287 
288  if (use_display)
289  {
291  app = std::make_unique<QApplication>(argc, argv);
292  }
293  else
294  {
295  app = std::make_unique<QCoreApplication>(argc, argv);
296  }
297  QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHTV_SETUP);
298 
299 #ifndef _WIN32
300  QList<int> signallist;
301  signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
302  << SIGILL;
303 #if ! CONFIG_DARWIN
304  signallist << SIGRTMIN;
305 #endif
306  SignalHandler::Init(signallist);
307  SignalHandler::SetHandler(SIGHUP, logSigHup);
308 #endif
309 
310  if (cmdline.toBool("geometry"))
311  geometry = cmdline.toString("geometry");
312 
313  QString mask("general");
314  int retval = cmdline.ConfigureLogging(mask, quiet);
315  if (retval != GENERIC_EXIT_OK)
316  return retval;
317 
318  if (cmdline.toBool("expert"))
319  expertMode = true;
320  if (cmdline.toBool("scanlist"))
321  doScanList = true;
322  if (cmdline.toBool("savescan"))
323  doScanSaveOnly = true;
324  if (cmdline.toBool("scannoninteractive"))
325  scanInteractive = false;
326 
327  if (cmdline.toBool("importscan"))
328  scanImport = cmdline.toUInt("importscan");
329  if (cmdline.toBool("ftaonly"))
330  scanFTAOnly = true;
331  if (cmdline.toBool("lcnonly"))
332  scanLCNOnly = true;
333  if (cmdline.toBool("completeonly"))
334  scanCompleteOnly = true;
335  if (cmdline.toBool("fullsearch"))
336  scanFullChannelSearch = true;
337  if (cmdline.toBool("removeduplicates"))
338  scanRemoveDuplicates = true;
339  if (cmdline.toBool("addfullts"))
340  addFullTS = true;
341  if (cmdline.toBool("servicetype"))
342  {
343  scanServiceRequirements = kRequireNothing;
344  if (cmdline.toString("servicetype").contains("radio"))
345  scanServiceRequirements = kRequireAudio;
346  if (cmdline.toString("servicetype").contains("tv"))
347  scanServiceRequirements = kRequireAV;
348  if (cmdline.toString("servicetype").contains("tv+radio") ||
349  cmdline.toString("servicetype").contains("radio+tv"))
350  scanServiceRequirements = kRequireAudio;
351  if (cmdline.toString("servicetype").contains("all"))
352  scanServiceRequirements = kRequireNothing;
353  }
354 
355  if (!cmdline.toBool("noupnp"))
356  {
357  // start looking for any uPnP devices we can use like VBoxes
358  SSDP::Instance()->PerformSearch("ssdp:all");
359  }
360  if (cmdline.toBool("scan"))
361  {
362  scanCardId = cmdline.toUInt("scan");
363  doScan = true;
364  }
365  if (cmdline.toBool("freqstd"))
366  frequencyStandard = cmdline.toString("freqstd").toLower();
367  if (cmdline.toBool("modulation"))
368  modulation = cmdline.toString("modulation").toLower();
369  if (cmdline.toBool("region"))
370  region = cmdline.toString("region").toLower();
371  if (cmdline.toBool("inputname"))
372  scanInputName = cmdline.toString("inputname");
373 
374  if (!geometry.isEmpty())
376 
378 
380  if (!gContext->Init(use_display,false,true)) // No Upnp, Prompt for db
381  {
382  LOG(VB_GENERAL, LOG_ERR, "Failed to init MythContext, exiting.");
384  }
385 
387 
388  if (!GetMythDB()->HaveSchema())
389  {
390  if (!InitializeMythSchema())
391  return GENERIC_EXIT_DB_ERROR;
392  }
393 
394  setHttpProxy();
395 
396  if (use_display)
397  {
398  QString fileprefix = GetConfDir();
399  QDir dir(fileprefix);
400  if (!dir.exists())
401  dir.mkdir(fileprefix);
402  }
403 
404  if (doScan)
405  {
406  bool okCardID = scanCardId != 0U;
407 
408  if (scanInputName.isEmpty())
409  scanInputName = CardUtil::GetInputName(scanCardId);
410 
411  bool okInputName = (scanInputName == CardUtil::GetInputName(scanCardId)
412  && scanInputName != "None");
413 
414  doScan = (okCardID && okInputName);
415 
416  if (!okCardID)
417  {
418  std::cerr << "You must enter a valid cardid to scan." << std::endl;
419  vector<uint> cardids = CardUtil::GetInputIDs();
420  if (cardids.empty())
421  {
422  std::cerr << "But no cards have been defined on this host"
423  << std::endl;
425  }
426  std::cerr << "Valid cards: " << std::endl;
427  for (uint id : cardids)
428  {
429  fprintf(stderr, "%5u: %s %s\n", id,
430  CardUtil::GetRawInputType(id).toLatin1().constData(),
431  CardUtil::GetVideoDevice(id).toLatin1().constData());
432  }
434  }
435 
436  if (!okInputName)
437  {
438  std::cerr << "You must enter a valid input to scan this card."
439  << std::endl;
440  std::cerr << "Valid input: "
441  << CardUtil::GetInputName(scanCardId).toLatin1().constData()
442  << std::endl;
444  }
445  }
446 
447  if (doScan)
448  {
449  int ret = 0;
450  uint inputid = scanCardId;
451  uint sourceid = CardUtil::GetSourceID(inputid);
452  QMap<QString,QString> startChan;
453  {
454  ChannelScannerCLI scanner(doScanSaveOnly, scanInteractive);
455 
456  int scantype { ScanTypeSetting::FullScan_ATSC };
457  if (frequencyStandard == "atsc")
458  scantype = ScanTypeSetting::FullScan_ATSC; // NOLINT(bugprone-branch-clone)
459  else if (frequencyStandard == "dvbt")
461  else if (frequencyStandard == "mpeg")
463  else if (frequencyStandard == "iptv")
464  {
466  scanner.ImportM3U(scanCardId, scanInputName, sourceid, true);
467  }
468  else if (frequencyStandard == "extern")
470  else
472 
473  scanner.Scan(scantype,
474  /* cardid */ scanCardId,
475  /* inputname */ scanInputName,
476  /* sourceid */ sourceid,
477  /* ignore signal timeout */ false,
478  /* follow_nit */ true,
479  /* test decryption */ true,
480  scanFTAOnly,
481  scanLCNOnly,
482  scanCompleteOnly,
483  scanFullChannelSearch,
484  scanRemoveDuplicates,
485  addFullTS,
486  scanServiceRequirements,
487  // stuff needed for particular scans
488  /* mplexid */ 0,
489  startChan, frequencyStandard, modulation, region);
490  ret = QCoreApplication::exec();
491  }
492  return (ret) ? GENERIC_EXIT_NOT_OK : GENERIC_EXIT_OK;
493  }
494 
495  if (doScanList)
496  {
497  vector<ScanInfo> scans = LoadScanList();
498 
499  std::cout<<" scanid cardid sourceid processed date"<<std::endl;
500  for (auto & scan : scans)
501  {
502  printf("%5i %6i %8i %8s %20s\n",
503  scan.m_scanid, scan.m_cardid,
504  scan.m_sourceid, (scan.m_processed) ? "yes" : "no",
505  scan.m_scandate.toString(Qt::ISODate)
506  .toLatin1().constData());
507  }
508  std::cout<<std::endl;
509 
510  return GENERIC_EXIT_OK;
511  }
512 
513  if (scanImport)
514  {
515  std::cout<<"*** SCAN IMPORT START ***"<<std::endl;
516  {
517  ScanDTVTransportList list = LoadScan(scanImport);
518  ChannelImporter ci(false, true, true, true, false,
519  scanFTAOnly, scanLCNOnly,
520  scanCompleteOnly,
521  scanFullChannelSearch,
522  scanRemoveDuplicates,
523  scanServiceRequirements);
524  ci.Process(list);
525  }
526  std::cout<<"*** SCAN IMPORT END ***"<<std::endl;
527  return GENERIC_EXIT_OK;
528  }
529 
530  MythTranslation::load("mythfrontend");
531 
532  QString themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
533  QString themedir = GetMythUI()->FindThemeDir(themename);
534  if (themedir.isEmpty())
535  {
536  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
537  .arg(themename));
538  return GENERIC_EXIT_NO_THEME;
539  }
540 
541  MythMainWindow *mainWindow = GetMythMainWindow();
542  mainWindow->Init();
543  mainWindow->setWindowTitle(QObject::tr("MythTV Setup"));
544 
545  // We must reload the translation after a language change and this
546  // also means clearing the cached/loaded theme strings, so reload the
547  // theme which also triggers a translation reload
549  {
550  if (!reloadTheme())
551  return GENERIC_EXIT_NO_THEME;
552  }
553 
555  {
556  LOG(VB_GENERAL, LOG_ERR,
557  "MySQL time zone support is missing. "
558  "Please install it and try again. "
559  "See 'mysql_tzinfo_to_sql' for assistance.");
561  }
562 
563  if (!UpgradeTVDatabaseSchema(true))
564  {
565  LOG(VB_GENERAL, LOG_ERR, "Couldn't upgrade database to new schema.");
567  }
568 
569  // Refresh Global/Main Menu keys after DB update in case there was no DB
570  // when they were written originally
571  mainWindow->ReloadKeys();
572 
573  if (!startPrompt)
574  startPrompt = new StartPrompter();
576 
577  // Let the user select buttons, type values, scan for channels, etc.
578  if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename))
579  return GENERIC_EXIT_NO_THEME;
580 
581  ExpertSettingsEditor *expertEditor = nullptr;
582  if (expertMode)
583  {
585  expertEditor =
586  new ExpertSettingsEditor(mainStack, "Expert Settings Editor");
587  if (expertEditor->Create())
588  mainStack->AddScreen(expertEditor);
589  else
590  {
591  delete expertEditor;
592  expertEditor = nullptr;
593  LOG(VB_GENERAL, LOG_ERR,
594  "Unable to create expert settings editor window");
595  return GENERIC_EXIT_OK;
596  }
597  }
598 
599  QCoreApplication::exec();
600 }
601 
602 /* vim: set expandtab tabstop=4 shiftwidth=4: */
themedir
static QString themedir
Definition: mythdirs.cpp:21
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:314
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:1272
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:210
setHttpProxy
void setHttpProxy(void)
Get network proxy settings from OS, and use for [Q]Http[Comms].
Definition: mythmiscutil.cpp:857
dbutil.h
MythMainWindow::Init
void Init(bool MayReInit=true)
Definition: mythmainwindow.cpp:637
MythUIScreenBounds::ParseGeometryOverride
static void ParseGeometryOverride(const QString &Geometry)
Parse an X11 style command line geometry string.
Definition: mythuiscreenbounds.cpp:39
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:199
MythTranslation::reload
static void reload()
Reload all active translators based on the current language setting.
Definition: mythtranslation.cpp:97
ScanTypeSetting::FullScan_DVBT
@ FullScan_DVBT
Definition: scanwizardconfig.h:79
CardUtil::GetInputName
static QString GetInputName(uint inputid)
Definition: cardutil.cpp:1701
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:385
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:1361
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
mythdbcon.h
ChannelScannerCLI
Definition: channelscanner_cli.h:40
MythMainWindow::ReloadKeys
void ReloadKeys()
Definition: mythmainwindow.cpp:944
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:46
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:53
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:1019
mythversion.h
MythDisplay::ConfigureQtGUI
static void ConfigureQtGUI(int SwapInterval, const MythCommandLineParser &CmdLine)
Shared static initialistaion code for all MythTV GUI applications.
Definition: mythdisplay.cpp:1152
SSDP::Instance
static SSDP * Instance()
Definition: ssdp.cpp:52
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:1449
StandardSettingDialog
Definition: standardsettings.h:468
InitializeMythSchema
bool InitializeMythSchema(void)
command to get the the initial database layout from an empty database:
Definition: dbcheck.cpp:3882
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:111
exitPrompt
ExitPrompter * exitPrompt
Definition: mythtv/programs/mythtv-setup/main.cpp:50
SIGHUP
#define SIGHUP
Definition: compat.h:216
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:1277
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:2144
DBUtil::CheckTimeZoneSupport
static bool CheckTimeZoneSupport(void)
Check if MySQL has working timz zone support.
Definition: dbutil.cpp:866
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:1293
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:70
uint
unsigned int uint
Definition: compat.h:144
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:2825
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:236
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:74
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:2252
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:2095
cardutil.h
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:1850
SignalHandler::SetHandler
static void SetHandler(int signum, SigHandlerFunc handler)
Definition: signalhandling.cpp:138
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:101
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:2756
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:1570
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:922
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