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