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.
This commit is contained in:
Christopher Michael 2021-01-20 12:33:56 -05:00
parent efb062efe2
commit 945b462135
2 changed files with 11 additions and 8 deletions

View File

@ -1124,12 +1124,14 @@ e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es)
} }
E_API E_Entry_Dialog * 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]; char buf[256];
snprintf(buf, sizeof(buf), _("Shelf #%d"), eina_list_count(e_config->shelves)); snprintf(buf, sizeof(buf), _("Shelf #%d"),
return e_entry_dialog_show(_("Add New Shelf"), "preferences-desktop-shelf", eina_list_count(e_config->shelves));
return e_entry_dialog_show(parent, _("Add New Shelf"),
"preferences-desktop-shelf",
_("Name:"), buf, NULL, NULL, _("Name:"), buf, NULL, NULL,
_e_shelf_new_dialog_ok, NULL, zone); _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; E_Shelf *es = data;
if (es->rename_dialog) return; if (es->rename_dialog) return;
es->rename_dialog = e_entry_dialog_show(_("Rename Shelf"), "edit-rename", es->rename_dialog =
_("Name:"), es->name, NULL, NULL, e_entry_dialog_show(NULL, _("Rename Shelf"), "edit-rename",
_e_shelf_cb_menu_rename_yes_cb, _("Name:"), es->name, NULL, NULL,
NULL, es); _e_shelf_cb_menu_rename_yes_cb,
NULL, es);
e_object_data_set(E_OBJECT(es->rename_dialog), es); e_object_data_set(E_OBJECT(es->rename_dialog), es);
e_object_del_attach_func_set(E_OBJECT(es->rename_dialog), e_object_del_attach_func_set(E_OBJECT(es->rename_dialog),
_e_shelf_cb_menu_rename_cb); _e_shelf_cb_menu_rename_cb);

View File

@ -71,7 +71,7 @@ E_API extern int E_EVENT_SHELF_DEL;
EINTERN int e_shelf_init(void); EINTERN int e_shelf_init(void);
EINTERN int e_shelf_shutdown(void); EINTERN int e_shelf_shutdown(void);
E_API void e_shelf_config_update(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(void);
E_API Eina_List *e_shelf_list_all(void); // includes dummy shelves 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); E_API E_Shelf *e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, E_Layer layer, int id);