mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 01:41:12 +02:00
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:
@@ -37,7 +37,6 @@
|
|||||||
|
|
||||||
#include "system/settings.h"
|
#include "system/settings.h"
|
||||||
#include "system/set_threadname.h"
|
#include "system/set_threadname.h"
|
||||||
#include "gui/widget/hintbox.h"
|
|
||||||
|
|
||||||
#include <driver/screen_max.h>
|
#include <driver/screen_max.h>
|
||||||
|
|
||||||
@@ -60,6 +59,7 @@ cTmdb::cTmdb()
|
|||||||
#else
|
#else
|
||||||
key = g_settings.tmdb_api_key;
|
key = g_settings.tmdb_api_key;
|
||||||
#endif
|
#endif
|
||||||
|
hintbox = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
cTmdb::~cTmdb()
|
cTmdb::~cTmdb()
|
||||||
@@ -71,15 +71,19 @@ void cTmdb::setTitle(std::string epgtitle)
|
|||||||
{
|
{
|
||||||
minfo.epgtitle = epgtitle;
|
minfo.epgtitle = epgtitle;
|
||||||
|
|
||||||
CHintBox hintbox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_TMDB_READ_DATA));
|
hintbox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_TMDB_READ_DATA));
|
||||||
hintbox.paint();
|
hintbox->paint();
|
||||||
|
|
||||||
std::string lang = Lang2ISO639_1(g_settings.language);
|
std::string lang = Lang2ISO639_1(g_settings.language);
|
||||||
GetMovieDetails(lang);
|
GetMovieDetails(lang);
|
||||||
if ((minfo.result < 1 || minfo.overview.empty()) && lang != "en")
|
if ((minfo.result < 1 || minfo.overview.empty()) && lang != "en")
|
||||||
GetMovieDetails("en", true);
|
GetMovieDetails("en", true);
|
||||||
|
|
||||||
hintbox.hide();
|
if(hintbox){
|
||||||
|
hintbox->hide();
|
||||||
|
delete hintbox;
|
||||||
|
hintbox = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cTmdb::GetData(std::string url, Json::Value *root)
|
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);
|
url = urlapi + "search/multi?api_key="+key+"&language="+lang+"&query=" + encodeUrl(title);
|
||||||
if(!(GetData(url, &root)))
|
if(!(GetData(url, &root)))
|
||||||
return false;
|
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);
|
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)
|
void cTmdb::selectResult(Json::Value elements, int results, int &use_result)
|
||||||
{
|
{
|
||||||
|
if(hintbox){
|
||||||
|
hintbox->hide();
|
||||||
|
delete hintbox;
|
||||||
|
hintbox = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
int select = 0;
|
int select = 0;
|
||||||
|
|
||||||
CMenuWidget *m = new CMenuWidget(LOCALE_TMDB_READ_DATA, NEUTRINO_ICON_SETTINGS);
|
CMenuWidget *m = new CMenuWidget(LOCALE_TMDB_READ_DATA, NEUTRINO_ICON_SETTINGS);
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "system/helpers.h"
|
#include "system/helpers.h"
|
||||||
#include <system/helpers-json.h>
|
#include <system/helpers-json.h>
|
||||||
|
#include "gui/widget/hintbox.h"
|
||||||
|
|
||||||
#define TMDB_COVER "/tmp/tmdb.jpg"
|
#define TMDB_COVER "/tmp/tmdb.jpg"
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ class cTmdb
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
tmdbinfo minfo;
|
tmdbinfo minfo;
|
||||||
|
CHintBox* hintbox;
|
||||||
std::string key; // tmdb api key
|
std::string key; // tmdb api key
|
||||||
bool GetMovieDetails(std::string lang, bool second = false);
|
bool GetMovieDetails(std::string lang, bool second = false);
|
||||||
bool GetData(std::string url, Json::Value *root);
|
bool GetData(std::string url, Json::Value *root);
|
||||||
|
Reference in New Issue
Block a user