From 945b46213564e3c451eb537c44a382a778062ba2 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Wed, 20 Jan 2021 12:33:56 -0500 Subject: [PATCH] e_shelf: Add parent parameter to e_shelf_new_dialog This adds a parent param to e_shelf_new_dialog function so that the Add Shelf window cannot be closed while Shelf Name dialog is open. --- src/bin/e_shelf.c | 17 ++++++++++------- src/bin/e_shelf.h | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/bin/e_shelf.c b/src/bin/e_shelf.c index 2d211763e..853045479 100644 --- a/src/bin/e_shelf.c +++ b/src/bin/e_shelf.c @@ -1124,12 +1124,14 @@ e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es) } E_API E_Entry_Dialog * -e_shelf_new_dialog(E_Zone *zone) +e_shelf_new_dialog(Evas_Object *parent, E_Zone *zone) { char buf[256]; - snprintf(buf, sizeof(buf), _("Shelf #%d"), eina_list_count(e_config->shelves)); - return e_entry_dialog_show(_("Add New Shelf"), "preferences-desktop-shelf", + snprintf(buf, sizeof(buf), _("Shelf #%d"), + eina_list_count(e_config->shelves)); + return e_entry_dialog_show(parent, _("Add New Shelf"), + "preferences-desktop-shelf", _("Name:"), buf, NULL, NULL, _e_shelf_new_dialog_ok, NULL, zone); } @@ -2282,10 +2284,11 @@ _e_shelf_cb_menu_rename(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_ { E_Shelf *es = data; if (es->rename_dialog) return; - es->rename_dialog = e_entry_dialog_show(_("Rename Shelf"), "edit-rename", - _("Name:"), es->name, NULL, NULL, - _e_shelf_cb_menu_rename_yes_cb, - NULL, es); + es->rename_dialog = + e_entry_dialog_show(NULL, _("Rename Shelf"), "edit-rename", + _("Name:"), es->name, NULL, NULL, + _e_shelf_cb_menu_rename_yes_cb, + NULL, es); e_object_data_set(E_OBJECT(es->rename_dialog), es); e_object_del_attach_func_set(E_OBJECT(es->rename_dialog), _e_shelf_cb_menu_rename_cb); diff --git a/src/bin/e_shelf.h b/src/bin/e_shelf.h index a98b3ba98..dfabb41ad 100644 --- a/src/bin/e_shelf.h +++ b/src/bin/e_shelf.h @@ -71,7 +71,7 @@ E_API extern int E_EVENT_SHELF_DEL; EINTERN int e_shelf_init(void); EINTERN int e_shelf_shutdown(void); E_API void e_shelf_config_update(void); -E_API E_Entry_Dialog *e_shelf_new_dialog(E_Zone *zone); +E_API E_Entry_Dialog *e_shelf_new_dialog(Evas_Object *parent, E_Zone *zone); E_API Eina_List *e_shelf_list(void); E_API Eina_List *e_shelf_list_all(void); // includes dummy shelves E_API E_Shelf *e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, E_Layer layer, int id);