summaryrefslogtreecommitdiff
path: root/apps/plugins/text_viewer/tv_settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/text_viewer/tv_settings.c')
-rw-r--r--apps/plugins/text_viewer/tv_settings.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/plugins/text_viewer/tv_settings.c b/apps/plugins/text_viewer/tv_settings.c
index b537b3fb40..db27e8928a 100644
--- a/apps/plugins/text_viewer/tv_settings.c
+++ b/apps/plugins/text_viewer/tv_settings.c
@@ -48,7 +48,8 @@
48 * autoscroll_speed 1 48 * autoscroll_speed 1
49 * horizontal_scrollbar 1 49 * horizontal_scrollbar 1
50 * horizontal_scroll_mode 1 50 * horizontal_scroll_mode 1
51 * (reserved) 14 51 * narrow_mode 1
52 * (reserved) 13
52 * font name MAX_PATH 53 * font name MAX_PATH
53 */ 54 */
54 55
@@ -56,7 +57,7 @@
56#define TV_GLOBAL_SETTINGS_FILE VIEWERS_DIR "/tv_global.dat" 57#define TV_GLOBAL_SETTINGS_FILE VIEWERS_DIR "/tv_global.dat"
57 58
58#define TV_GLOBAL_SETTINGS_HEADER "\x54\x56\x47\x53" /* "TVGS" */ 59#define TV_GLOBAL_SETTINGS_HEADER "\x54\x56\x47\x53" /* "TVGS" */
59#define TV_GLOBAL_SETTINGS_VERSION 0x35 60#define TV_GLOBAL_SETTINGS_VERSION 0x36
60#define TV_GLOBAL_SETTINGS_HEADER_SIZE 5 61#define TV_GLOBAL_SETTINGS_HEADER_SIZE 5
61#define TV_GLOBAL_SETTINGS_FIRST_VERSION 0x31 62#define TV_GLOBAL_SETTINGS_FIRST_VERSION 0x31
62 63
@@ -88,7 +89,8 @@
88 * autoscroll_speed 1 89 * autoscroll_speed 1
89 * horizontal_scrollbar 1 90 * horizontal_scrollbar 1
90 * horizontal_scroll_mode 1 91 * horizontal_scroll_mode 1
91 * (reserved) 14 92 * narrow_mode 1
93 * (reserved) 13
92 * font name MAX_PATH 94 * font name MAX_PATH
93 * bookmark count 1 95 * bookmark count 1
94 * [1st bookmark] 96 * [1st bookmark]
@@ -110,7 +112,7 @@
110#define TV_SETTINGS_TMP_FILE VIEWERS_DIR "/tv_file.tmp" 112#define TV_SETTINGS_TMP_FILE VIEWERS_DIR "/tv_file.tmp"
111 113
112#define TV_SETTINGS_HEADER "\x54\x56\x53" /* "TVS" */ 114#define TV_SETTINGS_HEADER "\x54\x56\x53" /* "TVS" */
113#define TV_SETTINGS_VERSION 0x36 115#define TV_SETTINGS_VERSION 0x37
114#define TV_SETTINGS_HEADER_SIZE 4 116#define TV_SETTINGS_HEADER_SIZE 4
115#define TV_SETTINGS_FIRST_VERSION 0x32 117#define TV_SETTINGS_FIRST_VERSION 0x32
116 118
@@ -167,6 +169,11 @@ static bool tv_read_preferences(int pfd, int version, struct tv_preferences *pre
167 else 169 else
168 prefs->horizontal_scroll_mode = SCREEN; 170 prefs->horizontal_scroll_mode = SCREEN;
169 171
172 if (version > 4)
173 prefs->narrow_mode = *p++;
174 else
175 prefs->narrow_mode = NM_PAGE;
176
170 rb->memcpy(prefs->font_name, buf + read_size - MAX_PATH, MAX_PATH); 177 rb->memcpy(prefs->font_name, buf + read_size - MAX_PATH, MAX_PATH);
171 178
172#ifdef HAVE_LCD_BITMAP 179#ifdef HAVE_LCD_BITMAP
@@ -196,6 +203,7 @@ static bool tv_write_preferences(int pfd, const struct tv_preferences *prefs)
196 *p++ = prefs->autoscroll_speed; 203 *p++ = prefs->autoscroll_speed;
197 *p++ = prefs->horizontal_scrollbar; 204 *p++ = prefs->horizontal_scrollbar;
198 *p++ = prefs->horizontal_scroll_mode; 205 *p++ = prefs->horizontal_scroll_mode;
206 *p++ = prefs->narrow_mode;
199 207
200 rb->memcpy(buf + 28, prefs->font_name, MAX_PATH); 208 rb->memcpy(buf + 28, prefs->font_name, MAX_PATH);
201 209