MythTV  master
welcomedialog.cpp
Go to the documentation of this file.
1 // ANSI C
2 #include <cstdlib>
3 
4 // POSIX
5 #include <unistd.h>
6 
7 // qt
8 #include <QCoreApplication>
9 #include <QKeyEvent>
10 #include <QEvent>
11 
12 // myth
13 #include "exitcodes.h"
14 #include "mythcontext.h"
15 #include "mythdbcon.h"
16 #include "lcddevice.h"
17 #include "tv.h"
18 #include "compat.h"
19 #include "mythdirs.h"
20 #include "remoteutil.h"
21 #include "mythsystemlegacy.h"
22 
23 #include "welcomedialog.h"
24 #include "welcomesettings.h"
25 
26 #define UPDATE_STATUS_INTERVAL 30000
27 #define UPDATE_SCREEN_INTERVAL 15000
28 
29 
31  :MythScreenType(parent, name),
32  m_status_text(nullptr), m_recording_text(nullptr), m_scheduled_text(nullptr),
33  m_warning_text(nullptr), m_startfrontend_button(nullptr),
34  m_menuPopup(nullptr), m_updateStatusTimer(new QTimer(this)),
35  m_updateScreenTimer(new QTimer(this)), m_isRecording(false),
36  m_hasConflicts(false), m_bWillShutdown(false),
37  m_secondsToShutdown(-1), m_preRollSeconds(0), m_idleWaitForRecordingTime(0),
38  m_idleTimeoutSecs(0), m_screenTunerNo(0), m_screenScheduledNo(0),
39  m_statusListNo(0), m_frontendIsRunning(false),
40  m_pendingRecListUpdate(false), m_pendingSchedUpdate(false)
41 {
43 
45  m_preRollSeconds = gCoreContext->GetNumSetting("RecordPreRoll");
47  gCoreContext->GetNumSetting("idleWaitForRecordingTime", 15);
48 
49  // if idleTimeoutSecs is 0, the user disabled the auto-shutdown feature
50  m_bWillShutdown = (gCoreContext->GetNumSetting("idleTimeoutSecs", 0) != 0);
51 
52  m_idleTimeoutSecs = gCoreContext->GetNumSetting("idleTimeoutSecs", 0);
53 
54  connect(m_updateStatusTimer, SIGNAL(timeout()),
55  this, SLOT(updateStatus()));
57 
58  connect(m_updateScreenTimer, SIGNAL(timeout()),
59  this, SLOT(updateScreen()));
60 }
61 
63 {
64  // Load the theme for this screen
65  bool foundtheme = LoadWindowFromXML("welcome-ui.xml", "welcome_screen", this);
66  if (!foundtheme)
67  return false;
68 
69  bool err = false;
70  UIUtilE::Assign(this, m_status_text, "status_text", &err);
71  UIUtilE::Assign(this, m_recording_text, "recording_text", &err);
72  UIUtilE::Assign(this, m_scheduled_text, "scheduled_text", &err);
73  UIUtilE::Assign(this, m_warning_text, "conflicts_text", &err);
74  UIUtilE::Assign(this, m_startfrontend_button, "startfrontend_button", &err);
75 
76  if (err)
77  {
78  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'welcome_screen'");
79  return false;
80  }
81 
82  m_warning_text->SetVisible(false);
83 
84  m_startfrontend_button->SetText(tr("Start Frontend"));
85  connect(m_startfrontend_button, SIGNAL(Clicked()),
86  this, SLOT(startFrontendClick()));
87 
89 
91 
94 
95  return true;
96 }
97 
99 {
100  QString startFECmd = gCoreContext->GetSetting("MythWelcomeStartFECmd",
101  m_appBinDir + "mythfrontend");
102 
104  updateAll();
105  m_frontendIsRunning = false;
106 }
107 
109 {
111  return;
112 
113  m_frontendIsRunning = true;
114 
115  // this makes sure the button appears to click properly
116  QTimer::singleShot(500, this, SLOT(startFrontend()));
117 }
118 
120 {
121  // mythshutdown --startup returns 0 for automatic startup
122  // 1 for manual startup
123  QString command = m_appBinDir + "mythshutdown --startup";
124  command += logPropagateArgs;
125  uint state = myth_system(command, kMSDontBlockInputDevs);
126 
127  LOG(VB_GENERAL, LOG_NOTICE,
128  QString("mythshutdown --startup returned: %1").arg(state));
129 
130  bool bAutoStartFrontend = gCoreContext->GetBoolSetting("AutoStartFrontend", true);
131 
132  if (state == 1 && bAutoStartFrontend)
134 
135  // update status now
136  updateAll();
137 }
138 
140 {
141  if (e->type() == MythEvent::MythEventMessage)
142  {
143  MythEvent *me = static_cast<MythEvent *>(e);
144 
145  if (me->Message().startsWith("RECORDING_LIST_CHANGE") ||
146  me->Message() == "UPDATE_PROG_INFO")
147  {
148  LOG(VB_GENERAL, LOG_NOTICE,
149  "MythWelcome received a recording list change event");
150 
151  QMutexLocker lock(&m_RecListUpdateMuxtex);
152 
153  if (pendingRecListUpdate())
154  {
155  LOG(VB_GENERAL, LOG_NOTICE,
156  " [deferred to pending handler]");
157  }
158  else
159  {
160  // we can't query the backend from inside a customEvent
161  QTimer::singleShot(500, this, SLOT(updateRecordingList()));
163  }
164  }
165  else if (me->Message().startsWith("SCHEDULE_CHANGE"))
166  {
167  LOG(VB_GENERAL, LOG_NOTICE,
168  "MythWelcome received a SCHEDULE_CHANGE event");
169 
170  QMutexLocker lock(&m_SchedUpdateMuxtex);
171 
172  if (pendingSchedUpdate())
173  {
174  LOG(VB_GENERAL, LOG_NOTICE,
175  " [deferred to pending handler]");
176  }
177  else
178  {
179  QTimer::singleShot(500, this, SLOT(updateScheduledList()));
180  setPendingSchedUpdate(true);
181  }
182  }
183  else if (me->Message().startsWith("SHUTDOWN_COUNTDOWN"))
184  {
185 #if 0
186  LOG(VB_GENERAL, LOG_NOTICE,
187  "MythWelcome received a SHUTDOWN_COUNTDOWN event");
188 #endif
189  QString secs = me->Message().mid(19);
190  m_secondsToShutdown = secs.toInt();
192  updateScreen();
193  }
194  else if (me->Message().startsWith("SHUTDOWN_NOW"))
195  {
196  LOG(VB_GENERAL, LOG_NOTICE,
197  "MythWelcome received a SHUTDOWN_NOW event");
199  {
200  // does the user want to shutdown this frontend only machine
201  // when the BE shuts down?
202  if (gCoreContext->GetNumSetting("ShutdownWithMasterBE", 0) == 1)
203  {
204  LOG(VB_GENERAL, LOG_NOTICE,
205  "MythWelcome is shutting this computer down now");
206  QString poweroff_cmd = gCoreContext->GetSetting("MythShutdownPowerOff", "");
207  if (!poweroff_cmd.isEmpty())
208  myth_system(poweroff_cmd, kMSDontBlockInputDevs);
209  }
210  }
211  }
212  }
213 }
214 
216 {
218  StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "settings",
219  screen);
220  if (ssd->Create())
221  mainStack->AddScreen(ssd);
222  else
223  delete ssd;
224 }
225 
226 bool WelcomeDialog::keyPressEvent(QKeyEvent *event)
227 {
228  if (GetFocusWidget()->keyPressEvent(event))
229  return true;
230 
231  QStringList actions;
232  bool handled = GetMythMainWindow()->TranslateKeyPress("Welcome", event, actions);
233 
234  for (int i = 0; i < actions.size() && !handled; i++)
235  {
236  QString action = actions[i];
237  handled = true;
238 
239  if (action == "ESCAPE")
240  {
241  return true; // eat escape key
242  }
243  if (action == "MENU")
244  {
245  ShowMenu();
246  }
247  else if (action == "NEXTVIEW")
248  {
249  Close();
250  }
251  else if (action == "INFO")
252  {
254  }
255  else if (action == "SHOWSETTINGS")
256  {
258  }
259  else if (action == "0")
260  {
261  QString mythshutdown_status =
262  m_appBinDir + "mythshutdown --status 0";
263  QString mythshutdown_unlock =
264  m_appBinDir + "mythshutdown --unlock";
265  QString mythshutdown_lock =
266  m_appBinDir + "mythshutdown --lock";
267 
268  uint statusCode;
269  statusCode = myth_system(mythshutdown_status + logPropagateArgs, kMSDontBlockInputDevs);
270 
271  // is shutdown locked by a user
272  if (!(statusCode & 0xFF00) && statusCode & 16)
273  {
274  myth_system(mythshutdown_unlock + logPropagateArgs, kMSDontBlockInputDevs);
275  }
276  else
277  {
278  myth_system(mythshutdown_lock + logPropagateArgs, kMSDontBlockInputDevs);
279  }
280 
282  updateScreen();
283  }
284  else if (action == "STARTXTERM")
285  {
286  QString cmd = gCoreContext->GetSetting("MythShutdownXTermCmd", "");
287  if (!cmd.isEmpty())
289  }
290  else if (action == "STARTSETUP")
291  {
292  QString mythtv_setup = m_appBinDir + "mythtv-setup";
293  myth_system(mythtv_setup + logPropagateArgs);
294  }
295  else
296  handled = false;
297  }
298 
299  if (!handled && MythScreenType::keyPressEvent(event))
300  handled = true;
301 
302  return handled;
303 }
304 
306 {
307  Close();
308 }
309 
311 {
313 
315  m_updateStatusTimer->disconnect();
316 
318  m_updateScreenTimer->disconnect();
319 }
320 
322 {
324 
326 }
327 
329 {
330  QString status;
331 
333  {
334  m_recording_text->SetText(tr("Cannot connect to server!"));
335  m_scheduled_text->SetText(tr("Cannot connect to server!"));
336  m_warning_text->SetVisible(false);
337  }
338  else
339  {
340  // update recording
341  if (m_isRecording && !m_tunerList.empty())
342  {
344 
345  do
346  {
347  if (m_screenTunerNo < m_tunerList.size() - 1)
348  m_screenTunerNo++;
349  else
350  m_screenTunerNo = 0;
351  tuner = m_tunerList[m_screenTunerNo];
352  }
353  while (!tuner.isRecording);
354 
355  status = tr("Tuner %1 is recording:").arg(tuner.id);
356  status += "\n";
357  status += tuner.channame;
358  status += "\n" + tuner.title;
359  if (!tuner.subtitle.isEmpty())
360  status += "\n("+tuner.subtitle+")";
361 
362  status += "\n" +
363  tr("%1 to %2", "Time period, 'starttime to endtime'")
366  }
367  else
368  status = tr("There are no recordings currently taking place");
369 
370  m_recording_text->SetText(status);
371 
372  // update scheduled
373  if (!m_scheduledList.empty())
374  {
375  if (m_screenScheduledNo >= m_scheduledList.size())
377 
379 
380  InfoMap infomap;
381  progInfo.ToMap(infomap);
382 
383  //status = QString("%1 of %2\n").arg(m_screenScheduledNo + 1)
384  // .arg(m_scheduledList.size());
385  status = infomap["channame"] + "\n";
386  status += infomap["title"];
387  if (!infomap["subtitle"].isEmpty())
388  status += "\n(" + infomap["subtitle"] + ")";
389 
390  status += "\n" + infomap["timedate"];
391 
392  if (m_screenScheduledNo < m_scheduledList.size() - 1)
394  else
396  }
397  else
398  status = tr("There are no scheduled recordings");
399 
400  m_scheduled_text->SetText(status);
401  }
402 
403  // update status message
404  if (m_statusList.empty())
405  status = tr("Please Wait...");
406  else
407  {
408  if ((int)m_statusListNo >= m_statusList.count())
409  m_statusListNo = 0;
410 
411  status = m_statusList[m_statusListNo];
412  if (m_statusList.count() > 1)
413  status += "...";
414  m_status_text->SetText(status);
415 
416  if ((int)m_statusListNo < m_statusList.count() - 1)
417  m_statusListNo++;
418  else
419  m_statusListNo = 0;
420  }
421 
422  m_updateScreenTimer->stop();
423  m_updateScreenTimer->setSingleShot(true);
425 }
426 
427 // taken from housekeeper.cpp
429 {
430  QString command;
431 
432  QString mfpath = gCoreContext->GetSetting("MythFillDatabasePath",
433  "mythfilldatabase");
434  QString mfarg = gCoreContext->GetSetting("MythFillDatabaseArgs", "");
435 
436  command = QString("%1 %2").arg(mfpath).arg(mfarg);
437  command += logPropagateArgs;
438 
439  command += "&";
440 
441  LOG(VB_GENERAL, LOG_INFO, QString("Grabbing EPG data using command: %1\n")
442  .arg(command));
443 
445 }
446 
448 {
451 }
452 
454 {
455  {
456  // clear pending flag early in case something happens while
457  // we're updating
458  QMutexLocker lock(&m_RecListUpdateMuxtex);
460  }
461 
462  m_tunerList.clear();
463  m_isRecording = false;
464  m_screenTunerNo = 0;
465 
467  return false;
468 
470 
471  return true;
472 }
473 
475 {
476  {
477  // clear pending flag early in case something happens while
478  // we're updating
479  QMutexLocker lock(&m_SchedUpdateMuxtex);
480  setPendingSchedUpdate(false);
481  }
482 
483  m_scheduledList.clear();
485 
487  {
489  return false;
490  }
491 
493  &m_scheduledList);
494 
495  updateStatus();
496  updateScreen();
497 
498  return true;
499 }
500 
502 {
503  m_statusList.clear();
504 
505  QDateTime curtime = MythDate::current();
506 
507  if (!m_isRecording && !m_nextRecordingStart.isNull() &&
508  curtime.secsTo(m_nextRecordingStart) - m_preRollSeconds <
510  {
511  m_statusList.append(tr("MythTV is about to start recording."));
512  }
513 
514  if (m_isRecording)
515  {
516  m_statusList.append(tr("MythTV is busy recording."));
517  }
518 
519  QString mythshutdown_status = m_appBinDir + "mythshutdown --status 0";
520  uint statusCode = myth_system(mythshutdown_status + logPropagateArgs, kMSDontBlockInputDevs);
521 
522  if (!(statusCode & 0xFF00))
523  {
524  if (statusCode & 1)
525  m_statusList.append(tr("MythTV is busy transcoding."));
526  if (statusCode & 2)
527  m_statusList.append(tr("MythTV is busy flagging commercials."));
528  if (statusCode & 4)
529  m_statusList.append(tr("MythTV is busy grabbing EPG data."));
530  if (statusCode & 16)
531  m_statusList.append(tr("MythTV is locked by a user."));
532  if (statusCode & 32)
533  m_statusList.append(tr("MythTV has running or pending jobs."));
534  if (statusCode & 64)
535  m_statusList.append(tr("MythTV is in a daily wakeup/shutdown period."));
536  if (statusCode & 128)
537  m_statusList.append(tr("MythTV is about to start a wakeup/shutdown period."));
538  }
539 
540  if (m_statusList.empty())
541  {
543  m_statusList.append(tr("MythTV is idle and will shutdown in %n "
544  "second(s).", "", m_secondsToShutdown));
545  else
546  m_statusList.append(tr("MythTV is idle."));
547  }
548 
550 }
551 
553 {
554  m_updateStatusTimer->stop();
555 
556  bool bRes = false;
557 
559  bRes = true;
560  else
561  {
563  {
564  bRes = true;
565  updateAll();
566  }
567  else
568  updateScreen();
569  }
570 
571  if (bRes)
573  else
574  m_updateStatusTimer->start(5000);
575 
576  return bRes;
577 }
578 
580 {
581  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
582 
583  m_menuPopup = new MythDialogBox("Menu", popupStack, "actionmenu");
584 
585  if (m_menuPopup->Create())
586  popupStack->AddScreen(m_menuPopup);
587 
588  m_menuPopup->SetReturnEvent(this, "action");
589 
590  QString mythshutdown_status = m_appBinDir + "mythshutdown --status 0";
591  uint statusCode = myth_system(mythshutdown_status + logPropagateArgs, kMSDontBlockInputDevs);
592 
593  if (!(statusCode & 0xFF00) && statusCode & 16)
594  m_menuPopup->AddButton(tr("Unlock Shutdown"), SLOT(unlockShutdown()));
595  else
596  m_menuPopup->AddButton(tr("Lock Shutdown"), SLOT(lockShutdown()));
597 
598  m_menuPopup->AddButton(tr("Run mythfilldatabase"), SLOT(runEPGGrabber()));
599  m_menuPopup->AddButton(tr("Shutdown Now"), SLOT(shutdownNow()));
600  m_menuPopup->AddButton(tr("Exit"), SLOT(closeDialog()));
601  m_menuPopup->AddButton(tr("Cancel"));
602 }
603 
605 {
606  QString command = m_appBinDir + "mythshutdown --lock";
607  command += logPropagateArgs;
610  updateScreen();
611 }
612 
614 {
615  QString command = m_appBinDir + "mythshutdown --unlock";
616  command += logPropagateArgs;
619  updateScreen();
620 }
621 
623 {
625  sleep(1);
627  updateScreen();
628 }
629 
631 {
632  // if this is a frontend only machine just shut down now
634  {
635  LOG(VB_GENERAL, LOG_INFO,
636  "MythWelcome is shutting this computer down now");
637  QString poweroff_cmd = gCoreContext->GetSetting("MythShutdownPowerOff", "");
638  if (!poweroff_cmd.isEmpty())
639  myth_system(poweroff_cmd, kMSDontBlockInputDevs);
640  return;
641  }
642 
643  // don't shutdown if we are recording
644  if (m_isRecording)
645  {
646  ShowOkPopup(tr("Cannot shutdown because MythTV is currently recording"));
647  return;
648  }
649 
650  QDateTime curtime = MythDate::current();
651 
652  // don't shutdown if we are about to start recording
653  if (!m_nextRecordingStart.isNull() &&
654  curtime.secsTo(m_nextRecordingStart) - m_preRollSeconds <
656  {
657  ShowOkPopup(tr("Cannot shutdown because MythTV is about to start recording"));
658  return;
659  }
660 
661  // don't shutdown if we are about to start a wakeup/shutdown period
662  QString command = m_appBinDir + "mythshutdown --status 0";
663  command += logPropagateArgs;
664 
665  uint statusCode = myth_system(command, kMSDontBlockInputDevs);
666  if (!(statusCode & 0xFF00) && statusCode & 128)
667  {
668  ShowOkPopup(tr("Cannot shutdown because MythTV is about to start "
669  "a wakeup/shutdown period."));
670  return;
671  }
672 
673  // set the wakeup time for the next scheduled recording
674  if (!m_nextRecordingStart.isNull())
675  {
676  QDateTime restarttime = m_nextRecordingStart.addSecs((-1) * m_preRollSeconds);
677 
678  int add = gCoreContext->GetNumSetting("StartupSecsBeforeRecording", 240);
679  if (add)
680  restarttime = restarttime.addSecs((-1) * add);
681 
682  QString wakeup_timeformat = gCoreContext->GetSetting("WakeupTimeFormat",
683  "yyyy-MM-ddThh:mm");
684  QString setwakeup_cmd = gCoreContext->GetSetting("SetWakeuptimeCommand",
685  "echo \'Wakeuptime would "
686  "be $time if command "
687  "set.\'");
688 
689  if (wakeup_timeformat == "time_t")
690  {
691  QString time_ts;
692  setwakeup_cmd.replace("$time",
693 #if QT_VERSION < QT_VERSION_CHECK(5,8,0)
694  time_ts.setNum(restarttime.toTime_t())
695 #else
696  time_ts.setNum(restarttime.toSecsSinceEpoch())
697 #endif
698  );
699  }
700  else
701  setwakeup_cmd.replace(
702  "$time", restarttime.toLocalTime().toString(wakeup_timeformat));
703 
704  if (!setwakeup_cmd.isEmpty())
705  {
706  myth_system(setwakeup_cmd, kMSDontBlockInputDevs);
707  }
708  }
709 
710  // run command to set wakeuptime in bios and shutdown the system
711  command = QString();
712 
713 #ifndef _WIN32
714  command = "sudo ";
715 #endif
716 
717  command += m_appBinDir + "mythshutdown --shutdown" + logPropagateArgs;
718 
720 }
721 
bool updateScheduledList(void)
virtual void ToMap(InfoMap &progMap, bool showrerecord=false, uint star_range=10) const
Converts ProgramInfo into QString QHash containing each field in ProgramInfo converted into localized...
QDateTime endTime
Definition: tvremoteutil.h:26
uint m_screenScheduledNo
Definition: welcomedialog.h:82
bool TranslateKeyPress(const QString &context, QKeyEvent *e, QStringList &actions, bool allowJumps=true)
Get a list of actions for a keypress in the given context.
void closeDialog(void)
MythConfirmationDialog * ShowOkPopup(const QString &message, QObject *parent, const char *slot, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
MythUIText * m_warning_text
Definition: welcomedialog.h:63
QDateTime m_nextRecordingStart
Definition: welcomedialog.h:77
static Type MythEventMessage
Definition: mythevent.h:66
void removeListener(QObject *listener)
Remove a listener to the observable.
QString title
Definition: tvremoteutil.h:23
QString m_appBinDir
Definition: welcomedialog.h:72
Basic menu dialog, message and a list of options.
MythUIText * m_status_text
Definition: welcomedialog.h:60
QString logPropagateArgs
Definition: logging.cpp:89
bool GetNextRecordingList(QDateTime &nextRecordingStart, bool *hasConflicts, vector< ProgramInfo > *list)
bool checkConnectionToServer(void)
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:136
int m_idleWaitForRecordingTime
Definition: welcomedialog.h:79
MythScreenStack * GetStack(const QString &stackname)
void updateAll(void)
unsigned int uint
Definition: compat.h:140
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
recording status stuff
Definition: tvremoteutil.h:17
void ShowMenu(void) override
MythScreenStack * GetMainStack()
void addListener(QObject *listener)
Add a listener to the observable.
MythDialogBox * m_menuPopup
Definition: welcomedialog.h:67
bool m_frontendIsRunning
Definition: welcomedialog.h:85
QTimer * m_updateStatusTimer
Definition: welcomedialog.h:69
void BuildFocusList(void)
unsigned sleep(unsigned int x)
Definition: compat.h:159
process events while waiting
Definition: mythsystem.h:37
#define UPDATE_SCREEN_INTERVAL
virtual void Close()
void AddButton(const QString &title, QVariant data=0, bool newMenu=false, bool setCurrent=false)
bool pendingSchedUpdate() const
Definition: welcomedialog.h:99
Holds information on recordings and videos.
Definition: programinfo.h:66
virtual void SetVisible(bool visible)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
MythUIText * m_scheduled_text
Definition: welcomedialog.h:62
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
This class is used as a container for messages.
Definition: mythevent.h:16
bool IsConnectedToMaster(void)
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
MythUIText * m_recording_text
Definition: welcomedialog.h:61
Default local time.
Definition: mythdate.h:19
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
QString GetAppBinDir(void)
Definition: mythdirs.cpp:221
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
QString GetSetting(const QString &key, const QString &defaultval="")
QString channame
Definition: tvremoteutil.h:22
vector< TunerStatus > m_tunerList
Definition: welcomedialog.h:87
QMutex m_SchedUpdateMuxtex
Definition: welcomedialog.h:96
QStringList m_statusList
Definition: welcomedialog.h:84
WelcomeDialog(MythScreenStack *parent, const char *name)
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
void setPendingSchedUpdate(bool newState)
void updateScreen(void)
const char * name
Definition: ParseText.cpp:328
uint myth_system(const QString &command, uint flags, uint timeout)
void startFrontend(void)
vector< ProgramInfo > m_scheduledList
Definition: welcomedialog.h:88
disable MythMessage UDP listener for the duration of application.
Definition: mythsystem.h:48
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:101
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
MythUIType * GetFocusWidget(void) const
void checkAutoStart(void)
MythMainWindow * GetMythMainWindow(void)
uint m_screenTunerNo
Definition: welcomedialog.h:81
void updateStatus(void)
#define UPDATE_STATUS_INTERVAL
int GetNumSetting(const QString &key, int defaultval=0)
void updateStatusMessage(void)
bool keyPressEvent(QKeyEvent *) override
Key event handler.
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
bool Create(void) override
MythUIButton * m_startfrontend_button
Definition: welcomedialog.h:65
void runMythFillDatabase(void)
bool GetBoolSetting(const QString &key, bool defaultval=false)
bool isRecording
Definition: tvremoteutil.h:21
void SetReturnEvent(QObject *retobject, const QString &resultid)
bool pendingRecListUpdate() const
Definition: welcomedialog.h:93
void startFrontendClick(void)
QString subtitle
Definition: tvremoteutil.h:24
bool SafeConnectToMasterServer(bool blockingClient=true, bool openEventSocket=true)
void runEPGGrabber(void)
bool m_bWillShutdown
Definition: welcomedialog.h:75
void setPendingRecListUpdate(bool newState)
Definition: welcomedialog.h:94
bool SetFocusWidget(MythUIType *widget=nullptr)
bool IsFrontendOnly(void)
is there a frontend, but no backend, running on this host
QMutex m_RecListUpdateMuxtex
Definition: welcomedialog.h:90
Screen in which all other widgets are contained and rendered.
void unlockShutdown(void)
const QString & Message() const
Definition: mythevent.h:58
int RemoteGetRecordingStatus(const ProgramInfo *pginfo, int overrecsecs, int underrecsecs)
Get status of an individual programme (with pre-post roll?).
Definition: remoteutil.cpp:505
bool Create(void) override
void shutdownNow(void)
int m_secondsToShutdown
Definition: welcomedialog.h:76
void SetText(const QString &msg)
bool updateRecordingList(void)
void ShowSettings(GroupSetting *screen)
QTimer * m_updateScreenTimer
Definition: welcomedialog.h:70
void customEvent(QEvent *e) override
void lockShutdown(void)
QDateTime startTime
Definition: tvremoteutil.h:25
avoid blocking LIRC & Joystick Menu
Definition: mythsystem.h:34
bool Create(void) override