Go to the documentation of this file.
11 #include <QGuiApplication>
35 m_updateStatusTimer(new QTimer(this)),
36 m_updateScreenTimer(new QTimer(this))
73 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'welcome_screen'");
100 if (!startFECmd.contains(
"platform"))
101 args << QString(
"--platform %1").arg(QGuiApplication::platformName());
122 QString command =
m_appBinDir +
"mythshutdown --startup";
126 LOG(VB_GENERAL, LOG_NOTICE,
127 QString(
"mythshutdown --startup returned: %1").
arg(state));
131 if (state == 1 && bAutoStartFrontend)
146 if (me->Message().startsWith(
"RECORDING_LIST_CHANGE") ||
147 me->Message() ==
"UPDATE_PROG_INFO")
149 LOG(VB_GENERAL, LOG_NOTICE,
150 "MythWelcome received a recording list change event");
156 LOG(VB_GENERAL, LOG_NOTICE,
157 " [deferred to pending handler]");
166 else if (me->Message().startsWith(
"SCHEDULE_CHANGE"))
168 LOG(VB_GENERAL, LOG_NOTICE,
169 "MythWelcome received a SCHEDULE_CHANGE event");
175 LOG(VB_GENERAL, LOG_NOTICE,
176 " [deferred to pending handler]");
184 else if (me->Message().startsWith(
"SHUTDOWN_COUNTDOWN"))
187 LOG(VB_GENERAL, LOG_NOTICE,
188 "MythWelcome received a SHUTDOWN_COUNTDOWN event");
190 QString secs = me->Message().mid(19);
195 else if (me->Message().startsWith(
"SHUTDOWN_NOW"))
197 LOG(VB_GENERAL, LOG_NOTICE,
198 "MythWelcome received a SHUTDOWN_NOW event");
205 LOG(VB_GENERAL, LOG_NOTICE,
206 "MythWelcome is shutting this computer down now");
208 if (!poweroff_cmd.isEmpty())
234 for (
int i = 0; i < actions.size() && !handled; i++)
236 QString
action = actions[i];
247 else if (
action ==
"NEXTVIEW")
251 else if (
action ==
"INFO")
255 else if (
action ==
"SHOWSETTINGS")
261 QString mythshutdown_status =
263 QString mythshutdown_unlock =
265 QString mythshutdown_lock =
272 if (!(statusCode & 0xFF00) && statusCode & 16)
284 else if (
action ==
"STARTXTERM")
290 else if (
action ==
"STARTSETUP")
292 QString mythtv_setup =
m_appBinDir +
"mythtv-setup";
355 status = tr(
"Tuner %1 is recording:").arg(tuner.
id);
358 status +=
"\n" + tuner.
title;
363 tr(
"%1 to %2",
"Time period, 'starttime to endtime'")
368 status = tr(
"There are no recordings currently taking place");
381 progInfo.
ToMap(infomap);
385 status = infomap[
"channame"] +
"\n";
386 status += infomap[
"title"];
387 if (!infomap[
"subtitle"].isEmpty())
388 status +=
"\n(" + infomap[
"subtitle"] +
")";
390 status +=
"\n" + infomap[
"timedate"];
398 status = tr(
"There are no scheduled recordings");
405 status = tr(
"Please Wait...");
436 command = QString(
"%1 %2").arg(mfpath).arg(mfarg);
441 LOG(VB_GENERAL, LOG_INFO, QString(
"Grabbing EPG data using command: %1\n")
511 m_statusList.append(tr(
"MythTV is about to start recording."));
519 QString mythshutdown_status =
m_appBinDir +
"mythshutdown --status 0";
522 if (!(statusCode & 0xFF00))
527 m_statusList.append(tr(
"MythTV is busy flagging commercials."));
529 m_statusList.append(tr(
"MythTV is busy grabbing EPG data."));
533 m_statusList.append(tr(
"MythTV has running or pending jobs."));
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."));
544 m_statusList.append(tr(
"MythTV is idle and will shutdown in %n "
594 QString mythshutdown_status =
m_appBinDir +
"mythshutdown --status 0";
597 if (!(statusCode & 0xFF00) && statusCode & 16)
610 QString command =
m_appBinDir +
"mythshutdown --lock";
619 QString command =
m_appBinDir +
"mythshutdown --unlock";
639 LOG(VB_GENERAL, LOG_INFO,
640 "MythWelcome is shutting this computer down now");
642 if (!poweroff_cmd.isEmpty())
650 ShowOkPopup(tr(
"Cannot shutdown because MythTV is currently recording"));
661 ShowOkPopup(tr(
"Cannot shutdown because MythTV is about to start recording"));
666 QString command =
m_appBinDir +
"mythshutdown --status 0";
670 if (!(statusCode & 0xFF00) && statusCode & 128)
672 ShowOkPopup(tr(
"Cannot shutdown because MythTV is about to start "
673 "a wakeup/shutdown period."));
684 restarttime = restarttime.addSecs((-1) * add);
689 "echo \'Wakeuptime would "
690 "be $time if command "
693 if (wakeup_timeformat ==
"time_t")
696 setwakeup_cmd.replace(
"$time",
697 time_ts.setNum(restarttime.toSecsSinceEpoch())
701 setwakeup_cmd.replace(
702 "$time", restarttime.toLocalTime().toString(wakeup_timeformat));
704 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 Type MythEventMessage
@ 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.
arg(title).arg(filename).arg(doDelete))
bool GetNextRecordingList(QDateTime &nextRecordingStart, bool *hasConflicts, vector< ProgramInfo > *list)
#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)
unsigned sleep(unsigned int x)
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)
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)
@ kMSProcessEvents
process events while waiting
virtual void SetText(const QString &text)
virtual void SetVisible(bool visible)
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...
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="")