hide hintbox with selectResult menu

Origin commit data
------------------
Branch: ni/coolstream
Commit: ae49f08147
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2020-02-27 (Thu, 27 Feb 2020)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2020-02-27 21:23:47 +01:00
committed by vanhofen
parent 603d0dfdaa
commit 31418fd4e4
2 changed files with 18 additions and 6 deletions

View File

@@ -37,7 +37,6 @@
#include "system/settings.h"
#include "system/set_threadname.h"
#include "gui/widget/hintbox.h"
#include <driver/screen_max.h>
@@ -60,6 +59,7 @@ cTmdb::cTmdb()
#else
key = g_settings.tmdb_api_key;
#endif
hintbox = NULL;
}
cTmdb::~cTmdb()
@@ -71,15 +71,19 @@ void cTmdb::setTitle(std::string epgtitle)
{
minfo.epgtitle = epgtitle;
CHintBox hintbox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_TMDB_READ_DATA));
hintbox.paint();
hintbox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_TMDB_READ_DATA));
hintbox->paint();
std::string lang = Lang2ISO639_1(g_settings.language);
GetMovieDetails(lang);
if ((minfo.result < 1 || minfo.overview.empty()) && lang != "en")
GetMovieDetails("en", true);
hintbox.hide();
if(hintbox){
hintbox->hide();
delete hintbox;
hintbox = NULL;
}
}
bool cTmdb::GetData(std::string url, Json::Value *root)
@@ -118,8 +122,9 @@ bool cTmdb::GetMovieDetails(std::string lang, bool second)
url = urlapi + "search/multi?api_key="+key+"&language="+lang+"&query=" + encodeUrl(title);
if(!(GetData(url, &root)))
return false;
minfo.result = root.get("total_results",0).asInt();
}
minfo.result = root.get("total_results",0).asInt();
}
printf("[TMDB]: results: %d\n",minfo.result);
@@ -213,6 +218,12 @@ void cTmdb::cleanup()
void cTmdb::selectResult(Json::Value elements, int results, int &use_result)
{
if(hintbox){
hintbox->hide();
delete hintbox;
hintbox = NULL;
}
int select = 0;
CMenuWidget *m = new CMenuWidget(LOCALE_TMDB_READ_DATA, NEUTRINO_ICON_SETTINGS);

View File

@@ -23,6 +23,7 @@
#include <string>
#include "system/helpers.h"
#include <system/helpers-json.h>
#include "gui/widget/hintbox.h"
#define TMDB_COVER "/tmp/tmdb.jpg"
@@ -49,7 +50,7 @@ class cTmdb
{
private:
tmdbinfo minfo;
CHintBox* hintbox;
std::string key; // tmdb api key
bool GetMovieDetails(std::string lang, bool second = false);
bool GetData(std::string url, Json::Value *root);