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 #if CONFIG_DARWIN
48 #include "mythuidefines.h"
49 #endif
50 #include "cleanupguard.h"
51 
52 using namespace std;
53 
56 
58 static QString logfile;
59 
60 static void cleanup()
61 {
63 
64  delete gContext;
65  gContext = nullptr;
66 
67  delete qApp;
68 
70 }
71 
72 static void SetupMenuCallback(void* /* data */, QString& selection)
73 {
74  QString sel = selection.toLower();
75 
76  if (sel == "general")
77  {
80  new StandardSettingDialog(mainStack, "generalsettings",
81  new BackendSettings());
82 
83  if (ssd->Create())
84  mainStack->AddScreen(ssd);
85  else
86  delete ssd;
87  }
88  else if (sel == "capture cards")
89  {
92  new StandardSettingDialog(mainStack, "capturecardeditor",
93  new CaptureCardEditor());
94 
95  if (ssd->Create())
96  mainStack->AddScreen(ssd);
97  else
98  delete ssd;
99  }
100  else if (sel == "video sources")
101  {
103  StandardSettingDialog *ssd =
104  new StandardSettingDialog(mainStack, "videosourceeditor",
105  new VideoSourceEditor());
106  if (ssd->Create())
107  mainStack->AddScreen(ssd);
108  else
109  delete ssd;
110  }
111  else if (sel == "card inputs")
112  {
114  StandardSettingDialog *ssd =
115  new StandardSettingDialog(mainStack, "cardinputeditor",
116  new CardInputEditor());
117 
118  if (ssd->Create())
119  mainStack->AddScreen(ssd);
120  else
121  delete ssd;
122  }
123  else if (sel == "recording profile")
124  {
126  StandardSettingDialog *ssd =
127  new StandardSettingDialog(mainStack, "recordingprofileeditor",
128  new ProfileGroupEditor());
129 
130  if (ssd->Create())
131  mainStack->AddScreen(ssd);
132  else
133  delete ssd;
134  }
135  else if (sel == "channel editor")
136  {
138 
139  ChannelEditor *chanedit = new ChannelEditor(mainStack);
140 
141  if (chanedit->Create())
142  mainStack->AddScreen(chanedit);
143  else
144  delete chanedit;
145  }
146  else if (sel == "storage groups")
147  {
149  StandardSettingDialog *ssd =
150  new StandardSettingDialog(mainStack, "storagegroupeditor",
151  new StorageGroupListEditor());
152 
153  if (ssd->Create())
154  mainStack->AddScreen(ssd);
155  else
156  delete ssd;
157  }
158  else if (sel == "systemeventeditor")
159  {
161 
163  mainStack, "System Event Editor");
164 
165  if (msee->Create())
166  mainStack->AddScreen(msee);
167  else
168  delete msee;
169  }
170  else if (sel.startsWith("exiting_app") || (sel == "standby_mode"))
171  {
172  if (!exitPrompt)
173  exitPrompt = new ExitPrompter();
175  }
176  else
177  LOG(VB_GENERAL, LOG_ERR, "Unknown menu action: " + selection);
178 }
179 
180 static bool RunMenu(const QString& themedir, const QString& themename)
181 {
182  QByteArray tmp = themedir.toLocal8Bit();
183  menu = new MythThemedMenu(
184  QString(tmp.constData()), "setup.xml",
185  GetMythMainWindow()->GetMainStack(), "mainmenu", false);
186 
187  if (menu->foundTheme())
188  {
191  return true;
192  }
193 
194  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't use theme '%1'").arg(themename));
195  delete menu;
196  menu = nullptr;
197 
198  return false;
199 }
200 
201 // If the theme specified in the DB is somehow broken, try a standard one:
202 //
203 static bool resetTheme(QString themedir, const QString &badtheme)
204 {
205  QString themename = DEFAULT_UI_THEME;
206 
207  if (badtheme == DEFAULT_UI_THEME)
208  themename = FALLBACK_UI_THEME;
209 
210  LOG(VB_GENERAL, LOG_ERR,
211  QString("Overriding broken theme '%1' with '%2'")
212  .arg(badtheme).arg(themename));
213 
214  gCoreContext->OverrideSettingForSession("Theme", themename);
215  themedir = GetMythUI()->FindThemeDir(themename);
216 
218  GetMythUI()->LoadQtConfig();
219 #if CONFIG_DARWIN
221 #else
222  GetMythMainWindow()->Init();
223 #endif
225 
226  return RunMenu(themedir, themename);
227 }
228 
229 static int reloadTheme(void)
230 {
231  QString themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
232  QString themedir = GetMythUI()->FindThemeDir(themename);
233  if (themedir.isEmpty())
234  {
235  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
236  .arg(themename));
237  return GENERIC_EXIT_NO_THEME;
238  }
239 
241 
243 
244  GetMythUI()->LoadQtConfig();
245 
246  if (menu)
247  {
248  menu->Close();
249  }
250 #if CONFIG_DARWIN
252 #else
253  GetMythMainWindow()->Init();
254 #endif
255 
257 
259 
260  if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename))
261  return GENERIC_EXIT_NO_THEME;
262 
263  return 0;
264 }
265 
266 int main(int argc, char *argv[])
267 {
268  QString geometry;
269  QString display;
270  bool doScan = false;
271  bool doScanList = false;
272  bool doScanSaveOnly = false;
273  bool scanInteractive = true;
274  bool expertMode = false;
275  uint scanImport = 0;
276  bool scanFTAOnly = false;
277  bool scanLCNOnly = false;
278  bool scanCompleteOnly = false;
279  bool addFullTS = false;
280  ServiceRequirements scanServiceRequirements = kRequireAV;
281  uint scanCardId = 0;
282  QString frequencyStandard = "atsc";
283  QString modulation = "vsb8";
284  QString region = "us";
285  QString scanInputName = "";
286 
287 #if CONFIG_OMX_RPI
288  setenv("QT_XCB_GL_INTEGRATION","none",0);
289 #endif
290 
292  if (!cmdline.Parse(argc, argv))
293  {
294  cmdline.PrintHelp();
296  }
297 
298  if (cmdline.toBool("showhelp"))
299  {
300  cmdline.PrintHelp();
301  return GENERIC_EXIT_OK;
302  }
303 
304  if (cmdline.toBool("showversion"))
305  {
307  return GENERIC_EXIT_OK;
308  }
309 
310  bool quiet = false, use_display = true;
311  if (cmdline.toBool("scan"))
312  {
313  quiet = true;
314  use_display = false;
315  }
316 
317  CleanupGuard callCleanup(cleanup);
318 
319  if (use_display)
320  {
321 
322 #ifdef Q_OS_MAC
323  // Without this, we can't set focus to any of the CheckBoxSetting, and most
324  // of the MythPushButton widgets, and they don't use the themed background.
325  QApplication::setDesktopSettingsAware(false);
326 #endif
327  new QApplication(argc, argv);
328  }
329  else {
330  new QCoreApplication(argc, argv);
331  }
332  QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHTV_SETUP);
333 
334 #ifndef _WIN32
335  QList<int> signallist;
336  signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
337  << SIGILL;
338 #if ! CONFIG_DARWIN
339  signallist << SIGRTMIN;
340 #endif
341  SignalHandler::Init(signallist);
342  SignalHandler::SetHandler(SIGHUP, logSigHup);
343 #endif
344 
345  if (cmdline.toBool("display"))
346  display = cmdline.toString("display");
347  if (cmdline.toBool("geometry"))
348  geometry = cmdline.toString("geometry");
349 
350  int retval;
351  QString mask("general");
352  if ((retval = cmdline.ConfigureLogging(mask, quiet)) != GENERIC_EXIT_OK)
353  return retval;
354 
355  if (cmdline.toBool("expert"))
356  expertMode = true;
357  if (cmdline.toBool("scanlist"))
358  doScanList = true;
359  if (cmdline.toBool("savescan"))
360  doScanSaveOnly = true;
361  if (cmdline.toBool("scannoninteractive"))
362  scanInteractive = false;
363 
364  if (cmdline.toBool("importscan"))
365  scanImport = cmdline.toUInt("importscan");
366  if (cmdline.toBool("ftaonly"))
367  scanFTAOnly = true;
368  if (cmdline.toBool("lcnonly"))
369  scanLCNOnly = true;
370  if (cmdline.toBool("completeonly"))
371  scanCompleteOnly = true;
372  if (cmdline.toBool("addfullts"))
373  addFullTS = true;
374  if (cmdline.toBool("servicetype"))
375  {
376  scanServiceRequirements = kRequireNothing;
377  if (cmdline.toString("servicetype").contains("radio"))
378  scanServiceRequirements = kRequireAudio;
379  if (cmdline.toString("servicetype").contains("tv"))
380  scanServiceRequirements = kRequireAV;
381  if (cmdline.toString("servicetype").contains("tv+radio") ||
382  cmdline.toString("servicetype").contains("radio+tv"))
383  scanServiceRequirements = kRequireAudio;
384  if (cmdline.toString("servicetype").contains("all"))
385  scanServiceRequirements = kRequireNothing;
386  }
387 
388  if (!cmdline.toBool("noupnp"))
389  {
390  // start looking for any uPnP devices we can use like VBoxes
391  SSDP::Instance()->PerformSearch("ssdp:all");
392  }
393  if (cmdline.toBool("scan"))
394  {
395  scanCardId = cmdline.toUInt("scan");
396  doScan = true;
397  }
398  if (cmdline.toBool("freqstd"))
399  frequencyStandard = cmdline.toString("freqstd").toLower();
400  if (cmdline.toBool("modulation"))
401  modulation = cmdline.toString("modulation").toLower();
402  if (cmdline.toBool("region"))
403  region = cmdline.toString("region").toLower();
404  if (cmdline.toBool("inputname"))
405  scanInputName = cmdline.toString("inputname");
406 
407  if (!display.isEmpty())
408  {
410  }
411 
412  if (!geometry.isEmpty())
413  {
415  }
416 
418 
420  if (!gContext->Init(use_display,false,true)) // No Upnp, Prompt for db
421  {
422  LOG(VB_GENERAL, LOG_ERR, "Failed to init MythContext, exiting.");
424  }
425 
427 
428  if (!GetMythDB()->HaveSchema())
429  {
430  if (!InitializeMythSchema())
431  return GENERIC_EXIT_DB_ERROR;
432  }
433 
434  setHttpProxy();
435 
436  if (use_display)
437  {
438  GetMythUI()->LoadQtConfig();
439 
440  QString fileprefix = GetConfDir();
441 
442  QDir dir(fileprefix);
443  if (!dir.exists())
444  dir.mkdir(fileprefix);
445  }
446 
447  if (doScan)
448  {
449  bool okCardID = scanCardId != 0U;
450 
451  if (scanInputName.isEmpty())
452  scanInputName = CardUtil::GetInputName(scanCardId);
453 
454  bool okInputName = (scanInputName == CardUtil::GetInputName(scanCardId)
455  && scanInputName != "None");
456 
457  doScan = (okCardID && okInputName);
458 
459  if (!okCardID)
460  {
461  cerr << "You must enter a valid cardid to scan." << endl;
462  vector<uint> cardids = CardUtil::GetInputIDs();
463  if (cardids.empty())
464  {
465  cerr << "But no cards have been defined on this host"
466  << endl;
468  }
469  cerr << "Valid cards: " << endl;
470  for (size_t i = 0; i < cardids.size(); i++)
471  {
472  fprintf(stderr, "%5u: %s %s\n",
473  cardids[i],
474  CardUtil::GetRawInputType(cardids[i])
475  .toLatin1().constData(),
476  CardUtil::GetVideoDevice(cardids[i])
477  .toLatin1().constData());
478  }
480  }
481 
482  if (!okInputName)
483  {
484  cerr << "You must enter a valid input to scan this card."
485  << endl;
486  cerr << "Valid input: "
487  << CardUtil::GetInputName(scanCardId).toLatin1().constData()
488  << endl;
490  }
491  }
492 
493  if (doScan)
494  {
495  int ret = 0;
496  uint inputid = scanCardId;
497  uint sourceid = CardUtil::GetSourceID(inputid);
498  QMap<QString,QString> startChan;
499  {
500  ChannelScannerCLI scanner(doScanSaveOnly, scanInteractive);
501 
502  int scantype;
503  if (frequencyStandard == "atsc")
505  else if (frequencyStandard == "dvbt")
507  else if (frequencyStandard == "mpeg")
509  else if (frequencyStandard == "iptv")
510  {
512  scanner.ImportM3U(scanCardId, scanInputName, sourceid, true);
513  }
514  else if (frequencyStandard == "extern")
516  else
518 
519  scanner.Scan(scantype,
520  /* cardid */ scanCardId,
521  /* inputname */ scanInputName,
522  /* sourceid */ sourceid,
523  /* ignore signal timeout */ false,
524  /* follow_nit */ true,
525  /* test decryption */ true,
526  scanFTAOnly,
527  scanLCNOnly,
528  scanCompleteOnly,
529  addFullTS,
530  scanServiceRequirements,
531  // stuff needed for particular scans
532  /* mplexid */ 0,
533  startChan, frequencyStandard, modulation, region);
534  ret = qApp->exec();
535  }
536  return (ret) ? GENERIC_EXIT_NOT_OK : GENERIC_EXIT_OK;
537  }
538 
539  if (doScanList)
540  {
541  vector<ScanInfo> scans = LoadScanList();
542 
543  cout<<" scanid cardid sourceid processed date"<<endl;
544  for (size_t i = 0; i < scans.size(); i++)
545  {
546  printf("%5i %6i %8i %8s %20s\n",
547  scans[i].m_scanid, scans[i].m_cardid,
548  scans[i].m_sourceid, (scans[i].m_processed) ? "yes" : "no",
549  scans[i].m_scandate.toString(Qt::ISODate)
550  .toLatin1().constData());
551  }
552  cout<<endl;
553 
554  return GENERIC_EXIT_OK;
555  }
556 
557  if (scanImport)
558  {
559  cout<<"*** SCAN IMPORT START ***"<<endl;
560  {
561  ScanDTVTransportList list = LoadScan(scanImport);
562  ChannelImporter ci(false, true, true, true, false,
563  scanFTAOnly, scanLCNOnly, scanCompleteOnly, scanServiceRequirements);
564  ci.Process(list);
565  }
566  cout<<"*** SCAN IMPORT END ***"<<endl;
567  return GENERIC_EXIT_OK;
568  }
569 
570  MythTranslation::load("mythfrontend");
571 
572  QString themename = gCoreContext->GetSetting("Theme", DEFAULT_UI_THEME);
573  QString themedir = GetMythUI()->FindThemeDir(themename);
574  if (themedir.isEmpty())
575  {
576  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find theme '%1'")
577  .arg(themename));
578  return GENERIC_EXIT_NO_THEME;
579  }
580 
581  MythMainWindow *mainWindow = GetMythMainWindow();
582 #if CONFIG_DARWIN
583  mainWindow->Init(QT_PAINTER);
584 #else
585  mainWindow->Init();
586 #endif
587  mainWindow->setWindowTitle(QObject::tr("MythTV Setup"));
588 
589  // We must reload the translation after a language change and this
590  // also means clearing the cached/loaded theme strings, so reload the
591  // theme which also triggers a translation reload
593  {
594  if (!reloadTheme())
595  return GENERIC_EXIT_NO_THEME;
596  }
597 
599  {
600  LOG(VB_GENERAL, LOG_ERR,
601  "MySQL time zone support is missing. "
602  "Please install it and try again. "
603  "See 'mysql_tzinfo_to_sql' for assistance.");
605  }
606 
607  if (!UpgradeTVDatabaseSchema(true))
608  {
609  LOG(VB_GENERAL, LOG_ERR, "Couldn't upgrade database to new schema.");
611  }
612 
613  // Refresh Global/Main Menu keys after DB update in case there was no DB
614  // when they were written originally
615  mainWindow->ReloadKeys();
616 
617  if (!startPrompt)
618  startPrompt = new StartPrompter();
620 
621  // Let the user select buttons, type values, scan for channels, etc.
622  if (!RunMenu(themedir, themename) && !resetTheme(themedir, themename))
623  return GENERIC_EXIT_NO_THEME;
624 
625  ExpertSettingsEditor *expertEditor = nullptr;
626  if (expertMode)
627  {
629  expertEditor =
630  new ExpertSettingsEditor(mainStack, "Expert Settings Editor");
631  if (expertEditor->Create())
632  mainStack->AddScreen(expertEditor);
633  else
634  {
635  delete expertEditor;
636  expertEditor = nullptr;
637  LOG(VB_GENERAL, LOG_ERR,
638  "Unable to create expert settings editor window");
639  return GENERIC_EXIT_OK;
640  }
641  }
642 
643  qApp->exec();
644 }
645 
646 /* vim: set expandtab tabstop=4 shiftwidth=4: */
vector< ScanInfo > LoadScanList(void)
Definition: scaninfo.cpp:249
#define GENERIC_EXIT_DB_ERROR
Database error.
Definition: exitcodes.h:17
Startup context for MythTV.
Definition: mythcontext.h:42
QString FindThemeDir(const QString &themename, bool doFallback=true)
Returns the full path to the theme denoted by themename.
bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, const bool upgradeIfNoUI, const bool informSystemd)
Called from outside dbcheck.cpp to update the schema.
stderr
Definition: ttvdb.py:1426
static QString GetInputName(uint inputid)
Definition: cardutil.cpp:1682
static QString themedir
Definition: mythdirs.cpp:21
void LoadQtConfig(void)
void handleStart()
Definition: startprompt.cpp:35
#define GENERIC_EXIT_OK
Exited with no error.
Definition: exitcodes.h:10
void setHttpProxy(void)
Get network proxy settings from OS, and use for [Q]Http[Comms].
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
bool Create(void) override
Creates the UI screen.
void PrintHelp(void) const
Print command line option help.
vector< ScanDTVTransport > ScanDTVTransportList
Definition: dtvmultiplex.h:141
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_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())
static void Init(QList< int > &signallist, QObject *parent=nullptr)
static bool resetTheme(QString themedir, const QString &badtheme)
void DestroyMythMainWindow(void)
void setCallback(void(*lcallback)(void *, QString &), void *data)
Set the themed menus callback function and data for that function.
#define DEFAULT_UI_THEME
Definition: mythuihelper.h:12
unsigned int uint
Definition: compat.h:140
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythScreenStack * GetMainStack()
virtual bool ImportM3U(uint cardid, const QString &inputname, uint sourceid, bool is_mpts)
MythContext * gContext
This global variable contains the MythContext instance for the application.
Definition: mythcontext.cpp:63
static MythThemedMenu * menu
static void SetupMenuCallback(void *, QString &selection)
int main(int argc, char *argv[])
static guint32 * tmp
Definition: goom_core.c:35
void Init(const QString &forcedpainter=QString(), bool mayReInit=true)
#define MYTH_APPNAME_MYTHTV_SETUP
static void SetX11Display(const QString &display)
This needs to be set before MythUIHelper is initialized so that the MythUIHelper::Init() can detect X...
QString GetConfDir(void)
Definition: mythdirs.cpp:224
virtual void Close()
void ApplySettingsOverride(void)
Apply all overrides to the global context.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
void PerformSearch(const QString &sST, uint timeout_secs=2)
Definition: ssdp.cpp:206
#define GENERIC_EXIT_DB_NOTIMEZONE
Missing DB time zone support.
Definition: exitcodes.h:36
bool Create(void) override
Definition: osd.cpp:46
void OverrideSettingForSession(const QString &key, const QString &value)
QString GetSetting(const QString &key, const QString &defaultval="")
QString toString(const QString &key) const
Returns stored QVariant as a QString, falling to default if not provided.
static void ParseGeometryOverride(const QString &geometry)
Parse an X11 style command line geometry string.
static void load(const QString &module_name)
Load a QTranslator for the user's preferred language.
static void Done(void)
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:1249
static void SetHandler(int signum, SigHandlerFunc handler)
MythCommFlagCommandLineParser cmdline
static bool prompt(bool force=false)
Ask the user for the language to use.
StartPrompter * startPrompt
MythUIHelper * GetMythUI()
static void reload()
Reload all active translators based on the current language setting.
MythMainWindow * GetMythMainWindow(void)
static QString GetVideoDevice(uint inputid)
Definition: cardutil.h:273
#define FALLBACK_UI_THEME
Definition: mythuihelper.h:13
static int reloadTheme(void)
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
Themed menu class, used for main menus in MythTV frontend.
bool Create(void) override
static SSDP * Instance()
Definition: ssdp.cpp:54
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
#define SIGHUP
Definition: compat.h:213
void SetEffectsEnabled(bool enable)
ServiceRequirements
#define MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
Definition: mythversion.h:16
bool foundTheme(void)
Returns true iff a theme has been found by a previous call to SetMenuTheme().
An editor for MythSystemEvent handler commands.
ExitPrompter * exitPrompt
ScanDTVTransportList LoadScan(uint scanid)
Definition: scaninfo.cpp:72
#define QT_PAINTER
Definition: mythuidefines.h:2
static uint GetSourceID(uint inputid)
Definition: cardutil.cpp:1730
static QString GetRawInputType(uint inputid)
Definition: cardutil.h:271
#define setenv(x, y, z)
Definition: compat.h:156
bool Init(const bool gui=true, const bool promptForBackend=false, const bool disableAutoDiscovery=false, const bool ignoreDB=false)
#define GENERIC_EXIT_NO_THEME
No Theme available.
Definition: exitcodes.h:14
int ConfigureLogging(QString mask="general", unsigned int progress=0)
Read in logging options and initialize the logging interface.
MythDB * GetMythDB(void)
Definition: mythdb.cpp:46
#define GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.
Definition: exitcodes.h:13
static QString logfile
#define GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
Definition: exitcodes.h:15
Scans the transport when there is no tuner (for ASI)
#define GENERIC_EXIT_NOT_OK
Exited with error.
Definition: exitcodes.h:11
uint toUInt(const QString &key) const
Returns stored QVariant as an unsigned integer, falling to default if not provided.
void ReinitDone(void)
void ReloadKeys(void)
static void cleanup()
void PrintVersion(void) const
Print application version information.
Default UTC.
Definition: mythdate.h:14
static bool RunMenu(const QString &themedir, const QString &themename)
bool InitializeMythSchema(void)
command to get the the initial database layout from an empty database:
static bool CheckTimeZoneSupport(void)
Check if MySQL has working timz zone support.
Definition: dbutil.cpp:868
#define GENERIC_EXIT_DB_OUTOFDATE
Database needs upgrade.
Definition: exitcodes.h:16
void Process(const ScanDTVTransportList &, int sourceid=-1)