MythTV  master
statusbox.cpp
Go to the documentation of this file.
1 
2 #include "statusbox.h"
3 
4 #include <QHostAddress>
5 #include <QNetworkInterface>
6 
7 #include "mythcorecontext.h"
8 #include "filesysteminfo.h"
9 #include "mythmiscutil.h"
10 #include "mythdb.h"
11 #include "mythlogging.h"
12 #include "mythversion.h"
13 #include "mythdate.h"
14 
15 #include "config.h"
16 #include "remoteutil.h"
17 #include "tv.h"
18 #include "jobqueue.h"
19 #include "cardutil.h"
20 #include "recordinginfo.h"
21 
22 #include "mythmiscutil.h"
23 #include "mythuihelper.h"
24 #include "mythuibuttonlist.h"
25 #include "mythuitext.h"
26 #include "mythuistatetype.h"
27 #include "mythdialogbox.h"
28 #include "mythrender_base.h"
30 #include "mythdisplay.h"
32 #include "mythchrono.h"
33 
34 struct LogLine {
35  QString m_line;
36  QString m_detail;
37  QString m_help;
38  QString m_helpdetail;
39  QString m_data;
40  QString m_state;
41 };
42 
43 void StatusBoxItem::Start(std::chrono::seconds Interval)
44 {
45  connect(this, &QTimer::timeout, [=]() { emit UpdateRequired(this); });
46  start(Interval);
47 }
48 
59  : MythScreenType(parent, "StatusBox")
60 {
61  m_minLevel = gCoreContext->GetNumSetting("LogDefaultView",5);
62 
63  QStringList strlist;
64  strlist << "QUERY_IS_ACTIVE_BACKEND";
65  strlist << gCoreContext->GetHostName();
66 
68 
69  m_isBackendActive = (strlist[0] == "TRUE");
70  m_popupStack = GetMythMainWindow()->GetStack("popup stack");
71 }
72 
74 {
75  if (m_logList)
76  gCoreContext->SaveSetting("StatusBoxItemCurrent",
78 }
79 
81 {
82  if (!LoadWindowFromXML("status-ui.xml", "status", this))
83  return false;
84 
85  m_categoryList = dynamic_cast<MythUIButtonList *>(GetChild("category"));
86  m_logList = dynamic_cast<MythUIButtonList *>(GetChild("log"));
87 
88  m_iconState = dynamic_cast<MythUIStateType *>(GetChild("icon"));
89  m_helpText = dynamic_cast<MythUIText *>(GetChild("helptext"));
90  m_justHelpText = dynamic_cast<MythUIText *>(GetChild("justhelptext"));
91 
93  {
94  LOG(VB_GENERAL, LOG_ERR, "StatusBox, theme is missing "
95  "required elements");
96  return false;
97  }
98 
100  this, &StatusBox::updateLogList);
102  this, &StatusBox::setHelpText);
104  this, &StatusBox::clicked);
105 
106  BuildFocusList();
107  return true;
108 }
109 
111 {
112  auto *item = new MythUIButtonListItem(m_categoryList, tr("Listings Status"),
114  item->DisplayState("listings", "icon");
115 
116  item = new MythUIButtonListItem(m_categoryList, tr("Schedule Status"),
118  item->DisplayState("schedule", "icon");
119 
120  item = new MythUIButtonListItem(m_categoryList, tr("Input Status"),
122  item->DisplayState("tuner", "icon");
123 
124  item = new MythUIButtonListItem(m_categoryList, tr("Job Queue"),
126  item->DisplayState("jobqueue", "icon");
127 
128  item = new MythUIButtonListItem(m_categoryList, tr("Video decoders"),
130  item->DisplayState("decoders", "icon");
131 
132  item = new MythUIButtonListItem(m_categoryList, tr("Display"),
134  item->DisplayState("display", "icon");
135 
136  item = new MythUIButtonListItem(m_categoryList, tr("Rendering"),
138  item->DisplayState("render", "icon");
139 
140  item = new MythUIButtonListItem(m_categoryList, tr("Machine Status"),
142  item->DisplayState("machine", "icon");
143 
144  item = new MythUIButtonListItem(m_categoryList, tr("AutoExpire List"),
145  qOverload<>(&StatusBox::doAutoExpireList));
146  item->DisplayState("autoexpire", "icon");
147 
148  int itemCurrent = gCoreContext->GetNumSetting("StatusBoxItemCurrent", 0);
149  m_categoryList->SetItemCurrent(itemCurrent);
150 }
151 
152 StatusBoxItem *StatusBox::AddLogLine(const QString & line,
153  const QString & help,
154  const QString & detail,
155  const QString & helpdetail,
156  const QString & state,
157  const QString & data)
158 {
159  LogLine logline;
160  logline.m_line = line;
161 
162  if (detail.isEmpty())
163  logline.m_detail = line;
164  else
165  logline.m_detail = detail;
166 
167  if (help.isEmpty())
168  logline.m_help = logline.m_detail;
169  else
170  logline.m_help = help;
171 
172  if (helpdetail.isEmpty())
173  logline.m_helpdetail = logline.m_detail;
174  else
175  logline.m_helpdetail = helpdetail;
176 
177  logline.m_state = state;
178  logline.m_data = data;
179 
180  auto *item = new StatusBoxItem(m_logList, line, QVariant::fromValue(logline));
181  if (logline.m_state.isEmpty())
182  logline.m_state = "normal";
183 
184  item->SetFontState(logline.m_state);
185  item->DisplayState(logline.m_state, "status");
186  item->SetText(logline.m_detail, "detail");
187  return item;
188 }
189 
190 bool StatusBox::keyPressEvent(QKeyEvent *event)
191 {
192  if (GetFocusWidget()->keyPressEvent(event))
193  return true;
194 
195  QStringList actions;
196  bool handled = GetMythMainWindow()->TranslateKeyPress("Status", event, actions);
197 
198 #if 0
199  for (int i = 0; i < actions.size() && !handled; ++i)
200  {
201  QString action = actions[i];
202  handled = true;
203 
204  if (action == "MENU")
205  {
206  }
207  else
208  handled = false;
209  }
210 #endif
211 
212  if (!handled && MythScreenType::keyPressEvent(event))
213  handled = true;
214 
215  return handled;
216 }
217 
219 {
220  if (!item || GetFocusWidget() != m_logList)
221  return;
222 
223  auto logline = item->GetData().value<LogLine>();
224  if (m_helpText)
225  m_helpText->SetText(logline.m_helpdetail);
226  if (m_justHelpText)
227  m_justHelpText->SetText(logline.m_help);
228 }
229 
231 {
232  if (!item)
233  return;
234 
235  disconnect(this, &StatusBox::updateLog,nullptr,nullptr);
236 
237  if (item->GetData().value<MythUICallbackMF>())
238  {
239  connect(this, &StatusBox::updateLog,
240  item->GetData().value<MythUICallbackMF>());
241  emit updateLog();
242  }
243  else if (item->GetData().value<MythUICallbackMFc>())
244  {
245  connect(this, &StatusBox::updateLog,
246  item->GetData().value<MythUICallbackMFc>());
247  emit updateLog();
248  }
249 }
250 
252 {
253  if (!item)
254  return;
255 
256  auto logline = item->GetData().value<LogLine>();
257 
259  QString currentItem;
260  if (currentButton)
261  currentItem = currentButton->GetText();
262 
263  // FIXME: Comparisons against strings here is not great, changing names
264  // breaks everything and it's inefficient
265  if (currentItem == tr("Job Queue"))
266  {
267  int jobStatus = JobQueue::GetJobStatus(logline.m_data.toInt());
268 
269  if (jobStatus == JOB_QUEUED)
270  {
271  QString message = tr("Delete Job?");
272 
273  auto *confirmPopup =
274  new MythConfirmationDialog(m_popupStack, message);
275 
276  confirmPopup->SetReturnEvent(this, "JobDelete");
277  confirmPopup->SetData(logline.m_data);
278 
279  if (confirmPopup->Create())
280  m_popupStack->AddScreen(confirmPopup, false);
281  }
282  else if ((jobStatus == JOB_PENDING) ||
283  (jobStatus == JOB_STARTING) ||
284  (jobStatus == JOB_RUNNING) ||
285  (jobStatus == JOB_PAUSED))
286  {
287  QString label = tr("Job Queue Actions:");
288 
289  auto *menuPopup = new MythDialogBox(label, m_popupStack,
290  "statusboxpopup");
291 
292  if (menuPopup->Create())
293  m_popupStack->AddScreen(menuPopup, false);
294 
295  menuPopup->SetReturnEvent(this, "JobModify");
296 
297  QVariant data = QVariant::fromValue(logline.m_data);
298 
299  if (jobStatus == JOB_PAUSED)
300  menuPopup->AddButtonV(tr("Resume"), data);
301  else
302  menuPopup->AddButtonV(tr("Pause"), data);
303  menuPopup->AddButtonV(tr("Stop"), data);
304  menuPopup->AddButtonV(tr("No Change"), data);
305  }
306  else if (jobStatus & JOB_DONE)
307  {
308  QString message = tr("Requeue Job?");
309 
310  auto *confirmPopup =
311  new MythConfirmationDialog(m_popupStack, message);
312 
313  confirmPopup->SetReturnEvent(this, "JobRequeue");
314  confirmPopup->SetData(logline.m_data);
315 
316  if (confirmPopup->Create())
317  m_popupStack->AddScreen(confirmPopup, false);
318  }
319  }
320  else if (currentItem == tr("AutoExpire List"))
321  {
323 
324  if (rec)
325  {
326  QString label = tr("AutoExpire Actions:");
327 
328  auto *menuPopup = new MythDialogBox(label, m_popupStack,
329  "statusboxpopup");
330 
331  if (menuPopup->Create())
332  m_popupStack->AddScreen(menuPopup, false);
333 
334  menuPopup->SetReturnEvent(this, "AutoExpireManage");
335 
336  menuPopup->AddButtonV(tr("Delete Now"), QVariant::fromValue(rec));
337  if ((rec)->GetRecordingGroup() == "LiveTV")
338  {
339  menuPopup->AddButtonV(tr("Move to Default group"),
340  QVariant::fromValue(rec));
341  }
342  else if ((rec)->GetRecordingGroup() == "Deleted")
343  menuPopup->AddButtonV(tr("Undelete"), QVariant::fromValue(rec));
344  else
345  menuPopup->AddButtonV(tr("Disable AutoExpire"),
346  QVariant::fromValue(rec));
347  menuPopup->AddButtonV(tr("No Change"), QVariant::fromValue(rec));
348 
349  }
350  }
351 }
352 
353 void StatusBox::customEvent(QEvent *event)
354 {
355  if (event->type() == DialogCompletionEvent::kEventType)
356  {
357  auto *dce = (DialogCompletionEvent*)(event);
358 
359  QString resultid = dce->GetId();
360  int buttonnum = dce->GetResult();
361 
362  if (resultid == "JobDelete")
363  {
364  if (buttonnum == 1)
365  {
366  int jobID = dce->GetData().toInt();
368 
370  }
371  }
372  else if (resultid == "JobRequeue")
373  {
374  if (buttonnum == 1)
375  {
376  int jobID = dce->GetData().toInt();
377  JobQueue::ChangeJobStatus(jobID, JOB_QUEUED);
379  }
380  }
381  else if (resultid == "JobModify")
382  {
383  int jobID = dce->GetData().toInt();
384  if (buttonnum == 0)
385  {
386  if (JobQueue::GetJobStatus(jobID) == JOB_PAUSED)
388  else
390  }
391  else if (buttonnum == 1)
392  {
394  }
395 
397  }
398  else if (resultid == "AutoExpireManage")
399  {
400  auto* rec = dce->GetData().value<ProgramInfo*>();
401 
402  // button 2 is "No Change"
403  if (!rec || buttonnum == 2)
404  return;
405 
406  // button 1 is "Delete Now"
407  if ((buttonnum == 0) && rec->QueryIsDeleteCandidate())
408  {
409  if (!RemoteDeleteRecording(rec->GetRecordingID(),
410  false, false))
411  {
412  LOG(VB_GENERAL, LOG_ERR, QString("Failed to delete recording: %1").arg(rec->GetTitle()));
413  return;
414  }
415  }
416  // button 1 is "Move To Default Group" or "UnDelete" or "Disable AutoExpire"
417  else if (buttonnum == 1)
418  {
419  if ((rec)->GetRecordingGroup() == "Deleted")
420  {
421  RemoteUndeleteRecording(rec->GetRecordingID());
422  }
423  else
424  {
425  rec->SaveAutoExpire(kDisableAutoExpire);
426 
427  if ((rec)->GetRecordingGroup() == "LiveTV")
428  {
429  RecordingInfo ri(*rec);
431  *rec = ri;
432  }
433  }
434  }
435 
436  // remove the changed recording from the expire list
437  delete m_expList[m_logList->GetCurrentPos()];
438  m_expList.erase(m_expList.begin() + m_logList->GetCurrentPos());
439 
440  int pos = m_logList->GetCurrentPos();
441  int topPos = m_logList->GetTopItemPos();
442  doAutoExpireList(false);
443  m_logList->SetItemCurrent(pos, topPos);
444  }
445 
446  }
447 }
448 
450 {
451  if (m_iconState)
452  m_iconState->DisplayState("listings");
453  m_logList->Reset();
454 
455  QString helpmsg(tr("Listings Status shows the latest "
456  "status information from "
457  "mythfilldatabase"));
458  if (m_helpText)
459  m_helpText->SetText(helpmsg);
460  if (m_justHelpText)
461  m_justHelpText->SetText(helpmsg);
462 
463  QDateTime mfdLastRunStart;
464  QDateTime mfdLastRunEnd;
465  QDateTime mfdNextRunStart;
466  QString mfdLastRunStatus;
467  QDateTime qdtNow;
468  QDateTime GuideDataThrough;
469 
470  qdtNow = MythDate::current();
471 
472  MSqlQuery query(MSqlQuery::InitCon());
473  query.prepare("SELECT max(endtime) FROM program WHERE manualid=0;");
474 
475  if (query.exec() && query.next())
476  GuideDataThrough = MythDate::fromString(query.value(0).toString());
477 
478  QString tmp = gCoreContext->GetSetting("mythfilldatabaseLastRunStart");
479  mfdLastRunStart = MythDate::fromString(tmp);
480  tmp = gCoreContext->GetSetting("mythfilldatabaseLastRunEnd");
481  mfdLastRunEnd = MythDate::fromString(tmp);
482  tmp = gCoreContext->GetSetting("MythFillSuggestedRunTime");
483  mfdNextRunStart = MythDate::fromString(tmp);
484 
485  mfdLastRunStatus = gCoreContext->GetSetting("mythfilldatabaseLastRunStatus");
486 
487  AddLogLine(tr("Mythfrontend version: %1 (%2)")
489  helpmsg);
490  AddLogLine(tr("Last mythfilldatabase guide update:"), helpmsg);
491  tmp = tr("Started: %1").arg(
493  mfdLastRunStart, MythDate::kDateTimeFull | MythDate::kSimplify));
494  AddLogLine(tmp, helpmsg);
495 
496  if (mfdLastRunEnd >= mfdLastRunStart)
497  {
498  tmp = tr("Finished: %1")
499  .arg(MythDate::toString(
500  mfdLastRunEnd,
502  AddLogLine(tmp, helpmsg);
503  }
504 
505  AddLogLine(tr("Result: %1").arg(mfdLastRunStatus), helpmsg);
506 
507 
508  if (mfdNextRunStart >= mfdLastRunStart)
509  {
510  tmp = tr("Suggested Next: %1")
511  .arg(MythDate::toString(
512  mfdNextRunStart,
514  AddLogLine(tmp, helpmsg);
515  }
516 
517  int DaysOfData = qdtNow.daysTo(GuideDataThrough);
518 
519  if (GuideDataThrough.isNull())
520  {
521  AddLogLine(tr("There's no guide data available!"), helpmsg,
522  "", "warning");
523  AddLogLine(tr("Have you run mythfilldatabase?"), helpmsg,
524  "", "warning");
525  }
526  else
527  {
528  AddLogLine(
529  tr("There is guide data until %1")
530  .arg(MythDate::toString(
531  GuideDataThrough,
533 
534  AddLogLine(QString("(%1).").arg(tr("%n day(s)", "", DaysOfData)),
535  helpmsg);
536  }
537 
538  if (DaysOfData <= 3)
539  AddLogLine(tr("WARNING: is mythfilldatabase running?"), helpmsg,
540  "", "", "warning");
541 }
542 
544 {
545  if (m_iconState)
546  m_iconState->DisplayState("schedule");
547  m_logList->Reset();
548 
549  QString helpmsg(tr("Schedule Status shows current statistics "
550  "from the scheduler."));
551  if (m_helpText)
552  m_helpText->SetText(helpmsg);
553  if (m_justHelpText)
554  m_justHelpText->SetText(helpmsg);
555 
556  MSqlQuery query(MSqlQuery::InitCon());
557 
558  query.prepare("SELECT COUNT(*) FROM record WHERE type = :TEMPLATE");
559  query.bindValue(":TEMPLATE", kTemplateRecord);
560  if (query.exec() && query.next())
561  {
562  QString rules = tr("%n template rule(s) (is) defined", "",
563  query.value(0).toInt());
564  AddLogLine(rules, helpmsg);
565  }
566  else
567  {
568  MythDB::DBError("StatusBox::doScheduleStatus()", query);
569  return;
570  }
571 
572  query.prepare("SELECT COUNT(*) FROM record "
573  "WHERE type <> :TEMPLATE AND search = :NOSEARCH");
574  query.bindValue(":TEMPLATE", kTemplateRecord);
575  query.bindValue(":NOSEARCH", kNoSearch);
576  if (query.exec() && query.next())
577  {
578  QString rules = tr("%n standard rule(s) (is) defined", "",
579  query.value(0).toInt());
580  AddLogLine(rules, helpmsg);
581  }
582  else
583  {
584  MythDB::DBError("StatusBox::doScheduleStatus()", query);
585  return;
586  }
587 
588  query.prepare("SELECT COUNT(*) FROM record WHERE search > :NOSEARCH");
589  query.bindValue(":NOSEARCH", kNoSearch);
590  if (query.exec() && query.next())
591  {
592  QString rules = tr("%n search rule(s) are defined", "",
593  query.value(0).toInt());
594  AddLogLine(rules, helpmsg);
595  }
596  else
597  {
598  MythDB::DBError("StatusBox::doScheduleStatus()", query);
599  return;
600  }
601 
602  QMap<RecStatus::Type, int> statusMatch;
603  QMap<RecStatus::Type, QString> statusText;
604  QMap<int, int> sourceMatch;
605  QMap<int, QString> sourceText;
606  QMap<int, int> cardMatch;
607  QMap<int, QString> cardText;
608  QMap<int, int> cardParent;
609  QMap<int, bool> cardSchedGroup;
610  QString tmpstr;
611  int maxSource = 0;
612  int maxCard = 0;
613  int lowerpriority = 0;
614  int hdflag = 0;
615 
616  query.prepare("SELECT MAX(sourceid) FROM videosource");
617  if (query.exec())
618  {
619  if (query.next())
620  maxSource = query.value(0).toInt();
621  }
622 
623  query.prepare("SELECT sourceid,name FROM videosource");
624  if (query.exec())
625  {
626  while (query.next())
627  sourceText[query.value(0).toInt()] = query.value(1).toString();
628  }
629 
630  query.prepare("SELECT MAX(cardid) FROM capturecard");
631  if (query.exec())
632  {
633  if (query.next())
634  maxCard = query.value(0).toInt();
635  }
636 
637  query.prepare("SELECT cardid, inputname, displayname, parentid, "
638  " schedgroup "
639  "FROM capturecard");
640  if (query.exec())
641  {
642  while (query.next())
643  {
644  int inputid = query.value(0).toInt();
645  cardText[inputid] = query.value(2).toString();
646  if (cardText[inputid].isEmpty())
647  cardText[inputid] = QString::number(query.value(1).toInt());
648  cardParent[inputid] = query.value(3).toInt();
649  cardSchedGroup[inputid] = query.value(4).toBool();
650  }
651  }
652 
653  ProgramList schedList;
654  LoadFromScheduler(schedList);
655 
656  tmpstr = tr("%n matching showing(s)", "", schedList.size());
657  AddLogLine(tmpstr, helpmsg);
658 
659  for (auto *s : schedList)
660  {
661  const RecStatus::Type recstatus = s->GetRecordingStatus();
662 
663  if (statusMatch[recstatus] < 1)
664  {
665  statusText[recstatus] = RecStatus::toString(
666  recstatus, s->GetRecordingRuleType());
667  }
668 
669  ++statusMatch[recstatus];
670 
671  if (recstatus == RecStatus::WillRecord ||
672  recstatus == RecStatus::Pending ||
673  recstatus == RecStatus::Recording ||
674  recstatus == RecStatus::Tuning ||
675  recstatus == RecStatus::Failing)
676  {
677  ++sourceMatch[s->GetSourceID()];
678  int inputid = s->GetInputID();
679  // When schedgroup is used, always attribute recordings to
680  // the parent inputs.
681  if (cardParent[inputid] && cardSchedGroup[cardParent[inputid]])
682  inputid = cardParent[inputid];
683  ++cardMatch[inputid];
684  if (s->GetRecordingPriority2() < 0)
685  ++lowerpriority;
686  if (s->GetVideoProperties() & VID_HDTV)
687  ++hdflag;
688  }
689  }
690 
691 #define ADD_STATUS_LOG_LINE(rtype, fstate) \
692  do { \
693  if (statusMatch[rtype] > 0) \
694  { \
695  tmpstr = QString("%1 %2").arg(statusMatch[rtype]) \
696  .arg(statusText[rtype]); \
697  AddLogLine(tmpstr, helpmsg, tmpstr, tmpstr, fstate);\
698  } \
699  } while (false)
710 
711  QString willrec = statusText[RecStatus::WillRecord];
712 
713  if (lowerpriority > 0)
714  {
715  tmpstr = QString("%1 %2 %3").arg(QString::number(lowerpriority),
716  willrec, tr("with lower priority"));
717  AddLogLine(tmpstr, helpmsg, tmpstr, tmpstr, "warning");
718  }
719  if (hdflag > 0)
720  {
721  tmpstr = QString("%1 %2 %3").arg(QString::number(hdflag),
722  willrec, tr("marked as HDTV"));
723  AddLogLine(tmpstr, helpmsg);
724  }
725  for (int i = 1; i <= maxSource; ++i)
726  {
727  if (sourceMatch[i] > 0)
728  {
729  tmpstr = QString("%1 %2 %3 %4 \"%5\"")
730  .arg(QString::number(sourceMatch[i]), willrec,
731  tr("from source"), QString::number(i), sourceText[i]);
732  AddLogLine(tmpstr, helpmsg);
733  }
734  }
735  for (int i = 1; i <= maxCard; ++i)
736  {
737  if (cardMatch[i] > 0)
738  {
739  tmpstr = QString("%1 %2 %3 %4 \"%5\"")
740  .arg(QString::number(cardMatch[i]), willrec,
741  tr("on input"), QString::number(i), cardText[i]);
742  AddLogLine(tmpstr, helpmsg);
743  }
744  }
745 }
746 
748 {
749  struct info
750  {
751  int m_inputid {0};
752  bool m_schedgroup {false};
753  QString m_displayname;
754  int m_errored {0};
755  int m_unavailable {0};
756  int m_sleeping {0};
757  int m_recording {0};
758  int m_livetv {0};
759  int m_available {0};
760  QStringList m_recordings;
761  };
762  QMap<int, struct info> info;
763  QList<int> inputids;
764 
765  if (m_iconState)
766  m_iconState->DisplayState("tuner");
767  m_logList->Reset();
768 
769  QString helpmsg(tr("Input Status shows the current information "
770  "about the state of backend inputs"));
771  if (m_helpText)
772  m_helpText->SetText(helpmsg);
773  if (m_justHelpText)
774  m_justHelpText->SetText(helpmsg);
775 
776  MSqlQuery query(MSqlQuery::InitCon());
777  query.prepare(
778  "SELECT cardid, parentid, schedgroup, displayname "
779  "FROM capturecard ORDER BY cardid");
780 
781  if (!query.exec() || !query.isActive())
782  {
783  MythDB::DBError("StatusBox::doTunerStatus()", query);
784  return;
785  }
786 
787  while (query.next())
788  {
789  int inputid = query.value(0).toInt();
790  int parentid = query.value(1).toInt();
791 
792  // If this is a schedgroup child, attribute all status to the
793  // parent.
794  int infoid = inputid;
795  if (parentid && info[parentid].m_schedgroup)
796  infoid = parentid;
797  else
798  {
799  info[infoid].m_inputid = inputid;
800  info[infoid].m_schedgroup = query.value(2).toBool();
801  info[infoid].m_displayname = query.value(3).toString();
802  inputids.append(inputid);
803  }
804 
805  QString cmd = QString("QUERY_REMOTEENCODER %1").arg(inputid);
806  QStringList strlist( cmd );
807  strlist << "GET_STATE";
808 
810  int state = strlist[0].toInt();
811 
812  if (state == kState_Error)
813  {
814  strlist.clear();
815  strlist << QString("QUERY_REMOTEENCODER %1").arg(inputid);
816  strlist << "GET_SLEEPSTATUS";
817 
819  int sleepState = strlist[0].toInt();
820 
821  if (sleepState == -1)
822  info[infoid].m_errored += 1;
823  else if (sleepState == sStatus_Undefined)
824  info[infoid].m_unavailable += 1;
825  else
826  info[infoid].m_sleeping += 1;
827  }
828  else if (state == kState_RecordingOnly ||
829  state == kState_WatchingRecording)
830  info[infoid].m_recording += 1;
831  else if (state == kState_WatchingLiveTV)
832  info[infoid].m_livetv += 1;
833  else
834  info[infoid].m_available += 1;
835 
836  if (state == kState_RecordingOnly ||
837  state == kState_WatchingRecording ||
838  state == kState_WatchingLiveTV)
839  {
840  strlist = QStringList( QString("QUERY_RECORDER %1").arg(inputid));
841  strlist << "GET_RECORDING";
843  ProgramInfo pginfo(strlist);
844  if (pginfo.GetChanID())
845  {
846  QString titlesub = pginfo.GetTitle();
847  if (!pginfo.GetSubtitle().isEmpty())
848  titlesub += QString(" - ") + pginfo.GetSubtitle();
849  info[infoid].m_recordings += titlesub;
850  }
851  }
852  }
853 
854  for (int inputid : qAsConst(inputids))
855  {
856  QStringList statuslist;
857  if (info[inputid].m_errored)
858  statuslist << tr("%1 errored").arg(info[inputid].m_errored);
859  if (info[inputid].m_unavailable)
860  statuslist << tr("%1 unavailable").arg(info[inputid].m_unavailable);
861  if (info[inputid].m_sleeping)
862  statuslist << tr("%1 sleeping").arg(info[inputid].m_sleeping);
863  if (info[inputid].m_recording)
864  statuslist << tr("%1 recording").arg(info[inputid].m_recording);
865  if (info[inputid].m_livetv)
866  statuslist << tr("%1 live television").arg(info[inputid].m_livetv);
867  if (info[inputid].m_available)
868  statuslist << tr("%1 available").arg(info[inputid].m_available);
869 
870  QString fontstate;
871  if (info[inputid].m_errored)
872  fontstate = "error";
873  else if (info[inputid].m_unavailable || info[inputid].m_sleeping)
874  fontstate = "warning";
875 
876  QString shortstatus = tr("Input %1 %2: %3")
877  .arg(QString::number(inputid), info[inputid].m_displayname,
878  statuslist.join(tr(", ")));
879  QString longstatus = shortstatus + "\n" +
880  info[inputid].m_recordings.join("\n");
881 
882  AddLogLine(shortstatus, helpmsg, longstatus, longstatus, fontstate);
883  }
884 }
885 
887 {
888  if (m_iconState)
889  m_iconState->DisplayState("log");
890  m_logList->Reset();
891 
892  QString helpmsg(tr("Log Entries shows any unread log entries "
893  "from the system if you have logging enabled"));
894  if (m_helpText)
895  m_helpText->SetText(helpmsg);
896  if (m_justHelpText)
897  m_justHelpText->SetText(helpmsg);
898 
899  MSqlQuery query(MSqlQuery::InitCon());
900  query.prepare("SELECT logid, module, priority, logdate, host, "
901  "message, details "
902  "FROM mythlog WHERE acknowledged = 0 "
903  "AND priority <= :PRIORITY ORDER BY logdate DESC;");
904  query.bindValue(":PRIORITY", m_minLevel);
905 
906  if (query.exec())
907  {
908  QString line;
909  QString detail;
910  while (query.next())
911  {
912  line = QString("%1").arg(query.value(5).toString());
913 
914  detail = tr("On %1 from %2.%3\n%4\n")
915  .arg(MythDate::toString(
916  MythDate::as_utc(query.value(3).toDateTime()),
918  query.value(4).toString(),
919  query.value(1).toString(),
920  query.value(5).toString());
921 
922  QString tmp = query.value(6).toString();
923  if (!tmp.isEmpty())
924  detail.append(tmp);
925  else
926  detail.append(tr("No further details"));
927 
928  AddLogLine(line, helpmsg, detail, detail,
929  "", query.value(0).toString());
930  }
931 
932  if (query.size() == 0)
933  {
934  AddLogLine(tr("No items found at priority level %1 or lower.")
935  .arg(m_minLevel), helpmsg);
936  AddLogLine(tr("Use 1-8 to change priority level."), helpmsg);
937  }
938  }
939 }
940 
942 {
943  if (m_iconState)
944  m_iconState->DisplayState("jobqueue");
945  m_logList->Reset();
946 
947  QString helpmsg(tr("Job Queue shows any jobs currently in "
948  "MythTV's Job Queue such as a commercial "
949  "detection job."));
950  if (m_helpText)
951  m_helpText->SetText(helpmsg);
952  if (m_justHelpText)
953  m_justHelpText->SetText(helpmsg);
954 
955  QMap<int, JobQueueEntry> jobs;
956  QMap<int, JobQueueEntry>::Iterator it;
957 
961 
962  if (!jobs.empty())
963  {
964  QString detail;
965  QString line;
966 
967  for (it = jobs.begin(); it != jobs.end(); ++it)
968  {
969  ProgramInfo pginfo((*it).chanid, (*it).recstartts);
970 
971  if (!pginfo.GetChanID())
972  continue;
973 
974  detail = QString("%1\n%2 %3 @ %4\n%5 %6 %7 %8")
975  .arg(pginfo.GetTitle(),
976  pginfo.GetChannelName(),
977  pginfo.GetChanNum(),
979  pginfo.GetRecordingStartTime(),
981  tr("Job:"),
982  JobQueue::JobText((*it).type),
983  tr("Status: "),
984  JobQueue::StatusText((*it).status));
985 
986  if ((*it).status != JOB_QUEUED)
987  detail += " (" + (*it).hostname + ')';
988 
989  if ((*it).schedruntime > MythDate::current())
990  {
991  detail += '\n' + tr("Scheduled Run Time:") + ' ' +
993  (*it).schedruntime,
995  }
996  else
997  {
998  detail += '\n' + (*it).comment;
999  }
1000 
1001  line = QString("%1 @ %2")
1002  .arg(pginfo.GetTitle(),
1004  pginfo.GetRecordingStartTime(),
1006 
1007  QString font;
1008  if ((*it).status == JOB_ERRORED)
1009  font = "error";
1010  else if ((*it).status == JOB_ABORTED)
1011  font = "warning";
1012 
1013  AddLogLine(line, helpmsg, detail, detail, font,
1014  QString("%1").arg((*it).id));
1015  }
1016  }
1017  else
1018  AddLogLine(tr("Job Queue is currently empty."), helpmsg);
1019 
1020 }
1021 
1022 // Some helper routines for doMachineStatus() that format the output strings
1023 
1031 static QString sm_str(long long sizeKB, int prec=1)
1032 {
1033  if (sizeKB>1024*1024*1024) // Terabytes
1034  {
1035  double sizeGB = sizeKB/(1024*1024*1024.0);
1036  return QObject::tr("%1 TB").arg(sizeGB, 0, 'f', (sizeGB>10)?0:prec);
1037  }
1038  if (sizeKB>1024*1024) // Gigabytes
1039  {
1040  double sizeGB = sizeKB/(1024*1024.0);
1041  return QObject::tr("%1 GB").arg(sizeGB, 0, 'f', (sizeGB>10)?0:prec);
1042  }
1043  if (sizeKB>1024) // Megabytes
1044  {
1045  double sizeMB = sizeKB/1024.0;
1046  return QObject::tr("%1 MB").arg(sizeMB, 0, 'f', (sizeMB>10)?0:prec);
1047  }
1048  // Kilobytes
1049  return QObject::tr("%1 KB").arg(sizeKB);
1050 }
1051 
1052 static QString usage_str_kb(long long total,
1053  long long used,
1054  long long free)
1055 {
1056  QString ret = QObject::tr("Unknown");
1057  if (total > 0.0 && free > 0.0)
1058  {
1059  double percent = (100.0*free)/total;
1060  ret = StatusBox::tr("%1 total, %2 used, %3 (or %4%) free.")
1061  .arg(sm_str(total), sm_str(used),
1062  sm_str(free)).arg(percent, 0, 'f', (percent >= 10.0) ? 0 : 2);
1063  }
1064  return ret;
1065 }
1066 
1067 static QString usage_str_mb(float total, float used, float free)
1068 {
1069  return usage_str_kb((long long)(total*1024), (long long)(used*1024),
1070  (long long)(free*1024));
1071 }
1072 
1073 static void disk_usage_with_rec_time_kb(QStringList& out, long long total,
1074  long long used, long long free,
1075  const recprof2bps_t& prof2bps)
1076 {
1077  const QString tail = StatusBox::tr(", using your %1 rate of %2 kb/s");
1078 
1079  out<<usage_str_kb(total, used, free);
1080  if (free<0)
1081  return;
1082 
1083  // NOLINTNEXTLINE(modernize-loop-convert)
1084  for (auto it = prof2bps.begin(); it != prof2bps.end(); ++it)
1085  {
1086  const QString pro =
1087  tail.arg(it.key()).arg((int)((float)(*it) / 1024.0F));
1088 
1089  long long bytesPerMin = ((*it) >> 1) * 15;
1090  uint minLeft = ((free<<5)/bytesPerMin)<<5;
1091  minLeft = (minLeft/15)*15;
1092  uint hoursLeft = minLeft/60;
1093  QString hourstring = StatusBox::tr("%n hour(s)", "", hoursLeft);
1094  QString minstring = StatusBox::tr("%n minute(s)", "", minLeft%60);
1095  QString remainstring = StatusBox::tr("%1 remaining", "time");
1096  if (minLeft%60 == 0)
1097  out<<remainstring.arg(hourstring) + pro;
1098  else if (minLeft > 60)
1099  {
1100  out<<StatusBox::tr("%1 and %2 remaining", "time")
1101  .arg(hourstring, minstring) + pro;
1102  }
1103  else
1104  {
1105  out<<remainstring.arg(minstring) + pro;
1106  }
1107  }
1108 }
1109 
1110 static QString uptimeStr(std::chrono::seconds uptime)
1111 {
1112  QString str = " " + StatusBox::tr("Uptime") + ": ";
1113 
1114  if (uptime == 0s)
1115  return str + StatusBox::tr("unknown", "unknown uptime");
1116 
1117  auto days = duration_cast<std::chrono::days>(uptime);
1118  auto secs = uptime % 24h;
1119 
1120  QString astext;
1121  if (days.count() > 0)
1122  {
1123  astext = QString("%1, %2")
1124  .arg(StatusBox::tr("%n day(s)", "", days.count()),
1125  MythFormatTime(secs, "H:mm"));
1126  } else {
1127  astext = MythFormatTime(secs, "H:mm:ss");
1128  }
1129  return str + astext;
1130 }
1131 
1135 void StatusBox::getActualRecordedBPS(const QString& hostnames)
1136 {
1137  m_recordingProfilesBps.clear();
1138 
1139  QString querystr;
1140  MSqlQuery query(MSqlQuery::InitCon());
1141 
1142  querystr =
1143  "SELECT sum(filesize) * 8 / "
1144  "sum(((unix_timestamp(endtime) - unix_timestamp(starttime)))) "
1145  "AS avg_bitrate "
1146  "FROM recorded WHERE hostname in (%1) "
1147  "AND (unix_timestamp(endtime) - unix_timestamp(starttime)) > 300;";
1148 
1149  query.prepare(querystr.arg(hostnames));
1150 
1151  if (query.exec() && query.next() &&
1152  query.value(0).toDouble() > 0)
1153  {
1154  QString rateStr = tr("average", "average rate");
1155 
1156  // Don't user a tr() directly here as the Qt tools will
1157  // not be able to extract the string for translation.
1158  m_recordingProfilesBps[rateStr] =
1159  (int)(query.value(0).toDouble());
1160  }
1161 
1162  querystr =
1163  "SELECT max(filesize * 8 / "
1164  "(unix_timestamp(endtime) - unix_timestamp(starttime))) "
1165  "AS max_bitrate "
1166  "FROM recorded WHERE hostname in (%1) "
1167  "AND (unix_timestamp(endtime) - unix_timestamp(starttime)) > 300;";
1168 
1169  query.prepare(querystr.arg(hostnames));
1170 
1171  if (query.exec() && query.next() &&
1172  query.value(0).toDouble() > 0)
1173  {
1174  QString rateStr = tr("maximum", "maximum rate");
1175 
1176  // Don't user a tr() directly here as the Qt tools will
1177  // not be able to extract the string for translation.
1178  m_recordingProfilesBps[rateStr] =
1179  (int)(query.value(0).toDouble());
1180  }
1181 }
1182 
1192 {
1193  if (m_iconState)
1194  m_iconState->DisplayState("machine");
1195  m_logList->Reset();
1196  QString machineStr = tr("Machine Status shows some operating system "
1197  "statistics of this machine and the MythTV "
1198  "server.");
1199 
1200  if (m_helpText)
1201  m_helpText->SetText(machineStr);
1202  if (m_justHelpText)
1203  m_justHelpText->SetText(machineStr);
1204 
1205  QString line;
1206  if (m_isBackendActive)
1207  line = tr("System:");
1208  else
1209  line = tr("This machine:");
1210  AddLogLine(line, machineStr);
1211 
1212  // Time
1213  StatusBoxItem *timebox = AddLogLine("");
1214  auto UpdateTime = [](StatusBoxItem* Item)
1215  {
1216  Item->SetText(" " + tr("System time") + ": " + QDateTime::currentDateTime().toString());
1217  };
1218  UpdateTime(timebox);
1219  connect(timebox, &StatusBoxItem::UpdateRequired, UpdateTime);
1220  timebox->Start();
1221 
1222  // Hostname & IP
1223  AddLogLine(" " + tr("Hostname") + ": " + gCoreContext->GetHostName());
1224  AddLogLine(" " + tr("OS") + QString(": %1 (%2)").arg(QSysInfo::prettyProductName(),
1225  QSysInfo::currentCpuArchitecture()));
1226  AddLogLine(" " + tr("Qt version") + QString(": %1").arg(qVersion()));
1227 
1228  QList allInterfaces = QNetworkInterface::allInterfaces();
1229  for (const QNetworkInterface & iface : qAsConst(allInterfaces))
1230  {
1231  QNetworkInterface::InterfaceFlags f = iface.flags();
1232  if (!(f & QNetworkInterface::IsUp))
1233  continue;
1234  if (!(f & QNetworkInterface::IsRunning))
1235  continue;
1236  if ((f & QNetworkInterface::IsLoopBack) != 0U)
1237  continue;
1238 
1239 #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
1240  QNetworkInterface::InterfaceType type = iface.type();
1241  QString name = type == QNetworkInterface::Wifi ? tr("WiFi") : tr("Ethernet");
1242 #else
1243  QString name = tr("Network");
1244 #endif
1245  AddLogLine(" " + name + QString(" (%1): ").arg(iface.humanReadableName()));
1246  AddLogLine(" " + tr("MAC Address") + ": " + iface.hardwareAddress());
1247  QList addresses = iface.addressEntries();
1248  for (const QNetworkAddressEntry & addr : qAsConst(addresses))
1249  {
1250  if (addr.ip().protocol() == QAbstractSocket::IPv4Protocol ||
1251  addr.ip().protocol() == QAbstractSocket::IPv6Protocol)
1252  {
1253  AddLogLine(" " + tr("IP Address") + ": " + addr.ip().toString());
1254  }
1255  }
1256  }
1257  AddLogLine(line, machineStr);
1258 
1259  // uptime
1260  std::chrono::seconds uptime = 0s;
1261  if (getUptime(uptime))
1262  {
1263  auto UpdateUptime = [](StatusBoxItem* Item)
1264  {
1265  std::chrono::seconds time = 0s;
1266  if (getUptime(time))
1267  Item->SetText(uptimeStr(time));
1268  };
1269  StatusBoxItem *uptimeitem = AddLogLine(uptimeStr(uptime));
1270  connect(uptimeitem, &StatusBoxItem::UpdateRequired, UpdateUptime);
1271  uptimeitem->Start(1min);
1272  }
1273 
1274  // weighted average loads
1275 #if !defined(_WIN32) && !defined(Q_OS_ANDROID)
1276  auto UpdateLoad = [](StatusBoxItem* Item)
1277  {
1278  loadArray loads = getLoadAvgs();
1279  Item->SetText(QString(" %1: %2 %3 %4").arg(tr("Load")).arg(loads[0], 1, 'f', 2)
1280  .arg(loads[1], 1, 'f', 2).arg(loads[2], 1, 'f', 2));
1281  };
1282  StatusBoxItem* loaditem = AddLogLine("");
1283  UpdateLoad(loaditem);
1284  connect(loaditem, &StatusBoxItem::UpdateRequired, UpdateLoad);
1285  loaditem->Start();
1286 #endif
1287 
1288  // memory usage
1289  int totalM = 0; // Physical memory
1290  int freeM = 0;
1291  int totalS = 0; // Virtual memory (swap)
1292  int freeS = 0;
1293  if (getMemStats(totalM, freeM, totalS, freeS))
1294  {
1295  auto UpdateMem = [](StatusBoxItem* Item)
1296  {
1297  int totm = 0;
1298  int freem = 0;
1299  int tots = 0;
1300  int frees = 0;
1301  if (getMemStats(totm, freem, tots, frees))
1302  Item->SetText(QString(" " + tr("RAM") + ": " + usage_str_mb(totm, totm - freem, freem)));
1303  };
1304 
1305  auto UpdateSwap = [](StatusBoxItem* Item)
1306  {
1307  int totm = 0;
1308  int freem = 0;
1309  int tots = 0;
1310  int frees = 0;
1311  if (getMemStats(totm, freem, tots, frees))
1312  Item->SetText(QString(" " + tr("Swap") + ": " + usage_str_mb(tots, tots - frees, frees)));
1313  };
1314  StatusBoxItem* mem = AddLogLine("", machineStr);
1315  StatusBoxItem* swap = AddLogLine("", machineStr);
1316  UpdateMem(mem);
1317  UpdateSwap(swap);
1318  connect(mem, &StatusBoxItem::UpdateRequired, UpdateMem);
1319  connect(swap, &StatusBoxItem::UpdateRequired, UpdateSwap);
1320  mem->Start(3s);
1321  swap->Start(3s);
1322  }
1323 
1324  if (!m_isBackendActive)
1325  {
1326  line = tr("MythTV server") + ':';
1327  AddLogLine(line, machineStr);
1328 
1329  // Hostname & IP
1330  line = " " + tr("Hostname") + ": " + gCoreContext->GetSetting("MasterServerName");
1331  line.append(", " + tr("IP") + ": " + gCoreContext->GetSetting("MasterServerIP"));
1332  AddLogLine(line, machineStr);
1333 
1334  // uptime
1335  if (RemoteGetUptime(uptime))
1336  {
1337  auto UpdateRemoteUptime = [](StatusBoxItem* Item)
1338  {
1339  std::chrono::seconds time = 0s;
1340  RemoteGetUptime(time);
1341  Item->SetText(uptimeStr(time));
1342  };
1343  StatusBoxItem *remoteuptime = AddLogLine(uptimeStr(uptime));
1344  connect(remoteuptime, &StatusBoxItem::UpdateRequired, UpdateRemoteUptime);
1345  remoteuptime->Start(1min);
1346  }
1347 
1348  // weighted average loads
1349  system_load_array floads;
1350  if (RemoteGetLoad(floads))
1351  {
1352  auto UpdateRemoteLoad = [](StatusBoxItem* Item)
1353  {
1354  system_load_array loads = { 0.0, 0.0, 0.0 };
1355  RemoteGetLoad(loads);
1356  Item->SetText(QString(" %1: %2 %3 %4").arg(tr("Load")).arg(loads[0], 1, 'f', 2)
1357  .arg(loads[1], 1, 'f', 2).arg(loads[2], 1, 'f', 2));
1358  };
1359  StatusBoxItem* remoteloaditem = AddLogLine("");
1360  UpdateRemoteLoad(remoteloaditem);
1361  connect(remoteloaditem, &StatusBoxItem::UpdateRequired, UpdateRemoteLoad);
1362  remoteloaditem->Start();
1363  }
1364 
1365  // memory usage
1366  if (RemoteGetMemStats(totalM, freeM, totalS, freeS))
1367  {
1368  auto UpdateRemoteMem = [](StatusBoxItem* Item)
1369  {
1370  int totm = 0;
1371  int freem = 0;
1372  int tots = 0;
1373  int frees = 0;
1374  if (RemoteGetMemStats(totm, freem, tots, frees))
1375  Item->SetText(QString(" " + tr("RAM") + ": " + usage_str_mb(totm, totm - freem, freem)));
1376  };
1377 
1378  auto UpdateRemoteSwap = [](StatusBoxItem* Item)
1379  {
1380  int totm = 0;
1381  int freem = 0;
1382  int tots = 0;
1383  int frees = 0;
1384  if (RemoteGetMemStats(totm, freem, tots, frees))
1385  Item->SetText(QString(" " + tr("Swap") + ": " + usage_str_mb(tots, tots - frees, frees)));
1386  };
1387  StatusBoxItem* rmem = AddLogLine("", machineStr);
1388  StatusBoxItem* rswap = AddLogLine("", machineStr);
1389  UpdateRemoteMem(rmem);
1390  UpdateRemoteSwap(rswap);
1391  connect(rmem, &StatusBoxItem::UpdateRequired, UpdateRemoteMem);
1392  connect(rswap, &StatusBoxItem::UpdateRequired, UpdateRemoteSwap);
1393  rmem->Start(10s);
1394  rswap->Start(11s);
1395  }
1396  }
1397 
1398  // get free disk space
1399  QString hostnames;
1400 
1401  QList<FileSystemInfo> fsInfos = FileSystemInfo::RemoteGetInfo();
1402  for (int i = 0; i < fsInfos.size(); ++i)
1403  {
1404  // For a single-directory installation just display the totals
1405  if ((fsInfos.size() == 2) && (i == 0) &&
1406  (fsInfos[i].getPath() != "TotalDiskSpace") &&
1407  (fsInfos[i+1].getPath() == "TotalDiskSpace"))
1408  i++;
1409 
1410  hostnames = QString("\"%1\"").arg(fsInfos[i].getHostname());
1411  hostnames.replace(' ', "");
1412  hostnames.replace(',', "\",\"");
1413 
1414  getActualRecordedBPS(hostnames);
1415 
1416  QStringList list;
1418  fsInfos[i].getTotalSpace(), fsInfos[i].getUsedSpace(),
1419  fsInfos[i].getTotalSpace() - fsInfos[i].getUsedSpace(),
1421 
1422  if (fsInfos[i].getPath() == "TotalDiskSpace")
1423  {
1424  line = tr("Total Disk Space:");
1425  AddLogLine(line, machineStr);
1426  }
1427  else
1428  {
1429  line = tr("MythTV Drive #%1:").arg(fsInfos[i].getFSysID());
1430  AddLogLine(line, machineStr);
1431 
1432  QStringList tokens = fsInfos[i].getPath().split(',');
1433 
1434  if (tokens.size() > 1)
1435  {
1436  AddLogLine(QString(" ") + tr("Directories:"), machineStr);
1437 
1438  int curToken = 0;
1439  while (curToken < tokens.size())
1440  AddLogLine(QString(" ") +
1441  tokens[curToken++], machineStr);
1442  }
1443  else
1444  {
1445  AddLogLine(QString(" " ) + tr("Directory:") + ' ' +
1446  fsInfos[i].getPath(), machineStr);
1447  }
1448  }
1449 
1450  for (auto & diskinfo : list)
1451  {
1452  line = QString(" ") + diskinfo;
1453  AddLogLine(line, machineStr);
1454  }
1455  }
1456 
1457 }
1458 
1460 {
1461  if (m_iconState)
1462  m_iconState->DisplayState("decoders");
1463  m_logList->Reset();
1464  QString displayhelp = tr("Available hardware decoders for video playback.");
1465  if (m_helpText)
1466  m_helpText->SetText(displayhelp);
1467  if (m_justHelpText)
1468  m_justHelpText->SetText(displayhelp);
1469 
1470  QStringList decoders = MythCodecContext::GetDecoderDescription();
1471  if (decoders.isEmpty())
1472  {
1473  AddLogLine(tr("None"));
1474  }
1475  else
1476  {
1477  for (const QString & decoder : qAsConst(decoders))
1478  AddLogLine(decoder);
1479  }
1480 }
1481 
1483 {
1484  if (m_iconState)
1485  m_iconState->DisplayState("display");
1486  m_logList->Reset();
1487  auto displayhelp = tr("Display information.");
1488  if (m_helpText)
1489  m_helpText->SetText(displayhelp);
1490  if (m_justHelpText)
1491  m_justHelpText->SetText(displayhelp);
1492 
1493  auto desc = GetMythMainWindow()->GetDisplay()->GetDescription();
1494  for (const auto & line : qAsConst(desc))
1495  AddLogLine(line);
1496 }
1497 
1499 {
1500  if (m_iconState)
1501  m_iconState->DisplayState("render");
1502  m_logList->Reset();
1503  auto displayhelp = tr("Render information.");
1504  if (m_helpText)
1505  m_helpText->SetText(displayhelp);
1506  if (m_justHelpText)
1507  m_justHelpText->SetText(displayhelp);
1508 
1509  auto * render = GetMythMainWindow()->GetRenderDevice();
1510  if (render && render->Type() == kRenderOpenGL)
1511  {
1512  auto * opengl = dynamic_cast<MythRenderOpenGL*>(render);
1513 
1514  if (opengl)
1515  {
1516  auto UpdateFPS = [](StatusBoxItem* Item)
1517  {
1518  uint64_t swapcount = 0;
1519  auto * rend = GetMythMainWindow()->GetRenderDevice();
1520  if (auto * gl = dynamic_cast<MythRenderOpenGL*>(rend); gl != nullptr)
1521  swapcount = gl->GetSwapCount();
1522  Item->SetText(tr("Current fps: %1").arg(swapcount));
1523  };
1524 
1525  auto * fps = AddLogLine("");
1526  // Reset the frame counter
1527  (void)opengl->GetSwapCount();
1528  UpdateFPS(fps);
1529  connect(fps, &StatusBoxItem::UpdateRequired, UpdateFPS);
1530  fps->Start();
1531  }
1532 
1533  if (opengl && (opengl->GetExtraFeatures() & kGLNVMemory))
1534  {
1535  auto GetGPUMem = []()
1536  {
1537  auto * rend = GetMythMainWindow()->GetRenderDevice();
1538  if (auto * gl = dynamic_cast<MythRenderOpenGL*>(rend); gl != nullptr)
1539  return gl->GetGPUMemory();
1540  return std::tuple<int,int,int> { 0, 0, 0 };
1541  };
1542  auto UpdateUsed = [&GetGPUMem](StatusBoxItem* Item)
1543  {
1544  auto mem = GetGPUMem();
1545  int total = std::get<0>(mem);
1546  if (total > 0)
1547  {
1548  int avail = std::get<2>(mem);
1549  Item->SetText(tr("GPU memory used : %1MB").arg(total - avail));
1550  }
1551  };
1552 
1553  auto UpdateFree = [&GetGPUMem](StatusBoxItem* Item)
1554  {
1555  auto mem = GetGPUMem();
1556  int total = std::get<0>(mem);
1557  if (total > 0)
1558  {
1559  int avail = std::get<2>(mem);
1560  int percent = static_cast<int>((avail / static_cast<float>(total) * 100.0F));
1561  Item->SetText(tr("GPU memory free : %1MB (or %2%)").arg(avail).arg(percent));
1562  }
1563  };
1564 
1565  auto current = GetGPUMem();
1566  // Total and dedicated will not change
1567  AddLogLine(tr("GPU memory total : %1MB").arg(std::get<0>(current)));
1568  AddLogLine(tr("GPU memory dedicated: %1MB").arg(std::get<1>(current)));
1569  auto * used = AddLogLine("");
1570  auto * freemem = AddLogLine("");
1571  UpdateUsed(used);
1572  UpdateFree(freemem);
1573  connect(used, &StatusBoxItem::UpdateRequired, UpdateUsed);
1574  connect(freemem, &StatusBoxItem::UpdateRequired, UpdateFree);
1575  used->Start();
1576  freemem->Start();
1577  }
1578 
1579  auto desc = render->GetDescription();
1580  for (const auto & line : qAsConst(desc))
1581  AddLogLine(line);
1582  }
1583 }
1584 
1588 void StatusBox::doAutoExpireList(bool updateExpList)
1589 {
1590  if (m_iconState)
1591  m_iconState->DisplayState("autoexpire");
1592  m_logList->Reset();
1593 
1594  QString helpmsg(tr("The AutoExpire List shows all recordings "
1595  "which may be expired and the order of "
1596  "their expiration. Recordings at the top "
1597  "of the list will be expired first."));
1598  if (m_helpText)
1599  m_helpText->SetText(helpmsg);
1600  if (m_justHelpText)
1601  m_justHelpText->SetText(helpmsg);
1602 
1603  QString contentLine;
1604  QString detailInfo;
1605  QString staticInfo;
1606  long long totalSize(0);
1607  long long liveTVSize(0);
1608  int liveTVCount(0);
1609  long long deletedGroupSize(0);
1610  int deletedGroupCount(0);
1611 
1612  vector<ProgramInfo *>::iterator it;
1613 
1614  if (updateExpList)
1615  {
1616  for (it = m_expList.begin(); it != m_expList.end(); ++it)
1617  delete *it;
1618  m_expList.clear();
1619 
1621  }
1622 
1623  for (it = m_expList.begin(); it != m_expList.end(); ++it)
1624  {
1625  ProgramInfo *pginfo = *it;
1626 
1627  totalSize += pginfo->GetFilesize();
1628  if (pginfo->GetRecordingGroup() == "LiveTV")
1629  {
1630  liveTVSize += pginfo->GetFilesize();
1631  liveTVCount++;
1632  }
1633  else if (pginfo->GetRecordingGroup() == "Deleted")
1634  {
1635  deletedGroupSize += pginfo->GetFilesize();
1636  deletedGroupCount++;
1637  }
1638  }
1639 
1640  staticInfo = tr("%n recording(s) consuming %1 (is) allowed to expire\n", "",
1641  m_expList.size()).arg(sm_str(totalSize / 1024));
1642 
1643  if (liveTVCount)
1644  staticInfo += tr("%n (is) LiveTV and consume(s) %1\n", "", liveTVCount)
1645  .arg(sm_str(liveTVSize / 1024));
1646 
1647  if (deletedGroupCount)
1648  {
1649  staticInfo += tr("%n (is) Deleted and consume(s) %1\n", "",
1650  deletedGroupCount)
1651  .arg(sm_str(deletedGroupSize / 1024));
1652  }
1653 
1654  for (it = m_expList.begin(); it != m_expList.end(); ++it)
1655  {
1656  ProgramInfo *pginfo = *it;
1657  QDateTime starttime = pginfo->GetRecordingStartTime();
1658  QDateTime endtime = pginfo->GetRecordingEndTime();
1659  contentLine =
1661  starttime, MythDate::kDateFull | MythDate::kSimplify) + " - ";
1662 
1663  contentLine +=
1664  "(" + ProgramInfo::i18n(pginfo->GetRecordingGroup()) + ") ";
1665 
1666  contentLine += pginfo->GetTitle() +
1667  " (" + sm_str(pginfo->GetFilesize() / 1024) + ")";
1668 
1669  detailInfo =
1672  " - " +
1675 
1676  detailInfo += " (" + sm_str(pginfo->GetFilesize() / 1024) + ")";
1677 
1678  detailInfo += " (" + ProgramInfo::i18n(pginfo->GetRecordingGroup()) + ")";
1679 
1680  detailInfo += "\n" + pginfo->toString(ProgramInfo::kTitleSubtitle, " - ");
1681 
1682  AddLogLine(contentLine, staticInfo, detailInfo,
1683  staticInfo + detailInfo);
1684  }
1685 }
1686 
1688 
1689 /* vim: set expandtab tabstop=4 shiftwidth=4: */
filesysteminfo.h
MSqlQuery::isActive
bool isActive(void) const
Definition: mythdbcon.h:213
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:806
RecStatus::Type
Type
Definition: recStatus.h:16
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
RecStatus::LaterShowing
@ LaterShowing
Definition: recStatus.h:40
MythUIButtonList::GetTopItemPos
int GetTopItemPos(void) const
Definition: mythuibuttonlist.h:226
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(GrabberScript *)
RecordingInfo::kDefaultRecGroup
@ kDefaultRecGroup
Definition: recordinginfo.h:191
MythDate::toString
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:80
tv.h
MSqlQuery::size
int size(void) const
Definition: mythdbcon.h:212
MythUIButtonList::GetItemCurrent
MythUIButtonListItem * GetItemCurrent() const
Definition: mythuibuttonlist.cpp:1590
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:103
ProgramInfo::GetFilesize
virtual uint64_t GetFilesize(void) const
Definition: programinfo.cpp:6283
kGLNVMemory
@ kGLNVMemory
Definition: mythrenderopengl.h:51
mythuitext.h
LoadFromScheduler
bool LoadFromScheduler(AutoDeleteDeque< TYPE * > &destination, bool &hasConflicts, const QString &altTable="", int recordid=-1)
Definition: programinfo.h:895
mythdb.h
MythCoreContext::SendReceiveStringList
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
Definition: mythcorecontext.cpp:1395
StatusBox::Init
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
Definition: statusbox.cpp:110
MythDate::as_utc
QDateTime as_utc(const QDateTime &old_dt)
Returns copy of QDateTime with TimeSpec set to UTC.
Definition: mythdate.cpp:23
StatusBox::doAutoExpireList
void doAutoExpireList()
Show list of recordings which may AutoExpire.
Definition: statusbox.h:66
RecStatus::Tuning
@ Tuning
Definition: recStatus.h:22
RecordingInfo
Holds information on a TV Program one might wish to record.
Definition: recordinginfo.h:35
StatusBox::getActualRecordedBPS
void getActualRecordedBPS(const QString &hostnames)
Fills in m_recordingProfilesBps w/ average bitrate from recorded table.
Definition: statusbox.cpp:1135
MythUIType::GetChild
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Definition: mythuitype.cpp:131
MythUIButtonList::RemoveItem
void RemoveItem(MythUIButtonListItem *item)
Definition: mythuibuttonlist.cpp:1488
ProgramInfo::GetChannelName
QString GetChannelName(void) const
This is the channel name in the local market, i.e.
Definition: programinfo.h:386
StatusBox::AddLogLine
StatusBoxItem * AddLogLine(const QString &line, const QString &help="", const QString &detail="", const QString &helpdetail="", const QString &state="", const QString &data="")
Definition: statusbox.cpp:152
LogLine::m_data
QString m_data
Definition: statusbox.cpp:39
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
ProgramInfo::GetChanNum
QString GetChanNum(void) const
This is the channel "number", in the form 1, 1_2, 1-2, 1#1, etc.
Definition: programinfo.h:376
MythUIButtonList::itemSelected
void itemSelected(MythUIButtonListItem *item)
getLoadAvgs
loadArray getLoadAvgs(void)
Returns the system load averages.
Definition: mythmiscutil.cpp:181
ProgramInfo::kTitleSubtitle
@ kTitleSubtitle
Definition: programinfo.h:510
mythdialogbox.h
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:202
MythScreenStack
Definition: mythscreenstack.h:16
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:607
JOB_LIST_NOT_DONE
@ JOB_LIST_NOT_DONE
Definition: jobqueue.h:67
kRenderOpenGL
@ kRenderOpenGL
Definition: mythrender_base.h:19
RemoteUndeleteRecording
bool RemoteUndeleteRecording(uint recordingID)
Definition: remoteutil.cpp:139
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
mythuistatetype.h
StatusBox::doDisplayStatus
void doDisplayStatus()
Definition: statusbox.cpp:1482
statusbox.h
StatusBox::Create
bool Create(void) override
Definition: statusbox.cpp:80
JobQueue::StopJob
static bool StopJob(int jobID)
Definition: jobqueue.cpp:751
StatusBox::~StatusBox
~StatusBox(void) override
Definition: statusbox.cpp:73
MythMainWindow::GetRenderDevice
MythRender * GetRenderDevice()
Definition: mythmainwindow.cpp:288
ProgramInfo::GetRecordingEndTime
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
Definition: programinfo.h:412
LogLine::m_state
QString m_state
Definition: statusbox.cpp:40
ProgramInfo::GetRecordingGroup
QString GetRecordingGroup(void) const
Definition: programinfo.h:419
remoteutil.h
mythuibuttonlist.h
MythDate::kDateTimeShort
@ kDateTimeShort
Default local time.
Definition: mythdate.h:24
LogLine::m_detail
QString m_detail
Definition: statusbox.cpp:36
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
kState_Error
@ kState_Error
Error State, if we ever try to enter this state errored is set.
Definition: tv.h:54
ProgramInfo::GetRecordingStartTime
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
Definition: programinfo.h:404
StatusBox::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: statusbox.cpp:190
tmp
static guint32 * tmp
Definition: goom_core.cpp:31
RemoteGetLoad
bool RemoteGetLoad(system_load_array &load)
Definition: remoteutil.cpp:39
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:112
StatusBox::setHelpText
void setHelpText(MythUIButtonListItem *item)
Definition: statusbox.cpp:218
mythversion.h
StatusBox::m_categoryList
MythUIButtonList * m_categoryList
Definition: statusbox.h:83
system_load_array
std::array< double, 3 > system_load_array
Definition: remoteutil.h:17
kState_WatchingRecording
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
Definition: tv.h:80
JobQueue::JobText
static QString JobText(int jobType)
Definition: jobqueue.cpp:1121
JobQueue::PauseJob
static bool PauseJob(int jobID)
Definition: jobqueue.cpp:724
MythMainWindow::GetDisplay
MythDisplay * GetDisplay()
Definition: mythmainwindow.cpp:249
RecStatus::WillRecord
@ WillRecord
Definition: recStatus.h:31
usage_str_mb
static QString usage_str_mb(float total, float used, float free)
Definition: statusbox.cpp:1067
MythUIButtonListItem
Definition: mythuibuttonlist.h:34
StatusBox::m_justHelpText
MythUIText * m_justHelpText
Definition: statusbox.h:82
kDisableAutoExpire
@ kDisableAutoExpire
Definition: programtypes.h:195
mythrenderopengl.h
MythUICallbackMF
void(QObject::*)(void) MythUICallbackMF
Definition: mythuitype.h:43
JobQueue::GetJobsInQueue
static int GetJobsInQueue(QMap< int, JobQueueEntry > &jobs, int findJobs=JOB_LIST_NOT_DONE)
Definition: jobqueue.cpp:1282
mythdate.h
mythrender_base.h
RecStatus::TooManyRecordings
@ TooManyRecordings
Definition: recStatus.h:37
mythdisplay.h
StatusBox::clicked
void clicked(MythUIButtonListItem *item)
Definition: statusbox.cpp:251
StatusBox::m_recordingProfilesBps
recprof2bps_t m_recordingProfilesBps
Definition: statusbox.h:87
mythlogging.h
FileSystemInfo::RemoteGetInfo
static QList< FileSystemInfo > RemoteGetInfo(MythSocket *sock=nullptr)
Definition: filesysteminfo.cpp:143
StatusBox::doListingsStatus
void doListingsStatus()
Definition: statusbox.cpp:449
MythUIButtonList::itemClicked
void itemClicked(MythUIButtonListItem *item)
StatusBox::updateLogList
void updateLogList(MythUIButtonListItem *item)
Definition: statusbox.cpp:230
MythMainWindow::TranslateKeyPress
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
Definition: mythmainwindow.cpp:1102
MythUIButtonList::GetCurrentPos
int GetCurrentPos() const
Definition: mythuibuttonlist.h:224
kTemplateRecord
@ kTemplateRecord
Definition: recordingtypes.h:32
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
StatusBox::doJobQueueStatus
void doJobQueueStatus()
Definition: statusbox.cpp:941
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:361
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:539
StatusBoxItem::Start
void Start(std::chrono::seconds Interval=1s)
Definition: statusbox.cpp:43
JobQueue::GetJobStatus
static enum JobStatus GetJobStatus(int jobID)
Definition: jobqueue.cpp:1528
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:226
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:205
RecStatus::Failing
@ Failing
Definition: recStatus.h:18
StatusBox::StatusBox
StatusBox(MythScreenStack *parent)
Definition: statusbox.cpp:58
StatusBox::doTunerStatus
void doTunerStatus()
Definition: statusbox.cpp:747
disk_usage_with_rec_time_kb
static void disk_usage_with_rec_time_kb(QStringList &out, long long total, long long used, long long free, const recprof2bps_t &prof2bps)
Definition: statusbox.cpp:1073
RecStatus::Conflict
@ Conflict
Definition: recStatus.h:39
ProgramInfo::toString
QString toString(Verbosity v=kLongDescription, const QString &sep=":", const QString &grp="\"") const
Definition: programinfo.cpp:1933
loadArray
std::array< double, 3 > loadArray
Definition: mythmiscutil.h:37
jobqueue.h
kNoSearch
@ kNoSearch
Definition: recordingtypes.h:73
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3648
uint
unsigned int uint
Definition: compat.h:144
StatusBox::doDecoderStatus
void doDecoderStatus()
Definition: statusbox.cpp:1459
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
MythFormatTime
QString MythFormatTime(std::chrono::milliseconds msecs, const QString &fmt)
Format a milliseconds time value.
Definition: mythmiscutil.cpp:1238
StatusBox::m_logList
MythUIButtonList * m_logList
Definition: statusbox.h:84
getUptime
bool getUptime(std::chrono::seconds &uptime)
Definition: mythmiscutil.cpp:71
StatusBox::updateLog
void updateLog()
ProgramInfo::i18n
static QString i18n(const QString &msg)
Translations for play,recording, & storage groups +.
Definition: programinfo.cpp:5303
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:936
GetMythSourcePath
const char * GetMythSourcePath()
Definition: mythcoreutil.cpp:297
RemoteGetMemStats
bool RemoteGetMemStats(int &totalMB, int &freeMB, int &totalVM, int &freeVM)
Definition: remoteutil.cpp:74
MythDate::fromString
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:30
JobQueue::DeleteJob
static bool DeleteJob(int jobID)
Definition: jobqueue.cpp:881
RecStatus::Pending
@ Pending
Definition: recStatus.h:17
ADD_STATUS_LOG_LINE
#define ADD_STATUS_LOG_LINE(rtype, fstate)
MythDate::kSimplify
@ kSimplify
Do Today/Yesterday/Tomorrow transform.
Definition: mythdate.h:26
MythUIButtonListItem::GetText
QString GetText(const QString &name="") const
Definition: mythuibuttonlist.cpp:3318
AutoDeleteDeque< ProgramInfo * >
MythCodecContext::GetDecoderDescription
static QStringList GetDecoderDescription(void)
Definition: mythcodeccontext.cpp:115
sStatus_Undefined
@ sStatus_Undefined
A slave's sleep status is undefined when it has never connected to the master backend or is not able ...
Definition: tv.h:117
mythuihelper.h
MythRenderOpenGL
Definition: mythrenderopengl.h:99
recordinginfo.h
std::chrono::days
duration< CHRONO_TYPE, ratio< 86400 > > days
Definition: mythchrono.h:25
ProgramInfo::GetChanID
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:372
RemoteGetUptime
bool RemoteGetUptime(std::chrono::seconds &uptime)
Definition: remoteutil.cpp:54
RemoteGetAllExpiringRecordings
void RemoteGetAllExpiringRecordings(vector< ProgramInfo * > &expiringlist)
Definition: remoteutil.cpp:168
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:30
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:397
mythmiscutil.h
RecStatus::Recording
@ Recording
Definition: recStatus.h:30
StatusBox::m_popupStack
MythScreenStack * m_popupStack
Definition: statusbox.h:91
StatusBox::doRenderStatus
void doRenderStatus()
Definition: statusbox.cpp:1498
MythConfirmationDialog
Dialog asking for user confirmation. Ok and optional Cancel button.
Definition: mythdialogbox.h:271
mythcorecontext.h
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:692
cardutil.h
StatusBox::m_helpText
MythUIText * m_helpText
Definition: statusbox.h:81
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:882
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
recprof2bps_t
QMap< QString, unsigned int > recprof2bps_t
Definition: statusbox.h:21
StatusBoxItem
Definition: statusbox.h:23
RecStatus::NotListed
@ NotListed
Definition: recStatus.h:38
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:133
LogLine::m_line
QString m_line
Definition: statusbox.cpp:35
StatusBox::doLogEntries
void doLogEntries()
Definition: statusbox.cpp:886
mythchrono.h
MythUIButtonList::Reset
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuibuttonlist.cpp:114
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:101
kState_WatchingLiveTV
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
Definition: tv.h:63
MythUIButtonList::SetItemCurrent
void SetItemCurrent(MythUIButtonListItem *item)
Definition: mythuibuttonlist.cpp:1557
uptimeStr
static QString uptimeStr(std::chrono::seconds uptime)
Definition: statusbox.cpp:1110
build_compdb.action
action
Definition: build_compdb.py:9
JobQueue::ResumeJob
static bool ResumeJob(int jobID)
Definition: jobqueue.cpp:733
build_compdb.help
help
Definition: build_compdb.py:10
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:319
MythDate::kDateFull
@ kDateFull
Default local time.
Definition: mythdate.h:19
GetMythSourceVersion
const char * GetMythSourceVersion()
Definition: mythcoreutil.cpp:292
mythcodeccontext.h
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:862
getMemStats
bool getMemStats(int &totalMB, int &freeMB, int &totalVM, int &freeVM)
Returns memory statistics in megabytes.
Definition: mythmiscutil.cpp:114
JOB_LIST_RECENT
@ JOB_LIST_RECENT
Definition: jobqueue.h:69
StatusBox::m_iconState
MythUIStateType * m_iconState
Definition: statusbox.h:85
MythUICallbackMFc
void(QObject::*)(void) const MythUICallbackMFc
Definition: mythuitype.h:44
MythDisplay::GetDescription
QStringList GetDescription()
Definition: mythdisplay.cpp:135
MythDate::kDateTimeFull
@ kDateTimeFull
Default local time.
Definition: mythdate.h:23
RecStatus::toString
static QString toString(Type recstatus, uint id)
Converts "recstatus" into a short (unreadable) string.
Definition: recStatus.cpp:39
usage_str_kb
static QString usage_str_kb(long long total, long long used, long long free)
Definition: statusbox.cpp:1052
StatusBox::doScheduleStatus
void doScheduleStatus()
Definition: statusbox.cpp:543
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:905
StatusBox::m_expList
std::vector< ProgramInfo * > m_expList
Definition: statusbox.h:89
RecordingInfo::ApplyRecordRecGroupChange
void ApplyRecordRecGroupChange(const QString &newrecgroup)
Sets the recording group, both in this RecordingInfo and in the database.
Definition: recordinginfo.cpp:606
StatusBox::customEvent
void customEvent(QEvent *event) override
Definition: statusbox.cpp:353
jobID
int jobID
Definition: mythtv/programs/mythcommflag/main.cpp:82
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:177
JOB_LIST_ERROR
@ JOB_LIST_ERROR
Definition: jobqueue.h:68
JobQueue::ChangeJobStatus
static bool ChangeJobStatus(int jobID, int newStatus, const QString &comment="")
Definition: jobqueue.cpp:992
StatusBoxItem::UpdateRequired
void UpdateRequired(StatusBoxItem *Item)
RecStatus::LowDiskSpace
@ LowDiskSpace
Definition: recStatus.h:25
RemoteDeleteRecording
bool RemoteDeleteRecording(uint recordingID, bool forceMetadataDelete, bool forgetHistory)
Definition: remoteutil.cpp:110
sm_str
static QString sm_str(long long sizeKB, int prec=1)
Returns a short string describing an amount of space, choosing one of a number of useful units,...
Definition: statusbox.cpp:1031
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:50
LogLine::m_helpdetail
QString m_helpdetail
Definition: statusbox.cpp:38
kState_RecordingOnly
@ kState_RecordingOnly
Recording Only is a TVRec only state for when we are recording a program, but there is no one current...
Definition: tv.h:84
LogLine
Definition: statusbox.cpp:34
StatusBox::m_minLevel
int m_minLevel
Definition: statusbox.h:93
StatusBox::m_isBackendActive
bool m_isBackendActive
Definition: statusbox.h:95
MythUIStateType
This widget is used for grouping other widgets for display when a particular named state is called....
Definition: mythuistatetype.h:22
LogLine::m_help
QString m_help
Definition: statusbox.cpp:37
AutoDeleteDeque::size
size_t size(void) const
Definition: autodeletedeque.h:67
JobQueue::StatusText
static QString StatusText(int status)
Definition: jobqueue.cpp:1140
StatusBox::doMachineStatus
void doMachineStatus()
Show machine status.
Definition: statusbox.cpp:1191
MythUIStateType::DisplayState
bool DisplayState(const QString &name)
Definition: mythuistatetype.cpp:84
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:922
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:831
ProgramInfo::GetSubtitle
QString GetSubtitle(void) const
Definition: programinfo.h:363