MythTV  master
gameui.cpp
Go to the documentation of this file.
1 #include <QMetaType>
2 #include <QStringList>
3 #include <QTimer>
4 
5 #include <mythcontext.h>
6 #include <mythuibuttontree.h>
8 #include <mythuiimage.h>
9 #include <mythuitext.h>
10 #include <mythuistatetype.h>
11 #include <mythmainwindow.h>
12 #include <mythdialogbox.h>
13 #include <mythgenerictree.h>
14 #include <mythdirs.h>
15 
16 // MythGame headers
17 #include "gamehandler.h"
18 #include "rominfo.h"
19 #include "gamedetails.h"
20 #include "romedit.h"
21 #include "gamescan.h"
22 #include "gameui.h"
23 
24 static const QString sLocation = "MythGame";
25 
27 {
28  public:
29  GameTreeInfo(const QString& levels, QString filter)
30  : m_levels(levels.split(" "))
31  , m_filter(std::move(filter))
32  {
33  }
34 
35  int getDepth() const { return m_levels.size(); }
36  const QString& getLevel(unsigned i) const { return m_levels[i]; }
37  const QString& getFilter() const { return m_filter; }
38 
39  private:
40  QStringList m_levels;
41  QString m_filter;
42 };
43 
45 
47  : MythScreenType(parent, "GameUI")
48 {
49  m_popupStack = GetMythMainWindow()->GetStack("popup stack");
50 
51  m_query = new MetadataDownload(this);
52  m_imageDownload = new MetadataImageDownload(this);
53 }
54 
56 {
57  if (!LoadWindowFromXML("game-ui.xml", "gameui", this))
58  return false;
59 
60  bool err = false;
61  UIUtilE::Assign(this, m_gameUITree, "gametreelist", &err);
62  UIUtilW::Assign(this, m_gameTitleText, "title");
63  UIUtilW::Assign(this, m_gameSystemText, "system");
64  UIUtilW::Assign(this, m_gameYearText, "year");
65  UIUtilW::Assign(this, m_gameGenreText, "genre");
66  UIUtilW::Assign(this, m_gameFavouriteState, "favorite");
67  UIUtilW::Assign(this, m_gamePlotText, "description");
68  UIUtilW::Assign(this, m_gameImage, "screenshot");
69  UIUtilW::Assign(this, m_fanartImage, "fanart");
70  UIUtilW::Assign(this, m_boxImage, "coverart");
71 
72  if (err)
73  {
74  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'gameui'");
75  return false;
76  }
77 
79  this, &GameUI::itemClicked);
80 
82  this, &GameUI::nodeChanged);
83 
84  m_gameShowFileName = gCoreContext->GetBoolSetting("GameShowFileNames");
85 
86  BuildTree();
87 
89 
90  return true;
91 }
92 
94 {
95  if (m_gameTree)
96  {
98  delete m_gameTree;
99  m_gameTree = nullptr;
100  }
101 
102  m_gameTree = new MythGenericTree("game root", 0, false);
103 
104  // create system filter to only select games where handlers are present
105  QString systemFilter;
106 
107  // The call to GameHandler::count() fills the handler list for us
108  // to move through.
109  unsigned handlercount = GameHandler::count();
110 
111  for (unsigned i = 0; i < handlercount; ++i)
112  {
113  QString system = GameHandler::getHandler(i)->SystemName();
114  if (i == 0)
115  systemFilter = "`system` in ('" + system + "'";
116  else
117  systemFilter += ",'" + system + "'";
118  }
119  if (systemFilter.isEmpty())
120  {
121  systemFilter = "1=0";
122  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find any game handlers!"));
123  }
124  else
125  systemFilter += ")";
126 
127  m_showHashed = gCoreContext->GetBoolSetting("GameTreeView");
128 
129  // create a few top level nodes - this could be moved to a config based
130  // approach with multiple roots if/when someone has the time to create
131  // the relevant dialog screens
132 
133  QString levels = gCoreContext->GetSetting("GameFavTreeLevels", "gamename");
134 
135  auto *new_node = new MythGenericTree(tr("Favorites"), 1, true);
136  new_node->SetData(QVariant::fromValue(
137  new GameTreeInfo(levels, systemFilter + " and favorite=1")));
138  m_favouriteNode = m_gameTree->addNode(new_node);
139 
140  levels = gCoreContext->GetSetting("GameAllTreeLevels", "system gamename");
141 
142  if (m_showHashed)
143  {
144  int pos = levels.indexOf("gamename");
145  if (pos >= 0)
146  levels.insert(pos, " hash ");
147  }
148 
149  new_node = new MythGenericTree(tr("All Games"), 1, true);
150  new_node->SetData(QVariant::fromValue(
151  new GameTreeInfo(levels, systemFilter)));
152  m_gameTree->addNode(new_node);
153 
154  new_node = new MythGenericTree(tr("- By Genre"), 1, true);
155  new_node->SetData(QVariant::fromValue(
156  new GameTreeInfo("genre gamename", systemFilter)));
157  m_gameTree->addNode(new_node);
158 
159  new_node = new MythGenericTree(tr("- By Year"), 1, true);
160  new_node->SetData(QVariant::fromValue(
161  new GameTreeInfo("year gamename", systemFilter)));
162  m_gameTree->addNode(new_node);
163 
164  new_node = new MythGenericTree(tr("- By Name"), 1, true);
165  new_node->SetData(QVariant::fromValue(
166  new GameTreeInfo("gamename", systemFilter)));
167  m_gameTree->addNode(new_node);
168 
169  new_node = new MythGenericTree(tr("- By Publisher"), 1, true);
170  new_node->SetData(QVariant::fromValue(
171  new GameTreeInfo("publisher gamename", systemFilter)));
172  m_gameTree->addNode(new_node);
173 
176 }
177 
178 bool GameUI::keyPressEvent(QKeyEvent *event)
179 {
180  if (GetFocusWidget()->keyPressEvent(event))
181  return true;
182 
183  QStringList actions;
184  bool handled = GetMythMainWindow()->TranslateKeyPress("Game", event, actions);
185 
186  for (int i = 0; i < actions.size() && !handled; i++)
187  {
188  QString action = actions[i];
189  handled = true;
190 
191  if (action == "MENU")
192  ShowMenu();
193  else if (action == "EDIT")
194  edit();
195  else if (action == "INFO")
196  showInfo();
197  else if (action == "TOGGLEFAV")
198  toggleFavorite();
199  else if ((action == "INCSEARCH") || (action == "INCSEARCHNEXT"))
200  searchStart();
201  else if (action == "DOWNLOADDATA")
202  gameSearch();
203  else
204  handled = false;
205  }
206 
207  if (!handled && MythScreenType::keyPressEvent(event))
208  handled = true;
209 
210  return handled;
211 }
212 
214 {
215  if (!node)
216  return;
217 
218  if (!isLeaf(node))
219  {
220  if (node->childCount() == 0 || node == m_favouriteNode)
221  {
222  node->deleteAllChildren();
223  fillNode(node);
224  }
225  clearRomInfo();
226  }
227  else
228  {
229  auto *romInfo = node->GetData().value<RomInfo *>();
230  if (!romInfo)
231  return;
232  if (romInfo->Romname().isEmpty())
233  romInfo->fillData();
234  updateRomInfo(romInfo);
235  if (!romInfo->Screenshot().isEmpty() || !romInfo->Fanart().isEmpty() ||
236  !romInfo->Boxart().isEmpty())
237  showImages();
238  else
239  {
240  if (m_gameImage)
241  m_gameImage->Reset();
242  if (m_fanartImage)
243  m_fanartImage->Reset();
244  if (m_boxImage)
245  m_boxImage->Reset();
246  }
247  }
248 }
249 
251 {
253  if (isLeaf(node))
254  {
255  auto *romInfo = node->GetData().value<RomInfo *>();
256  if (!romInfo)
257  return;
258  if (romInfo->RomCount() == 1)
259  {
260  GameHandler::Launchgame(romInfo, nullptr);
261  }
262  else
263  {
264  //: %1 is the game name
265  QString msg = tr("Choose System for:\n%1").arg(node->GetText());
266  MythScreenStack *popupStack = GetMythMainWindow()->
267  GetStack("popup stack");
268  auto *chooseSystemPopup = new MythDialogBox(
269  msg, popupStack, "chooseSystemPopup");
270 
271  if (chooseSystemPopup->Create())
272  {
273  chooseSystemPopup->SetReturnEvent(this, "chooseSystemPopup");
274  QString all_systems = romInfo->AllSystems();
275  QStringList players = all_systems.split(',');
276  for (const auto & player : qAsConst(players))
277  chooseSystemPopup->AddButton(player);
278  popupStack->AddScreen(chooseSystemPopup);
279  }
280  else
281  delete chooseSystemPopup;
282  }
283  }
284 }
285 
287 {
288  if (m_gameImage)
289  m_gameImage->Load();
290  if (m_fanartImage)
291  m_fanartImage->Load();
292  if (m_boxImage)
293  m_boxImage->Load();
294 }
295 
296 void GameUI::searchComplete(const QString& string)
297 {
299  return;
300 
302  if (!parent)
303  return;
304 
305  MythGenericTree *new_node = parent->getChildByName(string);
306  if (new_node)
307  m_gameUITree->SetCurrentNode(new_node);
308 }
309 
311 {
312  if (m_gameTitleText)
314  if (m_gameSystemText)
316  if (m_gameYearText)
317  m_gameYearText->SetText(rom->Year());
318  if (m_gameGenreText)
319  m_gameGenreText->SetText(rom->Genre());
320  if (m_gamePlotText)
321  m_gamePlotText->SetText(rom->Plot());
322 
324  {
325  if (rom->Favorite())
327  else
329  }
330 
331  if (m_gameImage)
332  {
333  m_gameImage->Reset();
335  }
336  if (m_fanartImage)
337  {
338  m_fanartImage->Reset();
340  }
341  if (m_boxImage)
342  {
343  m_boxImage->Reset();
344  m_boxImage->SetFilename(rom->Boxart());
345  }
346 }
347 
349 {
350  if (m_gameTitleText)
352  if (m_gameSystemText)
354  if (m_gameYearText)
356  if (m_gameGenreText)
358  if (m_gamePlotText)
362 
363  if (m_gameImage)
364  m_gameImage->Reset();
365 
366  if (m_fanartImage)
367  m_fanartImage->Reset();
368 
369  if (m_boxImage)
370  m_boxImage->Reset();
371 }
372 
373 void GameUI::edit(void)
374 {
376  if (isLeaf(node))
377  {
378  auto *romInfo = node->GetData().value<RomInfo *>();
379 
380  MythScreenStack *screenStack = GetScreenStack();
381 
382  auto *md_editor = new EditRomInfoDialog(screenStack,
383  "mythgameeditmetadata", romInfo);
384 
385  if (md_editor->Create())
386  {
387  screenStack->AddScreen(md_editor);
388  md_editor->SetReturnEvent(this, "editMetadata");
389  }
390  else
391  delete md_editor;
392  }
393 }
394 
396 {
398  if (isLeaf(node))
399  {
400  auto *romInfo = node->GetData().value<RomInfo *>();
401  if (!romInfo)
402  return;
404  auto *details_dialog = new GameDetailsPopup(mainStack, romInfo);
405 
406  if (details_dialog->Create())
407  {
408  mainStack->AddScreen(details_dialog);
409  details_dialog->SetReturnEvent(this, "detailsPopup");
410  }
411  else
412  delete details_dialog;
413  }
414 }
415 
417 {
419 
420  MythScreenStack *popupStack = GetMythMainWindow()->
421  GetStack("popup stack");
422  auto *showMenuPopup =
423  new MythDialogBox(node->GetText(), popupStack, "showMenuPopup");
424 
425  if (showMenuPopup->Create())
426  {
427  showMenuPopup->SetReturnEvent(this, "showMenuPopup");
428 
429  showMenuPopup->AddButton(tr("Scan For Changes"));
430  if (isLeaf(node))
431  {
432  auto *romInfo = node->GetData().value<RomInfo *>();
433  if (romInfo)
434  {
435  showMenuPopup->AddButton(tr("Show Information"));
436  if (romInfo->Favorite())
437  showMenuPopup->AddButton(tr("Remove Favorite"));
438  else
439  showMenuPopup->AddButton(tr("Make Favorite"));
440  showMenuPopup->AddButton(tr("Retrieve Details"));
441  showMenuPopup->AddButton(tr("Edit Details"));
442  }
443  }
444  popupStack->AddScreen(showMenuPopup);
445  }
446  else
447  delete showMenuPopup;
448 }
449 
451 {
453 
454  if (parent != nullptr)
455  {
456  QStringList childList;
457  QList<MythGenericTree*>::iterator it;
458  QList<MythGenericTree*> *children = parent->getAllChildren();
459 
460  for (it = children->begin(); it != children->end(); ++it)
461  {
462  MythGenericTree *child = *it;
463  childList << child->GetText();
464  }
465 
466  MythScreenStack *popupStack =
467  GetMythMainWindow()->GetStack("popup stack");
468  auto *searchDialog = new MythUISearchDialog(popupStack,
469  tr("Game Search"), childList, true, "");
470 
471  if (searchDialog->Create())
472  {
473  connect(searchDialog, &MythUISearchDialog::haveResult,
474  this, &GameUI::searchComplete);
475 
476  popupStack->AddScreen(searchDialog);
477  }
478  else
479  delete searchDialog;
480  }
481 }
482 
484 {
486  if (isLeaf(node))
487  {
488  auto *romInfo = node->GetData().value<RomInfo *>();
489  romInfo->setFavorite(true);
490  updateChangedNode(node, romInfo);
491  }
492 }
493 
494 void GameUI::customEvent(QEvent *event)
495 {
496  if (event->type() == DialogCompletionEvent::kEventType)
497  {
498  auto *dce = dynamic_cast<DialogCompletionEvent*>(event);
499  if (dce == nullptr)
500  return;
501  QString resultid = dce->GetId();
502  QString resulttext = dce->GetResultText();
503 
504  if (resultid == "showMenuPopup")
505  {
506  if (resulttext == tr("Edit Details"))
507  {
508  edit();
509  }
510  if (resulttext == tr("Scan For Changes"))
511  {
512  doScan();
513  }
514  else if (resulttext == tr("Show Information"))
515  {
516  showInfo();
517  }
518  else if (resulttext == tr("Make Favorite") ||
519  resulttext == tr("Remove Favorite"))
520  {
521  toggleFavorite();
522  }
523  else if (resulttext == tr("Retrieve Details"))
524  {
525  gameSearch();
526  }
527  }
528  else if (resultid == "chooseSystemPopup")
529  {
530  if (!resulttext.isEmpty() && resulttext != tr("Cancel"))
531  {
533  auto *romInfo = node->GetData().value<RomInfo *>();
534  GameHandler::Launchgame(romInfo, resulttext);
535  }
536  }
537  else if (resultid == "editMetadata")
538  {
540  auto *oldRomInfo = node->GetData().value<RomInfo *>();
541  delete oldRomInfo;
542 
543  auto *romInfo = dce->GetData().value<RomInfo *>();
544  node->SetData(QVariant::fromValue(romInfo));
545  node->SetText(romInfo->Gamename());
546 
547  romInfo->SaveToDatabase();
548  updateChangedNode(node, romInfo);
549  }
550  else if (resultid == "detailsPopup")
551  {
552  // Play button pushed
553  itemClicked(nullptr);
554  }
555  }
556  if (event->type() == MetadataLookupEvent::kEventType)
557  {
558  auto *lue = dynamic_cast<MetadataLookupEvent *>(event);
559  if (lue == nullptr)
560  return;
561  MetadataLookupList lul = lue->m_lookupList;
562 
563  if (m_busyPopup)
564  {
565  m_busyPopup->Close();
566  m_busyPopup = nullptr;
567  }
568 
569  if (lul.isEmpty())
570  return;
571 
572  if (lul.count() == 1)
573  {
574  OnGameSearchDone(lul[0]);
575  }
576  else
577  {
578  auto *resultsdialog =
580 
581  connect(resultsdialog, &MetadataResultsDialog::haveResult,
583  Qt::QueuedConnection);
584 
585  if (resultsdialog->Create())
586  m_popupStack->AddScreen(resultsdialog);
587  }
588  }
589  else if (event->type() == MetadataLookupFailure::kEventType)
590  {
591  auto *luf = dynamic_cast<MetadataLookupFailure *>(event);
592  if (luf == nullptr)
593  return;
594  MetadataLookupList lul = luf->m_lookupList;
595 
596  if (m_busyPopup)
597  {
598  m_busyPopup->Close();
599  m_busyPopup = nullptr;
600  }
601 
602  if (!lul.empty())
603  {
604  MetadataLookup *lookup = lul[0];
605  auto *node = lookup->GetData().value<MythGenericTree *>();
606  if (node)
607  {
608  auto *metadata = node->GetData().value<RomInfo *>();
609  if (metadata)
610  {
611  }
612  }
613  LOG(VB_GENERAL, LOG_ERR,
614  QString("No results found for %1").arg(lookup->GetTitle()));
615  }
616  }
617  else if (event->type() == ImageDLEvent::kEventType)
618  {
619  auto *ide = dynamic_cast<ImageDLEvent *>(event);
620  if (ide == nullptr)
621  return;
622  MetadataLookup *lookup = ide->m_item;
623 
624  if (!lookup)
625  return;
626 
627  handleDownloadedImages(lookup);
628  }
629  else if (event->type() == ImageDLFailureEvent::kEventType)
630  {
631  MythErrorNotification n(tr("Failed to retrieve image(s)"),
632  sLocation,
633  tr("Check logs"));
635  }
636 }
637 
639 {
640  QString layer = node->GetText();
641  int childDepth = node->getInt() + 1;
642  QString childLevel = getChildLevelString(node);
643  QString filter = getFilter(node);
644  bool childIsLeaf = childDepth == getLevelsOnThisBranch(node) + 1;
645  auto *romInfo = node->GetData().value<RomInfo *>();
646 
647  if (childLevel.isEmpty())
648  childLevel = "gamename";
649 
650  QString columns;
651  QString conj = "where ";
652 
653  if (!filter.isEmpty())
654  {
655  filter = conj + filter;
656  conj = " and ";
657  }
658  if ((childLevel == "gamename") && (m_gameShowFileName))
659  {
660  columns = childIsLeaf
661  ? "romname,`system`,year,genre,gamename"
662  : "romname";
663 
664  if (m_showHashed)
665  filter += " and romname like '" + layer + "%'";
666 
667  }
668  else if ((childLevel == "gamename") && (layer.length() == 1))
669  {
670  columns = childIsLeaf
671  ? childLevel + ",`system`,year,genre,gamename"
672  : childLevel;
673 
674  if (m_showHashed)
675  filter += " and gamename like '" + layer + "%'";
676 
677  }
678  else if (childLevel == "hash")
679  {
680  columns = "left(gamename,1)";
681  }
682  else
683  {
684 
685  columns = childIsLeaf
686  ? childLevel + ",`system`,year,genre,gamename"
687  : childLevel;
688  }
689 
690  // this whole section ought to be in rominfo.cpp really, but I've put it
691  // in here for now to minimise the number of files changed by this mod
692  if (romInfo)
693  {
694  if (!romInfo->System().isEmpty())
695  {
696  filter += conj + "trim(system)=:SYSTEM";
697  conj = " and ";
698  }
699  if (!romInfo->Year().isEmpty())
700  {
701  filter += conj + "year=:YEAR";
702  conj = " and ";
703  }
704  if (!romInfo->Genre().isEmpty())
705  {
706  filter += conj + "trim(genre)=:GENRE";
707  conj = " and ";
708  }
709  if (!romInfo->Plot().isEmpty())
710  {
711  filter += conj + "plot=:PLOT";
712  conj = " and ";
713  }
714  if (!romInfo->Publisher().isEmpty())
715  {
716  filter += conj + "publisher=:PUBLISHER";
717  conj = " and ";
718  }
719  if (!romInfo->Gamename().isEmpty())
720  {
721  filter += conj + "trim(gamename)=:GAMENAME";
722  }
723 
724  }
725 
726  filter += conj + " display = 1 ";
727 
728  QString sql;
729 
730  if ((childLevel == "gamename") && (m_gameShowFileName))
731  {
732  sql = "select distinct "
733  + columns
734  + " from gamemetadata "
735  + filter
736  + " order by romname"
737  + ";";
738  }
739  else if (childLevel == "hash")
740  {
741  sql = "select distinct "
742  + columns
743  + " from gamemetadata "
744  + filter
745  + " order by gamename,romname"
746  + ";";
747  }
748  else
749  {
750  sql = "select distinct "
751  + columns
752  + " from gamemetadata "
753  + filter
754  + " order by "
755  + childLevel
756  + ";";
757  }
758 
759  return sql;
760 }
761 
763 {
764  unsigned this_level = node->getInt();
765  while (node->getInt() != 1)
766  node = node->getParent();
767 
768  auto *gi = node->GetData().value<GameTreeInfo *>();
769  return gi->getLevel(this_level - 1);
770 }
771 
773 {
774  while (node->getInt() != 1)
775  node = node->getParent();
776  auto *gi = node->GetData().value<GameTreeInfo *>();
777  return gi->getFilter();
778 }
779 
781 {
782  while (node->getInt() != 1)
783  node = node->getParent();
784 
785  auto *gi = node->GetData().value<GameTreeInfo *>();
786  return gi->getDepth();
787 }
788 
790 {
791  return (node->getInt() - 1) == getLevelsOnThisBranch(node);
792 }
793 
795 {
796 // QString layername = node->GetText();
797  auto *romInfo = node->GetData().value<RomInfo *>();
798 
799  MSqlQuery query(MSqlQuery::InitCon());
800 
801  query.prepare(getFillSql(node));
802 
803  if (romInfo)
804  {
805  if (!romInfo->System().isEmpty())
806  query.bindValue(":SYSTEM", romInfo->System());
807  if (!romInfo->Year().isEmpty())
808  query.bindValue(":YEAR", romInfo->Year());
809  if (!romInfo->Genre().isEmpty())
810  query.bindValue(":GENRE", romInfo->Genre());
811  if (!romInfo->Plot().isEmpty())
812  query.bindValue(":PLOT", romInfo->Plot());
813  if (!romInfo->Publisher().isEmpty())
814  query.bindValue(":PUBLISHER", romInfo->Publisher());
815  if (!romInfo->Gamename().isEmpty())
816  query.bindValue(":GAMENAME", romInfo->Gamename());
817  }
818 
819  bool IsLeaf = node->getInt() == getLevelsOnThisBranch(node);
820  if (query.exec() && query.size() > 0)
821  {
822  while (query.next())
823  {
824  QString current = query.value(0).toString().trimmed();
825  auto *new_node =
826  new MythGenericTree(current, node->getInt() + 1, false);
827  if (IsLeaf)
828  {
829  auto *temp = new RomInfo();
830  temp->setSystem(query.value(1).toString().trimmed());
831  temp->setYear(query.value(2).toString());
832  temp->setGenre(query.value(3).toString().trimmed());
833  temp->setGamename(query.value(4).toString().trimmed());
834  new_node->SetData(QVariant::fromValue(temp));
835  node->addNode(new_node);
836  }
837  else
838  {
839  RomInfo *newRomInfo = nullptr;
840  if (node->getInt() > 1)
841  {
842  auto *currentRomInfo = node->GetData().value<RomInfo *>();
843  newRomInfo = new RomInfo(*currentRomInfo);
844  }
845  else
846  {
847  newRomInfo = new RomInfo();
848  }
849  new_node->SetData(QVariant::fromValue(newRomInfo));
850  node->addNode(new_node);
851  if (getChildLevelString(node) != "hash")
852  newRomInfo->setField(getChildLevelString(node), current);
853  }
854  }
855  }
856 }
857 
859 {
860  MythGenericTree *top_level = node;
861  while (top_level->getParent() != m_gameTree)
862  {
863  top_level = top_level->getParent();
864  }
865 
866  QList<MythGenericTree*>::iterator it;
867  QList<MythGenericTree*> *children = m_gameTree->getAllChildren();
868 
869  for (it = children->begin(); it != children->end(); ++it)
870  {
871  MythGenericTree *child = *it;
872  if (child != top_level)
873  {
874  child->deleteAllChildren();
875  }
876  }
877 }
878 
880 {
881  resetOtherTrees(node);
882 
883  if (node->getParent() == m_favouriteNode && !romInfo->Favorite())
884  {
885  // node is being removed
887  }
888  else
889  nodeChanged(node);
890 }
891 
893  bool automode)
894 {
895  if (!node)
896  node = m_gameUITree->GetCurrentNode();
897 
898  if (!node)
899  return;
900 
901  auto *metadata = node->GetData().value<RomInfo *>();
902  if (!metadata)
903  return;
904 
905  auto *lookup = new MetadataLookup();
906  lookup->SetStep(kLookupSearch);
907  lookup->SetType(kMetadataGame);
908  lookup->SetData(QVariant::fromValue(node));
909 
910  if (automode)
911  {
912  lookup->SetAutomatic(true);
913  }
914 
915  lookup->SetTitle(metadata->Gamename());
916  lookup->SetInetref(metadata->Inetref());
917  if (m_query->isRunning())
918  m_query->prependLookup(lookup);
919  else
920  m_query->addLookup(lookup);
921 
922  if (!automode)
923  {
924  //: %1 is the game name
925  QString msg = tr("Fetching details for %1")
926  .arg(metadata->Gamename());
927  createBusyDialog(msg);
928  }
929 }
930 
931 void GameUI::createBusyDialog(const QString& title)
932 {
933  if (m_busyPopup)
934  return;
935 
936  const QString& message = title;
937 
939  "mythgamebusydialog");
940 
941  if (m_busyPopup->Create())
943 }
944 
946 {
947  if (!lookup)
948  return;
949 
950  lookup->SetStep(kLookupData);
951  lookup->IncrRef();
952  m_query->prependLookup(lookup);
953 }
954 
956 {
957  if (m_busyPopup)
958  {
959  m_busyPopup->Close();
960  m_busyPopup = nullptr;
961  }
962 
963  if (!lookup)
964  return;
965 
966  auto *node = lookup->GetData().value<MythGenericTree *>();
967  if (!node)
968  return;
969 
970  auto *metadata = node->GetData().value<RomInfo *>();
971  if (!metadata)
972  return;
973 
974  metadata->setGamename(lookup->GetTitle());
975  metadata->setYear(QString::number(lookup->GetYear()));
976  metadata->setPlot(lookup->GetDescription());
977  metadata->setSystem(lookup->GetSystem());
978 
979  QStringList coverart;
980  QStringList fanart;
981  QStringList screenshot;
982 
983  // Imagery
984  ArtworkList coverartlist = lookup->GetArtwork(kArtworkCoverart);
985  for (const auto & art : qAsConst(coverartlist))
986  coverart.prepend(art.url);
987  ArtworkList fanartlist = lookup->GetArtwork(kArtworkFanart);
988  for (const auto & art : qAsConst(fanartlist))
989  fanart.prepend(art.url);
990  ArtworkList screenshotlist = lookup->GetArtwork(kArtworkScreenshot);
991  for (const auto & art : qAsConst(screenshotlist))
992  screenshot.prepend(art.url);
993 
994  StartGameImageSet(node, coverart, fanart, screenshot);
995 
996  metadata->SaveToDatabase();
997  updateChangedNode(node, metadata);
998 }
999 
1000 void GameUI::StartGameImageSet(MythGenericTree *node, QStringList coverart,
1001  QStringList fanart, QStringList screenshot)
1002 {
1003  if (!node)
1004  return;
1005 
1006  auto *metadata = node->GetData().value<RomInfo *>();
1007  if (!metadata)
1008  return;
1009 
1010  DownloadMap map;
1011 
1012  if (metadata->Boxart().isEmpty() && !coverart.empty())
1013  {
1014  ArtworkInfo info;
1015  info.url = coverart.takeAt(0).trimmed();
1016  map.insert(kArtworkCoverart, info);
1017  }
1018 
1019  if (metadata->Fanart().isEmpty() && !fanart.empty())
1020  {
1021  ArtworkInfo info;
1022  info.url = fanart.takeAt(0).trimmed();
1023  map.insert(kArtworkFanart, info);
1024  }
1025 
1026  if (metadata->Screenshot().isEmpty() && !screenshot.empty())
1027  {
1028  ArtworkInfo info;
1029  info.url = screenshot.takeAt(0).trimmed();
1030  map.insert(kArtworkScreenshot, info);
1031  }
1032 
1033  auto *lookup = new MetadataLookup();
1034  lookup->SetTitle(metadata->Gamename());
1035  lookup->SetSystem(metadata->System());
1036  lookup->SetInetref(metadata->Inetref());
1037  lookup->SetType(kMetadataGame);
1038  lookup->SetDownloads(map);
1039  lookup->SetData(QVariant::fromValue(node));
1040 
1041  m_imageDownload->addDownloads(lookup);
1042 }
1043 
1045 {
1046  if (!lookup)
1047  return;
1048 
1049  auto *node = lookup->GetData().value<MythGenericTree *>();
1050  if (!node)
1051  return;
1052 
1053  auto *metadata = node->GetData().value<RomInfo *>();
1054  if (!metadata)
1055  return;
1056 
1057  DownloadMap downloads = lookup->GetDownloads();
1058 
1059  if (downloads.isEmpty())
1060  return;
1061 
1062  for (DownloadMap::iterator i = downloads.begin();
1063  i != downloads.end(); ++i)
1064  {
1065  VideoArtworkType type = i.key();
1066  ArtworkInfo info = i.value();
1067  QString filename = info.url;
1068 
1069  if (type == kArtworkCoverart)
1070  metadata->setBoxart(filename);
1071  else if (type == kArtworkFanart)
1072  metadata->setFanart(filename);
1073  else if (type == kArtworkScreenshot)
1074  metadata->setScreenshot(filename);
1075  }
1076 
1077  metadata->SaveToDatabase();
1078  updateChangedNode(node, metadata);
1079 }
1080 
1082 {
1083  if (!m_scanner)
1084  m_scanner = new GameScanner();
1086  m_scanner->doScanAll();
1087 }
1088 
1089 void GameUI::reloadAllData(bool dbChanged)
1090 {
1091  delete m_scanner;
1092  m_scanner = nullptr;
1093 
1094  if (dbChanged)
1095  BuildTree();
1096 }
1097 
GameScanner::doScanAll
void doScanAll(void)
Definition: gamescan.cpp:227
RomInfo::Boxart
QString Boxart() const
Definition: rominfo.h:67
GameUI::getFillSql
QString getFillSql(MythGenericTree *node) const
Definition: gameui.cpp:638
GameUI::m_popupStack
MythScreenStack * m_popupStack
Definition: gameui.h:79
GameUI::isLeaf
static bool isLeaf(MythGenericTree *node)
Definition: gameui.cpp:789
mythuibuttontree.h
mythuimetadataresults.h
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:314
GameTreeInfo::m_filter
QString m_filter
Definition: gameui.cpp:41
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(GrabberScript *)
MythUISearchDialog
Provide a dialog to quickly find an entry in a list.
Definition: mythdialogbox.h:398
VideoArtworkType
VideoArtworkType
Definition: metadataimagehelper.h:10
GameUI::customEvent
void customEvent(QEvent *event) override
Definition: gameui.cpp:494
RefCountHandler
Definition: referencecounterlist.h:17
GameUI::getChildLevelString
static QString getChildLevelString(MythGenericTree *node)
Definition: gameui.cpp:762
mythuitext.h
MythGenericTree::SetData
void SetData(QVariant data)
Definition: mythgenerictree.h:97
GameTreeInfo::GameTreeInfo
GameTreeInfo(const QString &levels, QString filter)
Definition: gameui.cpp:29
DialogCompletionEvent::GetId
QString GetId()
Definition: mythdialogbox.h:52
MythUIText::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitext.cpp:83
MetadataImageDownload
Definition: metadataimagedownload.h:87
MythGenericTree::GetText
QString GetText(const QString &name="") const
Definition: mythgenerictree.cpp:557
GameUI::createBusyDialog
void createBusyDialog(const QString &title)
Definition: gameui.cpp:931
RomInfo::Plot
QString Plot() const
Definition: rominfo.h:100
GameUI::ShowMenu
void ShowMenu(void) override
Definition: gameui.cpp:416
GameUI::nodeChanged
void nodeChanged(MythGenericTree *node)
Definition: gameui.cpp:213
MetadataLookup::GetTitle
QString GetTitle() const
Definition: metadatacommon.h:299
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:385
RomInfo::Gamename
QString Gamename() const
Definition: rominfo.h:76
MetadataResultsDialog
Definition: mythuimetadataresults.h:11
GameUI::m_gameYearText
MythUIText * m_gameYearText
Definition: gameui.h:84
GameUI::edit
void edit(void)
Definition: gameui.cpp:373
GameUI
Definition: gameui.h:24
RomInfo::Favorite
bool Favorite() const
Definition: rominfo.h:115
ArtworkList
QList< ArtworkInfo > ArtworkList
Definition: metadataimagehelper.h:30
EditRomInfoDialog
Definition: romedit.h:8
GameTreeInfo::m_levels
QStringList m_levels
Definition: gameui.cpp:40
GameTreeInfo::getDepth
int getDepth() const
Definition: gameui.cpp:35
GameUI::StartGameImageSet
void StartGameImageSet(MythGenericTree *node, QStringList coverart, QStringList fanart, QStringList screenshot)
Definition: gameui.cpp:1000
GameTreeInfo::getLevel
const QString & getLevel(unsigned i) const
Definition: gameui.cpp:36
MythUIImage::Load
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
Definition: mythuiimage.cpp:970
MetadataDownload::prependLookup
void prependLookup(MetadataLookup *lookup)
prependLookup: Add lookup to top of the queue MetadataDownload::m_lookupList takes ownership of the g...
Definition: metadatadownload.cpp:53
GameUI::m_gameUITree
MythUIButtonTree * m_gameUITree
Definition: gameui.h:81
MythGenericTree::getInt
int getInt() const
Definition: mythgenerictree.h:73
MythUISearchDialog::haveResult
void haveResult(QString)
MythUIBusyDialog::Create
bool Create(void) override
Definition: mythprogressdialog.cpp:32
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
ImageDLFailureEvent::kEventType
static Type kEventType
Definition: metadataimagedownload.h:67
romedit.h
GameUI::m_scanner
GameScanner * m_scanner
Definition: gameui.h:95
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
GameScanner
Definition: gamescan.h:68
MythGenericTree::GetData
QVariant GetData(void) const
Definition: mythgenerictree.h:98
RomInfo::Genre
QString Genre() const
Definition: rominfo.h:79
MythUIButtonTree::SetCurrentNode
bool SetCurrentNode(MythGenericTree *node)
Set the currently selected node.
Definition: mythuibuttontree.cpp:344
MythGenericTree::getChildByName
MythGenericTree * getChildByName(const QString &a_name) const
Definition: mythgenerictree.cpp:379
ImageDLEvent
Definition: metadataimagedownload.h:18
MetadataDownload
Definition: metadatadownload.h:35
MetadataLookup::GetArtwork
ArtworkList GetArtwork(VideoArtworkType type) const
Definition: metadatacommon.cpp:327
GameUI::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: gameui.cpp:178
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
mythuistatetype.h
GameUI::itemClicked
void itemClicked(MythUIButtonListItem *item)
Definition: gameui.cpp:250
MythUIStateType::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuistatetype.cpp:197
GameUI::doScan
void doScan(void)
Definition: gameui.cpp:1081
mythdirs.h
MythUIImage::Reset
void Reset(void) override
Reset the image back to the default defined in the theme.
Definition: mythuiimage.cpp:647
RomInfo::System
QString System() const
Definition: rominfo.h:73
MythUIButtonTree::AssignTree
bool AssignTree(MythGenericTree *tree)
Assign the root node of the tree to be displayed.
Definition: mythuibuttontree.cpp:211
GameTreeInfo
Definition: gameui.cpp:26
GameUI::searchComplete
void searchComplete(const QString &string)
Definition: gameui.cpp:296
GameUI::m_gameTree
MythGenericTree * m_gameTree
Definition: gameui.h:75
mythuiimage.h
gamescan.h
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
kLookupSearch
@ kLookupSearch
Definition: metadatacommon.h:28
sLocation
static const QString sLocation
Definition: gameui.cpp:24
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:112
GameUI::m_gamePlotText
MythUIText * m_gamePlotText
Definition: gameui.h:86
MetadataLookup
Definition: metadatacommon.h:87
MythGenericTree::addNode
MythGenericTree * addNode(const QString &a_string, int an_int=0, bool selectable_flag=false, bool visible=true)
Definition: mythgenerictree.cpp:87
MetadataLookupFailure::kEventType
static Type kEventType
Definition: metadatadownload.h:32
MythUIButtonListItem
Definition: mythuibuttonlist.h:34
MythUIButtonTree::itemClicked
void itemClicked(MythUIButtonListItem *item)
MetadataLookup::GetDownloads
DownloadMap GetDownloads() const
Definition: metadatacommon.h:372
GameUI::updateChangedNode
void updateChangedNode(MythGenericTree *node, RomInfo *romInfo)
Definition: gameui.cpp:879
RomInfo::Screenshot
QString Screenshot() const
Definition: rominfo.h:61
GameUI::m_gameImage
MythUIImage * m_gameImage
Definition: gameui.h:88
RomInfo::fillData
void fillData()
Definition: rominfo.cpp:244
GameUI::gameSearch
void gameSearch(MythGenericTree *node=nullptr, bool automode=false)
Definition: gameui.cpp:892
GameUI::reloadAllData
void reloadAllData(bool dbchanged)
Definition: gameui.cpp:1089
MetadataLookup::GetDescription
QString GetDescription() const
Definition: metadatacommon.h:312
MythMainWindow::TranslateKeyPress
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
Definition: mythmainwindow.cpp:1102
MetadataLookupFailure
Definition: metadatadownload.h:23
ArtworkInfo
Definition: metadataimagehelper.h:21
RomInfo::setGamename
void setGamename(const QString &lgamename)
Definition: rominfo.h:77
RefCountedList< MetadataLookup >
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
MetadataLookup::GetData
QVariant GetData() const
Definition: metadatacommon.h:288
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:539
kLookupData
@ kLookupData
Definition: metadatacommon.h:29
GameUI::OnGameSearchDone
void OnGameSearchDone(MetadataLookup *lookup)
Definition: gameui.cpp:955
GameHandler::getHandler
static GameHandler * getHandler(uint i)
Definition: gamehandler.cpp:50
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:205
GameScanner::finished
void finished(bool)
MythGenericTree::childCount
int childCount(void) const
Definition: mythgenerictree.cpp:256
MythErrorNotification
Definition: mythnotification.h:198
kArtworkFanart
@ kArtworkFanart
Definition: metadataimagehelper.h:12
GameUI::m_gameGenreText
MythUIText * m_gameGenreText
Definition: gameui.h:85
GameUI::OnGameSearchListSelection
void OnGameSearchListSelection(RefCountHandler< MetadataLookup > lookup)
Definition: gameui.cpp:945
RomInfo::setFavorite
void setFavorite(bool updateDatabase=false)
Definition: rominfo.cpp:210
rominfo.h
mythgenerictree.h
MythUIBusyDialog
Definition: mythprogressdialog.h:36
MetadataDownload::addLookup
void addLookup(MetadataLookup *lookup)
addLookup: Add lookup to bottom of the queue MetadataDownload::m_lookupList takes ownership of the gi...
Definition: metadatadownload.cpp:38
MetadataLookup::GetYear
uint GetYear() const
Definition: metadatacommon.h:349
MythGenericTree::deleteAllChildren
void deleteAllChildren()
Definition: mythgenerictree.cpp:455
GameUI::handleDownloadedImages
void handleDownloadedImages(MetadataLookup *lookup)
Definition: gameui.cpp:1044
MythUIButtonTree::GetCurrentNode
MythGenericTree * GetCurrentNode(void) const
Definition: mythuibuttontree.h:32
GameUI::showInfo
void showInfo(void)
Definition: gameui.cpp:395
GameUI::m_busyPopup
MythUIBusyDialog * m_busyPopup
Definition: gameui.h:78
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
MythScreenType::GetScreenStack
MythScreenStack * GetScreenStack() const
Definition: mythscreentype.cpp:216
MythGenericTree::getAllChildren
QList< MythGenericTree * > * getAllChildren() const
Definition: mythgenerictree.cpp:278
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
GameDetailsPopup
Definition: gamedetails.h:9
GameUI::m_gameShowFileName
bool m_gameShowFileName
Definition: gameui.h:73
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:930
RomInfo
Definition: rominfo.h:12
MetadataLookup::GetSystem
QString GetSystem() const
Definition: metadatacommon.h:346
MetadataResultsDialog::haveResult
void haveResult(RefCountHandler< MetadataLookup >)
GameUI::m_gameSystemText
MythUIText * m_gameSystemText
Definition: gameui.h:83
GameUI::m_gameTitleText
MythUIText * m_gameTitleText
Definition: gameui.h:82
MythUIButtonTree::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuibuttontree.cpp:234
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:397
MetadataLookupEvent::kEventType
static Type kEventType
Definition: metadatadownload.h:20
RomInfo::Fanart
QString Fanart() const
Definition: rominfo.h:64
GameHandler::SystemName
QString SystemName() const
Definition: gamehandler.h:101
GameUI::m_fanartImage
MythUIImage * m_fanartImage
Definition: gameui.h:89
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:692
MythGenericTree::getParent
MythGenericTree * getParent(void) const
Definition: mythgenerictree.cpp:372
GameUI::m_query
MetadataDownload * m_query
Definition: gameui.h:92
std
Definition: mythchrono.h:23
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
GameUI::Create
bool Create() override
Definition: gameui.cpp:55
MythGenericTree
Definition: mythgenerictree.h:27
kMetadataGame
@ kMetadataGame
Definition: metadatacommon.h:46
GameUI::showImages
void showImages(void)
Definition: gameui.cpp:286
GameUI::m_imageDownload
MetadataImageDownload * m_imageDownload
Definition: gameui.h:93
GameUI::m_gameFavouriteState
MythUIStateType * m_gameFavouriteState
Definition: gameui.h:87
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:133
GetNotificationCenter
MythNotificationCenter * GetNotificationCenter(void)
Definition: mythmainwindow.cpp:121
mythcontext.h
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:101
MThread::isRunning
bool isRunning(void) const
Definition: mthread.cpp:266
GameHandler::Launchgame
static void Launchgame(RomInfo *romdata, const QString &systemname)
Definition: gamehandler.cpp:815
GameUI::resetOtherTrees
void resetOtherTrees(MythGenericTree *node)
Definition: gameui.cpp:858
GameUI::clearRomInfo
void clearRomInfo(void)
Definition: gameui.cpp:348
build_compdb.action
action
Definition: build_compdb.py:9
GameUI::m_favouriteNode
MythGenericTree * m_favouriteNode
Definition: gameui.h:76
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:319
DownloadMap
QMap< VideoArtworkType, ArtworkInfo > DownloadMap
Definition: metadatacommon.h:84
GameUI::getFilter
static QString getFilter(MythGenericTree *node)
Definition: gameui.cpp:772
GameUI::getLevelsOnThisBranch
static int getLevelsOnThisBranch(MythGenericTree *node)
Definition: gameui.cpp:780
MythGenericTree::SetText
void SetText(const QString &text, const QString &name="", const QString &state="")
Definition: mythgenerictree.cpp:519
gameui.h
RomInfo::setField
void setField(const QString &field, const QString &data)
Definition: rominfo.cpp:169
GameUI::BuildTree
void BuildTree()
Definition: gameui.cpp:93
GameUI::m_showHashed
bool m_showHashed
Definition: gameui.h:72
GameTreeInfo::getFilter
const QString & getFilter() const
Definition: gameui.cpp:37
kArtworkScreenshot
@ kArtworkScreenshot
Definition: metadataimagehelper.h:14
MythUIImage::SetFilename
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
Definition: mythuiimage.cpp:678
GameUI::searchStart
void searchStart(void)
Definition: gameui.cpp:450
ReferenceCounter::IncrRef
virtual int IncrRef(void)
Increments reference count.
Definition: referencecounter.cpp:101
build_compdb.filename
filename
Definition: build_compdb.py:21
mythmainwindow.h
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:50
GameUI::toggleFavorite
void toggleFavorite(void)
Definition: gameui.cpp:483
MetadataLookupEvent
Definition: metadatadownload.h:11
kArtworkCoverart
@ kArtworkCoverart
Definition: metadataimagehelper.h:11
gamehandler.h
MetadataLookup::SetStep
void SetStep(LookupStep step)
Definition: metadatacommon.h:244
RomInfo::Year
QString Year() const
Definition: rominfo.h:109
GameUI::fillNode
void fillNode(MythGenericTree *node)
Definition: gameui.cpp:794
gamedetails.h
MythUIStateType::DisplayState
bool DisplayState(const QString &name)
Definition: mythuistatetype.cpp:84
MythUIButtonTree::nodeChanged
void nodeChanged(MythGenericTree *node)
ImageDLEvent::kEventType
static Type kEventType
Definition: metadataimagedownload.h:41
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:922
GameHandler::count
static uint count(void)
Definition: gamehandler.cpp:97
ArtworkInfo::url
QString url
Definition: metadataimagehelper.h:25
GameUI::m_boxImage
MythUIImage * m_boxImage
Definition: gameui.h:90
MetadataImageDownload::addDownloads
void addDownloads(MetadataLookup *lookup)
addLookup: Add lookup to bottom of the queue MetadataDownload::m_downloadList takes ownership of the ...
Definition: metadataimagedownload.cpp:53
GameUI::updateRomInfo
void updateRomInfo(RomInfo *rom)
Definition: gameui.cpp:310
MythNotificationCenter::Queue
bool Queue(const MythNotification &notification)
Queue a notification Queue() is thread-safe and can be called from anywhere.
Definition: mythnotificationcenter.cpp:1351