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 db27e8928a..6b16218523 100644
--- a/apps/plugins/text_viewer/tv_settings.c
+++ b/apps/plugins/text_viewer/tv_settings.c
@@ -49,7 +49,8 @@
49 * horizontal_scrollbar 1 49 * horizontal_scrollbar 1
50 * horizontal_scroll_mode 1 50 * horizontal_scroll_mode 1
51 * narrow_mode 1 51 * narrow_mode 1
52 * (reserved) 13 52 * indent_spaces 1
53 * (reserved) 12
53 * font name MAX_PATH 54 * font name MAX_PATH
54 */ 55 */
55 56
@@ -57,7 +58,7 @@
57#define TV_GLOBAL_SETTINGS_FILE VIEWERS_DIR "/tv_global.dat" 58#define TV_GLOBAL_SETTINGS_FILE VIEWERS_DIR "/tv_global.dat"
58 59
59#define TV_GLOBAL_SETTINGS_HEADER "\x54\x56\x47\x53" /* "TVGS" */ 60#define TV_GLOBAL_SETTINGS_HEADER "\x54\x56\x47\x53" /* "TVGS" */
60#define TV_GLOBAL_SETTINGS_VERSION 0x36 61#define TV_GLOBAL_SETTINGS_VERSION 0x37
61#define TV_GLOBAL_SETTINGS_HEADER_SIZE 5 62#define TV_GLOBAL_SETTINGS_HEADER_SIZE 5
62#define TV_GLOBAL_SETTINGS_FIRST_VERSION 0x31 63#define TV_GLOBAL_SETTINGS_FIRST_VERSION 0x31
63 64
@@ -90,7 +91,8 @@
90 * horizontal_scrollbar 1 91 * horizontal_scrollbar 1
91 * horizontal_scroll_mode 1 92 * horizontal_scroll_mode 1
92 * narrow_mode 1 93 * narrow_mode 1
93 * (reserved) 13 94 * indent_spaces 1
95 * (reserved) 12
94 * font name MAX_PATH 96 * font name MAX_PATH
95 * bookmark count 1 97 * bookmark count 1
96 * [1st bookmark] 98 * [1st bookmark]
@@ -112,7 +114,7 @@
112#define TV_SETTINGS_TMP_FILE VIEWERS_DIR "/tv_file.tmp" 114#define TV_SETTINGS_TMP_FILE VIEWERS_DIR "/tv_file.tmp"
113 115
114#define TV_SETTINGS_HEADER "\x54\x56\x53" /* "TVS" */ 116#define TV_SETTINGS_HEADER "\x54\x56\x53" /* "TVS" */
115#define TV_SETTINGS_VERSION 0x37 117#define TV_SETTINGS_VERSION 0x38
116#define TV_SETTINGS_HEADER_SIZE 4 118#define TV_SETTINGS_HEADER_SIZE 4
117#define TV_SETTINGS_FIRST_VERSION 0x32 119#define TV_SETTINGS_FIRST_VERSION 0x32
118 120
@@ -174,6 +176,11 @@ static bool tv_read_preferences(int pfd, int version, struct tv_preferences *pre
174 else 176 else
175 prefs->narrow_mode = NM_PAGE; 177 prefs->narrow_mode = NM_PAGE;
176 178
179 if (version > 5)
180 prefs->indent_spaces = *p++;
181 else
182 prefs->indent_spaces = 2;
183
177 rb->memcpy(prefs->font_name, buf + read_size - MAX_PATH, MAX_PATH); 184 rb->memcpy(prefs->font_name, buf + read_size - MAX_PATH, MAX_PATH);
178 185
179#ifdef HAVE_LCD_BITMAP 186#ifdef HAVE_LCD_BITMAP
@@ -204,6 +211,7 @@ static bool tv_write_preferences(int pfd, const struct tv_preferences *prefs)
204 *p++ = prefs->horizontal_scrollbar; 211 *p++ = prefs->horizontal_scrollbar;
205 *p++ = prefs->horizontal_scroll_mode; 212 *p++ = prefs->horizontal_scroll_mode;
206 *p++ = prefs->narrow_mode; 213 *p++ = prefs->narrow_mode;
214 *p++ = prefs->indent_spaces;
207 215
208 rb->memcpy(buf + 28, prefs->font_name, MAX_PATH); 216 rb->memcpy(buf + 28, prefs->font_name, MAX_PATH);
209 217