Go to the documentation of this file.
10 #include <QGuiApplication>
34 m_updateStatusTimer(new QTimer(this)),
35 m_updateScreenTimer(new QTimer(this))
72 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'welcome_screen'");
99 if (!startFECmd.contains(
"platform"))
100 args << QString(
"--platform %1").arg(QGuiApplication::platformName());
121 QString command =
m_appBinDir +
"mythshutdown --startup";
125 LOG(VB_GENERAL, LOG_NOTICE,
126 QString(
"mythshutdown --startup returned: %1").arg(state));
130 if (state == 1 && bAutoStartFrontend)
145 if (me->Message().startsWith(
"RECORDING_LIST_CHANGE") ||
146 me->Message() ==
"UPDATE_PROG_INFO")
148 LOG(VB_GENERAL, LOG_NOTICE,
149 "MythWelcome received a recording list change event");
155 LOG(VB_GENERAL, LOG_NOTICE,
156 " [deferred to pending handler]");
165 else if (me->Message().startsWith(
"SCHEDULE_CHANGE"))
167 LOG(VB_GENERAL, LOG_NOTICE,
168 "MythWelcome received a SCHEDULE_CHANGE event");
174 LOG(VB_GENERAL, LOG_NOTICE,
175 " [deferred to pending handler]");
183 else if (me->Message().startsWith(
"SHUTDOWN_COUNTDOWN"))
186 LOG(VB_GENERAL, LOG_NOTICE,
187 "MythWelcome received a SHUTDOWN_COUNTDOWN event");
189 QString secs = me->Message().mid(19);
194 else if (me->Message().startsWith(
"SHUTDOWN_NOW"))
196 LOG(VB_GENERAL, LOG_NOTICE,
197 "MythWelcome received a SHUTDOWN_NOW event");
204 LOG(VB_GENERAL, LOG_NOTICE,
205 "MythWelcome is shutting this computer down now");
207 if (!poweroff_cmd.isEmpty())
233 for (
int i = 0; i < actions.size() && !handled; i++)
235 const QString&
action = actions[i];
246 else if (
action ==
"NEXTVIEW")
250 else if (
action ==
"INFO")
254 else if (
action ==
"SHOWSETTINGS")
260 QString mythshutdown_status =
262 QString mythshutdown_unlock =
264 QString mythshutdown_lock =
271 if (!(statusCode & 0xFF00) && statusCode & 16)
283 else if (
action ==
"STARTXTERM")
289 else if (
action ==
"STARTSETUP")
291 QString mythtv_setup =
m_appBinDir +
"mythtv-setup";
356 status = tr(
"Tuner %1 is recording:").arg(tuner.
id);
359 status +=
"\n" + tuner.
title;
364 tr(
"%1 to %2",
"Time period, 'starttime to endtime'")
370 status = tr(
"There are no recordings currently taking place");
384 progInfo.
ToMap(infomap);
388 status = infomap[
"channame"] +
"\n";
389 status += infomap[
"title"];
390 if (!infomap[
"subtitle"].isEmpty())
391 status +=
"\n(" + infomap[
"subtitle"] +
")";
393 status +=
"\n" + infomap[
"timedate"];
402 status = tr(
"There are no scheduled recordings");
410 status = tr(
"Please Wait...");
441 command = QString(
"%1 %2").arg(mfpath, mfarg);
446 LOG(VB_GENERAL, LOG_INFO, QString(
"Grabbing EPG data using command: %1\n")
516 m_statusList.append(tr(
"MythTV is about to start recording."));
524 QString mythshutdown_status =
m_appBinDir +
"mythshutdown --status 0";
527 if (!(statusCode & 0xFF00))
532 m_statusList.append(tr(
"MythTV is busy flagging commercials."));
534 m_statusList.append(tr(
"MythTV is busy grabbing EPG data."));
538 m_statusList.append(tr(
"MythTV has running or pending jobs."));
540 m_statusList.append(tr(
"MythTV is in a daily wakeup/shutdown period."));
541 if (statusCode & 128)
542 m_statusList.append(tr(
"MythTV is about to start a wakeup/shutdown period."));
549 m_statusList.append(tr(
"MythTV is idle and will shutdown in %n "
601 QString mythshutdown_status =
m_appBinDir +
"mythshutdown --status 0";
604 if (!(statusCode & 0xFF00) && statusCode & 16)
617 QString command =
m_appBinDir +
"mythshutdown --lock";
626 QString command =
m_appBinDir +
"mythshutdown --unlock";
646 LOG(VB_GENERAL, LOG_INFO,
647 "MythWelcome is shutting this computer down now");
649 if (!poweroff_cmd.isEmpty())
657 ShowOkPopup(tr(
"Cannot shutdown because MythTV is currently recording"));
668 ShowOkPopup(tr(
"Cannot shutdown because MythTV is about to start recording"));
673 QString command =
m_appBinDir +
"mythshutdown --status 0";
677 if (!(statusCode & 0xFF00) && statusCode & 128)
679 ShowOkPopup(tr(
"Cannot shutdown because MythTV is about to start "
680 "a wakeup/shutdown period."));
691 restarttime = restarttime.addSecs((-1LL) * add);
696 "echo \'Wakeuptime would "
697 "be $time if command "
700 if (wakeup_timeformat ==
"time_t")
703 setwakeup_cmd.replace(
"$time",
704 time_ts.setNum(restarttime.toSecsSinceEpoch())
709 setwakeup_cmd.replace(
710 "$time", restarttime.toLocalTime().toString(wakeup_timeformat));
713 if (!setwakeup_cmd.isEmpty())
MythScreenStack * GetMainStack()
void SetReturnEvent(QObject *retobject, const QString &resultid)
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
static const Type kMythEventMessage
@ kMSDontBlockInputDevs
avoid blocking LIRC & Joystick Menu
bool IsFrontendOnly(void)
is there a frontend, but no backend, running on this host
This class is used as a container for messages.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Screen in which all other widgets are contained and rendered.
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
bool SafeConnectToMasterServer(bool blockingClient=true, bool openEventSocket=true)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
MythUIType * GetFocusWidget(void) const
QHash< QString, QString > InfoMap
void addListener(QObject *listener)
Add a listener to the observable.
bool IsConnectedToMaster(void)
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
int RemoteGetRecordingStatus(const ProgramInfo *pginfo, int overrecsecs, int underrecsecs)
Get status of an individual programme (with pre-post roll?).
bool SetFocusWidget(MythUIType *widget=nullptr)
void AddButton(const QString &title)
Basic menu dialog, message and a list of options.
bool Create(void) override
std::enable_if_t< std::chrono::__is_duration< T >::value, T > GetDurSetting(const QString &key, T defaultval=T::zero())
void BuildFocusList(void)
virtual void ToMap(InfoMap &progMap, bool showrerecord=false, uint star_range=10, uint date_format=0) const
Converts ProgramInfo into QString QHash containing each field in ProgramInfo converted into localized...
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
int GetNumSetting(const QString &key, int defaultval=0)
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
bool GetBoolSetting(const QString &key, bool defaultval=false)
@ kMSDisableUDPListener
disable MythMessage UDP listener for the duration of application.
Holds information on recordings and videos.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
bool GetNextRecordingList(QDateTime &nextRecordingStart, bool *hasConflicts, std::vector< ProgramInfo > *list)
@ kMSProcessEvents
process events while waiting
virtual void SetText(const QString &text)
virtual void SetVisible(bool visible)
QString GetAppBinDir(void)
MythMainWindow * GetMythMainWindow(void)
MythScreenStack * GetStack(const QString &Stackname)
@ kTime
Default local time.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
void removeListener(QObject *listener)
Remove a listener to the observable.
QString GetSetting(const QString &key, const QString &defaultval="")