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