aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-22 17:03:45 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-22 17:03:45 -0500
commit27d505fb595e63615b0f6e83759848268abcbf59 (patch)
treea80611ea0183925b87232d125d4f3ff82974da35
parentprint notifications to stderr if a notification handler doesn't exist (diff)
downloadenlightenment-27d505fb595e63615b0f6e83759848268abcbf59.tar.gz
require [X-Gadget-Bugreport] entry for sandbox gadgets, integrate bug reporting
-rw-r--r--src/bin/e_gadget_runner.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/bin/e_gadget_runner.c b/src/bin/e_gadget_runner.c
index aaaef650e..d6a56011a 100644
--- a/src/bin/e_gadget_runner.c
+++ b/src/bin/e_gadget_runner.c
@@ -764,6 +764,14 @@ runner_hints(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info
}
static void
+runner_menu_bugreport(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
+{
+ char *url = data;
+ e_util_open(url, NULL);
+ free(url);
+}
+
+static void
runner_menu(void *data, Evas_Object *obj, void *event_info)
{
E_Menu *m = event_info;
@@ -771,8 +779,31 @@ runner_menu(void *data, Evas_Object *obj, void *event_info)
if (inst->ci->sandbox)
{
+ E_Menu_Item *mi;
+ E_Menu *subm;
Efreet_Desktop *ed = eina_hash_find(sandbox_gadgets, e_gadget_type_get(obj));
+ char buf[1024];
+
e_menu_title_set(m, ed->name);
+
+ subm = e_menu_new();
+ snprintf(buf, sizeof(buf), _("Version: %s"), (char*)eina_hash_find(ed->x, "X-Gadget-Version"));
+ e_menu_title_set(subm, buf);
+
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, _("Details"));
+ e_menu_item_submenu_set(mi, subm);
+ e_object_unref(E_OBJECT(subm));
+
+ mi = e_menu_item_new(subm);
+ snprintf(buf, sizeof(buf), "PID: %u", ecore_exe_pid_get(inst->exe));
+ e_menu_item_label_set(mi, buf);
+ e_menu_item_disabled_set(mi, 1);
+
+ mi = e_menu_item_new(subm);
+ e_menu_item_label_set(mi, _("Report bug"));
+ e_util_menu_item_theme_icon_set(mi, "dialog-error");
+ e_menu_item_callback_set(mi, runner_menu_bugreport, eina_strdup(eina_hash_find(ed->x, "X-Gadget-Bugreport")));
}
else
{
@@ -1003,6 +1034,17 @@ gadget_dir_add(const char *filename)
efreet_desktop_free(ed);
return;
}
+ if (!eina_hash_find(ed->x, "X-Gadget-Bugreport"))
+ {
+ char str[4096];
+ snprintf(str, sizeof(str), _("A gadget .desktop file was found,</ps>"
+ "but [X-Gadget-Bugreport] is missing!</ps>"
+ "%s"), buf);
+ /* FIXME: maybe don't use notification here? T6630 */
+ e_notification_util_send(_("Gadget Error"), str);
+ efreet_desktop_free(ed);
+ return;
+ }
eina_hash_add(sandbox_gadgets, filename, ed);
e_gadget_external_type_add("runner_sandbox", filename, sandbox_create, NULL);
e_gadget_external_type_name_cb_set("runner_sandbox", filename, sandbox_name);