forked from enlightenment/enlightenment
parent
5fa6f90122
commit
1f05439257
1
TODO
1
TODO
|
@ -95,6 +95,7 @@ Some of the things (in very short form) that need to be done to E17...
|
|||
"NICE TO HAVE" FEATURES
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
* enlightenment_remote cmd's for logout, hibernate, reboot, suspend.
|
||||
* nice to have a menu item for a window for "add keyboard shortcut to run this
|
||||
app" would be nice usability
|
||||
* full fm2 support as an icon fm needs work - beyond fsel needs and for icons
|
||||
|
|
|
@ -18,6 +18,12 @@ struct _E_Confirm_Dialog
|
|||
void *data;
|
||||
void (*func)(void *data);
|
||||
} no;
|
||||
|
||||
struct
|
||||
{
|
||||
void *data;
|
||||
void (*func)(void *data);
|
||||
} del;
|
||||
E_Dialog *dia;
|
||||
};
|
||||
|
||||
|
@ -32,7 +38,7 @@ static void _e_confirm_dialog_no(void *data, E_Dialog *dia);
|
|||
EAPI void
|
||||
e_confirm_dialog_show(const char *title, const char *icon, const char *text,
|
||||
const char *button_text, const char *button2_text, void (*func)(void *data),
|
||||
void (*func2)(void *data), void *data, void *data2)
|
||||
void (*func2)(void *data), void *data, void *data2, void (*del_func)(void *data), void *del_data)
|
||||
{
|
||||
E_Confirm_Dialog *cd;
|
||||
E_Dialog *dia;
|
||||
|
@ -42,6 +48,8 @@ e_confirm_dialog_show(const char *title, const char *icon, const char *text,
|
|||
cd->yes.data = data;
|
||||
cd->no.func = func2;
|
||||
cd->no.data = data2;
|
||||
cd->del.func = del_func;
|
||||
cd->del.data = del_data;
|
||||
|
||||
dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_confirm_dialog");
|
||||
if (!dia)
|
||||
|
@ -94,6 +102,7 @@ _e_confirm_dialog_delete(E_Win *win)
|
|||
dia = win->data;
|
||||
cd = dia->data;
|
||||
|
||||
if (cd->del.func) cd->del.func(cd->del.data);
|
||||
e_object_del(E_OBJECT(dia));
|
||||
free(cd);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* data - the pointer passed to func
|
||||
* data2 - the pointer passed to func2
|
||||
*/
|
||||
EAPI void e_confirm_dialog_show(const char *title, const char *icon, const char *text, const char *button_text, const char *button2_text, void (*func)(void *data), void (*func2)(void *data), void *data, void *data2);
|
||||
EAPI void e_confirm_dialog_show(const char *title, const char *icon, const char *text, const char *button_text, const char *button2_text, void (*func)(void *data), void (*func2)(void *data), void *data, void *data2, void (*del_func)(void *data), void * del_data);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -8,6 +8,7 @@ static void _ilist_cb_selected(void *data);
|
|||
static void _cb_add(void *data, void *data2);
|
||||
static void _cb_delete(void *data, void *data2);
|
||||
static void _cb_dialog_yes(void *data);
|
||||
static void _cb_dialog_destroy(void *data);
|
||||
static void _cb_config(void *data, void *data2);
|
||||
|
||||
struct _E_Config_Dialog_Data
|
||||
|
@ -19,6 +20,14 @@ struct _E_Config_Dialog_Data
|
|||
char *cur_shelf;
|
||||
};
|
||||
|
||||
typedef struct _Shelf_Del_Confirm_Data Shelf_Del_Confirm_Data;
|
||||
struct _Shelf_Del_Confirm_Data
|
||||
{
|
||||
E_Config_Dialog_Data *cfdata;
|
||||
E_Shelf *es;
|
||||
};
|
||||
|
||||
|
||||
EAPI E_Config_Dialog *
|
||||
e_int_config_shelf(E_Container *con)
|
||||
{
|
||||
|
@ -229,38 +238,51 @@ _cb_add(void *data, void *data2)
|
|||
static void
|
||||
_cb_delete(void *data, void *data2)
|
||||
{
|
||||
E_Config_Dialog_Data *cfdata;
|
||||
Shelf_Del_Confirm_Data *d;
|
||||
char buf[4096];
|
||||
|
||||
cfdata = data;
|
||||
if (!cfdata) return;
|
||||
if (!cfdata->cur_shelf) return;
|
||||
d = E_NEW(Shelf_Del_Confirm_Data, 1);
|
||||
if (!d) return;
|
||||
d->cfdata = data;
|
||||
if (!d->cfdata) return;
|
||||
if (!d->cfdata->cur_shelf) return;
|
||||
d->es = evas_list_nth(e_shelf_list(), e_widget_ilist_selected_get(d->cfdata->o_list));
|
||||
if (!d->es) return;
|
||||
e_object_ref(E_OBJECT(d->es));
|
||||
|
||||
snprintf(buf, sizeof(buf), _("You requested to delete \"%s\".<br><br>"
|
||||
"Are you sure you want to delete this shelf?"),
|
||||
cfdata->cur_shelf);
|
||||
d->cfdata->cur_shelf);
|
||||
|
||||
e_confirm_dialog_show(_("Are you sure you want to delete this shelf?"),
|
||||
"enlightenment/exit", buf, NULL, NULL, _cb_dialog_yes, NULL, cfdata, NULL);
|
||||
"enlightenment/exit", buf, NULL, NULL, _cb_dialog_yes, NULL, d, NULL,
|
||||
_cb_dialog_destroy, d);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_dialog_yes(void *data)
|
||||
{
|
||||
E_Config_Dialog_Data *cfdata;
|
||||
Shelf_Del_Confirm_Data *d;
|
||||
E_Shelf *es;
|
||||
|
||||
cfdata = data;
|
||||
if (!cfdata) return;
|
||||
d = data;
|
||||
if (!data) return;
|
||||
|
||||
es = evas_list_nth(e_shelf_list(), e_widget_ilist_selected_get(cfdata->o_list));
|
||||
if (!es) return;
|
||||
|
||||
e_shelf_unsave(es);
|
||||
e_object_del(E_OBJECT(es));
|
||||
if (e_object_is_del(E_OBJECT(d->es))) return;
|
||||
e_shelf_unsave(d->es);
|
||||
e_object_del(E_OBJECT(d->es));
|
||||
e_config_save_queue();
|
||||
}
|
||||
|
||||
_ilist_fill(cfdata);
|
||||
static void
|
||||
_cb_dialog_destroy(void *data)
|
||||
{
|
||||
Shelf_Del_Confirm_Data *d;
|
||||
|
||||
d = data;
|
||||
e_object_unref(E_OBJECT(d->es));
|
||||
_ilist_fill(d->cfdata);
|
||||
E_FREE(d);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -12,6 +12,7 @@ static void _e_shelf_cb_menu_config(void *data, E_Menu *m, E_Menu_Item *mi);
|
|||
static void _e_shelf_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _e_shelf_cb_menu_contents(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _e_shelf_cb_confirm_dialog_yes(void *data);
|
||||
static void _e_shelf_cb_confirm_dialog_no(void *data);
|
||||
static void _e_shelf_cb_menu_delete(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _e_shelf_menu_append(E_Shelf *es, E_Menu *mn);
|
||||
static void _e_shelf_cb_menu_items_append(void *data, E_Menu *mn);
|
||||
|
@ -22,6 +23,7 @@ static void _e_shelf_cb_mouse_out(void *data, Evas *evas, Evas_Object *obj, void
|
|||
static int _e_shelf_cb_id_sort(void *data1, void *data2);
|
||||
|
||||
static Evas_List *shelves = NULL;
|
||||
static Evas_Bool _del_confirm_active = 0;
|
||||
|
||||
/* externally accessible functions */
|
||||
EAPI int
|
||||
|
@ -865,6 +867,15 @@ _e_shelf_cb_menu_contents(void *data, E_Menu *m, E_Menu_Item *mi)
|
|||
e_int_gadcon_config(es->gadcon);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_shelf_cb_confirm_dialog_destroy(void *data)
|
||||
{
|
||||
E_Shelf *es;
|
||||
|
||||
es = data;
|
||||
e_object_unref(E_OBJECT(es));
|
||||
}
|
||||
|
||||
static void
|
||||
_e_shelf_cb_confirm_dialog_yes(void *data)
|
||||
{
|
||||
|
@ -873,6 +884,7 @@ _e_shelf_cb_confirm_dialog_yes(void *data)
|
|||
|
||||
es = data;
|
||||
cfg = es->cfg;
|
||||
if (e_object_is_del(E_OBJECT(es))) return;
|
||||
e_object_del(E_OBJECT(es));
|
||||
e_config->shelves = evas_list_remove(e_config->shelves, cfg);
|
||||
if (cfg->name) evas_stringshare_del(cfg->name);
|
||||
|
@ -886,11 +898,14 @@ _e_shelf_cb_confirm_dialog_yes(void *data)
|
|||
static void
|
||||
_e_shelf_cb_menu_delete(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||
{
|
||||
E_Shelf * es = data;
|
||||
e_object_ref(E_OBJECT(es));
|
||||
e_confirm_dialog_show(_("Are you sure you want to delete this shelf?"), "enlightenment/e",
|
||||
_("You requested to delete this shelf.<br>"
|
||||
"<br>"
|
||||
"Are you sure you want to delete it?"), NULL, NULL,
|
||||
_e_shelf_cb_confirm_dialog_yes, NULL, data, NULL);
|
||||
_e_shelf_cb_confirm_dialog_yes, NULL, data, NULL,
|
||||
_e_shelf_cb_confirm_dialog_destroy, data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue