src/bin/e_config.h \
src/bin/e_desk.h \
src/bin/e_desk_area.h \
-src/bin/e_dialog.h \
src/bin/e_dnd.h \
src/bin/e_dpms.h \
src/bin/e_env.h \
src/bin/e_module.h \
src/bin/e_mouse.h \
src/bin/e_msgbus.h \
-src/bin/e_obj_dialog.h \
src/bin/e_object.h \
src/bin/e_output.h \
src/bin/e_path.h \
src/bin/e_config_data.c \
src/bin/e_desk.c \
src/bin/e_desk_area.c \
-src/bin/e_dialog.c \
src/bin/e_dpms.c \
src/bin/e_dnd.c \
src/bin/e_env.c \
src/bin/e_module.c \
src/bin/e_mouse.c \
src/bin/e_msgbus.c \
-src/bin/e_obj_dialog.c \
src/bin/e_object.c \
src/bin/e_path.c \
src/bin/e_pixmap.c \
e_client_act_close_begin((E_Client *)obj);
}
-/***************************************************************************/
-static E_Dialog *kill_dialog = NULL;
-
-static void
-_e_actions_cb_kill_dialog_ok(void *data, E_Dialog *dia)
-{
- E_Object *obj;
-
- obj = data;
- if (dia)
- {
- e_object_del(E_OBJECT(kill_dialog));
- kill_dialog = NULL;
- }
- if ((!((E_Client *)obj)->lock_close) && (!((E_Client *)obj)->internal))
- e_client_act_kill_begin((E_Client *)obj);
-}
-
-static void
-_e_actions_cb_kill_dialog_cancel(void *data EINA_UNUSED, E_Dialog *dia EINA_UNUSED)
-{
- e_object_del(E_OBJECT(kill_dialog));
- kill_dialog = NULL;
-}
-
-static void
-_e_actions_cb_kill_dialog_delete(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
-{
- _e_actions_cb_kill_dialog_cancel(NULL, data);
-}
-
-ACT_FN_GO(window_kill, EINA_UNUSED)
-{
- E_Client *ec;
- char dialog_text[1024];
-
- if (!obj) obj = E_OBJECT(e_client_focused_get());
- if (!obj) return;
- if (obj->type != E_CLIENT_TYPE) return;
- ec = (E_Client *)obj;
- if ((ec->lock_close) || (ec->internal)) return;
-
- if (kill_dialog) e_object_del(E_OBJECT(kill_dialog));
-
- snprintf(dialog_text, sizeof(dialog_text),
- _("You are about to kill %s.<br><br>"
- "Please keep in mind that all data from this window<br>"
- "which has not yet been saved will be lost!<br><br>"
- "Are you sure you want to kill this window?"),
- ec->icccm.name);
-
- kill_dialog = e_dialog_new(NULL,
- "E", "_kill_dialog");
- if (!kill_dialog) return;
- evas_object_event_callback_add(kill_dialog->win, EVAS_CALLBACK_DEL,
- _e_actions_cb_kill_dialog_delete, kill_dialog);
- e_dialog_title_set(kill_dialog,
- _("Are you sure you want to kill this window?"));
- e_dialog_text_set(kill_dialog, _(dialog_text));
- e_dialog_icon_set(kill_dialog, "application-exit", 64);
- e_dialog_button_add(kill_dialog, _("Kill"), NULL,
- _e_actions_cb_kill_dialog_ok, obj);
- e_dialog_button_add(kill_dialog, _("No"), NULL,
- _e_actions_cb_kill_dialog_cancel, NULL);
- e_dialog_button_focus_num(kill_dialog, 1);
- //elm_win_center(kill_dialog->win, 1, 1);
- e_dialog_show(kill_dialog);
-}
-
/***************************************************************************/
ACT_FN_GO(window_sticky_toggle, EINA_UNUSED)
{
e_action_predef_name_set(N_("Window : Actions"), N_("Close"),
"window_close", NULL, NULL, 0);
- /* window_kill */
- ACT_GO(window_kill);
- e_action_predef_name_set(N_("Window : Actions"), N_("Kill"),
- "window_kill", NULL, NULL, 0);
-
/* window_sticky_toggle */
ACT_GO(window_sticky_toggle);
e_action_predef_name_set(N_("Window : State"), N_("Sticky Mode Toggle"),
evas_object_pass_events_set(ec->frame, 1);
}
- E_FREE_FUNC(ec->border_prop_dialog, e_object_del);
E_FREE_FUNC(ec->color_editor, evas_object_del);
if (ec->focused)
ec->placed = 1;
ec->pre_cb.x = ec->x; ec->pre_cb.y = ec->y;
}
-#if 0
- else if ((ec->leader) && (ec->dialog))
- {
- /* TODO: Place in center of group */
- }
-#endif
else if (ec->dialog)
{
tx = zx + ((zw - ec->w) / 2);
if (!e_util_strcmp(ec->border.name, name)) return EINA_TRUE;
if (ec->mwm.borderless && name && strcmp(name, "borderless"))
{
- e_util_dialog_show(_("Client Error!"), _("Something has attempted to set a border when it shouldn't! Report this!"));
CRI("border change attempted for MWM borderless client!");
}
pborder = ec->border.name;
Eina_List *stick_desks;
Evas_Object *color_editor;
- E_Dialog *border_prop_dialog;
Eina_List *pending_resize;
struct
static E_Config_DD *_e_config_socket_access_edd = NULL;
static E_Config_DD *_e_config_aux_hint_supported_edd = NULL;
-#if 0
-static E_Dialog *_e_config_error_dialog = NULL;
-
-static void
-_e_config_error_dialog_cb_delete(void *dia)
-{
- if (dia == _e_config_error_dialog)
- _e_config_error_dialog = NULL;
-}
-#endif
-
static void
_e_config_edd_shutdown(void)
{
return data;
}
-#if 0
-static void
-_e_config_mv_error(const char *from, const char *to)
-{
- E_Dialog *dia;
- char buf[8192];
-
- if (_e_config_error_dialog) return;
-
- dia = e_dialog_new(NULL, "E", "_sys_error_logout_slow");
- EINA_SAFETY_ON_NULL_RETURN(dia);
-
- e_dialog_title_set(dia, _("Enlightenment Settings Write Problems"));
- e_dialog_icon_set(dia, "dialog-error", 64);
- snprintf(buf, sizeof(buf),
- _("Enlightenment has had an error while moving config files<br>"
- "from:<br>"
- "%s<br>"
- "<br>"
- "to:<br>"
- "%s<br>"
- "<br>"
- "The rest of the write has been aborted for safety.<br>"),
- from, to);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
- e_dialog_button_focus_num(dia, 0);
- //elm_win_center(dia->win, 1, 1);
- e_object_del_attach_func_set(E_OBJECT(dia),
- _e_config_error_dialog_cb_delete);
- e_dialog_show(dia);
- _e_config_error_dialog = dia;
-}
-#endif
-
E_API int
e_config_profile_save(void)
{
static Eina_Bool
_e_config_cb_timer(void *data)
{
- e_util_dialog_show(_("Settings Upgraded"), "%s", (char *)data);
return 0;
}
}
if (erstr)
{
- // TODO - yigl
-#if 0
- /* delete any partially-written file */
- ecore_file_unlink(file);
- /* only show dialog for first error - further ones are likely */
- /* more of the same error */
- if (!_e_config_error_dialog)
- {
- E_Dialog *dia;
-
- dia = e_dialog_new(NULL, "E", "_sys_error_logout_slow");
- if (dia)
- {
- char buf[8192];
-
- e_dialog_title_set(dia, _("Enlightenment Settings Write Problems"));
- e_dialog_icon_set(dia, "dialog-error", 64);
- snprintf(buf, sizeof(buf),
- _("Enlightenment has had an error while writing<br>"
- "its config file.<br>"
- "%s<br>"
- "<br>"
- "The file where the error occurred was:<br>"
- "%s<br>"
- "<br>"
- "This file has been deleted to avoid corrupt data.<br>"),
- erstr, file);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
- e_dialog_button_focus_num(dia, 0);
- //elm_win_center(dia->win, 1, 1);
- e_object_del_attach_func_set(E_OBJECT(dia),
- _e_config_error_dialog_cb_delete);
- e_dialog_show(dia);
- _e_config_error_dialog = dia;
- }
- }
- return 0;
-#else
ELOGF("CFG", "EET ERROR %s", NULL, erstr);
return 0;
-#endif
}
return 1;
}
+++ /dev/null
-#ifdef E_TYPEDEFS
-
-typedef struct _E_Dialog E_Dialog;
-typedef struct _E_Dialog_Button E_Dialog_Button;
-
-#else
-#ifndef E_DIALOG_H
-#define E_DIALOG_H
-
-#define E_DIALOG_TYPE 0xE0b01012
-
-struct _E_Dialog
-{
- E_Object e_obj_inherit;
-
- Evas_Object *win;
- Evas_Object *bg_object;
- Evas_Object *box_object;
- Evas_Object *text_object;
- Evas_Object *content_object;
- Evas_Object *icon_object;
- Evas_Object *event_object;
- Eina_List *buttons;
- void *data;
- int min_w, min_h;
- unsigned char resizable : 1;
-};
-
-typedef void (*E_Dialog_Cb)(void *data, E_Dialog *dia);
-
-E_API E_Dialog *e_dialog_new (Evas_Object *parent, const char *name, const char *dialog_class);
-E_API E_Dialog *e_dialog_normal_win_new (Evas_Object *parent, const char *name, const char *dialog_class);
-E_API void e_dialog_button_add (E_Dialog *dia, const char *label, const char *icon, E_Dialog_Cb func, void *data);
-E_API int e_dialog_button_focus_num (E_Dialog *dia, int button);
-E_API int e_dialog_button_disable_num_set (E_Dialog *dia, int button, int disabled);
-E_API int e_dialog_button_disable_num_get (E_Dialog *dia, int button);
-E_API void e_dialog_title_set (E_Dialog *dia, const char *title);
-E_API void e_dialog_text_set (E_Dialog *dia, const char *text);
-E_API void e_dialog_icon_set (E_Dialog *dia, const char *icon, Evas_Coord size);
-E_API void e_dialog_border_icon_set (E_Dialog *dia, const char *icon);
-E_API void e_dialog_content_set (E_Dialog *dia, Evas_Object *obj, Evas_Coord minw, Evas_Coord minh);
-E_API void e_dialog_resizable_set (E_Dialog *dia, int resizable);
-E_API void e_dialog_show (E_Dialog *dia);
-
-#endif
-#endif
#include "e_maximize.h"
#include "e_grabinput.h"
#include "e_bg.h"
-#include "e_dialog.h"
#include "e_screensaver.h"
#include "e_dpms.h"
#include "e_eom.h"
-#include "e_obj_dialog.h"
#include "e_mouse.h"
#include "e_msgbus.h"
#include "e_scale.h"
/* local subsystem functions */
static void _e_module_free(E_Module *m);
-static void _e_module_dialog_disable_defer(const char *title, const char *body, E_Module *m);
-static void _e_module_dialog_disable_create(const char *title, const char *body, E_Module *m);
-static void _e_module_cb_dialog_disable(void *data, E_Dialog *dia);
static void _e_module_event_update_free(void *data, void *event);
static void _e_module_create_wm_start(void);
static int _e_module_sort_priority(const void *d1, const void *d2);
E_API int E_EVENT_MODULE_DEFER_JOB = 0;
static Eina_Stringshare *mod_src_path = NULL;
-static Eina_List *deferred_dialogs = NULL;
-
-typedef struct _Defer_Dialog
-{
- const char *title;
- const char *body;
- E_Module *m;
-} Defer_Dialog;
static Eina_Bool
_module_filter_cb(void *d EINA_UNUSED, Eio_File *ls EINA_UNUSED, const Eina_File_Direct_Info *info)
_("There was an error loading the module named: %s<br>"
"No module named %s could be found in the<br>"
"module search directories.<br>"), name, buf);
- _e_module_dialog_disable_create(_("Error loading Module"), body, m);
m->error = 1;
goto init_done;
}
"%s<br>"
"The error reported was:<br>"
"%s<br>"), name, buf, dlerror());
- _e_module_dialog_disable_create(_("Error loading Module"), body, m);
m->error = 1;
goto init_done;
}
"The error reported was:<br>"
"%s<br>"),
name, buf, _("Module does not contain all needed functions"));
- _e_module_dialog_disable_create(_("Error loading Module"), body, m);
m->api = NULL;
m->func.init = NULL;
m->func.shutdown = NULL;
snprintf(title, sizeof(title), _("Enlightenment %s Module"),
_(m->api->name));
- _e_module_dialog_disable_create(title, body, m);
m->api = NULL;
m->func.init = NULL;
m->func.shutdown = NULL;
}
}
-static void
-_e_module_dialog_disable_show(const char *title, const char *body, E_Module *m)
-{
- E_Dialog *dia;
- char buf[4096];
-
- printf("MODULE ERR:\n%s\n", body);
-
- dia = e_dialog_new(NULL, "E", "_module_unload_dialog");
-
- snprintf(buf, sizeof(buf), "%s<br>%s", body,
- _("What action should be taken with this module?<br>"));
-
- if (!dia) return;
-
- e_dialog_title_set(dia, title);
- e_dialog_icon_set(dia, "enlightenment", 64);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("Unload"), NULL, _e_module_cb_dialog_disable, m);
- e_dialog_button_add(dia, _("Keep"), NULL, NULL, NULL);
- //elm_win_center(dia->win, 1, 1);
- //e_win_no_remember_set(dia->win, 1);
- e_dialog_show(dia);
-}
-
E_API void
e_module_deferred_job(void)
{
- Defer_Dialog *dd;
-
ecore_event_add(E_EVENT_MODULE_DEFER_JOB, NULL, NULL, NULL);
-
- if (!deferred_dialogs) return;
-
- EINA_LIST_FREE(deferred_dialogs, dd)
- {
- _e_module_dialog_disable_show(dd->title, dd->body, dd->m);
- eina_stringshare_del(dd->title);
- eina_stringshare_del(dd->body);
- E_FREE(dd);
- }
}
/* local subsystem functions */
free(m);
}
-typedef struct Disable_Dialog
-{
- char *title;
- char *body;
- E_Module *m;
-} Disable_Dialog;
-
-static void
-_e_module_dialog_disable_defer(const char *title, const char *body, E_Module *m)
-{
- Defer_Dialog *dd;
-
- dd = E_NEW(Defer_Dialog, 1);
- if (!dd)
- {
- ERR("Failed to allocate Defer_Dialog");
- return;
- }
-
- dd->title = eina_stringshare_add(title);
- dd->body = eina_stringshare_add(body);
- dd->m = m;
-
- deferred_dialogs = eina_list_append(deferred_dialogs, dd);
-}
-
-static Eina_Bool
-_e_module_dialog_disable_timer(Disable_Dialog *dd)
-{
- _e_module_dialog_disable_show(dd->title, dd->body, dd->m);
- free(dd->title);
- free(dd->body);
- free(dd);
- return EINA_FALSE;
-}
-
-static void
-_e_module_dialog_disable_create(const char *title, const char *body, E_Module *m)
-{
- Disable_Dialog *dd;
-
-#ifdef ENABLE_QUICK_INIT
- if (!_e_modules_init_end)
- {
- _e_module_dialog_disable_defer(title, body, m);
- return;
- }
-#endif
-
- dd = E_NEW(Disable_Dialog, 1);
- if (!dd) return;
- dd->title = strdup(title);
- dd->body = strdup(body);
- dd->m = m;
- ecore_timer_add(1.5, (Ecore_Task_Cb)_e_module_dialog_disable_timer, dd);
-}
-
-static void
-_e_module_cb_dialog_disable(void *data, E_Dialog *dia)
-{
- E_Module *m;
-
- m = data;
- e_module_disable(m);
- e_object_del(E_OBJECT(m));
- e_object_del(E_OBJECT(dia));
- e_config_save_queue();
-}
-
static int
_e_module_sort_priority(const void *d1, const void *d2)
{
+++ /dev/null
-#ifdef E_TYPEDEFS
-
-typedef struct _E_Obj_Dialog E_Obj_Dialog;
-
-#else
-#ifndef E_OBJ_DIALOG_H
-#define E_OBJ_DIALOG_H
-
-#define E_OBJ_DIALOG_TYPE 0xE0b0101b
-
-struct _E_Obj_Dialog
-{
- E_Object e_obj_inherit;
-
- Evas_Object *win;
- Evas_Object *bg_object;
- void *data;
- void (*cb_delete)(E_Obj_Dialog *od);
-};
-
-E_API E_Obj_Dialog *e_obj_dialog_new(char *title, char *class_name, char *class_class);
-E_API void e_obj_dialog_icon_set(E_Obj_Dialog *od, char *icon);
-E_API void e_obj_dialog_show(E_Obj_Dialog *od);
-E_API void e_obj_dialog_obj_part_text_set(E_Obj_Dialog *od, const char *part, const char *text);
-E_API void e_obj_dialog_obj_theme_set(E_Obj_Dialog *od, char *theme_cat, char *theme_obj);
-E_API void e_obj_dialog_cb_delete_set(E_Obj_Dialog *od, void (*func)(E_Obj_Dialog *od));
-
-#endif
-#endif
return ret;
}
-EINTERN E_Dialog *
-e_util_dialog_internal(const char *title, const char *txt)
-{
- E_Dialog *dia;
-
- dia = e_dialog_new(NULL, "E", "_error_dialog");
- if (!dia) return NULL;
- e_dialog_title_set(dia, title);
- e_dialog_text_set(dia, txt);
- e_dialog_icon_set(dia, "dialog-error", 64);
- e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
- e_dialog_button_focus_num(dia, 0);
- //elm_win_center(dia->win, 1, 1);
- e_dialog_show(dia);
- return dia;
-}
-
EINTERN const char *
e_util_filename_escape(const char *filename)
{
{
if (!ecore_file_mkpath(dir))
{
- e_util_dialog_show(_("Error creating directory"), _("Failed to create directory: %s .<br>Check that you have correct permissions set."), dir);
+ ERR("Error creating directory. Failed to create directory: %s .Check that you have correct permissions set.", dir);
return 0;
}
}
{
if (!ecore_file_is_dir(dir))
{
- e_util_dialog_show(_("Error creating directory"), _("Failed to create directory: %s .<br>A file of that name already exists."), dir);
+ ERR("Error creating directory. Failed to create directory: %s . A file of that name already exists.", dir);
return 0;
}
}
_e_util_conf_timer_old(void *data)
{
char *module_name = data;
- char buf[4096];
- char *msg = _("Configuration data needed upgrading. Your old configuration<br>"
- "has been wiped and a new set of defaults initialized. This<br>"
- "will happen regularly during development, so don't report a<br>"
- "bug. This means the module needs new configuration<br>"
- "data by default for usable functionality that your old<br>"
- "configuration lacked. This new set of defaults will fix<br>"
- "that by adding it in. You can re-configure things now to your<br>"
- "liking. Sorry for the hiccup in your configuration.<br>");
-
- snprintf(buf, sizeof(buf), N_("%s Configuration Updated"), module_name);
- e_util_dialog_internal(buf, msg);
+
E_FREE(module_name);
return ECORE_CALLBACK_CANCEL;
_e_util_conf_timer_new(void *data)
{
char *module_name = data;
- char buf[4096];
- char *msg =
- _("Your module configuration is NEWER "
- "than the module version. This is "
- "very<br>strange. This should not happen unless"
- " you downgraded<br>the module or "
- "copied the configuration from a place where"
- "<br>a newer version of the module "
- "was running. This is bad and<br>as a "
- "precaution your configuration has been now "
- "restored to<br>defaults. Sorry for the "
- "inconvenience.<br>");
-
- snprintf(buf, sizeof(buf), _("%s Configuration Updated"), module_name);
- e_util_dialog_internal(buf, msg);
+
E_FREE(module_name);
return ECORE_CALLBACK_CANCEL;
void *data;
};
-#define e_util_dialog_show(title, args...) \
-{ \
- char __tmpbuf[4096]; \
- \
- snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \
- e_util_dialog_internal(title, __tmpbuf); \
-}
-
/* These macros are used to just mark strings for translation, this is useful
* for string lists which are not dynamically allocated
*/
EINTERN int e_util_glob_case_match(const char *str, const char *glob);
EINTERN int e_util_strcasecmp(const char *s1, const char *s2);
E_API int e_util_strcmp(const char *s1, const char *s2);
-
EINTERN int e_util_both_str_empty(const char *s1, const char *s2);
EINTERN unsigned int e_util_icon_size_normalize(unsigned int desired);
EINTERN E_Client *e_util_desk_client_above(E_Client *ec);
EINTERN E_Client *e_util_desk_client_below(E_Client *ec);
EINTERN int e_util_edje_collection_exists(const char *file, const char *coll);
-EINTERN E_Dialog *e_util_dialog_internal(const char *title, const char *txt);
EINTERN const char *e_util_filename_escape(const char *filename);
EINTERN char *e_util_size_string_get(off_t size);
EINTERN char *e_util_file_time_get(time_t ftime);