3#if QT_VERSION >= QT_VERSION_CHECK(6,5,0)
4#include <QtSystemDetection>
7#include <QNetworkInterface>
17#include "libmythbase/mythversion.h"
68 strlist <<
"QUERY_IS_ACTIVE_BACKEND";
98 LOG(VB_GENERAL, LOG_ERR,
"StatusBox, theme is missing "
118 item->DisplayState(
"listings",
"icon");
122 item->DisplayState(
"schedule",
"icon");
126 item->DisplayState(
"tuner",
"icon");
130 item->DisplayState(
"jobqueue",
"icon");
134 item->DisplayState(
"decoders",
"icon");
138 item->DisplayState(
"display",
"icon");
142 item->DisplayState(
"render",
"icon");
146 item->DisplayState(
"machine",
"icon");
150 item->DisplayState(
"autoexpire",
"icon");
157 const QString &
help,
158 const QString & detail,
159 const QString & helpdetail,
160 const QString & state,
161 const QString & data)
166 if (detail.isEmpty())
176 if (helpdetail.isEmpty())
188 item->SetFontState(logline.
m_state);
189 item->DisplayState(logline.
m_state,
"status");
190 item->SetText(logline.
m_detail,
"detail");
203 for (
int i = 0; i < actions.size() && !handled; ++i)
205 QString
action = actions[i];
265 currentItem = currentButton->
GetText();
269 if (currentItem == tr(
"Job Queue"))
273 if (jobStatus == JOB_QUEUED)
275 QString message = tr(
"Delete Job?");
280 confirmPopup->SetReturnEvent(
this,
"JobDelete");
281 confirmPopup->SetData(logline.m_data);
283 if (confirmPopup->Create())
286 else if ((jobStatus == JOB_PENDING) ||
287 (jobStatus == JOB_STARTING) ||
288 (jobStatus == JOB_RUNNING) ||
289 (jobStatus == JOB_PAUSED))
291 QString label = tr(
"Job Queue Actions:");
296 if (menuPopup->Create())
299 menuPopup->SetReturnEvent(
this,
"JobModify");
301 QVariant data = QVariant::fromValue(logline.m_data);
303 if (jobStatus == JOB_PAUSED)
304 menuPopup->AddButtonV(tr(
"Resume"), data);
306 menuPopup->AddButtonV(tr(
"Pause"), data);
307 menuPopup->AddButtonV(tr(
"Stop"), data);
308 menuPopup->AddButtonV(tr(
"No Change"), data);
310 else if (jobStatus & JOB_DONE)
312 QString message = tr(
"Requeue Job?");
317 confirmPopup->SetReturnEvent(
this,
"JobRequeue");
318 confirmPopup->SetData(logline.m_data);
320 if (confirmPopup->Create())
324 else if (currentItem == tr(
"AutoExpire List"))
330 QString label = tr(
"AutoExpire Actions:");
335 if (menuPopup->Create())
338 menuPopup->SetReturnEvent(
this,
"AutoExpireManage");
340 menuPopup->AddButtonV(tr(
"Delete Now"), QVariant::fromValue(rec));
343 menuPopup->AddButtonV(tr(
"Move to Default group"),
344 QVariant::fromValue(rec));
348 menuPopup->AddButtonV(tr(
"Undelete"), QVariant::fromValue(rec));
352 menuPopup->AddButtonV(tr(
"Disable AutoExpire"),
353 QVariant::fromValue(rec));
355 menuPopup->AddButtonV(tr(
"No Change"), QVariant::fromValue(rec));
367 QString resultid = dce->GetId();
368 int buttonnum = dce->GetResult();
370 if (resultid ==
"JobDelete")
374 int jobID = dce->GetData().toInt();
380 else if (resultid ==
"JobRequeue")
384 int jobID = dce->GetData().toInt();
389 else if (resultid ==
"JobModify")
391 int jobID = dce->GetData().toInt();
399 else if (buttonnum == 1)
406 else if (resultid ==
"AutoExpireManage")
411 if (!rec || buttonnum == 2)
415 if ((buttonnum == 0) && rec->QueryIsDeleteCandidate())
420 LOG(VB_GENERAL, LOG_ERR, QString(
"Failed to delete recording: %1").arg(rec->GetTitle()));
425 else if (buttonnum == 1)
427 if (rec->GetRecordingGroup() ==
"Deleted")
435 if (rec->GetRecordingGroup() ==
"LiveTV")
463 QString helpmsg(tr(
"Listings Status shows the latest "
464 "status information from "
465 "mythfilldatabase"));
471 QDateTime mfdLastRunStart;
472 QDateTime mfdLastRunEnd;
473 QDateTime mfdNextRunStart;
474 QString mfdLastRunStatus;
476 QDateTime GuideDataThrough;
481 query.
prepare(
"SELECT max(endtime) FROM program WHERE manualid=0;");
495 AddLogLine(tr(
"Mythfrontend version: %1 (%2)")
499 AddLogLine(tr(
"Last mythfilldatabase guide update:"), helpmsg);
500 tmp = tr(
"Started: %1").arg(
505 if (mfdLastRunEnd >= mfdLastRunStart)
507 tmp = tr(
"Finished: %1")
514 AddLogLine(tr(
"Result: %1").arg(mfdLastRunStatus), helpmsg);
517 if (mfdNextRunStart >= mfdLastRunStart)
519 tmp = tr(
"Suggested Next: %1")
526 int DaysOfData = qdtNow.daysTo(GuideDataThrough);
528 if (GuideDataThrough.isNull())
530 AddLogLine(tr(
"There's no guide data available!"), helpmsg,
532 AddLogLine(tr(
"Have you run mythfilldatabase?"), helpmsg,
538 tr(
"There is guide data until %1")
543 AddLogLine(QString(
"(%1).").arg(tr(
"%n day(s)",
"", DaysOfData)),
548 AddLogLine(tr(
"WARNING: is mythfilldatabase running?"), helpmsg,
558 QString helpmsg(tr(
"Schedule Status shows current statistics "
559 "from the scheduler."));
567 query.
prepare(
"SELECT COUNT(*) FROM record WHERE type = :TEMPLATE");
571 QString rules = tr(
"%n template rule(s) (is) defined",
"",
572 query.
value(0).toInt());
581 query.
prepare(
"SELECT COUNT(*) FROM record "
582 "WHERE type <> :TEMPLATE AND search = :NOSEARCH");
587 QString rules = tr(
"%n standard rule(s) (is) defined",
"",
588 query.
value(0).toInt());
597 query.
prepare(
"SELECT COUNT(*) FROM record WHERE search > :NOSEARCH");
601 QString rules = tr(
"%n search rule(s) are defined",
"",
602 query.
value(0).toInt());
611 QMap<RecStatus::Type, int> statusMatch;
612 QMap<RecStatus::Type, QString> statusText;
613 QMap<int, int> sourceMatch;
614 QMap<int, QString> sourceText;
615 QMap<int, int> cardMatch;
616 QMap<int, QString> cardText;
617 QMap<int, int> cardParent;
618 QMap<int, bool> cardSchedGroup;
622 int lowerpriority = 0;
625 query.
prepare(
"SELECT MAX(sourceid) FROM videosource");
629 maxSource = query.
value(0).toInt();
632 query.
prepare(
"SELECT sourceid,name FROM videosource");
636 sourceText[query.
value(0).toInt()] = query.
value(1).toString();
639 query.
prepare(
"SELECT MAX(cardid) FROM capturecard");
643 maxCard = query.
value(0).toInt();
646 query.
prepare(
"SELECT cardid, inputname, displayname, parentid, "
653 int inputid = query.
value(0).toInt();
654 cardText[inputid] = query.
value(2).toString();
655 if (cardText[inputid].isEmpty())
656 cardText[inputid] = QString::number(query.
value(1).toInt());
657 cardParent[inputid] = query.
value(3).toInt();
658 cardSchedGroup[inputid] = query.
value(4).toBool();
665 tmpstr = tr(
"%n matching showing(s)",
"", schedList.
size());
668 for (
auto *s : schedList)
672 if (statusMatch[recstatus] < 1)
675 recstatus, s->GetRecordingRuleType());
678 ++statusMatch[recstatus];
686 ++sourceMatch[s->GetSourceID()];
687 int inputid = s->GetInputID();
690 if (cardParent[inputid] && cardSchedGroup[cardParent[inputid]])
691 inputid = cardParent[inputid];
692 ++cardMatch[inputid];
693 if (s->GetRecordingPriority2() < 0)
695 if (s->GetVideoProperties() & VID_HDTV)
701#define ADD_STATUS_LOG_LINE(rtype, fstate) \
703 if (statusMatch[rtype] > 0) \
705 tmpstr = QString("%1 %2").arg(statusMatch[rtype]) \
706 .arg(statusText[rtype]); \
707 AddLogLine(tmpstr, helpmsg, tmpstr, tmpstr, fstate);\
723 if (lowerpriority > 0)
725 tmpstr = QString(
"%1 %2 %3").arg(QString::number(lowerpriority),
726 willrec, tr(
"with lower priority"));
727 AddLogLine(tmpstr, helpmsg, tmpstr, tmpstr,
"warning");
731 tmpstr = QString(
"%1 %2 %3").arg(QString::number(hdflag),
732 willrec, tr(
"marked as HDTV"));
735 for (
int i = 1; i <= maxSource; ++i)
737 if (sourceMatch[i] > 0)
739 tmpstr = QString(
"%1 %2 %3 %4 \"%5\"")
740 .arg(QString::number(sourceMatch[i]), willrec,
741 tr(
"from source"), QString::number(i), sourceText[i]);
745 for (
int i = 1; i <= maxCard; ++i)
747 if (cardMatch[i] > 0)
749 tmpstr = QString(
"%1 %2 %3 %4 \"%5\"")
750 .arg(QString::number(cardMatch[i]), willrec,
751 tr(
"on input"), QString::number(i), cardText[i]);
762 int m_unavailable {0};
767 QStringList m_recordings;
769 QMap<QString, struct info>
info;
770 QStringList inputnames;
776 QString helpmsg(tr(
"Input Status shows the current information "
777 "about the state of backend inputs"));
785 "SELECT cardid, displayname "
786 "FROM capturecard ORDER BY displayname, cardid");
796 int inputid = query.
value(0).toInt();
797 QString inputname = query.
value(1).toString();
798 if (!
info.contains(inputname))
799 inputnames.append(inputname);
801 QString cmd = QString(
"QUERY_REMOTEENCODER %1").arg(inputid);
802 QStringList strlist( cmd );
803 strlist <<
"GET_STATE";
806 int state = strlist[0].toInt();
811 strlist << QString(
"QUERY_REMOTEENCODER %1").arg(inputid);
812 strlist <<
"GET_SLEEPSTATUS";
815 int sleepState = strlist[0].toInt();
817 if (sleepState == -1)
818 info[inputname].m_errored += 1;
820 info[inputname].m_unavailable += 1;
822 info[inputname].m_sleeping += 1;
827 info[inputname].m_recording += 1;
831 info[inputname].m_livetv += 1;
835 info[inputname].m_available += 1;
842 strlist = QStringList( QString(
"QUERY_RECORDER %1").arg(inputid));
843 strlist <<
"GET_RECORDING";
848 QString titlesub = pginfo.
GetTitle();
851 info[inputname].m_recordings += titlesub;
856 for (
const QString& inputname : std::as_const(inputnames))
858 QStringList statuslist;
859 if (
info[inputname].m_errored)
860 statuslist << tr(
"%1 errored").arg(
info[inputname].m_errored);
861 if (
info[inputname].m_unavailable)
862 statuslist << tr(
"%1 unavailable").arg(
info[inputname].m_unavailable);
863 if (
info[inputname].m_sleeping)
864 statuslist << tr(
"%1 sleeping").arg(
info[inputname].m_sleeping);
865 if (
info[inputname].m_recording)
866 statuslist << tr(
"%1 recording").arg(
info[inputname].m_recording);
867 if (
info[inputname].m_livetv)
868 statuslist << tr(
"%1 live television").arg(
info[inputname].m_livetv);
869 if (
info[inputname].m_available)
870 statuslist << tr(
"%1 available").arg(
info[inputname].m_available);
873 if (
info[inputname].m_errored)
875 else if (
info[inputname].m_unavailable ||
info[inputname].m_sleeping)
876 fontstate =
"warning";
878 QString shortstatus = tr(
"Input %1: %2")
879 .arg(inputname, statuslist.join(tr(
", ")));
880 QString longstatus = shortstatus +
"\n" +
881 info[inputname].m_recordings.join(
"\n");
883 AddLogLine(shortstatus, helpmsg, longstatus, longstatus, fontstate);
893 QString helpmsg(tr(
"Log Entries shows any unread log entries "
894 "from the system if you have logging enabled"));
901 query.
prepare(
"SELECT logid, module, priority, logdate, host, "
903 "FROM mythlog WHERE acknowledged = 0 "
904 "AND priority <= :PRIORITY ORDER BY logdate DESC;");
913 line = QString(
"%1").arg(query.
value(5).toString());
915 detail = tr(
"On %1 from %2.%3\n%4\n")
919 query.
value(4).toString(),
920 query.
value(1).toString(),
921 query.
value(5).toString());
923 QString tmp = query.
value(6).toString();
927 detail.append(tr(
"No further details"));
930 "", query.
value(0).toString());
933 if (query.
size() == 0)
935 AddLogLine(tr(
"No items found at priority level %1 or lower.")
937 AddLogLine(tr(
"Use 1-8 to change priority level."), helpmsg);
948 QString helpmsg(tr(
"Job Queue shows any jobs currently in "
949 "MythTV's Job Queue such as a commercial "
956 QMap<int, JobQueueEntry> jobs;
957 QMap<int, JobQueueEntry>::Iterator it;
968 for (it = jobs.begin(); it != jobs.end(); ++it)
970 ProgramInfo pginfo((*it).chanid, (*it).recstartts);
975 detail = QString(
"%1\n%2 %3 @ %4\n%5 %6 %7 %8")
987 if ((*it).status != JOB_QUEUED)
988 detail +=
" (" + (*it).hostname +
')';
992 detail +=
'\n' + tr(
"Scheduled Run Time:") +
' ' +
999 detail +=
'\n' + (*it).comment;
1002 line = QString(
"%1 @ %2")
1009 if ((*it).status == JOB_ERRORED)
1011 else if ((*it).status == JOB_ABORTED)
1014 AddLogLine(line, helpmsg, detail, detail, font,
1015 QString(
"%1").arg((*it).id));
1020 AddLogLine(tr(
"Job Queue is currently empty."), helpmsg);
1031 QString ret = QObject::tr(
"Unknown");
1032 if (total > 0.0 && free > 0.0)
1034 double percent = (100.0*free)/total;
1035 ret = StatusBox::tr(
"%1 total, %2 used, %3 (or %4%) free.")
1039 .arg(percent, 0,
'f', (percent >= 10.0) ? 0 : 2);
1046 return usage_str_kb((
long long)(total*1024), (
long long)(used*1024),
1047 (
long long)(free*1024));
1051 long long used,
long long free,
1054 const QString tail = StatusBox::tr(
", using your %1 rate of %2 kb/s");
1061 for (
auto it = prof2bps.begin(); it != prof2bps.end(); ++it)
1064 tail.arg(it.key()).arg((
int)((
float)(*it) / 1024.0F));
1066 long long bytesPerMin = ((*it) >> 1) * 15LL;
1067 uint minLeft = ((free<<5)/bytesPerMin)<<5;
1068 minLeft = (minLeft/15)*15;
1069 uint hoursLeft = minLeft/60;
1070 QString hourstring = StatusBox::tr(
"%n hour(s)",
"", hoursLeft);
1071 QString minstring = StatusBox::tr(
"%n minute(s)",
"", minLeft%60);
1072 QString remainstring = StatusBox::tr(
"%1 remaining",
"time");
1073 if (minLeft%60 == 0)
1075 out<<remainstring.arg(hourstring) + pro;
1077 else if (minLeft > 60)
1079 out<<StatusBox::tr(
"%1 and %2 remaining",
"time")
1080 .arg(hourstring, minstring) + pro;
1084 out<<remainstring.arg(minstring) + pro;
1091 QString str =
" " + StatusBox::tr(
"Uptime") +
": ";
1094 return str + StatusBox::tr(
"unknown",
"unknown uptime");
1096 auto days = duration_cast<std::chrono::days>(uptime);
1097 auto secs = uptime % 24h;
1100 if (days.count() > 0)
1102 astext = QString(
"%1, %2")
1103 .arg(StatusBox::tr(
"%n day(s)",
"", days.count()),
1108 return str + astext;
1122 "SELECT sum(filesize) * 8 / "
1123 "sum(((unix_timestamp(endtime) - unix_timestamp(starttime)))) "
1125 "FROM recorded WHERE hostname in (%1) "
1126 "AND (unix_timestamp(endtime) - unix_timestamp(starttime)) > 300;";
1128 query.
prepare(querystr.arg(hostnames));
1130 if (query.
exec() && query.
next() &&
1131 query.
value(0).toDouble() > 0)
1133 QString rateStr = tr(
"average",
"average rate");
1138 (int)(query.
value(0).toDouble());
1142 "SELECT max(filesize * 8 / "
1143 "(unix_timestamp(endtime) - unix_timestamp(starttime))) "
1145 "FROM recorded WHERE hostname in (%1) "
1146 "AND (unix_timestamp(endtime) - unix_timestamp(starttime)) > 300;";
1148 query.
prepare(querystr.arg(hostnames));
1150 if (query.
exec() && query.
next() &&
1151 query.
value(0).toDouble() > 0)
1153 QString rateStr = tr(
"maximum",
"maximum rate");
1158 (int)(query.
value(0).toDouble());
1175 QString machineStr = tr(
"Machine Status shows some operating system "
1176 "statistics of this machine and the MythTV "
1186 line = tr(
"System:");
1188 line = tr(
"This machine:");
1195 Item->SetText(
" " + tr(
"System time") +
": " + QDateTime::currentDateTime().toString());
1197 UpdateTime(timebox);
1199 timebox, UpdateTime);
1204 AddLogLine(
" " + tr(
"OS") + QString(
": %1 (%2)").arg(QSysInfo::prettyProductName(),
1205 QSysInfo::currentCpuArchitecture()));
1206 AddLogLine(
" " + tr(
"Qt version") + QString(
": %1").arg(qVersion()));
1208 QList allInterfaces = QNetworkInterface::allInterfaces();
1209 for (
const QNetworkInterface & iface : std::as_const(allInterfaces))
1211 QNetworkInterface::InterfaceFlags f = iface.flags();
1212 if (!(f & QNetworkInterface::IsUp))
1214 if (!(f & QNetworkInterface::IsRunning))
1216 if ((f & QNetworkInterface::IsLoopBack) != 0U)
1219 QNetworkInterface::InterfaceType
type = iface.type();
1220 QString name =
type == QNetworkInterface::Wifi ? tr(
"WiFi") : tr(
"Ethernet");
1221 AddLogLine(
" " + name + QString(
" (%1): ").arg(iface.humanReadableName()));
1222 AddLogLine(
" " + tr(
"MAC Address") +
": " + iface.hardwareAddress());
1223 QList addresses = iface.addressEntries();
1224 for (
const QNetworkAddressEntry & addr : std::as_const(addresses))
1226 if (addr.ip().protocol() == QAbstractSocket::IPv4Protocol ||
1227 addr.ip().protocol() == QAbstractSocket::IPv6Protocol)
1229 AddLogLine(
" " + tr(
"IP Address") +
": " + addr.ip().toString());
1236 std::chrono::seconds uptime = 0s;
1241 std::chrono::seconds time = 0s;
1247 uptimeitem, UpdateUptime);
1248 uptimeitem->
Start(1min);
1252#if !defined(Q_OS_WINDOWS) && !defined(Q_OS_ANDROID)
1256 Item->SetText(QString(
" %1: %2 %3 %4").arg(tr(
"Load")).arg(loads[0], 1,
'f', 2)
1257 .arg(loads[1], 1,
'f', 2).arg(loads[2], 1,
'f', 2));
1260 UpdateLoad(loaditem);
1262 loaditem, UpdateLoad);
1280 Item->SetText(QString(
" " + tr(
"RAM") +
": " +
usage_str_mb(totm, totm - freem, freem)));
1290 Item->SetText(QString(
" " + tr(
"Swap") +
": " +
usage_str_mb(tots, tots - frees, frees)));
1306 line = tr(
"MythTV server") +
':';
1319 std::chrono::seconds time = 0s;
1325 remoteuptime, UpdateRemoteUptime);
1326 remoteuptime->
Start(1min);
1337 Item->SetText(QString(
" %1: %2 %3 %4").arg(tr(
"Load")).arg(loads[0], 1,
'f', 2)
1338 .arg(loads[1], 1,
'f', 2).arg(loads[2], 1,
'f', 2));
1341 UpdateRemoteLoad(remoteloaditem);
1343 remoteloaditem, UpdateRemoteLoad);
1344 remoteloaditem->
Start();
1357 Item->SetText(QString(
" " + tr(
"RAM") +
": " +
usage_str_mb(totm, totm - freem, freem)));
1367 Item->SetText(QString(
" " + tr(
"Swap") +
": " +
usage_str_mb(tots, tots - frees, frees)));
1371 UpdateRemoteMem(rmem);
1372 UpdateRemoteSwap(rswap);
1374 rmem, UpdateRemoteMem);
1376 rswap, UpdateRemoteSwap);
1386 for (
int i = 0; i < fsInfos.size(); ++i)
1389 if ((fsInfos.size() == 2) && (i == 0) &&
1390 (fsInfos[i].getPath() !=
"TotalDiskSpace") &&
1391 (fsInfos[i+1].getPath() ==
"TotalDiskSpace"))
1394 hostnames = QString(
"\"%1\"").arg(fsInfos[i].getHostname());
1395 hostnames.replace(
' ',
"");
1396 hostnames.replace(
',',
"\",\"");
1402 fsInfos[i].getTotalSpace(), fsInfos[i].getUsedSpace(),
1403 fsInfos[i].getTotalSpace() - fsInfos[i].getUsedSpace(),
1406 if (fsInfos[i].getPath() ==
"TotalDiskSpace")
1408 line = tr(
"Total Disk Space:");
1413 line = tr(
"MythTV Drive #%1:").arg(fsInfos[i].getFSysID());
1416 QStringList tokens = fsInfos[i].getPath().split(
',');
1418 if (tokens.size() > 1)
1420 AddLogLine(QString(
" ") + tr(
"Directories:"), machineStr);
1423 while (curToken < tokens.size())
1425 tokens[curToken++], machineStr);
1429 AddLogLine(QString(
" " ) + tr(
"Directory:") +
' ' +
1430 fsInfos[i].getPath(), machineStr);
1434 for (
auto & diskinfo : list)
1436 line = QString(
" ") + diskinfo;
1448 QString displayhelp = tr(
"Available hardware decoders for video playback.");
1455 if (decoders.isEmpty())
1461 for (
const QString & decoder : std::as_const(decoders))
1471 auto displayhelp = tr(
"Display information.");
1478 for (
const auto & line : std::as_const(desc))
1487 auto displayhelp = tr(
"Render information.");
1502 uint64_t swapcount = 0;
1505 swapcount = gl->GetSwapCount();
1506 Item->SetText(tr(
"Current fps\t: %1").arg(swapcount));
1511 (void)opengl->GetSwapCount();
1518 if (opengl && (opengl->GetExtraFeatures() &
kGLNVMemory))
1520 auto GetGPUMem = []()
1524 return gl->GetGPUMemory();
1525 return std::tuple<int,int,int> { 0, 0, 0 };
1529 auto mem = GetGPUMem();
1530 int total = std::get<0>(mem);
1533 int avail = std::get<2>(mem);
1534 Item->SetText(tr(
"GPU memory used : %1MB").arg(total - avail));
1540 auto mem = GetGPUMem();
1541 int total = std::get<0>(mem);
1544 int avail = std::get<2>(mem);
1545 int percent =
static_cast<int>((avail /
static_cast<float>(total) * 100.0F));
1546 Item->SetText(tr(
"GPU memory free : %1MB (or %2%)").arg(avail).arg(percent));
1557 UpdateFree(freemem);
1561 freemem, UpdateFree);
1566 auto desc = render->GetDescription();
1567 for (
const auto & line : std::as_const(desc))
1581 QString helpmsg(tr(
"The AutoExpire List shows all recordings "
1582 "which may be expired and the order of "
1583 "their expiration. Recordings at the top "
1584 "of the list will be expired first."));
1590 QString contentLine;
1593 long long totalSize(0);
1594 long long liveTVSize(0);
1596 long long deletedGroupSize(0);
1597 int deletedGroupCount(0);
1599 std::vector<ProgramInfo *>::iterator it;
1623 deletedGroupCount++;
1627 staticInfo = tr(
"%n recording(s) consuming %1 (is) allowed to expire\n",
"",
1631 staticInfo += tr(
"%n (is) LiveTV and consume(s) %1\n",
"", liveTVCount)
1634 if (deletedGroupCount)
1636 staticInfo += tr(
"%n (is) Deleted and consume(s) %1\n",
"",
1653 contentLine += pginfo->
GetTitle() +
1669 AddLogLine(contentLine, staticInfo, detailInfo,
1670 staticInfo + detailInfo);
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
static const Type kEventType
static int GetJobsInQueue(QMap< int, JobQueueEntry > &jobs, int findJobs=JOB_LIST_NOT_DONE)
static QString JobText(int jobType)
static bool DeleteJob(int jobID)
static bool StopJob(int jobID)
static bool ResumeJob(int jobID)
static bool ChangeJobStatus(int jobID, int newStatus, const QString &comment="")
static enum JobStatus GetJobStatus(int jobID)
static bool PauseJob(int jobID)
static QString StatusText(int status)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
QVariant value(int i) const
bool isActive(void) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
static QStringList GetDecoderDescription(void)
Dialog asking for user confirmation.
QString GetHostName(void)
void SaveSetting(const QString &key, int newValue)
QString GetSetting(const QString &key, const QString &defaultval="")
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
int GetNumSetting(const QString &key, int defaultval=0)
static void DBError(const QString &where, const MSqlQuery &query)
Basic menu dialog, message and a list of options.
QStringList GetDescription()
MythDisplay * GetDisplay()
MythRender * GetRenderDevice()
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
MythScreenStack * GetStack(const QString &Stackname)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Screen in which all other widgets are contained and rendered.
void BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
This widget is used for grouping other widgets for display when a particular named state is called.
bool DisplayState(const QString &name)
All purpose text widget, displays a text string.
virtual void SetText(const QString &text)
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Holds information on recordings and videos.
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
QString toString(Verbosity v=kLongDescription, const QString &sep=":", const QString &grp="\"") const
QString GetRecordingGroup(void) const
QString GetChannelName(void) const
This is the channel name in the local market, i.e.
QString GetTitle(void) const
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
QString GetChanNum(void) const
This is the channel "number", in the form 1, 1_2, 1-2, 1#1, etc.
static QString i18n(const QString &msg)
Translations for play,recording, & storage groups +.
virtual uint64_t GetFilesize(void) const
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
QString GetSubtitle(void) const
static QString toString(RecStatus::Type recstatus, uint id)
Converts "recstatus" into a short (unreadable) string.
Holds information on a TV Program one might wish to record.
void ApplyRecordRecGroupChange(const QString &newrecgroup)
Sets the recording group, both in this RecordingInfo and in the database.
void UpdateRequired(StatusBoxItem *Item)
void Start(std::chrono::seconds Interval=1s)
StatusBox(MythScreenStack *parent)
void getActualRecordedBPS(const QString &hostnames)
Fills in m_recordingProfilesBps w/ average bitrate from recorded table.
void clicked(MythUIButtonListItem *item)
void customEvent(QEvent *event) override
StatusBoxItem * AddLogLine(const QString &line, const QString &help="", const QString &detail="", const QString &helpdetail="", const QString &state="", const QString &data="")
MythUIButtonList * m_categoryList
void setHelpText(MythUIButtonListItem *item)
~StatusBox(void) override
void doAutoExpireList()
Show list of recordings which may AutoExpire.
bool Create(void) override
std::vector< ProgramInfo * > m_expList
MythUIText * m_justHelpText
MythUIButtonList * m_logList
recprof2bps_t m_recordingProfilesBps
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void doMachineStatus()
Show machine status.
MythUIStateType * m_iconState
MythScreenStack * m_popupStack
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
void updateLogList(MythUIButtonListItem *item)
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
QVector< FileSystemInfo > FileSystemInfoList
Q_DECLARE_METATYPE(std::chrono::seconds)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
bool RemoteGetUptime(std::chrono::seconds &uptime)
bool getMemStats(int &totalMB, int &freeMB, int &totalVM, int &freeVM)
Returns memory statistics in megabytes.
loadArray getLoadAvgs(void)
Returns the system load averages.
bool RemoteGetLoad(loadArray &load)
bool getUptime(std::chrono::seconds &uptime)
Returns uptime statistics.
bool RemoteGetMemStats(int &totalMB, int &freeMB, int &totalVM, int &freeVM)
std::array< double, 3 > loadArray
void(QObject::*)(void) const MythUICallbackMFc
void(QObject::*)(void) MythUICallbackMF
const char * GetMythSourceVersion()
const char * GetMythSourcePath()
MBASE_PUBLIC FileSystemInfoList GetInfoList(MythSocket *sock=nullptr)
QString formatTime(std::chrono::milliseconds msecs, QString fmt)
Format a milliseconds time value.
QDateTime as_utc(const QDateTime &old_dt)
Returns copy of QDateTime with TimeSpec set to UTC.
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
@ kDateTimeFull
Default local time.
@ kSimplify
Do Today/Yesterday/Tomorrow transform.
@ kDateFull
Default local time.
@ kDateTimeShort
Default local time.
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
MBASE_PUBLIC QString formatKBytes(int64_t sizeKB, int prec=1)
bool LoadFromScheduler(AutoDeleteDeque< TYPE * > &destination, bool &hasConflicts, const QString &altTable="", int recordid=-1)
bool RemoteDeleteRecording(uint recordingID, bool forceMetadataDelete, bool forgetHistory)
void RemoteGetAllExpiringRecordings(std::vector< ProgramInfo * > &expiringlist)
bool RemoteUndeleteRecording(uint recordingID)
static QString uptimeStr(std::chrono::seconds uptime)
static QString usage_str_kb(long long total, long long used, long long free)
#define ADD_STATUS_LOG_LINE(rtype, fstate)
static void disk_usage_with_rec_time_kb(QStringList &out, long long total, long long used, long long free, const recprof2bps_t &prof2bps)
static QString usage_str_mb(float total, float used, float free)
QMap< QString, unsigned int > recprof2bps_t
@ sStatus_Undefined
A slave's sleep status is undefined when it has never connected to the master backend or is not able ...
@ kState_RecordingOnly
Recording Only is a TVRec only state for when we are recording a program, but there is no one current...
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
@ kState_Error
Error State, if we ever try to enter this state errored is set.
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...