diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 703c5e67c..4dc677e93 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -192,7 +192,9 @@ void CSignalBar::initSBarName() void CSignalBar::Refresh() { //get current value from frontend - sb_signal = sb_frontend->getSignalStrength(); + sb_signal = 0; + if (sb_frontend) + sb_signal = sb_frontend->getSignalStrength(); //reinit items with current values initSBItems(); @@ -242,7 +244,9 @@ void CSignalBar::paint(bool do_save_bg) void CSignalNoiseRatioBar::Refresh() { //get current value from frontend - sb_signal = sb_frontend->getSignalNoiseRatio(); + sb_signal = 0; + if (sb_frontend) + sb_signal = sb_frontend->getSignalNoiseRatio(); //reinit items with current values initSBItems(); @@ -338,10 +342,8 @@ void CSignalBox::paintScale() void CSignalBox::paint(bool do_save_bg) { //paint frame and body - if (!is_painted){ - initSignalItems(); + if (!is_painted) paintForm(do_save_bg); - } //paint current signal value paintScale(); diff --git a/src/gui/components/cc_frm_signalbars.h b/src/gui/components/cc_frm_signalbars.h index 110060b66..b69516a6c 100644 --- a/src/gui/components/cc_frm_signalbars.h +++ b/src/gui/components/cc_frm_signalbars.h @@ -116,7 +116,7 @@ class CSignalBar : public CComponentsForm, public CCTextScreen CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sb_name = "SIG", CComponentsForm *parent = NULL); ///assigns the current used frontend, simplified a tuner object, see frontend_c.h - virtual void setFrontEnd(CFrontend *frontend_ref){sb_frontend = frontend_ref;}; + virtual void setFrontEnd(CFrontend *frontend_ref){if (sb_frontend != frontend_ref) {sb_lastsig = 0; sb_frontend = frontend_ref;}} ///assigns font for caption virtual void setTextFont(Font* font_text){sb_font = font_text;}; ///sets the caption color, see also property 'sb_caption_color' @@ -298,6 +298,9 @@ class CSignalBox : public CComponentsForm, public CCTextScreen ///returns the signal noise ratio object, type = CSignalNoiseRatioBar* CSignalNoiseRatioBar* getLabelObject(){return snrbar;}; + ///assigns the current used frontend, simplified a tuner object, see frontend_c.h + void setFrontEnd(CFrontend *frontend_ref){sbx_frontend = frontend_ref;} + ///sets the caption color of signalbars, see also property 'sbx_caption_color' void setTextColor(const fb_pixel_t& caption_color){ sbx_caption_color = caption_color;}; ///get caption color of signalbars, see also property 'sbx_caption_color'