diff --git a/TODO b/TODO index 82724be3..5a780012 100644 --- a/TODO +++ b/TODO @@ -3,7 +3,7 @@ here's a short list of things i think we can do in the short to medium term to make it a first-class terminal: [X] evas textgrid needs creating and to be used -[ ] underline and strikethrough need supporting at termio level +[X] underline and strikethrough need supporting at termio level [ ] blink and blink2 attributes need to be supported [ ] improve terminal emulation handling (i know it doesn't handle gfx chars and it definitely has an incomplete escape handling core - @@ -15,7 +15,7 @@ make it a first-class terminal: then maybe not according to convention) [ ] general input mode handling improvements (keypad, other key input, mousereporting etc.) -[ ] save of config after options changes (option checkbox for +[X] save of config after options changes (option checkbox for temporary local only changes) [ ] selection of themes [ ] selection of background "wallpapers" (and support them at all - diff --git a/src/bin/config.c b/src/bin/config.c index d389ef96..b78348a5 100644 --- a/src/bin/config.c +++ b/src/bin/config.c @@ -5,6 +5,7 @@ static Eet_Data_Descriptor *edd_base = NULL; Config *config = NULL; +Eina_Bool config_tmp = EINA_FALSE; static const char * _homedir(void) @@ -105,7 +106,8 @@ config_save(void) Eet_File *ef; char buf[4096], buf2[4096], *home; int ok; - + + if (config_tmp) return; home = (char *)_homedir(); snprintf(buf, sizeof(buf), "%s/.terminology/config/standard", home); ecore_file_mkpath(buf); diff --git a/src/bin/config.h b/src/bin/config.h index d1c1a3c8..61424c5a 100644 --- a/src/bin/config.h +++ b/src/bin/config.h @@ -18,6 +18,7 @@ struct _Config }; extern Config *config; +extern Eina_Bool config_tmp; void config_init(void); void config_shutdown(void); diff --git a/src/bin/main.c b/src/bin/main.c index 17b845b1..559715ec 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -163,17 +163,20 @@ elm_main(int argc, char **argv) } else config->theme = eina_stringshare_add(argv[i]); + config_tmp = EINA_TRUE; } else if ((!strcmp(argv[i], "-b")) && (i < (argc - 1))) { i++; if (config->background) eina_stringshare_del(config->background); config->background = eina_stringshare_add(argv[i]); + config_tmp = EINA_TRUE; } else if ((!strcmp(argv[i], "-m")) && (i < (argc - 1))) { i++; config->mute = atoi(argv[i]); + config_tmp = EINA_TRUE; } else if ((!strcmp(argv[i], "-vm")) && (i < (argc - 1))) { @@ -182,6 +185,7 @@ elm_main(int argc, char **argv) else if (!strcmp(argv[i], "gstreamer")) config->vidmod = 1; else if (!strcmp(argv[i], "xine")) config->vidmod = 2; else if (!strcmp(argv[i], "generic")) config->vidmod = 3; + config_tmp = EINA_TRUE; } } diff --git a/src/bin/options.c b/src/bin/options.c index 9bef6385..a394b587 100644 --- a/src/bin/options.c +++ b/src/bin/options.c @@ -3,8 +3,10 @@ #include "options_font.h" #include "options_behavior.h" #include "options_video.h" +#include "config.h" -static Evas_Object *op_frame, *op_box = NULL, *op_toolbar = NULL, *op_opbox = NULL; +static Evas_Object *op_frame, *op_box = NULL, *op_toolbar = NULL, + *op_opbox = NULL, *op_tbox = NULL, *op_temp = NULL; static Eina_Bool op_out = EINA_FALSE; static void @@ -42,6 +44,12 @@ _cb_op_behavior(void *data, Evas_Object *obj, void *event) options_behavior(op_opbox, data); } +static void +_cb_op_tmp_chg(void *data, Evas_Object *obj, void *event) +{ + config_tmp = elm_check_state_get(obj); +} + void options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term) { @@ -67,7 +75,15 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term) elm_box_pack_end(op_box, o); evas_object_show(o); + op_tbox = o = elm_box_add(win); + evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_pack_end(op_box, o); + evas_object_show(o); + op_toolbar = o = elm_toolbar_add(win); + evas_object_size_hint_weight_set(o, 0.0, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(o, 0.5, 0.0); elm_toolbar_horizontal_set(o, EINA_FALSE); elm_object_style_set(o, "item_horizontal"); evas_object_size_hint_weight_set(o, 0.0, 0.0); @@ -89,12 +105,21 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term) it_bh = elm_toolbar_item_append(o, "system-run", "Behavior", _cb_op_behavior, term); - elm_box_pack_end(op_box, o); + elm_box_pack_end(op_tbox, o); evas_object_show(o); elm_toolbar_item_selected_set(it_fn, EINA_TRUE); + + op_temp = o = elm_check_add(win); + evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 1.0); + elm_object_text_set(o, "Temporary"); + elm_check_state_set(o, config_tmp); + elm_box_pack_end(op_tbox, o); + evas_object_show(o); + evas_object_smart_callback_add(o, "changed", _cb_op_tmp_chg, NULL); - evas_smart_objects_calculate(evas_object_evas_get(win)); +// evas_smart_objects_calculate(evas_object_evas_get(win)); edje_object_part_swallow(bg, "terminology.options", op_frame); evas_object_show(o); }