forked from enlightenment/enlightenment
parent
8933744cbd
commit
24d2cfc8fd
|
@ -3,35 +3,35 @@
|
||||||
struct _E_Config_Dialog_Data
|
struct _E_Config_Dialog_Data
|
||||||
{
|
{
|
||||||
Efreet_Desktop *desktop;
|
Efreet_Desktop *desktop;
|
||||||
int type; /* desktop type */
|
int type; /* desktop type */
|
||||||
|
|
||||||
char *name; /* app name (e.g. Firefox) */
|
char *name; /* app name (e.g. Firefox) */
|
||||||
char *generic_name; /* generic app name (e.g. Web Browser) */
|
char *generic_name; /* generic app name (e.g. Web Browser) */
|
||||||
char *comment; /* a longer description */
|
char *comment; /* a longer description */
|
||||||
char *exec; /* command to execute */
|
char *exec; /* command to execute */
|
||||||
char *try_exec; /* executable to test for an apps existence */
|
char *try_exec; /* executable to test for an apps existence */
|
||||||
char *url; /* url to open */
|
char *url; /* url to open */
|
||||||
|
|
||||||
char *startup_wm_class; /* window class */
|
char *startup_wm_class; /* window class */
|
||||||
char *categories; /* list of category names that app is in */
|
char *categories; /* list of category names that app is in */
|
||||||
char *mimes; /* list of mimes this app can handle */
|
char *mimes; /* list of mimes this app can handle */
|
||||||
char *icon; /* absolute path to file or icon name */
|
char *icon; /* absolute path to file or icon name */
|
||||||
|
|
||||||
int startup_notify;
|
int startup_notify;
|
||||||
int terminal;
|
int terminal;
|
||||||
int show_in_menus;
|
int show_in_menus;
|
||||||
|
|
||||||
E_Desktop_Edit *editor;
|
E_Desktop_Edit *editor;
|
||||||
|
|
||||||
char *orig_path; /* informational only */
|
char *orig_path; /* informational only */
|
||||||
Evas_Object *orig_path_entry; /* to set when info changes */
|
Evas_Object *orig_path_entry; /* to set when info changes */
|
||||||
Evas_Object *icon_entry; /* to set when icon changes */
|
Evas_Object *icon_entry; /* to set when icon changes */
|
||||||
|
|
||||||
/* speed up check_changed tests */
|
/* speed up check_changed tests */
|
||||||
Eina_Bool changed_categories;
|
Eina_Bool changed_categories;
|
||||||
Eina_Bool changed_mimes;
|
Eina_Bool changed_mimes;
|
||||||
Eina_Bool edited_categories;
|
Eina_Bool edited_categories;
|
||||||
Eina_Bool edited_mimes;
|
Eina_Bool edited_mimes;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* local subsystem functions */
|
/* local subsystem functions */
|
||||||
|
@ -56,10 +56,12 @@ static void _e_desktop_editor_exec_update(E_Config_Dialog_Data *cfdata);
|
||||||
static void _e_desktop_edit_select_cb(void *data, Evas_Object *obj);
|
static void _e_desktop_edit_select_cb(void *data, Evas_Object *obj);
|
||||||
static void _e_desktop_editor_icon_entry_changed(void *data, Evas_Object *obj);
|
static void _e_desktop_editor_icon_entry_changed(void *data, Evas_Object *obj);
|
||||||
|
|
||||||
#define IFADD(src, dst) if (src) dst = eina_stringshare_add(src); else dst = NULL
|
#define IFADD(src, dst) if (src) dst = eina_stringshare_add(src); else \
|
||||||
#define IFDEL(src) if (src) eina_stringshare_del(src); src = NULL;
|
dst = NULL
|
||||||
#define IFDUP(src, dst) if (src) dst = strdup(src); else dst = NULL
|
#define IFDEL(src) if (src) eina_stringshare_del(src); src = NULL;
|
||||||
#define IFFREE(src) if (src) free(src); src = NULL;
|
#define IFDUP(src, dst) if (src) dst = strdup(src); else \
|
||||||
|
dst = NULL
|
||||||
|
#define IFFREE(src) if (src) free(src); src = NULL;
|
||||||
|
|
||||||
/* externally accessible functions */
|
/* externally accessible functions */
|
||||||
|
|
||||||
|
@ -86,39 +88,41 @@ e_desktop_border_create(E_Border *bd)
|
||||||
|
|
||||||
if (bname)
|
if (bname)
|
||||||
{
|
{
|
||||||
snprintf(path, sizeof(path), "%s/%s.desktop", desktop_dir, bname);
|
snprintf(path, sizeof(path), "%s/%s.desktop", desktop_dir, bname);
|
||||||
desktop = efreet_desktop_empty_new(path);
|
desktop = efreet_desktop_empty_new(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 1; i < 65536; i++)
|
for (i = 1; i < 65536; i++)
|
||||||
{
|
{
|
||||||
snprintf(path, sizeof(path), "%s/_new_app-%i.desktop",
|
snprintf(path, sizeof(path), "%s/_new_app-%i.desktop",
|
||||||
desktop_dir, i);
|
desktop_dir, i);
|
||||||
if (!ecore_file_exists(path))
|
if (!ecore_file_exists(path))
|
||||||
{
|
{
|
||||||
desktop = efreet_desktop_empty_new(path);
|
desktop = efreet_desktop_empty_new(path);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!desktop)
|
if (!desktop)
|
||||||
{
|
{
|
||||||
snprintf(path, sizeof(path), "%s/_rename_me-%i.desktop",
|
snprintf(path, sizeof(path), "%s/_rename_me-%i.desktop",
|
||||||
desktop_dir, (int)ecore_time_get());
|
desktop_dir, (int)ecore_time_get());
|
||||||
desktop = efreet_desktop_empty_new(NULL);
|
desktop = efreet_desktop_empty_new(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!desktop)
|
if (!desktop)
|
||||||
{
|
{
|
||||||
//XXX out of memory?
|
//XXX out of memory?
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (bclass) desktop->name = strdup(bclass);
|
if (bclass) desktop->name = strdup(bclass);
|
||||||
else if (bname) desktop->name = strdup(bname);
|
else if (bname)
|
||||||
else if (btitle) desktop->name = strdup(btitle);
|
desktop->name = strdup(bname);
|
||||||
|
else if (btitle)
|
||||||
|
desktop->name = strdup(btitle);
|
||||||
|
|
||||||
if (btitle) desktop->comment = strdup(btitle);
|
if (btitle) desktop->comment = strdup(btitle);
|
||||||
|
|
||||||
|
@ -133,15 +137,15 @@ e_desktop_border_create(E_Border *bd)
|
||||||
// if (bd->client.netwm.startup_id > 0) desktop->startup_notify = 1;
|
// if (bd->client.netwm.startup_id > 0) desktop->startup_notify = 1;
|
||||||
if (bd->client.netwm.icons)
|
if (bd->client.netwm.icons)
|
||||||
{
|
{
|
||||||
/* FIXME
|
/* FIXME
|
||||||
* - Find the icon with the best size
|
* - Find the icon with the best size
|
||||||
* - Should use mkstemp
|
* - Should use mkstemp
|
||||||
*/
|
*/
|
||||||
snprintf(path, sizeof(path), "%s/%s-%.6f.png", icon_dir, bname, ecore_time_get());
|
snprintf(path, sizeof(path), "%s/%s-%.6f.png", icon_dir, bname, ecore_time_get());
|
||||||
if (e_util_icon_save(&(bd->client.netwm.icons[0]), path))
|
if (e_util_icon_save(&(bd->client.netwm.icons[0]), path))
|
||||||
desktop->icon = strdup(path);
|
desktop->icon = strdup(path);
|
||||||
else
|
else
|
||||||
fprintf(stderr, "Could not save file from ARGB: %s\n", path);
|
fprintf(stderr, "Could not save file from ARGB: %s\n", path);
|
||||||
}
|
}
|
||||||
return desktop;
|
return desktop;
|
||||||
}
|
}
|
||||||
|
@ -162,34 +166,34 @@ e_desktop_border_edit(E_Container *con, E_Border *bd)
|
||||||
it with values from the border */
|
it with values from the border */
|
||||||
if (!editor->desktop)
|
if (!editor->desktop)
|
||||||
{
|
{
|
||||||
editor->desktop = e_desktop_border_create(bd);
|
editor->desktop = e_desktop_border_create(bd);
|
||||||
if ((editor->desktop) && (editor->desktop->icon))
|
if ((editor->desktop) && (editor->desktop->icon))
|
||||||
editor->tmp_image_path = strdup(editor->desktop->icon);
|
editor->tmp_image_path = strdup(editor->desktop->icon);
|
||||||
new_desktop = 1;
|
new_desktop = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if ((!bname) && (!bclass))
|
if ((!bname) && (!bclass))
|
||||||
{
|
{
|
||||||
e_util_dialog_show(_("Incomplete Window Properties"),
|
e_util_dialog_show(_("Incomplete Window Properties"),
|
||||||
_("The window you are creating an icon for<br>"
|
_("The window you are creating an icon for<br>"
|
||||||
"does not contain window name and class<br>"
|
"does not contain window name and class<br>"
|
||||||
"properties, so the needed properties for<br>"
|
"properties, so the needed properties for<br>"
|
||||||
"the icon so that it will be used for this<br>"
|
"the icon so that it will be used for this<br>"
|
||||||
"window cannot be guessed. You will need to<br>"
|
"window cannot be guessed. You will need to<br>"
|
||||||
"use the window title instead. This will only<br>"
|
"use the window title instead. This will only<br>"
|
||||||
"work if the window title is the same at<br>"
|
"work if the window title is the same at<br>"
|
||||||
"the time the window starts up, and does not<br>"
|
"the time the window starts up, and does not<br>"
|
||||||
"change."));
|
"change."));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!_e_desktop_edit_view_create(editor, con))
|
if (!_e_desktop_edit_view_create(editor, con))
|
||||||
{
|
{
|
||||||
e_object_del(E_OBJECT(editor));
|
e_object_del(E_OBJECT(editor));
|
||||||
editor = NULL;
|
editor = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
e_config_dialog_changed_set(editor->cfd, new_desktop);
|
e_config_dialog_changed_set(editor->cfd, new_desktop);
|
||||||
|
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
|
@ -205,8 +209,8 @@ e_desktop_edit(E_Container *con, Efreet_Desktop *desktop)
|
||||||
if (desktop) editor->desktop = desktop;
|
if (desktop) editor->desktop = desktop;
|
||||||
if (!_e_desktop_edit_view_create(editor, con))
|
if (!_e_desktop_edit_view_create(editor, con))
|
||||||
{
|
{
|
||||||
e_object_del(E_OBJECT(editor));
|
e_object_del(E_OBJECT(editor));
|
||||||
editor = NULL;
|
editor = NULL;
|
||||||
}
|
}
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
|
@ -220,21 +224,21 @@ _e_desktop_edit_view_create(E_Desktop_Edit *editor, E_Container *con)
|
||||||
if (!v) return 0;
|
if (!v) return 0;
|
||||||
|
|
||||||
/* view methods */
|
/* view methods */
|
||||||
v->create_cfdata = _e_desktop_edit_create_data;
|
v->create_cfdata = _e_desktop_edit_create_data;
|
||||||
v->free_cfdata = _e_desktop_edit_free_data;
|
v->free_cfdata = _e_desktop_edit_free_data;
|
||||||
v->basic.apply_cfdata = _e_desktop_edit_basic_apply_data;
|
v->basic.apply_cfdata = _e_desktop_edit_basic_apply_data;
|
||||||
v->basic.create_widgets = _e_desktop_edit_basic_create_widgets;
|
v->basic.create_widgets = _e_desktop_edit_basic_create_widgets;
|
||||||
v->basic.check_changed = _e_desktop_edit_basic_check_changed;
|
v->basic.check_changed = _e_desktop_edit_basic_check_changed;
|
||||||
|
|
||||||
editor->cfd =
|
editor->cfd =
|
||||||
e_config_dialog_new(con, _("Desktop Entry Editor"), "E",
|
e_config_dialog_new(con, _("Desktop Entry Editor"), "E",
|
||||||
"applications/new_application",
|
"applications/new_application",
|
||||||
"preferences-applications", 0, v, editor);
|
"preferences-applications", 0, v, editor);
|
||||||
|
|
||||||
if (!editor->cfd)
|
if (!editor->cfd)
|
||||||
{
|
{
|
||||||
E_FREE(v);
|
E_FREE(v);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -279,37 +283,37 @@ _e_desktop_edit_create_data(E_Config_Dialog *cfd)
|
||||||
path[0] = '\0';
|
path[0] = '\0';
|
||||||
if (cfdata->editor->desktop)
|
if (cfdata->editor->desktop)
|
||||||
{
|
{
|
||||||
char dir[PATH_MAX];
|
char dir[PATH_MAX];
|
||||||
const char *file;
|
const char *file;
|
||||||
|
|
||||||
if (ecore_file_can_write (cfdata->editor->desktop->orig_path))
|
if (ecore_file_can_write(cfdata->editor->desktop->orig_path))
|
||||||
cfdata->desktop = efreet_desktop_uncached_new(cfdata->editor->desktop->orig_path);
|
cfdata->desktop = efreet_desktop_uncached_new(cfdata->editor->desktop->orig_path);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf(dir, sizeof(dir), "%s/applications", efreet_data_home_get());
|
snprintf(dir, sizeof(dir), "%s/applications", efreet_data_home_get());
|
||||||
if (!strncmp(dir, cfdata->editor->desktop->orig_path, strlen(dir)))
|
if (!strncmp(dir, cfdata->editor->desktop->orig_path, strlen(dir)))
|
||||||
cfdata->desktop = efreet_desktop_uncached_new(cfdata->editor->desktop->orig_path);
|
cfdata->desktop = efreet_desktop_uncached_new(cfdata->editor->desktop->orig_path);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* file not in user's dir, so create new desktop that points there */
|
/* file not in user's dir, so create new desktop that points there */
|
||||||
if (!ecore_file_exists(dir)) ecore_file_mkdir(dir);
|
if (!ecore_file_exists(dir)) ecore_file_mkdir(dir);
|
||||||
file = ecore_file_file_get(cfdata->editor->desktop->orig_path);
|
file = ecore_file_file_get(cfdata->editor->desktop->orig_path);
|
||||||
snprintf(path, sizeof(path), "%s/%s", dir, file);
|
snprintf(path, sizeof(path), "%s/%s", dir, file);
|
||||||
/*
|
/*
|
||||||
* if a file already exists in the user dir with this name, we
|
* if a file already exists in the user dir with this name, we
|
||||||
* fetch the pointer to it, so the caches stay consistent (this
|
* fetch the pointer to it, so the caches stay consistent (this
|
||||||
* probably will never return non null, since the ui shouldn't
|
* probably will never return non null, since the ui shouldn't
|
||||||
* provide a means to edit a file in a system dir when one
|
* provide a means to edit a file in a system dir when one
|
||||||
* exists in the user's
|
* exists in the user's
|
||||||
*/
|
*/
|
||||||
cfdata->desktop = efreet_desktop_uncached_new(path);
|
cfdata->desktop = efreet_desktop_uncached_new(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
desktop = cfdata->editor->desktop;
|
desktop = cfdata->editor->desktop;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cfdata->desktop)
|
if (!cfdata->desktop)
|
||||||
cfdata->desktop = efreet_desktop_empty_new(path);
|
cfdata->desktop = efreet_desktop_empty_new(path);
|
||||||
|
|
||||||
if (!desktop) desktop = cfdata->desktop;
|
if (!desktop) desktop = cfdata->desktop;
|
||||||
|
|
||||||
|
@ -349,12 +353,12 @@ _e_desktop_edit_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data
|
||||||
{
|
{
|
||||||
if (cfdata->editor->tmp_image_path)
|
if (cfdata->editor->tmp_image_path)
|
||||||
{
|
{
|
||||||
if ((!cfdata->desktop) || (!cfdata->editor->saved) ||
|
if ((!cfdata->desktop) || (!cfdata->editor->saved) ||
|
||||||
(!cfdata->desktop->icon) ||
|
(!cfdata->desktop->icon) ||
|
||||||
(strcmp(cfdata->editor->tmp_image_path, cfdata->desktop->icon)))
|
(strcmp(cfdata->editor->tmp_image_path, cfdata->desktop->icon)))
|
||||||
{
|
{
|
||||||
ecore_file_unlink(cfdata->editor->tmp_image_path);
|
ecore_file_unlink(cfdata->editor->tmp_image_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cfdata->desktop) efreet_desktop_free(cfdata->desktop);
|
if (cfdata->desktop) efreet_desktop_free(cfdata->desktop);
|
||||||
|
|
||||||
|
@ -388,32 +392,32 @@ _e_desktop_edit_user_local_desktop_filename_generate(E_Config_Dialog_Data *cfdat
|
||||||
if ((cfdata->name) && (cfdata->name[0]))
|
if ((cfdata->name) && (cfdata->name[0]))
|
||||||
name = cfdata->name;
|
name = cfdata->name;
|
||||||
else if ((cfdata->desktop) && (cfdata->desktop->name) &&
|
else if ((cfdata->desktop) && (cfdata->desktop->name) &&
|
||||||
(cfdata->desktop->name[0]))
|
(cfdata->desktop->name[0]))
|
||||||
name = cfdata->name;
|
name = cfdata->name;
|
||||||
else
|
else
|
||||||
name = NULL;
|
name = NULL;
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
{
|
{
|
||||||
const char *s = name;
|
const char *s = name;
|
||||||
for (i = 0; i < sizeof(buf) && s[i]; i++)
|
for (i = 0; i < sizeof(buf) && s[i]; i++)
|
||||||
{
|
{
|
||||||
if (isalnum(s[i]))
|
if (isalnum(s[i]))
|
||||||
buf[i] = s[i];
|
buf[i] = s[i];
|
||||||
else
|
else
|
||||||
buf[i] = '_';
|
buf[i] = '_';
|
||||||
}
|
}
|
||||||
buf[i] = '\0';
|
buf[i] = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
eina_strlcpy(buf, "unnamed_desktop", sizeof(buf));
|
eina_strlcpy(buf, "unnamed_desktop", sizeof(buf));
|
||||||
|
|
||||||
i = snprintf(path, PATH_MAX, "%s/applications/%s.desktop",
|
i = snprintf(path, PATH_MAX, "%s/applications/%s.desktop",
|
||||||
efreet_data_home_get(), buf);
|
efreet_data_home_get(), buf);
|
||||||
if (i >= PATH_MAX)
|
if (i >= PATH_MAX)
|
||||||
{
|
{
|
||||||
path[0] = '\0';
|
path[0] = '\0';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
prefix = i - (sizeof(".desktop") - 1);
|
prefix = i - (sizeof(".desktop") - 1);
|
||||||
|
|
||||||
|
@ -431,8 +435,8 @@ _e_desktop_edit_update_orig_path(E_Config_Dialog_Data *cfdata)
|
||||||
orig_path = cfdata->desktop->orig_path;
|
orig_path = cfdata->desktop->orig_path;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_e_desktop_edit_user_local_desktop_filename_generate(cfdata, path);
|
_e_desktop_edit_user_local_desktop_filename_generate(cfdata, path);
|
||||||
orig_path = cfdata->orig_path = strdup(path);
|
orig_path = cfdata->orig_path = strdup(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfdata->orig_path_entry)
|
if (cfdata->orig_path_entry)
|
||||||
|
@ -454,16 +458,17 @@ _e_desktop_edit_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialo
|
||||||
|
|
||||||
switch (cfdata->type)
|
switch (cfdata->type)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
IFFREE(cfdata->desktop->url);
|
IFFREE(cfdata->desktop->url);
|
||||||
IFDUP(cfdata->url, cfdata->desktop->url);
|
IFDUP(cfdata->url, cfdata->desktop->url);
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
IFFREE(cfdata->desktop->exec);
|
default:
|
||||||
IFDUP(cfdata->exec, cfdata->desktop->exec);
|
IFFREE(cfdata->desktop->exec);
|
||||||
IFFREE(cfdata->desktop->try_exec);
|
IFDUP(cfdata->exec, cfdata->desktop->exec);
|
||||||
IFDUP(cfdata->try_exec, cfdata->desktop->try_exec);
|
IFFREE(cfdata->desktop->try_exec);
|
||||||
break;
|
IFDUP(cfdata->try_exec, cfdata->desktop->try_exec);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
IFFREE(cfdata->desktop->generic_name);
|
IFFREE(cfdata->desktop->generic_name);
|
||||||
|
@ -490,9 +495,9 @@ _e_desktop_edit_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialo
|
||||||
cfdata->editor->saved = efreet_desktop_save(cfdata->desktop);
|
cfdata->editor->saved = efreet_desktop_save(cfdata->desktop);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_e_desktop_edit_update_orig_path(cfdata);
|
_e_desktop_edit_update_orig_path(cfdata);
|
||||||
cfdata->editor->saved = efreet_desktop_save_as
|
cfdata->editor->saved = efreet_desktop_save_as
|
||||||
(cfdata->desktop, cfdata->orig_path);
|
(cfdata->desktop, cfdata->orig_path);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -507,21 +512,21 @@ _e_desktop_edit_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Di
|
||||||
(cfdata->show_in_menus != !cfdata->desktop->no_display))
|
(cfdata->show_in_menus != !cfdata->desktop->no_display))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
#define CHECK(k) \
|
#define CHECK(k) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
const char *__k; \
|
const char *__k; \
|
||||||
if (cfdata->desktop->k) \
|
if (cfdata->desktop->k) \
|
||||||
__k = cfdata->desktop->k; \
|
__k = cfdata->desktop->k; \
|
||||||
else if ((cfdata->editor) && (cfdata->editor->desktop)) \
|
else if ((cfdata->editor) && (cfdata->editor->desktop)) \
|
||||||
__k = cfdata->editor->desktop->k; \
|
__k = cfdata->editor->desktop->k; \
|
||||||
else \
|
else \
|
||||||
__k = NULL; \
|
__k = NULL; \
|
||||||
if ((cfdata->k && !__k) || (!cfdata->k && __k) || \
|
if ((cfdata->k && !__k) || (!cfdata->k && __k) || \
|
||||||
(cfdata->k && __k && strcmp(cfdata->k, __k) != 0)) \
|
(cfdata->k && __k && strcmp(cfdata->k, __k) != 0)) \
|
||||||
return 1; \
|
return 1; \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
CHECK(name);
|
CHECK(name);
|
||||||
CHECK(exec);
|
CHECK(exec);
|
||||||
|
@ -537,90 +542,89 @@ _e_desktop_edit_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Di
|
||||||
|
|
||||||
if (cfdata->edited_categories)
|
if (cfdata->edited_categories)
|
||||||
{
|
{
|
||||||
const char *str;
|
const char *str;
|
||||||
Eina_List *lst, *old_lst;
|
Eina_List *lst, *old_lst;
|
||||||
|
|
||||||
cfdata->edited_categories = EINA_FALSE;
|
cfdata->edited_categories = EINA_FALSE;
|
||||||
cfdata->changed_categories = EINA_FALSE;
|
cfdata->changed_categories = EINA_FALSE;
|
||||||
|
|
||||||
if (cfdata->desktop->categories)
|
if (cfdata->desktop->categories)
|
||||||
old_lst = cfdata->desktop->categories;
|
old_lst = cfdata->desktop->categories;
|
||||||
else if ((cfdata->editor) && (cfdata->editor->desktop))
|
else if ((cfdata->editor) && (cfdata->editor->desktop))
|
||||||
old_lst = cfdata->editor->desktop->categories;
|
old_lst = cfdata->editor->desktop->categories;
|
||||||
else
|
else
|
||||||
old_lst = NULL;
|
old_lst = NULL;
|
||||||
|
|
||||||
lst = efreet_desktop_string_list_parse(cfdata->categories);
|
lst = efreet_desktop_string_list_parse(cfdata->categories);
|
||||||
if (eina_list_count(lst) != eina_list_count(old_lst))
|
if (eina_list_count(lst) != eina_list_count(old_lst))
|
||||||
cfdata->changed_categories = EINA_TRUE;
|
cfdata->changed_categories = EINA_TRUE;
|
||||||
|
|
||||||
EINA_LIST_FREE(lst, str)
|
EINA_LIST_FREE(lst, str)
|
||||||
{
|
{
|
||||||
if (!cfdata->changed_categories)
|
if (!cfdata->changed_categories)
|
||||||
{
|
{
|
||||||
Eina_List *n;
|
Eina_List *n;
|
||||||
const char *old;
|
const char *old;
|
||||||
Eina_Bool found = EINA_FALSE;
|
Eina_Bool found = EINA_FALSE;
|
||||||
EINA_LIST_FOREACH(old_lst, n, old)
|
EINA_LIST_FOREACH(old_lst, n, old)
|
||||||
{
|
{
|
||||||
if (strcmp(str, old) == 0)
|
if (strcmp(str, old) == 0)
|
||||||
{
|
{
|
||||||
found = EINA_TRUE;
|
found = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
cfdata->changed_categories = EINA_TRUE;
|
cfdata->changed_categories = EINA_TRUE;
|
||||||
}
|
}
|
||||||
eina_stringshare_del(str);
|
eina_stringshare_del(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret |= cfdata->changed_categories;
|
ret |= cfdata->changed_categories;
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
if (cfdata->edited_mimes)
|
if (cfdata->edited_mimes)
|
||||||
{
|
{
|
||||||
const char *str;
|
const char *str;
|
||||||
Eina_List *lst, *old_lst;
|
Eina_List *lst, *old_lst;
|
||||||
|
|
||||||
cfdata->edited_mimes = EINA_FALSE;
|
cfdata->edited_mimes = EINA_FALSE;
|
||||||
cfdata->changed_mimes = EINA_FALSE;
|
cfdata->changed_mimes = EINA_FALSE;
|
||||||
|
|
||||||
if (cfdata->desktop->mime_types)
|
if (cfdata->desktop->mime_types)
|
||||||
old_lst = cfdata->desktop->mime_types;
|
old_lst = cfdata->desktop->mime_types;
|
||||||
else if ((cfdata->editor) && (cfdata->editor->desktop))
|
else if ((cfdata->editor) && (cfdata->editor->desktop))
|
||||||
old_lst = cfdata->editor->desktop->mime_types;
|
old_lst = cfdata->editor->desktop->mime_types;
|
||||||
else
|
else
|
||||||
old_lst = NULL;
|
old_lst = NULL;
|
||||||
|
|
||||||
lst = efreet_desktop_string_list_parse(cfdata->mimes);
|
lst = efreet_desktop_string_list_parse(cfdata->mimes);
|
||||||
if (eina_list_count(lst) != eina_list_count(old_lst))
|
if (eina_list_count(lst) != eina_list_count(old_lst))
|
||||||
cfdata->changed_mimes = EINA_TRUE;
|
cfdata->changed_mimes = EINA_TRUE;
|
||||||
|
|
||||||
EINA_LIST_FREE(lst, str)
|
EINA_LIST_FREE(lst, str)
|
||||||
{
|
{
|
||||||
if (!cfdata->changed_mimes)
|
if (!cfdata->changed_mimes)
|
||||||
{
|
{
|
||||||
Eina_List *n;
|
Eina_List *n;
|
||||||
const char *old;
|
const char *old;
|
||||||
Eina_Bool found = EINA_FALSE;
|
Eina_Bool found = EINA_FALSE;
|
||||||
EINA_LIST_FOREACH(old_lst, n, old)
|
EINA_LIST_FOREACH(old_lst, n, old)
|
||||||
{
|
{
|
||||||
if (strcmp(str, old) == 0)
|
if (strcmp(str, old) == 0)
|
||||||
{
|
{
|
||||||
found = EINA_TRUE;
|
found = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
cfdata->changed_mimes = EINA_TRUE;
|
cfdata->changed_mimes = EINA_TRUE;
|
||||||
}
|
}
|
||||||
eina_stringshare_del(str);
|
eina_stringshare_del(str);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
ret |= cfdata->changed_mimes;
|
||||||
ret |= cfdata->changed_mimes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -693,11 +697,11 @@ _e_desktop_edit_basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas
|
||||||
e_widget_table_object_append(ot, o, 0, 2, 1, 1, 1, 1, 0, 0);
|
e_widget_table_object_append(ot, o, 0, 2, 1, 1, 1, 1, 0, 0);
|
||||||
|
|
||||||
editor->entry_widget_exec = e_widget_entry_add
|
editor->entry_widget_exec = e_widget_entry_add
|
||||||
(evas, &(cfdata->exec), NULL, NULL, NULL);
|
(evas, &(cfdata->exec), NULL, NULL, NULL);
|
||||||
e_widget_table_object_append(ot, editor->entry_widget_exec, 1, 2, 1, 1, 1, 1, 1, 0);
|
e_widget_table_object_append(ot, editor->entry_widget_exec, 1, 2, 1, 1, 1, 1, 1, 0);
|
||||||
|
|
||||||
o = e_widget_button_add
|
o = e_widget_button_add
|
||||||
(evas, "...", NULL, _e_desktop_editor_cb_exec_select, cfdata, editor);
|
(evas, "...", NULL, _e_desktop_editor_cb_exec_select, cfdata, editor);
|
||||||
e_widget_table_object_append(ot, o, 2, 2, 1, 1, 0, 0, 0, 0);
|
e_widget_table_object_append(ot, o, 2, 2, 1, 1, 0, 0, 0, 0);
|
||||||
|
|
||||||
// desktop type: url
|
// desktop type: url
|
||||||
|
@ -705,7 +709,7 @@ _e_desktop_edit_basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas
|
||||||
e_widget_table_object_append(ot, o, 0, 3, 1, 1, 1, 1, 0, 0);
|
e_widget_table_object_append(ot, o, 0, 3, 1, 1, 1, 1, 0, 0);
|
||||||
|
|
||||||
editor->entry_widget_url = e_widget_entry_add
|
editor->entry_widget_url = e_widget_entry_add
|
||||||
(evas, &(cfdata->url), NULL, NULL, NULL);
|
(evas, &(cfdata->url), NULL, NULL, NULL);
|
||||||
e_widget_table_object_append(ot, editor->entry_widget_url, 1, 3, 1, 1, 1, 1, 1, 0);
|
e_widget_table_object_append(ot, editor->entry_widget_url, 1, 3, 1, 1, 1, 1, 1, 0);
|
||||||
// FIXME: add url selection dialog (file:/etc/..)
|
// FIXME: add url selection dialog (file:/etc/..)
|
||||||
|
|
||||||
|
@ -717,7 +721,7 @@ _e_desktop_edit_basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas
|
||||||
ot = e_widget_table_add(evas, 0);
|
ot = e_widget_table_add(evas, 0);
|
||||||
|
|
||||||
editor->img_widget = e_widget_button_add
|
editor->img_widget = e_widget_button_add
|
||||||
(evas, "", NULL, _e_desktop_editor_cb_icon_select, cfdata, editor);
|
(evas, "", NULL, _e_desktop_editor_cb_icon_select, cfdata, editor);
|
||||||
_e_desktop_editor_icon_update(cfdata);
|
_e_desktop_editor_icon_update(cfdata);
|
||||||
e_widget_size_min_set(editor->img_widget, 192, 192);
|
e_widget_size_min_set(editor->img_widget, 192, 192);
|
||||||
|
|
||||||
|
@ -774,7 +778,6 @@ _e_desktop_edit_basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas
|
||||||
e_widget_toolbook_page_append
|
e_widget_toolbook_page_append
|
||||||
(otb, NULL, _("General"), ot, 1, 0, 1, 0, 0.5, 0.0);
|
(otb, NULL, _("General"), ot, 1, 0, 1, 0, 0.5, 0.0);
|
||||||
|
|
||||||
|
|
||||||
ol = e_widget_list_add(evas, 0, 0);
|
ol = e_widget_list_add(evas, 0, 0);
|
||||||
o = e_widget_check_add(evas, _("Startup Notify"), &(cfdata->startup_notify));
|
o = e_widget_check_add(evas, _("Startup Notify"), &(cfdata->startup_notify));
|
||||||
e_widget_list_object_append(ol, o, 1, 0, 0.0);
|
e_widget_list_object_append(ol, o, 1, 0, 0.0);
|
||||||
|
@ -813,7 +816,7 @@ _e_desktop_editor_cb_icon_select(void *data1, void *data2)
|
||||||
dia = e_dialog_new(cfdata->editor->cfd->con, "E", "_eap_icon_select_dialog");
|
dia = e_dialog_new(cfdata->editor->cfd->con, "E", "_eap_icon_select_dialog");
|
||||||
if (!dia) return;
|
if (!dia) return;
|
||||||
e_object_del_attach_func_set(E_OBJECT(dia),
|
e_object_del_attach_func_set(E_OBJECT(dia),
|
||||||
_e_desktop_edit_cb_icon_select_destroy);
|
_e_desktop_edit_cb_icon_select_destroy);
|
||||||
e_dialog_title_set(dia, _("Select an Icon"));
|
e_dialog_title_set(dia, _("Select an Icon"));
|
||||||
dia->data = cfdata;
|
dia->data = cfdata;
|
||||||
|
|
||||||
|
@ -822,10 +825,10 @@ _e_desktop_editor_cb_icon_select(void *data1, void *data2)
|
||||||
* files from a dir, or icons in the current theme */
|
* files from a dir, or icons in the current theme */
|
||||||
if (cfdata->icon)
|
if (cfdata->icon)
|
||||||
{
|
{
|
||||||
if (ecore_file_exists(cfdata->icon))
|
if (ecore_file_exists(cfdata->icon))
|
||||||
icon_path = cfdata->icon;
|
icon_path = cfdata->icon;
|
||||||
else
|
else
|
||||||
icon_path = efreet_icon_path_find(e_config->icon_theme, cfdata->icon, 64);
|
icon_path = efreet_icon_path_find(e_config->icon_theme, cfdata->icon, 64);
|
||||||
|
|
||||||
if (icon_path)
|
if (icon_path)
|
||||||
path = ecore_file_dir_get(icon_path);
|
path = ecore_file_dir_get(icon_path);
|
||||||
|
@ -833,16 +836,16 @@ _e_desktop_editor_cb_icon_select(void *data1, void *data2)
|
||||||
|
|
||||||
if (path)
|
if (path)
|
||||||
{
|
{
|
||||||
o = e_widget_fsel_add(dia->win->evas, "/", path, NULL, NULL,
|
o = e_widget_fsel_add(dia->win->evas, "/", path, NULL, NULL,
|
||||||
_e_desktop_edit_select_cb, cfdata,
|
_e_desktop_edit_select_cb, cfdata,
|
||||||
NULL, cfdata, 1);
|
NULL, cfdata, 1);
|
||||||
free(path);
|
free(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
|
o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
|
||||||
_e_desktop_edit_select_cb, cfdata,
|
_e_desktop_edit_select_cb, cfdata,
|
||||||
NULL, cfdata, 1);
|
NULL, cfdata, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
@ -852,9 +855,9 @@ _e_desktop_editor_cb_icon_select(void *data1, void *data2)
|
||||||
|
|
||||||
/* buttons at the bottom */
|
/* buttons at the bottom */
|
||||||
e_dialog_button_add(dia, _("OK"), NULL,
|
e_dialog_button_add(dia, _("OK"), NULL,
|
||||||
_e_desktop_edit_cb_icon_select_ok, cfdata);
|
_e_desktop_edit_cb_icon_select_ok, cfdata);
|
||||||
e_dialog_button_add(dia, _("Cancel"), NULL,
|
e_dialog_button_add(dia, _("Cancel"), NULL,
|
||||||
_e_desktop_edit_cb_icon_select_cancel, cfdata);
|
_e_desktop_edit_cb_icon_select_cancel, cfdata);
|
||||||
e_dialog_resizable_set(dia, 1);
|
e_dialog_resizable_set(dia, 1);
|
||||||
e_win_centered_set(dia->win, 1);
|
e_win_centered_set(dia->win, 1);
|
||||||
e_dialog_show(dia);
|
e_dialog_show(dia);
|
||||||
|
@ -879,34 +882,34 @@ _e_desktop_editor_cb_exec_select(void *data1, void *data2)
|
||||||
dia = e_dialog_new(cfdata->editor->cfd->con, "E", "_eap_exec_select_dialog");
|
dia = e_dialog_new(cfdata->editor->cfd->con, "E", "_eap_exec_select_dialog");
|
||||||
if (!dia) return;
|
if (!dia) return;
|
||||||
e_object_del_attach_func_set(E_OBJECT(dia),
|
e_object_del_attach_func_set(E_OBJECT(dia),
|
||||||
_e_desktop_edit_cb_exec_select_destroy);
|
_e_desktop_edit_cb_exec_select_destroy);
|
||||||
e_dialog_title_set(dia, _("Select an Executable"));
|
e_dialog_title_set(dia, _("Select an Executable"));
|
||||||
dia->data = cfdata;
|
dia->data = cfdata;
|
||||||
|
|
||||||
/* absolute path to exe */
|
/* absolute path to exe */
|
||||||
if (cfdata->exec)
|
if (cfdata->exec)
|
||||||
{
|
{
|
||||||
path = ecore_file_dir_get(cfdata->exec);
|
path = ecore_file_dir_get(cfdata->exec);
|
||||||
if (path && !ecore_file_exists(path))
|
if (path && !ecore_file_exists(path))
|
||||||
{
|
{
|
||||||
free(path);
|
free(path);
|
||||||
path = NULL;
|
path = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (path)
|
if (path)
|
||||||
{
|
{
|
||||||
o = e_widget_fsel_add(dia->win->evas, "/", path, NULL, NULL,
|
o = e_widget_fsel_add(dia->win->evas, "/", path, NULL, NULL,
|
||||||
_e_desktop_edit_select_cb, cfdata,
|
_e_desktop_edit_select_cb, cfdata,
|
||||||
NULL, cfdata, 1);
|
NULL, cfdata, 1);
|
||||||
free(path);
|
free(path);
|
||||||
path = NULL;
|
path = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
|
o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
|
||||||
_e_desktop_edit_select_cb, cfdata,
|
_e_desktop_edit_select_cb, cfdata,
|
||||||
NULL, cfdata, 1);
|
NULL, cfdata, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
@ -916,9 +919,9 @@ _e_desktop_editor_cb_exec_select(void *data1, void *data2)
|
||||||
|
|
||||||
/* buttons at the bottom */
|
/* buttons at the bottom */
|
||||||
e_dialog_button_add(dia, _("OK"), NULL,
|
e_dialog_button_add(dia, _("OK"), NULL,
|
||||||
_e_desktop_edit_cb_exec_select_ok, cfdata);
|
_e_desktop_edit_cb_exec_select_ok, cfdata);
|
||||||
e_dialog_button_add(dia, _("Cancel"), NULL,
|
e_dialog_button_add(dia, _("Cancel"), NULL,
|
||||||
_e_desktop_edit_cb_exec_select_cancel, cfdata);
|
_e_desktop_edit_cb_exec_select_cancel, cfdata);
|
||||||
e_dialog_resizable_set(dia, 1);
|
e_dialog_resizable_set(dia, 1);
|
||||||
e_win_centered_set(dia->win, 1);
|
e_win_centered_set(dia->win, 1);
|
||||||
e_dialog_show(dia);
|
e_dialog_show(dia);
|
||||||
|
@ -1024,3 +1027,4 @@ _e_desktop_editor_exec_update(E_Config_Dialog_Data *cfdata)
|
||||||
if (!cfdata->editor->entry_widget_exec) return;
|
if (!cfdata->editor->entry_widget_exec) return;
|
||||||
e_widget_entry_text_set(cfdata->editor->entry_widget_exec, cfdata->exec);
|
e_widget_entry_text_set(cfdata->editor->entry_widget_exec, cfdata->exec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,52 +33,53 @@
|
||||||
|
|
||||||
/* PROTOTYPES - same all the time */
|
/* PROTOTYPES - same all the time */
|
||||||
|
|
||||||
static void *_create_data(E_Config_Dialog *cfd);
|
static void *_create_data(E_Config_Dialog *cfd);
|
||||||
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||||
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||||
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||||
#if 0
|
#if 0
|
||||||
static int _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
static int _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||||
static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void _cb_icon_sel(void *data, void *data2);
|
static void _cb_icon_sel(void *data, void *data2);
|
||||||
static void _cb_type(void *data, Evas_Object *obj, void *event_info);
|
static void _cb_type(void *data, Evas_Object *obj, void *event_info);
|
||||||
static void _cb_preview_update(void *data, Evas_Object *obj, void *event_info);
|
static void _cb_preview_update(void *data, Evas_Object *obj, void *event_info);
|
||||||
static void _cb_fsel_sel(void *data, Evas_Object *obj);
|
static void _cb_fsel_sel(void *data, Evas_Object *obj);
|
||||||
static void _cb_fsel_ok(void *data, E_Dialog *dia);
|
static void _cb_fsel_ok(void *data, E_Dialog *dia);
|
||||||
static void _cb_fsel_cancel(void *data, E_Dialog *dia);
|
static void _cb_fsel_cancel(void *data, E_Dialog *dia);
|
||||||
|
|
||||||
/* Actual config data we will be playing with whil the dialog is active */
|
/* Actual config data we will be playing with whil the dialog is active */
|
||||||
struct _E_Config_Dialog_Data
|
struct _E_Config_Dialog_Data
|
||||||
{
|
{
|
||||||
E_Fm2_Icon *ic;
|
E_Fm2_Icon *ic;
|
||||||
E_Fm2_Icon_Info *fi;
|
E_Fm2_Icon_Info *fi;
|
||||||
struct {
|
struct
|
||||||
|
{
|
||||||
Evas_Object *icon_wid;
|
Evas_Object *icon_wid;
|
||||||
Evas_Object *preview;
|
Evas_Object *preview;
|
||||||
Evas_Object *preview_table;
|
Evas_Object *preview_table;
|
||||||
Evas_Object *fsel_wid;
|
Evas_Object *fsel_wid;
|
||||||
E_Dialog *fsel;
|
E_Dialog *fsel;
|
||||||
} gui;
|
} gui;
|
||||||
/*- BASIC -*/
|
/*- BASIC -*/
|
||||||
char *file;
|
char *file;
|
||||||
char *size;
|
char *size;
|
||||||
char *mod_date;
|
char *mod_date;
|
||||||
char *mime;
|
char *mime;
|
||||||
char *owner;
|
char *owner;
|
||||||
char *link;
|
char *link;
|
||||||
char *plink;
|
char *plink;
|
||||||
int owner_read;
|
int owner_read;
|
||||||
int owner_write;
|
int owner_write;
|
||||||
int others_read;
|
int others_read;
|
||||||
int others_write;
|
int others_write;
|
||||||
int picon_type;
|
int picon_type;
|
||||||
int picon_mime;
|
int picon_mime;
|
||||||
int picon_changed;
|
int picon_changed;
|
||||||
int icon_type;
|
int icon_type;
|
||||||
int icon_mime;
|
int icon_mime;
|
||||||
char *icon;
|
char *icon;
|
||||||
/*- ADVANCED -*/
|
/*- ADVANCED -*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -92,19 +93,19 @@ e_fm_prop_file(E_Container *con, E_Fm2_Icon *ic)
|
||||||
v = E_NEW(E_Config_Dialog_View, 1);
|
v = E_NEW(E_Config_Dialog_View, 1);
|
||||||
|
|
||||||
/* methods */
|
/* methods */
|
||||||
v->create_cfdata = _create_data;
|
v->create_cfdata = _create_data;
|
||||||
v->free_cfdata = _free_data;
|
v->free_cfdata = _free_data;
|
||||||
v->basic.apply_cfdata = _basic_apply_data;
|
v->basic.apply_cfdata = _basic_apply_data;
|
||||||
v->basic.create_widgets = _basic_create_widgets;
|
v->basic.create_widgets = _basic_create_widgets;
|
||||||
#if 0
|
#if 0
|
||||||
v->advanced.apply_cfdata = _advanced_apply_data;
|
v->advanced.apply_cfdata = _advanced_apply_data;
|
||||||
v->advanced.create_widgets = _advanced_create_widgets;
|
v->advanced.create_widgets = _advanced_create_widgets;
|
||||||
#endif
|
#endif
|
||||||
/* create config diaolg for NULL object/data */
|
/* create config diaolg for NULL object/data */
|
||||||
cfd = e_config_dialog_new(con,
|
cfd = e_config_dialog_new(con,
|
||||||
_("File Properties"),
|
_("File Properties"),
|
||||||
"E", "_fm_prop",
|
"E", "_fm_prop",
|
||||||
"enlightenment/file_properties", 0, v, ic);
|
"enlightenment/file_properties", 0, v, ic);
|
||||||
return cfd;
|
return cfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +169,7 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||||
int fperm = 0;
|
int fperm = 0;
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/%s",
|
snprintf(buf, sizeof(buf), "%s/%s",
|
||||||
e_fm2_real_path_get(cfdata->fi->fm), cfdata->fi->file);
|
e_fm2_real_path_get(cfdata->fi->fm), cfdata->fi->file);
|
||||||
if (((cfdata->fi->statinfo.st_mode & S_IRUSR) && (cfdata->owner_read)) ||
|
if (((cfdata->fi->statinfo.st_mode & S_IRUSR) && (cfdata->owner_read)) ||
|
||||||
((!(cfdata->fi->statinfo.st_mode & S_IRUSR)) && (!cfdata->owner_read)))
|
((!(cfdata->fi->statinfo.st_mode & S_IRUSR)) && (!cfdata->owner_read)))
|
||||||
fperm = 1;
|
fperm = 1;
|
||||||
|
@ -183,123 +184,123 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||||
fperm = 1;
|
fperm = 1;
|
||||||
if (fperm)
|
if (fperm)
|
||||||
{
|
{
|
||||||
mode_t pmode;
|
mode_t pmode;
|
||||||
|
|
||||||
pmode = cfdata->fi->statinfo.st_mode;
|
pmode = cfdata->fi->statinfo.st_mode;
|
||||||
if (cfdata->owner_read) cfdata->fi->statinfo.st_mode |= S_IRUSR;
|
if (cfdata->owner_read) cfdata->fi->statinfo.st_mode |= S_IRUSR;
|
||||||
else cfdata->fi->statinfo.st_mode &= ~S_IRUSR;
|
else cfdata->fi->statinfo.st_mode &= ~S_IRUSR;
|
||||||
if (cfdata->owner_write) cfdata->fi->statinfo.st_mode |= S_IWUSR;
|
if (cfdata->owner_write) cfdata->fi->statinfo.st_mode |= S_IWUSR;
|
||||||
else cfdata->fi->statinfo.st_mode &= ~S_IWUSR;
|
else cfdata->fi->statinfo.st_mode &= ~S_IWUSR;
|
||||||
if (cfdata->others_read) cfdata->fi->statinfo.st_mode |= S_IROTH;
|
if (cfdata->others_read) cfdata->fi->statinfo.st_mode |= S_IROTH;
|
||||||
else cfdata->fi->statinfo.st_mode &= ~S_IROTH;
|
else cfdata->fi->statinfo.st_mode &= ~S_IROTH;
|
||||||
if (cfdata->others_write) cfdata->fi->statinfo.st_mode |= S_IWOTH;
|
if (cfdata->others_write) cfdata->fi->statinfo.st_mode |= S_IWOTH;
|
||||||
else cfdata->fi->statinfo.st_mode &= ~S_IWOTH;
|
else cfdata->fi->statinfo.st_mode &= ~S_IWOTH;
|
||||||
if (chmod(buf, cfdata->fi->statinfo.st_mode) == -1)
|
if (chmod(buf, cfdata->fi->statinfo.st_mode) == -1)
|
||||||
{
|
{
|
||||||
/* FIXME: error dialog */
|
/* FIXME: error dialog */
|
||||||
cfdata->fi->statinfo.st_mode = pmode;
|
cfdata->fi->statinfo.st_mode = pmode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((cfdata->link) && ((cfdata->fi->real_link) || (cfdata->fi->broken_link)))
|
if ((cfdata->link) && ((cfdata->fi->real_link) || (cfdata->fi->broken_link)))
|
||||||
{
|
{
|
||||||
if ((cfdata->link[0]) && (strcmp(cfdata->plink, cfdata->link)))
|
if ((cfdata->link[0]) && (strcmp(cfdata->plink, cfdata->link)))
|
||||||
{
|
{
|
||||||
ecore_file_unlink(buf);
|
ecore_file_unlink(buf);
|
||||||
ecore_file_symlink(cfdata->link, buf);
|
ecore_file_symlink(cfdata->link, buf);
|
||||||
free(cfdata->plink);
|
free(cfdata->plink);
|
||||||
cfdata->plink = strdup(cfdata->link);
|
cfdata->plink = strdup(cfdata->link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((cfdata->picon_type != cfdata->icon_type) ||
|
if ((cfdata->picon_type != cfdata->icon_type) ||
|
||||||
(cfdata->picon_mime != cfdata->icon_mime) ||
|
(cfdata->picon_mime != cfdata->icon_mime) ||
|
||||||
(cfdata->picon_changed))
|
(cfdata->picon_changed))
|
||||||
{
|
{
|
||||||
if ((cfdata->icon_mime) && (cfdata->mime)) /* modify mimetype */
|
if ((cfdata->icon_mime) && (cfdata->mime)) /* modify mimetype */
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
E_Config_Mime_Icon *mi = NULL;
|
E_Config_Mime_Icon *mi = NULL;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
if (!cfdata->picon_mime) /* remove previous custom icon info */
|
if (!cfdata->picon_mime) /* remove previous custom icon info */
|
||||||
e_fm2_custom_file_del(buf);
|
e_fm2_custom_file_del(buf);
|
||||||
EINA_LIST_FOREACH(e_config->mime_icons, l, mi)
|
EINA_LIST_FOREACH(e_config->mime_icons, l, mi)
|
||||||
{
|
{
|
||||||
if (!mi) continue;
|
if (!mi) continue;
|
||||||
if (strcmp(mi->mime, cfdata->mime)) continue;
|
if (strcmp(mi->mime, cfdata->mime)) continue;
|
||||||
if (mi->icon)
|
if (mi->icon)
|
||||||
{
|
{
|
||||||
eina_stringshare_del(mi->icon);
|
eina_stringshare_del(mi->icon);
|
||||||
mi->icon = NULL;
|
mi->icon = NULL;
|
||||||
}
|
}
|
||||||
found = 1;
|
found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((!found) && (cfdata->icon_type != 0))
|
if ((!found) && (cfdata->icon_type != 0))
|
||||||
{
|
{
|
||||||
mi = E_NEW(E_Config_Mime_Icon, 1);
|
mi = E_NEW(E_Config_Mime_Icon, 1);
|
||||||
mi->mime = eina_stringshare_add(cfdata->mime);
|
mi->mime = eina_stringshare_add(cfdata->mime);
|
||||||
e_config->mime_icons = eina_list_append(e_config->mime_icons, mi);
|
e_config->mime_icons = eina_list_append(e_config->mime_icons, mi);
|
||||||
}
|
}
|
||||||
/* FIXME: modify mime info */
|
/* FIXME: modify mime info */
|
||||||
if (cfdata->icon_type == 0)
|
if (cfdata->icon_type == 0)
|
||||||
{
|
{
|
||||||
if (found)
|
if (found)
|
||||||
{
|
{
|
||||||
e_config->mime_icons = eina_list_remove(e_config->mime_icons, mi);
|
e_config->mime_icons = eina_list_remove(e_config->mime_icons, mi);
|
||||||
if (mi->mime) eina_stringshare_del(mi->mime);
|
if (mi->mime) eina_stringshare_del(mi->mime);
|
||||||
if (mi->icon) eina_stringshare_del(mi->icon);
|
if (mi->icon) eina_stringshare_del(mi->icon);
|
||||||
free(mi);
|
free(mi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cfdata->icon_type == 1)
|
else if (cfdata->icon_type == 1)
|
||||||
{
|
{
|
||||||
mi->icon = eina_stringshare_add("THUMB");
|
mi->icon = eina_stringshare_add("THUMB");
|
||||||
}
|
}
|
||||||
else if (cfdata->icon_type == 2)
|
else if (cfdata->icon_type == 2)
|
||||||
{
|
{
|
||||||
mi->icon = eina_stringshare_add(cfdata->icon);
|
mi->icon = eina_stringshare_add(cfdata->icon);
|
||||||
}
|
}
|
||||||
e_config_save_queue();
|
e_config_save_queue();
|
||||||
e_fm_mime_icon_cache_flush();
|
e_fm_mime_icon_cache_flush();
|
||||||
}
|
}
|
||||||
else /* custom for this file */
|
else /* custom for this file */
|
||||||
{
|
{
|
||||||
E_Fm2_Custom_File *cf, cf0;
|
E_Fm2_Custom_File *cf, cf0;
|
||||||
|
|
||||||
cf = e_fm2_custom_file_get(buf);
|
cf = e_fm2_custom_file_get(buf);
|
||||||
if (cf)
|
if (cf)
|
||||||
{
|
{
|
||||||
cf->icon.type = cfdata->icon_type;
|
cf->icon.type = cfdata->icon_type;
|
||||||
if (cf->icon.icon)
|
if (cf->icon.icon)
|
||||||
eina_stringshare_del(cf->icon.icon);
|
eina_stringshare_del(cf->icon.icon);
|
||||||
cf->icon.icon = NULL;
|
cf->icon.icon = NULL;
|
||||||
if (cfdata->icon_type == 2)
|
if (cfdata->icon_type == 2)
|
||||||
cf->icon.icon = eina_stringshare_add(cfdata->icon);
|
cf->icon.icon = eina_stringshare_add(cfdata->icon);
|
||||||
if (cfdata->icon_type == 0)
|
if (cfdata->icon_type == 0)
|
||||||
cf->icon.valid = 0;
|
cf->icon.valid = 0;
|
||||||
else
|
else
|
||||||
cf->icon.valid = 1;
|
cf->icon.valid = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memset(&cf0, 0, sizeof(E_Fm2_Custom_File));
|
memset(&cf0, 0, sizeof(E_Fm2_Custom_File));
|
||||||
cf = &cf0;
|
cf = &cf0;
|
||||||
cf->icon.type = cfdata->icon_type;
|
cf->icon.type = cfdata->icon_type;
|
||||||
if (cfdata->icon_type == 2)
|
if (cfdata->icon_type == 2)
|
||||||
cf->icon.icon = cfdata->icon;
|
cf->icon.icon = cfdata->icon;
|
||||||
if (cfdata->icon_type == 0)
|
if (cfdata->icon_type == 0)
|
||||||
cf->icon.valid = 0;
|
cf->icon.valid = 0;
|
||||||
else
|
else
|
||||||
cf->icon.valid = 1;
|
cf->icon.valid = 1;
|
||||||
}
|
}
|
||||||
e_fm2_custom_file_set(buf, cf);
|
e_fm2_custom_file_set(buf, cf);
|
||||||
e_fm2_custom_file_flush();
|
e_fm2_custom_file_flush();
|
||||||
}
|
}
|
||||||
cfdata->picon_type = cfdata->icon_type;
|
cfdata->picon_type = cfdata->icon_type;
|
||||||
cfdata->picon_mime = cfdata->icon_mime;
|
cfdata->picon_mime = cfdata->icon_mime;
|
||||||
|
|
||||||
e_fm2_all_icons_update();
|
e_fm2_all_icons_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1; /* Apply was OK */
|
return 1; /* Apply was OK */
|
||||||
|
@ -311,6 +312,7 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
return 1; /* Apply was OK */
|
return 1; /* Apply was OK */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**--GUI--**/
|
/**--GUI--**/
|
||||||
|
@ -324,7 +326,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
const char *itype = NULL;
|
const char *itype = NULL;
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/%s",
|
snprintf(buf, sizeof(buf), "%s/%s",
|
||||||
e_fm2_real_path_get(cfdata->fi->fm), cfdata->fi->file);
|
e_fm2_real_path_get(cfdata->fi->fm), cfdata->fi->file);
|
||||||
o = e_widget_table_add(evas, 0);
|
o = e_widget_table_add(evas, 0);
|
||||||
|
|
||||||
ot = e_widget_table_add(evas, 0);
|
ot = e_widget_table_add(evas, 0);
|
||||||
|
@ -383,10 +385,10 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
cfdata->gui.preview = ob;
|
cfdata->gui.preview = ob;
|
||||||
cfdata->gui.preview_table = ot;
|
cfdata->gui.preview_table = ot;
|
||||||
evas_object_smart_callback_add(ob, "preview_update",
|
evas_object_smart_callback_add(ob, "preview_update",
|
||||||
_cb_preview_update, cfdata);
|
_cb_preview_update, cfdata);
|
||||||
e_widget_table_object_append(ot, ob, 0, 0, 1, 1, 0, 0, 1, 1);
|
e_widget_table_object_append(ot, ob, 0, 0, 1, 1, 0, 0, 1, 1);
|
||||||
e_widget_preview_thumb_set(ob, buf,
|
e_widget_preview_thumb_set(ob, buf,
|
||||||
"e/desktop/background", 128, 128);
|
"e/desktop/background", 128, 128);
|
||||||
e_widget_frametable_object_append(of, ot, 0, 0, 1, 1, 1, 1, 1, 1);
|
e_widget_frametable_object_append(of, ot, 0, 0, 1, 1, 1, 1, 1, 1);
|
||||||
|
|
||||||
e_widget_table_object_append(o, of, 1, 0, 1, 1, 1, 1, 1, 1);
|
e_widget_table_object_append(o, of, 1, 0, 1, 1, 1, 1, 1, 1);
|
||||||
|
@ -396,27 +398,27 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
ob = e_widget_button_add(evas, "", NULL, _cb_icon_sel, cfdata, cfd);
|
ob = e_widget_button_add(evas, "", NULL, _cb_icon_sel, cfdata, cfd);
|
||||||
cfdata->gui.icon_wid = ob;
|
cfdata->gui.icon_wid = ob;
|
||||||
oi = e_fm2_icon_get(evas,
|
oi = e_fm2_icon_get(evas,
|
||||||
cfdata->ic,
|
cfdata->ic,
|
||||||
NULL, NULL, 0, &itype);
|
NULL, NULL, 0, &itype);
|
||||||
e_widget_button_icon_set(ob, oi);
|
e_widget_button_icon_set(ob, oi);
|
||||||
e_widget_frametable_object_append(ot, ob, 0, 0, 1, 3, 0, 1, 0, 1);
|
e_widget_frametable_object_append(ot, ob, 0, 0, 1, 3, 0, 1, 0, 1);
|
||||||
|
|
||||||
if (itype)
|
if (itype)
|
||||||
{
|
{
|
||||||
if ((!strcmp(itype, "THEME_ICON")) ||
|
if ((!strcmp(itype, "THEME_ICON")) ||
|
||||||
(!strcmp(itype, "DESKTOP")) ||
|
(!strcmp(itype, "DESKTOP")) ||
|
||||||
(!strcmp(itype, "FILE_TYPE")))
|
(!strcmp(itype, "FILE_TYPE")))
|
||||||
{
|
{
|
||||||
e_widget_disabled_set(ob, 1);
|
e_widget_disabled_set(ob, 1);
|
||||||
cfdata->icon_type = 0;
|
cfdata->icon_type = 0;
|
||||||
}
|
}
|
||||||
else if (!strcmp(itype, "THUMB"))
|
else if (!strcmp(itype, "THUMB"))
|
||||||
{
|
{
|
||||||
cfdata->icon_type = 1;
|
cfdata->icon_type = 1;
|
||||||
e_widget_disabled_set(ob, 1);
|
e_widget_disabled_set(ob, 1);
|
||||||
}
|
}
|
||||||
else if (!strcmp(itype, "CUSTOM"))
|
else if (!strcmp(itype, "CUSTOM"))
|
||||||
cfdata->icon_type = 2;
|
cfdata->icon_type = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cfdata->icon_type = 0;
|
cfdata->icon_type = 0;
|
||||||
|
@ -439,20 +441,20 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
cfdata->picon_mime = cfdata->icon_mime;
|
cfdata->picon_mime = cfdata->icon_mime;
|
||||||
if (cfdata->mime)
|
if (cfdata->mime)
|
||||||
{
|
{
|
||||||
ob = e_widget_check_add(evas, _("Use this icon for all files of this type"), &(cfdata->icon_mime));
|
ob = e_widget_check_add(evas, _("Use this icon for all files of this type"), &(cfdata->icon_mime));
|
||||||
e_widget_frametable_object_append(ot, ob, 0, 3, 2, 1, 1, 1, 1, 1);
|
e_widget_frametable_object_append(ot, ob, 0, 3, 2, 1, 1, 1, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
e_widget_table_object_append(o, ot, 0, 1, 1, 1, 1, 1, 1, 1);
|
e_widget_table_object_append(o, ot, 0, 1, 1, 1, 1, 1, 1, 1);
|
||||||
|
|
||||||
if ((cfdata->link) && ((cfdata->fi->real_link) || (cfdata->fi->broken_link)))
|
if ((cfdata->link) && ((cfdata->fi->real_link) || (cfdata->fi->broken_link)))
|
||||||
{
|
{
|
||||||
ot = e_widget_frametable_add(evas, _("Link Information"), 0);
|
ot = e_widget_frametable_add(evas, _("Link Information"), 0);
|
||||||
|
|
||||||
ob = e_widget_entry_add(evas, &(cfdata->link), NULL, NULL, NULL);
|
ob = e_widget_entry_add(evas, &(cfdata->link), NULL, NULL, NULL);
|
||||||
e_widget_frametable_object_append(ot, ob, 0, 0, 1, 1, 1, 0, 1, 0);
|
e_widget_frametable_object_append(ot, ob, 0, 0, 1, 1, 1, 0, 1, 0);
|
||||||
|
|
||||||
e_widget_table_object_append(o, ot, 1, 1, 1, 1, 1, 1, 1, 1);
|
e_widget_table_object_append(o, ot, 1, 1, 1, 1, 1, 1, 1, 1);
|
||||||
}
|
}
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
@ -467,11 +469,9 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
||||||
o = e_widget_table_add(evas, 0);
|
o = e_widget_table_add(evas, 0);
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_cb_icon_sel(void *data, void *data2)
|
_cb_icon_sel(void *data, void *data2)
|
||||||
{
|
{
|
||||||
|
@ -493,11 +493,11 @@ _cb_icon_sel(void *data, void *data2)
|
||||||
// if (cfdata->type == EDJ)
|
// if (cfdata->type == EDJ)
|
||||||
// e_dialog_title_set(dia, _("Select an Edj File"));
|
// e_dialog_title_set(dia, _("Select an Edj File"));
|
||||||
// else if (cfdata->type == IMG)
|
// else if (cfdata->type == IMG)
|
||||||
e_dialog_title_set(dia, _("Select an Image"));
|
e_dialog_title_set(dia, _("Select an Image"));
|
||||||
|
|
||||||
dia->data = cfdata;
|
dia->data = cfdata;
|
||||||
o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
|
o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
|
||||||
_cb_fsel_sel, cfdata, NULL, cfdata, 1);
|
_cb_fsel_sel, cfdata, NULL, cfdata, 1);
|
||||||
|
|
||||||
cfdata->gui.fsel_wid = o;
|
cfdata->gui.fsel_wid = o;
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
@ -533,8 +533,8 @@ _cb_preview_update(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
|
||||||
|
|
||||||
cfdata = data;
|
cfdata = data;
|
||||||
e_widget_table_object_repack(cfdata->gui.preview_table,
|
e_widget_table_object_repack(cfdata->gui.preview_table,
|
||||||
cfdata->gui.preview,
|
cfdata->gui.preview,
|
||||||
0, 0, 1, 1, 0, 0, 1, 1);
|
0, 0, 1, 1, 0, 0, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -563,19 +563,19 @@ _cb_fsel_ok(void *data, E_Dialog *dia)
|
||||||
ext = strrchr(cfdata->icon, '.');
|
ext = strrchr(cfdata->icon, '.');
|
||||||
if (ext)
|
if (ext)
|
||||||
{
|
{
|
||||||
if (!strcasecmp(ext, ".edj"))
|
if (!strcasecmp(ext, ".edj"))
|
||||||
{
|
{
|
||||||
icon = edje_object_add( evas_object_evas_get(cfdata->gui.icon_wid));
|
icon = edje_object_add(evas_object_evas_get(cfdata->gui.icon_wid));
|
||||||
edje_object_file_set(icon, cfdata->file, "icon");
|
edje_object_file_set(icon, cfdata->file, "icon");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
icon = e_widget_image_add_from_file(evas_object_evas_get(cfdata->gui.icon_wid), cfdata->icon, 48, 48);
|
icon = e_widget_image_add_from_file(evas_object_evas_get(cfdata->gui.icon_wid), cfdata->icon, 48, 48);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
icon = e_widget_image_add_from_file(evas_object_evas_get(cfdata->gui.icon_wid), cfdata->icon, 48, 48);
|
icon = e_widget_image_add_from_file(evas_object_evas_get(cfdata->gui.icon_wid), cfdata->icon, 48, 48);
|
||||||
}
|
}
|
||||||
if (icon) e_widget_button_icon_set(cfdata->gui.icon_wid, icon);
|
if (icon) e_widget_button_icon_set(cfdata->gui.icon_wid, icon);
|
||||||
}
|
}
|
||||||
|
@ -589,3 +589,4 @@ _cb_fsel_cancel(void *data, E_Dialog *dia)
|
||||||
e_object_del(E_OBJECT(dia));
|
e_object_del(E_OBJECT(dia));
|
||||||
cfdata->gui.fsel = NULL;
|
cfdata->gui.fsel = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue