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 
50 using namespace std;
51 
54 
56 static QString logfile;
57 
58 static void cleanup()
59 {
61 
62  delete gContext;
63  gContext = nullptr;
64 
66 }
67 
68 static void SetupMenuCallback(void* /* data */, QString& selection)
69 {
70  QString sel = selection.toLower();
71 
72  if (sel == "general")
73  {
75  auto *ssd = new StandardSettingDialog(mainStack, "generalsettings",
76  new BackendSettings());
77 
78  if (ssd->Create())
79  mainStack->AddScreen(ssd);
80  else
81  delete ssd;
82  }
83  else if (sel == "capture cards")
84  {
86  auto *ssd = new StandardSettingDialog(mainStack, "capturecardeditor",
87  new CaptureCardEditor());
88 
89  if (ssd->Create())
90  mainStack->AddScreen(ssd);
91  else
92  delete ssd;
93  }
94  else if (sel == "video sources")
95  {
97  auto *ssd = new StandardSettingDialog(mainStack, "videosourceeditor",
98  new VideoSourceEditor());
99  if (ssd->Create())
100  mainStack->AddScreen(ssd);
101  else
102  delete ssd;
103  }
104  else if (sel == "card inputs")
105  {
107  auto *ssd = new StandardSettingDialog(mainStack, "cardinputeditor",
108  new CardInputEditor());
109 
110  if (ssd->Create())
111  mainStack->AddScreen(ssd);
112  else
113  delete ssd;
114  }
115  else if (sel == "recording profile")
116  {
118  auto *ssd = new StandardSettingDialog(mainStack, "recordingprofileeditor",
119  new ProfileGroupEditor());
120 
121  if (ssd->Create())
122  mainStack->AddScreen(ssd);
123  else
124  delete ssd;
125  }
126  else if (sel == "channel editor")
127  {
129 
130  auto *chanedit = new ChannelEditor(mainStack);
131 
132  if (chanedit->Create())
133  mainStack->AddScreen(chanedit);
134  else
135  delete chanedit;
136  }
137  else if (sel == "storage groups")
138  {
140  auto *ssd = new StandardSettingDialog(mainStack, "storagegroupeditor",
141  new StorageGroupListEditor());
142 
143  if (ssd->Create())
144  mainStack->AddScreen(ssd);
145  else
146  delete ssd;
147  }
148  else if (sel == "systemeventeditor")
149  {
151 
152  auto *msee = new MythSystemEventEditor(mainStack, "System Event Editor");
153 
154  if (msee->Create())
155  mainStack->AddScreen(msee);
156  else
157  delete msee;
158  }
159  else if (sel.startsWith("exiting_app") || (sel == "standby_mode"))
160  {
161  if (!exitPrompt)
162  exitPrompt = new ExitPrompter();
164  }
165  else
166  LOG(VB_GENERAL, LOG_ERR, "Unknown menu action: " + selection);
167 }
168 
169 static bool RunMenu(const QString& themedir, const QString& themename)
170 {
171  QByteArray tmp = themedir.toLocal8Bit();
172  menu = new MythThemedMenu(
173  QString(tmp.constData()), "setup.xml",
174  GetMythMainWindow()->GetMainStack(), "mainmenu", false);
175 
176  if (menu->foundTheme())
177  {
180  return true;
181  }
182 
183  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't use theme '%1'").arg(themename));
184  delete menu;
185  menu = nullptr;
186 
187  return false;
188 }
189 
190 // If the theme specified in the DB is somehow broken, try a standard one:
191 //
192 static bool resetTheme(QString themedir, const QString &badtheme)
193 {
194  QString themename = DEFAULT_UI_THEME;
195 
196  if (badtheme == DEFAULT_UI_THEME)
197  themename = FALLBACK_UI_THEME;
198 
199  LOG(VB_GENERAL, LOG_ERR,
200  QString("Overriding broken theme '%1' with '%2'")
201  .arg(badtheme).arg(themename));
202 
203  gCoreContext->OverrideSettingForSession("Theme", themename);
204  themedir = GetMythUI()->FindThemeDir(themename);
205 
207  GetMythUI()->LoadQtConfig();
208  GetMythMainWindow()->Init();
210 
211  return RunMenu(themedir, themename);
212 }
213 
214 static int reloadTheme(void)
215 {
216  QString themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
217  QString themedir = GetMythUI()->FindThemeDir(themename);
218  if (themedir.isEmpty())
219  {
220  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
221  .arg(themename));
222  return GENERIC_EXIT_NO_THEME;
223  }
224 
226 
228 
229  GetMythUI()->LoadQtConfig();
230 
231  if (menu)
232  {
233  menu->Close();
234  }
235  GetMythMainWindow()->Init();
238 
239  if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename))
240  return GENERIC_EXIT_NO_THEME;
241 
242  return 0;
243 }
244 
245 int main(int argc, char *argv[])
246 {
247  QString geometry;
248  bool doScan = false;
249  bool doScanList = false;
250  bool doScanSaveOnly = false;
251  bool scanInteractive = true;
252  bool expertMode = false;
253  uint scanImport = 0;
254  bool scanFTAOnly = false;
255  bool scanLCNOnly = false;
256  bool scanCompleteOnly = false;
257  bool scanFullChannelSearch = false;
258  bool scanRemoveDuplicates = false;
259  bool addFullTS = false;
260  ServiceRequirements scanServiceRequirements = kRequireAV;
261  uint scanCardId = 0;
262  QString frequencyStandard = "atsc";
263  QString modulation = "vsb8";
264  QString region = "us";
265  QString scanInputName = "";
266 
268  if (!cmdline.Parse(argc, argv))
269  {
270  cmdline.PrintHelp();
272  }
273 
274  if (cmdline.toBool("showhelp"))
275  {
276  cmdline.PrintHelp();
277  return GENERIC_EXIT_OK;
278  }
279 
280  if (cmdline.toBool("showversion"))
281  {
283  return GENERIC_EXIT_OK;
284  }
285 
286  bool quiet = false;
287  bool use_display = true;
288  if (cmdline.toBool("scan"))
289  {
290  quiet = true;
291  use_display = false;
292  }
293 
294  std::unique_ptr<QCoreApplication> app {nullptr};
295  CleanupGuard callCleanup(cleanup);
296 
297  if (use_display)
298  {
300  app = std::make_unique<QApplication>(argc, argv);
301  }
302  else
303  {
304  app = std::make_unique<QCoreApplication>(argc, argv);
305  }
306  QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHTV_SETUP);
307 
308 #ifndef _WIN32
309  QList<int> signallist;
310  signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
311  << SIGILL;
312 #if ! CONFIG_DARWIN
313  signallist << SIGRTMIN;
314 #endif
315  SignalHandler::Init(signallist);
316  SignalHandler::SetHandler(SIGHUP, logSigHup);
317 #endif
318 
319  if (cmdline.toBool("geometry"))
320  geometry = cmdline.toString("geometry");
321 
322  QString mask("general");
323  int retval = cmdline.ConfigureLogging(mask, quiet);
324  if (retval != GENERIC_EXIT_OK)
325  return retval;
326 
327  if (cmdline.toBool("expert"))
328  expertMode = true;
329  if (cmdline.toBool("scanlist"))
330  doScanList = true;
331  if (cmdline.toBool("savescan"))
332  doScanSaveOnly = true;
333  if (cmdline.toBool("scannoninteractive"))
334  scanInteractive = false;
335 
336  if (cmdline.toBool("importscan"))
337  scanImport = cmdline.toUInt("importscan");
338  if (cmdline.toBool("ftaonly"))
339  scanFTAOnly = true;
340  if (cmdline.toBool("lcnonly"))
341  scanLCNOnly = true;
342  if (cmdline.toBool("completeonly"))
343  scanCompleteOnly = true;
344  if (cmdline.toBool("fullsearch"))
345  scanFullChannelSearch = true;
346  if (cmdline.toBool("removeduplicates"))
347  scanRemoveDuplicates = true;
348  if (cmdline.toBool("addfullts"))
349  addFullTS = true;
350  if (cmdline.toBool("servicetype"))
351  {
352  scanServiceRequirements = kRequireNothing;
353  if (cmdline.toString("servicetype").contains("radio"))
354  scanServiceRequirements = kRequireAudio;
355  if (cmdline.toString("servicetype").contains("tv"))
356  scanServiceRequirements = kRequireAV;
357  if (cmdline.toString("servicetype").contains("tv+radio") ||
358  cmdline.toString("servicetype").contains("radio+tv"))
359  scanServiceRequirements = kRequireAudio;
360  if (cmdline.toString("servicetype").contains("all"))
361  scanServiceRequirements = kRequireNothing;
362  }
363 
364  if (!cmdline.toBool("noupnp"))
365  {
366  // start looking for any uPnP devices we can use like VBoxes
367  SSDP::Instance()->PerformSearch("ssdp:all");
368  }
369  if (cmdline.toBool("scan"))
370  {
371  scanCardId = cmdline.toUInt("scan");
372  doScan = true;
373  }
374  if (cmdline.toBool("freqstd"))
375  frequencyStandard = cmdline.toString("freqstd").toLower();
376  if (cmdline.toBool("modulation"))
377  modulation = cmdline.toString("modulation").toLower();
378  if (cmdline.toBool("region"))
379  region = cmdline.toString("region").toLower();
380  if (cmdline.toBool("inputname"))
381  scanInputName = cmdline.toString("inputname");
382 
383  if (!geometry.isEmpty())
384  {
386  }
387 
389 
391  if (!gContext->Init(use_display,false,true)) // No Upnp, Prompt for db
392  {
393  LOG(VB_GENERAL, LOG_ERR, "Failed to init MythContext, exiting.");
395  }
396 
398 
399  if (!GetMythDB()->HaveSchema())
400  {
401  if (!InitializeMythSchema())
402  return GENERIC_EXIT_DB_ERROR;
403  }
404 
405  setHttpProxy();
406 
407  if (use_display)
408  {
409  GetMythUI()->LoadQtConfig();
410 
411  QString fileprefix = GetConfDir();
412 
413  QDir dir(fileprefix);
414  if (!dir.exists())
415  dir.mkdir(fileprefix);
416  }
417 
418  if (doScan)
419  {
420  bool okCardID = scanCardId != 0U;
421 
422  if (scanInputName.isEmpty())
423  scanInputName = CardUtil::GetInputName(scanCardId);
424 
425  bool okInputName = (scanInputName == CardUtil::GetInputName(scanCardId)
426  && scanInputName != "None");
427 
428  doScan = (okCardID && okInputName);
429 
430  if (!okCardID)
431  {
432  cerr << "You must enter a valid cardid to scan." << endl;
433  vector<uint> cardids = CardUtil::GetInputIDs();
434  if (cardids.empty())
435  {
436  cerr << "But no cards have been defined on this host"
437  << endl;
439  }
440  cerr << "Valid cards: " << endl;
441  for (uint id : cardids)
442  {
443  fprintf(stderr, "%5u: %s %s\n", id,
444  CardUtil::GetRawInputType(id).toLatin1().constData(),
445  CardUtil::GetVideoDevice(id).toLatin1().constData());
446  }
448  }
449 
450  if (!okInputName)
451  {
452  cerr << "You must enter a valid input to scan this card."
453  << endl;
454  cerr << "Valid input: "
455  << CardUtil::GetInputName(scanCardId).toLatin1().constData()
456  << endl;
458  }
459  }
460 
461  if (doScan)
462  {
463  int ret = 0;
464  uint inputid = scanCardId;
465  uint sourceid = CardUtil::GetSourceID(inputid);
466  QMap<QString,QString> startChan;
467  {
468  ChannelScannerCLI scanner(doScanSaveOnly, scanInteractive);
469 
470  int scantype = ScanTypeSetting::FullScan_ATSC;
471  if (frequencyStandard == "atsc")
472  scantype = ScanTypeSetting::FullScan_ATSC; // NOLINT(bugprone-branch-clone)
473  else if (frequencyStandard == "dvbt")
475  else if (frequencyStandard == "mpeg")
477  else if (frequencyStandard == "iptv")
478  {
480  scanner.ImportM3U(scanCardId, scanInputName, sourceid, true);
481  }
482  else if (frequencyStandard == "extern")
484  else
486 
487  scanner.Scan(scantype,
488  /* cardid */ scanCardId,
489  /* inputname */ scanInputName,
490  /* sourceid */ sourceid,
491  /* ignore signal timeout */ false,
492  /* follow_nit */ true,
493  /* test decryption */ true,
494  scanFTAOnly,
495  scanLCNOnly,
496  scanCompleteOnly,
497  scanFullChannelSearch,
498  scanRemoveDuplicates,
499  addFullTS,
500  scanServiceRequirements,
501  // stuff needed for particular scans
502  /* mplexid */ 0,
503  startChan, frequencyStandard, modulation, region);
504  ret = QCoreApplication::exec();
505  }
506  return (ret) ? GENERIC_EXIT_NOT_OK : GENERIC_EXIT_OK;
507  }
508 
509  if (doScanList)
510  {
511  vector<ScanInfo> scans = LoadScanList();
512 
513  cout<<" scanid cardid sourceid processed date"<<endl;
514  for (auto & scan : scans)
515  {
516  printf("%5i %6i %8i %8s %20s\n",
517  scan.m_scanid, scan.m_cardid,
518  scan.m_sourceid, (scan.m_processed) ? "yes" : "no",
519  scan.m_scandate.toString(Qt::ISODate)
520  .toLatin1().constData());
521  }
522  cout<<endl;
523 
524  return GENERIC_EXIT_OK;
525  }
526 
527  if (scanImport)
528  {
529  cout<<"*** SCAN IMPORT START ***"<<endl;
530  {
531  ScanDTVTransportList list = LoadScan(scanImport);
532  ChannelImporter ci(false, true, true, true, false,
533  scanFTAOnly, scanLCNOnly,
534  scanCompleteOnly,
535  scanFullChannelSearch,
536  scanRemoveDuplicates,
537  scanServiceRequirements);
538  ci.Process(list);
539  }
540  cout<<"*** SCAN IMPORT END ***"<<endl;
541  return GENERIC_EXIT_OK;
542  }
543 
544  MythTranslation::load("mythfrontend");
545 
546  QString themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
547  QString themedir = GetMythUI()->FindThemeDir(themename);
548  if (themedir.isEmpty())
549  {
550  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
551  .arg(themename));
552  return GENERIC_EXIT_NO_THEME;
553  }
554 
555  MythMainWindow *mainWindow = GetMythMainWindow();
556  mainWindow->Init();
557  mainWindow->setWindowTitle(QObject::tr("MythTV Setup"));
558 
559  // We must reload the translation after a language change and this
560  // also means clearing the cached/loaded theme strings, so reload the
561  // theme which also triggers a translation reload
563  {
564  if (!reloadTheme())
565  return GENERIC_EXIT_NO_THEME;
566  }
567 
569  {
570  LOG(VB_GENERAL, LOG_ERR,
571  "MySQL time zone support is missing. "
572  "Please install it and try again. "
573  "See 'mysql_tzinfo_to_sql' for assistance.");
575  }
576 
577  if (!UpgradeTVDatabaseSchema(true))
578  {
579  LOG(VB_GENERAL, LOG_ERR, "Couldn't upgrade database to new schema.");
581  }
582 
583  // Refresh Global/Main Menu keys after DB update in case there was no DB
584  // when they were written originally
585  mainWindow->ReloadKeys();
586 
587  if (!startPrompt)
588  startPrompt = new StartPrompter();
590 
591  // Let the user select buttons, type values, scan for channels, etc.
592  if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename))
593  return GENERIC_EXIT_NO_THEME;
594 
595  ExpertSettingsEditor *expertEditor = nullptr;
596  if (expertMode)
597  {
599  expertEditor =
600  new ExpertSettingsEditor(mainStack, "Expert Settings Editor");
601  if (expertEditor->Create())
602  mainStack->AddScreen(expertEditor);
603  else
604  {
605  delete expertEditor;
606  expertEditor = nullptr;
607  LOG(VB_GENERAL, LOG_ERR,
608  "Unable to create expert settings editor window");
609  return GENERIC_EXIT_OK;
610  }
611  }
612 
613  QCoreApplication::exec();
614 }
615 
616 /* vim: set expandtab tabstop=4 shiftwidth=4: */
themedir
static QString themedir
Definition: mythdirs.cpp:21
commandlineparser.h
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:304
SetupMenuCallback
static void SetupMenuCallback(void *, QString &selection)
Definition: mythtv/programs/mythtv-setup/main.cpp:68
channelscanner_cli.h
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:214
setHttpProxy
void setHttpProxy(void)
Get network proxy settings from OS, and use for [Q]Http[Comms].
Definition: mythmiscutil.cpp:851
dbutil.h
MythMainWindow::ReinitDone
void ReinitDone(void)
Definition: mythmainwindow.cpp:930
VideoSourceEditor
Definition: videosource.h:843
storagegroupeditor.h
expertsettingseditor.h
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:78
CardUtil::GetInputName
static QString GetInputName(uint inputid)
Definition: cardutil.cpp:1717
UpgradeTVDatabaseSchema
bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, const bool upgradeIfNoUI, const bool informSystemd)
Called from outside dbcheck.cpp to update the schema.
Definition: dbcheck.cpp:362
channelimporter.h
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:402
ssdp.h
MythContext
Startup context for MythTV.
Definition: mythcontext.h:43
ExitPrompter
Definition: mythfrontend/exitprompt.h:5
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:9
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:21
MythScreenStack
Definition: mythscreenstack.h:16
arg
arg(title).arg(filename).arg(doDelete))
mythdbcon.h
ChannelScannerCLI
Definition: channelscanner_cli.h:41
StartPrompter::handleStart
void handleStart()
Definition: startprompt.cpp:35
ScanDTVTransportList
vector< ScanDTVTransport > ScanDTVTransportList
Definition: dtvmultiplex.h:143
checksetup.h
scanwizardconfig.h
ScanTypeSetting::FullScan_ATSC
@ FullScan_ATSC
Definition: scanwizardconfig.h:76
startPrompt
StartPrompter * startPrompt
Definition: mythtv/programs/mythtv-setup/main.cpp:53
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:824
MythTVSetupCommandLineParser
Definition: mythtv-setup/commandlineparser.h:7
menu
static MythThemedMenu * menu
Definition: mythtv/programs/mythtv-setup/main.cpp:55
remoteutil.h
BackendSettings
Definition: backendsettings.h:8
ChannelImporter::Process
void Process(const ScanDTVTransportList &_transports, int sourceid=-1)
Definition: channelimporter.cpp:38
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:30
mythversion.h
LoadScanList
vector< ScanInfo > LoadScanList(void)
Definition: scaninfo.cpp:270
SSDP::Instance
static SSDP * Instance()
Definition: ssdp.cpp:54
ProfileGroupEditor
Definition: profilegroup.h:122
MythCommandLineParser::Parse
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
Definition: mythcommandlineparser.cpp:1441
StandardSettingDialog
Definition: standardsettings.h:466
InitializeMythSchema
bool InitializeMythSchema(void)
command to get the the initial database layout from an empty database:
Definition: dbcheck.cpp:3804
mythdisplay.h
DEFAULT_UI_THEME
#define DEFAULT_UI_THEME
Definition: mythuihelper.h:12
mythlogging.h
GetConfDir
QString GetConfDir(void)
Definition: mythdirs.cpp:224
dbcheck.h
signalhandling.h
CleanupGuard
Definition: cleanupguard.h:7
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:112
ScanTypeSetting::IPTVImportMPTS
@ IPTVImportMPTS
Definition: scanwizardconfig.h:96
ChannelEditor
Definition: osd.h:82
DestroyMythMainWindow
void DestroyMythMainWindow(void)
Definition: mythmainwindow.cpp:117
exitPrompt
ExitPrompter * exitPrompt
Definition: mythtv/programs/mythtv-setup/main.cpp:52
SIGHUP
#define SIGHUP
Definition: compat.h:213
MythMainWindow::ReloadKeys
void ReloadKeys(void)
Definition: mythmainwindow.cpp:922
MythCommandLineParser::PrintVersion
static void PrintVersion(void)
Print application version information.
Definition: mythcommandlineparser.cpp:1268
mythtranslation.h
scaninfo.h
MythMainWindow::SetEffectsEnabled
void SetEffectsEnabled(bool enable)
Definition: mythmainwindow.cpp:1023
MythCommandLineParser::toUInt
uint toUInt(const QString &key) const
Returns stored QVariant as an unsigned integer, falling to default if not provided.
Definition: mythcommandlineparser.cpp:2000
DBUtil::CheckTimeZoneSupport
static bool CheckTimeZoneSupport(void)
Check if MySQL has working timz zone support.
Definition: dbutil.cpp:869
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:1284
MythUIHelper::FindThemeDir
QString FindThemeDir(const QString &themename, bool doFallback=true)
Returns the full path to the theme denoted by themename.
Definition: mythuihelper.cpp:953
logfile
static QString logfile
Definition: mythtv/programs/mythtv-setup/main.cpp:56
MythSystemEventEditor
An editor for MythSystemEvent handler commands.
Definition: mythsystemevent.h:51
quiet
int quiet
Definition: mythtv/programs/mythcommflag/main.cpp:73
uint
unsigned int uint
Definition: compat.h:140
ScanTypeSetting::CurrentTransportScan
@ CurrentTransportScan
Scans the transport when there is no tuner (for ASI)
Definition: scanwizardconfig.h:92
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
kRequireNothing
@ kRequireNothing
Definition: channelscantypes.h:6
MythCommandLineParser::ApplySettingsOverride
void ApplySettingsOverride(void)
Apply all overrides to the global context.
Definition: mythcommandlineparser.cpp:2652
MythUIHelper::LoadQtConfig
void LoadQtConfig(void)
Definition: mythuihelper.cpp:319
channeleditor.h
CardUtil::GetInputIDs
static 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:1288
RunMenu
static bool RunMenu(const QString &themedir, const QString &themename)
Definition: mythtv/programs/mythtv-setup/main.cpp:169
resetTheme
static bool resetTheme(QString themedir, const QString &badtheme)
Definition: mythtv/programs/mythtv-setup/main.cpp:192
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:245
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:77
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:2100
GENERIC_EXIT_NOT_OK
#define GENERIC_EXIT_NOT_OK
Exited with error.
Definition: exitcodes.h:11
StartPrompter
Definition: startprompt.h:7
MythCommandLineParser::toBool
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
Definition: mythcommandlineparser.cpp:1955
cardutil.h
dir
QDir dir
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1171
cleanupguard.h
LanguageSelection::prompt
static bool prompt(bool force=false)
Ask the user for the language to use.
Definition: langsettings.cpp:175
MythDate::ISODate
@ ISODate
Default UTC.
Definition: mythdate.h:14
ChannelImporter
Definition: channelimporter.h:74
ScanTypeSetting::ExternRecImport
@ ExternRecImport
Definition: scanwizardconfig.h:104
SSDP::PerformSearch
void PerformSearch(const QString &sST, uint timeout_secs=2)
Definition: ssdp.cpp:201
MythDisplay::ConfigureQtGUI
static void ConfigureQtGUI(int SwapInterval=1, const QString &Display=QString())
Shared static initialistaion code for all MythTV GUI applications.
Definition: mythdisplay.cpp:1050
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:1786
SignalHandler::SetHandler
static void SetHandler(int signum, SigHandlerFunc handler)
Definition: signalhandling.cpp:150
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:107
FALLBACK_UI_THEME
#define FALLBACK_UI_THEME
Definition: mythuihelper.h:13
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:2583
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:81
ServiceRequirements
ServiceRequirements
Definition: channelscantypes.h:5
StorageGroupListEditor
Definition: storagegroupeditor.h:31
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:49
cleanup
static void cleanup()
Definition: mythtv/programs/mythtv-setup/main.cpp:58
gContext
MythContext * gContext
This global variable contains the MythContext instance for the application.
Definition: mythcontext.cpp:61
MythMainWindow::Init
void Init(bool mayReInit=true)
Definition: mythmainwindow.cpp:596
videosource.h
MythUIHelper::ParseGeometryOverride
static void ParseGeometryOverride(const QString &geometry)
Parse an X11 style command line geometry string.
Definition: mythuihelper.cpp:836
MythContext::Init
bool Init(bool gui=true, bool promptForBackend=false, bool disableAutoDiscovery=false, bool ignoreDB=false)
Definition: mythcontext.cpp:1566
MythMainWindow
Definition: mythmainwindow.h:33
ChannelScanner::ImportM3U
virtual bool ImportM3U(uint cardid, const QString &inputname, uint sourceid, bool is_mpts)
Definition: channelscanner.cpp:333
SignalHandler::Done
static void Done(void)
Definition: signalhandling.cpp:143
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:916
CardInputEditor
Definition: videosource.h:862
SignalHandler::Init
static void Init(QList< int > &signallist, QObject *parent=nullptr)
Definition: signalhandling.cpp:136
GENERIC_EXIT_DB_OUTOFDATE
#define GENERIC_EXIT_DB_OUTOFDATE
Database needs upgrade.
Definition: exitcodes.h:16