|
|
@ -213,6 +213,7 @@ terminal_restore_defaults(void) |
|
|
|
termconf->debugbar = SCR_DEF_DEBUGBAR; |
|
|
|
termconf->debugbar = SCR_DEF_DEBUGBAR; |
|
|
|
termconf->allow_decopt_12 = SCR_DEF_DECOPT12; |
|
|
|
termconf->allow_decopt_12 = SCR_DEF_DECOPT12; |
|
|
|
termconf->ascii_debug = SCR_DEF_ASCIIDEBUG; |
|
|
|
termconf->ascii_debug = SCR_DEF_ASCIIDEBUG; |
|
|
|
|
|
|
|
termconf->backdrop[0] = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -247,6 +248,11 @@ terminal_apply_settings_noclear(void) |
|
|
|
termconf->ascii_debug = SCR_DEF_ASCIIDEBUG; |
|
|
|
termconf->ascii_debug = SCR_DEF_ASCIIDEBUG; |
|
|
|
changed = 1; |
|
|
|
changed = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (termconf->config_version < 4) { |
|
|
|
|
|
|
|
persist_dbg("termconf: Updating to version %d", 1); |
|
|
|
|
|
|
|
termconf->backdrop[0] = 0; |
|
|
|
|
|
|
|
changed = 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
termconf->config_version = TERMCONF_VERSION; |
|
|
|
termconf->config_version = TERMCONF_VERSION; |
|
|
|
|
|
|
|
|
|
|
@ -385,6 +391,7 @@ screen_reset_do(bool size, bool labels) |
|
|
|
|
|
|
|
|
|
|
|
if (labels) { |
|
|
|
if (labels) { |
|
|
|
strcpy(termconf_live.title, termconf->title); |
|
|
|
strcpy(termconf_live.title, termconf->title); |
|
|
|
|
|
|
|
strcpy(termconf_live.backdrop, termconf->backdrop); |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= TERM_BTN_COUNT; i++) { |
|
|
|
for (int i = 1; i <= TERM_BTN_COUNT; i++) { |
|
|
|
strcpy(termconf_live.btn[i], termconf->btn[i]); |
|
|
|
strcpy(termconf_live.btn[i], termconf->btn[i]); |
|
|
@ -394,7 +401,7 @@ screen_reset_do(bool size, bool labels) |
|
|
|
termconf_live.show_buttons = termconf->show_buttons; |
|
|
|
termconf_live.show_buttons = termconf->show_buttons; |
|
|
|
termconf_live.show_config_links = termconf->show_config_links; |
|
|
|
termconf_live.show_config_links = termconf->show_config_links; |
|
|
|
|
|
|
|
|
|
|
|
topics |= TOPIC_CHANGE_TITLE | TOPIC_CHANGE_BUTTONS; |
|
|
|
topics |= TOPIC_CHANGE_TITLE | TOPIC_CHANGE_BUTTONS | TOPIC_CHANGE_BACKDROP; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// initial values in the save buffer in case of receiving restore without storing first
|
|
|
|
// initial values in the save buffer in case of receiving restore without storing first
|
|
|
@ -1009,6 +1016,18 @@ screen_set_button_text(int num, const char *text) |
|
|
|
NOTIFY_DONE(TOPIC_CHANGE_BUTTONS); |
|
|
|
NOTIFY_DONE(TOPIC_CHANGE_BUTTONS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Helper function to set terminalbackdrop |
|
|
|
|
|
|
|
* @param url - url |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
void ICACHE_FLASH_ATTR |
|
|
|
|
|
|
|
screen_set_backdrop(const char *url) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
NOTIFY_LOCK(); |
|
|
|
|
|
|
|
strncpy(termconf_live.backdrop, url, TERM_BACKDROP_LEN); |
|
|
|
|
|
|
|
NOTIFY_DONE(TOPIC_CHANGE_BACKDROP); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Shift screen upwards |
|
|
|
* Shift screen upwards |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -1907,6 +1926,7 @@ screenSerializeToBuffer(char *buffer, size_t buf_len, ScreenNotifyTopics topics, |
|
|
|
#define TOPICMARK_BELL '!' |
|
|
|
#define TOPICMARK_BELL '!' |
|
|
|
#define TOPICMARK_CURSOR 'C' |
|
|
|
#define TOPICMARK_CURSOR 'C' |
|
|
|
#define TOPICMARK_SCREEN 'S' |
|
|
|
#define TOPICMARK_SCREEN 'S' |
|
|
|
|
|
|
|
#define TOPICMARK_BACKDROP 'W' |
|
|
|
|
|
|
|
|
|
|
|
if (ss == NULL) { |
|
|
|
if (ss == NULL) { |
|
|
|
// START!
|
|
|
|
// START!
|
|
|
@ -2025,9 +2045,11 @@ screenSerializeToBuffer(char *buffer, size_t buf_len, ScreenNotifyTopics topics, |
|
|
|
bufput_c(TOPICMARK_TITLE); |
|
|
|
bufput_c(TOPICMARK_TITLE); |
|
|
|
|
|
|
|
|
|
|
|
int len = (int) strlen(termconf_live.title); |
|
|
|
int len = (int) strlen(termconf_live.title); |
|
|
|
|
|
|
|
if (len > 0) { |
|
|
|
memcpy(bb, termconf_live.title, len); |
|
|
|
memcpy(bb, termconf_live.title, len); |
|
|
|
bb += len; |
|
|
|
bb += len; |
|
|
|
remain -= len; |
|
|
|
remain -= len; |
|
|
|
|
|
|
|
} |
|
|
|
bufput_c('\x01'); |
|
|
|
bufput_c('\x01'); |
|
|
|
END_TOPIC |
|
|
|
END_TOPIC |
|
|
|
|
|
|
|
|
|
|
@ -2038,13 +2060,27 @@ screenSerializeToBuffer(char *buffer, size_t buf_len, ScreenNotifyTopics topics, |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < TERM_BTN_COUNT; i++) { |
|
|
|
for (int i = 0; i < TERM_BTN_COUNT; i++) { |
|
|
|
int len = (int) strlen(termconf_live.btn[i]); |
|
|
|
int len = (int) strlen(termconf_live.btn[i]); |
|
|
|
|
|
|
|
if (len > 0) { |
|
|
|
memcpy(bb, termconf_live.btn[i], len); |
|
|
|
memcpy(bb, termconf_live.btn[i], len); |
|
|
|
bb += len; |
|
|
|
bb += len; |
|
|
|
remain -= len; |
|
|
|
remain -= len; |
|
|
|
|
|
|
|
} |
|
|
|
bufput_c('\x01'); |
|
|
|
bufput_c('\x01'); |
|
|
|
} |
|
|
|
} |
|
|
|
END_TOPIC |
|
|
|
END_TOPIC |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_TOPIC(TOPIC_CHANGE_BACKDROP, TERM_BACKDROP_LEN+1+1) |
|
|
|
|
|
|
|
bufput_c(TOPICMARK_BACKDROP); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int len = (int) strlen(termconf_live.backdrop); |
|
|
|
|
|
|
|
if (len > 0) { |
|
|
|
|
|
|
|
memcpy(bb, termconf_live.backdrop, len); |
|
|
|
|
|
|
|
bb += len; |
|
|
|
|
|
|
|
remain -= len; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
bufput_c('\x01'); |
|
|
|
|
|
|
|
END_TOPIC |
|
|
|
|
|
|
|
|
|
|
|
BEGIN_TOPIC(TOPIC_INTERNAL, 45) |
|
|
|
BEGIN_TOPIC(TOPIC_INTERNAL, 45) |
|
|
|
bufput_c(TOPICMARK_DEBUG); |
|
|
|
bufput_c(TOPICMARK_DEBUG); |
|
|
|
// General flags
|
|
|
|
// General flags
|
|
|
|