diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index c873db44a..bf75a93c6 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2102,11 +2102,11 @@ remotebox_channel_na Kanal auf Remote-Box nicht verfügbar remotebox_del löschen remotebox_head Remote-Boxen remotebox_mod bearbeiten -remotebox_user Benutzer remotebox_pass Passwort remotebox_port Port remotebox_rbaddr Adresse remotebox_rbname Anzeigename +remotebox_user Benutzer reset_all Werkseinstellungen und Reboot reset_channels Lösche Kanäle reset_confirm Sind Sie sich sicher? diff --git a/data/locale/english.locale b/data/locale/english.locale index 9fc0c5efb..2a7eff1ff 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2102,11 +2102,11 @@ remotebox_channel_na Channel not available on Remote-Box remotebox_del delete remotebox_head Remote-Boxes remotebox_mod modify -remotebox_user User remotebox_pass Password remotebox_port Port remotebox_rbaddr Address remotebox_rbname Screenname +remotebox_user User reset_all Factory reset and reboot reset_channels Delete all channels reset_confirm Are you sure ? diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 8a5f85d59..e14f12de4 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -922,6 +922,7 @@ public: while (value.length() < 3) value = " " + value; CStringInput input(name, &value, 3, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2, "0123456789 ", this); + input.forceSaveScreen(true); return input.exec(parent, action_Key); } diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 556a5030b..60b6ce892 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -298,10 +298,15 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) std::string rbname,rbaddress,user,pass = ""; std::string port = "80"; CKeyboardInput remotebox_name(LOCALE_REMOTEBOX_RBNAME , &rbname, 25); + remotebox_name.forceSaveScreen(true); CKeyboardInput remotebox_address(LOCALE_REMOTEBOX_RBADDR , &rbaddress, 50); + remotebox_address.forceSaveScreen(true); CStringInput remotebox_port(LOCALE_REMOTEBOX_PORT , &port, 5); + remotebox_port.forceSaveScreen(true); CKeyboardInput remotebox_user(LOCALE_REMOTEBOX_USER , &user, 15); + remotebox_user.forceSaveScreen(true); CKeyboardInput remotebox_pass(LOCALE_REMOTEBOX_PASS , &pass, 15); + remotebox_pass.forceSaveScreen(true); CMenuWidget * rbsetup = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_RBNAME, true, rbname, &remotebox_name)); rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_RBADDR, true, rbaddress, &remotebox_address)); @@ -350,10 +355,15 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) std::advance(it,bselected-item_offset); std::string port = to_string(it->port); CKeyboardInput remotebox_name(LOCALE_REMOTEBOX_RBNAME , &it->rbname, 25); + remotebox_name.forceSaveScreen(true); CKeyboardInput remotebox_address(LOCALE_REMOTEBOX_RBADDR , &it->rbaddress, 50); + remotebox_address.forceSaveScreen(true); CStringInput remotebox_port(LOCALE_REMOTEBOX_PORT , &port, 5); + remotebox_port.forceSaveScreen(true); CKeyboardInput remotebox_user(LOCALE_REMOTEBOX_USER , &it->user, 15); + remotebox_user.forceSaveScreen(true); CKeyboardInput remotebox_pass(LOCALE_REMOTEBOX_PASS , &it->pass, 15); + remotebox_pass.forceSaveScreen(true); CMenuWidget * rbsetup = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_RBNAME, true, it->rbname, &remotebox_name)); rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_RBADDR, true, it->rbaddress, &remotebox_address)); @@ -684,6 +694,7 @@ void CTimerList::RemoteBoxSelect() for (std::vector::iterator it = g_settings.timer_remotebox_ip.begin(); it != g_settings.timer_remotebox_ip.end(); ++it) m->addItem(new CMenuForwarder(it->rbname, true, NULL, selector, to_string(std::distance(g_settings.timer_remotebox_ip.begin(),it)).c_str())); + m->enableSaveScreen(true); m->exec(NULL, ""); delete selector; diff --git a/src/gui/widget/keyboard_input.cpp b/src/gui/widget/keyboard_input.cpp index 72cd73dfc..a7f574cfe 100644 --- a/src/gui/widget/keyboard_input.cpp +++ b/src/gui/widget/keyboard_input.cpp @@ -199,6 +199,8 @@ CKeyboardInput::CKeyboardInput(const neutrino_locale_t Name, std::string* Value, caps = 0; srow = scol = 0; focus = FOCUS_STRING; + force_saveScreen = false; + pixBuf = NULL; } CKeyboardInput::CKeyboardInput(const std::string &Name, std::string *Value, int Size, CChangeObserver* Observ, const char * const Icon, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2) @@ -221,6 +223,8 @@ CKeyboardInput::CKeyboardInput(const std::string &Name, std::string *Value, int caps = 0; srow = scol = 0; focus = FOCUS_STRING; + force_saveScreen = false; + pixBuf = NULL; } CKeyboardInput::CKeyboardInput(const std::string &Name, std::string *Value, int Size, CChangeObserver* Observ, const char * const Icon, std::string HintText_1, std::string HintText_2) @@ -243,6 +247,8 @@ CKeyboardInput::CKeyboardInput(const std::string &Name, std::string *Value, int caps = 0; srow = scol = 0; focus = FOCUS_STRING; + force_saveScreen = false; + pixBuf = NULL; } CKeyboardInput::~CKeyboardInput() @@ -515,6 +521,15 @@ std::string &CKeyboardInput::getValue(void) return *valueString; } +void CKeyboardInput::forceSaveScreen(bool enable) +{ + force_saveScreen = enable; + if (!enable && pixBuf) { + delete[] pixBuf; + pixBuf = NULL; + } +} + int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) { neutrino_msg_t msg; @@ -528,11 +543,12 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) std::string oldval = *valueString; - fb_pixel_t * pixbuf = NULL; - if (!parent) { - pixbuf = new fb_pixel_t[(width + OFFSET_SHADOW) * (height + OFFSET_SHADOW)]; - if (pixbuf) - frameBuffer->SaveScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixbuf); + if (pixBuf) + delete[] pixBuf; + if (!parent || force_saveScreen) { + pixBuf = new fb_pixel_t[(width + OFFSET_SHADOW) * (height + OFFSET_SHADOW)]; + if (pixBuf) + frameBuffer->SaveScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixBuf); } paint(); @@ -624,10 +640,12 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) } } - if (pixbuf) + if (pixBuf) { - frameBuffer->RestoreScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixbuf); - delete[] pixbuf; + frameBuffer->RestoreScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixBuf); + delete[] pixBuf; + pixBuf = NULL; + frameBuffer->blit(); } else hide(); diff --git a/src/gui/widget/keyboard_input.h b/src/gui/widget/keyboard_input.h index 009934b4a..1003e7f39 100644 --- a/src/gui/widget/keyboard_input.h +++ b/src/gui/widget/keyboard_input.h @@ -101,6 +101,8 @@ class CKeyboardInput : public CMenuTarget int selected; bool changed; CChangeObserver * observ; + bool force_saveScreen; + fb_pixel_t *pixBuf; virtual void init(); @@ -133,6 +135,8 @@ class CKeyboardInput : public CMenuTarget void hide(); int exec( CMenuTarget* parent, const std::string & actionKey ); virtual std::string &getValue(void); + + void forceSaveScreen(bool enable); }; #endif diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index b47a99c4e..8fa986268 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -150,6 +150,8 @@ void CStringInput::init() y = getScreenStartY(height); selected = 0; smstimer = 0; + force_saveScreen = false; + pixBuf = NULL; } void CStringInput::NormalKeyPressed(const neutrino_msg_t key) @@ -377,6 +379,15 @@ std::string &CStringInput::getValue(void) return *valueString; } +void CStringInput::forceSaveScreen(bool enable) +{ + force_saveScreen = enable; + if (!enable && pixBuf) { + delete[] pixBuf; + pixBuf = NULL; + } +} + int CStringInput::exec( CMenuTarget* parent, const std::string & ) { neutrino_msg_t msg; @@ -392,11 +403,12 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) if (size > (int) valueString->length()) valueString->append(size - valueString->length(), ' '); - fb_pixel_t * pixbuf = NULL; - if (!parent) { - pixbuf = new fb_pixel_t[(width + OFFSET_SHADOW) * (height + OFFSET_SHADOW)]; - if (pixbuf) - frameBuffer->SaveScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixbuf); + if (pixBuf) + delete[] pixBuf; + if (!parent || force_saveScreen) { + pixBuf = new fb_pixel_t[(width + OFFSET_SHADOW) * (height + OFFSET_SHADOW)]; + if (pixBuf) + frameBuffer->SaveScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixBuf); } paint(); @@ -517,10 +529,11 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) } } - if (pixbuf) + if (pixBuf) { - frameBuffer->RestoreScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixbuf); - delete[] pixbuf;//Mismatching allocation and deallocation: pixbuf + frameBuffer->RestoreScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixBuf); + delete[] pixBuf; + pixBuf = NULL; frameBuffer->blit(); } else hide(); diff --git a/src/gui/widget/stringinput.h b/src/gui/widget/stringinput.h index 2a8d9bcd4..d435a7f84 100644 --- a/src/gui/widget/stringinput.h +++ b/src/gui/widget/stringinput.h @@ -61,6 +61,8 @@ class CStringInput : public CMenuTarget int size; int selected; CChangeObserver * observ; + bool force_saveScreen; + fb_pixel_t *pixBuf; virtual void init(); @@ -91,6 +93,8 @@ class CStringInput : public CMenuTarget int exec( CMenuTarget* parent, const std::string & actionKey ); void setMinMax(const int min_value, const int max_value); virtual std::string &getValue(void); + + void forceSaveScreen(bool enable); }; class CStringInputSMS : public CStringInput diff --git a/src/system/locals.h b/src/system/locals.h index 7e3f48afa..8a20d4e61 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2129,11 +2129,11 @@ typedef enum LOCALE_REMOTEBOX_DEL, LOCALE_REMOTEBOX_HEAD, LOCALE_REMOTEBOX_MOD, - LOCALE_REMOTEBOX_USER, LOCALE_REMOTEBOX_PASS, LOCALE_REMOTEBOX_PORT, LOCALE_REMOTEBOX_RBADDR, LOCALE_REMOTEBOX_RBNAME, + LOCALE_REMOTEBOX_USER, LOCALE_RESET_ALL, LOCALE_RESET_CHANNELS, LOCALE_RESET_CONFIRM, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 66660b194..8ed3606a2 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2129,11 +2129,11 @@ const char * locale_real_names[] = "remotebox_del", "remotebox_head", "remotebox_mod", - "remotebox_user", "remotebox_pass", "remotebox_port", "remotebox_rbaddr", "remotebox_rbname", + "remotebox_user", "reset_all", "reset_channels", "reset_confirm",