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