diff --git a/data/icons/filetypes/Makefile.am b/data/icons/filetypes/Makefile.am index ec9f09d5a..d71903773 100644 --- a/data/icons/filetypes/Makefile.am +++ b/data/icons/filetypes/Makefile.am @@ -3,4 +3,6 @@ installdir = $(ICONSDIR) install_DATA = \ file.png \ folder.png \ - movie.png + movie.png \ + mp3.png \ + picture.png diff --git a/data/icons/filetypes/mp3.png b/data/icons/filetypes/mp3.png new file mode 100644 index 000000000..f27997270 Binary files /dev/null and b/data/icons/filetypes/mp3.png differ diff --git a/data/icons/filetypes/picture.png b/data/icons/filetypes/picture.png new file mode 100644 index 000000000..c8a5d91e3 Binary files /dev/null and b/data/icons/filetypes/picture.png differ diff --git a/data/icons/headers/Makefile.am b/data/icons/headers/Makefile.am index 77e409429..faf172967 100644 --- a/data/icons/headers/Makefile.am +++ b/data/icons/headers/Makefile.am @@ -17,7 +17,6 @@ install_DATA = \ language.png \ lcd.png \ mainmenue.png \ - mp3.png \ multimedia.png \ network.png \ personalize.png \ diff --git a/data/icons/headers/mp3.png b/data/icons/headers/mp3.png deleted file mode 100644 index dc1200e58..000000000 Binary files a/data/icons/headers/mp3.png and /dev/null differ diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 49aeb4fb8..75e65bb41 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -631,11 +631,11 @@ filebrowser.prevpage Seite zurück filebrowser.scan Durchsuche Verzeichnisse filebrowser.select Auswählen filebrowser.showrights Dateirechte anzeigen -filebrowser.sort.date (Datum) -filebrowser.sort.name (Dateiname) -filebrowser.sort.namedirsfirst (Dateiname2) -filebrowser.sort.size (Größe) -filebrowser.sort.type (Typ) +filebrowser.sort.date Datum +filebrowser.sort.name Name +filebrowser.sort.namedirsfirst Name, Verz. zuerst +filebrowser.sort.size Größe +filebrowser.sort.type Typ filesystem.is.utf8 Dateisystem filesystem.is.utf8.option.iso8859.1 ISO-8859-1 filesystem.is.utf8.option.utf8 UTF-8 @@ -747,7 +747,7 @@ flashupdate.writeflashmtd einzelne Partition einspielen flashupdate.wrongbase Abweichende Release-Information\nFortfahren? fontmenu.channellist Kanalliste fontmenu.epg EPG (Programmführer) -fontmenu.eventlist Event-Liste +fontmenu.eventlist Eventliste fontmenu.head Schrift fontmenu.infobar Infobar fontmenu.menu Menü @@ -772,7 +772,7 @@ fontsize.epg_info2 EPG Info 2 fontsize.epg_title EPG Titel fontsize.epgplus_item EPG-Plus Listeneintrag fontsize.eventlist_datetime Datum/Zeit -fontsize.eventlist_event Event Info +fontsize.eventlist_event Eventinfo fontsize.eventlist_itemlarge Groß fontsize.eventlist_itemsmall Klein fontsize.eventlist_title Titel @@ -868,6 +868,22 @@ imageinfo.kernel Kernel: imageinfo.license Lizenz imageinfo.vcs Git: imageinfo.version Version: +imdb.data_actors Darsteller +imdb.data_awards Awards +imdb.data_boxoffice Einspielergebnis +imdb.data_director Regisseur +imdb.data_failed Keine Daten gefunden +imdb.data_genre Genre +imdb.data_metascore Metascore +imdb.data_plot Handlung +imdb.data_production Produktion +imdb.data_rating_failed Keine Bewertung +imdb.data_released Veröffentlicht +imdb.data_runtime Spieldauer +imdb.data_title Originaltitel +imdb.data_votes Stimmen +imdb.data_website Webseite +imdb.data_writer Drehbuchautor imdb.info IMDb-Info imdb.info_save Bild speichern inetradio.name Internetradio diff --git a/data/locale/english.locale b/data/locale/english.locale index d2f9d9d04..9c7e42287 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -631,11 +631,11 @@ filebrowser.prevpage Prev. Page filebrowser.scan Scaning folder filebrowser.select Select filebrowser.showrights Show file rights -filebrowser.sort.date (date) -filebrowser.sort.name (name) -filebrowser.sort.namedirsfirst (name, dir first) -filebrowser.sort.size (Size) -filebrowser.sort.type (type) +filebrowser.sort.date Date +filebrowser.sort.name Name +filebrowser.sort.namedirsfirst Name, dirs first +filebrowser.sort.size Size +filebrowser.sort.type Type filesystem.is.utf8 file system filesystem.is.utf8.option.iso8859.1 ISO-8859-1 filesystem.is.utf8.option.utf8 UTF-8 @@ -761,7 +761,7 @@ fontmenu.scaling_y Vertical (in %) fontmenu.scaling_y_hint2 Vertical (in %) min 50 / max 200 fontmenu.sizes Font sizes fontsize.button_text Button text -fontsize.channel_num_zap direct selection +fontsize.channel_num_zap Direct selection fontsize.channellist Channellist fontsize.channellist_descr Description fontsize.channellist_event Event list @@ -772,7 +772,7 @@ fontsize.epg_info2 EPG Info 2 fontsize.epg_title EPG Title fontsize.epgplus_item EPG-Plus item fontsize.eventlist_datetime Date and time -fontsize.eventlist_event Event Info +fontsize.eventlist_event Event info fontsize.eventlist_itemlarge Large fontsize.eventlist_itemsmall Small fontsize.eventlist_title Title @@ -868,6 +868,22 @@ imageinfo.kernel Kernel: imageinfo.license License imageinfo.vcs Git: imageinfo.version Version: +imdb.data_actors Actors +imdb.data_awards Awards +imdb.data_boxoffice Boxoffice +imdb.data_director Director +imdb.data_failed No data found +imdb.data_genre Genre +imdb.data_metascore Metascore +imdb.data_plot Plot +imdb.data_production Production +imdb.data_rating_failed No rating +imdb.data_released Released +imdb.data_runtime Runtime +imdb.data_title Original title +imdb.data_votes Votes +imdb.data_website Website +imdb.data_writer Screenplay author imdb.info IMDb-Info imdb.info_save save Cover inetradio.name Internetradio diff --git a/src/driver/file.cpp b/src/driver/file.cpp index ce4c809f5..7e02bdf10 100644 --- a/src/driver/file.cpp +++ b/src/driver/file.cpp @@ -34,43 +34,65 @@ #include #endif /* HAVE_CONFIG_H */ -#include #include #include #include -/* ATTENTION: the array file_extension_list MUST BE SORTED ASCENDING (cf. sort, man bsearch) - otherwise bsearch will not work correctly! */ -const char * const file_extension_list[] = -{ - "aac", "asf", "avi", "bin", "bmp", "cdr", "crw", - "dts", "flac", "flv", "gif", "imu", "ipk", "iso", "jpeg", "jpg", - "m2a", "m3u", "m3u8", "m4a", "mkv", "mp2", "mp3", - "mpa", "ogg", "opk", "pls", "png", "sh", - "txt", "url", "wav", "xml" +struct file_ext_s { + const char *ext; + const CFile::FileType type; }; -/* ATTENTION: the array file_extension_list MUST BE SORTED ASCENDING (cf. sort, man bsearch) - otherwise bsearch will not work correctly! */ -const CFile::FileType file_type_list[] = +// ATTENTION: the array MUST BE SORTED ASCENDING (cf. sort, man bsearch) - otherwise bsearch will not work correctly! +static const file_ext_s file_ext[] = { - CFile::FILE_AAC , CFile::FILE_ASF , CFile::FILE_AVI , CFile::FILE_BIN_PACKAGE ,CFile::FILE_PICTURE , CFile::FILE_CDR , CFile::FILE_PICTURE , - CFile::FILE_WAV , CFile::FILE_FLAC , CFile::FILE_FLV , CFile::FILE_PICTURE , CFile::STREAM_PICTURE , CFile::FILE_PKG_PACKAGE ,CFile::FILE_ISO , CFile::FILE_PICTURE , CFile::FILE_PICTURE , - CFile::FILE_MP3 , CFile::FILE_PLAYLIST , CFile::FILE_PLAYLIST , CFile::FILE_AAC , CFile::FILE_MKV , CFile::FILE_MP3 , CFile::FILE_MP3 , - CFile::FILE_MP3 , CFile::FILE_OGG , CFile::FILE_PKG_PACKAGE, CFile::FILE_PLAYLIST , CFile::FILE_PICTURE , CFile::FILE_TEXT , - CFile::FILE_TEXT , CFile::STREAM_AUDIO , CFile::FILE_WAV , CFile::FILE_XML + { "aac", CFile::FILE_AAC }, + { "asf", CFile::FILE_ASF }, + { "avi", CFile::FILE_AVI }, + { "bin", CFile::FILE_BIN_PACKAGE }, + { "bmp", CFile::FILE_PICTURE }, + { "cdr", CFile::FILE_CDR }, + { "crw", CFile::FILE_PICTURE }, + { "dts", CFile::FILE_WAV }, + { "flac", CFile::FILE_FLAC }, + { "flv", CFile::FILE_MPG }, + { "gif", CFile::FILE_PICTURE }, + { "imu", CFile::STREAM_PICTURE }, + { "ipk", CFile::FILE_PKG_PACKAGE }, + { "iso", CFile::FILE_ISO }, + { "jpeg", CFile::FILE_PICTURE }, + { "jpg", CFile::FILE_PICTURE }, + { "m2a", CFile::FILE_MP3 }, + { "m3u", CFile::FILE_PLAYLIST }, + { "m3u8", CFile::FILE_PLAYLIST }, + { "m4a", CFile::FILE_AAC }, + { "mkv", CFile::FILE_MKV }, + { "mp2", CFile::FILE_MP3 }, + { "mp3", CFile::FILE_MP3 }, + { "mp4", CFile::FILE_MPG }, + { "mpa", CFile::FILE_MP3 }, + { "mpeg", CFile::FILE_MPG }, + { "mpg", CFile::FILE_MPG }, + { "ogg", CFile::FILE_OGG }, + { "opk", CFile::FILE_PKG_PACKAGE }, + { "pls", CFile::FILE_PLAYLIST }, + { "png", CFile::FILE_PICTURE }, + { "sh", CFile::FILE_TEXT }, + { "ts", CFile::FILE_TS }, + { "txt", CFile::FILE_TEXT }, + { "url", CFile::STREAM_AUDIO }, + { "vob", CFile::FILE_VOB }, + { "wav", CFile::FILE_WAV }, + { "xml", CFile::FILE_XML } }; int mycasecmp(const void * a, const void * b) { - return strcasecmp(*(const char * *)a, *(const char * *)b); + return strcasecmp(((file_ext_s *)a)->ext, ((file_ext_s *)b)->ext); } -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -CFile::CFile() - : Size( 0 ), Mode( 0 ), Marked( false ), Time( 0 ) +CFile::CFile() : Size( 0 ), Mode( 0 ), Marked( false ), Time( 0 ) { - Type = -1; } CFile::FileType CFile::getType(void) const @@ -78,24 +100,17 @@ CFile::FileType CFile::getType(void) const if(S_ISDIR(Mode)) return FILE_DIR; - if (Type < 0) { - Type = (int) FILE_UNKNOWN; - std::string::size_type ext_pos = Name.rfind('.'); + std::string::size_type ext_pos = Name.rfind('.'); - if (ext_pos != std::string::npos) { - const char * key = &(Name.c_str()[ext_pos + 1]); - - void * result = ::bsearch(&key, file_extension_list, sizeof(file_extension_list) / sizeof(const char *), sizeof(const char *), mycasecmp); - - if (result != NULL) - Type = (int) file_type_list[(const char * *)result - (const char * *)&file_extension_list]; - } + if (ext_pos != std::string::npos) { + const char * key = &(Name.c_str()[ext_pos + 1]); + void * result = ::bsearch(&key, file_ext, sizeof(file_ext) / sizeof(file_ext_s), sizeof(file_ext_s), mycasecmp); + if (result) + return ((file_ext_s *)result)->type; } - return (CFile::FileType) Type; + return FILE_UNKNOWN; } -//------------------------------------------------------------------------ - std::string CFile::getFileName(void) const // return name.extension or folder name without trailing / { std::string::size_type namepos = Name.rfind('/'); @@ -103,8 +118,6 @@ std::string CFile::getFileName(void) const // return name.extension or folder n return (namepos == std::string::npos) ? Name : Name.substr(namepos + 1); } -//------------------------------------------------------------------------ - std::string CFile::getPath(void) const // return complete path including trailing / { int pos = 0; diff --git a/src/driver/file.h b/src/driver/file.h index e8d7ff8b8..60801a871 100644 --- a/src/driver/file.h +++ b/src/driver/file.h @@ -59,25 +59,28 @@ class CFile { FILE_UNKNOWN = 0, FILE_AAC, - FILE_AVI, FILE_ASF, - FILE_DIR, - FILE_ISO, - FILE_TEXT, + FILE_AVI, + FILE_BIN_PACKAGE, FILE_CDR, - FILE_MP3, - FILE_MKV, - FILE_OGG, - FILE_WAV, + FILE_DIR, FILE_FLAC, FILE_FLV, - FILE_XML, - FILE_PLAYLIST, - STREAM_AUDIO, + FILE_ISO, + FILE_MKV, + FILE_MP3, + FILE_MPG, + FILE_OGG, FILE_PICTURE, - STREAM_PICTURE, - FILE_BIN_PACKAGE, - FILE_PKG_PACKAGE + FILE_PKG_PACKAGE, + FILE_PLAYLIST, + FILE_TEXT, + FILE_TS, + FILE_VOB, + FILE_WAV, + FILE_XML, + STREAM_AUDIO, + STREAM_PICTURE }; FileType getType(void) const; diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 0199bc779..bc251f253 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -66,15 +66,16 @@ CAdZapMenu::CAdZapMenu() sem_init(&sem, 0, 0); + channelId = -1; + armed = false; + monitor = false; + alerted = false; + pthread_t thr; if (pthread_create(&thr, 0, CAdZapMenu::Run, this)) fprintf(stderr, "ERROR: pthread_create(CAdZapMenu::CAdZapMenu)\n"); else pthread_detach(thr); - channelId = -1; - armed = false; - monitor = false; - alerted = false; } static bool sortByDateTime(const CChannelEvent & a, const CChannelEvent & b) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 91bd002d0..2aebefa9b 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -264,7 +264,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); int iw, ih; - m_frameBuffer->getIconSize(NEUTRINO_ICON_MP3, &iw, &ih); + m_frameBuffer->getIconSize(NEUTRINO_ICON_AUDIO, &iw, &ih); //NI m_theight = std::max(m_theight, ih+4); m_title_height = m_fheight*2 + 20 + m_sheight + 4; @@ -1573,7 +1573,7 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist || m_screensaver) return; - CComponentsHeaderLocalized header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_MP3); + CComponentsHeaderLocalized header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); //NI header.setCorner(RADIUS_MID, CORNER_TOP); if (m_inetmode) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index c4caa1203..f9cadd119 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1705,13 +1705,15 @@ void CChannelList::showChannelLogo() { if ((*chanlist).empty()) return; + if(g_settings.channellist_show_channellogo){ header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName()); header->getChannelLogoObject()->hide(); header->getChannelLogoObject()->clearSavedScreen(); - header->getChannelLogoObject()->allowPaint(true); header->getChannelLogoObject()->paint(); } + else + header->setChannelLogo(0, string()); } #define NUM_LIST_BUTTONS_SORT 9 @@ -2182,16 +2184,7 @@ void CChannelList::paintHead() } } - if(g_settings.channellist_show_channellogo){ - //ensure to have clean background - header->getChannelLogoObject()->hide(); - header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName()); - header->getChannelLogoObject()->allowPaint(false); - } - else - header->setChannelLogo(0, string()); header->paint(CC_SAVE_SCREEN_NO); - showChannelLogo(); } CComponentsHeader* CChannelList::getHeaderObject() diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index dbca41d93..078edf940 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -374,15 +374,16 @@ bool CCDraw::clearFbGradientData() for(size_t i =0; i< v_fbdata.size() ;i++) { if (v_fbdata[i].gradient_data){ if (v_fbdata[i].gradient_data->gradientBuf){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradientBuf \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data->gradientBuf); free(v_fbdata[i].gradient_data->gradientBuf); v_fbdata[i].gradient_data->gradientBuf = NULL; - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradientBuf...\033[0m\n", __func__, __LINE__); } if (v_fbdata[i].gradient_data->boxBuf){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up boxBuf \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data->boxBuf); cs_free_uncached(v_fbdata[i].gradient_data->boxBuf); v_fbdata[i].gradient_data->boxBuf = NULL; - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up boxBuf...\033[0m\n", __func__, __LINE__); } + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradient data \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data); delete v_fbdata[i].gradient_data; v_fbdata[i].gradient_data = NULL; ret = true; diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index c7215b4fc..c0c0039b0 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -112,7 +112,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_item_enabled = enabled; cc_item_selected = selected; fr_thickness = 0; //TODO: parts of the GUI still don't use framed buttons - append_x_offset = 6; + append_x_offset = OFFSET_INTER; append_y_offset = 0; corner_rad = RADIUS_SMALL; @@ -187,6 +187,7 @@ void CComponentsButton::initCaption() } //set basic properties + int x_offset = (!cc_btn_text_obj || !cc_btn_icon_obj) ? 0 : append_x_offset; int w_frame = fr_thickness; int reduce = 2*w_frame; if (cc_btn_text_obj){ @@ -198,7 +199,7 @@ void CComponentsButton::initCaption() if (cc_btn_font == NULL) cc_btn_font = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT]; - int w_cap = min(width - append_x_offset - x_cap - reduce, cc_btn_font->getRenderWidth(cc_btn_text)); + int w_cap = min(width - x_offset - x_cap - reduce, cc_btn_font->getRenderWidth(cc_btn_text)); int h_cap = min(height - reduce, cc_btn_font->getHeight()); /*NOTE: paint of centered text in y direction without y_offset @@ -235,10 +236,10 @@ void CComponentsButton::initCaption() } //handle common position of icon and text inside container required for alignment - int w_required = w_frame + append_x_offset; - w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + append_x_offset : 0; + int w_required = w_frame + x_offset; + w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + x_offset : 0; w_required += cc_btn_font ? cc_btn_font->getRenderWidth(cc_btn_text) : 0; - w_required += append_x_offset + w_frame; + w_required += x_offset + w_frame; //dynamic width if (w_required > width){ @@ -247,10 +248,10 @@ void CComponentsButton::initCaption() } //do center - int x_icon = width/2 - w_required/2 /*+ fr_thickness + append_x_offset*/; + int x_icon = width/2 - w_required/2 /*+ fr_thickness + x_offset*/; int w_icon = 0; if (cc_btn_icon_obj){ - x_icon += w_frame + append_x_offset; + x_icon += w_frame + x_offset; cc_btn_icon_obj->setXPos(x_icon); w_icon = cc_btn_icon_obj->getWidth(); /*in case of dynamic changed height of caption or button opbject itself, @@ -260,7 +261,7 @@ void CComponentsButton::initCaption() cc_btn_icon_obj->setYPos(y_icon); } if (cc_btn_text_obj){ - cc_btn_text_obj->setXPos(x_icon + w_icon + append_x_offset); + cc_btn_text_obj->setXPos(x_icon + w_icon + x_offset); cc_btn_text_obj->setWidth(width - cc_btn_text_obj->getXPos()); } } diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 297406e9f..46d4781df 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -325,12 +325,14 @@ bool CComponentsFrmClock::startClock() if (cl_timer == NULL){ cl_timer = new CComponentsTimer(0); cl_timer->setThreadName("frmClock"); - if (cl_timer->OnTimer.empty()){ - dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); - cl_timer->OnTimer.connect(cl_sl_show); - force_paint_bg = true; - } } + + if (cl_timer->OnTimer.empty()){ + dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); + cl_timer->OnTimer.connect(cl_sl_show); + force_paint_bg = true; + } + cl_timer->setTimerInterval(cl_interval); if (cl_timer->startTimer()) @@ -390,7 +392,7 @@ void CComponentsFrmClock::paint(bool do_save_bg) void CComponentsFrmClock::setClockFont(Font *font, const int& style) { - if (cl_font != font || (cl_font != font)){ + if (cl_font != font || cl_font_style != style){ if (cl_font != font) cl_font = font; if (style != -1) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 34d4fb226..75b14da0b 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -232,8 +232,10 @@ void CComponentsHeader::initIcon() //init cch_icon_obj only if an icon available if (cch_icon_name.empty()) { cch_icon_w = 0; - if (cch_icon_obj) + if (cch_icon_obj){ removeCCItem(cch_icon_obj); + cch_icon_obj = NULL; + } return; } diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 73fa733be..2a553950e 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -94,7 +94,7 @@ void CComponentsScrollBar::initVarSbForm(const int& count, const fb_pixel_t& col sb_down_obj = NULL; sb_segments_obj = NULL; - setCorner(RADIUS_MIN, CORNER_ALL); + setCorner(RADIUS_NONE, CORNER_ALL); //NI sb_up_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_UP) ; sb_down_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_DOWN); diff --git a/src/gui/components/cc_item_progressbar.cpp b/src/gui/components/cc_item_progressbar.cpp index 14ec48588..b40546e45 100644 --- a/src/gui/components/cc_item_progressbar.cpp +++ b/src/gui/components/cc_item_progressbar.cpp @@ -153,7 +153,7 @@ class CProgressBarCache static inline unsigned int make16color(__u32 rgb){return 0xFF000000 | rgb;}; - void pbcPaintBoxRel(int x, int y, int dx, int dy, fb_pixel_t *pixbuf, fb_pixel_t col); + void pbcPaintBoxRel(int x, int y, int dx, int dy, fb_pixel_t *pixbuf, fb_pixel_t col) const; void pbcApplyGradient(fb_pixel_t *pixbuf); void pbcCreateBitmaps(); @@ -185,7 +185,7 @@ class CProgressBarCache } void pbcClear(); public: - void pbcPaint(int x, int y, int pbc_active_width, int pbc_passive_width); + void pbcPaint(int x, int y, int pbc_active_width, int pbc_passive_width) const; static CProgressBarCache *pbcLookup( int dy, int dx, int active_col, @@ -230,7 +230,7 @@ CProgressBarCache *CProgressBarCache::pbcLookup(int dy, int dx, int active_col, return pbc; } -void CProgressBarCache::pbcPaint(int x, int y, int pbc_active_width, int pbc_passive_width) +void CProgressBarCache::pbcPaint(int x, int y, int pbc_active_width, int pbc_passive_width) const { y += yoff; static CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); @@ -258,7 +258,7 @@ void CProgressBarCache::pbcPaint(int x, int y, int pbc_active_width, int pbc_pas frameBuffer->mark(x, y, x + pbc_width, y + pbc_height); } -void CProgressBarCache::pbcPaintBoxRel(int x, int y, int dx, int dy, fb_pixel_t *pixbuf, fb_pixel_t col) +void CProgressBarCache::pbcPaintBoxRel(int x, int y, int dx, int dy, fb_pixel_t *pixbuf, fb_pixel_t col) const { if (x < 0) { dx -= x; @@ -509,23 +509,8 @@ void CProgressBar::paintProgress(bool do_save_bg) //NI graphic void CProgressBar::paintGraphic() { - std::ostringstream buf; - - buf.str(""); - buf << ICONSDIR_VAR << "/" << graphic_file << ".png"; - if (access(buf.str().c_str(), F_OK) != 0) { - buf.str(""); - buf << ICONSDIR << "/" << graphic_file << ".png"; - } - std::string pb_active_graphic(buf.str()); - - buf.str(""); - buf << ICONSDIR_VAR << "/" << graphic_file << "_passive.png"; - if (access(buf.str().c_str(), F_OK) != 0) { - buf.str(""); - buf << ICONSDIR << "/" << graphic_file << "_passive.png"; - } - std::string pb_passive_graphic(buf.str()); + std::string pb_active_graphic(frameBuffer->getIconPath(graphic_file)); + std::string pb_passive_graphic(frameBuffer->getIconPath(graphic_file + "_passive")); //printf("**** %04d::%04d: pb_last_width: %d, pb_active_width: %d, pb_max_width %d\n", pb_x, pb_y, pb_last_width, pb_active_width, pb_max_width); @@ -548,24 +533,8 @@ void CProgressBar::paintGraphic() //NI starbar void CProgressBar::paintStarBar() { - std::ostringstream buf; - graphic_file = "stars"; - - buf.str(""); - buf << ICONSDIR_VAR << "/" << graphic_file << ".png"; - if (access(buf.str().c_str(), F_OK) != 0) { - buf.str(""); - buf << ICONSDIR << "/" << graphic_file << ".png"; - } - std::string pb_active_graphic(buf.str()); - - buf.str(""); - buf << ICONSDIR_VAR << "/" << graphic_file << "_bg.png"; - if (access(buf.str().c_str(), F_OK) != 0) { - buf.str(""); - buf << ICONSDIR << "/" << graphic_file << "_bg.png"; - } - std::string pb_passive_graphic(buf.str()); + std::string pb_active_graphic(frameBuffer->getIconPath(NEUTRINO_ICON_STARS)); + std::string pb_passive_graphic(frameBuffer->getIconPath(NEUTRINO_ICON_STARS_BG)); int stars_w = 0, stars_h = 0; g_PicViewer->getSize(pb_passive_graphic.c_str(), &stars_w, &stars_h); diff --git a/src/gui/components/cc_item_progressbar.h b/src/gui/components/cc_item_progressbar.h index 02d351c26..6ea067c04 100644 --- a/src/gui/components/cc_item_progressbar.h +++ b/src/gui/components/cc_item_progressbar.h @@ -136,7 +136,7 @@ class CProgressBar : public CComponentsItem const int val, const int max_val){x=x_pos; y=y_pos; width=w; height=h; pb_value=val; pb_max_value=max_val;} //NI graphic - void setGraphic(std::string graphic = "progressbar"){graphic_file = graphic;}; + void setGraphic(std::string graphic) { graphic_file = graphic; } ///force update on next paint void reset() { pb_last_width = -1; } diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index ab6523840..5f32adf2d 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -144,8 +144,11 @@ bool CComponentsTimer::stopTimer() { tm_enable = false; stopThread(); - if(tm_thread == 0) + if(tm_thread == 0){ + if (!OnTimer.empty()) + OnTimer.clear(); return true; + } return false; } diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index bd0b368e0..e7100f583 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -321,7 +321,7 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) stars *= 10; // recalculate stars value for starbar int stars_w = 0, stars_h = 0; - g_PicViewer->getSize(imdb->stars_bg.c_str(), &stars_w, &stars_h); + frameBuffer->getIconSize(NEUTRINO_ICON_STARS_BG, &stars_w, &stars_h); //create starbar item CProgressBar *cc_starbar = new CProgressBar(); @@ -331,8 +331,8 @@ void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) if (imdb_active) { - int _x = sx+OFFSET_INNER_MID+cover_offset+logo_offset+stars_w+OFFSET_INNER_MID; - int _w = ox-OFFSET_INNER_MID-cover_offset-logo_offset-stars_w-OFFSET_INNER_MID; + int _x = sx+OFFSET_INNER_MID+cover_offset+logo_offset+cc_starbar->getWidth()+OFFSET_INNER_MID; + int _w = ox-OFFSET_INNER_MID-cover_offset-logo_offset-cc_starbar->getWidth()-OFFSET_INNER_MID; g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(_x, y+medlineheight, _w, imdb_rating, COL_MENUCONTENT_TEXT, 0, true); } } @@ -1655,10 +1655,9 @@ int CEpgData::showIMDb(bool splash) } //titel - std::string title = "Title"; - imdb->getIMDbElement(title); + std::string title = imdb->getIMDbElement("Title"); - if(((title.find("IMDb: URL (Seite) nicht gefunden")) != std::string::npos)) + if(((title.find(imdb->search_error)) != std::string::npos)) return 1; // clear epg array @@ -1675,25 +1674,17 @@ int CEpgData::showIMDb(bool splash) textCount = epgText.size(); //rating - imdb_rating = "imdbRating"; - imdb->getIMDbElement(imdb_rating); + imdb_rating = imdb->getIMDbElement("imdbRating"); std::string value = imdb_rating; if (imdb_rating == "N/A") { value = "0"; - imdb_rating = "Keine Bewertung"; + imdb_rating = g_Locale->getText(LOCALE_IMDB_DATA_RATING_FAILED); } else imdb_rating += "/10"; -#if 0 - std::string votes = "imdbVotes"; - imdb->getIMDbElement(votes); - if (votes != "N/A") - imdb_rating += " (Stimmen: " + votes + ")"; -#endif - size_t pos = value.find_first_of(",."); if (pos != std::string::npos) value.replace(pos, 1, ""); // change 8,1 or 8.1 to 81 diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 7b41520cf..0dabc9b93 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -323,7 +323,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna iheight = ::paintButtons(0, 0, 0, 1, tmp_button, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); // Calculate theight - theight = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getHeight(); + theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); //NI const int pic_h = 39; theight = std::max(theight, pic_h); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index a69818abb..b0f47b03a 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -268,19 +268,18 @@ void CFileBrowser::fontInit() height = frameBuffer->getScreenHeightRel(); x = getScreenStartX(width); - theight = fnt_title->getHeight(); - fheight = fnt_item->getHeight(); - if (fheight == 0) - fheight = 1; /* avoid div by zero on invalid font */ - //foheight = fnt_foot->getHeight()+6; //initial height value for buttonbar; TODO get value from buttonbar - foheight = paintFoot(false); - skwidth = 26; + header_height = fnt_title->getHeight(); + item_height = fnt_item->getHeight(); + if (item_height == 0) + item_height = 1; /* avoid div by zero on invalid font */ + footer_height = paintFoot(false); + smskey_width = fnt_foot->getRenderWidth("M") + OFFSET_INNER_MID; liststart = 0; - listmaxshow = std::max(1,(int)(height - theight - foheight)/fheight); + listmaxshow = std::max(1,(int)(height - header_height - footer_height)/item_height); //recalc height - height = theight + listmaxshow * fheight + foheight; + height = header_height + listmaxshow * item_height + footer_height; y = getScreenStartY(height); } @@ -1167,8 +1166,8 @@ void CFileBrowser::hide() void CFileBrowser::paintItem(unsigned int pos) { - int colwidth1, colwidth2, colwidth3; - int ypos = y+ theight+0 + pos*fheight; + int col1_width, col2_width, col3_width; + int ypos = y + header_height + pos*item_height; CFile * actual_file = NULL; std::string fileicon; unsigned int currpos = liststart + pos; @@ -1176,7 +1175,7 @@ void CFileBrowser::paintItem(unsigned int pos) if (currpos >= filelist.size()) { // just paint an empty line - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, COL_MENUCONTENT_PLUS_0); return; } @@ -1196,15 +1195,15 @@ void CFileBrowser::paintItem(unsigned int pos) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, bgcolor, i_radius); if (g_settings.filebrowser_showrights == 0 && S_ISREG(actual_file->Mode)) - colwidth2 = 0; + col2_width = 0; else - colwidth2 = fnt_item->getRenderWidth("rwxrwxrwx"); - colwidth3 = fnt_item->getRenderWidth("222.222G"); - colwidth1 = width - 35 - colwidth2 - colwidth3 - 10; + col2_width = fnt_item->getRenderWidth("rwxrwxrwx"); + col3_width = fnt_item->getRenderWidth("222.222G"); + col1_width = width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - col3_width - OFFSET_INNER_MID - col2_width - OFFSET_INNER_MID; if ( !actual_file->Name.empty() ) { @@ -1219,6 +1218,7 @@ void CFileBrowser::paintItem(unsigned int pos) case CFile::FILE_WAV: case CFile::FILE_FLAC: case CFile::FILE_AAC: + case CFile::FILE_PLAYLIST: fileicon = NEUTRINO_ICON_MP3; break; @@ -1227,13 +1227,31 @@ void CFileBrowser::paintItem(unsigned int pos) break; case CFile::FILE_PICTURE: + fileicon = NEUTRINO_ICON_PICTURE; + break; + + case CFile::FILE_AVI: + case CFile::FILE_ASF: + case CFile::FILE_MKV: + case CFile::FILE_VOB: + case CFile::FILE_MPG: + case CFile::FILE_TS: + fileicon = NEUTRINO_ICON_MOVIE; + break; + case CFile::FILE_TEXT: default: fileicon = NEUTRINO_ICON_FILE; } - frameBuffer->paintIcon(fileicon, x+5 , ypos + (fheight-16) / 2 ); - fnt_item->RenderString(x + 35, ypos + fheight, colwidth1 - 10 , FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()), color); + int icon_w = 0; + int icon_h = 0; + frameBuffer->getIconSize(NEUTRINO_ICON_FILE, &icon_w, &icon_h); + + frameBuffer->paintIcon(fileicon, x + OFFSET_INNER_MID, ypos, item_height); + + int col1_offset = OFFSET_INNER_MID + icon_w + OFFSET_INNER_MID; + fnt_item->RenderString(x + col1_offset, ypos + item_height, col1_width - col1_offset, FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()), color); if( S_ISREG(actual_file->Mode) ) { @@ -1246,13 +1264,13 @@ void CFileBrowser::paintItem(unsigned int pos) modestring[9] = 0; - fnt_item->RenderString(x + width - 25 - colwidth3 - colwidth2 , ypos+ fheight, colwidth2, modestring, color); + fnt_item->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - col3_width - OFFSET_INNER_MID - col2_width , ypos + item_height, col2_width, modestring, color); } #define GIGABYTE 1073741824LL #define MEGABYTE 1048576LL #define KILOBYTE 1024LL - char tmpstr[256]; + char sizestring[256]; const char *unit = ""; int64_t factor = 0; if (actual_file->Size >= GIGABYTE) @@ -1274,14 +1292,14 @@ void CFileBrowser::paintItem(unsigned int pos) { int a = actual_file->Size / factor; int b = (actual_file->Size - a * factor) * 1000 / factor; - snprintf(tmpstr, sizeof(tmpstr), "%d.%03d%s", a, b, unit); + snprintf(sizestring, sizeof(sizestring), "%d.%03d%s", a, b, unit); } else - snprintf(tmpstr,sizeof(tmpstr),"%d", (int)actual_file->Size); + snprintf(sizestring,sizeof(sizestring),"%d", (int)actual_file->Size); /* right align file size */ - int sz_w = fnt_item->getRenderWidth(tmpstr); - fnt_item->RenderString(x + width - sz_w - 25, ypos+ fheight, sz_w, tmpstr, color); + int sz_w = fnt_item->getRenderWidth(sizestring); + fnt_item->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - sz_w, ypos + item_height, sz_w, sizestring, color); } if(actual_file->isDir()) @@ -1292,7 +1310,7 @@ void CFileBrowser::paintItem(unsigned int pos) strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&rawtime)); /* right align directory time */ int time_w = fnt_item->getRenderWidth(timestring); - fnt_item->RenderString(x + width - time_w - 25, ypos+ fheight, time_w, timestring, color); + fnt_item->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - time_w, ypos + item_height, time_w, timestring, color); } } } @@ -1317,16 +1335,16 @@ void CFileBrowser::paintHead() /* too long? Leave out the "Filebrowser" or "Shoutcast" prefix * the allocated space is sufficient since it is surely shorter than before */ - if (fnt_title->getRenderWidth(l_name) > width - 11) + if (fnt_title->getRenderWidth(l_name) > width - 2*OFFSET_INNER_MID) l = sprintf(l_name, "%s", FILESYSTEM_ENCODING_TO_UTF8_STRING(name).c_str()); if (l_name[l - 1] == '/') l_name[--l] = '\0'; /* still too long? the last part is probably more interesting than the first part... */ - while ((fnt_title->getRenderWidth(&l_name[i]) > width - 20) && (i < l)) + while ((fnt_title->getRenderWidth(&l_name[i]) > width - 2*OFFSET_INNER_MID) && (i < l)) i++; - CComponentsHeader header(x, y, width, theight, &l_name[i]); + CComponentsHeader header(x, y, width, header_height, &l_name[i]); header.paint(CC_SAVE_SCREEN_NO); free(l_name); @@ -1360,17 +1378,12 @@ bool chooserDir(std::string &setting_dir, bool test_dir, const char *action_str, return false; } -const struct button_label FileBrowserFilterButton[2] = -{ - { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_FILEBROWSER_FILTER_INACTIVE }, - { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_FILEBROWSER_FILTER_ACTIVE }, -}; - int CFileBrowser::paintFoot(bool show) { - int cnt,res; + int cnt, res; std::string sort_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT); + sort_text += " "; sort_text += g_Locale->getText(sortByNames[g_settings.filebrowser_sortmethod]); int sort_text_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT)); @@ -1380,65 +1393,72 @@ int CFileBrowser::paintFoot(bool show) sort_text_len += len; - neutrino_locale_t f_loc = LOCALE_FILEBROWSER_FILTER_INACTIVE; + neutrino_locale_t locale_filebrowser_filter = LOCALE_FILEBROWSER_FILTER_INACTIVE; if (Filter != NULL && use_filter) - f_loc = LOCALE_FILEBROWSER_FILTER_ACTIVE; + locale_filebrowser_filter = LOCALE_FILEBROWSER_FILTER_ACTIVE; - button_label_ext footerButtons_pm[] = { + button_label_ext buttons_playlistmode[] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_FILEBROWSER_DELETE, NULL, 0, false }, - { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_FILEBROWSER_ADD, NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_FILEBROWSER_ADD, NULL, 0, false }, { NEUTRINO_ICON_BUTTON_YELLOW, NONEXISTANT_LOCALE, sort_text.c_str(), sort_text_len, false }, - { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_AUDIOPLAYER_SHUFFLE, NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_AUDIOPLAYER_SHUFFLE, NULL, 0, false }, { NEUTRINO_ICON_BUTTON_OKAY, LOCALE_FILEBROWSER_SELECT, NULL, 0, false }, { NEUTRINO_ICON_BUTTON_PLAY, LOCALE_FILEBROWSER_MARK, NULL, 0, false }, }; - button_label_ext footerButtons[] = { + button_label_ext buttons_filelistmode[] = { { NEUTRINO_ICON_BUTTON_RED, NONEXISTANT_LOCALE, sort_text.c_str(), sort_text_len, false }, { NEUTRINO_ICON_BUTTON_OKAY, LOCALE_FILEBROWSER_SELECT, NULL, 0, false }, { NEUTRINO_ICON_BUTTON_MUTE_SMALL, LOCALE_FILEBROWSER_DELETE, NULL, 0, false }, { NEUTRINO_ICON_BUTTON_PLAY, LOCALE_FILEBROWSER_MARK, NULL, 0, false }, - { NEUTRINO_ICON_BUTTON_BLUE, f_loc, NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_BLUE, locale_filebrowser_filter, NULL, 0, false }, }; if (playlistmode) { - cnt = sizeof(footerButtons_pm) / sizeof(button_label_ext); + cnt = sizeof(buttons_playlistmode)/sizeof(button_label_ext); if (!show) - return paintButtons(footerButtons_pm, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); + return paintButtons(buttons_playlistmode, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); } else { - cnt = sizeof(footerButtons) / sizeof(button_label_ext); + cnt = sizeof(buttons_filelistmode)/sizeof(button_label_ext); if (!show) - return paintButtons(footerButtons, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); + return paintButtons(buttons_filelistmode, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); } - int fowidth = width - skwidth; + int footer_width = width - smskey_width; - - if (filelist.empty()) { - frameBuffer->paintBoxRel(x, y + height - foheight, width, foheight, COL_MENUFOOT_PLUS_0, RADIUS_MID, CORNER_BOTTOM); - return foheight; + if (filelist.empty()) + { + // show an empty footer + frameBuffer->paintBoxRel(x, y + height - footer_height, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + return footer_height; } + + /* + We can't use CComponentsFooter because + CComponentsFooter can't handle button_label_ext + */ if (playlistmode) - res = paintButtons(footerButtons_pm, Filter ? cnt : cnt - 1, x, y + height - foheight, width, foheight, fowidth); + res = paintButtons(buttons_playlistmode, cnt, x, y + height - footer_height, width, footer_height, footer_width); else - res = paintButtons(footerButtons, Filter ? cnt : cnt - 1, x, y + height - foheight, width, foheight, fowidth); + res = paintButtons(buttons_filelistmode, cnt, x, y + height - footer_height, width, footer_height, footer_width); + paintSMSKey(); return res; } void CFileBrowser::paintSMSKey() { - int skheight = fnt_foot->getHeight(); + int smskey_height = fnt_foot->getHeight(); //background - frameBuffer->paintBoxRel(x + width - skwidth, y + height - foheight, skwidth, foheight, COL_MENUFOOT_PLUS_0, RADIUS_MID, CORNER_BOTTOM_RIGHT); + frameBuffer->paintBoxRel(x + width - smskey_width, y + height - footer_height, smskey_width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM_RIGHT); if(m_SMSKeyInput.getOldKey()!=0) { char cKey[2] = {(char)m_SMSKeyInput.getOldKey(), 0}; cKey[0] = toupper(cKey[0]); int len = fnt_foot->getRenderWidth(cKey); - fnt_foot->RenderString(x + width - skwidth, y + height - foheight + foheight/2 + skheight/2, len, cKey, COL_MENUHEAD_TEXT); + fnt_foot->RenderString(x + width - smskey_width, y + height - footer_height + footer_height/2 + smskey_height/2, len, cKey, COL_MENUHEAD_TEXT); } } @@ -1452,16 +1472,10 @@ void CFileBrowser::paint() paintItem(count); //scrollbar - int ypos = y+ theight; - int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0); + int total_pages = ((filelist.size() - 1) / listmaxshow) + 1; + int current_page = (selected / listmaxshow); - int sbc= ((filelist.size()- 1)/ listmaxshow)+ 1; - int sbs= (selected/listmaxshow); - if (sbc < 1) - sbc = 1; - - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_SMALL); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); } void CFileBrowser::SMSInput(const neutrino_msg_t msg) diff --git a/src/gui/filebrowser.h b/src/gui/filebrowser.h index 3d458125d..4de5981c2 100644 --- a/src/gui/filebrowser.h +++ b/src/gui/filebrowser.h @@ -162,10 +162,10 @@ class CFileBrowser unsigned int listmaxshow; std::vector selections; - int fheight; // Fonthoehe Filelist-Inhalt - int theight; // Fonthoehe Filelist-Titel - int foheight; // Hoehe der button leiste - int skwidth; // width SMSKey field + int item_height; + int header_height; + int footer_height; + int smskey_width; std::string name; std::string base; std::string m_baseurl; diff --git a/src/gui/imdb.cpp b/src/gui/imdb.cpp index 9950df625..3ce74cbfb 100644 --- a/src/gui/imdb.cpp +++ b/src/gui/imdb.cpp @@ -42,13 +42,13 @@ CIMDB::CIMDB() { - surl = "http://www.google.de/search?q="; - soutfile = "/tmp/google.out"; - IMDburl = "http://www.omdbapi.com/?plot=full&r=json&i="; - IMDbAPI = "/tmp/imdb.json"; + search_url = "http://www.google.de/search?q="; + search_outfile = "/tmp/google.out"; + search_error = "IMDb: Google download failed"; + imdb_url = "http://www.omdbapi.com/?plot=full&r=json&i="; + imdb_outfile = "/tmp/imdb.json"; + omdb_apikey = "&apikey=20711f9e"; posterfile = "/tmp/imdb.jpg"; - stars_bg = ICONSDIR "/stars_bg.png"; - stars = ICONSDIR "/stars.png"; } CIMDB::~CIMDB() @@ -202,38 +202,39 @@ std::string CIMDB::parseFile(std::string search1, std::string search2, const cha return(ret); } -std::string CIMDB::googleIMDb(std::string searchStr) +std::string CIMDB::googleIMDb(std::string s) { CHTTPTool httpTool; - std::string ret = "IMDb: google download fehlgeschlagen"; - std::string httpString = "imdb+"; - char* searchStr_ = (char*) searchStr.c_str(); + std::string ret = search_error; + std::string search_string("title+"); + char* search_char = (char*) s.c_str(); m.clear(); - unlink(soutfile.c_str()); - unlink(IMDbAPI.c_str()); + unlink(search_outfile.c_str()); + unlink(imdb_outfile.c_str()); unlink(posterfile.c_str()); - while (*searchStr_!=0) + while (*search_char != 0) { - if ( (*searchStr_==' ') ) + if (*search_char == ' ') { - httpString += '+'; - } else - { - httpString += *searchStr_; + search_string += '+'; } - searchStr_++; + else + { + search_string += *search_char; + } + search_char++; } - std::string url = surl + "IMDb+" + utf82url(httpString); + std::string url = search_url + utf82url(search_string) + "%20site:www.imdb.com"; - if (httpTool.downloadFile(url, soutfile.c_str())) + if (httpTool.downloadFile(url, search_outfile.c_str())) { - ret = parseFile("http://www.imdb.com/title/", ">", soutfile.c_str()); + ret = parseFile("http://www.imdb.com/title/", ">", search_outfile.c_str()); if(ret.empty()) - ret = parseFile("http://www.imdb.de/title/", ">", soutfile.c_str()); + ret = parseFile("http://www.imdb.de/title/", ">", search_outfile.c_str()); std::string delimiters = "/&;"; size_t next = ret.find_first_of(delimiters, 0); @@ -249,7 +250,7 @@ void CIMDB::initMap( std::map& my ) Json::Reader reader; std::ostringstream ss; - std::ifstream fh(IMDbAPI.c_str(),std::ifstream::in); + std::ifstream fh(imdb_outfile.c_str(),std::ifstream::in); ss << fh.rdbuf(); std::string filedata = ss.str(); @@ -269,22 +270,30 @@ void CIMDB::initMap( std::map& my ) when api is changed */ - my["Actors"] = root.get("Actors", "").asString(); - my["Awards"] = root.get("Awards", "").asString(); - my["Country"] = root.get("Country", "").asString(); - my["Director"] = root.get("Director", "").asString(); - my["Genre"] = root.get("Genre", "").asString(); - my["imdbID"] = root.get("imdbID", "").asString(); - my["imdbRating"]= root.get("imdbRating", "").asString(); - my["imdbVotes"] = root.get("imdbVotes", "").asString(); - my["Metascore"] = root.get("Metascore", "N/A").asString(); - my["Plot"] = root.get("Plot", "").asString(); - my["Poster"] = root.get("Poster", "N/A").asString(); - my["Released"] = root.get("Released", "").asString(); - my["Response"] = root.get("Response", "False").asString(); - my["Runtime"] = root.get("Runtime", "").asString(); - my["Title"] = root.get("Title", "").asString(); - my["Writer"] = root.get("Writer", "").asString(); + my["Actors"] = root.get("Actors", "").asString(); + my["Awards"] = root.get("Awards", "").asString(); + my["BoxOffice"] = root.get("BoxOffice", "").asString(); + my["Country"] = root.get("Country", "").asString(); + my["Director"] = root.get("Director", "").asString(); + my["Genre"] = root.get("Genre", "").asString(); + my["imdbID"] = root.get("imdbID", "").asString(); + my["imdbRating"] = root.get("imdbRating", "N/A").asString(); + my["imdbVotes"] = root.get("imdbVotes", "").asString(); + my["Metascore"] = root.get("Metascore", "N/A").asString(); + my["Plot"] = root.get("Plot", "").asString(); + my["Poster"] = root.get("Poster", "N/A").asString(); + my["Production"] = root.get("Production", "").asString(); + my["Released"] = root.get("Released", "").asString(); + my["Response"] = root.get("Response", "False").asString(); + my["Runtime"] = root.get("Runtime", "").asString(); + my["Title"] = root.get("Title", "").asString(); + my["Website"] = root.get("Website", "").asString(); + my["Writer"] = root.get("Writer", "").asString(); + my["Year"] = root.get("Year", "").asString(); + + // currently unused + //my["Rated"] = root.get("Rated", "").asString(); + //my["Type"] = root.get("Type", "").asString(); } int CIMDB::getIMDb(const std::string& epgTitle) @@ -292,14 +301,14 @@ int CIMDB::getIMDb(const std::string& epgTitle) CHTTPTool httpTool; int ret = 0; - std::string imdb_ID = googleIMDb(epgTitle); + std::string imdb_id = googleIMDb(epgTitle); - if(((imdb_ID.find("IMDb: ")) != std::string::npos)) + if(((imdb_id.find(search_error)) != std::string::npos)) return ret; - std::string url = IMDburl + imdb_ID; + std::string url = imdb_url + imdb_id + omdb_apikey; - if (httpTool.downloadFile(url, IMDbAPI.c_str())) + if (httpTool.downloadFile(url, imdb_outfile.c_str())) { initMap(m); @@ -314,6 +323,16 @@ int CIMDB::getIMDb(const std::string& epgTitle) //download Poster if(m["Poster"] != "N/A") { + // if possible load bigger image + std::string origURL ("300"); + std::string replURL ("600"); + + if (m["Poster"].compare(m["Poster"].size()-7,3,origURL) == 0){ + //std::cout << "########## " << m["Poster"] << " contains " << origURL << '\n'; + m["Poster"].replace(m["Poster"].size()-7,3,replURL); + //std::cout << "########## New string: " << m["Poster"] << '\n'; + } + if (httpTool.downloadFile(m["Poster"], posterfile.c_str())) return 2; else { @@ -328,27 +347,54 @@ int CIMDB::getIMDb(const std::string& epgTitle) return ret; } +bool CIMDB::checkIMDbElement(std::string element) +{ + if (m[element].empty() || m[element].compare("N/A") == 0) + return false; + else + return true; +} + void CIMDB::getIMDbData(std::string& txt) { if (m["imdbID"].empty() || m["Response"] != "True") { - txt = "Keine Daten gefunden"; + txt = g_Locale->getText(LOCALE_IMDB_DATA_FAILED); return; } - //TODO: localize - txt += "Stimmen: "+m["imdbVotes"]+"\n"; - txt += "Metascore: "+m["Metascore"]+(m["Metascore"] == "N/A" ? "\n" : "/100\n"); - txt += "Original-Titel: "+m["Title"]+"\n"; - txt += "Datum: "+m["Released"]+" | "+m["Country"]+" | "+m["Runtime"]+"\n"; - txt += "Genre: "+m["Genre"]+"\n"; - txt += "Awards: "+m["Awards"]+"\n"; - txt += "Regisseur: "+m["Director"]+"\n"; - txt += "Drehbuch: "+m["Writer"]+"\n"; - txt += "\n"; - txt += "Darsteller: "+m["Actors"]+"\n"; - txt += "\n"; - txt += m["Plot"]; + txt += g_Locale->getString(LOCALE_IMDB_DATA_VOTES) + ": " + m["imdbVotes"] + "\n"; + if (checkIMDbElement("Metascore")) + txt += g_Locale->getString(LOCALE_IMDB_DATA_METASCORE) + ": " + m["Metascore"] + "/100\n"; + txt += g_Locale->getString(LOCALE_IMDB_DATA_TITLE) + ": " + m["Title"] + "\n"; + if (checkIMDbElement("Released")) + txt += g_Locale->getString(LOCALE_IMDB_DATA_RELEASED) + ": " + m["Country"] + ", " + m["Released"] + "\n"; + if (checkIMDbElement("Runtime")) + txt += g_Locale->getString(LOCALE_IMDB_DATA_RUNTIME) + ": " + m["Runtime"] + "\n"; + if (checkIMDbElement("Genre")) + txt += g_Locale->getString(LOCALE_IMDB_DATA_GENRE) + ": " + m["Genre"] + "\n"; + if (checkIMDbElement("Awards")) + txt += g_Locale->getString(LOCALE_IMDB_DATA_AWARDS) + ": " + m["Awards"] + "\n"; + if (checkIMDbElement("Director")) + txt += g_Locale->getString(LOCALE_IMDB_DATA_DIRECTOR) + ": " + m["Director"] + "\n"; + if (checkIMDbElement("Writer")) + txt += g_Locale->getString(LOCALE_IMDB_DATA_WRITER) + ": " + m["Writer"] + "\n"; + if (checkIMDbElement("Production")) + txt += g_Locale->getString(LOCALE_IMDB_DATA_PRODUCTION) + ": " + m["Production"] + "\n"; + if (checkIMDbElement("Website")) + txt += g_Locale->getString(LOCALE_IMDB_DATA_WEBSITE) + ": " + m["Website"] + "\n"; + if (checkIMDbElement("BoxOffice")) + txt += g_Locale->getString(LOCALE_IMDB_DATA_BOXOFFICE) + ": " + m["BoxOffice"] + "\n"; + if (checkIMDbElement("Actors")) + { + txt += "\n"; + txt += g_Locale->getString(LOCALE_IMDB_DATA_ACTORS) + ": " + m["Actors"] + "\n"; + } + if (checkIMDbElement("Plot")) + { + txt += "\n"; + txt += g_Locale->getString(LOCALE_IMDB_DATA_PLOT) + ": " + m["Plot"]; + } } std::string CIMDB::getFilename(CZapitChannel * channel, uint64_t id) @@ -421,8 +467,8 @@ void CIMDB::StringReplace(std::string &str, const std::string search, const std: void CIMDB::cleanup() { - if (access(soutfile.c_str(), F_OK) == 0) - unlink(soutfile.c_str()); + if (access(search_outfile.c_str(), F_OK) == 0) + unlink(search_outfile.c_str()); if (access(posterfile.c_str(), F_OK) == 0) unlink(posterfile.c_str()); } diff --git a/src/gui/imdb.h b/src/gui/imdb.h index a44f51b25..c6e5d952d 100644 --- a/src/gui/imdb.h +++ b/src/gui/imdb.h @@ -37,12 +37,11 @@ class CIMDB ~CIMDB(); static CIMDB* getInstance(); - std::string surl; - std::string soutfile; - std::string IMDbAPI; + std::string search_url; + std::string search_outfile; + std::string search_error; + std::string imdb_outfile; std::string posterfile; - std::string stars_bg; - std::string stars; int getIMDb(const std::string& epgTitle); std::string getFilename(CZapitChannel * channel, uint64_t id); @@ -51,15 +50,17 @@ class CIMDB void getIMDbData(std::string& txt); - bool gotPoster() { return (access(posterfile.c_str(), F_OK) == 0); }; + bool gotPoster() { return (access(posterfile.c_str(), F_OK) == 0); }; + bool checkIMDbElement(std::string element); //FIXME: what if m[element] doesn't exist? - virtual void getIMDbElement(std::string& element) { element = m[element]; }; + std::string getIMDbElement(std::string element) { return m[element]; }; private: int acc; - std::string IMDburl; - std::string googleIMDb(std::string searchStr); + std::string imdb_url; + std::string omdb_apikey; + std::string googleIMDb(std::string s); std::string utf82url(std::string s); std::string parseString(std::string search1, std::string search2, std::string str); std::string parseFile(std::string search1, std::string search2, const char* file, std::string firstline="", int line_offset=0); diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 01e9d6457..6807ac771 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -2529,9 +2529,7 @@ void CInfoViewer::showAnalogClock(int posx,int posy,int dia) hy = int((dia * 0.6 * sin(hAngleInRad))); if (analogclock_buf == NULL) { - std::string clock_face = ICONSDIR_VAR "/clock_face.png"; - if (access(clock_face.c_str(), F_OK) != 0) - clock_face = ICONSDIR "/clock_face.png"; + std::string clock_face = frameBuffer->getIconPath("clock_face"); g_PicViewer->DisplayImage(clock_face, posx-dia, posy-dia, 2*dia, 2*dia); analogclock_buf = new fb_pixel_t[2*dia * 2*dia]; diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 725e3d945..c93b92fa9 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -787,9 +787,8 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) imdb->getIMDb(title); #if 0 - element = "Title"; - imdb->getIMDbElement(element); - if (element.compare("Title") != 0) + element = imdb->getIMDbElement("Title"); + if (!element.empty()) { printf("Title\n"); printf("* old: %s\n", m_movieSelectionHandler->epgTitle.c_str()); @@ -797,9 +796,8 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) printf("* new: %s\n", m_movieSelectionHandler->epgTitle.c_str()); } - element = "Genre"; - imdb->getIMDbElement(element); - if (element.compare("Genre") != 0) + element = imdb->getIMDbElement("Genre"); + if (!element.empty()) { printf("Genre\n"); printf("* old: %s\n", m_movieSelectionHandler->epgInfo1.c_str()); @@ -808,9 +806,8 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) } #endif - element = "Year"; - imdb->getIMDbElement(element); - if (element.compare("Year") != 0) + element = imdb->getIMDbElement("Year"); + if (!element.empty()) { printf("Year\n"); printf("* old: %d\n", m_movieSelectionHandler->productionDate); @@ -818,9 +815,8 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) printf("* new: %d\n", m_movieSelectionHandler->productionDate); } - element = "Country"; - imdb->getIMDbElement(element); - if (element.compare("Country") != 0) + element = imdb->getIMDbElement("Country"); + if (!element.empty()) { printf("Country\n"); printf("* old: %s\n", m_movieSelectionHandler->productionCountry.c_str()); @@ -828,9 +824,8 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) printf("* new: %s\n", m_movieSelectionHandler->productionCountry.c_str()); } - element = "imdbRating"; - imdb->getIMDbElement(element); - if (element.compare("imdbRating") != 0 && element.compare("N/A") != 0) + element = imdb->getIMDbElement("imdbRating"); + if (!element.empty()) { if ((pos = element.find_first_of(",.")) != std::string::npos) element.replace(pos, 1, ""); // change 8,1 or 8.1 to 81 diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 82e241c16..d6c76c95b 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -125,7 +125,7 @@ size_t channellist_font_items = sizeof(channellist_font_sizes)/sizeof(channellis const SNeutrinoSettings::FONT_TYPES eventlist_font_sizes[] = { - SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE, + //NI SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE, SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE, SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL, SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME, @@ -145,7 +145,7 @@ size_t infobar_font_items = sizeof(infobar_font_sizes)/sizeof(infobar_font_sizes const SNeutrinoSettings::FONT_TYPES epg_font_sizes[] = { - SNeutrinoSettings::FONT_TYPE_EPG_TITLE, + //NI SNeutrinoSettings::FONT_TYPE_EPG_TITLE, SNeutrinoSettings::FONT_TYPE_EPG_INFO1, SNeutrinoSettings::FONT_TYPE_EPG_INFO2, SNeutrinoSettings::FONT_TYPE_EPG_DATE, @@ -225,7 +225,7 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = {LOCALE_FONTSIZE_INFOBAR_INFO , 20, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_INFOBAR_SMALL , 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_INFOBAR_ECMINFO , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, //NI - {LOCALE_FONTSIZE_FILEBROWSER_ITEM , 16, CNeutrinoFonts::FONT_STYLE_BOLD , 1}, + {LOCALE_FONTSIZE_FILEBROWSER_ITEM , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, //NI {LOCALE_FONTSIZE_MENU_HINT , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, {LOCALE_FONTSIZE_MOVIEBROWSER_HEAD , 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, //NI {LOCALE_FONTSIZE_MOVIEBROWSER_LIST , 20, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, //NI diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 5c17e517d..51b2bb0e2 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -174,7 +174,7 @@ void* CScreenSaver::ScreenSaverPrg(void* arg) if (g_settings.screensaver_timeout) { - while(1) + while(PScreenSaver) { PScreenSaver->paint(); sleep(g_settings.screensaver_timeout); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index fac258cf6..743c88397 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1043,7 +1043,7 @@ int CTimerList::show() CTimerd::responseGetTimer* timer=&timerlist[selected]; if (timer!=NULL) { - if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_REMOTEBOX || timer->eventType == CTimerd::TIMER_ZAPTO) + if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_ZAPTO) //NI { hide(); if (timer->epgID != 0) @@ -1398,7 +1398,7 @@ void CTimerList::paintFoot() if (timer != NULL) { //replace info button with dummy if timer is not type REC or ZAP - if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_REMOTEBOX || timer->eventType == CTimerd::TIMER_ZAPTO) + if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_ZAPTO) //NI TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_INFO_SMALL; else TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL; diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 345a9d041..8eeaaab4e 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -93,8 +93,6 @@ #define NEUTRINO_ICON_EPGINFO "epginfo" #define NEUTRINO_ICON_ERROR "error" #define NEUTRINO_ICON_FEATURES "features" -#define NEUTRINO_ICON_FILE "file" -#define NEUTRINO_ICON_FOLDER "folder" #define NEUTRINO_ICON_GAMES "games" #define NEUTRINO_ICON_INFO "information" #define NEUTRINO_ICON_IMPORTANT "important" @@ -103,7 +101,6 @@ #define NEUTRINO_ICON_LOCK_PASSIVE "lock_passive" #define NEUTRINO_ICON_HIDDEN "hidden" #define NEUTRINO_ICON_MOUNTED "mounted" -#define NEUTRINO_ICON_MP3 "mp3" #define NEUTRINO_ICON_MULTIMEDIA "multimedia" #define NEUTRINO_ICON_MOVIEPLAYER "icon_movieplayer" #define NEUTRINO_ICON_NKPLAY "icon_nkplay" @@ -183,6 +180,8 @@ #define NEUTRINO_ICON_PIP "pip" #define NEUTRINO_ICON_STAR_ON "star-on" #define NEUTRINO_ICON_STAR_OFF "star-off" +#define NEUTRINO_ICON_STARS_BG "stars_bg" //NI +#define NEUTRINO_ICON_STARS "stars" //NI #define NEUTRINO_ICON_TMDB "tmdb" #define NEUTRINO_ICON_IMDB "imdb" #define NEUTRINO_ICON_PICTUREVIEWER "pictureviewer" @@ -265,6 +264,13 @@ #define NEUTRINO_ICON_HINT_RESTORE "hint_restore" #define NEUTRINO_ICON_HINT_FACTORY "hint_factory" +/* filetypes */ +#define NEUTRINO_ICON_FILE "file" +#define NEUTRINO_ICON_FOLDER "folder" +#define NEUTRINO_ICON_MOVIE "movie" +#define NEUTRINO_ICON_MP3 "mp3" +#define NEUTRINO_ICON_PICTURE "picture" + /* plugins */ #define NEUTRINO_ICON_HINT_PLUGIN "hint_plugin" diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 5a23c2c88..1393ac455 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -938,7 +938,7 @@ int CNeutrinoApp::loadSetup(const char * fname) //Filebrowser g_settings.filebrowser_showrights = configfile.getInt32("filebrowser_showrights", 1); - g_settings.filebrowser_sortmethod = configfile.getInt32("filebrowser_sortmethod", 0); + g_settings.filebrowser_sortmethod = configfile.getInt32("filebrowser_sortmethod", 1); //NI if ((g_settings.filebrowser_sortmethod < 0) || (g_settings.filebrowser_sortmethod >= FILEBROWSER_NUMBER_OF_SORT_VARIANTS)) g_settings.filebrowser_sortmethod = 0; g_settings.filebrowser_denydirectoryleave = configfile.getBool("filebrowser_denydirectoryleave", false); diff --git a/src/system/localize.cpp b/src/system/localize.cpp index 63f562437..ec0b9db5f 100644 --- a/src/system/localize.cpp +++ b/src/system/localize.cpp @@ -251,6 +251,12 @@ const char * CLocaleManager::getText(const neutrino_locale_t keyName) const return localeData[keyName]; } +//NI +std::string CLocaleManager::getString(const neutrino_locale_t keyName) const +{ + return (std::string) localeData[keyName]; +} + static const neutrino_locale_t locale_weekday[7] = { LOCALE_DATE_SUN, diff --git a/src/system/localize.h b/src/system/localize.h index b12b430fd..f05e03be8 100644 --- a/src/system/localize.h +++ b/src/system/localize.h @@ -69,6 +69,7 @@ class CLocaleManager loadLocale_ret_t loadLocale(const char * const locale, bool asdefault = false); const char * getText(const neutrino_locale_t keyName) const; + std::string getString(const neutrino_locale_t keyName) const; //NI static neutrino_locale_t getMonth (const struct tm * struct_tm_p); static neutrino_locale_t getMonth (const int mon); diff --git a/src/system/locals.h b/src/system/locals.h index 47f92d4c5..2b29b273f 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -895,6 +895,22 @@ typedef enum LOCALE_IMAGEINFO_LICENSE, LOCALE_IMAGEINFO_VCS, LOCALE_IMAGEINFO_VERSION, + LOCALE_IMDB_DATA_ACTORS, + LOCALE_IMDB_DATA_AWARDS, + LOCALE_IMDB_DATA_BOXOFFICE, + LOCALE_IMDB_DATA_DIRECTOR, + LOCALE_IMDB_DATA_FAILED, + LOCALE_IMDB_DATA_GENRE, + LOCALE_IMDB_DATA_METASCORE, + LOCALE_IMDB_DATA_PLOT, + LOCALE_IMDB_DATA_PRODUCTION, + LOCALE_IMDB_DATA_RATING_FAILED, + LOCALE_IMDB_DATA_RELEASED, + LOCALE_IMDB_DATA_RUNTIME, + LOCALE_IMDB_DATA_TITLE, + LOCALE_IMDB_DATA_VOTES, + LOCALE_IMDB_DATA_WEBSITE, + LOCALE_IMDB_DATA_WRITER, LOCALE_IMDB_INFO, LOCALE_IMDB_INFO_SAVE, LOCALE_INETRADIO_NAME, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index e6fd5a2d9..e2132e314 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -895,6 +895,22 @@ const char * locale_real_names[] = "imageinfo.license", "imageinfo.vcs", "imageinfo.version", + "imdb.data_actors", + "imdb.data_awards", + "imdb.data_boxoffice", + "imdb.data_director", + "imdb.data_failed", + "imdb.data_genre", + "imdb.data_metascore", + "imdb.data_plot", + "imdb.data_production", + "imdb.data_rating_failed", + "imdb.data_released", + "imdb.data_runtime", + "imdb.data_title", + "imdb.data_votes", + "imdb.data_website", + "imdb.data_writer", "imdb.info", "imdb.info_save", "inetradio.name",