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.
devs/bu5hm4n/swipe_real
Christopher Michael 2 years ago
parent efb062efe2
commit 945b462135
  1. 17
      src/bin/e_shelf.c
  2. 2
      src/bin/e_shelf.h

@ -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);

@ -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);

Loading…
Cancel
Save