diff --git a/.gitignore b/.gitignore index acef3ca..0486f03 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,8 @@ po/stamp-po /src/tests/test-suite.log /src/tests/check-results.xml +/elm_code/src/lib/*.eo.h +/elm_code/src/lib/*.eo.c /elm_code/src/bin/elm_code_test /elm_code/src/tests/elm_code_suite diff --git a/src/bin/edi_consolepanel.c b/src/bin/edi_consolepanel.c index f9d2501..5e178c4 100644 --- a/src/bin/edi_consolepanel.c +++ b/src/bin/edi_consolepanel.c @@ -83,19 +83,16 @@ static void _edi_consolepanel_parse_directory(const char *line) } static Eina_Bool -_edi_consolepanel_clicked_cb(void *data, Eo *obj EINA_UNUSED, +_edi_consolepanel_clicked_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info) { Edi_Path_Options *options; - Elm_Code *code; Elm_Code_Line *line; - const char *content; + const char *content, *parentdir; char *path, *terminated; int length; - code = (Elm_Code *)data; line = (Elm_Code_Line *)event_info; - content = elm_code_line_content_get(line, &length); terminated = malloc(sizeof(char) * (length + 1)); @@ -103,10 +100,8 @@ _edi_consolepanel_clicked_cb(void *data, Eo *obj EINA_UNUSED, if (_edi_consolepanel_startswith_location(terminated)) { - if (code == _edi_console_code) - path = _edi_consolepanel_extract_location(terminated, _current_dir, _edi_strlen_current_dir); - else - path = _edi_consolepanel_extract_location(terminated, _current_test_dir, strlen(_current_test_dir)); + parentdir = (const char *)line->data; + path = _edi_consolepanel_extract_location(terminated, parentdir, strlen(parentdir)); if (strstr(path, edi_project_get()) == path) { @@ -137,7 +132,7 @@ static void _edi_consolepanel_append_line_type(const char *line, Eina_Bool err) { _edi_consolepanel_parse_directory(line); - elm_code_file_line_append(_edi_console_code->file, line, strlen(line), err ? _EDI_CONSOLE_ERROR : NULL); + elm_code_file_line_append(_edi_console_code->file, line, strlen(line), err ? strdup(_current_dir) : NULL); _edi_test_line_callback(line); } @@ -256,7 +251,7 @@ _edi_test_line_parse_suite(const char *path) { _edi_test_count++; _edi_test_fail++; - elm_code_file_line_append(_edi_test_code->file, line->start, line->length, _EDI_SUITE_FAILED); + elm_code_file_line_append(_edi_test_code->file, line->start, line->length, strdup(_current_test_dir)); } else if (_edi_test_line_contains(line->start, line->length, "Running")) { diff --git a/src/bin/edi_filepanel.c b/src/bin/edi_filepanel.c index 322a5eb..54c3d81 100644 --- a/src/bin/edi_filepanel.c +++ b/src/bin/edi_filepanel.c @@ -8,6 +8,8 @@ #include #include +#include "Edi.h" + #include "edi_filepanel.h" #include "edi_private.h" @@ -341,24 +343,41 @@ _populate(Evas_Object *obj, else lreq->selected = NULL; + // FIXME re-enable the monitors once we have a less intrusive manner of refreshing the file tree /* TODO: keep track of monitors so they can be cleaned */ - //sd->monitor = - eio_monitor_add(path); + //sd->monitor = eio_monitor_add(path); //sd->current = eio_file_stat_ls(path, _ls_filter_cb, _ls_main_cb, _ls_done_cb, _ls_error_cb, lreq); } +static void +_file_listing_reload(const char *dir) +{ + elm_genlist_clear(list); + _populate(list, dir, NULL, NULL); +} -void _file_listing_updated(void *data, int type EINA_UNUSED, void *event EINA_UNUSED) +static void +_file_listing_updated(void *data, int type EINA_UNUSED, void *event EINA_UNUSED) { const char *dir; dir = (const char *)data; DBG("File created in %s\n", dir); - elm_genlist_clear(list); - _populate(list, dir, NULL, NULL); + _file_listing_reload(dir); +} + +void +_edi_filepanel_reload() +{ + char *dir; + + dir = realpath(edi_project_get(), NULL); + _file_listing_reload(dir); + + free(dir); } void diff --git a/src/bin/edi_main.c b/src/bin/edi_main.c index d7a8031..5941c0b 100644 --- a/src/bin/edi_main.c +++ b/src/bin/edi_main.c @@ -450,6 +450,7 @@ _tb_new_create_cb(void *data, path = edi_project_file_path_get(name); fclose(fopen(path, "w")); + _edi_filepanel_reload(); edi_mainview_open_path(eina_stringshare_add(path)); evas_object_del(_edi_new_popup); diff --git a/src/bin/edi_private.h b/src/bin/edi_private.h index 4d82d3f..8ab1bb1 100644 --- a/src/bin/edi_private.h +++ b/src/bin/edi_private.h @@ -33,4 +33,7 @@ Evas_Object *edi_open(const char *path); void edi_close(); +// TODO remove this once our filepanel is updating gracefully +void _edi_filepanel_reload(); + #endif diff --git a/src/bin/screens/edi_welcome.c b/src/bin/screens/edi_welcome.c index 6f1e223..ac5fb1a 100644 --- a/src/bin/screens/edi_welcome.c +++ b/src/bin/screens/edi_welcome.c @@ -97,6 +97,8 @@ _edi_welcome_project_chosen_cb(void *data, void *event_info) { evas_object_del(data); + elm_object_disabled_set(_edi_open_button, EINA_FALSE); + elm_object_disabled_set(_edi_create_button, EINA_FALSE); if (event_info) {