From ab3e68a68ace738d9ea2856c2c6530c85fbac72b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 9 Nov 2013 18:34:09 +0100 Subject: [PATCH 01/45] audioplayer: show cover from id3-tag or folder.jpg in header if exist a file called folder.jpg in same dir as the audiofile or a audiocover is defined in id3-tag it will be displayed in header. cover in tag is preferred. ported from mohusch. original patch by tangocash. thx! Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fe07423ad195165bf354de54542a85796566f6d5 Author: vanhofen Date: 2013-11-09 (Sat, 09 Nov 2013) Origin message was: ------------------ - audioplayer: show cover from id3-tag or folder.jpg in header if exist a file called folder.jpg in same dir as the audiofile or a audiocover is defined in id3-tag it will be displayed in header. cover in tag is preferred. ported from mohusch. original patch by tangocash. thx! --- src/driver/audiodec/mp3dec.cpp | 77 ++++++++++++++++++++++++++++++++++ src/driver/audiodec/mp3dec.h | 1 + src/driver/audiometadata.cpp | 4 +- src/driver/audiometadata.h | 1 + src/gui/audioplayer.cpp | 23 +++++++++- 5 files changed, 103 insertions(+), 3 deletions(-) diff --git a/src/driver/audiodec/mp3dec.cpp b/src/driver/audiodec/mp3dec.cpp index 458873e56..f64d3956a 100644 --- a/src/driver/audiodec/mp3dec.cpp +++ b/src/driver/audiodec/mp3dec.cpp @@ -944,6 +944,7 @@ bool CMP3Dec::GetMetaData(FILE* in, const bool nice, CAudioMetaData* const m) { res = GetMP3Info(in, nice, m); GetID3(in, m); + SaveCover(in, m); } else { @@ -1344,6 +1345,82 @@ void CMP3Dec::GetID3(FILE* in, CAudioMetaData* const m) } } +bool CMP3Dec::SaveCover(FILE * in, CAudioMetaData * const m) +{ + struct id3_frame const *frame; + const char * coverfile = "/tmp/cover.jpg"; + + /* text information */ + struct id3_file *id3file = id3_file_fdopen(fileno(in), ID3_FILE_MODE_READONLY); + + if(id3file == 0) + { + printf("CMP3Dec::SaveCover: error open id3 file\n"); + return false; + } + else + { + id3_tag * tag = id3_file_tag(id3file); + if(tag) + { + frame = id3_tag_findframe(tag, "APIC", 0); + + if (frame) + { + printf("CMP3Dec::SaveCover: Cover found\n"); + // Picture file data + unsigned int j; + union id3_field const *field; + + for (j = 0; (field = id3_frame_field(frame, j)); j++) + { + switch (id3_field_type(field)) + { + case ID3_FIELD_TYPE_BINARYDATA: + id3_length_t size; + id3_byte_t const *data; + + data = id3_field_getbinarydata(field, &size); + if ( data ) + { + m->cover = coverfile; + FILE * pFile; + pFile = fopen ( coverfile , "wb" ); + fwrite (data , 1 , size , pFile ); + fclose (pFile); + } + break; + + case ID3_FIELD_TYPE_INT8: + //pic->type = id3_field_getint(field); + break; + + default: + break; + } + } + } + + id3_tag_delete(tag); + } + else + { + printf("CMP3Dec::SaveCover: error open id3 tag\n"); + return false; + } + + id3_finish_file(id3file); + } + + if(0) + { + printf("CMP3Dec::SaveCover:id3: not enough memory to display tag\n"); + return false; + } + + return true; +} + // this is a copy of static libid3tag function "finish_file" // which cannot be called from outside void id3_finish_file(struct id3_file* file) diff --git a/src/driver/audiodec/mp3dec.h b/src/driver/audiodec/mp3dec.h index cafdc4f9c..5f9b97c66 100644 --- a/src/driver/audiodec/mp3dec.h +++ b/src/driver/audiodec/mp3dec.h @@ -73,6 +73,7 @@ public: State* const state, CAudioMetaData* m, time_t* const t, unsigned int* const secondsToSkip); bool GetMetaData(FILE *in, const bool nice, CAudioMetaData* const m); + bool SaveCover(FILE*, CAudioMetaData * const m); CMP3Dec(){}; }; diff --git a/src/driver/audiometadata.cpp b/src/driver/audiometadata.cpp index 600c4f32b..92c6a78fc 100644 --- a/src/driver/audiometadata.cpp +++ b/src/driver/audiometadata.cpp @@ -51,7 +51,7 @@ CAudioMetaData::CAudioMetaData( const CAudioMetaData& src ) audio_start_pos( src.audio_start_pos ), vbr( src.vbr ), hasInfoOrXingTag( src.hasInfoOrXingTag ), artist( src.artist ), title( src.title ), album( src.album ), sc_station( src.sc_station ), - date( src.date ), genre( src.genre ), track( src.track ), + date( src.date ), genre( src.genre ), track( src.track ),cover(src.cover), changed( src.changed ) { } @@ -81,6 +81,7 @@ void CAudioMetaData::operator=( const CAudioMetaData& src ) date = src.date; genre = src.genre; track = src.track; + cover = src.cover; sc_station = src.sc_station; changed = src.changed; } @@ -104,5 +105,6 @@ void CAudioMetaData::clear() date.clear(); genre.clear(); track.clear(); + cover.clear(); changed=false; } diff --git a/src/driver/audiometadata.h b/src/driver/audiometadata.h index 022d59460..ba2a58e0c 100644 --- a/src/driver/audiometadata.h +++ b/src/driver/audiometadata.h @@ -84,6 +84,7 @@ public: std::string date; std::string genre; std::string track; + std::string cover; bool changed; }; #endif /* __AUDIO_METADATA__ */ diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index beb1be8cb..63e9171c0 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -66,6 +66,7 @@ #include #include "gui/pictureviewer.h" +extern CPictureViewer * g_PicViewer; #include #include @@ -2169,6 +2170,25 @@ void CAudioPlayerGui::updateMetaData(bool screen_saver) m_curr_audiofile.MetaData.album = meta.sc_station; updateLcd = true; } + + std::string cover = m_curr_audiofile.Filename.substr(0, m_curr_audiofile.Filename.rfind('/')) + "/folder.jpg"; + + if (!meta.cover.empty()) + cover = "/tmp/cover.jpg"; + + if ((access(cover.c_str(), F_OK) == 0) && !screen_saver) + { + g_PicViewer->DisplayImage(cover, m_x + 2, m_y + 2, m_title_height - 14, m_title_height - 14, m_frameBuffer->TM_NONE); + + if(g_settings.rounded_corners) + { + //repaint frame to cover up the corners of the cover; FIXME + if (!m_show_playlist) + m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, m_title_height - 10 - m_fheight, 2, COL_MENUCONTENT_PLUS_6, RADIUS_MID); + else + m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, m_title_height - 10, 2, COL_MENUCONTENT_PLUS_6, RADIUS_MID); + } + } } //if (CAudioPlayer::getInstance()->getScBuffered() != 0) if (CAudioPlayer::getInstance()->hasMetaDataChanged() != 0) @@ -2183,8 +2203,7 @@ void CAudioPlayerGui::updateMetaData(bool screen_saver) if (updateMeta || updateScreen) { - m_frameBuffer->paintBoxRel(m_x + 10, m_y + 4 + 2*m_fheight, m_width - 20, - m_sheight, COL_MENUCONTENTSELECTED_PLUS_0); + m_frameBuffer->paintBoxRel(m_x + 10 + m_title_height, m_y + 4 + 2*m_fheight, m_width - 20 - m_title_height, m_sheight, COL_MENUCONTENTSELECTED_PLUS_0); int xstart = ((m_width - 20 - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(m_metainfo))/2)+10; g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL] ->RenderString(m_x + xstart, m_y + 4 + 2*m_fheight + m_sheight, From c59a486f11cd59b912f8e7d2472b84b28d9825c3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 31 Oct 2013 08:27:02 +0100 Subject: [PATCH 02/45] CTextBox: add new parameter to setText() force_repaint Paint routine of text has changed, so it can be useful to affect the old behavior of text repaint beacause of text is painted only if text or some other properties have changed. Default value of force_repaint is true, so we have the same behavior like before changes. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7e91fecc0214e133eb6734fc5157ef6fe1afb5c4 Author: Thilo Graf Date: 2013-10-31 (Thu, 31 Oct 2013) --- src/gui/widget/textbox.cpp | 9 +++++++-- src/gui/widget/textbox.h | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 71a0ae94a..637716501 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -178,6 +178,7 @@ void CTextBox::initVar(void) m_textBackgroundColor = m_old_textBackgroundColor = COL_MENUCONTENT_PLUS_0; m_textColor = COL_MENUCONTENT_TEXT; + m_old_textColor = 0; m_nPaintBackground = true; m_nBgRadius = m_old_nBgRadius = 0; m_nBgRadiusType = m_old_nBgRadiusType = CORNER_ALL; @@ -517,6 +518,7 @@ bool CTextBox::hasChanged(int* x, int* y, int* dx, int* dy) || m_old_dx != *dx || m_old_dy != *dy || m_old_textBackgroundColor != m_textBackgroundColor + || m_old_textColor != m_textColor || m_old_nBgRadius != m_nBgRadius || m_old_nBgRadiusType != m_nBgRadiusType || m_old_nMode != m_nMode){ @@ -531,6 +533,7 @@ void CTextBox::reInitToCompareVar(int* x, int* y, int* dx, int* dy) m_old_dx = *dx; m_old_dy = *dy; m_old_textBackgroundColor = m_textBackgroundColor; + m_old_textColor = m_textColor; m_old_nBgRadius = m_nBgRadius; m_old_nBgRadiusType = m_nBgRadiusType; m_old_nMode = m_nMode; @@ -699,12 +702,14 @@ void CTextBox::refresh(void) } -bool CTextBox::setText(const std::string* newText, int max_width) +bool CTextBox::setText(const std::string* newText, int max_width, bool force_repaint) { //TRACE("[CTextBox]->SetText \r\n"); bool result = false; m_nMaxTextWidth = max_width; - + //reset text to force repaint the text, managed in hasChanged() + if (force_repaint) + m_old_cText = ""; //printf("setText: _max_width %d max_width %d\n", _max_width, max_width); if (newText != NULL) { diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index 044c82b55..0922521c8 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -124,7 +124,7 @@ class CTextBox int m_old_x, m_old_y, m_old_dx, m_old_dy, m_old_nBgRadius, m_old_nBgRadiusType, m_old_nMode; bool m_has_scrolled; - fb_pixel_t m_old_textBackgroundColor; + fb_pixel_t m_old_textBackgroundColor, m_old_textColor; bool m_showTextFrame; @@ -183,7 +183,7 @@ class CTextBox void scrollPageDown(const int pages); void scrollPageUp(const int pages); void enableBackgroundPaint(bool mode = true){m_nPaintBackground = mode;}; - bool setText(const std::string* newText, int max_width = 0); + bool setText(const std::string* newText, int max_width = 0, bool force_repaint = true); void setTextColor(fb_pixel_t color_text){ m_textColor = color_text;}; void setBackGroundRadius(const int radius, const int type = CORNER_ALL){m_nBgRadius = radius; m_nBgRadiusType = type;}; void setTextBorderWidth(int Hborder, int Vborder); From dc838c8810bcfb231074d362d5a53c9f002e422f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 31 Oct 2013 09:32:00 +0100 Subject: [PATCH 03/45] locales: use german translation for 'Setup Tuner' Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5d37b0b88fe4917f7a07be11a6cb1659bc47f006 Author: Thilo Graf Date: 2013-10-31 (Thu, 31 Oct 2013) --- data/locale/deutsch.locale | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 48cfd8e94..ef4a47c37 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1707,7 +1707,7 @@ satsetup.fe_mode_link_loop Loop satsetup.fe_mode_link_twin TWIN satsetup.fe_mode_master Master satsetup.fe_mode_unused Nicht genutzt -satsetup.fe_setup Setup Tuner +satsetup.fe_setup Tuner Einstellungen satsetup.lofh LNB High Offset satsetup.lofl LNB Low Offset satsetup.lofs LNB Switch Offset From 5a6f74eab61800bb2c93f2b6f2caab2a2f9ac7e9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 1 Nov 2013 19:35:18 +0100 Subject: [PATCH 04/45] CComponentsLabel: remove alternate constructor default parameters can also be used Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5fb7959ddbda4270211e9663cf495c22bd7f00ea Author: Thilo Graf Date: 2013-11-01 (Fri, 01 Nov 2013) --- src/gui/components/cc_item_text.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 2661641eb..261a50c0c 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -150,20 +150,14 @@ CComponentsLbel provides a interface to the embedded CTextBox object. class CComponentsLabel : public CComponentsText { public: - CComponentsLabel( const int x_pos, const int y_pos, const int w, const int h, + CComponentsLabel( const int x_pos = 10, const int y_pos = 10, const int w = 150, const int h = 50, std::string text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_text = COL_MENUCONTENTINACTIVE_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_text = COL_MENUCONTENTINACTIVE_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENTINACTIVE, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) :CComponentsText(x_pos, y_pos, w, h, text, mode, font_text, has_shadow, color_text, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_LABEL; }; - CComponentsLabel():CComponentsText() - { - initVarText(); - cc_item_type = CC_ITEMTYPE_LABEL; - ct_col_text = COL_MENUCONTENTINACTIVE_TEXT; - }; }; #endif From a610226223ebe39cbedc5ab9707997a673f0f903 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 1 Nov 2013 19:44:45 +0100 Subject: [PATCH 05/45] CTextBox: reinit text variables after evaluated comparison Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e617bab6cf52d0465a1ec159ad8a3640e7bff170 Author: Thilo Graf Date: 2013-11-01 (Fri, 01 Nov 2013) --- src/gui/widget/textbox.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 637716501..e60946120 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -537,6 +537,7 @@ void CTextBox::reInitToCompareVar(int* x, int* y, int* dx, int* dy) m_old_nBgRadius = m_nBgRadius; m_old_nBgRadiusType = m_nBgRadiusType; m_old_nMode = m_nMode; + m_old_cText = m_cText; } void CTextBox::refreshText(void) From d31fe6eef8b8c8d284ae1bc5899b0ad1d4d2c21d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 30 Oct 2013 11:29:25 +0100 Subject: [PATCH 06/45] CComponentsItem: add missing is_painted to hideCCItem() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4ed6e54da686a3c54bbc330cc6321ff5777297db Author: Thilo Graf Date: 2013-10-30 (Wed, 30 Oct 2013) --- src/gui/components/cc_item.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 07d621e96..0ab26c35d 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -107,21 +107,25 @@ void CComponentsItem::paintInit(bool do_save_bg) } //restore last saved screen behind form box, -//Do use parameter 'no restore' to override temporarly the restore funtionality. -//This could help to avoid ugly flicker efffects if it is necessary e.g. on often repaints, without changed contents. +//Do use parameter 'no restore' to override the restore funtionality. +//For embedded items is it mostly not required to restore saved screens, so no_resore=true also is default parameter +//for such items. +//This member ensures demage of already existing screen buffer too, if parameter no_restore was changed while runtime. void CComponentsItem::hideCCItem(bool no_restore) { - is_painted = false; - + //restore saved screen if available if (saved_screen.pixbuf) { frameBuffer->waitForIdle("CComponentsItem::hideCCItem()"); frameBuffer->RestoreScreen(saved_screen.x, saved_screen.y, saved_screen.dx, saved_screen.dy, saved_screen.pixbuf); - if (no_restore) { - delete[] saved_screen.pixbuf; - saved_screen.pixbuf = NULL; - firstPaint = true; - } + + if (no_restore) { //on parameter no restore=true delete saved screen if available + delete[] saved_screen.pixbuf; + saved_screen.pixbuf = NULL; + firstPaint = true; + } } + + is_painted = false; } void CComponentsItem::hide(bool no_restore) From 3e2fe115ded71bafe06b4deb72a0a43b28b0fdb6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 1 Nov 2013 22:20:50 +0100 Subject: [PATCH 07/45] CComponentsExtTextForm: add new class CComponentsExtTextForm this provides a combining form, that contains a text object with label Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d8514b19ee26c0f82a1546b11a07bcfeaec4a909 Author: Thilo Graf Date: 2013-11-01 (Fri, 01 Nov 2013) --- src/gui/components/Makefile.am | 1 + src/gui/components/cc.h | 2 +- src/gui/components/cc_frm.h | 91 ++++++++++ src/gui/components/cc_frm_ext_text.cpp | 225 +++++++++++++++++++++++++ src/gui/components/cc_item_text.cpp | 26 ++- src/gui/components/cc_types.h | 16 ++ 6 files changed, 353 insertions(+), 8 deletions(-) create mode 100644 src/gui/components/cc_frm_ext_text.cpp diff --git a/src/gui/components/Makefile.am b/src/gui/components/Makefile.am index 0a3da2fbb..e9cca4adc 100644 --- a/src/gui/components/Makefile.am +++ b/src/gui/components/Makefile.am @@ -31,6 +31,7 @@ libneutrino_gui_components_a_SOURCES = \ cc_frm_clock.cpp \ cc_frm_footer.cpp \ cc_frm_header.cpp \ + cc_frm_ext_text.cpp \ cc_frm_icons.cpp \ cc_frm_signalbars.cpp \ cc_frm_window.cpp \ diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index 9f13752e2..7842a0c10 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -31,8 +31,8 @@ Basic attributes and member functions for component sub classes #ifndef __N_COMPONENTS__ #define __N_COMPONENTS__ -#include "cc_base.h" #include "cc_types.h" +#include "cc_base.h" #include "cc_item_infobox.h" #include "cc_item_picture.h" diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index e00ae07d0..210d2ffa9 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -322,4 +322,95 @@ class CComponentsWindow : public CComponentsForm void Refresh(){initCCWItems();}; }; + +class CComponentsExtTextForm : public CComponentsForm +{ + private: + ///property: content of label, see also setLabelAndText() + std::string ccx_label_text; + ///property: content of text, see also setLabelAndText() + std::string ccx_text; + ///property: color of label text, see also setLabelAndTextColor() + fb_pixel_t ccx_label_color; + ///property: color of text, see also setLabelAndTextColor() + fb_pixel_t ccx_text_color; + ///property: mode of label text, see also setTextModes() + int ccx_label_align; + ///property: mode of text, see also setTextModes() + int ccx_text_align; + ///property: width of label, see also setLabelWidthPercent() + int ccx_label_width; + ///property: width of text, see also setLabelWidthPercent() + int ccx_text_width; + ///property: font type of both items (label and text), see also setLabelAndText() + Font* ccx_font; + + ///object: label object + CComponentsLabel *ccx_label_obj; + ///object: text object + CComponentsText *ccx_text_obj; + + ///initialize of properties for all objects + void initCCTextItems(); + ///initialize the label object + void initLabel(); + ///initialize the text object + void initText(); + + protected: + ///initialize basic variables + void initVarExtTextForm(const int x_pos = 0, const int y_pos = 0, const int w = 300, const int h = 27, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, + fb_pixel_t text_color = COL_MENUCONTENT_TEXT, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + + public: + ///simple constructor for CComponentsExtTextForm + CComponentsExtTextForm(); + + ///advanced constructor for CComponentsExtTextForm, provides parameters for the most required properties, and caption as string + CComponentsExtTextForm( const int x_pos, const int y_pos, const int w, const int h, + const std::string& label_text, const std::string& text, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, + fb_pixel_t text_color = COL_MENUCONTENT_TEXT, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + + ///advanced constructor for CComponentsExtTextForm, provides parameters for the most required properties, and caption as locales + CComponentsExtTextForm( const int x_pos, const int y_pos, const int w, const int h, + const neutrino_locale_t& locale_label_text, const neutrino_locale_t& locale_text, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, + fb_pixel_t text_color = COL_MENUCONTENT_TEXT, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); +// ~CComponentsExtTextForm(); //inherited from CComponentsForm + + ///assigns texts for label and text, parameter as string, parameter Font is optional for required font type, default font is dependently from defined item height + void setLabelAndText(const std::string& label_text, const std::string& text, Font* font_text = NULL); + void setLabelAndText(const neutrino_locale_t& locale_label_text, const neutrino_locale_t& locale_text, Font* font_text = NULL); + + ///assigns texts for label and text, parameter as struct (locale_ext_txt_t), parameters provide the same properties like setLabelAndText() + void setLabelAndTexts(const locale_ext_txt_t& texts); + ///assigns texts for label and text, parameter as struct (string_ext_txt_t), parameters provide the same properties like setLabelAndText() + void setLabelAndTexts(const string_ext_txt_t& locale_texts); + + ///assigns colors for text for label text, parameter as fb_pixel_t + void setLabelAndTextColor(const fb_pixel_t label_color , const fb_pixel_t text_color); + + ///assigns width of label and text related to width, parameter as uint8_t in percent of width, fits text automatically into the available remaining size of item + void setLabelWidthPercent(const uint8_t& percent_val); + + ///returns a pointer to the internal label object, use this to get access to its most properties + CComponentsLabel*getLabelObject(){return ccx_label_obj;}; + ///returns a pointer to the internal text object, use this to get access to its most properties + CComponentsText*getTextObject(){return ccx_text_obj;}; + + ///sets the text modes (mainly text alignment) to the label and text object, see /gui/widget/textbox.h for possible modes + void setTextModes(const int& label_mode, const int& text_mode); + + ///paint this item/form + void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); +}; + #endif diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp new file mode 100644 index 000000000..3d8cdfe48 --- /dev/null +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -0,0 +1,225 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Classes for generic GUI-related components. + Copyright (C) 2013, Thilo Graf 'dbt' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "cc_frm.h" + +#define DEF_HEIGHT 27 +#define DEF_LABEL_WIDTH_PERCENT 30 +#define DEF_WIDTH 300 + +using namespace std; + +CComponentsExtTextForm::CComponentsExtTextForm() +{ + initVarExtTextForm(); + initCCTextItems(); +} + +CComponentsExtTextForm::CComponentsExtTextForm( const int x_pos, const int y_pos, const int w, const int h, + const std::string& label_text, const std::string& text, + bool has_shadow, + fb_pixel_t label_color, + fb_pixel_t text_color, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +{ + initVarExtTextForm(x_pos, y_pos, w, h, has_shadow, label_color, text_color, color_frame, color_body, color_shadow); + ccx_label_text = label_text; + ccx_text = text; + initCCTextItems(); +} + +CComponentsExtTextForm::CComponentsExtTextForm( const int x_pos, const int y_pos, const int w, const int h, + const neutrino_locale_t& locale_label_text, const neutrino_locale_t& locale_text, + bool has_shadow, + fb_pixel_t label_color, + fb_pixel_t text_color, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +{ + initVarExtTextForm(x_pos, y_pos, w, h, has_shadow, label_color, text_color, color_frame, color_body, color_shadow); + ccx_label_text = g_Locale->getText(locale_label_text); + ccx_text = g_Locale->getText(locale_text); + + initCCTextItems(); +} + +void CComponentsExtTextForm::initVarExtTextForm(const int x_pos, const int y_pos, const int w, const int h, + bool has_shadow, + fb_pixel_t label_color, + fb_pixel_t text_color, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +{ + initVarForm(); + cc_item_type = CC_ITEMTYPE_FRM_EXT_TEXT; + x = x_pos; + y = y_pos; + width = w; + height = h; + ccx_label_text = ""; + ccx_text = ""; + shadow = has_shadow; + ccx_label_color = label_color; + ccx_text_color = text_color; + col_frame = color_frame; + col_body = color_body; + col_shadow = color_shadow; + ccx_label_obj = NULL; + ccx_text_obj = NULL; + corner_type = 0; + int dx = 0, dy = DEF_HEIGHT; + ccx_font = *(CNeutrinoFonts::getInstance()->getDynFont(dx, dy)); + ccx_label_align = ccx_text_align = CTextBox::NO_AUTO_LINEBREAK; + + //init ccx_label_width and ccx_text_width + //default ccx_label_width = 30% of form width + setLabelWidthPercent(DEF_LABEL_WIDTH_PERCENT ); +} + +void CComponentsExtTextForm::initLabel() +{ + //init label object only if text available + if (ccx_label_text.empty()) { + if (ccx_label_obj) + delete ccx_label_obj; + ccx_label_obj = NULL; + return; + } + + //initialize label object + if (ccx_label_obj == NULL){ + ccx_label_obj = new CComponentsLabel(); + ccx_label_obj->doPaintBg(false); + } + + //add label object + if (!ccx_label_obj->isAdded()) + addCCItem(ccx_label_obj); + + //set properties + if (ccx_label_obj){ + ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font); + ccx_label_obj->setTextColor(ccx_label_color); + ccx_label_obj->setDimensionsAll(fr_thickness, 0, ccx_label_width-fr_thickness, height-2*fr_thickness); + ccx_label_obj->setCorner(this->corner_rad, CORNER_LEFT); + } +} + +void CComponentsExtTextForm::initText() +{ + //init text object only if text available + if (ccx_text.empty()) { + if (ccx_text_obj) + delete ccx_text_obj; + ccx_text_obj = NULL; + return; + } + + //initialize text object + if (ccx_text_obj == NULL){ + ccx_text_obj = new CComponentsLabel(); + ccx_text_obj->doPaintBg(false); + } + + //add text object + if (!ccx_text_obj->isAdded()) + addCCItem(ccx_text_obj); + + //set properties + if (ccx_text_obj){ + ccx_text_obj->setText(ccx_text, ccx_text_align, ccx_font); + ccx_text_obj->setTextColor(ccx_text_color); + ccx_text_obj->setDimensionsAll(CC_APPEND, 0, ccx_text_width-2*fr_thickness, height-2*fr_thickness); + ccx_text_obj->setCorner(this->corner_rad, CORNER_RIGHT); + } +} + + +void CComponentsExtTextForm::setLabelAndText(const std::string& label_text, const std::string& text, Font* font_text) +{ + ccx_label_text = label_text; + ccx_text = text; + if (font_text) + ccx_font = font_text; + initCCTextItems(); +} + + +void CComponentsExtTextForm::setLabelAndText(const neutrino_locale_t& locale_label_text, const neutrino_locale_t& locale_text, Font* font_text) +{ + setLabelAndText(g_Locale->getText(locale_label_text), g_Locale->getText(locale_text), font_text); +} + +void CComponentsExtTextForm::setLabelAndTexts(const string_ext_txt_t& texts) +{ + setLabelAndText(texts.label_text, texts.text, texts.font); +} + +void CComponentsExtTextForm::setLabelAndTexts(const locale_ext_txt_t& locale_texts) +{ + setLabelAndText(g_Locale->getText(locale_texts.label_text), g_Locale->getText(locale_texts.text), locale_texts.font); +} + +void CComponentsExtTextForm::setTextModes(const int& label_mode, const int& text_mode) +{ + ccx_label_align = label_mode; + ccx_text_align = text_mode; + initCCTextItems(); +} + +void CComponentsExtTextForm::setLabelAndTextColor(const fb_pixel_t label_color , const fb_pixel_t text_color) +{ + ccx_label_color = label_color; + ccx_text_color = text_color; + initCCTextItems(); +} + +void CComponentsExtTextForm::initCCTextItems() +{ + height = max(height, ccx_font->getHeight()); + initLabel(); + initText(); +} + +void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val) +{ + ccx_label_width = percent_val * width/100; + ccx_text_width = width-ccx_label_width; + initCCTextItems(); +} + +void CComponentsExtTextForm::paint(bool do_save_bg) +{ + //prepare items before paint + initCCTextItems(); + + //paint form contents + paintForm(do_save_bg); +} diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index dbd94b4c2..3a5722353 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -109,7 +109,7 @@ void CComponentsText::initVarText() ct_text_Vborder = 0; ct_col_text = COL_MENUCONTENT_TEXT; - ct_old_col_text = ct_col_text; + ct_old_col_text = 0; ct_text_sent = false; ct_paint_textbg = false; ct_force_text_paint = false; @@ -153,11 +153,24 @@ void CComponentsText::initCCText() ct_textbox->setWindowMaxDimensions(width, height); ct_textbox->setWindowMinDimensions(width, height); - //send text to CTextBox object, but paint text only if text or text coloer has changed or force option is enabled - if ((ct_old_text != ct_text) || ct_old_col_text != ct_col_text || ct_force_text_paint) - ct_text_sent = ct_textbox->setText(&ct_text, this->iWidth); - ct_old_text = ct_text; - ct_old_col_text = ct_col_text; + //observe behavior of parent form if available + bool force_text_paint = ct_force_text_paint; + if (cc_parent){ + //if any embedded text item was hided because of hided parent form, + //we must ensure repaint of text, otherwise text item is not visible + if (cc_parent->isPainted()) + force_text_paint = true; + } + + //send text to CTextBox object, but force text paint text if force_text_paint option is enabled + //this is managed by CTextBox object itself + ct_text_sent = ct_textbox->setText(&ct_text, this->iWidth, force_text_paint); + + //set current text status, needed by textChanged() + if (ct_text_sent){ + ct_old_text = ct_text; + ct_old_col_text = ct_col_text; + } #ifdef DEBUG_CC printf(" [CComponentsText] [%s - %d] init text: %s [x %d, y %d, w %d, h %d]\n", __FUNCTION__, __LINE__, ct_text.c_str(), this->iX, this->iY, this->iWidth, this->iHeight); #endif @@ -170,7 +183,6 @@ void CComponentsText::clearCCText() ct_textbox = NULL; } - void CComponentsText::setText(const std::string& stext, const int mode, Font* font_text) { ct_old_text = ct_text; diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 55011123c..59fc34243 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -28,6 +28,7 @@ #include #include +#include ///cc item types typedef enum @@ -45,6 +46,7 @@ typedef enum CC_ITEMTYPE_FOOTER, CC_ITEMTYPE_FRM_ICONFORM, CC_ITEMTYPE_FRM_WINDOW, + CC_ITEMTYPE_FRM_EXT_TEXT, CC_ITEMTYPE_LABEL, CC_ITEMTYPE_PROGRESSBAR, CC_ITEMTYPE_BUTTON, @@ -125,6 +127,20 @@ typedef struct comp_element_data_t void* handler2; }comp_element_data_struct_t; +//text lebel types +typedef struct locale_ext_txt_t +{ + neutrino_locale_t label_text; + neutrino_locale_t text; + Font* font; +} locale_ext_txt_struct_t; + +typedef struct string_ext_txt_t +{ + std::string label_text; + std::string text; + Font* font; +} string_ext_txt_struct_t; #define CC_WIDTH_MIN 16 #define CC_HEIGHT_MIN 16 From c56f81269d170b69abd5c3005f54f04906c83fe4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 1 Nov 2013 22:21:43 +0100 Subject: [PATCH 08/45] CTestMenu: add sample code for CComponentsExtTextForm Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/29abd4f1ddead30861b364e4864dfd381f6fcfbc Author: Thilo Graf Date: 2013-11-01 (Fri, 01 Nov 2013) --- src/gui/test_menu.cpp | 19 ++++++++++++++++++- src/gui/test_menu.h | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 2eb8e2aa8..9ffd75917 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -73,6 +73,7 @@ CTestMenu::CTestMenu() window = NULL; button = NULL; clock = clock_r = NULL; + text_ext = NULL; } CTestMenu::~CTestMenu() @@ -90,6 +91,7 @@ CTestMenu::~CTestMenu() delete clock; delete clock_r; delete chnl_pic; + delete text_ext; } static int test_pos[4] = { 130, 192, 282, 360 }; @@ -465,8 +467,22 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) txt->paint(); return res; } + else if (actionKey == "text_ext"){ + if (text_ext == NULL) + text_ext = new CComponentsExtTextForm(); + text_ext->setDimensionsAll(10, 20, 300, 48); + text_ext->setLabelAndText("Label", "Text for demo", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); + text_ext->setFrameThickness(2); +// text_ext->setLabelWidthPercent(15/*%*/); + + if (text_ext->isPainted()) + text_ext->hide(); + else + text_ext->paint(); + return res; + } else if (actionKey == "header"){ - int hh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + int hh = 30;//g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); if (header == NULL){ header = new CComponentsHeader (100, 50, 500, hh, "Test-Header"/*, NEUTRINO_ICON_INFO, CComponentsHeader::CC_BTN_HELP | CComponentsHeader::CC_BTN_EXIT | CComponentsHeader::CC_BTN_MENU*/); // header->addHeaderButton(NEUTRINO_ICON_BUTTON_RED); @@ -680,6 +696,7 @@ void CTestMenu::showCCTests(CMenuWidget *widget) widget->addItem(new CMenuForwarderNonLocalized("Footer", true, NULL, this, "footer")); widget->addItem(new CMenuForwarderNonLocalized("Icon-Form", true, NULL, this, "iconform")); widget->addItem(new CMenuForwarderNonLocalized("Window", true, NULL, this, "window")); + widget->addItem(new CMenuForwarderNonLocalized("Text-Extended", true, NULL, this, "text_ext")); } void CTestMenu::showHWTests(CMenuWidget *widget) diff --git a/src/gui/test_menu.h b/src/gui/test_menu.h index b77bd9294..10869fe83 100644 --- a/src/gui/test_menu.h +++ b/src/gui/test_menu.h @@ -52,6 +52,7 @@ class CTestMenu : public CMenuTarget CComponentsButton *button; CComponentsFrmClock *clock ,*clock_r; CComponentsChannelLogo* chnl_pic; + CComponentsExtTextForm* text_ext; int width, selected; int showTestMenu(); From 907371b58c61ba89360c1577a0beb5cebf2de0be Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 1 Nov 2013 23:40:06 +0100 Subject: [PATCH 09/45] CComponentsLabel: use correct body color Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ffe50db001930b22e136a879498da152abb0271f Author: Thilo Graf Date: 2013-11-01 (Fri, 01 Nov 2013) --- src/gui/components/cc_item_text.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 261a50c0c..8d44d7f55 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -153,7 +153,7 @@ class CComponentsLabel : public CComponentsText CComponentsLabel( const int x_pos = 10, const int y_pos = 10, const int w = 150, const int h = 50, std::string text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_text = COL_MENUCONTENTINACTIVE_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENTINACTIVE, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_text = COL_MENUCONTENTINACTIVE_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) :CComponentsText(x_pos, y_pos, w, h, text, mode, font_text, has_shadow, color_text, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_LABEL; From 9a540db7aed4d757f2328f890b432a4875e62dba Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 2 Nov 2013 19:43:30 +0100 Subject: [PATCH 10/45] CComponents: use correct initial values screen start position Value '0' is wrong. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/72705b19debfef2e7a1dc68c3a029de3b44aed6f Author: Thilo Graf Date: 2013-11-02 (Sat, 02 Nov 2013) --- src/gui/components/cc_base.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index 94693d13e..b6ce8448d 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -56,8 +56,8 @@ void CComponents::clearSavedScreen() void CComponents::initVarBasic() { - x = saved_screen.x = 0; - y = saved_screen.y = 0; + x = saved_screen.x = 1; + y = saved_screen.y = 1; cc_xr = x; cc_yr = y; height = saved_screen.dy = CC_HEIGHT_MIN; From 689fa0a4b0d2d8b8a8b5ae7fae8f65f18276634f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 6 Nov 2013 22:11:11 +0100 Subject: [PATCH 11/45] CComponentsButton: add constructors with loacalized caption parameter Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/989ec253608c64ab526b13bd0098b95dcb9a16c0 Author: Thilo Graf Date: 2013-11-06 (Wed, 06 Nov 2013) --- src/gui/components/cc_frm_button.h | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index f435c8e44..f1cacda17 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -108,6 +108,14 @@ class CComponentsButtonRed : public CComponentsButton { cc_item_type = CC_ITEMTYPE_BUTTON_RED; }; + CComponentsButtonRed( const int x_pos, const int y_pos, const int w, const int h, + const neutrino_locale_t& caption_locale, + bool selected = false, bool enabled = true, bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_RED, selected, enabled, has_shadow, color_frame, color_body, color_shadow) + { + cc_item_type = CC_ITEMTYPE_BUTTON_RED; + }; }; //! Sub class of CComponentsButton. @@ -125,6 +133,14 @@ class CComponentsButtonGreen : public CComponentsButton { cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; }; + CComponentsButtonGreen( const int x_pos, const int y_pos, const int w, const int h, + const neutrino_locale_t& caption_locale, + bool selected = false, bool enabled = true, bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_GREEN, selected, enabled, has_shadow, color_frame, color_body, color_shadow) + { + cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; + }; }; //! Sub class of CComponentsButton. @@ -142,6 +158,14 @@ class CComponentsButtonYellow : public CComponentsButton { cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW; }; + CComponentsButtonYellow( const int x_pos, const int y_pos, const int w, const int h, + const neutrino_locale_t& caption_locale, + bool selected = false, bool enabled = true, bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_YELLOW, selected, enabled, has_shadow, color_frame, color_body, color_shadow) + { + cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW; + }; }; //! Sub class of CComponentsButton. @@ -159,6 +183,14 @@ class CComponentsButtonBlue : public CComponentsButton { cc_item_type = CC_ITEMTYPE_BUTTON_BLUE; }; + CComponentsButtonBlue( const int x_pos, const int y_pos, const int w, const int h, + const neutrino_locale_t& caption_locale, + bool selected = false, bool enabled = true, bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_BLUE, selected, enabled, has_shadow, color_frame, color_body, color_shadow) + { + cc_item_type = CC_ITEMTYPE_BUTTON_BLUE; + }; }; #endif /*__CC_BUTTONS_H__*/ From 07454cd8911446ccecd53276cdba18f5407a68ea Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 7 Nov 2013 16:24:44 +0100 Subject: [PATCH 12/45] CComponentsExtTextForm: add member setLabelAndTextFont() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a0e00387b603739dc66cb30675c5503ab0b7d2e0 Author: Thilo Graf Date: 2013-11-07 (Thu, 07 Nov 2013) --- src/gui/components/cc_frm.h | 3 +++ src/gui/components/cc_frm_ext_text.cpp | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 210d2ffa9..1cb288cff 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -388,7 +388,10 @@ class CComponentsExtTextForm : public CComponentsForm ///assigns texts for label and text, parameter as string, parameter Font is optional for required font type, default font is dependently from defined item height void setLabelAndText(const std::string& label_text, const std::string& text, Font* font_text = NULL); + ///assigns texts for label and text, parameter as neutrino_locale_t, parameter Font is optional for required font type, default font is dependently from defined item height void setLabelAndText(const neutrino_locale_t& locale_label_text, const neutrino_locale_t& locale_text, Font* font_text = NULL); + ///assigns text Font type + void setLabelAndTextFont(Font* font); ///assigns texts for label and text, parameter as struct (locale_ext_txt_t), parameters provide the same properties like setLabelAndText() void setLabelAndTexts(const locale_ext_txt_t& texts); diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 3d8cdfe48..33c4975b3 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -187,6 +187,13 @@ void CComponentsExtTextForm::setLabelAndTexts(const locale_ext_txt_t& locale_tex setLabelAndText(g_Locale->getText(locale_texts.label_text), g_Locale->getText(locale_texts.text), locale_texts.font); } +void CComponentsExtTextForm::setLabelAndTextFont(Font* font) +{ + if (font == NULL) + return; + setLabelAndText(ccx_label_text, ccx_text, font); +} + void CComponentsExtTextForm::setTextModes(const int& label_mode, const int& text_mode) { ccx_label_align = label_mode; @@ -203,7 +210,6 @@ void CComponentsExtTextForm::setLabelAndTextColor(const fb_pixel_t label_color , void CComponentsExtTextForm::initCCTextItems() { - height = max(height, ccx_font->getHeight()); initLabel(); initText(); } From 5acfff5968ce3884e089de658e2c386c0999e251 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 7 Nov 2013 16:27:06 +0100 Subject: [PATCH 13/45] CTextBox: use member getFontTextHeight() as public Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/172383b6bb86e6d31f5c66d03b18097d26ee7314 Author: Thilo Graf Date: 2013-11-07 (Thu, 07 Nov 2013) --- src/gui/widget/textbox.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index 0922521c8..b748e9f84 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -114,7 +114,7 @@ class CTextBox void refreshText(void); void reSizeMainFrameWidth(int maxTextWidth); void reSizeMainFrameHeight(int maxTextHeight); - int getFontTextHeight(); + bool hasChanged(int* x, int* y, int* dx, int* dy); void reInitToCompareVar(int* x, int* y, int* dx, int* dy); @@ -202,7 +202,8 @@ class CTextBox inline int getLinesPerPage(void) {return m_nLinesPerPage;}; inline int getPages(void) {return(m_nNrOfPages);}; inline void movePosition(int x, int y) {m_cFrame.iX = x; m_cFrame.iY = y;}; - + int getFontTextHeight(); + void paint (void); void hide (void); }; From 1f8532235727efc0b711cfbf54e844eb1e6552d9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 8 Nov 2013 21:16:42 +0100 Subject: [PATCH 14/45] CComponents: add property to allow/disallow paint of items This causes initialization of all properties, but affects the behavior of item paint. This can be understood as a counterpart to isPainted(). Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8ae491a9943e26044bd3fe2dd89847d259c43527 Author: Thilo Graf Date: 2013-11-08 (Fri, 08 Nov 2013) --- src/gui/components/cc_base.cpp | 16 ++++++++++------ src/gui/components/cc_base.h | 7 +++++++ src/gui/components/cc_frm.cpp | 9 +++++++++ src/gui/components/cc_item_infobox.cpp | 15 ++++++++++----- src/gui/components/cc_item_picture.cpp | 2 +- src/gui/components/cc_item_progressbar.cpp | 1 + src/gui/components/cc_item_progressbar.h | 2 +- src/gui/components/cc_item_text.cpp | 2 +- src/gui/components/cc_item_tvpic.cpp | 4 +++- 9 files changed, 43 insertions(+), 15 deletions(-) diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index b6ce8448d..db8fed84f 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -77,6 +77,7 @@ void CComponents::initVarBasic() firstPaint = true; is_painted = false; paint_bg = true; + cc_allow_paint = true; frameBuffer = CFrameBuffer::getInstance(); v_fbdata.clear(); saved_screen.pixbuf = NULL; @@ -130,7 +131,7 @@ void CComponents::paintFbItems(bool do_save_bg) //paint all fb relevant basic parts (frame and body) with all specified properties, paint_bg must be true if (fbtype != CC_FBDATA_TYPE_BGSCREEN && paint_bg){ if (fbtype == CC_FBDATA_TYPE_FRAME) { - if (v_fbdata[i].frame_thickness > 0) + if (v_fbdata[i].frame_thickness > 0 && cc_allow_paint) frameBuffer->paintBoxFrame(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].frame_thickness, v_fbdata[i].color, v_fbdata[i].r, corner_type); } else if (fbtype == CC_FBDATA_TYPE_BACKGROUND) @@ -148,14 +149,17 @@ void CComponents::paintFbItems(bool do_save_bg) //calculate current shadow width depends of current corner_rad sw_cur = max(2*v_fbdata[i].r, sw); } - // shadow right - frameBuffer->paintBoxRel(x_sh, v_fbdata[i].y, sw_cur, v_fbdata[i].dy-sw_cur, v_fbdata[i].color, v_fbdata[i].r, corner_type & CORNER_TOP_RIGHT); - // shadow bottom - frameBuffer->paintBoxRel(v_fbdata[i].x, y_sh, v_fbdata[i].dx, sw_cur, v_fbdata[i].color, v_fbdata[i].r, corner_type & CORNER_BOTTOM); + if (cc_allow_paint){ + // shadow right + frameBuffer->paintBoxRel(x_sh, v_fbdata[i].y, sw_cur, v_fbdata[i].dy-sw_cur, v_fbdata[i].color, v_fbdata[i].r, corner_type & CORNER_TOP_RIGHT); + // shadow bottom + frameBuffer->paintBoxRel(v_fbdata[i].x, y_sh, v_fbdata[i].dx, sw_cur, v_fbdata[i].color, v_fbdata[i].r, corner_type & CORNER_BOTTOM); + } } } else - frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].color, v_fbdata[i].r, corner_type); + if(cc_allow_paint) + frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].color, v_fbdata[i].r, corner_type); } } diff --git a/src/gui/components/cc_base.h b/src/gui/components/cc_base.h index 32605b04d..0f69bbe40 100644 --- a/src/gui/components/cc_base.h +++ b/src/gui/components/cc_base.h @@ -94,6 +94,8 @@ class CComponents bool is_painted; ///mode: true=activate rendering of basic elements (frame, shadow and body) bool paint_bg; + ///mode: true=allows painting of item, see also allowPaint() + bool cc_allow_paint; ///initialize of basic attributes, no parameters required void initVarBasic(); @@ -205,6 +207,11 @@ class CComponents ///allows paint of elementary item parts (shadow, frame and body), similar as background, set it usually to false, if item used in a form virtual void doPaintBg(bool do_paint){paint_bg = do_paint;}; + ///allow/disalows paint of item and its contents, but initialize of other properties are not touched + ///this can be understood as a counterpart to isPainted(), but before paint + virtual void allowPaint(bool allow){cc_allow_paint = allow;}; + ///returns visibility mode + virtual bool paintAllowed(){return cc_allow_paint;}; }; class CComponentsItem : public CComponents diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 1d2420a56..27c094170 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -361,8 +361,17 @@ void CComponentsForm::paintCCItems() cc_item->setHeight(new_h); } + //get current visibility mode from item, me must hold it and restore after paint + bool item_visible = cc_item->paintAllowed(); + //set visibility mode + if (!this->cc_allow_paint) + cc_item->allowPaint(false); + //finally paint current item cc_item->paint(CC_SAVE_SCREEN_NO); + + //restore defined old visibility mode of item after paint + cc_item->allowPaint(item_visible); } } diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index 0ea76cd27..ff1b30bfb 100644 --- a/src/gui/components/cc_item_infobox.cpp +++ b/src/gui/components/cc_item_infobox.cpp @@ -97,16 +97,19 @@ void CComponentsInfoBox::paintPicture() //exit if no image definied if (pic_name == "") return; - + //init pic object and set icon paint position pic = new CComponentsPicture(x+fr_thickness+x_offset, y+fr_thickness, 0, 0, ""); //define icon pic->setPicture(pic_name); - + //fit icon into infobox pic->setHeight(height-2*fr_thickness); pic->setColorBody(col_body); + + //paint, but set visibility mode + pic->allowPaint(cc_allow_paint); pic->paint(CC_SAVE_SCREEN_NO); } @@ -119,7 +122,7 @@ void CComponentsInfoBox::paint(bool do_save_bg) //NOTE: real values are reqiured, if we paint this item within a form as embedded cc-item int x_text = (cc_parent ? cc_xr : x) + fr_thickness; int y_text = (cc_parent ? cc_yr : y) + fr_thickness; - + //set text to the left border if picture is not painted int pic_w = 0; if ((pic) && (pic->isPicPainted())) @@ -141,7 +144,9 @@ void CComponentsInfoBox::paint(bool do_save_bg) int tw = width - x_offset - pic_w - 2*fr_thickness; int th = height-2*fr_thickness; cctext->setDimensionsAll(tx, y_text, tw, th); - - cctext->paint(CC_SAVE_SCREEN_NO); + + //paint, but set visibility mode + cctext->allowPaint(cc_allow_paint); + cctext->paint(CC_SAVE_SCREEN_NO); } } diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 6ccc94de6..6ff199f1d 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -180,7 +180,7 @@ void CComponentsPicture::paintPicture() { pic_painted = false; - if (do_paint){ + if (do_paint && cc_allow_paint){ #ifdef DEBUG_CC printf(" [CComponentsPicture] %s: paint image: %s (do_paint=%d)\n", __FUNCTION__, pic_name.c_str(), do_paint); #endif diff --git a/src/gui/components/cc_item_progressbar.cpp b/src/gui/components/cc_item_progressbar.cpp index 41bfa2d62..06debd8ae 100644 --- a/src/gui/components/cc_item_progressbar.cpp +++ b/src/gui/components/cc_item_progressbar.cpp @@ -141,6 +141,7 @@ void CProgressBar::paintShapes(int &shx, int ­, int &shw, int &shh, fb_pixel_ { CComponentsShapeSquare shape(shx, shy, shw, shh, false); shape.setColorBody(col); + shape.allowPaint(cc_allow_paint); shape.paint(false); } diff --git a/src/gui/components/cc_item_progressbar.h b/src/gui/components/cc_item_progressbar.h index 90fb2a7a0..ecc074eee 100644 --- a/src/gui/components/cc_item_progressbar.h +++ b/src/gui/components/cc_item_progressbar.h @@ -92,7 +92,7 @@ class CProgressBar : public CComponentsItem ///paint version of progressbar with color and advanced display modifications void paintAdvanced(); ///painting of activ/passive bars via shape object - static void paintShapes(int &shx, int ­, int &shw, int &shh, fb_pixel_t &col); + void paintShapes(int &shx, int ­, int &shw, int &shh, fb_pixel_t &col); void initDimensions(); diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index 3a5722353..feb6b3f0e 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -248,7 +248,7 @@ void CComponentsText::paintText(bool do_save_bg) { paintInit(do_save_bg); initCCText(); - if (ct_text_sent) + if (ct_text_sent && cc_allow_paint) ct_textbox->paint(); ct_text_sent = false; } diff --git a/src/gui/components/cc_item_tvpic.cpp b/src/gui/components/cc_item_tvpic.cpp index 9dc397c48..c5aa38117 100644 --- a/src/gui/components/cc_item_tvpic.cpp +++ b/src/gui/components/cc_item_tvpic.cpp @@ -87,6 +87,9 @@ void CComponentsPIP::paint(bool do_save_bg) pig_w -= pig_w*25/100; pig_x += tmpw/2-pig_w/2; } + + if (!cc_allow_paint) + return; if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv){ videoDecoder->Pig(pig_x, pig_y, pig_w, pig_h, screen_w, screen_h); @@ -95,7 +98,6 @@ void CComponentsPIP::paint(bool do_save_bg) CComponentsPicture pic = CComponentsPicture (pig_x, pig_y, pig_w, pig_h, pic_name, CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER); pic.paint(CC_SAVE_SCREEN_NO); } - } From b9fc2667216cf4015748cdc86c807b2cc6374063 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 8 Nov 2013 22:13:57 +0100 Subject: [PATCH 15/45] CComponentsWindow: remove paint() member The derived member of ComponentsForm() should be sufficiently and should serve its purpose. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/cbeb9f3ac655788bbda40c835cb4930ad726332e Author: Thilo Graf Date: 2013-11-08 (Fri, 08 Nov 2013) --- src/gui/components/cc_frm.h | 7 ++----- src/gui/components/cc_frm_window.cpp | 8 -------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 1cb288cff..5e62deaa0 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -285,16 +285,13 @@ class CComponentsWindow : public CComponentsForm ~CComponentsWindow(); - ///paint window - void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); - ///add item to body object, also usable is addCCItem() to add items to the windo object void addWindowItem(CComponentsItem* cc_Item); ///allow/disallow paint a footer, default true, see also ccw_show_footer, showHeader() - void showFooter(bool show = true){ccw_show_footer = show;}; + void showFooter(bool show = true){ccw_show_footer = show; initCCWItems();}; ///allow/disallow paint a header, default true, see also ccw_show_header, showFooter() - void showHeader(bool show = true){ccw_show_header = show;}; + void showHeader(bool show = true){ccw_show_header = show; initCCWItems();}; ///set caption in header with string, see also getHeaderObject() void setWindowCaption(const std::string& text, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK){ccw_caption = text; ccw_align_mode = align_mode;}; diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 6b66f5827..eef2f81ee 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -254,11 +254,3 @@ void CComponentsWindow::initCCWItems() addCCItem(ccw_footer); } -void CComponentsWindow::paint(bool do_save_bg) -{ - //prepare items before paint - initCCWItems(); - - //paint form contents - paintForm(do_save_bg); -} From 0fe6ad13d9d3886a549ac5df331640277c4c8935 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 9 Nov 2013 15:31:36 +0100 Subject: [PATCH 16/45] CComponentsButton: add members to get caption properties Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/812168416f82be657503eeb3659d5eb4dc31b81c Author: Thilo Graf Date: 2013-11-09 (Sat, 09 Nov 2013) --- src/gui/components/cc_frm_button.cpp | 7 +++++-- src/gui/components/cc_frm_button.h | 10 +++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index a126ab040..7846ef20d 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -68,7 +68,8 @@ CComponentsButton::CComponentsButton( const int x_pos, const int y_pos, const i { initVarButton(); cc_btn_icon = icon_name; - cc_btn_capt = g_Locale->getText(caption_locale);; + cc_btn_capt_locale = caption_locale; + cc_btn_capt = g_Locale->getText(cc_btn_capt_locale); cc_btn_capt_col = COL_MENUCONTENT_TEXT; x = x_pos; @@ -95,6 +96,7 @@ void CComponentsButton::initVarButton() cc_btn_font = NULL; cc_btn_icon = ""; cc_btn_capt = ""; + cc_btn_capt_locale = NONEXISTANT_LOCALE; } void CComponentsButton::initIcon() @@ -194,7 +196,8 @@ void CComponentsButton::setCaption(const std::string& text) void CComponentsButton::setCaption(const neutrino_locale_t locale_text) { - cc_btn_capt = g_Locale->getText(locale_text); + cc_btn_capt_locale = locale_text; + cc_btn_capt = g_Locale->getText(cc_btn_capt_locale); } void CComponentsButton::initCCBtnItems() diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index f1cacda17..976433e81 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -47,8 +47,11 @@ class CComponentsButton : public CComponentsForm ///initialize all required attributes and objects void initVarButton(); - ///property: button text + ///property: button text as string, see also setCaption() and getCaptionString() std::string cc_btn_capt; + ///property: button text as locale, see also setCaption() and getCaptionLocale() + neutrino_locale_t cc_btn_capt_locale; + ///property: icon name, only icons supported, to find in gui/widget/icons.h std::string cc_btn_icon; @@ -86,6 +89,11 @@ class CComponentsButton : public CComponentsForm ///set caption: parameter as locale virtual void setCaption(const neutrino_locale_t locale_text); + ///get caption, type as std::string + virtual std::string getCaptionString(){return cc_btn_capt;}; + ///get loacalized caption id, type = neutrino_locale_t + virtual neutrino_locale_t getCaptionLocale(){return cc_btn_capt_locale;}; + ///reinitialize items virtual void Refresh(){initCCBtnItems();}; From 4d5a5fef27416eb89d5e47be1c165101602002da Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 10 Nov 2013 14:48:19 +0100 Subject: [PATCH 17/45] CComponents: add log warning if position = 0 Value 0 for embedded items should be unproblematic, buy single items should have minimum value = 1. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e5b0673259426b5c32b6f4ea9830798541fd59d8 Author: Thilo Graf Date: 2013-11-10 (Sun, 10 Nov 2013) --- src/gui/components/cc_base.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index db8fed84f..38a015017 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -107,8 +107,13 @@ void CComponents::paintFbItems(bool do_save_bg) for(size_t i=0; i< v_fbdata.size() ;i++){ // Don't paint if dx or dy are 0 - if ((v_fbdata[i].dx == 0) || (v_fbdata[i].dy == 0)) + if ((v_fbdata[i].dx == 0) || (v_fbdata[i].dy == 0)){ + printf(" [CComponents] WARNING:\n [%s - %d], dx = %d\n dy = %d\n", __FUNCTION__, __LINE__, v_fbdata[i].dx, v_fbdata[i].dy); continue; + } + if ((v_fbdata[i].x == 0) || (v_fbdata[i].y == 0)){ + printf(" [CComponents] WARNING:\n [%s - %d], x = %d\n y = %d\n", __FUNCTION__, __LINE__, v_fbdata[i].x, v_fbdata[i].y); + } int fbtype = v_fbdata[i].fbdata_type; #ifdef DEBUG_CC From 2a5f6dd9c584ed607393247e8f1df60a06c5efbb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 10 Nov 2013 14:53:26 +0100 Subject: [PATCH 18/45] CComponentsExtTextForm: fix assign of width with percent value Assigning of value before width was set, had no effect Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/74d25a6089ef179c41895aa536731b6a9a90df1d Author: Thilo Graf Date: 2013-11-10 (Sun, 10 Nov 2013) --- src/gui/components/cc_frm.h | 4 +++- src/gui/components/cc_frm_ext_text.cpp | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 5e62deaa0..e3cb101d6 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -341,6 +341,8 @@ class CComponentsExtTextForm : public CComponentsForm int ccx_text_width; ///property: font type of both items (label and text), see also setLabelAndText() Font* ccx_font; + ///property: percentage val of label width related to full width, causes fit of text automatically into the available remaining size of item, see also setLabelWidthPercent() + uint8_t ccx_percent_label_w; ///object: label object CComponentsLabel *ccx_label_obj; @@ -356,7 +358,7 @@ class CComponentsExtTextForm : public CComponentsForm protected: ///initialize basic variables - void initVarExtTextForm(const int x_pos = 0, const int y_pos = 0, const int w = 300, const int h = 27, + void initVarExtTextForm(const int x_pos = 1, const int y_pos = 1, const int w = 300, const int h = 27, bool has_shadow = CC_SHADOW_OFF, fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, fb_pixel_t text_color = COL_MENUCONTENT_TEXT, diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 33c4975b3..7120040d5 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -81,8 +81,16 @@ void CComponentsExtTextForm::initVarExtTextForm(const int x_pos, const int y_pos cc_item_type = CC_ITEMTYPE_FRM_EXT_TEXT; x = x_pos; y = y_pos; + width = w; + //init ccx_label_width and ccx_text_width + //default ccx_label_width = 30% of form width + ccx_percent_label_w = DEF_LABEL_WIDTH_PERCENT; + ccx_label_width = ccx_percent_label_w * width/100; + ccx_text_width = width-ccx_label_width; + height = h; + ccx_label_text = ""; ccx_text = ""; shadow = has_shadow; @@ -98,9 +106,7 @@ void CComponentsExtTextForm::initVarExtTextForm(const int x_pos, const int y_pos ccx_font = *(CNeutrinoFonts::getInstance()->getDynFont(dx, dy)); ccx_label_align = ccx_text_align = CTextBox::NO_AUTO_LINEBREAK; - //init ccx_label_width and ccx_text_width - //default ccx_label_width = 30% of form width - setLabelWidthPercent(DEF_LABEL_WIDTH_PERCENT ); + } void CComponentsExtTextForm::initLabel() @@ -125,6 +131,7 @@ void CComponentsExtTextForm::initLabel() //set properties if (ccx_label_obj){ + ccx_label_width = (ccx_percent_label_w * width/100); ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font); ccx_label_obj->setTextColor(ccx_label_color); ccx_label_obj->setDimensionsAll(fr_thickness, 0, ccx_label_width-fr_thickness, height-2*fr_thickness); @@ -154,6 +161,7 @@ void CComponentsExtTextForm::initText() //set properties if (ccx_text_obj){ + ccx_text_width = width-ccx_label_obj->getWidth(); ccx_text_obj->setText(ccx_text, ccx_text_align, ccx_font); ccx_text_obj->setTextColor(ccx_text_color); ccx_text_obj->setDimensionsAll(CC_APPEND, 0, ccx_text_width-2*fr_thickness, height-2*fr_thickness); @@ -216,8 +224,7 @@ void CComponentsExtTextForm::initCCTextItems() void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val) { - ccx_label_width = percent_val * width/100; - ccx_text_width = width-ccx_label_width; + ccx_percent_label_w = (int)percent_val; initCCTextItems(); } From 346feb80d43df0b4fd48d9f00cc6da152b0111af Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 10 Nov 2013 21:45:02 +0100 Subject: [PATCH 19/45] CComponentsExtTextForm: remove check for empty strings This check causes possible segfault and check is already in ccx_text_obj. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/05ce02327882aba9e959e1f62b50a52a901f785f Author: Thilo Graf Date: 2013-11-10 (Sun, 10 Nov 2013) --- src/gui/components/cc_frm_ext_text.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 7120040d5..149786e28 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -111,14 +111,6 @@ void CComponentsExtTextForm::initVarExtTextForm(const int x_pos, const int y_pos void CComponentsExtTextForm::initLabel() { - //init label object only if text available - if (ccx_label_text.empty()) { - if (ccx_label_obj) - delete ccx_label_obj; - ccx_label_obj = NULL; - return; - } - //initialize label object if (ccx_label_obj == NULL){ ccx_label_obj = new CComponentsLabel(); @@ -141,14 +133,6 @@ void CComponentsExtTextForm::initLabel() void CComponentsExtTextForm::initText() { - //init text object only if text available - if (ccx_text.empty()) { - if (ccx_text_obj) - delete ccx_text_obj; - ccx_text_obj = NULL; - return; - } - //initialize text object if (ccx_text_obj == NULL){ ccx_text_obj = new CComponentsLabel(); From 92dd88d98df3d910abd06013325e13c77c61a652 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 17 Oct 2013 11:01:01 +0200 Subject: [PATCH 20/45] Add display of build info - Display compiler version, compiler flags, build PC, kernel version - configure.ac part ported from filezilla project Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4cf48572019db8fc3975fb6cea3bb87ce3495988 Author: Michael Liebmann Date: 2013-10-17 (Thu, 17 Oct 2013) --- configure.ac | 15 +++ data/locale/deutsch.locale | 7 + data/locale/english.locale | 7 + src/gui/Makefile.am | 1 + src/gui/buildinfo.cpp | 266 +++++++++++++++++++++++++++++++++++++ src/gui/buildinfo.h | 70 ++++++++++ src/gui/info_menue.cpp | 6 + src/system/locals.h | 7 + src/system/locals_intern.h | 7 + 9 files changed, 386 insertions(+) create mode 100644 src/gui/buildinfo.cpp create mode 100644 src/gui/buildinfo.h diff --git a/configure.ac b/configure.ac index 6d617f9ef..5e6f948b4 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,21 @@ AC_PROG_CXX AC_DISABLE_STATIC AM_PROG_LIBTOOL +# Add build information to config.h +# --------------------------------- + +# Add host to config.h +AC_DEFINE_UNQUOTED(USED_BUILD, ["$build"], [Build system under which the program was compiled on.]) + +# Add used CXXFLAGS to config.h +AC_DEFINE_UNQUOTED(USED_CXXFLAGS, ["$CXXFLAGS"], [Define to the used CXXFLAGS to compile this package.]) + +# Get compiler (version) +AH_TEMPLATE(USED_COMPILER, [Define to name and version of used compiler]) +if COMPILER=`$CC --version | head -n 1`; then + AC_DEFINE_UNQUOTED(USED_COMPILER, ["$COMPILER"]) +fi + AC_ARG_WITH([tremor], [AS_HELP_STRING([--with-tremor], [use libvorbisidec instead of libogg/libvorbis])], [TREMOR="$withval"], diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index ef4a47c37..3dd828133 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -200,6 +200,12 @@ bouquetname.hdtv HD Kanäle bouquetname.new Neue Kanäle bouquetname.other Unbekannter Provider bouquetname.removed Gelöschte Kanäle +buildinfo.compiled_on Build PC +buildinfo.compiled_with Compiler Version +buildinfo.compiler_flags Compiler Flags +buildinfo.creator Ersteller +buildinfo.kernel Kernel Version +buildinfo.menu Build Informationen cablesetup.provider Kabelanbieter channellist.additional Zusatzinformationen channellist.additional_off aus @@ -788,6 +794,7 @@ menu.hint_back Zurück zum vorherigen Menü.\nDie Taste 'Menü' schließt alle M menu.hint_backlight Konfigurieren Sie die Hintergrundbeleuchtung der Buttons menu.hint_backup Sichern von Konfigurationen und Kanallisten menu.hint_bedit Bearbeiten ihrer Favoriten und der Bouquets +menu.hint_buildinfo Informationen über Compiler, Compilerflags, Kernel menu.hint_cache_txt Startet das Zwischenspeichern des Teletextes nach einem Kanalwechsel menu.hint_cec_mode CEC-Modus menu.hint_cec_standby CEC-Standby diff --git a/data/locale/english.locale b/data/locale/english.locale index ef9a06cc0..7407cd916 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -200,6 +200,12 @@ bouquetname.hdtv HD channels bouquetname.new New channels bouquetname.other Unknown provider bouquetname.removed Removed channels +buildinfo.compiled_on Build PC +buildinfo.compiled_with Compiler version +buildinfo.compiler_flags Compiler flags +buildinfo.creator Creator +buildinfo.kernel Kernel version +buildinfo.menu Build information cablesetup.provider cable provider channellist.additional Additional informations channellist.additional_off off @@ -788,6 +794,7 @@ menu.hint_back Return to previous menu\nPress menu key to close all menus menu.hint_backlight Configure buttons backlight menu.hint_backup Backup configs and channels to selected dir menu.hint_bedit Edit favorites and bouquets +menu.hint_buildinfo Information about compilers, compiler flags, kernel menu.hint_cache_txt Start teletext caching after channel switch menu.hint_cec_mode CEC mode menu.hint_cec_standby CEC standby diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index ec2ff3afd..e26d7aab0 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -52,6 +52,7 @@ libneutrino_gui_a_SOURCES = \ audioplayer_setup.cpp\ bookmarkmanager.cpp \ bouquetlist.cpp \ + buildinfo.cpp \ channellist.cpp \ cec_setup.cpp \ dboxinfo.cpp \ diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp new file mode 100644 index 000000000..0ce04f054 --- /dev/null +++ b/src/gui/buildinfo.cpp @@ -0,0 +1,266 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Copyright (C) 2013, M. Liebmann 'micha-bbg' + Copyright (C) 2013, Thilo Graf 'dbt' + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include + +CBuildInfo::CBuildInfo(): config ('\t') +{ + Init(); +} + +//init all var members +void CBuildInfo::Init(void) +{ + cc_win = NULL; + cc_info = NULL; + item_offset = 10; + bodyHeight = 0; + v_info.clear(); + config.loadConfig("/.version"); +} + +CBuildInfo::~CBuildInfo() +{ + hide(); + delete cc_win; +} + +void CBuildInfo::Clean() +{ + if (cc_win){ + delete cc_win; + cc_win = NULL; + cc_info = NULL; + } +} + +int CBuildInfo::exec(CMenuTarget* parent, const std::string &) +{ + int res = menu_return::RETURN_REPAINT; + if (parent) + parent->hide(); + + //clean up before, because we could have a current instance with already initialized contents + Clean(); + + //init window object, add cc-items and paint all + ShowWindow(); + + neutrino_msg_t msg; + while (1) + { + neutrino_msg_data_t data; + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd_MS(100); + g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); + + if(msg == CRCInput::RC_setup) { + res = menu_return::RETURN_EXIT_ALL; + break; + } + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + g_RCInput->postMsg (msg, 0); + res = menu_return::RETURN_EXIT_ALL; + break; + } + else if (msg <= CRCInput::RC_MaxRC){ + break; + } + + if ( msg > CRCInput::RC_MaxRC && msg != CRCInput::RC_timeout){ + CNeutrinoApp::getInstance()->handleMsg( msg, data ); + } + } + + hide(); + + return res; +} + +void CBuildInfo::ShowWindow() +{ + if (cc_win == NULL){ + cc_win = new CComponentsWindow(LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO); + cc_win->setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); + CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); + int w = (frameBuffer->getScreenWidth()*2)/3; + int h = frameBuffer->getScreenHeight(); + cc_win->setDimensionsAll(getScreenStartX(w), getScreenStartY(h), w, h); + + CComponentsForm* bo = cc_win->getBodyObject(); + if (bo) bodyHeight = bo->getHeight(); + + } + + InitInfos(); + + cc_win->paint(); +} + +void CBuildInfo::InitInfos() +{ + v_info.clear(); + +#ifdef USED_COMPILER + build_info_t compiler = {LOCALE_BUILDINFO_COMPILED_WITH, USED_COMPILER}; + v_info.push_back(compiler); +#endif + +#ifdef USED_CXXFLAGS + std::string cxxflags = USED_CXXFLAGS; + cxxflags = trim(cxxflags); + // Remove double spaces + size_t pos = cxxflags.find(" "); + while (pos != std::string::npos) { + cxxflags.erase(pos, 1); + pos = cxxflags.find(" ", pos); + } + build_info_t flags = {LOCALE_BUILDINFO_COMPILER_FLAGS, cxxflags}; + v_info.push_back(flags); +#endif + +#ifdef USED_BUILD + build_info_t build = {LOCALE_BUILDINFO_COMPILED_ON, USED_BUILD}; + v_info.push_back(build); +#endif + + build_info_t creator = {LOCALE_BUILDINFO_CREATOR, config.getString("creator", "n/a")}; + v_info.push_back(creator); + + FILE *fp = fopen("/proc/version", "r"); + if (fp) { + char zeile[1024]; + memset(zeile, 0, sizeof(zeile)); + fgets(zeile, sizeof(zeile)-1, fp); + fclose(fp); + std::string zeile_s = zeile; + zeile_s = trim(zeile_s); + build_info_t kernel = {LOCALE_BUILDINFO_KERNEL, zeile_s}; + v_info.push_back(kernel); + } + +// ########################################################### + + int dx = 0, dy = 27; + Font * item_font = *(CNeutrinoFonts::getInstance()->getDynFont(dx, dy)); + + //initialize container for infos + if (cc_info == NULL) + cc_info = new CComponentsForm(); + cc_win->addWindowItem(cc_info); + cc_info->setPos(item_offset, item_offset); + cc_info->setWidth((cc_win->getWidth())-2*item_offset); + + //calculate max width of label and info_text + int w_label = 0, w_text = 0, w = 0; + for (size_t i = 0; i < v_info.size(); i++) { + w = item_font->getRenderWidth(g_Locale->getText(v_info[i].caption), true); + w_label = std::max(w_label, w); + + w = item_font->getRenderWidth(v_info[i].info_text.c_str(), true); + w_text = std::max(w_text, w); + } + + int x_label = 0, y_text = 0; + int x_text = x_label + w_label + item_offset; + int item_height = item_font->getHeight(); + int item_spacer = item_height / 2; + + //recalc w_text to avoid an overlap with pip TODO: calculate within cc_info itself + w_text = std::min(w_text, cc_win->getWidth() - x_text - 2*item_offset); + //create label and text items + int h_tmp = 0; + size_t i = 0; + + for (i = 0; i < v_info.size(); i++) { + CComponentsLabel *cc_label = new CComponentsLabel(); + cc_label->setDimensionsAll(x_label, y_text, w_label, item_height); + cc_label->setText(v_info[i].caption, CTextBox::NO_AUTO_LINEBREAK, item_font); + + //add label object to window body + cc_info->addCCItem(cc_label); + + CComponentsText *cc_text = new CComponentsText(); + cc_text->setDimensionsAll(x_text, y_text, w_text, item_height); + int textMode = CTextBox::AUTO_HIGH | CTextBox::TOP | CTextBox::AUTO_LINEBREAK_NO_BREAKCHARS; + cc_text->setText(v_info[i].info_text, textMode, item_font); + + //The rest of body height, less 1 line for each additional entry + int rest = bodyHeight-h_tmp-((v_info.size()-(i+1))*(item_height+item_spacer)); + int lines = cc_text->getTextLinesAutoHeight(rest, w_text, textMode); + cc_text->setHeight(lines*item_height); + y_text += lines*item_height + item_spacer; + + //add text object to window body + cc_info->addCCItem(cc_text); + + //
;-) + if (v_info[i].caption == LOCALE_BUILDINFO_CREATOR) { + int w1 = (cc_win->getWidth()*85)/100; + int x1 = cc_win->getRealXPos() + ((cc_win->getWidth() - w1)/2); + CComponentsShapeSquare *cc_shape; + cc_shape = new CComponentsShapeSquare(x1, y_text, w1, 2, CC_SHADOW_OFF, COL_MENUHEAD_PLUS_0, COL_MENUHEAD_PLUS_0); + y_text += item_spacer; + h_tmp += item_spacer; + cc_info->addCCItem(cc_shape); + } + + //set height for info form + h_tmp += lines*item_height + item_spacer; + } + + //assign height of info form + cc_info->setHeight(h_tmp); + + int ho_h = 0, fo_h = 0; + CComponentsHeader* ho = cc_win->getHeaderObject(); + if (ho) ho_h = ho->getHeight(); + CComponentsFooter* fo = cc_win->getFooterObject(); + if (fo) fo_h = fo->getHeight(); + h_tmp += ho_h + fo_h + 12; + cc_win->setHeight(h_tmp); + cc_win->setYPos(getScreenStartY(h_tmp)); +} + +void CBuildInfo::hide() +{ + printf("[CBuildInfo] [%s - %d] hide...\n", __FUNCTION__, __LINE__); + if (cc_win){ + cc_win->hide(); + Clean(); + } +} diff --git a/src/gui/buildinfo.h b/src/gui/buildinfo.h new file mode 100644 index 000000000..7145fb063 --- /dev/null +++ b/src/gui/buildinfo.h @@ -0,0 +1,70 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Copyright (C) 2013, M. Liebmann 'micha-bbg' + Copyright (C) 2013, Thilo Graf 'dbt' + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#ifndef __buildinfo__ +#define __buildinfo__ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +typedef struct build_info_t +{ + neutrino_locale_t caption; + std::string info_text; + +} build_info_struct_t; + +class CBuildInfo : public CMenuTarget +{ + private: + int item_offset; + int bodyHeight; + std::vector v_info; + + void Clean(); + void Init(); + void InitInfos(); + void ShowWindow(); + + CComponentsWindow *cc_win; + CComponentsForm *cc_info; + CConfigFile config; + + public: + + CBuildInfo(); + ~CBuildInfo(); + + void hide(); + int exec(CMenuTarget* parent, const std::string & actionKey); +}; + +#endif // __buildinfo__ diff --git a/src/gui/info_menue.cpp b/src/gui/info_menue.cpp index 6df35961f..215158fc4 100644 --- a/src/gui/info_menue.cpp +++ b/src/gui/info_menue.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include "gui/cam_menu.h" @@ -72,6 +73,7 @@ int CInfoMenu::showMenu() CImageInfo imageinfo; CDBoxInfoWidget boxinfo; CStreamInfo2 streaminfo; + CBuildInfo buildinfo; info->addIntroItems(); CMenuForwarder * mf = new CMenuForwarder(LOCALE_SERVICEMENU_IMAGEINFO, true, NULL, &imageinfo, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED ); @@ -86,6 +88,10 @@ int CInfoMenu::showMenu() mf->setHint(NEUTRINO_ICON_HINT_STREAMINFO, LOCALE_MENU_HINT_STREAMINFO); info->addItem(mf); + mf = new CMenuForwarder(LOCALE_BUILDINFO_MENU, true, NULL, &buildinfo, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE ); + mf->setHint(NEUTRINO_ICON_HINT_IMAGEINFO, LOCALE_MENU_HINT_BUILDINFO); + info->addItem(mf); + if (g_settings.easymenu) { mf = new CMenuForwarder(LOCALE_CI_SETTINGS, true, NULL, g_CamHandler, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); mf->setHint(NEUTRINO_ICON_HINT_CI, LOCALE_MENU_HINT_CI); diff --git a/src/system/locals.h b/src/system/locals.h index f2e681f7d..50de8652c 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -227,6 +227,12 @@ typedef enum LOCALE_BOUQUETNAME_NEW, LOCALE_BOUQUETNAME_OTHER, LOCALE_BOUQUETNAME_REMOVED, + LOCALE_BUILDINFO_COMPILED_ON, + LOCALE_BUILDINFO_COMPILED_WITH, + LOCALE_BUILDINFO_COMPILER_FLAGS, + LOCALE_BUILDINFO_CREATOR, + LOCALE_BUILDINFO_KERNEL, + LOCALE_BUILDINFO_MENU, LOCALE_CABLESETUP_PROVIDER, LOCALE_CHANNELLIST_ADDITIONAL, LOCALE_CHANNELLIST_ADDITIONAL_OFF, @@ -815,6 +821,7 @@ typedef enum LOCALE_MENU_HINT_BACKLIGHT, LOCALE_MENU_HINT_BACKUP, LOCALE_MENU_HINT_BEDIT, + LOCALE_MENU_HINT_BUILDINFO, LOCALE_MENU_HINT_CACHE_TXT, LOCALE_MENU_HINT_CEC_MODE, LOCALE_MENU_HINT_CEC_STANDBY, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index ee641767d..6b92fa3c9 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -227,6 +227,12 @@ const char * locale_real_names[] = "bouquetname.new", "bouquetname.other", "bouquetname.removed", + "buildinfo.compiled_on", + "buildinfo.compiled_with", + "buildinfo.compiler_flags", + "buildinfo.creator", + "buildinfo.kernel", + "buildinfo.menu", "cablesetup.provider", "channellist.additional", "channellist.additional_off", @@ -815,6 +821,7 @@ const char * locale_real_names[] = "menu.hint_backlight", "menu.hint_backup", "menu.hint_bedit", + "menu.hint_buildinfo", "menu.hint_cache_txt", "menu.hint_cec_mode", "menu.hint_cec_standby", From 9bf2127c3200de02f4257562cb54dbc94a018794 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 10 Nov 2013 23:58:38 +0100 Subject: [PATCH 21/45] CBuildInfo: rework buildinfo class for use as CComponentsWindow also possible: get partial informations also as strings for usage in other classes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6955df5c5efc11b1b3ebfd06c4dea77a9955ec5f Author: Thilo Graf Date: 2013-11-10 (Sun, 10 Nov 2013) --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- data/locale/nederlands.locale | 6 + src/gui/buildinfo.cpp | 234 +++++++++++++--------------------- src/gui/buildinfo.h | 41 +++--- 5 files changed, 123 insertions(+), 162 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 3dd828133..c52396fd0 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -200,7 +200,7 @@ bouquetname.hdtv HD Kanäle bouquetname.new Neue Kanäle bouquetname.other Unbekannter Provider bouquetname.removed Gelöschte Kanäle -buildinfo.compiled_on Build PC +buildinfo.compiled_on Build Host buildinfo.compiled_with Compiler Version buildinfo.compiler_flags Compiler Flags buildinfo.creator Ersteller diff --git a/data/locale/english.locale b/data/locale/english.locale index 7407cd916..e1acacaca 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -200,7 +200,7 @@ bouquetname.hdtv HD channels bouquetname.new New channels bouquetname.other Unknown provider bouquetname.removed Removed channels -buildinfo.compiled_on Build PC +buildinfo.compiled_on Build Host buildinfo.compiled_with Compiler version buildinfo.compiler_flags Compiler flags buildinfo.creator Creator diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index d397e5019..651d1a179 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -203,6 +203,12 @@ bouquetname.hdtv HD zenders bouquetname.new Nieuwe Zenders bouquetname.other Onbekende provider bouquetname.removed Verwijderde zenders +buildinfo.compiled_on Build Host +buildinfo.compiled_with Compiler Version +buildinfo.compiler_flags Compiler Flags +buildinfo.creator Creator +buildinfo.kernel Kernel Version +buildinfo.menu Build Informationen cablesetup.provider kabel provider channellist.additional Extra informatie channellist.additional_off Uit diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 0ce04f054..02523b66f 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -23,63 +23,60 @@ Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H -#include -#endif #include #include -//#include + #include -#include #include -#include -#include #include +#include #include -CBuildInfo::CBuildInfo(): config ('\t') +using namespace std; + +CBuildInfo::CBuildInfo() : CComponentsWindow(1, 1, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) { - Init(); + initVarBuildInfo(); } //init all var members -void CBuildInfo::Init(void) +void CBuildInfo::initVarBuildInfo() { - cc_win = NULL; - cc_info = NULL; - item_offset = 10; - bodyHeight = 0; - v_info.clear(); - config.loadConfig("/.version"); + x = frameBuffer->getScreenWidth(true)/2 - width/2; + y = frameBuffer->getScreenHeight(true)/2 -height/2; + + append_v_offset = 1; + font = NULL; + setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); + InitInfoItems(); + + + shadow = true; } CBuildInfo::~CBuildInfo() { - hide(); - delete cc_win; + cleanCCForm(); } -void CBuildInfo::Clean() -{ - if (cc_win){ - delete cc_win; - cc_win = NULL; - cc_info = NULL; - } -} -int CBuildInfo::exec(CMenuTarget* parent, const std::string &) +int CBuildInfo::exec(CMenuTarget* parent, const string & /*actionKey*/) { int res = menu_return::RETURN_REPAINT; + if (parent) parent->hide(); + + //exit if no informations available + if (!HasData()){ + return res; + } - //clean up before, because we could have a current instance with already initialized contents - Clean(); + //paint window + if (!is_painted) + paint(); - //init window object, add cc-items and paint all - ShowWindow(); neutrino_msg_t msg; while (1) @@ -104,163 +101,112 @@ int CBuildInfo::exec(CMenuTarget* parent, const std::string &) if ( msg > CRCInput::RC_MaxRC && msg != CRCInput::RC_timeout){ CNeutrinoApp::getInstance()->handleMsg( msg, data ); } + + } + //hide window hide(); return res; } -void CBuildInfo::ShowWindow() +void CBuildInfo::setFontType(Font* font_text) { - if (cc_win == NULL){ - cc_win = new CComponentsWindow(LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO); - cc_win->setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); - CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); - int w = (frameBuffer->getScreenWidth()*2)/3; - int h = frameBuffer->getScreenHeight(); - cc_win->setDimensionsAll(getScreenStartX(w), getScreenStartY(h), w, h); - - CComponentsForm* bo = cc_win->getBodyObject(); - if (bo) bodyHeight = bo->getHeight(); - - } - - InitInfos(); - - cc_win->paint(); + if (font_text == NULL) + return; + font = font_text; + InitInfoItems(); } -void CBuildInfo::InitInfos() +bool CBuildInfo::HasData() { v_info.clear(); #ifdef USED_COMPILER - build_info_t compiler = {LOCALE_BUILDINFO_COMPILED_WITH, USED_COMPILER}; + build_info_t compiler = {BI_TYPE_ID_USED_COMPILER, LOCALE_BUILDINFO_COMPILED_WITH, USED_COMPILER}; v_info.push_back(compiler); #endif #ifdef USED_CXXFLAGS - std::string cxxflags = USED_CXXFLAGS; + string cxxflags = USED_CXXFLAGS; cxxflags = trim(cxxflags); // Remove double spaces size_t pos = cxxflags.find(" "); - while (pos != std::string::npos) { + while (pos != string::npos) { cxxflags.erase(pos, 1); pos = cxxflags.find(" ", pos); } - build_info_t flags = {LOCALE_BUILDINFO_COMPILER_FLAGS, cxxflags}; + build_info_t flags = {BI_TYPE_ID_USED_CXXFLAGS, LOCALE_BUILDINFO_COMPILER_FLAGS, cxxflags}; v_info.push_back(flags); #endif #ifdef USED_BUILD - build_info_t build = {LOCALE_BUILDINFO_COMPILED_ON, USED_BUILD}; + build_info_t build = {BI_TYPE_ID_USED_BUILD , LOCALE_BUILDINFO_COMPILED_ON, USED_BUILD}; v_info.push_back(build); #endif - build_info_t creator = {LOCALE_BUILDINFO_CREATOR, config.getString("creator", "n/a")}; + CComponentsText utext; + build_info_t kernel = {BI_TYPE_ID_USED_KERNEL, LOCALE_BUILDINFO_KERNEL, utext.getTextFromFile("/proc/version")}; + v_info.push_back(kernel); + +#if 0 + CConfigFile data ('\t'); + data.loadConfig("/.version"); + build_info_t creator = {BI_TYPE_ID_CREATOR, LOCALE_BUILDINFO_CREATOR, data.getString("creator", "n/a")}; v_info.push_back(creator); +#endif - FILE *fp = fopen("/proc/version", "r"); - if (fp) { - char zeile[1024]; - memset(zeile, 0, sizeof(zeile)); - fgets(zeile, sizeof(zeile)-1, fp); - fclose(fp); - std::string zeile_s = zeile; - zeile_s = trim(zeile_s); - build_info_t kernel = {LOCALE_BUILDINFO_KERNEL, zeile_s}; - v_info.push_back(kernel); + if (v_info.empty()){ + DisplayInfoMessage("No Informations available. Please report!"); + return false; } -// ########################################################### + return true; +} - int dx = 0, dy = 27; - Font * item_font = *(CNeutrinoFonts::getInstance()->getDynFont(dx, dy)); +void CBuildInfo::InitInfoItems() +{ + //get and checkup required informations + if (!HasData()) + return; - //initialize container for infos - if (cc_info == NULL) - cc_info = new CComponentsForm(); - cc_win->addWindowItem(cc_info); - cc_info->setPos(item_offset, item_offset); - cc_info->setWidth((cc_win->getWidth())-2*item_offset); + //ensure a clean body + ccw_body->clearCCItems(); - //calculate max width of label and info_text - int w_label = 0, w_text = 0, w = 0; - for (size_t i = 0; i < v_info.size(); i++) { - w = item_font->getRenderWidth(g_Locale->getText(v_info[i].caption), true); - w_label = std::max(w_label, w); + //define size and position + int x_info = 10; + int h_info = ccw_body->getHeight()/v_info.size(); //default height + int w_info = width-2*x_info; - w = item_font->getRenderWidth(v_info[i].info_text.c_str(), true); - w_text = std::max(w_text, w); + //init info texts + for(size_t i=0; igetText(v_info[i].caption), v_info[i].info_text); + info->setLabelAndTextFont(font); + info->setTextModes(CTextBox::TOP , CTextBox::AUTO_HIGH | CTextBox::TOP | CTextBox::AUTO_LINEBREAK_NO_BREAKCHARS); + info->doPaintBg(false); + ccw_body->addCCItem(info); + } +} + +// This allows to retrieve information about build infos. +// Use parameter 'type_info' to get specific information. +build_info_t CBuildInfo::getInfo(const info_type_id_t& type_id) +{ + for(size_t i=0; igetHeight(); - int item_spacer = item_height / 2; + build_info_t res; + res.type_id = type_id; + res.caption = NONEXISTANT_LOCALE; + res.info_text = "Info not available!"; - //recalc w_text to avoid an overlap with pip TODO: calculate within cc_info itself - w_text = std::min(w_text, cc_win->getWidth() - x_text - 2*item_offset); - //create label and text items - int h_tmp = 0; - size_t i = 0; - - for (i = 0; i < v_info.size(); i++) { - CComponentsLabel *cc_label = new CComponentsLabel(); - cc_label->setDimensionsAll(x_label, y_text, w_label, item_height); - cc_label->setText(v_info[i].caption, CTextBox::NO_AUTO_LINEBREAK, item_font); - - //add label object to window body - cc_info->addCCItem(cc_label); - - CComponentsText *cc_text = new CComponentsText(); - cc_text->setDimensionsAll(x_text, y_text, w_text, item_height); - int textMode = CTextBox::AUTO_HIGH | CTextBox::TOP | CTextBox::AUTO_LINEBREAK_NO_BREAKCHARS; - cc_text->setText(v_info[i].info_text, textMode, item_font); - - //The rest of body height, less 1 line for each additional entry - int rest = bodyHeight-h_tmp-((v_info.size()-(i+1))*(item_height+item_spacer)); - int lines = cc_text->getTextLinesAutoHeight(rest, w_text, textMode); - cc_text->setHeight(lines*item_height); - y_text += lines*item_height + item_spacer; - - //add text object to window body - cc_info->addCCItem(cc_text); - - //
;-) - if (v_info[i].caption == LOCALE_BUILDINFO_CREATOR) { - int w1 = (cc_win->getWidth()*85)/100; - int x1 = cc_win->getRealXPos() + ((cc_win->getWidth() - w1)/2); - CComponentsShapeSquare *cc_shape; - cc_shape = new CComponentsShapeSquare(x1, y_text, w1, 2, CC_SHADOW_OFF, COL_MENUHEAD_PLUS_0, COL_MENUHEAD_PLUS_0); - y_text += item_spacer; - h_tmp += item_spacer; - cc_info->addCCItem(cc_shape); - } - - //set height for info form - h_tmp += lines*item_height + item_spacer; - } - - //assign height of info form - cc_info->setHeight(h_tmp); - - int ho_h = 0, fo_h = 0; - CComponentsHeader* ho = cc_win->getHeaderObject(); - if (ho) ho_h = ho->getHeight(); - CComponentsFooter* fo = cc_win->getFooterObject(); - if (fo) fo_h = fo->getHeight(); - h_tmp += ho_h + fo_h + 12; - cc_win->setHeight(h_tmp); - cc_win->setYPos(getScreenStartY(h_tmp)); + return res; } void CBuildInfo::hide() { - printf("[CBuildInfo] [%s - %d] hide...\n", __FUNCTION__, __LINE__); - if (cc_win){ - cc_win->hide(); - Clean(); - } + CComponentsWindow::hide(); } diff --git a/src/gui/buildinfo.h b/src/gui/buildinfo.h index 7145fb063..6ea7a946d 100644 --- a/src/gui/buildinfo.h +++ b/src/gui/buildinfo.h @@ -32,37 +32,46 @@ #endif #include -#include -#include +#include + +typedef int info_type_id_t; typedef struct build_info_t { + info_type_id_t type_id; neutrino_locale_t caption; std::string info_text; } build_info_struct_t; -class CBuildInfo : public CMenuTarget +class CBuildInfo : public CMenuTarget, public CComponentsWindow { private: - int item_offset; - int bodyHeight; std::vector v_info; - - void Clean(); - void Init(); - void InitInfos(); - void ShowWindow(); - - CComponentsWindow *cc_win; - CComponentsForm *cc_info; - CConfigFile config; - + Font* font; + void initVarBuildInfo(); + void InitInfoItems(); + + bool HasData(); public: + + //type_id's for infos + enum + { + BI_TYPE_ID_USED_COMPILER, + BI_TYPE_ID_USED_CXXFLAGS, + BI_TYPE_ID_USED_BUILD, + BI_TYPE_ID_USED_KERNEL, + BI_TYPE_ID_CREATOR, + + BI_TYPE_IDS, + }; CBuildInfo(); ~CBuildInfo(); - + ///assigns text Font type + void setFontType(Font* font_text); + build_info_t getInfo(const info_type_id_t& type_id); void hide(); int exec(CMenuTarget* parent, const std::string & actionKey); }; From e2a842bfb80b7da2abec66ce961241653e67df19 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 11 Nov 2013 00:13:21 +0100 Subject: [PATCH 22/45] CImageInfo: rework some parts of imageinfo -use CComponentsExtTextForm: this combines labels and text to one item -add build informations: this includes some functions of CBuildInfo class to show its informations, user can now use the red button and toggle between license and build infos Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2bd27147705f5e0be7ce56b691bd56eafa699497 Author: Thilo Graf Date: 2013-11-11 (Mon, 11 Nov 2013) --- data/license/deutsch.license | 2 + data/license/english.license | 2 + data/license/slovak.license | 2 + src/gui/imageinfo.cpp | 179 +++++++++++++++++++++-------------- src/gui/imageinfo.h | 8 ++ 5 files changed, 123 insertions(+), 70 deletions(-) diff --git a/data/license/deutsch.license b/data/license/deutsch.license index 3f183d2b5..01d9bfca1 100644 --- a/data/license/deutsch.license +++ b/data/license/deutsch.license @@ -1,3 +1,5 @@ +GPL v2 + Dieses Programm ist freie Software. Sie können es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation veröffentlicht, weitergeben und/oder modifizieren, gemäß Version 2 der Lizenz. Die Veröffentlichung dieses Programms erfolgt in der Hoffnung, daß es Ihnen von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar ohne die implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT FÜR EINEN BESTIMMTEN ZWECK. Details finden Sie in der GNU General Public License. diff --git a/data/license/english.license b/data/license/english.license index 2a52a4285..939d929a6 100644 --- a/data/license/english.license +++ b/data/license/english.license @@ -1,3 +1,5 @@ +GPL v2 + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. diff --git a/data/license/slovak.license b/data/license/slovak.license index fb94fcc56..ec0d44a44 100644 --- a/data/license/slovak.license +++ b/data/license/slovak.license @@ -1,3 +1,5 @@ +GPL v2 + Tento program je slobodný softvér: môžete ho šíriť a upravovať podľa ustanovení Všeobecnej verejnej licencie GNU (GNU General Public License), vydávanej nadáciou Free Software Foundation, a to buď podľa 2.verzie tejto Licencie, alebo (podľa vášho uváženia) ktorejkoľvek neskoršej verzie. Tento program je šírený v nádeji, že bude užitočný, avšak BEZ AKEJKOĽVEK ZÁRUKY. Neposkytujú sa ani odvodené záruky OBCHODOVATEĽNOSTI alebo VHODNOSTI PRE URČITÝ ÚČEL. Ďalšie podrobnosti hľadajte vo Všeobecnej verejnej licencii GNU. diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 7254860ca..edcb265e4 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -39,7 +39,7 @@ #include #include #include "version.h" - +#include #define LICENSEDIR DATADIR "/neutrino/license/" using namespace std; @@ -58,7 +58,13 @@ void CImageInfo::Init(void) cc_info = NULL; cc_tv = NULL; cc_lic = NULL; + cc_sub_caption = NULL; + b_info = NULL; + btn_red = NULL; item_offset = 10; + item_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; + item_height = item_font->getHeight(); + license_txt = ""; v_info.clear(); config.loadConfig("/.version"); @@ -81,6 +87,9 @@ void CImageInfo::Clean() cc_info = NULL; cc_tv = NULL; cc_lic = NULL; + cc_sub_caption = NULL; + b_info = NULL; + btn_red = NULL; } } @@ -107,6 +116,39 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) res = menu_return::RETURN_EXIT_ALL; break; } + else if (msg == CRCInput::RC_red){ + // init temporarly vars + neutrino_locale_t info_cap , new_btn_cap; + info_cap = new_btn_cap = NONEXISTANT_LOCALE; + string info_txt = ""; + neutrino_locale_t btn_cap = btn_red->getCaptionLocale(); + + //toggle caption and info contents + if (btn_cap == LOCALE_BUILDINFO_MENU){ + info_cap = LOCALE_BUILDINFO_MENU; + for (uint i=0; igetText(b_info->getInfo(i).caption); + info_txt += "\n"; + info_txt += b_info->getInfo(i).info_text + "\n\n"; + } + new_btn_cap = LOCALE_IMAGEINFO_LICENSE; + } + if (btn_cap == LOCALE_IMAGEINFO_LICENSE){ + info_cap = LOCALE_IMAGEINFO_LICENSE; + info_txt = getLicenseText(); + new_btn_cap = LOCALE_BUILDINFO_MENU; + } + + //assign new caption and info contents + cc_sub_caption->setText(info_cap, CTextBox::AUTO_WIDTH, item_font); + InitInfoText(info_txt); + btn_red->setCaption(new_btn_cap); + + //paint items + cc_sub_caption->paint(false); + cc_lic->paint(false); + btn_red->paint(false); + } else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; @@ -125,6 +167,7 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) if ( msg > CRCInput::RC_MaxRC && msg != CRCInput::RC_timeout){ CNeutrinoApp::getInstance()->handleMsg( msg, data ); } + } hide(); @@ -135,9 +178,14 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) //contains all actions to init and add the window object and items void CImageInfo::ShowWindow() { + CComponentsFooter *footer = NULL; if (cc_win == NULL){ cc_win = new CComponentsWindow(LOCALE_IMAGEINFO_HEAD, NEUTRINO_ICON_INFO); cc_win->setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); + footer = cc_win->getFooterObject(); + footer->setColorBody(COL_INFOBAR_SHADOW_PLUS_1); + btn_red = new CComponentsButtonRed(10, CC_CENTERED, 250, footer->getHeight(), LOCALE_BUILDINFO_MENU, false , true, false, footer->getColorBody(), footer->getColorBody()); + footer->addCCItem(btn_red); } //prepare minitv @@ -146,7 +194,10 @@ void CImageInfo::ShowWindow() //prepare infos InitInfos(); - //prepare license text + //prepare build infos + InitBuildInfos(); + + //prepare info text InitInfoText(getLicenseText()); //paint window @@ -171,11 +222,19 @@ void CImageInfo::InitMinitv() cc_tv->setXPos(cc_tv_x); //add minitv to container - cc_win->addWindowItem(cc_tv); + if (!cc_tv->isAdded()) + cc_win->addWindowItem(cc_tv); } //prepare distribution infos -void CImageInfo::InitInfos() +void CImageInfo::InitBuildInfos() +{ + if (b_info == NULL) + b_info = new CBuildInfo(); +} + +//collect required data from environment +void CImageInfo::InitInfoData() { v_info.clear(); @@ -224,66 +283,52 @@ void CImageInfo::InitInfos() v_info.push_back(doc); image_info_t forum = {LOCALE_IMAGEINFO_FORUM, config.getString("forum", "http://forum.tuxbox.org")}; v_info.push_back(forum); - image_info_t license = {LOCALE_IMAGEINFO_LICENSE, "GPL v2"}; - v_info.push_back(license); +} - Font * item_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; + +//prepare distribution infos +void CImageInfo::InitInfos() +{ + InitInfoData(); //initialize container for infos if (cc_info == NULL) cc_info = new CComponentsForm(); - cc_win->addWindowItem(cc_info); + if (!cc_info->isAdded()) + cc_win->addWindowItem(cc_info); + cc_info->setPos(item_offset, item_offset); - cc_info->setWidth((cc_win->getWidth()/3*2)-2*item_offset); - - - //calculate max width of label and info_text - int w_label = 0, w_text = 0, w = 0; - for (size_t i = 0; i < v_info.size(); i++) { - w = item_font->getRenderWidth(g_Locale->getText(v_info[i].caption), true); - w_label = std::max(w_label, w); - - w = item_font->getRenderWidth(v_info[i].info_text.c_str(), true); - w_text = std::max(w_text, w); - } - - int x_label = 0, y_text = 0; - int x_text = x_label + w_label + item_offset; - int item_height = item_font->getHeight(); - - //recalc w_text to avoid an overlap with pip TODO: calculate within cc_info itself - w_text = std::min(w_text, cc_win->getWidth() - x_text - /*cc_tv->getWidth() - */2*item_offset); - + + //set width, use size between left border and minitv + cc_info->setWidth(cc_win->getWidth() - cc_tv->getWidth() - 2*item_offset); + + //calculate initial height for info form + cc_info->setHeight(v_info.size()*item_height); + //create label and text items - int h_tmp = 0; - size_t i = 0; - for (i = 0; i < v_info.size(); i++) { - CComponentsLabel *cc_label = new CComponentsLabel(); - cc_label->setDimensionsAll(x_label, y_text, w_label, item_height); - cc_label->setText(v_info[i].caption, CTextBox::NO_AUTO_LINEBREAK, item_font); + for (size_t i=0; igetWidth(), item_height, g_Locale->getText(v_info[i].caption), v_info[i].info_text); + item->setLabelAndTextFont(item_font); + item->setLabelWidthPercent(20); - //add label object to window body - cc_info->addCCItem(cc_label); + if ((i == 0) && (item->getYPos() == CC_APPEND)) + item->setYPos(1); - CComponentsText *cc_text = new CComponentsText(); - cc_text->setDimensionsAll(x_text, y_text, w_text, item_height); - cc_text->setText(v_info[i].info_text.c_str(), CTextBox::NO_AUTO_LINEBREAK, item_font); - y_text += item_height/*CC_APPEND*/; + //add ext-text object to window body + if (!item->isAdded()) + cc_info->addCCItem(item); - //add text object to window body - cc_info->addCCItem(cc_text); - - // add an offset before homepage and license - if (v_info[i].caption == LOCALE_IMAGEINFO_CREATOR|| v_info[i].caption == LOCALE_IMAGEINFO_FORUM){ - h_tmp += item_offset; - y_text += item_offset; + //add an offset before homepage and license and at the end + if (v_info[i].caption == LOCALE_IMAGEINFO_CREATOR || v_info[i].caption == LOCALE_IMAGEINFO_FORUM){ + CComponentsShapeSquare *spacer = new CComponentsShapeSquare(1, CC_APPEND, 1, item_offset); + //spacer ist not visible! + spacer->allowPaint(false); + cc_info->addCCItem(spacer); + //increase height of cc_info object with offset + int tmp_h = cc_info->getHeight(); + cc_info->setHeight(tmp_h + item_offset); } - - //set height for info form - h_tmp += item_height; } - //assign height of info form - cc_info->setHeight(h_tmp); } //get license @@ -307,25 +352,21 @@ void CImageInfo::InitInfoText(const std::string& text) int h_body = winbody->getHeight(); int w_body = winbody->getWidth(); - int y_lic = item_offset + cc_info->getHeight() + item_offset; - int h_lic = h_body - y_lic - item_offset; + int h_lic = h_body - cc_info->getHeight() - 2*item_offset; if (cc_lic == NULL) - cc_lic = new CComponentsInfoBox(item_offset, cc_info->getYPos()+cc_info->getHeight()+item_offset, w_body-2*item_offset, h_lic); - cc_lic->setSpaceOffset(0); - cc_lic->setText(text, CTextBox::AUTO_WIDTH | CTextBox::SCROLL, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); + cc_lic = new CComponentsInfoBox(CC_CENTERED, CC_APPEND, w_body-2*item_offset, h_lic); + cc_lic->setSpaceOffset(1); + cc_lic->setText(text, CTextBox::TOP | CTextBox::AUTO_WIDTH | CTextBox::SCROLL, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); -#if 0 - //calc y pos of license box to avoid an overlap with pip - int h_info = cc_info->getHeight(); - int y_lic = std::max(h_info, cc_tv->getHeight() + 2*item_offset); - CComponentsForm *winbody = cc_win->getBodyObject(); - int h_lic = 0; - if (winbody) - h_lic = winbody->getHeight(); - cc_lic = new CComponentsInfoBox(item_offset, /*y_lic*/CC_APPEND, cc_win->getWidth()-2*item_offset, h_lic - h_info -item_offset); - cc_lic->setTextFromFile(file, CTextBox::AUTO_WIDTH | CTextBox::SCROLL, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); -#endif + //add a caption for info contents + Font * caption_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; + int caption_height = caption_font->getHeight(); + if (cc_sub_caption == NULL) + cc_sub_caption = new CComponentsLabel(cc_info->getXPos(), CC_APPEND, cc_info->getWidth(), caption_height, + g_Locale->getText(LOCALE_IMAGEINFO_LICENSE), CTextBox::AUTO_WIDTH, item_font); + if (!cc_sub_caption->isAdded()) + cc_win->addWindowItem(cc_sub_caption); //add text to container if (!cc_lic->isAdded()) @@ -349,8 +390,6 @@ void CImageInfo::ScrollLic(bool scrollDown) } } - - void CImageInfo::hide() { printf("[CImageInfo] [%s - %d] hide...\n", __FUNCTION__, __LINE__); diff --git a/src/gui/imageinfo.h b/src/gui/imageinfo.h index 2a5b671da..81c588bc2 100644 --- a/src/gui/imageinfo.h +++ b/src/gui/imageinfo.h @@ -33,6 +33,7 @@ #include #include +#include #include typedef struct image_info_t @@ -47,13 +48,17 @@ class CImageInfo : public CMenuTarget private: int item_offset; //distance between items and to boarder std::string license_txt; + Font* item_font; + int item_height; std::vector v_info; void Clean(); void Init(); + void InitInfoData(); void InitMinitv(); void InitInfos(); + void InitBuildInfos(); void InitInfoText(const std::string& text); std::string getLicenseText(); void ShowWindow(); @@ -63,7 +68,10 @@ class CImageInfo : public CMenuTarget CComponentsForm *cc_info; CComponentsPIP *cc_tv; CComponentsInfoBox *cc_lic; + CBuildInfo *b_info; CConfigFile config; + CComponentsButtonRed *btn_red; + CComponentsLabel *cc_sub_caption; public: From b6092046851f40f10a3d5bda01972637c63a1248 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 11 Nov 2013 00:18:22 +0100 Subject: [PATCH 23/45] CTestMenu: add buildinfo as menu entry Buildinfo also exists in infomenu, but is outcommented, so it is prepared just for testings. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ac6f547d0f939d937b042a138c9d5b75a1c43482 Author: Thilo Graf Date: 2013-11-11 (Mon, 11 Nov 2013) --- src/gui/info_menue.cpp | 11 ++++++++--- src/gui/test_menu.cpp | 7 ++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/gui/info_menue.cpp b/src/gui/info_menue.cpp index 215158fc4..e2add1b43 100644 --- a/src/gui/info_menue.cpp +++ b/src/gui/info_menue.cpp @@ -38,7 +38,10 @@ #include #include #include + +#if 0 #include +#endif #include #include "gui/cam_menu.h" @@ -73,7 +76,7 @@ int CInfoMenu::showMenu() CImageInfo imageinfo; CDBoxInfoWidget boxinfo; CStreamInfo2 streaminfo; - CBuildInfo buildinfo; + info->addIntroItems(); CMenuForwarder * mf = new CMenuForwarder(LOCALE_SERVICEMENU_IMAGEINFO, true, NULL, &imageinfo, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED ); @@ -87,17 +90,19 @@ int CInfoMenu::showMenu() mf = new CMenuForwarder(LOCALE_STREAMINFO_HEAD, !CNeutrinoApp::getInstance()->channelList->isEmpty(), NULL, &streaminfo, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); mf->setHint(NEUTRINO_ICON_HINT_STREAMINFO, LOCALE_MENU_HINT_STREAMINFO); info->addItem(mf); - + +#if 0 + CBuildInfo buildinfo; mf = new CMenuForwarder(LOCALE_BUILDINFO_MENU, true, NULL, &buildinfo, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE ); mf->setHint(NEUTRINO_ICON_HINT_IMAGEINFO, LOCALE_MENU_HINT_BUILDINFO); info->addItem(mf); +#endif if (g_settings.easymenu) { mf = new CMenuForwarder(LOCALE_CI_SETTINGS, true, NULL, g_CamHandler, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); mf->setHint(NEUTRINO_ICON_HINT_CI, LOCALE_MENU_HINT_CI); info->addItem(mf); } - int res = info->exec(NULL, ""); delete info; return res; diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 9ffd75917..d2380fdd3 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -54,7 +54,7 @@ #include #include #include - +#include extern int cs_test_card(int unit, char * str); @@ -675,6 +675,11 @@ int CTestMenu::showTestMenu() CMenuWidget * w_cc = new CMenuWidget("OSD-Components Demo", NEUTRINO_ICON_INFO, width, MN_WIDGET_ID_TESTMENU_COMPONENTS); w_test.addItem(new CMenuForwarderNonLocalized(w_cc->getName().c_str(), true, NULL, w_cc)); showCCTests(w_cc); + + //buildinfo + CMenuForwarder *f_bi = new CMenuForwarder(LOCALE_BUILDINFO_MENU, true, NULL, new CBuildInfo()); + f_bi->setHint(NEUTRINO_ICON_HINT_IMAGEINFO, LOCALE_MENU_HINT_BUILDINFO); + w_test.addItem(f_bi); //exit return w_test.exec(NULL, "");; From c2b5f7248d372aae5db3034a77c0440064f24ced Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 11 Nov 2013 08:53:33 +0100 Subject: [PATCH 24/45] CImageInfo: fix calculation of info text height Height of sub caption was not considered. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f3da71097656b7705e45d7880c17e0b335d46ffb Author: Thilo Graf Date: 2013-11-11 (Mon, 11 Nov 2013) --- src/gui/imageinfo.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index edcb265e4..573bfc929 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -352,13 +352,6 @@ void CImageInfo::InitInfoText(const std::string& text) int h_body = winbody->getHeight(); int w_body = winbody->getWidth(); - int h_lic = h_body - cc_info->getHeight() - 2*item_offset; - - if (cc_lic == NULL) - cc_lic = new CComponentsInfoBox(CC_CENTERED, CC_APPEND, w_body-2*item_offset, h_lic); - cc_lic->setSpaceOffset(1); - cc_lic->setText(text, CTextBox::TOP | CTextBox::AUTO_WIDTH | CTextBox::SCROLL, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); - //add a caption for info contents Font * caption_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; int caption_height = caption_font->getHeight(); @@ -368,6 +361,14 @@ void CImageInfo::InitInfoText(const std::string& text) if (!cc_sub_caption->isAdded()) cc_win->addWindowItem(cc_sub_caption); + //add info text box + int h_txt = h_body - item_offset - cc_info->getHeight() - cc_sub_caption->getHeight() - item_offset; + + if (cc_lic == NULL) + cc_lic = new CComponentsInfoBox(CC_CENTERED, CC_APPEND, w_body-2*item_offset, h_txt); + cc_lic->setSpaceOffset(1); + cc_lic->setText(text, CTextBox::TOP | CTextBox::AUTO_WIDTH | CTextBox::SCROLL, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); + //add text to container if (!cc_lic->isAdded()) cc_win->addWindowItem(cc_lic); From eac95733f653b898dfd0a620abdbf5ae0086e6b0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 11 Nov 2013 09:02:23 +0100 Subject: [PATCH 25/45] locales: remove colon from string Entry is used as caption, not as descriptive paragraph. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0d5004546945bfd388c6c0976ac349d8afc8b3d4 Author: Thilo Graf Date: 2013-11-11 (Mon, 11 Nov 2013) --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- data/locale/nederlands.locale | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index c52396fd0..7a7545314 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -628,7 +628,7 @@ imageinfo.head Image-Informationen imageinfo.homepage Homepage: imageinfo.image Image: imageinfo.kernel Kernel: -imageinfo.license Lizenz: +imageinfo.license Lizenz imageinfo.vcs Git: imageinfo.version Version: inetradio.name Internetradio diff --git a/data/locale/english.locale b/data/locale/english.locale index e1acacaca..a6b05c784 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -628,7 +628,7 @@ imageinfo.head Image info: imageinfo.homepage Home page: imageinfo.image Image: imageinfo.kernel Kernel: -imageinfo.license License: +imageinfo.license License imageinfo.vcs Git: imageinfo.version Version: inetradio.name Internetradio diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 651d1a179..5f4d0e229 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -606,7 +606,7 @@ imageinfo.forum Forum: imageinfo.head Image info: imageinfo.homepage Website: imageinfo.image Image: -imageinfo.license Licentie: +imageinfo.license Licentie imageinfo.version Versie: inetradio.name Internetradio infoviewer.epgnotload EPG is niet geladen.... From 917528fd3b487bf4b40a70209406a1dc728650a1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 11 Nov 2013 09:53:52 +0100 Subject: [PATCH 26/45] CBuildInfo: remevo unused id Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/74245afd0dff910ef74f01ba177cfef624d9e140 Author: Thilo Graf Date: 2013-11-11 (Mon, 11 Nov 2013) --- src/gui/buildinfo.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/buildinfo.h b/src/gui/buildinfo.h index 6ea7a946d..4a091506c 100644 --- a/src/gui/buildinfo.h +++ b/src/gui/buildinfo.h @@ -62,8 +62,10 @@ class CBuildInfo : public CMenuTarget, public CComponentsWindow BI_TYPE_ID_USED_CXXFLAGS, BI_TYPE_ID_USED_BUILD, BI_TYPE_ID_USED_KERNEL, +#if 0 BI_TYPE_ID_CREATOR, - +#endif + BI_TYPE_IDS, }; From d46cfee72d7a4f22924dfb8feebbd28651d1695f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 11 Nov 2013 14:04:59 +0400 Subject: [PATCH 27/45] driver/record.cpp: save added pids from pmt update; add safe-check for max pids recorded Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/545f1dee6adcb5d990ad644cc60fab62d9527e12 Author: [CST] Focus Date: 2013-11-11 (Mon, 11 Nov 2013) --- src/driver/record.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index d9541c3bf..c10d2e924 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -175,8 +175,11 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO_EAC3, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); }else psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); + + if (numpids >= REC_MAX_APIDS) + break; } - if ((StreamVTxtPid) && (allpids.PIDs.vtxtpid != 0)){ + if ((StreamVTxtPid) && (allpids.PIDs.vtxtpid != 0) && (numpids < REC_MAX_APIDS)){ apids[numpids++] = allpids.PIDs.vtxtpid; psi.addPid(allpids.PIDs.vtxtpid, EN_TYPE_TELTEX, 0, channel->getTeletextLang()); } @@ -186,6 +189,8 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) if (s->thisSubType == CZapitAbsSub::DVB) { if(i>9)//max sub pids break; + if (numpids >= REC_MAX_APIDS) + break; CZapitDVBSub* sd = reinterpret_cast(s); apids[numpids++] = sd->pId; @@ -196,9 +201,10 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) } psi.genpsi(fd); - - if ((StreamPmtPid) && (allpids.PIDs.pmtpid != 0)) +#if 0 + if ((StreamPmtPid) && (allpids.PIDs.pmtpid != 0) && (numpids < REC_MAX_APIDS)) apids[numpids++] = allpids.PIDs.pmtpid; +#endif if(record == NULL) record = new cRecord(channel->getRecordDemux() /*RECORD_DEMUX*/); @@ -317,6 +323,9 @@ bool CRecordInstance::Update() if(!found) { update = true; printf("%s: apid %x not found in recording pids\n", __FUNCTION__, it->apid); + if (numpids < REC_MAX_APIDS) + apids[numpids++] = it->apid; + record->AddPid(it->apid); for(unsigned int i = 0; i < allpids.APIDs.size(); i++) { if(allpids.APIDs[i].pid == it->apid) { From 25123ff234897d15ae359654fe770ab7f1d2f2b4 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 11 Nov 2013 14:06:51 +0400 Subject: [PATCH 28/45] driver/scanepg.cpp, neutrino.cpp: fix for standby epg scan Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3a120da68d913594cf9a4dcf6f48bad0bf7ea20c Author: [CST] Focus Date: 2013-11-11 (Mon, 11 Nov 2013) --- src/driver/scanepg.cpp | 1 + src/neutrino.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/driver/scanepg.cpp b/src/driver/scanepg.cpp index 40c10b720..f8aefe9d8 100644 --- a/src/driver/scanepg.cpp +++ b/src/driver/scanepg.cpp @@ -208,6 +208,7 @@ void CEpgScan::EnterStandby() { if (standby) { CZapit::getInstance()->SetCurrentChannelID(live_channel_id); + CZapit::getInstance()->EnablePlayback(true); g_Zapit->setStandby(true); g_Sectionsd->setPauseScanning(true); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index fc0a86546..559ea61fa 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3283,7 +3283,8 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) if(!g_settings.epg_scan && !fromDeepStandby && !CRecordManager::getInstance()->RecordingStatus() && !stream_status) { g_Zapit->setStandby(true); } else { - g_Zapit->stopPlayBack(); + //g_Zapit->stopPlayBack(); + g_Zapit->lockPlayBack(); } videoDecoder->Standby(true); @@ -3359,6 +3360,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); CVFD::getInstance()->setBacklight(g_settings.backlight_tv); + CZapit::getInstance()->EnablePlayback(true); g_Zapit->setStandby(false); /* the old code did: if(was_record) g_Zapit->startPlayBack() From 5b0e065fcb5323ae13ae63447a0ce0372f505bb3 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 11 Nov 2013 12:42:48 +0100 Subject: [PATCH 29/45] CStreamInfo2 initialize dmx Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f81f93b19033ebaf03aaefae5a41ef3cc249b38b Author: Jacek Jendrzej Date: 2013-11-11 (Mon, 11 Nov 2013) --- src/gui/streaminfo2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index fe2df548d..c487d274e 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -781,7 +781,7 @@ long delta_time_ms (struct timeval *tv, struct timeval *last_tv) return timeval_to_ms (tv) - timeval_to_ms (last_tv); } -static cDemux * dmx; +static cDemux * dmx = NULL; int CStreamInfo2::ts_setup () { From 13746c031053ac1edc816ec0327bab20729afa89 Mon Sep 17 00:00:00 2001 From: martii Date: Thu, 15 Aug 2013 20:33:03 +0200 Subject: [PATCH 30/45] implement yt search history Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4a0fdba710d3787b11ea3b36d84f2f793c123678 Author: martii Date: 2013-08-15 (Thu, 15 Aug 2013) --- data/locale/deutsch.locale | 4 +- data/locale/english.locale | 2 + src/gui/moviebrowser.cpp | 90 +++++++++++++++++++++++++++++++++++++- src/gui/moviebrowser.h | 4 ++ src/system/helpers.h | 10 ++++- src/system/locals.h | 2 + src/system/locals_intern.h | 2 + 7 files changed, 110 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 7a7545314..74700bf24 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1417,7 +1417,9 @@ moviebrowser.update_if_dest_empty_only Übernehmen nur wenn Ziel leer moviebrowser.use_dir Verzeichnis verwenden moviebrowser.use_movie_dir Wiedergabeverzeichnis verwenden moviebrowser.use_rec_dir Aufnahmeverzeichnis verwenden -moviebrowser.yt_concurrent_connections Gleichzeitige Verbindungen +moviebrowser.yt_concurrent_connections Gleichzeitige Verbindungen +moviebrowser.yt_history Frühere Suchen +moviebrowser.yt_max_history Max. Anzahl früherer Suchen moviebrowser.yt_error Fehler beim laden des Youtube Feed moviebrowser.yt_max_results Max. Anzahl der zu holenden Feeds moviebrowser.yt_most_discussed Am meisten diskutiert diff --git a/data/locale/english.locale b/data/locale/english.locale index a6b05c784..349246af0 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1419,6 +1419,8 @@ moviebrowser.use_movie_dir Use movie directory moviebrowser.use_rec_dir Use record directory moviebrowser.yt_concurrent_connections Concurrent connections moviebrowser.yt_error Failed to load youtube feed +moviebrowser.yt_history Search history +moviebrowser.yt_max_history Max search history size moviebrowser.yt_max_results Max results to fetch moviebrowser.yt_most_discussed Most discussed moviebrowser.yt_most_popular Most popular diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index ea6d891f8..43bf819a2 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -778,6 +778,17 @@ bool CMovieBrowser::loadSettings(MB_SETTINGS* settings) settings->ytregion = configfile.getString("mb_ytregion", "default"); settings->ytsearch = configfile.getString("mb_ytsearch", ""); settings->ytvid = configfile.getString("mb_ytvid", ""); + settings->ytsearch_history_max = configfile.getInt32("mb_ytsearch_history_max", 10); + settings->ytsearch_history_size = configfile.getInt32("mb_ytsearch_history_size", 0); + if (settings->ytsearch_history_size > settings->ytsearch_history_max) + settings->ytsearch_history_size = settings->ytsearch_history_max; + settings->ytsearch_history.clear(); + for(int i = 0; i < settings->ytsearch_history_size; i++) { + std::string s = configfile.getString("mb_ytsearch_history_" + to_string(i)); + if (s != "") + settings->ytsearch_history.push_back(configfile.getString("mb_ytsearch_history_" + to_string(i), "")); + } + settings->ytsearch_history_size = settings->ytsearch_history.size(); return (result); } @@ -835,6 +846,15 @@ bool CMovieBrowser::saveSettings(MB_SETTINGS* settings) configfile.setString("mb_ytsearch", settings->ytsearch); configfile.setString("mb_ytvid", settings->ytvid); + settings->ytsearch_history_size = settings->ytsearch_history.size(); + if (settings->ytsearch_history_size > settings->ytsearch_history_max) + settings->ytsearch_history_size = settings->ytsearch_history_max; + configfile.setInt32("mb_ytsearch_history_max", settings->ytsearch_history_max); + configfile.setInt32("mb_ytsearch_history_size", settings->ytsearch_history_size); + std::list:: iterator it = settings->ytsearch_history.begin(); + for(int i = 0; i < settings->ytsearch_history_size; i++, ++it) + configfile.setString("mb_ytsearch_history_" + to_string(i), *it); + if (configfile.getModifiedFlag()) configfile.saveConfig(MOVIEBROWSER_SETTINGS_FILE); return (result); @@ -3639,6 +3659,55 @@ neutrino_locale_t CMovieBrowser::getFeedLocale(void) return ret; } +class CYTHistory : public CMenuTarget +{ + private: + int width; + int selected; + std::string *search; + MB_SETTINGS *settings; + public: + CYTHistory(MB_SETTINGS &_settings, std::string &_search); + int exec(CMenuTarget* parent, const std::string & actionKey); +}; + +CYTHistory::CYTHistory(MB_SETTINGS &_settings, std::string &_search) +{ + width = w_max (40, 10); + selected = -1; + settings = &_settings; + search = &_search; +} + +int CYTHistory::exec(CMenuTarget* parent, const std::string &actionKey) +{ + if (actionKey == "") { + if (parent) + parent->hide(); + CMenuWidget* m = new CMenuWidget(LOCALE_MOVIEBROWSER_YT_HISTORY, NEUTRINO_ICON_MOVIEPLAYER, width); + m->addKey(CRCInput::RC_spkr, this, "clear"); + m->setSelected(selected); + m->addItem(GenericMenuSeparator); + m->addItem(GenericMenuBack); + m->addItem(GenericMenuSeparatorLine); + std::list::iterator it = settings->ytsearch_history.begin(); + for (int i = 0; i < settings->ytsearch_history_size; i++, ++it) + m->addItem(new CMenuForwarderNonLocalized((*it).c_str(), true, NULL, this, (*it).c_str(), CRCInput::convertDigitToKey(i + 1))); + m->exec(NULL, ""); + m->hide(); + delete m; + return menu_return::RETURN_REPAINT; + } + if (actionKey == "clear") { + settings->ytsearch_history.clear(); + settings->ytsearch_history_size = 0; + return menu_return::RETURN_EXIT; + } + *search = actionKey; + g_RCInput->postMsg((neutrino_msg_t) CRCInput::RC_blue, 0); + return menu_return::RETURN_EXIT; +} + bool CMovieBrowser::showYTMenu() { m_pcWindow->paintBackground(); @@ -3663,18 +3732,23 @@ bool CMovieBrowser::showYTMenu() sprintf(cnt, "%d", cYTFeedParser::NEXT); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_NEXT_RESULTS, ytparser.HaveNext(), NULL, selector, cnt, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); sprintf(cnt, "%d", cYTFeedParser::PREV); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_PREV_RESULTS, ytparser.HavePrev(), NULL, selector, cnt, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_PREV_RESULTS, ytparser.HavePrev(), NULL, selector, cnt, CRCInput::RC_nokey, "")); mainMenu.addItem(GenericMenuSeparatorLine); std::string search = m_settings.ytsearch; CStringInputSMS stringInput(LOCALE_MOVIEBROWSER_YT_SEARCH, &search, 20, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789 -_/()<>=+.,:!?\\'"); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_SEARCH, true, search, &stringInput, NULL, CRCInput::RC_nokey, "")); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_SEARCH, true, search, &stringInput, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); sprintf(cnt, "%d", cYTFeedParser::SEARCH); mainMenu.addItem(new CMenuForwarder(LOCALE_EVENTFINDER_START_SEARCH, true, NULL, selector, cnt, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE)); + CYTHistory ytHistory(m_settings, search); + if (m_settings.ytsearch_history_size > 0) + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_HISTORY, true, NULL, &ytHistory, "", CRCInput::RC_0)); + mainMenu.addItem(GenericMenuSeparatorLine); mainMenu.addItem(new CMenuOptionNumberChooser(LOCALE_MOVIEBROWSER_YT_MAX_RESULTS, &m_settings.ytresults, true, 10, 50, NULL)); + mainMenu.addItem(new CMenuOptionNumberChooser(LOCALE_MOVIEBROWSER_YT_MAX_HISTORY, &m_settings.ytsearch_history_max, true, 10, 50, NULL)); char rstr[20]; sprintf(rstr, "%s", m_settings.ytregion.c_str()); @@ -3730,6 +3804,18 @@ bool CMovieBrowser::showYTMenu() reload = true; m_settings.ytsearch = search; m_settings.ytmode = newmode; + m_settings.ytsearch_history.push_front(search); + std::list::iterator it = m_settings.ytsearch_history.begin(); + it++; + while (it != m_settings.ytsearch_history.end()) { + if (*it == search) + it = m_settings.ytsearch_history.erase(it); + else + ++it; + } + m_settings.ytsearch_history_size = m_settings.ytsearch_history.size(); + if (m_settings.ytsearch_history_size > m_settings.ytsearch_history_max) + m_settings.ytsearch_history_size = m_settings.ytsearch_history_max; } } else if (m_settings.ytmode != newmode) { diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 188eb95b5..2486bf0e5 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -73,6 +73,7 @@ #include #include +#include #include #include #include @@ -231,9 +232,12 @@ typedef struct int ytresults; int ytquality; int ytconcconn; + int ytsearch_history_size; + int ytsearch_history_max; std::string ytregion; std::string ytvid; std::string ytsearch; + std::list ytsearch_history; } MB_SETTINGS; // Priorities for Developmemt: P1: critical feature, P2: important feature, P3: for next release, P4: looks nice, lets see diff --git a/src/system/helpers.h b/src/system/helpers.h index 8bf4babfb..d9d4b6108 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -24,7 +24,8 @@ #include #include - +#include + int my_system(const char * cmd); int my_system(int argc, const char *arg, ...); /* argc is number of arguments including command */ @@ -64,4 +65,11 @@ class CFileHelpers }; +template std::string to_string(C i) +{ + std::stringstream s; + s << i; + return s.str(); +} + #endif diff --git a/src/system/locals.h b/src/system/locals.h index 50de8652c..1fd8f82cb 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1446,6 +1446,8 @@ typedef enum LOCALE_MOVIEBROWSER_USE_REC_DIR, LOCALE_MOVIEBROWSER_YT_CONCURRENT_CONNECTIONS, LOCALE_MOVIEBROWSER_YT_ERROR, + LOCALE_MOVIEBROWSER_YT_HISTORY, + LOCALE_MOVIEBROWSER_YT_MAX_HISTORY, LOCALE_MOVIEBROWSER_YT_MAX_RESULTS, LOCALE_MOVIEBROWSER_YT_MOST_DISCUSSED, LOCALE_MOVIEBROWSER_YT_MOST_POPULAR, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 6b92fa3c9..18924eac2 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1446,6 +1446,8 @@ const char * locale_real_names[] = "moviebrowser.use_rec_dir", "moviebrowser.yt_concurrent_connections", "moviebrowser.yt_error", + "moviebrowser.yt_history", + "moviebrowser.yt_max_history", "moviebrowser.yt_max_results", "moviebrowser.yt_most_discussed", "moviebrowser.yt_most_popular", From 3a7ffa7a8bb766a0a56c0354b21240289048f1a7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 12 Nov 2013 10:51:42 +0100 Subject: [PATCH 31/45] CComponents: remove log spam Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a6e0564c2bb007761f30786a011c7ae9c2db8b1f Author: Thilo Graf Date: 2013-11-12 (Tue, 12 Nov 2013) --- src/gui/components/cc_base.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index 38a015017..e6ebe16cb 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -108,12 +108,14 @@ void CComponents::paintFbItems(bool do_save_bg) for(size_t i=0; i< v_fbdata.size() ;i++){ // Don't paint if dx or dy are 0 if ((v_fbdata[i].dx == 0) || (v_fbdata[i].dy == 0)){ - printf(" [CComponents] WARNING:\n [%s - %d], dx = %d\n dy = %d\n", __FUNCTION__, __LINE__, v_fbdata[i].dx, v_fbdata[i].dy); +// printf(" [CComponents] WARNING:\n [%s - %d], dx = %d\n dy = %d\n", __FUNCTION__, __LINE__, v_fbdata[i].dx, v_fbdata[i].dy); continue; } +#if 0 if ((v_fbdata[i].x == 0) || (v_fbdata[i].y == 0)){ - printf(" [CComponents] WARNING:\n [%s - %d], x = %d\n y = %d\n", __FUNCTION__, __LINE__, v_fbdata[i].x, v_fbdata[i].y); + printf(" [CComponents] WARNING:\n [%s - %d], x = %d\n y = %d\n", __FUNCTION__, __LINE__, v_fbdata[i].x, v_fbdata[i].y); } +#endif int fbtype = v_fbdata[i].fbdata_type; #ifdef DEBUG_CC From f45c16a376c48a9e23de5584c0417704f4b71708 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 12 Nov 2013 17:13:54 +0400 Subject: [PATCH 32/45] data/locale/english.locale: capitalize Bouquet editor Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c3eb7a8d1ac85fe13686aa8250d9545c357c1450 Author: [CST] Focus Date: 2013-11-12 (Tue, 12 Nov 2013) --- data/locale/english.locale | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index 349246af0..1767bd4fb 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -187,7 +187,7 @@ bouqueteditor.discardingchanges Discarding changes. Please be patient. bouqueteditor.hide Hide bouqueteditor.lock Lock bouqueteditor.move Move -bouqueteditor.name bouquet editor +bouqueteditor.name Bouquet editor bouqueteditor.newbouquetname New name of bouquets bouqueteditor.rename Rename bouqueteditor.return ready From a40af640a44ad36d168f42ba14c4aca37f861628 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 12 Nov 2013 17:19:52 +0400 Subject: [PATCH 33/45] gui/network_setup.cpp: move wlan setup items up, to be visible always on first page Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b9881539d4e753bcecfb6a2d0f7ddf4ba03ad431 Author: [CST] Focus Date: 2013-11-12 (Tue, 12 Nov 2013) --- src/gui/network_setup.cpp | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/gui/network_setup.cpp b/src/gui/network_setup.cpp index 75fa1da60..b860de305 100644 --- a/src/gui/network_setup.cpp +++ b/src/gui/network_setup.cpp @@ -297,24 +297,8 @@ int CNetworkSetup::showNetworkSetup() networkSettings->addItem(o1); //set on start networkSettings->addItem(GenericMenuSeparatorLine); //------------------------------------------------ - networkSettings->addItem(mac); //eth id - networkSettings->addItem(GenericMenuSeparatorLine); - //------------------------------------------------- - networkSettings->addItem(o2); //dhcp on/off - networkSettings->addItem( m8); //hostname - networkSettings->addItem(GenericMenuSeparatorLine); - //------------------------------------------------- - networkSettings->addItem( m1); //adress - networkSettings->addItem( m2); //mask - networkSettings->addItem( m3); //broadcast - networkSettings->addItem(GenericMenuSeparatorLine); - //------------------------------------------------ - networkSettings->addItem( m4); //gateway - networkSettings->addItem( m5); //nameserver - //------------------------------------------------ if(ifcount > 1) // if there is only one, its probably wired { - networkSettings->addItem(GenericMenuSeparatorLine); //ssid CStringInputSMS * networkSettings_ssid = new CStringInputSMS(LOCALE_NETWORKMENU_SSID, &network_ssid, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789 -_/()<>=+.,:!?\\'"); //key @@ -334,10 +318,24 @@ int CNetworkSetup::showNetworkSetup() networkSettings->addItem( m11); //ssid scan networkSettings->addItem( m9); //ssid networkSettings->addItem( m10); //key - if (!g_settings.easymenu) - networkSettings->addItem(GenericMenuSeparatorLine); + networkSettings->addItem(GenericMenuSeparatorLine); } //------------------------------------------------ + networkSettings->addItem(mac); //eth id + networkSettings->addItem(GenericMenuSeparatorLine); + //------------------------------------------------- + networkSettings->addItem(o2); //dhcp on/off + networkSettings->addItem( m8); //hostname + networkSettings->addItem(GenericMenuSeparatorLine); + //------------------------------------------------- + networkSettings->addItem( m1); //adress + networkSettings->addItem( m2); //mask + networkSettings->addItem( m3); //broadcast + networkSettings->addItem(GenericMenuSeparatorLine); + //------------------------------------------------ + networkSettings->addItem( m4); //gateway + networkSettings->addItem( m5); //nameserver + //------------------------------------------------ sectionsdConfigNotifier = NULL; CMenuWidget ntp(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_NETWORKSETUP_NTP); #ifdef ENABLE_GUI_MOUNT From 439d44e903b1f1086012cf9e0090b3afa6f76737 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 12 Nov 2013 17:20:36 +0400 Subject: [PATCH 34/45] gui/scan_setup.cpp: remove tuner name from tuner setup menu header for easymenu mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3022dc251d161e5cad487f484fe6f1c9addec1b0 Author: [CST] Focus Date: 2013-11-12 (Tue, 12 Nov 2013) --- src/gui/scan_setup.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index a97d48bc3..9d57587ad 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -632,7 +632,12 @@ int CScanSetup::showFrontendSetup(int number) dmode = fe_config.diseqcType; char name[255]; - snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(LOCALE_SATSETUP_FE_SETUP), number+1, fe->getInfo()->name); + if (g_settings.easymenu) + snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(LOCALE_SATSETUP_FE_SETUP), number+1, + fe->getInfo()->type == FE_QPSK ? g_Locale->getText(LOCALE_SCANTS_ACTSATELLITE) + : g_Locale->getText(LOCALE_SCANTS_ACTCABLE)); + else + snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(LOCALE_SATSETUP_FE_SETUP), number+1, fe->getInfo()->name); CMenuWidget * setupMenu = new CMenuWidget(name, NEUTRINO_ICON_SETTINGS, width); setupMenu->setSelected(feselected); From e6f8509dc1b8c45cedb037996b0451521dcc859c Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 12 Nov 2013 17:21:22 +0400 Subject: [PATCH 35/45] neutrino_menue.cpp: for easymenu, replace 'Channels' with bouquet editor in main menu Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e2009a4681775c2552f412f1b56668275f6efa72 Author: [CST] Focus Date: 2013-11-12 (Tue, 12 Nov 2013) --- src/neutrino_menue.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 77481348a..72c476b93 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -149,9 +149,14 @@ void CNeutrinoApp::InitMenuMain() mb->setHint(NEUTRINO_ICON_HINT_MB, LOCALE_MENU_HINT_MB); personalize.addItem(MENU_MAIN, mb, &g_settings.personalize[SNeutrinoSettings::P_MPLAYER_MBROWSER]); } +#if 0 CMenuForwarder *cl = new CMenuForwarder(LOCALE_MAINMENU_CHANNELS, true, NULL, this, "channels", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); cl->setHint(NEUTRINO_ICON_HINT_TVMODE, LOCALE_MENU_HINT_CHANNELS); - personalize.addItem(MENU_MAIN, cl); //, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE]); + personalize.addItem(MENU_MAIN, cl); +#endif + CMenuForwarder * mf = new CMenuForwarder(LOCALE_BOUQUETEDITOR_NAME , true, NULL, new CBEBouquetWidget(), NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); + mf->setHint(NEUTRINO_ICON_HINT_BEDIT, LOCALE_MENU_HINT_BEDIT); + personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION); } else { //tv <-> radio toggle CMenuForwarder *tvradio_switch = new CMenuForwarder(LOCALE_MAINMENU_TVRADIO_SWITCH, true, NULL, this, "tv_radio_switch", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); @@ -469,18 +474,17 @@ void CNeutrinoApp::InitMenuService() } //bouquet edit - if (g_settings.easymenu) - mf = new CMenuForwarder(LOCALE_BOUQUETEDITOR_NAME , true, NULL, new CBEBouquetWidget(), NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); - else + if (!g_settings.easymenu) { mf = new CMenuForwarder(LOCALE_BOUQUETEDITOR_NAME , true, NULL, new CBEBouquetWidget(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); - mf->setHint(NEUTRINO_ICON_HINT_BEDIT, LOCALE_MENU_HINT_BEDIT); - personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT]); + mf->setHint(NEUTRINO_ICON_HINT_BEDIT, LOCALE_MENU_HINT_BEDIT); + personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT]); + } //channel reset CDataResetNotifier *resetNotifier = new CDataResetNotifier(); if (g_settings.easymenu) - mf = new CMenuForwarder(LOCALE_RESET_CHANNELS , true, NULL, resetNotifier, "channels", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); + mf = new CMenuForwarder(LOCALE_RESET_CHANNELS , true, NULL, resetNotifier, "channels", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); else mf = new CMenuForwarder(LOCALE_RESET_CHANNELS , true, NULL, resetNotifier, "channels"); @@ -522,7 +526,11 @@ void CNeutrinoApp::InitMenuService() } //firmware update - mf = new CMenuForwarder(LOCALE_SERVICEMENU_UPDATE, true, NULL, new CSoftwareUpdate()); + if (g_settings.easymenu) + mf = new CMenuForwarder(LOCALE_SERVICEMENU_UPDATE, true, NULL, new CSoftwareUpdate(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); + else + mf = new CMenuForwarder(LOCALE_SERVICEMENU_UPDATE, true, NULL, new CSoftwareUpdate()); + mf->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_SW_UPDATE); personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_SOFTUPDATE]); } From ea4a788826605faf87d6f91397b644a158a1b97f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 13 Nov 2013 13:21:20 +0400 Subject: [PATCH 36/45] lib/libcoolstream2/cnxtfb.h: header update, no u8 type used Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4130c04d164a18db313693cd993a1dcd01a1b665 Author: [CST] Focus Date: 2013-11-13 (Wed, 13 Nov 2013) --- lib/libcoolstream2/cnxtfb.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/libcoolstream2/cnxtfb.h b/lib/libcoolstream2/cnxtfb.h index 1f5b34f70..4a51357a3 100644 --- a/lib/libcoolstream2/cnxtfb.h +++ b/lib/libcoolstream2/cnxtfb.h @@ -76,7 +76,10 @@ typedef enum CNXTFB_1080P_50, CNXTFB_1080P_24, CNXTFB_1080P_25, - CNXTFB_DISPLAY_MODE_LAST = CNXTFB_1080P_25, + CNXTFB_1080P_30, + CNXTFB_1080P_2397, + CNXTFB_1080P_2997, + CNXTFB_DISPLAY_MODE_LAST = CNXTFB_1080P_2997, } cnxtfb_displaymode; typedef enum @@ -110,18 +113,18 @@ typedef enum typedef struct { - u8 uRed; - u8 uGreen; - u8 uBlue; - u8 uAlpha; + unsigned char uRed; + unsigned char uGreen; + unsigned char uBlue; + unsigned char uAlpha; } CNXTFB_RGB_COLOR; typedef struct { - u8 uY; - u8 uCb; - u8 uCr; - u8 uAlpha; + unsigned char uY; + unsigned char uCb; + unsigned char uCr; + unsigned char uAlpha; } CNXTFB_YCC_COLOR; typedef enum @@ -212,6 +215,7 @@ extern void cnxtfb_register_evnt_clbk(cnxtfb_notify pfnotify); #ifdef FB_TEST_HW_ACCELERATION #define FBIO_JPEG_RENDER 0x4633 +#define FBIO_SYNC_DRAW_OP 0x4641 #endif #define FBIO_SCALE_SD_OSD 0x4634 From 68e18e35d3832b0de8eb824dab8e758b50f49725 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Nov 2013 19:48:58 +0100 Subject: [PATCH 37/45] fix format string warnings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/630c66330de7a72030fd95faf4a335bbfa4ec59c Author: Stefan Seyfried Date: 2013-11-10 (Sun, 10 Nov 2013) --- src/gui/components/Makefile.am | 2 +- src/gui/components/cc_item_picture.cpp | 2 +- src/gui/update.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/components/Makefile.am b/src/gui/components/Makefile.am index e9cca4adc..d18fc0cbe 100644 --- a/src/gui/components/Makefile.am +++ b/src/gui/components/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -fno-rtti -fno-exceptions +AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS AM_CPPFLAGS += \ -I$(top_builddir) \ diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 6ff199f1d..ebd77bf6f 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -248,7 +248,7 @@ void CComponentsChannelLogo::initVarPictureChannellLogo() pic_name = tmp_logo; // #ifdef DEBUG_CC - printf(" [CComponentsChannelLogo] %s: init image: %s (has_logo=%d, channel_id=%lld)\n", __FUNCTION__, pic_name.c_str(), has_logo, channel_id); + printf("\t[CComponentsChannelLogo] %s: init image: %s (has_logo=%d, channel_id=%" PRIu64 ")\n", __func__, pic_name.c_str(), has_logo, channel_id); // #endif initVarPicture(); diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 225b13d64..36ea1b378 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -596,7 +596,8 @@ bool CFlashExpert::checkSize(int mtd, std::string &backupFile) uint64_t backupMaxSize = (btotal - bused) * (uint64_t)bsize; uint64_t res = 10; // Reserved 10% of available space backupMaxSize = (backupMaxSize - ((backupMaxSize * res) / 100ULL)) / 1024ULL; - printf("##### [%s] backupMaxSize: %llu, btotal: %llu, bused: %llu, bsize: %ld\n", __FUNCTION__, backupMaxSize, btotal, bused, bsize); + printf("##### [%s] backupMaxSize: %" PRIu64 ", btotal: %" PRIu64 ", bused: %" PRIu64 ", bsize: %ld\n", + __func__, backupMaxSize, btotal, bused, bsize); if (backupMaxSize < backupRequiredSize) { snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_NO_AVAILABLE_SPACE), path.c_str(), backupMaxSize, backupRequiredSize); From 548682c6642214b5159cb3848cafe23e0c5a9ddc Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Nov 2013 19:48:22 +0100 Subject: [PATCH 38/45] scanepg: fix unused variable warning Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0481b1f2afef0f32c1075d1f6759ce37fd9e4e3a Author: Stefan Seyfried Date: 2013-11-10 (Sun, 10 Nov 2013) --- src/driver/scanepg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/driver/scanepg.cpp b/src/driver/scanepg.cpp index f8aefe9d8..954645d64 100644 --- a/src/driver/scanepg.cpp +++ b/src/driver/scanepg.cpp @@ -238,7 +238,10 @@ void CEpgScan::Next() send zapTo_NOWAIT -> EIT_COMPLETE from sectionsd -> zap and this at the same time */ CFEManager::getInstance()->Lock(); - CFrontend *live_fe = NULL, *pip_fe = NULL; + CFrontend *live_fe = NULL; +#ifdef ENABLE_PIP + CFrontend *pip_fe = NULL; +#endif if (!standby) { locked = true; live_fe = CZapit::getInstance()->GetLiveFrontend(); From abe49faabb8ab332f27acb77903c00937635a0b0 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Nov 2013 19:47:44 +0100 Subject: [PATCH 39/45] fix cleantargets Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f04bfbdd8836710d2f9971014c585728e5fc1e0a Author: Stefan Seyfried Date: 2013-11-10 (Sun, 10 Nov 2013) --- configure.ac | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 5e6f948b4..259522535 100644 --- a/configure.ac +++ b/configure.ac @@ -222,6 +222,8 @@ src/gui/bedit/Makefile src/gui/components/Makefile src/gui/widget/Makefile src/system/Makefile +src/system/mtdutils/Makefile +src/system/mtdutils/lib/Makefile data/Makefile data/fonts/Makefile data/icons/Makefile @@ -243,10 +245,3 @@ src/zapit/lib/Makefile src/zapit/src/Makefile src/zapit/data/Makefile ]) - -if test "$BOXMODEL" = "apollo"; then -AC_OUTPUT([ -src/system/mtdutils/Makefile -src/system/mtdutils/lib/Makefile -]) -fi From 6a22ad7f2fce8e69792015743bc1df5bb6599ae3 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Nov 2013 19:45:51 +0100 Subject: [PATCH 40/45] ytparser: fix wrong-type compiler warnings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0fc3aa2ae806382a2957155cde016ab08bd4f9ac Author: Stefan Seyfried Date: 2013-11-10 (Sun, 10 Nov 2013) --- src/system/ytparser.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/system/ytparser.cpp b/src/system/ytparser.cpp index 3e9eb1d46..7bdfc8535 100644 --- a/src/system/ytparser.cpp +++ b/src/system/ytparser.cpp @@ -56,7 +56,7 @@ void cYTVideoInfo::Dump() printf("title: %s\n", title.c_str()); printf("duration: %d\n", duration); //printf("description: %s\n", description.c_str()); - printf("urls: %d\n", formats.size()); + printf("urls: %d\n", (int)formats.size()); for (yt_urlmap_iterator_t it = formats.begin(); it != formats.end(); ++it) { printf("format %d type [%s] url %s\n", it->first, it->second.type.c_str(), it->second.GetUrl().c_str()); } @@ -130,7 +130,7 @@ bool cYTFeedParser::getUrl(std::string &url, std::string &answer, CURL *_curl_ha printf("try to get [%s] ...\n", url.c_str()); CURLcode httpres = curl_easy_perform(_curl_handle); - printf("http: res %d size %d\n", httpres, answer.size()); + printf("http: res %d size %d\n", httpres, (int)answer.size()); if (httpres != 0 || answer.empty()) { printf("error: %s\n", cerror); @@ -195,7 +195,7 @@ void cYTFeedParser::encodeUrl(std::string &txt) void cYTFeedParser::splitString(std::string &str, std::string delim, std::vector &strlist, int start) { strlist.clear(); - unsigned int end = 0; + std::string::size_type end = 0; while ((end = str.find(delim, start)) != std::string::npos) { strlist.push_back(str.substr(start, end - start)); start = end + delim.size(); @@ -205,7 +205,7 @@ void cYTFeedParser::splitString(std::string &str, std::string delim, std::vector void cYTFeedParser::splitString(std::string &str, std::string delim, std::map &strmap, int start) { - unsigned int end = 0; + std::string::size_type end = 0; if ((end = str.find(delim, start)) != std::string::npos) { strmap[str.substr(start, end - start)] = str.substr(end - start + delim.size()); } @@ -414,7 +414,7 @@ bool cYTFeedParser::decodeVideoInfo(std::string &answer, cYTVideoInfo &vinfo) //FIXME check expire std::vector ulist; - unsigned fmt = answer.find("url_encoded_fmt_stream_map="); + std::string::size_type fmt = answer.find("url_encoded_fmt_stream_map="); if (fmt != std::string::npos) { fmt = answer.find("=", fmt); splitString(answer, ",", ulist, fmt+1); @@ -666,7 +666,7 @@ bool cYTFeedParser::GetVideoUrls() void cYTFeedParser::Cleanup(bool delete_thumbnails) { - printf("cYTFeedParser::Cleanup: %d videos\n", videos.size()); + printf("cYTFeedParser::Cleanup: %d videos\n", (int)videos.size()); if (delete_thumbnails) { for (unsigned i = 0; i < videos.size(); i++) { unlink(videos[i].tfile.c_str()); @@ -680,7 +680,7 @@ void cYTFeedParser::Cleanup(bool delete_thumbnails) void cYTFeedParser::Dump() { - printf("feed: %d videos\n", videos.size()); + printf("feed: %d videos\n", (int)videos.size()); for (unsigned i = 0; i < videos.size(); i++) videos[i].Dump(); } From f3c060b7f6e8dda105f6c23005a1ae7cb84f5ffc Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Nov 2013 11:52:16 +0100 Subject: [PATCH 41/45] movieplayer: initialize vpid and vtype variables Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e75526bad3cb18e28f5f50a5f623ff7c7d688fcf Author: Stefan Seyfried Date: 2013-11-10 (Sun, 10 Nov 2013) --- src/gui/movieplayer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index e01022382..4e3d16160 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -330,6 +330,8 @@ void CMoviePlayerGui::Cleanup() numpida = 0; currentapid = 0; currentspid = -1; numsubs = 0; + vpid = 0; + vtype = 0; startposition = 0; is_file_player = false; From e35f072d9d17455dc6d5852f94310b9d136c118a Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 13 Nov 2013 08:54:09 +0100 Subject: [PATCH 42/45] remove unneeded CConfigFile from lcdd and shutdown_count Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/769d31045533564fbfec1d4914018e8ddf454a1b Author: Stefan Seyfried Date: 2013-11-13 (Wed, 13 Nov 2013) --- src/driver/lcdd.cpp | 3 --- src/driver/lcdd.h | 5 +---- src/driver/shutdown_count.cpp | 2 -- src/driver/shutdown_count.h | 4 ---- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/driver/lcdd.cpp b/src/driver/lcdd.cpp index 8b6083df6..6730b59f0 100644 --- a/src/driver/lcdd.cpp +++ b/src/driver/lcdd.cpp @@ -1,6 +1,4 @@ /* - $Id$ - LCD-Daemon - DBoxII-Project Copyright (C) 2001 Steffen Hehn 'McClean' @@ -85,7 +83,6 @@ static bool isUTF8(const std::string &string) } CLCD::CLCD() - : configfile('\t') { #ifdef LCD_UPDATE m_fileList = NULL; diff --git a/src/driver/lcdd.h b/src/driver/lcdd.h index 1e7e5be15..6689a79de 100644 --- a/src/driver/lcdd.h +++ b/src/driver/lcdd.h @@ -1,6 +1,4 @@ /* - $Id$ - LCD-Daemon - DBoxII-Project Copyright (C) 2001 Steffen Hehn 'McClean' @@ -80,8 +78,8 @@ typedef enum #include "driver/file.h" #endif // LCD_UPDATE -#include #include +#include #include @@ -150,7 +148,6 @@ class CLCD bool showclock; bool movie_centered; bool movie_is_ac3; - CConfigFile configfile; pthread_t thrTime; int last_toggle_state_power; int clearClock; diff --git a/src/driver/shutdown_count.cpp b/src/driver/shutdown_count.cpp index a7b092022..9416a30fd 100644 --- a/src/driver/shutdown_count.cpp +++ b/src/driver/shutdown_count.cpp @@ -4,7 +4,6 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Homepage: http://dbox.cyberphoria.org/ - License: GPL This program is free software; you can redistribute it and/or modify @@ -39,7 +38,6 @@ SHTDCNT::SHTDCNT() - : configfile('\t') { } diff --git a/src/driver/shutdown_count.h b/src/driver/shutdown_count.h index 6b0692da6..7fed38ba8 100644 --- a/src/driver/shutdown_count.h +++ b/src/driver/shutdown_count.h @@ -4,8 +4,6 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Homepage: http://dbox.cyberphoria.org/ - - License: GPL This program is free software; you can redistribute it and/or modify @@ -26,7 +24,6 @@ #ifndef __shutdown_count__ #define __shutdown_count__ -#include #include class SHTDCNT @@ -36,7 +33,6 @@ class SHTDCNT pthread_t thrTime; unsigned int shutdown_cnt; unsigned int sleep_cnt; - CConfigFile configfile; void shutdown_counter(); SHTDCNT(); From f2a2e699c2d13d610a0c6e8cc3e884c383f74ab2 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 13 Nov 2013 09:07:41 +0100 Subject: [PATCH 43/45] global.h: Use forward-declarations to reduce number of dependencies Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4bc6e43ad478857453c64bbe9c46dffae7e525e1 Author: Stefan Seyfried Date: 2013-11-13 (Wed, 13 Nov 2013) --- src/driver/rcinput.cpp | 1 + src/driver/record.cpp | 1 + src/global.h | 43 ++++++++++------------------------ src/gui/channellist.cpp | 4 +++- src/gui/epgplus.cpp | 1 + src/gui/epgview.cpp | 1 + src/gui/eventlist.cpp | 1 + src/gui/infoviewer.cpp | 1 + src/gui/movieplayer.cpp | 4 ++++ src/gui/osd_setup.cpp | 1 + src/gui/screensetup.cpp | 1 + src/gui/sleeptimer.cpp | 1 + src/gui/start_wizard.cpp | 1 + src/gui/timerlist.cpp | 1 + src/gui/user_menue.cpp | 3 +++ src/neutrino.cpp | 1 + src/neutrino_menue.cpp | 1 + src/system/fsmounter.cpp | 1 + src/system/httptool.cpp | 3 +-- src/system/setting_helpers.cpp | 1 + 20 files changed, 39 insertions(+), 33 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index a961282bc..aa98e6c4c 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include //#define RCDEBUG diff --git a/src/driver/record.cpp b/src/driver/record.cpp index c10d2e924..9984e143e 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -51,6 +51,7 @@ #include +#include #include #include #include diff --git a/src/global.h b/src/global.h index 73322e913..c05a44822 100644 --- a/src/global.h +++ b/src/global.h @@ -6,14 +6,6 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Homepage: http://dbox.cyberphoria.org/ - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - License: GPL This program is free software; you can redistribute it and/or modify @@ -31,30 +23,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include -#include - -#include -#include -#include -#if HAVE_COOL_HARDWARE -#include -#endif -#if HAVE_TRIPLEDRAGON -#include -#define CVFD CLCD -#endif - -#include #include -#include -#include -#include -#include - - #ifndef NEUTRINO_CPP #define NEUTRINO_CPP extern #endif @@ -80,26 +50,39 @@ NEUTRINO_CPP SNeutrinoSettings g_settings; NEUTRINO_CPP SglobalInfo g_info; #ifdef HAVE_CONTROLD +class CControldClient; NEUTRINO_CPP CControldClient *g_Controld; #endif +class CZapitClient; NEUTRINO_CPP CZapitClient *g_Zapit; +class CSectionsdClient; NEUTRINO_CPP CSectionsdClient *g_Sectionsd; +class CTimerdClient; NEUTRINO_CPP CTimerdClient *g_Timerd; +class FBFontRenderClass; NEUTRINO_CPP FBFontRenderClass *g_fontRenderer; NEUTRINO_CPP FBFontRenderClass *g_dynFontRenderer; +class Font; NEUTRINO_CPP Font * g_Font[SNeutrinoSettings::FONT_TYPE_COUNT]; NEUTRINO_CPP Font * g_SignalFont; +class CRCInput; NEUTRINO_CPP CRCInput *g_RCInput; +class CEpgData; NEUTRINO_CPP CEpgData *g_EpgData; +class CInfoViewer; NEUTRINO_CPP CInfoViewer *g_InfoViewer; +class CNeutrinoEventList; NEUTRINO_CPP CNeutrinoEventList *g_EventList; +class CLocaleManager; NEUTRINO_CPP CLocaleManager *g_Locale; +class CVideoSettings; NEUTRINO_CPP CVideoSettings *g_videoSettings; +class CRadioText; NEUTRINO_CPP CRadioText *g_Radiotext; #ifndef DISABLE_GUI_MOUNT diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 6864276e2..a7eca53df 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -46,8 +46,10 @@ #include #include #include - +#include + #include +#include #include #include #include diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 3ee640c51..2988692e2 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 747633e61..1a9142f8d 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 8ac359e87..59d175789 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index f0f91474c..a2a1eb94a 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -62,6 +62,7 @@ #include #include #include +#include #include #include diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 4e3d16160..ed8c8aeab 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -32,12 +32,16 @@ #include #include +#include +#include +#include #include #include #include #include #include #include +#include #include #include #include diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 9760ea225..0a7b8a0e4 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include #include diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp index b1662e478..4109a3d9b 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include diff --git a/src/gui/sleeptimer.cpp b/src/gui/sleeptimer.cpp index 02c847b78..936355f3c 100644 --- a/src/gui/sleeptimer.cpp +++ b/src/gui/sleeptimer.cpp @@ -27,6 +27,7 @@ #endif #include +#include #include diff --git a/src/gui/start_wizard.cpp b/src/gui/start_wizard.cpp index 827781abf..676cfd182 100644 --- a/src/gui/start_wizard.cpp +++ b/src/gui/start_wizard.cpp @@ -46,6 +46,7 @@ #include "osd_setup.h" #include "osdlang_setup.h" #include "scan_setup.h" +#include "videosettings.h" #include #include diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 0aeeaed11..ab5dbd095 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -48,6 +48,7 @@ #include #include +#include #include #include #include diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 123066d18..e7859b8d8 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -48,6 +48,8 @@ #include "audio_select.h" #include "streaminfo2.h" #include "epgplus.h" +#include "epgview.h" +#include "eventlist.h" #include "movieplayer.h" #include "timerlist.h" #include "plugins.h" @@ -62,6 +64,7 @@ #include +#include #include #include diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 559ea61fa..7fd10575a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -58,6 +58,7 @@ #include #include #include +#include #include #include "gui/audiomute.h" diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 72c476b93..327efc425 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -76,6 +76,7 @@ #endif #include "gui/update.h" #include "gui/vfd_setup.h" +#include "gui/videosettings.h" #include "driver/record.h" diff --git a/src/system/fsmounter.cpp b/src/system/fsmounter.cpp index a6bfb93b3..d8d384220 100644 --- a/src/system/fsmounter.cpp +++ b/src/system/fsmounter.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include diff --git a/src/system/httptool.cpp b/src/system/httptool.cpp index 20bd5fba7..c23cd0a08 100644 --- a/src/system/httptool.cpp +++ b/src/system/httptool.cpp @@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA */ - +#include #include #include @@ -30,7 +30,6 @@ #include - CHTTPTool::CHTTPTool() { statusViewer = NULL; diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index b2ca12c00..b01c3226e 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include #include // obsolete #include From 81d56f75fca7e38df48f2629297c9e13775a77c4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 13 Nov 2013 10:31:16 +0100 Subject: [PATCH 44/45] add missing include of vfd header Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3845feb0e40a9d67d4bd4901def78beaf32b2611 Author: vanhofen Date: 2013-11-13 (Wed, 13 Nov 2013) Origin message was: ------------------ - add missing include of vfd header --- src/driver/audiodec/mp3dec.cpp | 1 + src/driver/volume.cpp | 1 + src/gui/audiomute.cpp | 2 ++ src/gui/audioplayer.cpp | 1 + src/gui/bookmarkmanager.cpp | 1 + src/gui/bouquetlist.cpp | 2 ++ src/gui/eventlist.cpp | 1 + src/gui/filebrowser.cpp | 1 + src/gui/pictureviewer.cpp | 1 + src/gui/rc_lock.cpp | 2 ++ src/gui/settings_manager.cpp | 2 ++ src/gui/streaminfo2.cpp | 1 + src/gui/vfd_setup.cpp | 1 + src/gui/videosettings.cpp | 1 + src/gui/widget/menue.cpp | 1 + src/gui/widget/progresswindow.cpp | 1 + src/gui/widget/stringinput.cpp | 1 + src/gui/widget/stringinput_ext.cpp | 1 + src/system/flashtool.cpp | 1 + src/system/setting_helpers.cpp | 1 + 20 files changed, 24 insertions(+) diff --git a/src/driver/audiodec/mp3dec.cpp b/src/driver/audiodec/mp3dec.cpp index f64d3956a..a5c3e9282 100644 --- a/src/driver/audiodec/mp3dec.cpp +++ b/src/driver/audiodec/mp3dec.cpp @@ -54,6 +54,7 @@ #include #include "mp3dec.h" #include +#include extern cAudio * audioDecoder; diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index a8fe704a3..8c230291b 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/src/gui/audiomute.cpp b/src/gui/audiomute.cpp index 90ef21734..d956cbea8 100644 --- a/src/gui/audiomute.cpp +++ b/src/gui/audiomute.cpp @@ -34,6 +34,8 @@ #include #include +#include + CAudioMute::CAudioMute():CComponentsPicture(0, 0, 0, 0, NEUTRINO_ICON_BUTTON_MUTE) { y_old = -1; diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 63e9171c0..25d0f6f53 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index 228b136fb..56dec6813 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include #include diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 594de4822..9cb87ea97 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -50,6 +50,8 @@ #include #include #include +#include + #include #include diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 59d175789..93e5902fe 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -47,6 +47,7 @@ #include #include +#include #include #include diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 01614f2fc..009ba9a3a 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 58ef0afe8..d6fab95dd 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -43,6 +43,7 @@ #include #include +#include #include diff --git a/src/gui/rc_lock.cpp b/src/gui/rc_lock.cpp index 2b7177692..a5839af49 100644 --- a/src/gui/rc_lock.cpp +++ b/src/gui/rc_lock.cpp @@ -37,6 +37,8 @@ #include #include +#include + const std::string CRCLock::NO_USER_INPUT = "noUserInput"; bool CRCLock::locked = false; diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index 9bb0d2bf5..49a80835f 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -40,6 +40,8 @@ #include #include +#include + #include #include diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index c487d274e..de08f2fbe 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index ecfc2f891..2e782ca82 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -44,6 +44,7 @@ #include #include +#include #include #include diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 90a6fe3d3..5800ad320 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -46,6 +46,7 @@ #include #include +#include #include diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 988bd6ff0..d66fa50b5 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -39,6 +39,7 @@ #include #include +#include #include diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 59b29f8a9..d014fd829 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 59a5e8be8..d83d803fa 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index af6c9b410..c5b510f6f 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include diff --git a/src/system/flashtool.cpp b/src/system/flashtool.cpp index d3c3ce5c6..c7f7aa352 100644 --- a/src/system/flashtool.cpp +++ b/src/system/flashtool.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index b01c3226e..0dd096d27 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include // obsolete #include From 63626eb576efb5ab8fcaeca378ea9e188c1ec861 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 13 Nov 2013 11:37:14 +0100 Subject: [PATCH 45/45] Revert "- add missing include of vfd header" This reverts commit 81d56f75fca7e38df48f2629297c9e13775a77c4. We use display.h instead. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2eacae9ca7bf89ec481090f6fbb5d0c627a04ff7 Author: Stefan Seyfried Date: 2013-11-13 (Wed, 13 Nov 2013) --- src/driver/audiodec/mp3dec.cpp | 1 - src/driver/volume.cpp | 1 - src/gui/audiomute.cpp | 2 -- src/gui/audioplayer.cpp | 1 - src/gui/bookmarkmanager.cpp | 1 - src/gui/bouquetlist.cpp | 2 -- src/gui/eventlist.cpp | 1 - src/gui/filebrowser.cpp | 1 - src/gui/pictureviewer.cpp | 1 - src/gui/rc_lock.cpp | 2 -- src/gui/settings_manager.cpp | 2 -- src/gui/streaminfo2.cpp | 1 - src/gui/vfd_setup.cpp | 1 - src/gui/videosettings.cpp | 1 - src/gui/widget/menue.cpp | 1 - src/gui/widget/progresswindow.cpp | 1 - src/gui/widget/stringinput.cpp | 1 - src/gui/widget/stringinput_ext.cpp | 1 - src/system/flashtool.cpp | 1 - src/system/setting_helpers.cpp | 1 - 20 files changed, 24 deletions(-) diff --git a/src/driver/audiodec/mp3dec.cpp b/src/driver/audiodec/mp3dec.cpp index a5c3e9282..f64d3956a 100644 --- a/src/driver/audiodec/mp3dec.cpp +++ b/src/driver/audiodec/mp3dec.cpp @@ -54,7 +54,6 @@ #include #include "mp3dec.h" #include -#include extern cAudio * audioDecoder; diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index 8c230291b..a8fe704a3 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/src/gui/audiomute.cpp b/src/gui/audiomute.cpp index d956cbea8..90ef21734 100644 --- a/src/gui/audiomute.cpp +++ b/src/gui/audiomute.cpp @@ -34,8 +34,6 @@ #include #include -#include - CAudioMute::CAudioMute():CComponentsPicture(0, 0, 0, 0, NEUTRINO_ICON_BUTTON_MUTE) { y_old = -1; diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 25d0f6f53..63e9171c0 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -46,7 +46,6 @@ #include #include #include -#include #include diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index 56dec6813..228b136fb 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -36,7 +36,6 @@ #include #include -#include #include #include #include diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 9cb87ea97..594de4822 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -50,8 +50,6 @@ #include #include #include -#include - #include #include diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 93e5902fe..59d175789 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -47,7 +47,6 @@ #include #include -#include #include #include diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 009ba9a3a..01614f2fc 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -40,7 +40,6 @@ #include #include #include -#include #include #include diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index d6fab95dd..58ef0afe8 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -43,7 +43,6 @@ #include #include -#include #include diff --git a/src/gui/rc_lock.cpp b/src/gui/rc_lock.cpp index a5839af49..2b7177692 100644 --- a/src/gui/rc_lock.cpp +++ b/src/gui/rc_lock.cpp @@ -37,8 +37,6 @@ #include #include -#include - const std::string CRCLock::NO_USER_INPUT = "noUserInput"; bool CRCLock::locked = false; diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index 49a80835f..9bb0d2bf5 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -40,8 +40,6 @@ #include #include -#include - #include #include diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index de08f2fbe..c487d274e 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index 2e782ca82..ecfc2f891 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -44,7 +44,6 @@ #include #include -#include #include #include diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 5800ad320..90a6fe3d3 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -46,7 +46,6 @@ #include #include -#include #include diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index d66fa50b5..988bd6ff0 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -39,7 +39,6 @@ #include #include -#include #include diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index d014fd829..59b29f8a9 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index d83d803fa..59a5e8be8 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index c5b510f6f..af6c9b410 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include diff --git a/src/system/flashtool.cpp b/src/system/flashtool.cpp index c7f7aa352..d3c3ce5c6 100644 --- a/src/system/flashtool.cpp +++ b/src/system/flashtool.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 0dd096d27..b01c3226e 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -55,7 +55,6 @@ #include #include #include -#include #include // obsolete #include