MythTV  master
statusbox.cpp
Go to the documentation of this file.
1 // Qt
2 #include <QHostAddress>
3 #include <QNetworkInterface>
4 
5 // MythTV
6 #include "libmyth/remoteutil.h"
10 #include "libmythbase/mythdate.h"
11 #include "libmythbase/mythdb.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 #define ADD_STATUS_LOG_LINE(rtype, fstate) \
691  do { \
692  if (statusMatch[rtype] > 0) \
693  { \
694  tmpstr = QString("%1 %2").arg(statusMatch[rtype]) \
695  .arg(statusText[rtype]); \
696  AddLogLine(tmpstr, helpmsg, tmpstr, tmpstr, fstate);\
697  } \
698  } while (false)
709 
710  QString willrec = statusText[RecStatus::WillRecord];
711 
712  if (lowerpriority > 0)
713  {
714  tmpstr = QString("%1 %2 %3").arg(QString::number(lowerpriority),
715  willrec, tr("with lower priority"));
716  AddLogLine(tmpstr, helpmsg, tmpstr, tmpstr, "warning");
717  }
718  if (hdflag > 0)
719  {
720  tmpstr = QString("%1 %2 %3").arg(QString::number(hdflag),
721  willrec, tr("marked as HDTV"));
722  AddLogLine(tmpstr, helpmsg);
723  }
724  for (int i = 1; i <= maxSource; ++i)
725  {
726  if (sourceMatch[i] > 0)
727  {
728  tmpstr = QString("%1 %2 %3 %4 \"%5\"")
729  .arg(QString::number(sourceMatch[i]), willrec,
730  tr("from source"), QString::number(i), sourceText[i]);
731  AddLogLine(tmpstr, helpmsg);
732  }
733  }
734  for (int i = 1; i <= maxCard; ++i)
735  {
736  if (cardMatch[i] > 0)
737  {
738  tmpstr = QString("%1 %2 %3 %4 \"%5\"")
739  .arg(QString::number(cardMatch[i]), willrec,
740  tr("on input"), QString::number(i), cardText[i]);
741  AddLogLine(tmpstr, helpmsg);
742  }
743  }
744 }
745 
747 {
748  struct info
749  {
750  int m_inputid {0};
751  bool m_schedgroup {false};
752  QString m_displayname;
753  int m_errored {0};
754  int m_unavailable {0};
755  int m_sleeping {0};
756  int m_recording {0};
757  int m_livetv {0};
758  int m_available {0};
759  QStringList m_recordings;
760  };
761  QMap<int, struct info> info;
762  QList<int> inputids;
763 
764  if (m_iconState)
765  m_iconState->DisplayState("tuner");
766  m_logList->Reset();
767 
768  QString helpmsg(tr("Input Status shows the current information "
769  "about the state of backend inputs"));
770  if (m_helpText)
771  m_helpText->SetText(helpmsg);
772  if (m_justHelpText)
773  m_justHelpText->SetText(helpmsg);
774 
775  MSqlQuery query(MSqlQuery::InitCon());
776  query.prepare(
777  "SELECT cardid, parentid, schedgroup, displayname "
778  "FROM capturecard ORDER BY cardid");
779 
780  if (!query.exec() || !query.isActive())
781  {
782  MythDB::DBError("StatusBox::doTunerStatus()", query);
783  return;
784  }
785 
786  while (query.next())
787  {
788  int inputid = query.value(0).toInt();
789  int parentid = query.value(1).toInt();
790 
791  // If this is a schedgroup child, attribute all status to the
792  // parent.
793  int infoid = inputid;
794  if (parentid && info[parentid].m_schedgroup)
795  infoid = parentid;
796  else
797  {
798  info[infoid].m_inputid = inputid;
799  info[infoid].m_schedgroup = query.value(2).toBool();
800  info[infoid].m_displayname = query.value(3).toString();
801  inputids.append(inputid);
802  }
803 
804  QString cmd = QString("QUERY_REMOTEENCODER %1").arg(inputid);
805  QStringList strlist( cmd );
806  strlist << "GET_STATE";
807 
809  int state = strlist[0].toInt();
810 
811  if (state == kState_Error)
812  {
813  strlist.clear();
814  strlist << QString("QUERY_REMOTEENCODER %1").arg(inputid);
815  strlist << "GET_SLEEPSTATUS";
816 
818  int sleepState = strlist[0].toInt();
819 
820  if (sleepState == -1)
821  info[infoid].m_errored += 1;
822  else if (sleepState == sStatus_Undefined)
823  info[infoid].m_unavailable += 1;
824  else
825  info[infoid].m_sleeping += 1;
826  }
827  else if (state == kState_RecordingOnly ||
828  state == kState_WatchingRecording)
829  info[infoid].m_recording += 1;
830  else if (state == kState_WatchingLiveTV)
831  info[infoid].m_livetv += 1;
832  else
833  info[infoid].m_available += 1;
834 
835  if (state == kState_RecordingOnly ||
836  state == kState_WatchingRecording ||
837  state == kState_WatchingLiveTV)
838  {
839  strlist = QStringList( QString("QUERY_RECORDER %1").arg(inputid));
840  strlist << "GET_RECORDING";
842  ProgramInfo pginfo(strlist);
843  if (pginfo.GetChanID())
844  {
845  QString titlesub = pginfo.GetTitle();
846  if (!pginfo.GetSubtitle().isEmpty())
847  titlesub += QString(" - ") + pginfo.GetSubtitle();
848  info[infoid].m_recordings += titlesub;
849  }
850  }
851  }
852 
853  for (int inputid : qAsConst(inputids))
854  {
855  QStringList statuslist;
856  if (info[inputid].m_errored)
857  statuslist << tr("%1 errored").arg(info[inputid].m_errored);
858  if (info[inputid].m_unavailable)
859  statuslist << tr("%1 unavailable").arg(info[inputid].m_unavailable);
860  if (info[inputid].m_sleeping)
861  statuslist << tr("%1 sleeping").arg(info[inputid].m_sleeping);
862  if (info[inputid].m_recording)
863  statuslist << tr("%1 recording").arg(info[inputid].m_recording);
864  if (info[inputid].m_livetv)
865  statuslist << tr("%1 live television").arg(info[inputid].m_livetv);
866  if (info[inputid].m_available)
867  statuslist << tr("%1 available").arg(info[inputid].m_available);
868 
869  QString fontstate;
870  if (info[inputid].m_errored)
871  fontstate = "error";
872  else if (info[inputid].m_unavailable || info[inputid].m_sleeping)
873  fontstate = "warning";
874 
875  QString shortstatus = tr("Input %1 %2: %3")
876  .arg(QString::number(inputid), info[inputid].m_displayname,
877  statuslist.join(tr(", ")));
878  QString longstatus = shortstatus + "\n" +
879  info[inputid].m_recordings.join("\n");
880 
881  AddLogLine(shortstatus, helpmsg, longstatus, longstatus, fontstate);
882  }
883 }
884 
886 {
887  if (m_iconState)
888  m_iconState->DisplayState("log");
889  m_logList->Reset();
890 
891  QString helpmsg(tr("Log Entries shows any unread log entries "
892  "from the system if you have logging enabled"));
893  if (m_helpText)
894  m_helpText->SetText(helpmsg);
895  if (m_justHelpText)
896  m_justHelpText->SetText(helpmsg);
897 
898  MSqlQuery query(MSqlQuery::InitCon());
899  query.prepare("SELECT logid, module, priority, logdate, host, "
900  "message, details "
901  "FROM mythlog WHERE acknowledged = 0 "
902  "AND priority <= :PRIORITY ORDER BY logdate DESC;");
903  query.bindValue(":PRIORITY", m_minLevel);
904 
905  if (query.exec())
906  {
907  QString line;
908  QString detail;
909  while (query.next())
910  {
911  line = QString("%1").arg(query.value(5).toString());
912 
913  detail = tr("On %1 from %2.%3\n%4\n")
914  .arg(MythDate::toString(
915  MythDate::as_utc(query.value(3).toDateTime()),
917  query.value(4).toString(),
918  query.value(1).toString(),
919  query.value(5).toString());
920 
921  QString tmp = query.value(6).toString();
922  if (!tmp.isEmpty())
923  detail.append(tmp);
924  else
925  detail.append(tr("No further details"));
926 
927  AddLogLine(line, helpmsg, detail, detail,
928  "", query.value(0).toString());
929  }
930 
931  if (query.size() == 0)
932  {
933  AddLogLine(tr("No items found at priority level %1 or lower.")
934  .arg(m_minLevel), helpmsg);
935  AddLogLine(tr("Use 1-8 to change priority level."), helpmsg);
936  }
937  }
938 }
939 
941 {
942  if (m_iconState)
943  m_iconState->DisplayState("jobqueue");
944  m_logList->Reset();
945 
946  QString helpmsg(tr("Job Queue shows any jobs currently in "
947  "MythTV's Job Queue such as a commercial "
948  "detection job."));
949  if (m_helpText)
950  m_helpText->SetText(helpmsg);
951  if (m_justHelpText)
952  m_justHelpText->SetText(helpmsg);
953 
954  QMap<int, JobQueueEntry> jobs;
955  QMap<int, JobQueueEntry>::Iterator it;
956 
960 
961  if (!jobs.empty())
962  {
963  QString detail;
964  QString line;
965 
966  for (it = jobs.begin(); it != jobs.end(); ++it)
967  {
968  ProgramInfo pginfo((*it).chanid, (*it).recstartts);
969 
970  if (!pginfo.GetChanID())
971  continue;
972 
973  detail = QString("%1\n%2 %3 @ %4\n%5 %6 %7 %8")
974  .arg(pginfo.GetTitle(),
975  pginfo.GetChannelName(),
976  pginfo.GetChanNum(),
978  pginfo.GetRecordingStartTime(),
980  tr("Job:"),
981  JobQueue::JobText((*it).type),
982  tr("Status: "),
983  JobQueue::StatusText((*it).status));
984 
985  if ((*it).status != JOB_QUEUED)
986  detail += " (" + (*it).hostname + ')';
987 
988  if ((*it).schedruntime > MythDate::current())
989  {
990  detail += '\n' + tr("Scheduled Run Time:") + ' ' +
992  (*it).schedruntime,
994  }
995  else
996  {
997  detail += '\n' + (*it).comment;
998  }
999 
1000  line = QString("%1 @ %2")
1001  .arg(pginfo.GetTitle(),
1003  pginfo.GetRecordingStartTime(),
1005 
1006  QString font;
1007  if ((*it).status == JOB_ERRORED)
1008  font = "error";
1009  else if ((*it).status == JOB_ABORTED)
1010  font = "warning";
1011 
1012  AddLogLine(line, helpmsg, detail, detail, font,
1013  QString("%1").arg((*it).id));
1014  }
1015  }
1016  else
1017  AddLogLine(tr("Job Queue is currently empty."), helpmsg);
1018 
1019 }
1020 
1021 // Some helper routines for doMachineStatus() that format the output strings
1022 
1023 static QString usage_str_kb(long long total,
1024  long long used,
1025  long long free)
1026 {
1027  QString ret = QObject::tr("Unknown");
1028  if (total > 0.0 && free > 0.0)
1029  {
1030  double percent = (100.0*free)/total;
1031  ret = StatusBox::tr("%1 total, %2 used, %3 (or %4%) free.")
1032  .arg(StringUtil::formatKBytes(total),
1035  .arg(percent, 0, 'f', (percent >= 10.0) ? 0 : 2);
1036  }
1037  return ret;
1038 }
1039 
1040 static QString usage_str_mb(float total, float used, float free)
1041 {
1042  return usage_str_kb((long long)(total*1024), (long long)(used*1024),
1043  (long long)(free*1024));
1044 }
1045 
1046 static void disk_usage_with_rec_time_kb(QStringList& out, long long total,
1047  long long used, long long free,
1048  const recprof2bps_t& prof2bps)
1049 {
1050  const QString tail = StatusBox::tr(", using your %1 rate of %2 kb/s");
1051 
1052  out<<usage_str_kb(total, used, free);
1053  if (free<0)
1054  return;
1055 
1056  // NOLINTNEXTLINE(modernize-loop-convert)
1057  for (auto it = prof2bps.begin(); it != prof2bps.end(); ++it)
1058  {
1059  const QString pro =
1060  tail.arg(it.key()).arg((int)((float)(*it) / 1024.0F));
1061 
1062  long long bytesPerMin = ((*it) >> 1) * 15LL;
1063  uint minLeft = ((free<<5)/bytesPerMin)<<5;
1064  minLeft = (minLeft/15)*15;
1065  uint hoursLeft = minLeft/60;
1066  QString hourstring = StatusBox::tr("%n hour(s)", "", hoursLeft);
1067  QString minstring = StatusBox::tr("%n minute(s)", "", minLeft%60);
1068  QString remainstring = StatusBox::tr("%1 remaining", "time");
1069  if (minLeft%60 == 0)
1070  out<<remainstring.arg(hourstring) + pro;
1071  else if (minLeft > 60)
1072  {
1073  out<<StatusBox::tr("%1 and %2 remaining", "time")
1074  .arg(hourstring, minstring) + pro;
1075  }
1076  else
1077  {
1078  out<<remainstring.arg(minstring) + pro;
1079  }
1080  }
1081 }
1082 
1083 static QString uptimeStr(std::chrono::seconds uptime)
1084 {
1085  QString str = " " + StatusBox::tr("Uptime") + ": ";
1086 
1087  if (uptime == 0s)
1088  return str + StatusBox::tr("unknown", "unknown uptime");
1089 
1090  auto days = duration_cast<std::chrono::days>(uptime);
1091  auto secs = uptime % 24h;
1092 
1093  QString astext;
1094  if (days.count() > 0)
1095  {
1096  astext = QString("%1, %2")
1097  .arg(StatusBox::tr("%n day(s)", "", days.count()),
1098  MythDate::formatTime(secs, "H:mm"));
1099  } else {
1100  astext = MythDate::formatTime(secs, "H:mm:ss");
1101  }
1102  return str + astext;
1103 }
1104 
1108 void StatusBox::getActualRecordedBPS(const QString& hostnames)
1109 {
1110  m_recordingProfilesBps.clear();
1111 
1112  QString querystr;
1113  MSqlQuery query(MSqlQuery::InitCon());
1114 
1115  querystr =
1116  "SELECT sum(filesize) * 8 / "
1117  "sum(((unix_timestamp(endtime) - unix_timestamp(starttime)))) "
1118  "AS avg_bitrate "
1119  "FROM recorded WHERE hostname in (%1) "
1120  "AND (unix_timestamp(endtime) - unix_timestamp(starttime)) > 300;";
1121 
1122  query.prepare(querystr.arg(hostnames));
1123 
1124  if (query.exec() && query.next() &&
1125  query.value(0).toDouble() > 0)
1126  {
1127  QString rateStr = tr("average", "average rate");
1128 
1129  // Don't user a tr() directly here as the Qt tools will
1130  // not be able to extract the string for translation.
1131  m_recordingProfilesBps[rateStr] =
1132  (int)(query.value(0).toDouble());
1133  }
1134 
1135  querystr =
1136  "SELECT max(filesize * 8 / "
1137  "(unix_timestamp(endtime) - unix_timestamp(starttime))) "
1138  "AS max_bitrate "
1139  "FROM recorded WHERE hostname in (%1) "
1140  "AND (unix_timestamp(endtime) - unix_timestamp(starttime)) > 300;";
1141 
1142  query.prepare(querystr.arg(hostnames));
1143 
1144  if (query.exec() && query.next() &&
1145  query.value(0).toDouble() > 0)
1146  {
1147  QString rateStr = tr("maximum", "maximum rate");
1148 
1149  // Don't user a tr() directly here as the Qt tools will
1150  // not be able to extract the string for translation.
1151  m_recordingProfilesBps[rateStr] =
1152  (int)(query.value(0).toDouble());
1153  }
1154 }
1155 
1165 {
1166  if (m_iconState)
1167  m_iconState->DisplayState("machine");
1168  m_logList->Reset();
1169  QString machineStr = tr("Machine Status shows some operating system "
1170  "statistics of this machine and the MythTV "
1171  "server.");
1172 
1173  if (m_helpText)
1174  m_helpText->SetText(machineStr);
1175  if (m_justHelpText)
1176  m_justHelpText->SetText(machineStr);
1177 
1178  QString line;
1179  if (m_isBackendActive)
1180  line = tr("System:");
1181  else
1182  line = tr("This machine:");
1183  AddLogLine(line, machineStr);
1184 
1185  // Time
1186  StatusBoxItem *timebox = AddLogLine("");
1187  auto UpdateTime = [](StatusBoxItem* Item)
1188  {
1189  Item->SetText(" " + tr("System time") + ": " + QDateTime::currentDateTime().toString());
1190  };
1191  UpdateTime(timebox);
1192  connect(timebox, &StatusBoxItem::UpdateRequired, UpdateTime);
1193  timebox->Start();
1194 
1195  // Hostname & IP
1196  AddLogLine(" " + tr("Hostname") + ": " + gCoreContext->GetHostName());
1197  AddLogLine(" " + tr("OS") + QString(": %1 (%2)").arg(QSysInfo::prettyProductName(),
1198  QSysInfo::currentCpuArchitecture()));
1199  AddLogLine(" " + tr("Qt version") + QString(": %1").arg(qVersion()));
1200 
1201  QList allInterfaces = QNetworkInterface::allInterfaces();
1202  for (const QNetworkInterface & iface : qAsConst(allInterfaces))
1203  {
1204  QNetworkInterface::InterfaceFlags f = iface.flags();
1205  if (!(f & QNetworkInterface::IsUp))
1206  continue;
1207  if (!(f & QNetworkInterface::IsRunning))
1208  continue;
1209  if ((f & QNetworkInterface::IsLoopBack) != 0U)
1210  continue;
1211 
1212 #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
1213  QNetworkInterface::InterfaceType type = iface.type();
1214  QString name = type == QNetworkInterface::Wifi ? tr("WiFi") : tr("Ethernet");
1215 #else
1216  QString name = tr("Network");
1217 #endif
1218  AddLogLine(" " + name + QString(" (%1): ").arg(iface.humanReadableName()));
1219  AddLogLine(" " + tr("MAC Address") + ": " + iface.hardwareAddress());
1220  QList addresses = iface.addressEntries();
1221  for (const QNetworkAddressEntry & addr : qAsConst(addresses))
1222  {
1223  if (addr.ip().protocol() == QAbstractSocket::IPv4Protocol ||
1224  addr.ip().protocol() == QAbstractSocket::IPv6Protocol)
1225  {
1226  AddLogLine(" " + tr("IP Address") + ": " + addr.ip().toString());
1227  }
1228  }
1229  }
1230  AddLogLine(line, machineStr);
1231 
1232  // uptime
1233  std::chrono::seconds uptime = 0s;
1234  if (getUptime(uptime))
1235  {
1236  auto UpdateUptime = [](StatusBoxItem* Item)
1237  {
1238  std::chrono::seconds time = 0s;
1239  if (getUptime(time))
1240  Item->SetText(uptimeStr(time));
1241  };
1242  StatusBoxItem *uptimeitem = AddLogLine(uptimeStr(uptime));
1243  connect(uptimeitem, &StatusBoxItem::UpdateRequired, UpdateUptime);
1244  uptimeitem->Start(1min);
1245  }
1246 
1247  // weighted average loads
1248 #if !defined(_WIN32) && !defined(Q_OS_ANDROID)
1249  auto UpdateLoad = [](StatusBoxItem* Item)
1250  {
1251  loadArray loads = getLoadAvgs();
1252  Item->SetText(QString(" %1: %2 %3 %4").arg(tr("Load")).arg(loads[0], 1, 'f', 2)
1253  .arg(loads[1], 1, 'f', 2).arg(loads[2], 1, 'f', 2));
1254  };
1255  StatusBoxItem* loaditem = AddLogLine("");
1256  UpdateLoad(loaditem);
1257  connect(loaditem, &StatusBoxItem::UpdateRequired, UpdateLoad);
1258  loaditem->Start();
1259 #endif
1260 
1261  // memory usage
1262  int totalM = 0; // Physical memory
1263  int freeM = 0;
1264  int totalS = 0; // Virtual memory (swap)
1265  int freeS = 0;
1266  if (getMemStats(totalM, freeM, totalS, freeS))
1267  {
1268  auto UpdateMem = [](StatusBoxItem* Item)
1269  {
1270  int totm = 0;
1271  int freem = 0;
1272  int tots = 0;
1273  int frees = 0;
1274  if (getMemStats(totm, freem, tots, frees))
1275  Item->SetText(QString(" " + tr("RAM") + ": " + usage_str_mb(totm, totm - freem, freem)));
1276  };
1277 
1278  auto UpdateSwap = [](StatusBoxItem* Item)
1279  {
1280  int totm = 0;
1281  int freem = 0;
1282  int tots = 0;
1283  int frees = 0;
1284  if (getMemStats(totm, freem, tots, frees))
1285  Item->SetText(QString(" " + tr("Swap") + ": " + usage_str_mb(tots, tots - frees, frees)));
1286  };
1287  StatusBoxItem* mem = AddLogLine("", machineStr);
1288  StatusBoxItem* swap = AddLogLine("", machineStr);
1289  UpdateMem(mem);
1290  UpdateSwap(swap);
1291  connect(mem, &StatusBoxItem::UpdateRequired, UpdateMem);
1292  connect(swap, &StatusBoxItem::UpdateRequired, UpdateSwap);
1293  mem->Start(3s);
1294  swap->Start(3s);
1295  }
1296 
1297  if (!m_isBackendActive)
1298  {
1299  line = tr("MythTV server") + ':';
1300  AddLogLine(line, machineStr);
1301 
1302  // Hostname & IP
1303  line = " " + tr("Hostname") + ": " + gCoreContext->GetSetting("MasterServerName");
1304  line.append(", " + tr("IP") + ": " + gCoreContext->GetSetting("MasterServerIP"));
1305  AddLogLine(line, machineStr);
1306 
1307  // uptime
1308  if (RemoteGetUptime(uptime))
1309  {
1310  auto UpdateRemoteUptime = [](StatusBoxItem* Item)
1311  {
1312  std::chrono::seconds time = 0s;
1313  RemoteGetUptime(time);
1314  Item->SetText(uptimeStr(time));
1315  };
1316  StatusBoxItem *remoteuptime = AddLogLine(uptimeStr(uptime));
1317  connect(remoteuptime, &StatusBoxItem::UpdateRequired, UpdateRemoteUptime);
1318  remoteuptime->Start(1min);
1319  }
1320 
1321  // weighted average loads
1322  system_load_array floads;
1323  if (RemoteGetLoad(floads))
1324  {
1325  auto UpdateRemoteLoad = [](StatusBoxItem* Item)
1326  {
1327  system_load_array loads = { 0.0, 0.0, 0.0 };
1328  RemoteGetLoad(loads);
1329  Item->SetText(QString(" %1: %2 %3 %4").arg(tr("Load")).arg(loads[0], 1, 'f', 2)
1330  .arg(loads[1], 1, 'f', 2).arg(loads[2], 1, 'f', 2));
1331  };
1332  StatusBoxItem* remoteloaditem = AddLogLine("");
1333  UpdateRemoteLoad(remoteloaditem);
1334  connect(remoteloaditem, &StatusBoxItem::UpdateRequired, UpdateRemoteLoad);
1335  remoteloaditem->Start();
1336  }
1337 
1338  // memory usage
1339  if (RemoteGetMemStats(totalM, freeM, totalS, freeS))
1340  {
1341  auto UpdateRemoteMem = [](StatusBoxItem* Item)
1342  {
1343  int totm = 0;
1344  int freem = 0;
1345  int tots = 0;
1346  int frees = 0;
1347  if (RemoteGetMemStats(totm, freem, tots, frees))
1348  Item->SetText(QString(" " + tr("RAM") + ": " + usage_str_mb(totm, totm - freem, freem)));
1349  };
1350 
1351  auto UpdateRemoteSwap = [](StatusBoxItem* Item)
1352  {
1353  int totm = 0;
1354  int freem = 0;
1355  int tots = 0;
1356  int frees = 0;
1357  if (RemoteGetMemStats(totm, freem, tots, frees))
1358  Item->SetText(QString(" " + tr("Swap") + ": " + usage_str_mb(tots, tots - frees, frees)));
1359  };
1360  StatusBoxItem* rmem = AddLogLine("", machineStr);
1361  StatusBoxItem* rswap = AddLogLine("", machineStr);
1362  UpdateRemoteMem(rmem);
1363  UpdateRemoteSwap(rswap);
1364  connect(rmem, &StatusBoxItem::UpdateRequired, UpdateRemoteMem);
1365  connect(rswap, &StatusBoxItem::UpdateRequired, UpdateRemoteSwap);
1366  rmem->Start(10s);
1367  rswap->Start(11s);
1368  }
1369  }
1370 
1371  // get free disk space
1372  QString hostnames;
1373 
1374  QList<FileSystemInfo> fsInfos = FileSystemInfo::RemoteGetInfo();
1375  for (int i = 0; i < fsInfos.size(); ++i)
1376  {
1377  // For a single-directory installation just display the totals
1378  if ((fsInfos.size() == 2) && (i == 0) &&
1379  (fsInfos[i].getPath() != "TotalDiskSpace") &&
1380  (fsInfos[i+1].getPath() == "TotalDiskSpace"))
1381  i++;
1382 
1383  hostnames = QString("\"%1\"").arg(fsInfos[i].getHostname());
1384  hostnames.replace(' ', "");
1385  hostnames.replace(',', "\",\"");
1386 
1387  getActualRecordedBPS(hostnames);
1388 
1389  QStringList list;
1391  fsInfos[i].getTotalSpace(), fsInfos[i].getUsedSpace(),
1392  fsInfos[i].getTotalSpace() - fsInfos[i].getUsedSpace(),
1394 
1395  if (fsInfos[i].getPath() == "TotalDiskSpace")
1396  {
1397  line = tr("Total Disk Space:");
1398  AddLogLine(line, machineStr);
1399  }
1400  else
1401  {
1402  line = tr("MythTV Drive #%1:").arg(fsInfos[i].getFSysID());
1403  AddLogLine(line, machineStr);
1404 
1405  QStringList tokens = fsInfos[i].getPath().split(',');
1406 
1407  if (tokens.size() > 1)
1408  {
1409  AddLogLine(QString(" ") + tr("Directories:"), machineStr);
1410 
1411  int curToken = 0;
1412  while (curToken < tokens.size())
1413  AddLogLine(QString(" ") +
1414  tokens[curToken++], machineStr);
1415  }
1416  else
1417  {
1418  AddLogLine(QString(" " ) + tr("Directory:") + ' ' +
1419  fsInfos[i].getPath(), machineStr);
1420  }
1421  }
1422 
1423  for (auto & diskinfo : list)
1424  {
1425  line = QString(" ") + diskinfo;
1426  AddLogLine(line, machineStr);
1427  }
1428  }
1429 
1430 }
1431 
1433 {
1434  if (m_iconState)
1435  m_iconState->DisplayState("decoders");
1436  m_logList->Reset();
1437  QString displayhelp = tr("Available hardware decoders for video playback.");
1438  if (m_helpText)
1439  m_helpText->SetText(displayhelp);
1440  if (m_justHelpText)
1441  m_justHelpText->SetText(displayhelp);
1442 
1443  QStringList decoders = MythCodecContext::GetDecoderDescription();
1444  if (decoders.isEmpty())
1445  {
1446  AddLogLine(tr("None"));
1447  }
1448  else
1449  {
1450  for (const QString & decoder : qAsConst(decoders))
1451  AddLogLine(decoder);
1452  }
1453 }
1454 
1456 {
1457  if (m_iconState)
1458  m_iconState->DisplayState("display");
1459  m_logList->Reset();
1460  auto displayhelp = tr("Display information.");
1461  if (m_helpText)
1462  m_helpText->SetText(displayhelp);
1463  if (m_justHelpText)
1464  m_justHelpText->SetText(displayhelp);
1465 
1466  auto desc = GetMythMainWindow()->GetDisplay()->GetDescription();
1467  for (const auto & line : qAsConst(desc))
1468  AddLogLine(line);
1469 }
1470 
1472 {
1473  if (m_iconState)
1474  m_iconState->DisplayState("render");
1475  m_logList->Reset();
1476  auto displayhelp = tr("Render information.");
1477  if (m_helpText)
1478  m_helpText->SetText(displayhelp);
1479  if (m_justHelpText)
1480  m_justHelpText->SetText(displayhelp);
1481 
1482  auto * render = GetMythMainWindow()->GetRenderDevice();
1483  if (render && render->Type() == kRenderOpenGL)
1484  {
1485  auto * opengl = dynamic_cast<MythRenderOpenGL*>(render);
1486 
1487  if (opengl)
1488  {
1489  auto UpdateFPS = [](StatusBoxItem* Item)
1490  {
1491  uint64_t swapcount = 0;
1492  auto * rend = GetMythMainWindow()->GetRenderDevice();
1493  if (auto * gl = dynamic_cast<MythRenderOpenGL*>(rend); gl != nullptr)
1494  swapcount = gl->GetSwapCount();
1495  Item->SetText(tr("Current fps: %1").arg(swapcount));
1496  };
1497 
1498  auto * fps = AddLogLine("");
1499  // Reset the frame counter
1500  (void)opengl->GetSwapCount();
1501  UpdateFPS(fps);
1502  connect(fps, &StatusBoxItem::UpdateRequired, UpdateFPS);
1503  fps->Start();
1504  }
1505 
1506  if (opengl && (opengl->GetExtraFeatures() & kGLNVMemory))
1507  {
1508  auto GetGPUMem = []()
1509  {
1510  auto * rend = GetMythMainWindow()->GetRenderDevice();
1511  if (auto * gl = dynamic_cast<MythRenderOpenGL*>(rend); gl != nullptr)
1512  return gl->GetGPUMemory();
1513  return std::tuple<int,int,int> { 0, 0, 0 };
1514  };
1515  auto UpdateUsed = [&GetGPUMem](StatusBoxItem* Item)
1516  {
1517  auto mem = GetGPUMem();
1518  int total = std::get<0>(mem);
1519  if (total > 0)
1520  {
1521  int avail = std::get<2>(mem);
1522  Item->SetText(tr("GPU memory used : %1MB").arg(total - avail));
1523  }
1524  };
1525 
1526  auto UpdateFree = [&GetGPUMem](StatusBoxItem* Item)
1527  {
1528  auto mem = GetGPUMem();
1529  int total = std::get<0>(mem);
1530  if (total > 0)
1531  {
1532  int avail = std::get<2>(mem);
1533  int percent = static_cast<int>((avail / static_cast<float>(total) * 100.0F));
1534  Item->SetText(tr("GPU memory free : %1MB (or %2%)").arg(avail).arg(percent));
1535  }
1536  };
1537 
1538  auto current = GetGPUMem();
1539  // Total and dedicated will not change
1540  AddLogLine(tr("GPU memory total : %1MB").arg(std::get<0>(current)));
1541  AddLogLine(tr("GPU memory dedicated: %1MB").arg(std::get<1>(current)));
1542  auto * used = AddLogLine("");
1543  auto * freemem = AddLogLine("");
1544  UpdateUsed(used);
1545  UpdateFree(freemem);
1546  connect(used, &StatusBoxItem::UpdateRequired, UpdateUsed);
1547  connect(freemem, &StatusBoxItem::UpdateRequired, UpdateFree);
1548  used->Start();
1549  freemem->Start();
1550  }
1551 
1552  auto desc = render->GetDescription();
1553  for (const auto & line : qAsConst(desc))
1554  AddLogLine(line);
1555  }
1556 }
1557 
1561 void StatusBox::doAutoExpireList(bool updateExpList)
1562 {
1563  if (m_iconState)
1564  m_iconState->DisplayState("autoexpire");
1565  m_logList->Reset();
1566 
1567  QString helpmsg(tr("The AutoExpire List shows all recordings "
1568  "which may be expired and the order of "
1569  "their expiration. Recordings at the top "
1570  "of the list will be expired first."));
1571  if (m_helpText)
1572  m_helpText->SetText(helpmsg);
1573  if (m_justHelpText)
1574  m_justHelpText->SetText(helpmsg);
1575 
1576  QString contentLine;
1577  QString detailInfo;
1578  QString staticInfo;
1579  long long totalSize(0);
1580  long long liveTVSize(0);
1581  int liveTVCount(0);
1582  long long deletedGroupSize(0);
1583  int deletedGroupCount(0);
1584 
1585  std::vector<ProgramInfo *>::iterator it;
1586 
1587  if (updateExpList)
1588  {
1589  for (it = m_expList.begin(); it != m_expList.end(); ++it)
1590  delete *it;
1591  m_expList.clear();
1592 
1594  }
1595 
1596  for (it = m_expList.begin(); it != m_expList.end(); ++it)
1597  {
1598  ProgramInfo *pginfo = *it;
1599 
1600  totalSize += pginfo->GetFilesize();
1601  if (pginfo->GetRecordingGroup() == "LiveTV")
1602  {
1603  liveTVSize += pginfo->GetFilesize();
1604  liveTVCount++;
1605  }
1606  else if (pginfo->GetRecordingGroup() == "Deleted")
1607  {
1608  deletedGroupSize += pginfo->GetFilesize();
1609  deletedGroupCount++;
1610  }
1611  }
1612 
1613  staticInfo = tr("%n recording(s) consuming %1 (is) allowed to expire\n", "",
1614  m_expList.size()).arg(StringUtil::formatKBytes(totalSize / 1024));
1615 
1616  if (liveTVCount)
1617  staticInfo += tr("%n (is) LiveTV and consume(s) %1\n", "", liveTVCount)
1618  .arg(StringUtil::formatKBytes(liveTVSize / 1024));
1619 
1620  if (deletedGroupCount)
1621  {
1622  staticInfo += tr("%n (is) Deleted and consume(s) %1\n", "",
1623  deletedGroupCount)
1624  .arg(StringUtil::formatKBytes(deletedGroupSize / 1024));
1625  }
1626 
1627  for (it = m_expList.begin(); it != m_expList.end(); ++it)
1628  {
1629  ProgramInfo *pginfo = *it;
1630  QDateTime starttime = pginfo->GetRecordingStartTime();
1631  QDateTime endtime = pginfo->GetRecordingEndTime();
1632  contentLine =
1634  starttime, MythDate::kDateFull | MythDate::kSimplify) + " - ";
1635 
1636  contentLine +=
1637  "(" + ProgramInfo::i18n(pginfo->GetRecordingGroup()) + ") ";
1638 
1639  contentLine += pginfo->GetTitle() +
1640  " (" + StringUtil::formatKBytes(pginfo->GetFilesize() / 1024) + ")";
1641 
1642  detailInfo =
1645  " - " +
1648 
1649  detailInfo += " (" + StringUtil::formatKBytes(pginfo->GetFilesize() / 1024) + ")";
1650 
1651  detailInfo += " (" + ProgramInfo::i18n(pginfo->GetRecordingGroup()) + ")";
1652 
1653  detailInfo += "\n" + pginfo->toString(ProgramInfo::kTitleSubtitle, " - ");
1654 
1655  AddLogLine(contentLine, staticInfo, detailInfo,
1656  staticInfo + detailInfo);
1657  }
1658 }
1659 
1661 
1662 /* 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
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(GrabberScript *)
RecordingInfo::kDefaultRecGroup
@ kDefaultRecGroup
Definition: recordinginfo.h:191
MythDate::toString
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp: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:6344
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:914
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:1375
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:1108
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:180
GetMythSourceVersion
const char * GetMythSourceVersion()
Definition: mythversion.cpp:5
ProgramInfo::kTitleSubtitle
@ kTitleSubtitle
Definition: programinfo.h:511
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:67
kRenderOpenGL
@ kRenderOpenGL
Definition: mythrender_base.h:19
RemoteUndeleteRecording
bool RemoteUndeleteRecording(uint recordingID)
Definition: remoteutil.cpp:140
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:1455
statusbox.h
StatusBox::Create
bool Create(void) override
Definition: statusbox.cpp:79
JobQueue::StopJob
static bool StopJob(int jobID)
Definition: jobqueue.cpp:753
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:32
RemoteGetLoad
bool RemoteGetLoad(system_load_array &load)
Definition: remoteutil.cpp:40
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:113
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:18
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:1123
JobQueue::PauseJob
static bool PauseJob(int jobID)
Definition: jobqueue.cpp:726
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:1040
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:1284
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:145
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:32
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
StatusBox::doJobQueueStatus
void doJobQueueStatus()
Definition: statusbox.cpp:940
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:1530
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:746
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:1046
RecStatus::Conflict
@ Conflict
Definition: recordingstatus.h:39
ProgramInfo::toString
QString toString(Verbosity v=kLongDescription, const QString &sep=":", const QString &grp="\"") const
Definition: programinfo.cpp:1937
loadArray
std::array< double, 3 > loadArray
Definition: mythmiscutil.h:22
jobqueue.h
kNoSearch
@ kNoSearch
Definition: recordingtypes.h:73
RemoteGetAllExpiringRecordings
void RemoteGetAllExpiringRecordings(std::vector< ProgramInfo * > &expiringlist)
Definition: remoteutil.cpp:169
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3665
uint
unsigned int uint
Definition: compat.h:79
StatusBox::doDecoderStatus
void doDecoderStatus()
Definition: statusbox.cpp:1432
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:59
StatusBox::m_logList
MythUIButtonList * m_logList
Definition: statusbox.h:84
getUptime
bool getUptime(std::chrono::seconds &uptime)
Definition: mythmiscutil.cpp:70
StatusBox::updateLog
void updateLog()
ProgramInfo::i18n
static QString i18n(const QString &msg)
Translations for play,recording, & storage groups +.
Definition: programinfo.cpp:5378
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:916
RemoteGetMemStats
bool RemoteGetMemStats(int &totalMB, int &freeMB, int &totalVM, int &freeVM)
Definition: remoteutil.cpp:75
StringUtil::formatKBytes
MBASE_PUBLIC QString formatKBytes(int64_t sizeKB, int prec=1)
Definition: stringutil.cpp:353
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:883
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:55
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:1471
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:885
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:1083
build_compdb.action
action
Definition: build_compdb.py:9
JobQueue::ResumeJob
static bool ResumeJob(int jobID)
Definition: jobqueue.cpp:735
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:842
getMemStats
bool getMemStats(int &totalMB, int &freeMB, int &totalVM, int &freeVM)
Returns memory statistics in megabytes.
Definition: mythmiscutil.cpp:113
JOB_LIST_RECENT
@ JOB_LIST_RECENT
Definition: jobqueue.h:69
StatusBox::m_iconState
MythUIStateType * m_iconState
Definition: statusbox.h:85
MythUICallbackMFc
void(QObject::*)(void) const MythUICallbackMFc
Definition: mythuitype.h: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:1023
StatusBox::doScheduleStatus
void doScheduleStatus()
Definition: statusbox.cpp:542
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:885
StatusBox::m_expList
std::vector< ProgramInfo * > m_expList
Definition: statusbox.h:89
RecordingInfo::ApplyRecordRecGroupChange
void ApplyRecordRecGroupChange(const QString &newrecgroup)
Sets the recording group, both in this RecordingInfo and in the database.
Definition: recordinginfo.cpp:606
StatusBox::customEvent
void customEvent(QEvent *event) override
Definition: statusbox.cpp: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:68
JobQueue::ChangeJobStatus
static bool ChangeJobStatus(int jobID, int newStatus, const QString &comment="")
Definition: jobqueue.cpp:994
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:111
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:1142
StatusBox::doMachineStatus
void doMachineStatus()
Show machine status.
Definition: statusbox.cpp:1164
MythUIStateType::DisplayState
bool DisplayState(const QString &name)
Definition: mythuistatetype.cpp:84
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:902
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