add new functions for renaming a shelf/gadcon in the process of hunting #1286

SVN revision: 74973
This commit is contained in:
Mike Blumenkrantz 2012-08-07 10:28:28 +00:00
parent 0eb043e8bf
commit 7623fa4de0
5 changed files with 25 additions and 3 deletions

View File

@ -764,6 +764,16 @@ e_gadcon_xdnd_window_get(E_Gadcon *gc)
return gc->xdnd_win;
}
EAPI void
e_gadcon_name_set(E_Gadcon *gc, const char *name)
{
if (!gc) return;
if (!name) return;
if (gc->name == name) return;
eina_stringshare_replace(&gc->name, name);
eina_stringshare_replace(&gc->cf->name, name);
}
EAPI void
e_gadcon_shelf_set(E_Gadcon *gc, E_Shelf *shelf)
{

View File

@ -302,6 +302,7 @@ EAPI E_Menu *e_gadcon_client_util_menu_items_append(E_Gadcon_Cli
EAPI void e_gadcon_client_util_menu_attach(E_Gadcon_Client *gcc);
EAPI void e_gadcon_locked_set(E_Gadcon *gc, int lock);
EAPI void e_gadcon_urgent_show(E_Gadcon *gc);
EAPI void e_gadcon_name_set(E_Gadcon *gc, const char *name);
/* site helpers */

View File

@ -373,6 +373,18 @@ e_shelf_locked_set(E_Shelf *es, int lock)
}
}
EAPI void
e_shelf_name_set(E_Shelf *es, const char *name)
{
if (!es) return;
if (!name) return;
if (es->name == name) return;
eina_stringshare_replace(&es->name, name);
eina_stringshare_replace(&es->cfg->name, name);
if (es->dummy) return;
e_gadcon_name_set(es->gadcon, name);
}
EAPI void
e_shelf_toggle(E_Shelf *es, int show)
{

View File

@ -82,6 +82,7 @@ EAPI void e_shelf_position_calc(E_Shelf *es);
EAPI void e_shelf_style_set(E_Shelf *es, const char *style);
EAPI void e_shelf_popup_set(E_Shelf *es, int popup);
EAPI E_Shelf *e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es);
EAPI void e_shelf_name_set(E_Shelf *es, const char *name);
#endif
#endif

View File

@ -477,14 +477,12 @@ _rename_shelf_cb_ok(void *data, E_Dialog *dia)
return;
}
es = e_widget_ilist_selected_data_get(cfdata->o_list);
eina_stringshare_replace(&es->name, cfdata->new_shelf);
e_shelf_name_set(es, cfdata->new_shelf);
e_config_save_queue();
e_shelf_config_update();
cfdata->dia_new_shelf = NULL;
e_object_unref(E_OBJECT(dia));
_ilist_empty(cfdata);
_ilist_fill(cfdata);
}
static void