From d8878ea74aee75c5fe3fd19ce2810920fe789404 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Dec 2016 16:42:13 +0100 Subject: [PATCH 01/11] CComponentsScrollBar: add easy to handle scrollbar methode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/728b95ac1cfa3743e4a0df02c49b0dc447103ceb Author: Thilo Graf Date: 2016-12-15 (Thu, 15 Dec 2016) --- src/gui/components/cc_frm_scrollbar.cpp | 17 +++++ src/gui/components/cc_frm_scrollbar.h | 91 ++++++++++++++++++++++--- 2 files changed, 98 insertions(+), 10 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index dc277f6be..31127f683 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -189,3 +189,20 @@ void CComponentsScrollBar::initSegments() sb_segments_obj->front()->setCorner(RADIUS_MIN, CORNER_TOP); sb_segments_obj->back()->setCorner(RADIUS_MIN, CORNER_BOTTOM); } + + +void paintScrollBar( const int &x_pos, + const int &y_pos, + const int &w, + const int &h, + const int& count, + const int& current_num, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) +{ + CComponentsScrollBar scrollbar(x_pos, y_pos, w, h, count, NULL, shadow_mode, color_frame, color_body, color_shadow); + scrollbar.setMarkID(current_num); + scrollbar.paint0(); +} diff --git a/src/gui/components/cc_frm_scrollbar.h b/src/gui/components/cc_frm_scrollbar.h index 731e83df5..8ea476fb7 100644 --- a/src/gui/components/cc_frm_scrollbar.h +++ b/src/gui/components/cc_frm_scrollbar.h @@ -60,24 +60,95 @@ class CComponentsScrollBar : public CComponentsFrmChain void initVarSbForm( const int& count); public: - CComponentsScrollBar( const int &x_pos, const int &y_pos, const int &w = 15, const int &h = 40, - const int& count = 1, + /**Class constructor to generate individual scrollbar objects + * + * @param[in] x_pos exepts type int, x position on screen + * @param[in] x_pos exepts type int, y position on screen modes are: + * @param[in] w exepts type int, width of scrollbar object + * @param[in] h exepts type int, height of scrollbar object + * @param[in] count optional, exepts type int, count of pages, default 1 + * + * usual paraemters: + * @param[in] parent optional, exepts type pointer to a parent CComponentsForm object, default NULL + * @param[in] shadow_mode optional, exepts type int defined by shadow mode enums, default CC_SHADOW_OFF + * @param[in] color_frame optional, exepts type fb_pixel_t, default COL_SCROLLBAR_ACTIVE_PLUS_0 + * @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0 + * @param[in] color_shadow optional, exepts type fb_pixel_t, default COL_SHADOW_PLUS_0 + */ + CComponentsScrollBar( const int &x_pos, + const int &y_pos, + const int &w = 15, + const int &h = 40, + const int& count = 1, CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SCROLLBAR_ACTIVE_PLUS_0, - fb_pixel_t color_body = COL_SCROLLBAR_PASSIVE_PLUS_0, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_SCROLLBAR_ACTIVE_PLUS_0, + fb_pixel_t color_body = COL_SCROLLBAR_PASSIVE_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsScrollBar(); //inherited from CComponentsForm - ///set marked segment, 1st = 0, 2nd = 1 ... - void setMarkID(const int& mark_id){sb_mark_id = mark_id; initSegments();}; - ///get current assigned marked id + /**Set current page number + * @return void + * + * @param[in] mark_id exepts type int, this sets the current selected page number. + * + * @see getMarkID() + */ + void setMarkID(const int& mark_id){sb_mark_id = mark_id; initSegments();} + + /**Gets current page number + * @return int + * + * @see setMarkID() + */ int getMarkID(){return sb_mark_id;}; - ///Sets count of scrollbar segments and is similar e.g. page count. Each segment is assigned to an id. Starting with id 0...n see also setMarkID(), getMarkID(). + /**Sets count of possible scrollbar segments (e.g. page count) and + * current selected page at once . + * Each segment is assigned to a page number. Starting with id 0...n + * @return void + * + * @param[in] segment_count exepts type int, sets the current count of pages. + * @param[in] mark_id optional, exepts type int, sets the current selected page number, default = 0 + * @see also setMarkID() + * getMarkID() + */ void setSegmentCount(const int& segment_count, const int& mark_id = 0); - ///Get count of current scrollbar segments + + /**Get count of current scrollbar segments (page count) + * @return int + * + * @see setSegmentCount() + */ int getSegmentCount(){return sb_segments_count;} }; + /**Small and easy to apply scrollbar paint methode without expilcit object declaration + * @return void + * + * @param[in] x_pos exepts type int, x position on screen + * @param[in] x_pos exepts type int, y position on screen modes are: + * @param[in] w exepts type int, width of scrollbar object + * @param[in] h exepts type int, height of scrollbar object + * @param[in] count exepts type int, count of pages, default 1 + * @param[in] current_num exepts type int, current selected page, default 0 + * + * usual paraemters: + * @param[in] parent optional, exepts type pointer to a parent CComponentsForm object, default NULL + * @param[in] shadow_mode optional, exepts type int defined by shadow mode enums, default CC_SHADOW_OFF + * @param[in] color_frame optional, exepts type fb_pixel_t, default COL_SCROLLBAR_ACTIVE_PLUS_0 + * @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0 + * @param[in] color_shadow optional, exepts type fb_pixel_t, default COL_SHADOW_PLUS_0 + */ +void paintScrollBar( const int &x_pos, + const int &y_pos, + const int &w, + const int &h, + const int& count, + const int& current_num, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_SCROLLBAR_ACTIVE_PLUS_0, + fb_pixel_t color_body = COL_SCROLLBAR_PASSIVE_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + #endif From c049ef103889f00e0faa9d0b6046b4bd467ecfa5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Dec 2016 16:52:51 +0100 Subject: [PATCH 02/11] CComponentsScrollBar: use corner settings for scrollbar body Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1d541834b1e10dd5f84e50375a5749cf85f43964 Author: Thilo Graf Date: 2016-12-15 (Thu, 15 Dec 2016) --- src/gui/components/cc_frm_scrollbar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 31127f683..ce0d281b8 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -81,6 +81,7 @@ void CComponentsScrollBar::initVarSbForm(const int& count) sb_up_obj = sb_down_obj = NULL; sb_segments_obj = NULL; + setCorner(RADIUS_MIN, CORNER_ALL); sb_up_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_UP) ; sb_down_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_DOWN); From c6f16e5acf4fe8eed544715c74eac0353edb0908 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Dec 2016 21:09:01 +0100 Subject: [PATCH 03/11] CComponentsScrollBar: fix pos and use current width to set height of arrows This fix size and position and dimensions of arrows. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6dda28d612e9fb46f2b3b86d726a4a40d73197bd Author: Thilo Graf Date: 2016-12-15 (Thu, 15 Dec 2016) --- src/gui/components/cc_frm_scrollbar.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index ce0d281b8..b0ca25fca 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -111,22 +111,20 @@ void CComponentsScrollBar::initTopNaviIcon() { //initialize icon object if (sb_up_obj == NULL){ - sb_up_obj = new CComponentsPicture(CC_CENTERED, fr_thickness, sb_up_icon, this); + sb_up_obj = new CComponentsPicture(CC_CENTERED, fr_thickness, width-2*fr_thickness, width-2*fr_thickness, sb_up_icon, this); sb_up_obj->SetTransparent(CFrameBuffer::TM_BLACK); sb_up_obj->doPaintBg(false); } - sb_up_obj->setWidth(width-2*fr_thickness); } void CComponentsScrollBar::initBottomNaviIcon() { //initialize icon object if (sb_down_obj == NULL){ - sb_down_obj = new CComponentsPicture(CC_CENTERED, CC_APPEND, sb_down_icon, this); + sb_down_obj = new CComponentsPicture(CC_CENTERED, height - width-2*fr_thickness, width-2*fr_thickness, 0, sb_down_icon, this); sb_down_obj->SetTransparent(CFrameBuffer::TM_BLACK); sb_down_obj->doPaintBg(false); } - sb_down_obj->setWidth(width-2*fr_thickness); } void CComponentsScrollBar::initSegments() From c0e881773acac69e00a8a8e765f08dd59ac3c62f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Dec 2016 22:02:21 +0100 Subject: [PATCH 04/11] CCDraw: reduce debug spam Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/689866c8726811bad558d8116e06c210c52aaaa9 Author: Thilo Graf Date: 2016-12-15 (Thu, 15 Dec 2016) --- src/gui/components/cc_draw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index c0a281434..a5c455bb8 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -678,7 +678,7 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const in r, corner_type); }else - dprintf(DEBUG_NORMAL, "\033[33m[CCDraw][%s - %d], WARNING! render with bad dimensions [dx = %d dy = %d]\033[0m\n", __func__, __LINE__, v_fbdata[i].dx, v_fbdata[i].dy ); + dprintf(DEBUG_DEBUG, "\033[33m[CCDraw][%s - %d], WARNING! render with bad dimensions [dx = %d dy = %d]\033[0m\n", __func__, __LINE__, v_fbdata[i].dx, v_fbdata[i].dy ); if (v_fbdata[i].frame_thickness) frameBuffer->paintBoxFrame(v_fbdata[i].x, From 366565264660b921e4c4401d18039fbc070f5c1e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 16 Dec 2016 09:03:07 +0100 Subject: [PATCH 05/11] cc_frm: avoid artificially offsets Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b46a35cdf4cef4fb01b1a10ee803bfdd1ec481bd Author: vanhofen Date: 2016-12-16 (Fri, 16 Dec 2016) Origin message was: ------------------ - cc_frm: avoid artificially offsets --- src/gui/components/cc_frm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index a1ae03b04..5bba0af59 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -375,9 +375,9 @@ void CComponentsForm::paintCCItems() //init and handle scrollbar getPageCount(); - int y_sb = this_y+1; + int y_sb = this_y; int x_sb = this_x + width - w_sb; - int h_sb = height-2; + int h_sb = height; if (sb == NULL){ sb = new CComponentsScrollBar(x_sb, y_sb, w_sb, h_sb); }else{ From e6ea5922d65fbb328091e758da5992b3506ff91c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 16 Dec 2016 09:03:07 +0100 Subject: [PATCH 06/11] helpbox: avoid artificially offsets Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5b3d451551b752d114069f2ea745e088960d74e1 Author: vanhofen Date: 2016-12-16 (Fri, 16 Dec 2016) Origin message was: ------------------ - helpbox: avoid artificially offsets --- src/gui/widget/helpbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index fc0839d4f..4169b5d13 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -44,7 +44,7 @@ Helpbox::Helpbox( const string& Title, CC_SHADOW_ON) { page = 0; - hbox_y = 1; + hbox_y = 0; setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); ccw_footer->setButtonLabel(NEUTRINO_ICON_BUTTON_HOME, LOCALE_MESSAGEBOX_BACK); From e5a5a8b41e994e5065774a08be6aa1758b403270 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 16 Dec 2016 09:03:07 +0100 Subject: [PATCH 07/11] cc_frm_scrollbar: set default height to 0 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c3439ad09dda85628198cf956aae7754feb113c8 Author: vanhofen Date: 2016-12-16 (Fri, 16 Dec 2016) Origin message was: ------------------ - cc_frm_scrollbar: set default height to 0 --- src/gui/components/cc_frm_scrollbar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_scrollbar.h b/src/gui/components/cc_frm_scrollbar.h index 8ea476fb7..8057147ec 100644 --- a/src/gui/components/cc_frm_scrollbar.h +++ b/src/gui/components/cc_frm_scrollbar.h @@ -78,7 +78,7 @@ class CComponentsScrollBar : public CComponentsFrmChain CComponentsScrollBar( const int &x_pos, const int &y_pos, const int &w = 15, - const int &h = 40, + const int &h = 0, const int& count = 1, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, From 77d89d2f0ad40f941631bb9ef64c85d491828157 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 16 Dec 2016 09:03:07 +0100 Subject: [PATCH 08/11] cc_frm_scrollbar: fix offsets; use OFFSET defines Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/38c621ad5e8aeb5f25f869b3ddd929b01226f84d Author: vanhofen Date: 2016-12-16 (Fri, 16 Dec 2016) Origin message was: ------------------ - cc_frm_scrollbar: fix offsets; use OFFSET defines --- src/gui/components/cc_frm_scrollbar.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index b0ca25fca..ad2189689 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -76,11 +76,13 @@ void CComponentsScrollBar::initVarSbForm(const int& count) cc_item_type = CC_ITEMTYPE_FRM_SCROLLBAR; fr_thickness = 0; - append_x_offset = 0; - append_y_offset = 2; + append_x_offset = OFFSET_INNER_MIN; + append_y_offset = OFFSET_INNER_MIN; - sb_up_obj = sb_down_obj = NULL; + sb_up_obj = NULL; + sb_down_obj = NULL; sb_segments_obj = NULL; + setCorner(RADIUS_MIN, CORNER_ALL); sb_up_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_UP) ; @@ -130,19 +132,19 @@ void CComponentsScrollBar::initBottomNaviIcon() void CComponentsScrollBar::initSegments() { //init dimensions for segments - int w_seg = width - 4*fr_thickness; -//never read int h_seg = height - (sb_segments_count-1)*append_y_offset; + int w_seg = width - 2*fr_thickness - 2*append_x_offset; + if (w_seg < 0) + w_seg = 0; //calculate height of segment container - int h_seg_obj = height - 2*sb_up_obj->getHeight() - 3*append_y_offset; - if(h_seg_obj < 0) + int h_seg_obj = height - 2*fr_thickness - 2*sb_up_obj->getHeight() - 2*append_y_offset; + if (h_seg_obj < 0) h_seg_obj = 0; //init segment container if (sb_segments_obj == NULL){ sb_segments_obj = new CComponentsFrmChain(CC_CENTERED, CC_APPEND, w_seg, h_seg_obj, NULL, CC_DIR_Y, this, false); - sb_segments_obj->setFrameThickness(0/*,0*/); - sb_segments_obj->setAppendOffset(0, 3); + sb_segments_obj->setFrameThickness(0); }else sb_segments_obj->setDimensionsAll(CC_CENTERED, CC_APPEND, w_seg, h_seg_obj); @@ -153,9 +155,9 @@ void CComponentsScrollBar::initSegments() sb_segments_obj->clear(); //set y position of 1st segment and set height of segments - int y_seg = 1+ append_y_offset; + int y_seg = append_y_offset; int h_seg = sb_segments_obj->getHeight()/sb_segments_count - append_y_offset; - if(h_seg < 0) + if (h_seg < 0) h_seg = 0; //create and add segments to segment container From e6b0d8104d769b6b99d385ed225cd197967e2d8a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 16 Dec 2016 20:32:09 +0100 Subject: [PATCH 09/11] locale: right names for timerlist repeat-hints Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4fc60600f78680cf8a1ccd68a005832ec7abf383 Author: vanhofen Date: 2016-12-16 (Fri, 16 Dec 2016) Origin message was: ------------------ - locale: right names for timerlist repeat-hints --- data/locale/deutsch.locale | 4 ++-- data/locale/english.locale | 4 ++-- src/gui/timerlist.cpp | 4 ++-- src/system/locals.h | 4 ++-- src/system/locals_intern.h | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index b7c469fdc..bd849d2be 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2371,8 +2371,8 @@ timerlist.repeat.wednesday Mi timerlist.repeat.weekdays An Wochentagen timerlist.repeat.weekly wöchentlich timerlist.repeatcount Wiederholungen -timerlist.repeatcount.help1 Anzahl der Timerausführungen -timerlist.repeatcount.help2 0 für unbegrenzte Anzahl +timerlist.repeatcount.hint_1 Anzahl der Timerausführungen +timerlist.repeatcount.hint_2 0 für unbegrenzte Anzahl timerlist.save Timer speichern timerlist.standby Aktion timerlist.standby.off Aufwachen aus Standby diff --git a/data/locale/english.locale b/data/locale/english.locale index ac562fa40..bcb7e1e8e 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2371,8 +2371,8 @@ timerlist.repeat.wednesday We timerlist.repeat.weekdays on weekdays timerlist.repeat.weekly weekly timerlist.repeatcount repeats -timerlist.repeatcount.help1 amount of timer repeats -timerlist.repeatcount.help2 0 for unlimited repeats +timerlist.repeatcount.hint_1 Amount of timer repeats +timerlist.repeatcount.hint_2 0 for unlimited repeats timerlist.save Save timer timerlist.standby Action timerlist.standby.off Leave standby diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 55902b379..0de73459c 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1591,7 +1591,7 @@ int CTimerList::modifyTimer() timer->eventRepeat = (CTimerd::CTimerEventRepeat)(((int)timer->eventRepeat) & 0x1FF); CStringInput timerSettings_weekdays(LOCALE_TIMERLIST_WEEKDAYS, &m_weekdaysStr, 7, LOCALE_TIMERLIST_WEEKDAYS_HINT_1, LOCALE_TIMERLIST_WEEKDAYS_HINT_2, "-X"); CMenuForwarder *m4 = new CMenuForwarder(LOCALE_TIMERLIST_WEEKDAYS, ((int)timer->eventRepeat) >= (int)CTimerd::TIMERREPEAT_WEEKDAYS, m_weekdaysStr, &timerSettings_weekdays ); - CIntInput timerSettings_repeatCount(LOCALE_TIMERLIST_REPEATCOUNT, (int*)&timer->repeatCount,3, LOCALE_TIMERLIST_REPEATCOUNT_HELP1, LOCALE_TIMERLIST_REPEATCOUNT_HELP2); + CIntInput timerSettings_repeatCount(LOCALE_TIMERLIST_REPEATCOUNT, (int*)&timer->repeatCount,3, LOCALE_TIMERLIST_REPEATCOUNT_HINT_1, LOCALE_TIMERLIST_REPEATCOUNT_HINT_2); CMenuForwarder *m5 = new CMenuForwarder(LOCALE_TIMERLIST_REPEATCOUNT, timer->eventRepeat != (int)CTimerd::TIMERREPEAT_ONCE ,timerSettings_repeatCount.getValue() , &timerSettings_repeatCount); @@ -1701,7 +1701,7 @@ int CTimerList::newTimer() CStringInput timerSettings_weekdays(LOCALE_TIMERLIST_WEEKDAYS, &m_weekdaysStr, 7, LOCALE_TIMERLIST_WEEKDAYS_HINT_1, LOCALE_TIMERLIST_WEEKDAYS_HINT_2, "-X"); CMenuForwarder *m4 = new CMenuForwarder(LOCALE_TIMERLIST_WEEKDAYS, false, m_weekdaysStr, &timerSettings_weekdays); - CIntInput timerSettings_repeatCount(LOCALE_TIMERLIST_REPEATCOUNT, (int*)&timerNew.repeatCount,3, LOCALE_TIMERLIST_REPEATCOUNT_HELP1, LOCALE_TIMERLIST_REPEATCOUNT_HELP2); + CIntInput timerSettings_repeatCount(LOCALE_TIMERLIST_REPEATCOUNT, (int*)&timerNew.repeatCount,3, LOCALE_TIMERLIST_REPEATCOUNT_HINT_1, LOCALE_TIMERLIST_REPEATCOUNT_HINT_2); CMenuForwarder *m5 = new CMenuForwarder(LOCALE_TIMERLIST_REPEATCOUNT, false,timerSettings_repeatCount.getValue() , &timerSettings_repeatCount); CTimerListRepeatNotifier notifier((int *)&timerNew.eventRepeat,m4,m5, &m_weekdaysStr); diff --git a/src/system/locals.h b/src/system/locals.h index d668034cd..a1dfd99a8 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2398,8 +2398,8 @@ typedef enum LOCALE_TIMERLIST_REPEAT_WEEKDAYS, LOCALE_TIMERLIST_REPEAT_WEEKLY, LOCALE_TIMERLIST_REPEATCOUNT, - LOCALE_TIMERLIST_REPEATCOUNT_HELP1, - LOCALE_TIMERLIST_REPEATCOUNT_HELP2, + LOCALE_TIMERLIST_REPEATCOUNT_HINT_1, + LOCALE_TIMERLIST_REPEATCOUNT_HINT_2, LOCALE_TIMERLIST_SAVE, LOCALE_TIMERLIST_STANDBY, LOCALE_TIMERLIST_STANDBY_OFF, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index e4bc718f4..1d61f6deb 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2398,8 +2398,8 @@ const char * locale_real_names[] = "timerlist.repeat.weekdays", "timerlist.repeat.weekly", "timerlist.repeatcount", - "timerlist.repeatcount.help1", - "timerlist.repeatcount.help2", + "timerlist.repeatcount.hint_1", + "timerlist.repeatcount.hint_2", "timerlist.save", "timerlist.standby", "timerlist.standby.off", From 454aaa159d84bf3386ce0872e01725fcbe0897c1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 16 Dec 2016 22:23:38 +0100 Subject: [PATCH 10/11] moviebrowser: fix crash; disable non-existing movie directories Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/615c4f360a6933cef5cfc5efd68b91e6006c4b3b Author: vanhofen Date: 2016-12-16 (Fri, 16 Dec 2016) Origin message was: ------------------ - moviebrowser: fix crash; disable non-existing movie directories --- src/gui/moviebrowser/mb.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 169ce1600..cc9204b86 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2715,24 +2715,37 @@ bool CMovieBrowser::onSortMovieInfoHandleList(std::vector& handl void CMovieBrowser::updateDir(void) { + struct stat info; + m_dir.clear(); + #if 0 // check if there is a movie dir and if we should use it if (g_settings.network_nfs_moviedir[0] != 0) { + if (!(stat(g_settings.network_nfs_moviedir.c_str(), &info) == 0 && S_ISDIR(info.st_mode))) + m_settings.storageDirMovieUsed = false; + std::string name = g_settings.network_nfs_moviedir; addDir(name,&m_settings.storageDirMovieUsed); } #endif + // check if there is a record dir and if we should use it if (!g_settings.network_nfs_recordingdir.empty()) { + if (!(stat(g_settings.network_nfs_recordingdir.c_str(), &info) == 0 && S_ISDIR(info.st_mode))) + m_settings.storageDirRecUsed = false; + addDir(g_settings.network_nfs_recordingdir, &m_settings.storageDirRecUsed); cHddStat::getInstance()->statOnce(); } for (int i = 0; i < MB_MAX_DIRS; i++) { + if (!(stat(m_settings.storageDir[i].c_str(), &info) == 0 && S_ISDIR(info.st_mode))) + m_settings.storageDirUsed[i] = false; + if (!m_settings.storageDir[i].empty()) addDir(m_settings.storageDir[i],&m_settings.storageDirUsed[i]); } From 6dab66f33c24a92c760a08b6b8f52bcb489638ef Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 16 Dec 2016 23:13:43 +0100 Subject: [PATCH 11/11] moviebrowser: reset filter at startup if filter-directory not exists ... to avoid a wrong display in footer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d5134803547ec6da1f23664e54095012814e968d Author: vanhofen Date: 2016-12-16 (Fri, 16 Dec 2016) Origin message was: ------------------ - moviebrowser: reset filter at startup if filter-directory not exists ... to avoid a wrong display in footer --- src/gui/moviebrowser/mb.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index cc9204b86..6ce73c0f8 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -610,9 +610,21 @@ bool CMovieBrowser::loadSettings(MB_SETTINGS* settings) settings->sorting.direction = (MB_DIRECTION)configfile.getInt32("mb_sorting_direction", MB_DIRECTION_UP); settings->filter.item = (MB_INFO_ITEM)configfile.getInt32("mb_filter_item", MB_INFO_MAX_NUMBER); - settings->filter.optionString = configfile.getString("mb_filter_optionString", ""); + settings->filter.optionString = configfile.getString("mb_filter_optionString", g_Locale->getText(LOCALE_OPTIONS_OFF)); settings->filter.optionVar = configfile.getInt32("mb_filter_optionVar", 0); + if (settings->filter.item == MB_INFO_FILEPATH) + { + struct stat info; + if (!(stat(settings->filter.optionString.c_str(), &info) == 0 && S_ISDIR(info.st_mode))) + { + //reset filter if directory not exists + settings->filter.item = MB_INFO_MAX_NUMBER; + settings->filter.optionString = g_Locale->getText(LOCALE_OPTIONS_OFF); + settings->filter.optionVar = 0; + } + } + settings->parentalLockAge = (MI_PARENTAL_LOCKAGE)configfile.getInt32("mb_parentalLockAge", MI_PARENTAL_OVER18); settings->parentalLock = (MB_PARENTAL_LOCK)configfile.getInt32("mb_parentalLock", MB_PARENTAL_LOCK_ACTIVE);