rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=a4bdbe14c11262d883f3c55cc0779db2e31ab1cf
commit a4bdbe14c11262d883f3c55cc0779db2e31ab1cf Author: Vyacheslav Reutskiy <v.reuts...@samsung.com> Date: Mon Jan 18 17:21:26 2016 +0200 notify: delete this module This module is old and not used yet, because now for print info for user used statusbar. And in future need to use only statusbar Change-Id: Ia5d42294300e0569cc04459646e4bf26c653703b --- po/POTFILES.in | 1 - src/bin/Makefile.am | 3 +- src/bin/eflete.h | 1 - src/bin/main.c | 2 - src/bin/ui/editors/colorclass_manager.c | 2 +- src/bin/ui/editors/image_editor.c | 4 +- src/bin/ui/editors/sound_editor.c | 16 ++-- src/bin/ui/editors/style_editor.c | 20 ++--- src/bin/ui/notification/notify.c | 142 -------------------------------- src/bin/ui/notification/notify.h | 135 ------------------------------ src/bin/ui/project_close.c | 4 +- src/bin/ui/project_common.c | 6 +- src/bin/ui/tab_home_new.c | 2 +- 13 files changed, 28 insertions(+), 310 deletions(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index abe88c4..1ca810d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -57,7 +57,6 @@ src/bin/ui/main_window.c src/bin/ui/menu.c src/bin/ui/modal_window/modal_window.c src/bin/ui/project_navigator.c -src/bin/ui/notification/notify.c src/bin/ui/group_navigator.c src/bin/ui/preference/preference.c src/bin/ui/project_close.c diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index a32a123..965f14b 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -100,8 +100,7 @@ libete_a_SOURCES = \ ../../src/bin/ui/live_view/elementary/live_spinner.c \ ../../src/bin/ui/live_view/elementary/live_progressbar.c \ ../../src/bin/ui/live_view/elementary/live_toolbar.c \ -../../src/bin/ui/live_view/elementary/live_naviframe.c \ -../../src/bin/ui/notification/notify.c +../../src/bin/ui/live_view/elementary/live_naviframe.c eflete_SOURCES = ../../src/bin/main.c diff --git a/src/bin/eflete.h b/src/bin/eflete.h index 6a4563b..976b5ea 100644 --- a/src/bin/eflete.h +++ b/src/bin/eflete.h @@ -74,7 +74,6 @@ TODO("delete it, and remake all strings to eina_stringshare or eina_strbuff") #include <Elementary.h> #include "logger.h" -#include "notify.h" #include "string_common.h" #include "editor.h" #include "signals.h" diff --git a/src/bin/main.c b/src/bin/main.c index 0ecb18e..e882a00 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -71,7 +71,6 @@ _import_end(void *data __UNUSED__, PM_Project_Result result) STATUSBAR_PROJECT_PATH(ap.project->pro_path); STATUSBAR_PROJECT_SAVE_TIME_UPDATE(); - NOTIFY_INFO(3, _("Project '%s' is opened."), pro->name); evas_object_smart_callback_call(ap.win, SIGNAL_PROJECT_OPENED, NULL); } evas_object_show(ap.win); @@ -91,7 +90,6 @@ _open_end(void *data __UNUSED__, PM_Project_Result result) ui_menu_disable_set(ap.menu, MENU_FILE_CLOSE_PROJECT, false); project_navigator_project_set(); - NOTIFY_INFO(3, _("Project '%s' is opened."), pro->name); STATUSBAR_PROJECT_PATH(ap.project->pro_path); STATUSBAR_PROJECT_SAVE_TIME_UPDATE(); evas_object_smart_callback_call(ap.win, SIGNAL_PROJECT_OPENED, NULL); diff --git a/src/bin/ui/editors/colorclass_manager.c b/src/bin/ui/editors/colorclass_manager.c index 50209dd..b74797f 100644 --- a/src/bin/ui/editors/colorclass_manager.c +++ b/src/bin/ui/editors/colorclass_manager.c @@ -161,7 +161,7 @@ _on_button_delete_clicked_cb(void *data __UNUSED__, symbs += strlen(res->name); break; TODO("remove this break after warning style remake") } - NOTIFY_WARNING("%s", buf); + WARN("%s", buf); return; } diff --git a/src/bin/ui/editors/image_editor.c b/src/bin/ui/editors/image_editor.c index b419cff..628ca4b 100644 --- a/src/bin/ui/editors/image_editor.c +++ b/src/bin/ui/editors/image_editor.c @@ -381,7 +381,7 @@ _on_button_delete_clicked_cb(void *data, symbs += strlen(res->name); break; TODO("remove this break after warning style remake") } - NOTIFY_WARNING("%s", buf); + WARN("%s", buf); } else if (notdeleted >1) { @@ -397,7 +397,7 @@ _on_button_delete_clicked_cb(void *data, } if (notdeleted >= 4) snprintf(buf + symbs, BUFF_MAX - symbs, "<br>..."); - NOTIFY_WARNING("%s", buf); + WARN("%s", buf); } editor_save(ap.project->global_object); diff --git a/src/bin/ui/editors/sound_editor.c b/src/bin/ui/editors/sound_editor.c index 853ed4c..eb26137 100644 --- a/src/bin/ui/editors/sound_editor.c +++ b/src/bin/ui/editors/sound_editor.c @@ -294,7 +294,7 @@ _fs_del(void *data) static void _add_sample_done(void *data, - Evas_Object *obj, + Evas_Object *obj __UNUSED__, void *event_info) { Item *it; @@ -326,8 +326,8 @@ _add_sample_done(void *data, } if (exist) { - WIN_NOTIFY_WARNING(obj, _("Sample with this name is already added to project")) - eina_stringshare_del(sound_name); + WARN(_("Sample '%s' is already added to project"), sound_name) + eina_stringshare_del(sound_name); return; } @@ -343,7 +343,7 @@ _add_sample_done(void *data, } else { - WIN_NOTIFY_ERROR(obj, _("File exist")); + ERR(_("File '%s' exist"), res->name); free(res); goto del; } @@ -366,7 +366,7 @@ _add_sample_done(void *data, ap.project->changed = true; } else - WIN_NOTIFY_ERROR(obj, _("Error while loading file.<br>File is not exist")); + ERR(_("File '%s' is not exist"), selected); del: ecore_job_add(_fs_del, edit); @@ -429,7 +429,7 @@ _add_tone_done(void *data, } if (exist) { - NOTIFY_WARNING(_("Tone with this name is already added to project")) + WARN(_("Tone '%s' is already added to project"), tone_name) eina_stringshare_del(tone_name); return; } @@ -602,7 +602,7 @@ _on_delete_clicked_cb(void *data, if ((!list) || (!selected)) { - NOTIFY_WARNING("No selected items"); + WARN("No selected items"); return; } @@ -650,7 +650,7 @@ _on_delete_clicked_cb(void *data, snprintf(buf + symbs, BUFF_MAX - symbs, "<br>..."); if (notdeleted != 0) - NOTIFY_WARNING("%s<br>Used in Programs", buf); + WARN("'%s' used in Programs", buf); editor_save(ap.project->global_object); TODO("Remove this line once edje_edit_sound_..._del would be added into Editor Modulei and saving would work properly") diff --git a/src/bin/ui/editors/style_editor.c b/src/bin/ui/editors/style_editor.c index 913d3fe..5b01593 100644 --- a/src/bin/ui/editors/style_editor.c +++ b/src/bin/ui/editors/style_editor.c @@ -196,12 +196,12 @@ _on_st_add_bt_ok(void *data, if ((!style_name) || (strcmp(style_name, "") == 0)) { - NOTIFY_WARNING(_("Style name can not be empty!")); + WARN(_("Style name can not be empty!")); return; } if (!edje_edit_style_add(edje_edit_obj, style_name)) { - NOTIFY_WARNING(_("Style name must be unique!")); + WARN(_("Style name must be unique!")); return; } if (edje_edit_style_tag_add(edje_edit_obj, style_name, "DEFAULT")) @@ -211,14 +211,14 @@ _on_st_add_bt_ok(void *data, "DEFAULT", "align=middle font=Sans font_size=24 color=#000000FF")) { - NOTIFY_WARNING(_("Failed to add tag value. Tag will be deleted")); + WARN(_("Failed to add tag value. Tag will be deleted")); edje_edit_style_tag_del(edje_edit_obj, style_name, "DEFAULT"); return; } } else { - NOTIFY_WARNING(_("Failed to add tag.")); + WARN(_("Failed to add tag.")); return; } @@ -263,18 +263,18 @@ _on_tag_add_bt_ok(void *data, if ((!tag_name) || (strcmp(tag_name, "") == 0)) { - NOTIFY_WARNING(_("Tag name can not be empty!")); + WARN(_("Tag name can not be empty!")); return; } if (!edje_edit_style_tag_add(edje_edit_obj, style_name, tag_name)) { - NOTIFY_WARNING(_("Tag name must be unique!")); + WARN(_("Tag name must be unique!")); return; } else if (!edje_edit_style_tag_value_set(edje_edit_obj, style_name, tag_name, "")) { - NOTIFY_WARNING(_("Failed to add tag value. Tag will be deleted")); + WARN(_("Failed to add tag value. Tag will be deleted")); edje_edit_style_tag_del(edje_edit_obj, style_name, tag_name); return; } @@ -357,7 +357,7 @@ _on_bt_tag_add(Style_Editor *style_edit) if (!glit) { - NOTIFY_WARNING(_("Select a style!")); + WARN(_("Select a style!")); return; } @@ -451,7 +451,7 @@ _on_bt_del(void *data, symbs += strlen(res->name); break; TODO("remove this break after warning style remake") } - NOTIFY_WARNING("%s", buf); + WARN("%s", buf); return; } } @@ -461,7 +461,7 @@ _on_bt_del(void *data, tag = elm_object_item_part_text_get(glit, "elm.text"); if (!strcmp(tag, "DEFAULT")) { - NOTIFY_WARNING(_("DEFAULT tag cannot be deleted!")); + WARN(_("DEFAULT tag cannot be deleted!")); return; } else diff --git a/src/bin/ui/notification/notify.c b/src/bin/ui/notification/notify.c deleted file mode 100644 index 7deed31..0000000 --- a/src/bin/ui/notification/notify.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Edje Theme Editor - * Copyright (C) 2013-2014 Samsung Electronics. - * - * This file is part of Edje Theme Editor. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; If not, see www.gnu.org/licenses/lgpl.html. - */ - -#include "notify.h" -#include "widget_macro.h" - -static void -_notify_close (void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - Evas_Object *notify = (Evas_Object *)data; - - assert(notify != NULL); - - evas_object_del(notify); -} - - -TODO("it all need to remake, use widget macro. notify style make as popup," - " with a blink block area") - -Eina_Bool -noti_error_show(Evas_Object *obj, const char *message) -{ - Evas_Object *notify, *layout, *btn; - - assert(obj != NULL); - assert(message != NULL); - - //1. setting notify up - notify = elm_notify_add(obj); - elm_notify_allow_events_set(notify, EINA_FALSE); - evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(notify, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_notify_align_set(notify, 0.5, 0.5); - - //2. start forming layout - layout = elm_layout_add(obj); - evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_layout_theme_set(layout, "layout", "notify", "default"); - elm_layout_signal_emit(layout, "notify,error", "eflete"); - - //2.2 add not editable entry for information viewable - elm_object_part_text_set(layout, "information", message); - - //2.3. add button for closing the error message - BUTTON_ADD(obj, btn, _("Close")); - evas_object_smart_callback_add(btn, "clicked", _notify_close, notify); - elm_object_part_content_set (layout, "close_button", btn); - - //2.4. show this layout with everything - evas_object_show (layout); - elm_object_content_set(notify, layout); - evas_object_show (notify); - return true; -} - -Eina_Bool -noti_warning_show(Evas_Object *obj, const char *message) -{ - Evas_Object *notify, *layout, *btn; - - assert(obj != NULL); - assert(message != NULL); - - //1. setting notify up - notify = elm_notify_add(obj); - elm_notify_allow_events_set(notify, EINA_FALSE); - evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(notify, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_notify_align_set(notify, 0.5, 0.5); - - //2. start forming layout - layout = elm_layout_add(obj); - evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_layout_theme_set(layout, "layout", "notify", "default"); - elm_layout_signal_emit(layout, "notify,warning", "eflete"); - - //2.2 add not editable entry for information viewable - elm_object_part_text_set(layout, "information", message); - - //2.3. add button for closing the error message - BUTTON_ADD(obj, btn, _("Close")); - evas_object_smart_callback_add(btn, "clicked", _notify_close, notify); - elm_object_part_content_set (layout, "close_button", btn); - - //2.4. show this layout with everything - evas_object_show (layout); - elm_object_content_set(notify, layout); - elm_object_focus_set(btn, EINA_TRUE); - evas_object_show (notify); - return true; -} - -Eina_Bool -noti_info_show(Evas_Object *obj, const char *message, double time) -{ - Evas_Object *notify, *layout; - - assert(obj != NULL); - assert(message != NULL); - assert(time >= 0); - - //1. setting notify up - notify = elm_notify_add(obj); - evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(notify, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_notify_align_set(notify, 0.5, 1.0); - elm_notify_timeout_set(notify, time); - evas_object_smart_callback_add(notify, "timeout", _notify_close, notify); - - //2. start forming layout - layout = elm_layout_add(notify); - evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_layout_theme_set(layout, "layout", "notify", "info"); - - //2.2 add not editable entry for information viewable - elm_object_part_text_set(layout, "information", message); - - //2.4. show this layout with everything - evas_object_show (layout); - elm_object_content_set(notify, layout); - evas_object_show (notify); - return true; -} diff --git a/src/bin/ui/notification/notify.h b/src/bin/ui/notification/notify.h deleted file mode 100644 index c370653..0000000 --- a/src/bin/ui/notification/notify.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Edje Theme Editor - * Copyright (C) 2013-2014 Samsung Electronics. - * - * This file is part of Edje Theme Editor. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; If not, see www.gnu.org/licenses/lgpl.html. - */ - -#ifndef UI_NOTIFY_HEADER_H -#define UI_NOTIFY_HEADER_H - -/** - * @defgroup Notify Notify - * @ingroup Window - * - * Notify API for showing some user-oriented information - * like warning or error's. - */ - -#include "eflete.h" - -/** - * Show Error Notification with formated message - * - * @ingroup Notify - */ -#define NOTIFY_ERROR(fmt, ...) \ - WIN_NOTIFY_ERROR(win_layout_get(), fmt, ##__VA_ARGS__) - -/** - * Show Warning Notification with formated message - * - * @ingroup Notify - */ -#define NOTIFY_WARNING(fmt, ...) \ - WIN_NOTIFY_WARNING(win_layout_get(), fmt, ##__VA_ARGS__) - -/** - * Show Information Notification with formated message - * - * @ingroup Notify - */ -#define NOTIFY_INFO(time, fmt, ...) \ - WIN_NOTIFY_INFO(win_layout_get(), time, fmt, ##__VA_ARGS__) - -/** - * Show Error Notification with formated message in given window - * - * @ingroup Notify - */ -#define WIN_NOTIFY_ERROR(win, fmt, ...) \ -{ \ - char *msg = mem_malloc(BUFF_MAX * sizeof(char)); \ - snprintf(msg, BUFF_MAX, fmt, ##__VA_ARGS__); \ - noti_error_show(win, msg); \ - free(msg); \ -} - -/** - * Show Warning Notification with formated message in given window - * - * @ingroup Notify - */ -#define WIN_NOTIFY_WARNING(win, fmt, ...) \ -{ \ - char *msg = mem_malloc(BUFF_MAX * sizeof(char)); \ - snprintf(msg, BUFF_MAX, fmt, ##__VA_ARGS__); \ - noti_warning_show(win, msg); \ - free(msg); \ -} - -/** - * Show Information Notification with formated message in given window - * - * @ingroup Notify - */ -#define WIN_NOTIFY_INFO(win, time, fmt, ...) \ -{ \ - char *msg = mem_malloc(BUFF_MAX * sizeof(char)); \ - snprintf(msg, BUFF_MAX, fmt, ##__VA_ARGS__); \ - noti_info_show(win, msg, time); \ - free(msg); \ -} - - -/** - * Show notification with some 'error' related message. - * - * @param obj object, on which notify will be appeared. - * @param message error message. - * @return EINA_FALSE on error, EINA_TRUE otherwise - * - * @ingroup Notify - */ -Eina_Bool -noti_error_show(Evas_Object *obj, const char *message); - -/** - * Show notification with 'warning' related message. - * - * @param obj object, on which notify will be appeared. - * @param message warning message. - * @return EINA_FALSE on error, EINA_TRUE otherwise - * - * @ingroup Notify - */ -Eina_Bool -noti_warning_show(Evas_Object *obj, const char *message); - -/** - * Show notification with some information. - * - * @param obj object, on which notify will be appeared. - * @param message information message. - * @param time the information message will be shown until given time, - * and after that time it will disappear. - * @return EINA_FALSE on error, EINA_TRUE otherwise - * - * @ingroup Notify - */ -Eina_Bool -noti_info_show(Evas_Object *obj, const char *message, double time); - -#endif /* UI_NOTIFY_HEADER_H */ diff --git a/src/bin/ui/project_close.c b/src/bin/ui/project_close.c index 70465a0..5af5589 100644 --- a/src/bin/ui/project_close.c +++ b/src/bin/ui/project_close.c @@ -38,12 +38,12 @@ _progress_end(void *data __UNUSED__, PM_Project_Result result) { case PM_PROJECT_ERROR: { - NOTIFY_INFO(3, _("Error: project not saved.")); + ERR(_("Error: project not saved.")); break; } case PM_PROJECT_CANCEL: { - NOTIFY_INFO(3, _("Saving canceled.")); + INFO(_("Saving canceled.")); break; } case PM_PROJECT_SUCCESS: diff --git a/src/bin/ui/project_common.c b/src/bin/ui/project_common.c index f38f03e..fb015fc 100644 --- a/src/bin/ui/project_common.c +++ b/src/bin/ui/project_common.c @@ -66,17 +66,17 @@ progress_end(void *data __UNUSED__, PM_Project_Result result) { case PM_PROJECT_ERROR: { - NOTIFY_INFO(3, _("Can't open project.")); + ERR( _("Can't open project.")); break; } case PM_PROJECT_CANCEL: { - NOTIFY_INFO(3, _("Project opening canceled.")); + ERR(_("Project opening canceled.")); break; } case PM_PROJECT_SUCCESS: { - NOTIFY_INFO(3, _("Project '%s' is opened."), ap.project->name); + INFO(_("Project '%s' is opened."), ap.project->name); STATUSBAR_PROJECT_PATH(ap.project->pro_path); STATUSBAR_PROJECT_SAVE_TIME_UPDATE(); break; diff --git a/src/bin/ui/tab_home_new.c b/src/bin/ui/tab_home_new.c index a7ecf7a..e96befb 100644 --- a/src/bin/ui/tab_home_new.c +++ b/src/bin/ui/tab_home_new.c @@ -381,7 +381,7 @@ _edc_code_generate(Eina_Stringshare *path) "%d widgets included due to dependencies:<br><br>", deps_count), deps_count); - NOTIFY_INFO(3, "%s", eina_strbuf_string_get(dep_message)); + INFO("%s", eina_strbuf_string_get(dep_message)); } eina_strbuf_free(dep_message); eina_strbuf_append(edc, "data.item: \"version\" \"110\";\n\n"); --