diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index df854245d..784a8585f 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1027,7 +1027,6 @@ imdb.data_votes Stimmen imdb.data_website Webseite imdb.data_writer Drehbuchautor imdb.info IMDb-Info -imdb.info_save Bild speichern imdb.read_data Suche IMDb-Daten ... inetradio.autostart Internetradio Auto-Start inetradio.name Internetradio @@ -1206,6 +1205,8 @@ mbkey.copy_several Film kopieren und teilen mbkey.cover Filmcover erzeugen/löschen mbkey.cut Film schneiden mbkey.truncate Film kürzen +mdb.save_poster Bild speichern +mdb.save_poster_hint Bild speichern mit %s menu.back Zurück menu.cancel Abbrechen menu.hint_a_pic Konfigurieren Sie den Audioplayer und den Bildbetrachter diff --git a/data/locale/english.locale b/data/locale/english.locale index af31ba7e0..966603fe2 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1027,7 +1027,6 @@ imdb.data_votes Votes imdb.data_website Website imdb.data_writer Screenplay author imdb.info IMDb-Info -imdb.info_save save Cover imdb.read_data Search IMDb data ... inetradio.autostart Internetradio auto-start inetradio.name Internetradio @@ -1206,6 +1205,8 @@ mbkey.copy_several Copy and split movie mbkey.cover Create/remove movie cover mbkey.cut Cut movie mbkey.truncate Truncate movie +mdb.save_poster Save poster +mdb.save_poster_hint Save poster with %s menu.back Back menu.cancel Cancel menu.hint_a_pic Configure audio player and picture viewer diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 665210e89..fb54d1cb3 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -288,6 +288,14 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) cover_offset = 0; frameBuffer->paintBoxRel(sx, y, ox-SCROLLBAR_WIDTH, sb, COL_MENUCONTENT_PLUS_0); // background of the text box } + /* FIXME + else + { + char hint[1024]; + snprintf(hint, sizeof(hint), g_Locale->getText(LOCALE_MDB_SAVE_POSTER_HINT), g_RCInput->getKeyName((neutrino_msg_t) g_settings.mbkey_cover)); + font->RenderString(sx+OFFSET_INNER_MID, y+OFFSET_INNER_MID+cover_height+OFFSET_INNER_MID+font->getHeight(), cover_width, hint, COL_MENUCONTENT_TEXT); + } + */ } // recalculate @@ -1197,30 +1205,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start else ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMsgBox::mbrOk , CMsgBox::mbrOk); } - else if (imdb_active && imdb->hasPoster()) - { - imdb_active = false; - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_IMDB_INFO_SAVE); - hintBox->paint(); - - std::string picname; - if (mp_info) - { - size_t _pos; - if ((_pos = movie_filename.rfind(".")) != std::string::npos) - picname = movie_filename.substr(0, _pos) + ".jpg"; - } - else - picname = CMDBTools::getInstance()->getFilename(channel, epgData.eventID); - - CFileHelpers fh; - if (!fh.copyFile(imdb->posterfile.c_str(), picname.c_str(), 0644)) - perror( "IMDb: error copy file" ); - - sleep(2); - hintBox->hide(); - showTimerEventBar(true, !mp_info && isCurrentEPG(channel_id), mp_info); //show buttons - } else { imdb_active = false; @@ -1389,6 +1373,38 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } else loop = false; } + else if (msg == (neutrino_msg_t) g_settings.mbkey_cover) + { + std::string poster(""); + + if (imdb_active && imdb->hasPoster()) + poster = imdb->getPoster(); + else if (tmdb_active && tmdb->hasPoster()) + poster = tmdb->getPoster(); + + if (!poster.empty()) + { + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MDB_SAVE_POSTER); + hintBox.paint(); + + std::string picname; + if (mp_info) + { + size_t _pos; + if ((_pos = movie_filename.rfind(".")) != std::string::npos) + picname = movie_filename.substr(0, _pos) + ".jpg"; + } + else + picname = CMDBTools::getInstance()->getFilename(channel, epgData.eventID); + + CFileHelpers fh; + if (!fh.copyFile(poster.c_str(), picname.c_str(), 0644)) + perror( "IMDb: error copy file" ); + + sleep(2); + hintBox.hide(); + } + } else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { if (!call_fromfollowlist) { g_RCInput->postMsg (msg, 0); @@ -1645,21 +1661,9 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) adzap_button += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); } - // check imdb button if (g_settings.omdb_enabled) - { - if (imdb_active) - { - EpgButtons[UsedButtons][1].button = (imdb->hasPoster()) ? NEUTRINO_ICON_BUTTON_GREEN : NEUTRINO_ICON_BUTTON_DUMMY_SMALL; - EpgButtons[UsedButtons][1].locale = LOCALE_IMDB_INFO_SAVE; - } - else - { - EpgButtons[UsedButtons][1].button = NEUTRINO_ICON_BUTTON_GREEN; - EpgButtons[UsedButtons][1].locale = LOCALE_IMDB_INFO; - } - } + EpgButtons[UsedButtons][1].button = NEUTRINO_ICON_BUTTON_GREEN; else EpgButtons[UsedButtons][1].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL; @@ -1670,9 +1674,7 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) EpgButtons[UsedButtons][2].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL; if (mp_info) - { ::paintButtons(x, y, w, MaxButtons, EpgButtons[MP_BUTTONS], w, h); - } else { // check followscreenings button diff --git a/src/gui/mdb-imdb.h b/src/gui/mdb-imdb.h index 7632992d0..3e1095f81 100644 --- a/src/gui/mdb-imdb.h +++ b/src/gui/mdb-imdb.h @@ -42,6 +42,8 @@ class CIMDB std::string parseFile(std::string search1, std::string search2, const char *file, std::string firstline = "", int line_offset = 0); std::map m; + std::string posterfile; + void initMap(std::map &my); public: @@ -56,7 +58,6 @@ class CIMDB std::string search_outfile; std::string search_error; std::string imdb_outfile; - std::string posterfile; int getMovieDetails(const std::string &epgTitle); void cleanup(); diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index f6bd14e5c..7190a15c6 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -872,7 +872,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) poster = m_movieSelectionHandler->file.Name.substr(0, pos); poster += ".jpg"; CFileHelpers fh; - if (fh.copyFile(imdb->posterfile.c_str(), poster.c_str(), 0644)) + if (fh.copyFile(imdb->getPoster().c_str(), poster.c_str(), 0644)) printf("* poster: %s\n", poster.c_str()); else printf("* poster: copy error\n"); diff --git a/src/system/locals.h b/src/system/locals.h index ce5ff35da..93d5b515e 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1054,7 +1054,6 @@ typedef enum LOCALE_IMDB_DATA_WEBSITE, LOCALE_IMDB_DATA_WRITER, LOCALE_IMDB_INFO, - LOCALE_IMDB_INFO_SAVE, LOCALE_IMDB_READ_DATA, LOCALE_INETRADIO_AUTOSTART, LOCALE_INETRADIO_NAME, @@ -1233,6 +1232,8 @@ typedef enum LOCALE_MBKEY_COVER, LOCALE_MBKEY_CUT, LOCALE_MBKEY_TRUNCATE, + LOCALE_MDB_SAVE_POSTER, + LOCALE_MDB_SAVE_POSTER_HINT, LOCALE_MENU_BACK, LOCALE_MENU_CANCEL, LOCALE_MENU_HINT_A_PIC, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d75242303..6f09e0685 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1054,7 +1054,6 @@ const char * locale_real_names[] = "imdb.data_website", "imdb.data_writer", "imdb.info", - "imdb.info_save", "imdb.read_data", "inetradio.autostart", "inetradio.name", @@ -1233,6 +1232,8 @@ const char * locale_real_names[] = "mbkey.cover", "mbkey.cut", "mbkey.truncate", + "mdb.save_poster", + "mdb.save_poster_hint", "menu.back", "menu.cancel", "menu.hint_a_pic",