X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=src%2Fapp-config.c;h=1ac28af2ec23a7b560901b54d72e1345628be6cf;hb=c2ef73ab945d0c668e000aef58a1ad227d8910c1;hp=6d65df9baa1215978158508a269ddecd61c575c8;hpb=1aa4da2dd777823a4aa5f40cf8cf7b1c09401a34;p=emu8051.git diff --git a/src/app-config.c b/src/app-config.c index 6d65df9..1ac28af 100644 --- a/src/app-config.c +++ b/src/app-config.c @@ -55,7 +55,13 @@ app_config_init(void) cfg->win_height = 480; cfg->hpane_pos = 100; cfg->vpane_pos = 200; - cfg->vpane_mem_pos = 200; + cfg->main_pane_pos = 200; + + /* View menu options */ + cfg->layout = UI_LAYOUT1; + cfg->view_int_memory = 1; + cfg->view_ext_memory = 1; + cfg->bits_per_row = 16; /* 8 or 16 */ } static int @@ -86,8 +92,21 @@ app_config_load_from_key_file(GKeyFile *kf) app_config_key_file_get_int(kf, "ui", "win_height", &cfg->win_height); app_config_key_file_get_int(kf, "ui", "hpane_pos", &cfg->hpane_pos); app_config_key_file_get_int(kf, "ui", "vpane_pos", &cfg->vpane_pos); - app_config_key_file_get_int(kf, "ui", "vpane_mem_pos", - &cfg->vpane_mem_pos); + app_config_key_file_get_int(kf, "ui", "main_pane_pos", + &cfg->main_pane_pos); + + /* View */ + app_config_key_file_get_int(kf, "view", "layout", &cfg->layout); + if ((cfg->layout != UI_LAYOUT1) && (cfg->layout != UI_LAYOUT2)) { + log_err("Invalid layout, defaulting to layout 1"); + cfg->layout = UI_LAYOUT1; + } + app_config_key_file_get_int(kf, "view", "int_memory", + &cfg->view_int_memory); + app_config_key_file_get_int(kf, "view", "ext_memory", + &cfg->view_ext_memory); + app_config_key_file_get_int(kf, "view", "bits_per_row", + &cfg->bits_per_row); } static char * @@ -168,8 +187,17 @@ app_config_save(void) g_string_append_printf(buf, "win_height=%d\n", cfg->win_height); g_string_append_printf(buf, "hpane_pos=%d\n", cfg->hpane_pos); g_string_append_printf(buf, "vpane_pos=%d\n", cfg->vpane_pos); - g_string_append_printf(buf, "vpane_mem_pos=%d\n", - cfg->vpane_mem_pos); + g_string_append_printf(buf, "main_pane_pos=%d\n", + cfg->main_pane_pos); + + g_string_append(buf, "\n[view]\n"); + g_string_append_printf(buf, "layout=%d\n", cfg->layout); + g_string_append_printf(buf, "int_memory=%d\n", + cfg->view_int_memory); + g_string_append_printf(buf, "ext_memory=%d\n", + cfg->view_ext_memory); + g_string_append_printf(buf, "bits_per_row=%d\n", + cfg->bits_per_row); file_path = app_config_get_file_path();