2005-10-24 16:08:20 -07:00
|
|
|
#include "e.h"
|
|
|
|
|
2013-12-10 11:15:21 -08:00
|
|
|
/* TODO: Check cache update */
|
|
|
|
|
2006-05-31 11:58:26 -07:00
|
|
|
struct _E_Config_Dialog_Data
|
2005-10-27 03:19:43 -07:00
|
|
|
{
|
2007-03-27 22:58:01 -07:00
|
|
|
Efreet_Desktop *desktop;
|
2012-07-17 03:32:01 -07:00
|
|
|
int type; /* desktop type */
|
2006-09-26 09:09:40 -07:00
|
|
|
|
2012-07-17 03:32:01 -07:00
|
|
|
char *name; /* app name (e.g. Firefox) */
|
|
|
|
char *generic_name; /* generic app name (e.g. Web Browser) */
|
|
|
|
char *comment; /* a longer description */
|
|
|
|
char *exec; /* command to execute */
|
|
|
|
char *try_exec; /* executable to test for an apps existence */
|
|
|
|
char *url; /* url to open */
|
2006-09-26 09:09:40 -07:00
|
|
|
|
2012-07-17 03:32:01 -07:00
|
|
|
char *startup_wm_class; /* window class */
|
|
|
|
char *categories; /* list of category names that app is in */
|
|
|
|
char *mimes; /* list of mimes this app can handle */
|
|
|
|
char *icon; /* absolute path to file or icon name */
|
2006-09-26 09:09:40 -07:00
|
|
|
|
2012-07-17 03:32:01 -07:00
|
|
|
int startup_notify;
|
|
|
|
int terminal;
|
|
|
|
int show_in_menus;
|
2006-09-26 09:09:40 -07:00
|
|
|
|
2007-03-27 22:58:01 -07:00
|
|
|
E_Desktop_Edit *editor;
|
2010-03-05 16:42:09 -08:00
|
|
|
|
2012-07-17 03:32:01 -07:00
|
|
|
char *orig_path; /* informational only */
|
|
|
|
Evas_Object *orig_path_entry; /* to set when info changes */
|
|
|
|
Evas_Object *icon_entry; /* to set when icon changes */
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
/* speed up check_changed tests */
|
2012-07-17 03:32:01 -07:00
|
|
|
Eina_Bool changed_categories;
|
|
|
|
Eina_Bool changed_mimes;
|
|
|
|
Eina_Bool edited_categories;
|
|
|
|
Eina_Bool edited_mimes;
|
2005-10-27 03:19:43 -07:00
|
|
|
};
|
|
|
|
|
2005-10-24 16:08:20 -07:00
|
|
|
/* local subsystem functions */
|
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
static int _e_desktop_edit_view_create(E_Desktop_Edit *editor, E_Comp *c);
|
2007-12-04 02:52:55 -08:00
|
|
|
static void _e_desktop_edit_free(E_Desktop_Edit *editor);
|
|
|
|
static void *_e_desktop_edit_create_data(E_Config_Dialog *cfd);
|
|
|
|
static void _e_desktop_edit_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *data);
|
|
|
|
static int _e_desktop_edit_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *data);
|
2010-03-05 16:42:09 -08:00
|
|
|
static int _e_desktop_edit_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *data);
|
2007-12-04 02:52:55 -08:00
|
|
|
static Evas_Object *_e_desktop_edit_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *data);
|
|
|
|
static void _e_desktop_editor_cb_icon_select(void *data1, void *data2);
|
|
|
|
static void _e_desktop_edit_cb_icon_select_destroy(void *obj);
|
|
|
|
static void _e_desktop_edit_cb_icon_select_ok(void *data, E_Dialog *dia);
|
|
|
|
static void _e_desktop_edit_cb_icon_select_cancel(void *data, E_Dialog *dia);
|
|
|
|
static void _e_desktop_editor_icon_update(E_Config_Dialog_Data *cfdata);
|
|
|
|
static void _e_desktop_editor_cb_exec_select(void *data1, void *data2);
|
|
|
|
static void _e_desktop_edit_cb_exec_select_destroy(void *obj);
|
|
|
|
static void _e_desktop_edit_cb_exec_select_ok(void *data, E_Dialog *dia);
|
|
|
|
static void _e_desktop_edit_cb_exec_select_cancel(void *data, E_Dialog *dia);
|
|
|
|
static void _e_desktop_editor_exec_update(E_Config_Dialog_Data *cfdata);
|
|
|
|
static void _e_desktop_edit_select_cb(void *data, Evas_Object *obj);
|
2010-06-02 12:59:48 -07:00
|
|
|
static void _e_desktop_editor_icon_entry_changed(void *data, Evas_Object *obj);
|
2005-10-27 03:19:43 -07:00
|
|
|
|
2012-07-17 03:32:01 -07:00
|
|
|
#define IFDUP(src, dst) if (src) dst = strdup(src); else \
|
|
|
|
dst = NULL
|
2005-12-04 04:03:59 -08:00
|
|
|
|
2013-08-19 06:12:21 -07:00
|
|
|
|
|
|
|
static int
|
|
|
|
_e_util_icon_save(Ecore_X_Icon *icon, const char *filename)
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Evas *evas;
|
|
|
|
Evas_Object *im;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
ee = ecore_evas_buffer_new(icon->width, icon->height);
|
|
|
|
if (!ee) return 0;
|
|
|
|
evas = ecore_evas_get(ee);
|
|
|
|
evas_image_cache_set(evas, 0);
|
|
|
|
evas_font_cache_set(evas, 0);
|
|
|
|
|
|
|
|
im = evas_object_image_add(evas);
|
|
|
|
if (!im)
|
|
|
|
{
|
|
|
|
ecore_evas_free(ee);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
evas_object_move(im, 0, 0);
|
|
|
|
evas_object_resize(im, icon->width, icon->height);
|
|
|
|
evas_object_image_size_set(im, icon->width, icon->height);
|
|
|
|
evas_object_image_data_copy_set(im, icon->data);
|
|
|
|
evas_object_image_alpha_set(im, 1);
|
|
|
|
evas_object_show(im);
|
|
|
|
ret = evas_object_image_save(im, filename, NULL, NULL);
|
|
|
|
evas_object_del(im);
|
|
|
|
ecore_evas_free(ee);
|
|
|
|
return ret;
|
|
|
|
}
|
2005-10-24 16:08:20 -07:00
|
|
|
/* externally accessible functions */
|
2005-10-27 03:19:43 -07:00
|
|
|
|
2007-04-12 18:36:05 -07:00
|
|
|
EAPI Efreet_Desktop *
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
e_desktop_client_create(E_Client *ec)
|
2005-10-24 16:08:20 -07:00
|
|
|
{
|
2007-04-12 18:36:05 -07:00
|
|
|
Efreet_Desktop *desktop = NULL;
|
|
|
|
const char *desktop_dir, *icon_dir;
|
2010-08-26 05:14:38 -07:00
|
|
|
const char *bname, *bclass, *btitle;
|
2007-04-12 17:49:24 -07:00
|
|
|
char path[PATH_MAX];
|
2005-10-25 17:19:52 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
bname = ec->icccm.name;
|
2007-04-12 17:49:24 -07:00
|
|
|
if ((bname) && (bname[0] == 0)) bname = NULL;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
bclass = ec->icccm.class;
|
2007-04-12 17:49:24 -07:00
|
|
|
if ((bclass) && (bclass[0] == 0)) bclass = NULL;
|
2014-02-05 07:55:50 -08:00
|
|
|
btitle = e_client_util_name_get(ec);
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2007-04-12 18:36:05 -07:00
|
|
|
desktop_dir = e_user_desktop_dir_get();
|
2007-04-12 17:49:24 -07:00
|
|
|
|
2007-12-04 09:48:28 -08:00
|
|
|
if ((!desktop_dir) || (!e_util_dir_check(desktop_dir))) return NULL;
|
2007-04-12 17:49:24 -07:00
|
|
|
|
2007-04-12 18:36:05 -07:00
|
|
|
icon_dir = e_user_icon_dir_get();
|
2007-12-04 09:48:28 -08:00
|
|
|
if ((!icon_dir) || (!e_util_dir_check(icon_dir))) return NULL;
|
2007-04-12 17:49:24 -07:00
|
|
|
|
2012-06-20 23:19:43 -07:00
|
|
|
if (bname)
|
2007-04-12 18:36:05 -07:00
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
snprintf(path, sizeof(path), "%s/%s.desktop", desktop_dir, bname);
|
|
|
|
desktop = efreet_desktop_empty_new(path);
|
2007-04-12 18:36:05 -07:00
|
|
|
}
|
|
|
|
else
|
2007-05-18 20:29:08 -07:00
|
|
|
{
|
|
|
|
int i;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2012-07-17 03:32:01 -07:00
|
|
|
for (i = 1; i < 65536; i++)
|
|
|
|
{
|
|
|
|
snprintf(path, sizeof(path), "%s/_new_app-%i.desktop",
|
|
|
|
desktop_dir, i);
|
|
|
|
if (!ecore_file_exists(path))
|
|
|
|
{
|
|
|
|
desktop = efreet_desktop_empty_new(path);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!desktop)
|
|
|
|
{
|
|
|
|
snprintf(path, sizeof(path), "%s/_rename_me-%i.desktop",
|
|
|
|
desktop_dir, (int)ecore_time_get());
|
|
|
|
desktop = efreet_desktop_empty_new(NULL);
|
|
|
|
}
|
2007-05-18 20:29:08 -07:00
|
|
|
}
|
2007-04-12 17:49:24 -07:00
|
|
|
|
2007-04-12 18:36:05 -07:00
|
|
|
if (!desktop)
|
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
//XXX out of memory?
|
|
|
|
return NULL;
|
2007-04-12 18:36:05 -07:00
|
|
|
}
|
|
|
|
if (bclass) desktop->name = strdup(bclass);
|
2012-07-17 03:32:01 -07:00
|
|
|
else if (bname)
|
|
|
|
desktop->name = strdup(bname);
|
|
|
|
else if (btitle)
|
|
|
|
desktop->name = strdup(btitle);
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2010-08-26 05:14:38 -07:00
|
|
|
if (btitle) desktop->comment = strdup(btitle);
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2007-04-12 18:36:05 -07:00
|
|
|
if (bclass) desktop->startup_wm_class = strdup(bclass);
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (ec->icccm.command.argc > 0)
|
2007-04-12 18:36:05 -07:00
|
|
|
// FIXME this should concat the entire argv array together
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
desktop->exec = strdup(ec->icccm.command.argv[0]);
|
2007-04-12 18:36:05 -07:00
|
|
|
else if (bname)
|
2012-06-20 23:19:43 -07:00
|
|
|
desktop->exec = strdup(bname);
|
2007-04-12 18:36:05 -07:00
|
|
|
|
2012-06-20 23:19:43 -07:00
|
|
|
// disable this
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
// if (ec->netwm.startup_id > 0) desktop->startup_notify = 1;
|
|
|
|
if (ec->netwm.icons)
|
2007-04-12 18:36:05 -07:00
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
/* FIXME
|
|
|
|
* - Find the icon with the best size
|
|
|
|
* - Should use mkstemp
|
|
|
|
*/
|
2012-11-30 13:25:30 -08:00
|
|
|
char file[PATH_MAX];
|
|
|
|
|
2013-01-23 02:50:29 -08:00
|
|
|
snprintf(file, sizeof(file), "%s-%.6f.png", bname ?: "", ecore_time_get());
|
2012-11-30 13:25:30 -08:00
|
|
|
snprintf(path, sizeof(path), "%s/%s", icon_dir, file);
|
2013-08-19 06:12:21 -07:00
|
|
|
if (_e_util_icon_save(&(ec->netwm.icons[0]), path))
|
2012-11-30 13:25:30 -08:00
|
|
|
desktop->icon = strdup(file);
|
2012-07-17 03:32:01 -07:00
|
|
|
else
|
|
|
|
fprintf(stderr, "Could not save file from ARGB: %s\n", path);
|
2007-04-12 18:36:05 -07:00
|
|
|
}
|
|
|
|
return desktop;
|
|
|
|
}
|
2007-05-18 19:13:11 -07:00
|
|
|
|
2007-04-12 18:36:05 -07:00
|
|
|
EAPI E_Desktop_Edit *
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
e_desktop_border_edit(E_Comp *c, E_Client *ec)
|
2007-04-12 18:36:05 -07:00
|
|
|
{
|
|
|
|
E_Desktop_Edit *editor;
|
2010-01-14 15:48:59 -08:00
|
|
|
int new_desktop = 0;
|
2007-04-12 17:49:24 -07:00
|
|
|
|
2007-04-12 18:36:05 -07:00
|
|
|
editor = E_OBJECT_ALLOC(E_Desktop_Edit, E_DESKTOP_EDIT_TYPE, _e_desktop_edit_free);
|
|
|
|
if (!editor) return NULL;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (ec->desktop)
|
|
|
|
editor->desktop = ec->desktop;
|
2007-04-12 18:36:05 -07:00
|
|
|
|
|
|
|
/* the border does not yet have a desktop entry. add one and pre-populate
|
|
|
|
it with values from the border */
|
|
|
|
if (!editor->desktop)
|
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
editor->desktop = e_desktop_client_create(ec);
|
2012-07-17 03:32:01 -07:00
|
|
|
if ((editor->desktop) && (editor->desktop->icon))
|
|
|
|
editor->tmp_image_path = strdup(editor->desktop->icon);
|
|
|
|
new_desktop = 1;
|
2007-04-12 17:49:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
if ((!bname) && (!bclass))
|
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
e_util_dialog_show(_("Incomplete Window Properties"),
|
|
|
|
_("The window you are creating an icon for<br>"
|
|
|
|
"does not contain window name and class<br>"
|
2012-11-30 07:39:17 -08:00
|
|
|
"properties. Without these, you will have to<br>"
|
2012-07-17 03:32:01 -07:00
|
|
|
"use the window title instead. This will only<br>"
|
|
|
|
"work if the window title is the same at<br>"
|
|
|
|
"the time the window starts up, and does not<br>"
|
|
|
|
"change."));
|
2007-04-12 17:49:24 -07:00
|
|
|
}
|
2012-06-20 23:19:43 -07:00
|
|
|
#endif
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (!_e_desktop_edit_view_create(editor, c))
|
2006-07-28 06:42:03 -07:00
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
e_object_del(E_OBJECT(editor));
|
|
|
|
editor = NULL;
|
2006-07-28 06:42:03 -07:00
|
|
|
}
|
2012-06-20 23:19:43 -07:00
|
|
|
else
|
2012-07-17 03:32:01 -07:00
|
|
|
e_config_dialog_changed_set(editor->cfd, new_desktop);
|
2009-01-06 18:41:20 -08:00
|
|
|
|
2007-04-12 17:49:24 -07:00
|
|
|
return editor;
|
|
|
|
}
|
2006-07-19 06:24:50 -07:00
|
|
|
|
2007-04-12 17:49:24 -07:00
|
|
|
EAPI E_Desktop_Edit *
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
e_desktop_edit(E_Comp *c, Efreet_Desktop *desktop)
|
2007-04-12 17:49:24 -07:00
|
|
|
{
|
|
|
|
E_Desktop_Edit *editor;
|
|
|
|
|
|
|
|
editor = E_OBJECT_ALLOC(E_Desktop_Edit, E_DESKTOP_EDIT_TYPE, _e_desktop_edit_free);
|
|
|
|
if (!editor) return NULL;
|
2007-12-04 09:48:28 -08:00
|
|
|
if (desktop) editor->desktop = desktop;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (!_e_desktop_edit_view_create(editor, c))
|
2007-04-12 17:49:24 -07:00
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
e_object_del(E_OBJECT(editor));
|
|
|
|
editor = NULL;
|
2007-04-12 17:49:24 -07:00
|
|
|
}
|
|
|
|
return editor;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
_e_desktop_edit_view_create(E_Desktop_Edit *editor, E_Comp *c)
|
2007-04-12 17:49:24 -07:00
|
|
|
{
|
|
|
|
E_Config_Dialog_View *v;
|
2007-12-04 09:48:28 -08:00
|
|
|
|
2007-04-12 17:49:24 -07:00
|
|
|
v = E_NEW(E_Config_Dialog_View, 1);
|
2007-12-04 09:48:28 -08:00
|
|
|
if (!v) return 0;
|
2007-04-12 17:49:24 -07:00
|
|
|
|
2007-03-27 22:58:01 -07:00
|
|
|
/* view methods */
|
2012-07-17 03:32:01 -07:00
|
|
|
v->create_cfdata = _e_desktop_edit_create_data;
|
|
|
|
v->free_cfdata = _e_desktop_edit_free_data;
|
|
|
|
v->basic.apply_cfdata = _e_desktop_edit_basic_apply_data;
|
|
|
|
v->basic.create_widgets = _e_desktop_edit_basic_create_widgets;
|
|
|
|
v->basic.check_changed = _e_desktop_edit_basic_check_changed;
|
2007-03-27 22:58:01 -07:00
|
|
|
|
2012-06-20 23:19:43 -07:00
|
|
|
editor->cfd =
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
e_config_dialog_new(c, _("Desktop Entry Editor"), "E",
|
2012-07-17 03:32:01 -07:00
|
|
|
"applications/new_application",
|
|
|
|
"preferences-applications", 0, v, editor);
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2009-01-06 18:41:20 -08:00
|
|
|
if (!editor->cfd)
|
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
E_FREE(v);
|
|
|
|
return 0;
|
2009-01-06 18:41:20 -08:00
|
|
|
}
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2007-04-12 17:49:24 -07:00
|
|
|
return 1;
|
2005-10-27 03:19:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* local subsystem functions */
|
2006-09-03 08:11:04 -07:00
|
|
|
static void
|
2007-03-27 22:58:01 -07:00
|
|
|
_e_desktop_edit_free(E_Desktop_Edit *editor)
|
2006-09-03 08:11:04 -07:00
|
|
|
{
|
|
|
|
if (!editor) return;
|
2006-09-18 13:52:59 -07:00
|
|
|
E_OBJECT_CHECK(editor);
|
2014-02-25 11:28:12 -08:00
|
|
|
E_OBJECT_TYPE_CHECK(editor, E_DESKTOP_EDIT_TYPE);
|
2006-09-18 13:52:59 -07:00
|
|
|
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE(editor->tmp_image_path);
|
2007-03-27 22:58:01 -07:00
|
|
|
E_FREE(editor);
|
2006-09-03 08:11:04 -07:00
|
|
|
}
|
2005-10-27 03:19:43 -07:00
|
|
|
|
2007-03-27 22:58:01 -07:00
|
|
|
/**
|
2012-06-20 23:19:43 -07:00
|
|
|
* Populates the config dialog's data from the .desktop file passed in
|
2007-03-27 22:58:01 -07:00
|
|
|
*/
|
2005-10-27 03:19:43 -07:00
|
|
|
static void *
|
2007-03-27 22:58:01 -07:00
|
|
|
_e_desktop_edit_create_data(E_Config_Dialog *cfd)
|
2005-10-27 03:19:43 -07:00
|
|
|
{
|
2006-05-31 11:58:26 -07:00
|
|
|
E_Config_Dialog_Data *cfdata;
|
2012-06-20 23:19:43 -07:00
|
|
|
Efreet_Desktop *desktop = NULL;
|
2007-03-27 22:58:01 -07:00
|
|
|
char path[PATH_MAX];
|
|
|
|
|
2006-05-31 11:58:26 -07:00
|
|
|
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
2005-10-27 03:19:43 -07:00
|
|
|
if (!cfdata) return NULL;
|
2012-10-04 01:11:51 -07:00
|
|
|
cfd->dia->win->state.no_reopen = EINA_TRUE;
|
2005-10-27 03:19:43 -07:00
|
|
|
cfdata->editor = cfd->data;
|
2007-03-27 22:58:01 -07:00
|
|
|
|
2012-06-20 23:19:43 -07:00
|
|
|
/*
|
2010-08-30 10:54:18 -07:00
|
|
|
* If we can't write to the file on it's current location,
|
2007-03-27 22:58:01 -07:00
|
|
|
* we always save to the user's applications dir.
|
|
|
|
* If the file is already there, then edit it directly. Otherwise, create
|
2012-06-20 23:19:43 -07:00
|
|
|
* a new empty desktop entry there.
|
2007-03-27 22:58:01 -07:00
|
|
|
*
|
|
|
|
* cfdata->editor->desktop is the the desktop passed in
|
|
|
|
* cfdata->desktop is the desktop to save
|
|
|
|
* desktop is the desktop to load
|
|
|
|
*/
|
|
|
|
path[0] = '\0';
|
2012-06-20 23:19:43 -07:00
|
|
|
if (cfdata->editor->desktop)
|
2006-09-25 11:15:37 -07:00
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
char dir[PATH_MAX];
|
|
|
|
const char *file;
|
|
|
|
|
|
|
|
if (ecore_file_can_write(cfdata->editor->desktop->orig_path))
|
|
|
|
cfdata->desktop = efreet_desktop_uncached_new(cfdata->editor->desktop->orig_path);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf(dir, sizeof(dir), "%s/applications", efreet_data_home_get());
|
|
|
|
if (!strncmp(dir, cfdata->editor->desktop->orig_path, strlen(dir)))
|
|
|
|
cfdata->desktop = efreet_desktop_uncached_new(cfdata->editor->desktop->orig_path);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* file not in user's dir, so create new desktop that points there */
|
|
|
|
if (!ecore_file_exists(dir)) ecore_file_mkdir(dir);
|
|
|
|
file = ecore_file_file_get(cfdata->editor->desktop->orig_path);
|
|
|
|
snprintf(path, sizeof(path), "%s/%s", dir, file);
|
|
|
|
/*
|
|
|
|
* if a file already exists in the user dir with this name, we
|
|
|
|
* fetch the pointer to it, so the caches stay consistent (this
|
|
|
|
* probably will never return non null, since the ui shouldn't
|
|
|
|
* provide a means to edit a file in a system dir when one
|
|
|
|
* exists in the user's
|
|
|
|
*/
|
|
|
|
cfdata->desktop = efreet_desktop_uncached_new(path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
desktop = cfdata->editor->desktop;
|
2006-09-25 11:15:37 -07:00
|
|
|
}
|
2007-03-27 22:58:01 -07:00
|
|
|
|
|
|
|
if (!cfdata->desktop)
|
2012-07-17 03:32:01 -07:00
|
|
|
cfdata->desktop = efreet_desktop_empty_new(path);
|
2007-03-27 22:58:01 -07:00
|
|
|
|
|
|
|
if (!desktop) desktop = cfdata->desktop;
|
|
|
|
|
|
|
|
IFDUP(desktop->name, cfdata->name);
|
2010-03-05 16:42:09 -08:00
|
|
|
IFDUP(desktop->generic_name, cfdata->generic_name);
|
2007-03-27 22:58:01 -07:00
|
|
|
IFDUP(desktop->comment, cfdata->comment);
|
|
|
|
IFDUP(desktop->exec, cfdata->exec);
|
|
|
|
IFDUP(desktop->try_exec, cfdata->try_exec);
|
2010-08-31 06:49:17 -07:00
|
|
|
IFDUP(desktop->url, cfdata->url);
|
2007-03-27 22:58:01 -07:00
|
|
|
IFDUP(desktop->startup_wm_class, cfdata->startup_wm_class);
|
2010-03-05 16:42:09 -08:00
|
|
|
IFDUP(desktop->orig_path, cfdata->orig_path);
|
2007-03-27 22:58:01 -07:00
|
|
|
|
|
|
|
if (desktop->categories)
|
|
|
|
cfdata->categories = efreet_desktop_string_list_join(desktop->categories);
|
2007-12-04 09:48:28 -08:00
|
|
|
if (desktop->mime_types)
|
|
|
|
cfdata->mimes = efreet_desktop_string_list_join(desktop->mime_types);
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2007-03-27 22:58:01 -07:00
|
|
|
IFDUP(desktop->icon, cfdata->icon);
|
|
|
|
|
|
|
|
cfdata->startup_notify = desktop->startup_notify;
|
|
|
|
cfdata->terminal = desktop->terminal;
|
|
|
|
cfdata->show_in_menus = !desktop->no_display;
|
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
if (cfdata->exec && *cfdata->exec)
|
|
|
|
cfdata->type = 0;
|
|
|
|
else if (cfdata->url && *cfdata->url)
|
|
|
|
cfdata->type = 1;
|
|
|
|
|
2005-10-27 03:19:43 -07:00
|
|
|
return cfdata;
|
|
|
|
}
|
|
|
|
|
2007-03-27 22:58:01 -07:00
|
|
|
/**
|
|
|
|
* Frees the config dialog data
|
|
|
|
*/
|
2005-10-27 03:19:43 -07:00
|
|
|
static void
|
2010-03-05 16:42:09 -08:00
|
|
|
_e_desktop_edit_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
2005-12-04 04:03:59 -08:00
|
|
|
{
|
2012-06-20 23:19:43 -07:00
|
|
|
if (cfdata->editor->tmp_image_path)
|
2007-04-12 17:49:24 -07:00
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
if ((!cfdata->desktop) || (!cfdata->editor->saved) ||
|
|
|
|
(!cfdata->desktop->icon) ||
|
|
|
|
(strcmp(cfdata->editor->tmp_image_path, cfdata->desktop->icon)))
|
|
|
|
{
|
|
|
|
ecore_file_unlink(cfdata->editor->tmp_image_path);
|
|
|
|
}
|
2007-04-12 17:49:24 -07:00
|
|
|
}
|
2009-01-06 18:41:20 -08:00
|
|
|
if (cfdata->desktop) efreet_desktop_free(cfdata->desktop);
|
2007-03-27 22:58:01 -07:00
|
|
|
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE(cfdata->name);
|
|
|
|
E_FREE(cfdata->generic_name);
|
|
|
|
E_FREE(cfdata->comment);
|
|
|
|
E_FREE(cfdata->exec);
|
|
|
|
E_FREE(cfdata->try_exec);
|
|
|
|
E_FREE(cfdata->url);
|
|
|
|
E_FREE(cfdata->startup_wm_class);
|
|
|
|
E_FREE(cfdata->categories);
|
|
|
|
E_FREE(cfdata->icon);
|
|
|
|
E_FREE(cfdata->mimes);
|
|
|
|
E_FREE(cfdata->orig_path);
|
2007-12-04 09:48:28 -08:00
|
|
|
|
2012-06-20 23:19:43 -07:00
|
|
|
if (cfdata->editor->icon_fsel_dia)
|
2008-06-07 11:31:08 -07:00
|
|
|
e_object_del(E_OBJECT(cfdata->editor->icon_fsel_dia));
|
|
|
|
|
2007-03-27 22:58:01 -07:00
|
|
|
e_object_del(E_OBJECT(cfdata->editor));
|
2006-09-25 11:15:37 -07:00
|
|
|
free(cfdata);
|
2005-10-27 03:19:43 -07:00
|
|
|
}
|
|
|
|
|
2010-03-05 16:42:09 -08:00
|
|
|
static void
|
|
|
|
_e_desktop_edit_user_local_desktop_filename_generate(E_Config_Dialog_Data *cfdata, char *path)
|
|
|
|
{
|
2012-05-03 19:34:56 -07:00
|
|
|
char buf[PATH_MAX];
|
2010-03-05 16:42:09 -08:00
|
|
|
const char *name;
|
|
|
|
unsigned int i;
|
|
|
|
int prefix;
|
|
|
|
|
|
|
|
if ((cfdata->name) && (cfdata->name[0]))
|
|
|
|
name = cfdata->name;
|
|
|
|
else if ((cfdata->desktop) && (cfdata->desktop->name) &&
|
2012-07-17 03:32:01 -07:00
|
|
|
(cfdata->desktop->name[0]))
|
2010-03-05 16:42:09 -08:00
|
|
|
name = cfdata->name;
|
|
|
|
else
|
|
|
|
name = NULL;
|
|
|
|
|
|
|
|
if (name)
|
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
const char *s = name;
|
2012-12-05 03:13:09 -08:00
|
|
|
for (i = 0; i < sizeof(buf) - 1 && s[i]; i++)
|
2012-07-17 03:32:01 -07:00
|
|
|
{
|
|
|
|
if (isalnum(s[i]))
|
|
|
|
buf[i] = s[i];
|
|
|
|
else
|
|
|
|
buf[i] = '_';
|
|
|
|
}
|
|
|
|
buf[i] = '\0';
|
2010-03-05 16:42:09 -08:00
|
|
|
}
|
|
|
|
else
|
2012-05-03 19:34:56 -07:00
|
|
|
eina_strlcpy(buf, "unnamed_desktop", sizeof(buf));
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
i = snprintf(path, PATH_MAX, "%s/applications/%s.desktop",
|
2012-07-17 03:32:01 -07:00
|
|
|
efreet_data_home_get(), buf);
|
2010-03-05 16:42:09 -08:00
|
|
|
if (i >= PATH_MAX)
|
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
path[0] = '\0';
|
|
|
|
return;
|
2010-03-05 16:42:09 -08:00
|
|
|
}
|
|
|
|
prefix = i - (sizeof(".desktop") - 1);
|
|
|
|
|
|
|
|
for (i = 0; ecore_file_exists(path); i++)
|
|
|
|
snprintf(path + prefix, PATH_MAX - prefix, "-%u.desktop", i);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desktop_edit_update_orig_path(E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
|
|
|
const char *orig_path;
|
|
|
|
char path[PATH_MAX];
|
|
|
|
|
|
|
|
if ((cfdata->desktop->orig_path) && (cfdata->desktop->orig_path[0]))
|
|
|
|
orig_path = cfdata->desktop->orig_path;
|
|
|
|
else
|
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
_e_desktop_edit_user_local_desktop_filename_generate(cfdata, path);
|
|
|
|
orig_path = cfdata->orig_path = strdup(path);
|
2010-03-05 16:42:09 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (cfdata->orig_path_entry)
|
|
|
|
e_widget_entry_text_set(cfdata->orig_path_entry, orig_path);
|
|
|
|
}
|
|
|
|
|
2007-03-27 22:58:01 -07:00
|
|
|
/**
|
|
|
|
* Apply the basic config dialog
|
|
|
|
*/
|
2005-10-27 03:19:43 -07:00
|
|
|
static int
|
2010-03-05 16:42:09 -08:00
|
|
|
_e_desktop_edit_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
2005-10-27 03:19:43 -07:00
|
|
|
{
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE(cfdata->desktop->name);
|
2007-03-27 22:58:01 -07:00
|
|
|
IFDUP(cfdata->name, cfdata->desktop->name);
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE(cfdata->desktop->comment);
|
2007-03-27 22:58:01 -07:00
|
|
|
IFDUP(cfdata->comment, cfdata->desktop->comment);
|
2010-09-06 08:17:21 -07:00
|
|
|
|
|
|
|
switch (cfdata->type)
|
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
case 1:
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE(cfdata->desktop->url);
|
2012-07-17 03:32:01 -07:00
|
|
|
IFDUP(cfdata->url, cfdata->desktop->url);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE(cfdata->desktop->exec);
|
2012-07-17 03:32:01 -07:00
|
|
|
IFDUP(cfdata->exec, cfdata->desktop->exec);
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE(cfdata->desktop->try_exec);
|
2012-07-17 03:32:01 -07:00
|
|
|
IFDUP(cfdata->try_exec, cfdata->desktop->try_exec);
|
|
|
|
break;
|
2010-09-06 08:17:21 -07:00
|
|
|
}
|
|
|
|
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE(cfdata->desktop->generic_name);
|
2007-03-27 22:58:01 -07:00
|
|
|
IFDUP(cfdata->generic_name, cfdata->desktop->generic_name);
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE(cfdata->desktop->startup_wm_class);
|
2007-03-27 22:58:01 -07:00
|
|
|
IFDUP(cfdata->startup_wm_class, cfdata->desktop->startup_wm_class);
|
|
|
|
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE_LIST(cfdata->desktop->categories, eina_stringshare_del);
|
|
|
|
if (cfdata->categories)
|
|
|
|
cfdata->desktop->categories = efreet_desktop_string_list_parse(cfdata->categories);
|
|
|
|
|
|
|
|
E_FREE_LIST(cfdata->desktop->mime_types, eina_stringshare_del);
|
|
|
|
if (cfdata->mimes)
|
|
|
|
cfdata->desktop->mime_types = efreet_desktop_string_list_parse(cfdata->mimes);
|
2007-03-27 22:58:01 -07:00
|
|
|
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE(cfdata->desktop->icon);
|
2007-03-27 22:58:01 -07:00
|
|
|
IFDUP(cfdata->icon, cfdata->desktop->icon);
|
|
|
|
|
|
|
|
cfdata->desktop->startup_notify = cfdata->startup_notify;
|
|
|
|
cfdata->desktop->terminal = cfdata->terminal;
|
|
|
|
cfdata->desktop->no_display = !cfdata->show_in_menus;
|
|
|
|
|
|
|
|
if (cfdata->desktop->orig_path && cfdata->desktop->orig_path[0])
|
2007-04-12 17:49:24 -07:00
|
|
|
cfdata->editor->saved = efreet_desktop_save(cfdata->desktop);
|
2006-09-26 06:51:31 -07:00
|
|
|
else
|
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
_e_desktop_edit_update_orig_path(cfdata);
|
|
|
|
cfdata->editor->saved = efreet_desktop_save_as
|
|
|
|
(cfdata->desktop, cfdata->orig_path);
|
2010-03-05 16:42:09 -08:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
2007-03-27 22:58:01 -07:00
|
|
|
|
2010-03-05 16:42:09 -08:00
|
|
|
static int
|
|
|
|
_e_desktop_edit_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
if ((cfdata->startup_notify != cfdata->desktop->startup_notify) ||
|
|
|
|
(cfdata->terminal != cfdata->desktop->terminal) ||
|
|
|
|
(cfdata->show_in_menus != !cfdata->desktop->no_display))
|
|
|
|
return 1;
|
|
|
|
|
2012-07-17 03:32:01 -07:00
|
|
|
#define CHECK(k) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
const char *__k; \
|
|
|
|
if (cfdata->desktop->k) \
|
|
|
|
__k = cfdata->desktop->k; \
|
|
|
|
else if ((cfdata->editor) && (cfdata->editor->desktop)) \
|
|
|
|
__k = cfdata->editor->desktop->k; \
|
|
|
|
else \
|
|
|
|
__k = NULL; \
|
|
|
|
if ((cfdata->k && !__k) || (!cfdata->k && __k) || \
|
|
|
|
(cfdata->k && __k && strcmp(cfdata->k, __k) != 0)) \
|
|
|
|
return 1; \
|
|
|
|
} \
|
|
|
|
while (0)
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
CHECK(name);
|
|
|
|
CHECK(exec);
|
2010-08-31 06:49:17 -07:00
|
|
|
CHECK(try_exec);
|
|
|
|
CHECK(url);
|
2010-03-05 16:42:09 -08:00
|
|
|
CHECK(comment);
|
|
|
|
CHECK(generic_name);
|
|
|
|
CHECK(startup_wm_class);
|
|
|
|
CHECK(icon);
|
|
|
|
#undef CHECK
|
|
|
|
|
|
|
|
ret = 0;
|
|
|
|
|
|
|
|
if (cfdata->edited_categories)
|
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
const char *str;
|
2013-02-04 05:58:47 -08:00
|
|
|
Eina_List *lst = NULL, *old_lst;
|
2012-07-17 03:32:01 -07:00
|
|
|
|
|
|
|
cfdata->edited_categories = EINA_FALSE;
|
|
|
|
cfdata->changed_categories = EINA_FALSE;
|
|
|
|
|
|
|
|
if (cfdata->desktop->categories)
|
|
|
|
old_lst = cfdata->desktop->categories;
|
|
|
|
else if ((cfdata->editor) && (cfdata->editor->desktop))
|
|
|
|
old_lst = cfdata->editor->desktop->categories;
|
|
|
|
else
|
|
|
|
old_lst = NULL;
|
|
|
|
|
2013-02-04 05:58:47 -08:00
|
|
|
if (cfdata->categories)
|
|
|
|
lst = efreet_desktop_string_list_parse(cfdata->categories);
|
2012-07-17 03:32:01 -07:00
|
|
|
if (eina_list_count(lst) != eina_list_count(old_lst))
|
|
|
|
cfdata->changed_categories = EINA_TRUE;
|
|
|
|
|
|
|
|
EINA_LIST_FREE(lst, str)
|
|
|
|
{
|
|
|
|
if (!cfdata->changed_categories)
|
|
|
|
{
|
|
|
|
Eina_List *n;
|
|
|
|
const char *old;
|
|
|
|
Eina_Bool found = EINA_FALSE;
|
|
|
|
EINA_LIST_FOREACH(old_lst, n, old)
|
|
|
|
{
|
|
|
|
if (strcmp(str, old) == 0)
|
|
|
|
{
|
|
|
|
found = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!found)
|
|
|
|
cfdata->changed_categories = EINA_TRUE;
|
|
|
|
}
|
|
|
|
eina_stringshare_del(str);
|
|
|
|
}
|
2010-03-05 16:42:09 -08:00
|
|
|
}
|
|
|
|
ret |= cfdata->changed_categories;
|
2006-07-19 06:24:50 -07:00
|
|
|
|
2010-03-05 16:42:09 -08:00
|
|
|
if (!ret)
|
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
if (cfdata->edited_mimes)
|
|
|
|
{
|
|
|
|
const char *str;
|
2013-02-04 05:58:47 -08:00
|
|
|
Eina_List *lst = NULL, *old_lst;
|
2012-07-17 03:32:01 -07:00
|
|
|
|
|
|
|
cfdata->edited_mimes = EINA_FALSE;
|
|
|
|
cfdata->changed_mimes = EINA_FALSE;
|
|
|
|
|
|
|
|
if (cfdata->desktop->mime_types)
|
|
|
|
old_lst = cfdata->desktop->mime_types;
|
|
|
|
else if ((cfdata->editor) && (cfdata->editor->desktop))
|
|
|
|
old_lst = cfdata->editor->desktop->mime_types;
|
|
|
|
else
|
|
|
|
old_lst = NULL;
|
|
|
|
|
2013-02-04 05:58:47 -08:00
|
|
|
if (cfdata->mimes)
|
|
|
|
lst = efreet_desktop_string_list_parse(cfdata->mimes);
|
2012-07-17 03:32:01 -07:00
|
|
|
if (eina_list_count(lst) != eina_list_count(old_lst))
|
|
|
|
cfdata->changed_mimes = EINA_TRUE;
|
|
|
|
|
|
|
|
EINA_LIST_FREE(lst, str)
|
|
|
|
{
|
|
|
|
if (!cfdata->changed_mimes)
|
|
|
|
{
|
|
|
|
Eina_List *n;
|
|
|
|
const char *old;
|
|
|
|
Eina_Bool found = EINA_FALSE;
|
|
|
|
EINA_LIST_FOREACH(old_lst, n, old)
|
|
|
|
{
|
|
|
|
if (strcmp(str, old) == 0)
|
|
|
|
{
|
|
|
|
found = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!found)
|
|
|
|
cfdata->changed_mimes = EINA_TRUE;
|
|
|
|
}
|
|
|
|
eina_stringshare_del(str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ret |= cfdata->changed_mimes;
|
2007-03-27 22:58:01 -07:00
|
|
|
}
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
return ret;
|
2005-10-24 16:08:20 -07:00
|
|
|
}
|
|
|
|
|
2010-03-05 16:42:09 -08:00
|
|
|
static void
|
|
|
|
_e_desktop_editor_name_changed(void *data, Evas_Object *obj __UNUSED__)
|
2005-10-24 18:03:50 -07:00
|
|
|
{
|
2010-03-05 16:42:09 -08:00
|
|
|
E_Config_Dialog_Data *cfdata = data;
|
|
|
|
_e_desktop_edit_update_orig_path(cfdata);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desktop_editor_categories_changed(void *data, Evas_Object *obj __UNUSED__)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata = data;
|
|
|
|
cfdata->edited_categories = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2010-06-02 12:59:48 -07:00
|
|
|
static void
|
|
|
|
_e_desktop_editor_icon_entry_changed(void *data, Evas_Object *obj __UNUSED__)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata = data;
|
|
|
|
_e_desktop_editor_icon_update(cfdata);
|
|
|
|
}
|
|
|
|
|
2010-03-05 16:42:09 -08:00
|
|
|
static void
|
|
|
|
_e_desktop_editor_mimes_changed(void *data, Evas_Object *obj __UNUSED__)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata = data;
|
|
|
|
cfdata->edited_mimes = EINA_TRUE;
|
2005-10-24 18:03:50 -07:00
|
|
|
}
|
2005-10-24 16:08:20 -07:00
|
|
|
|
2005-10-27 03:19:43 -07:00
|
|
|
static Evas_Object *
|
2010-03-05 16:42:09 -08:00
|
|
|
_e_desktop_edit_basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
|
2005-10-25 17:19:52 -07:00
|
|
|
{
|
2010-03-05 16:42:09 -08:00
|
|
|
E_Desktop_Edit *editor = cfdata->editor;
|
2010-09-06 08:17:21 -07:00
|
|
|
E_Radio_Group *rg;
|
|
|
|
Evas_Object *otb, *ol, *o, *ot;
|
2010-03-05 16:42:09 -08:00
|
|
|
Evas_Coord mw, mh;
|
2006-07-19 06:24:50 -07:00
|
|
|
|
2006-07-28 06:42:03 -07:00
|
|
|
editor->evas = evas;
|
2006-07-19 06:24:50 -07:00
|
|
|
|
2010-03-05 16:42:09 -08:00
|
|
|
otb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
|
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
ot = e_widget_table_add(evas, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
o = e_widget_label_add(evas, _("Name"));
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 0, 0, 1, 1, 1, 1, 0, 0);
|
|
|
|
|
|
|
|
o = e_widget_entry_add(evas, &(cfdata->name), NULL, NULL, NULL);
|
2010-03-05 16:42:09 -08:00
|
|
|
e_widget_size_min_get(o, &mw, &mh);
|
|
|
|
if (mw < 220) mw = 220;
|
|
|
|
e_widget_size_min_set(o, mw, mh);
|
|
|
|
if ((!cfdata->desktop->orig_path) || (!cfdata->desktop->orig_path[0]))
|
|
|
|
e_widget_on_change_hook_set(o, _e_desktop_editor_name_changed, cfdata);
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 1, 0, 1, 1, 1, 1, 1, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
o = e_widget_label_add(evas, _("Comment"));
|
|
|
|
e_widget_table_object_append(ot, o, 0, 1, 1, 1, 1, 1, 0, 0);
|
2010-08-31 06:49:17 -07:00
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
o = e_widget_entry_add(evas, &(cfdata->comment), NULL, NULL, NULL);
|
|
|
|
e_widget_table_object_append(ot, o, 1, 1, 1, 1, 1, 1, 1, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
rg = e_widget_radio_group_new(&(cfdata->type));
|
2010-03-05 16:42:09 -08:00
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
// desktop type: application
|
2010-03-05 16:42:09 -08:00
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
o = e_widget_radio_add(evas, _("Application"), 0, rg);
|
|
|
|
e_widget_table_object_append(ot, o, 0, 2, 1, 1, 1, 1, 0, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
editor->entry_widget_exec = e_widget_entry_add
|
2012-07-17 03:32:01 -07:00
|
|
|
(evas, &(cfdata->exec), NULL, NULL, NULL);
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, editor->entry_widget_exec, 1, 2, 1, 1, 1, 1, 1, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
o = e_widget_button_add
|
2012-07-17 03:32:01 -07:00
|
|
|
(evas, "...", NULL, _e_desktop_editor_cb_exec_select, cfdata, editor);
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 2, 2, 1, 1, 0, 0, 0, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
// desktop type: url
|
|
|
|
o = e_widget_radio_add(evas, _("URL"), 1, rg);
|
|
|
|
e_widget_table_object_append(ot, o, 0, 3, 1, 1, 1, 1, 0, 0);
|
|
|
|
|
|
|
|
editor->entry_widget_url = e_widget_entry_add
|
2012-07-17 03:32:01 -07:00
|
|
|
(evas, &(cfdata->url), NULL, NULL, NULL);
|
2010-09-06 08:17:21 -07:00
|
|
|
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/..)
|
2006-07-19 06:24:50 -07:00
|
|
|
|
2010-03-05 16:42:09 -08:00
|
|
|
e_widget_toolbook_page_append
|
2010-09-06 08:17:21 -07:00
|
|
|
(otb, NULL, _("Basic"), ot, 1, 0, 1, 0, 0.5, 0.0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
2010-06-02 12:59:48 -07:00
|
|
|
/* e_widget_size_min_get(ol, &mw, &mh); */
|
2010-03-05 16:42:09 -08:00
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
ot = e_widget_table_add(evas, 0);
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2010-03-05 16:42:09 -08:00
|
|
|
editor->img_widget = e_widget_button_add
|
2012-07-17 03:32:01 -07:00
|
|
|
(evas, "", NULL, _e_desktop_editor_cb_icon_select, cfdata, editor);
|
2007-03-27 22:58:01 -07:00
|
|
|
_e_desktop_editor_icon_update(cfdata);
|
2010-06-02 12:59:48 -07:00
|
|
|
e_widget_size_min_set(editor->img_widget, 192, 192);
|
2005-10-25 17:19:52 -07:00
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, editor->img_widget, 0, 0, 2, 1, 1, 1, 0, 0);
|
2006-07-19 06:24:50 -07:00
|
|
|
|
2010-06-02 12:59:48 -07:00
|
|
|
o = e_widget_label_add(evas, _("Icon"));
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 0, 1, 1, 1, 1, 1, 0, 0);
|
2006-07-19 06:24:50 -07:00
|
|
|
|
2010-06-02 12:59:48 -07:00
|
|
|
o = e_widget_entry_add(evas, &(cfdata->icon), NULL, NULL, NULL);
|
|
|
|
cfdata->icon_entry = o;
|
|
|
|
e_widget_on_change_hook_set(o, _e_desktop_editor_icon_entry_changed, cfdata);
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 1, 1, 1, 1, 1, 1, 1, 0);
|
2010-06-02 12:59:48 -07:00
|
|
|
|
|
|
|
e_widget_toolbook_page_append
|
2010-09-06 08:17:21 -07:00
|
|
|
(otb, NULL, _("Icon"), ot, 0, 0, 0, 0, 0.5, 0.5);
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2010-09-06 08:17:21 -07:00
|
|
|
ot = e_widget_table_add(evas, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
o = e_widget_label_add(evas, _("Generic Name"));
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 0, 0, 1, 1, 1, 1, 0, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
o = e_widget_entry_add(evas, &(cfdata->generic_name), NULL, NULL, NULL);
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 1, 0, 1, 1, 1, 1, 1, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
o = e_widget_label_add(evas, _("Window Class"));
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 0, 1, 1, 1, 1, 1, 0, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
o = e_widget_entry_add(evas, &(cfdata->startup_wm_class), NULL, NULL, NULL);
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 1, 1, 1, 1, 1, 1, 1, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
o = e_widget_label_add(evas, _("Categories"));
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 0, 2, 1, 1, 1, 1, 0, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
o = e_widget_entry_add(evas, &(cfdata->categories), NULL, NULL, NULL);
|
|
|
|
e_widget_on_change_hook_set(o, _e_desktop_editor_categories_changed, cfdata);
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 1, 2, 1, 1, 1, 1, 1, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
o = e_widget_label_add(evas, _("Mime Types"));
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 0, 3, 1, 1, 1, 1, 0, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
o = e_widget_entry_add(evas, &(cfdata->mimes), NULL, NULL, NULL);
|
|
|
|
e_widget_on_change_hook_set(o, _e_desktop_editor_mimes_changed, cfdata);
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 1, 3, 1, 1, 1, 1, 1, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
o = e_widget_label_add(evas, _("Desktop file"));
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 0, 4, 1, 1, 1, 1, 0, 0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
o = e_widget_entry_add(evas, NULL, NULL, NULL, NULL);
|
2010-09-06 08:17:21 -07:00
|
|
|
e_widget_table_object_append(ot, o, 1, 4, 1, 1, 1, 1, 1, 0);
|
2012-12-11 02:50:54 -08:00
|
|
|
e_widget_entry_readonly_set(o, 1);
|
2010-03-05 16:42:09 -08:00
|
|
|
cfdata->orig_path_entry = o;
|
|
|
|
_e_desktop_edit_update_orig_path(cfdata);
|
|
|
|
|
|
|
|
e_widget_toolbook_page_append
|
2010-09-06 08:17:21 -07:00
|
|
|
(otb, NULL, _("General"), ot, 1, 0, 1, 0, 0.5, 0.0);
|
2010-03-05 16:42:09 -08:00
|
|
|
|
|
|
|
ol = e_widget_list_add(evas, 0, 0);
|
|
|
|
o = e_widget_check_add(evas, _("Startup Notify"), &(cfdata->startup_notify));
|
|
|
|
e_widget_list_object_append(ol, o, 1, 0, 0.0);
|
|
|
|
o = e_widget_check_add(evas, _("Run in Terminal"), &(cfdata->terminal));
|
|
|
|
e_widget_list_object_append(ol, o, 1, 0, 0.0);
|
|
|
|
o = e_widget_check_add(evas, _("Show in Menus"), &(cfdata->show_in_menus));
|
|
|
|
e_widget_list_object_append(ol, o, 1, 0, 0.0);
|
|
|
|
e_widget_toolbook_page_append
|
|
|
|
(otb, NULL, _("Options"), ol, 1, 0, 1, 0, 0.5, 0.0);
|
|
|
|
|
|
|
|
e_widget_toolbook_page_show(otb, 0);
|
|
|
|
|
|
|
|
e_util_win_auto_resize_fill(cfd->dia->win);
|
|
|
|
e_win_centered_set(cfd->dia->win, 1);
|
|
|
|
|
|
|
|
return otb;
|
2005-10-24 16:08:20 -07:00
|
|
|
}
|
2005-10-28 16:37:14 -07:00
|
|
|
|
2006-07-28 06:42:03 -07:00
|
|
|
static void
|
2007-03-27 22:58:01 -07:00
|
|
|
_e_desktop_editor_cb_icon_select(void *data1, void *data2)
|
2005-10-28 16:37:14 -07:00
|
|
|
{
|
2006-07-28 06:42:03 -07:00
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
E_Dialog *dia;
|
|
|
|
Evas_Object *o;
|
|
|
|
Evas_Coord mw, mh;
|
2007-03-27 22:58:01 -07:00
|
|
|
E_Desktop_Edit *editor;
|
2010-11-09 12:15:55 -08:00
|
|
|
char *path = NULL;
|
|
|
|
const char *icon_path = NULL;
|
2012-10-04 01:43:50 -07:00
|
|
|
char buf[PATH_MAX + 32];
|
2006-07-28 06:42:03 -07:00
|
|
|
|
2006-08-26 21:33:07 -07:00
|
|
|
editor = data2;
|
2006-07-28 06:42:03 -07:00
|
|
|
cfdata = data1;
|
2006-09-27 09:20:44 -07:00
|
|
|
|
2007-06-29 23:43:12 -07:00
|
|
|
if (editor->icon_fsel_dia) return;
|
2006-09-27 09:20:44 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
dia = e_dialog_new(cfdata->editor->cfd->comp, "E", "_eap_icon_select_dialog");
|
2006-07-28 06:42:03 -07:00
|
|
|
if (!dia) return;
|
2012-06-20 23:19:43 -07:00
|
|
|
e_object_del_attach_func_set(E_OBJECT(dia),
|
2012-07-17 03:32:01 -07:00
|
|
|
_e_desktop_edit_cb_icon_select_destroy);
|
2012-10-04 04:52:30 -07:00
|
|
|
snprintf(buf, sizeof(buf), _("Select an Icon for '%s'"), ecore_file_file_get(cfdata->orig_path));
|
2012-10-04 01:43:50 -07:00
|
|
|
e_dialog_title_set(dia, buf);
|
2006-07-28 06:42:03 -07:00
|
|
|
dia->data = cfdata;
|
|
|
|
|
2007-03-27 22:58:01 -07:00
|
|
|
/* absolute path to icon */
|
|
|
|
/* XXX change this to a generic icon selector (that can do either
|
|
|
|
* files from a dir, or icons in the current theme */
|
2012-06-20 23:19:43 -07:00
|
|
|
if (cfdata->icon)
|
2007-10-27 08:55:27 -07:00
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
if (ecore_file_exists(cfdata->icon))
|
|
|
|
icon_path = cfdata->icon;
|
|
|
|
else
|
|
|
|
icon_path = efreet_icon_path_find(e_config->icon_theme, cfdata->icon, 64);
|
2007-10-27 18:54:24 -07:00
|
|
|
|
2010-11-09 12:15:55 -08:00
|
|
|
if (icon_path)
|
|
|
|
path = ecore_file_dir_get(icon_path);
|
2007-10-27 08:55:27 -07:00
|
|
|
}
|
2007-03-27 22:58:01 -07:00
|
|
|
|
2007-10-27 08:55:27 -07:00
|
|
|
if (path)
|
2006-09-25 11:15:37 -07:00
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
o = e_widget_fsel_add(dia->win->evas, "/", path, NULL, NULL,
|
|
|
|
_e_desktop_edit_select_cb, cfdata,
|
|
|
|
NULL, cfdata, 1);
|
|
|
|
free(path);
|
2006-09-25 11:15:37 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
|
|
|
|
_e_desktop_edit_select_cb, cfdata,
|
|
|
|
NULL, cfdata, 1);
|
2006-09-25 11:15:37 -07:00
|
|
|
}
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2006-07-28 06:42:03 -07:00
|
|
|
evas_object_show(o);
|
2007-06-29 23:43:12 -07:00
|
|
|
editor->icon_fsel = o;
|
2009-09-01 06:34:42 -07:00
|
|
|
e_widget_size_min_get(o, &mw, &mh);
|
2006-07-28 06:42:03 -07:00
|
|
|
e_dialog_content_set(dia, o, mw, mh);
|
|
|
|
|
|
|
|
/* buttons at the bottom */
|
2012-06-20 23:19:43 -07:00
|
|
|
e_dialog_button_add(dia, _("OK"), NULL,
|
2012-07-17 03:32:01 -07:00
|
|
|
_e_desktop_edit_cb_icon_select_ok, cfdata);
|
2012-06-20 23:19:43 -07:00
|
|
|
e_dialog_button_add(dia, _("Cancel"), NULL,
|
2012-07-17 03:32:01 -07:00
|
|
|
_e_desktop_edit_cb_icon_select_cancel, cfdata);
|
2006-07-28 06:42:03 -07:00
|
|
|
e_win_centered_set(dia->win, 1);
|
|
|
|
e_dialog_show(dia);
|
2007-06-29 23:43:12 -07:00
|
|
|
editor->icon_fsel_dia = dia;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desktop_editor_cb_exec_select(void *data1, void *data2)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
E_Dialog *dia;
|
|
|
|
Evas_Object *o;
|
|
|
|
Evas_Coord mw, mh;
|
|
|
|
E_Desktop_Edit *editor;
|
2007-10-27 08:55:27 -07:00
|
|
|
char *path = NULL;
|
2007-06-29 23:43:12 -07:00
|
|
|
|
|
|
|
editor = data2;
|
|
|
|
cfdata = data1;
|
|
|
|
|
|
|
|
if (editor->exec_fsel_dia) return;
|
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
dia = e_dialog_new(cfdata->editor->cfd->comp, "E", "_eap_exec_select_dialog");
|
2007-06-29 23:43:12 -07:00
|
|
|
if (!dia) return;
|
2012-06-20 23:19:43 -07:00
|
|
|
e_object_del_attach_func_set(E_OBJECT(dia),
|
2012-07-17 03:32:01 -07:00
|
|
|
_e_desktop_edit_cb_exec_select_destroy);
|
2007-06-29 23:43:12 -07:00
|
|
|
e_dialog_title_set(dia, _("Select an Executable"));
|
|
|
|
dia->data = cfdata;
|
|
|
|
|
|
|
|
/* absolute path to exe */
|
2012-06-20 23:19:43 -07:00
|
|
|
if (cfdata->exec)
|
2007-10-27 08:55:27 -07:00
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
path = ecore_file_dir_get(cfdata->exec);
|
|
|
|
if (path && !ecore_file_exists(path))
|
|
|
|
{
|
|
|
|
free(path);
|
|
|
|
path = NULL;
|
|
|
|
}
|
2007-10-27 08:55:27 -07:00
|
|
|
}
|
2007-06-29 23:43:12 -07:00
|
|
|
|
2007-10-27 08:55:27 -07:00
|
|
|
if (path)
|
2007-06-29 23:43:12 -07:00
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
o = e_widget_fsel_add(dia->win->evas, "/", path, NULL, NULL,
|
|
|
|
_e_desktop_edit_select_cb, cfdata,
|
|
|
|
NULL, cfdata, 1);
|
|
|
|
free(path);
|
|
|
|
path = NULL;
|
2007-06-29 23:43:12 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-17 03:32:01 -07:00
|
|
|
o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
|
|
|
|
_e_desktop_edit_select_cb, cfdata,
|
|
|
|
NULL, cfdata, 1);
|
2007-06-29 23:43:12 -07:00
|
|
|
}
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2007-06-29 23:43:12 -07:00
|
|
|
evas_object_show(o);
|
|
|
|
editor->exec_fsel = o;
|
2009-09-01 06:34:42 -07:00
|
|
|
e_widget_size_min_get(o, &mw, &mh);
|
2007-06-29 23:43:12 -07:00
|
|
|
e_dialog_content_set(dia, o, mw, mh);
|
|
|
|
|
|
|
|
/* buttons at the bottom */
|
2012-06-20 23:19:43 -07:00
|
|
|
e_dialog_button_add(dia, _("OK"), NULL,
|
2012-07-17 03:32:01 -07:00
|
|
|
_e_desktop_edit_cb_exec_select_ok, cfdata);
|
2012-06-20 23:19:43 -07:00
|
|
|
e_dialog_button_add(dia, _("Cancel"), NULL,
|
2012-07-17 03:32:01 -07:00
|
|
|
_e_desktop_edit_cb_exec_select_cancel, cfdata);
|
2007-06-29 23:43:12 -07:00
|
|
|
e_win_centered_set(dia->win, 1);
|
|
|
|
e_dialog_show(dia);
|
|
|
|
editor->exec_fsel_dia = dia;
|
2006-07-28 06:42:03 -07:00
|
|
|
}
|
2006-07-19 06:24:50 -07:00
|
|
|
|
2006-07-28 06:42:03 -07:00
|
|
|
static void
|
2010-01-14 15:48:59 -08:00
|
|
|
_e_desktop_edit_select_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__)
|
2006-07-28 06:42:03 -07:00
|
|
|
{
|
2005-10-28 16:37:14 -07:00
|
|
|
}
|
2005-12-05 14:20:34 -08:00
|
|
|
|
2007-06-29 23:43:12 -07:00
|
|
|
static void
|
|
|
|
_e_desktop_edit_cb_icon_select_destroy(void *obj)
|
|
|
|
{
|
|
|
|
E_Dialog *dia = obj;
|
|
|
|
E_Config_Dialog_Data *cfdata = dia->data;
|
|
|
|
|
2012-06-20 23:19:43 -07:00
|
|
|
/* extra unref isn't needed - there is no extra ref() anywhere i saw */
|
2007-08-19 07:54:55 -07:00
|
|
|
/* e_object_unref(E_OBJECT(dia));*/
|
2007-06-29 23:43:12 -07:00
|
|
|
_e_desktop_edit_cb_icon_select_cancel(cfdata, NULL);
|
|
|
|
}
|
|
|
|
|
2006-07-28 06:42:03 -07:00
|
|
|
static void
|
2007-03-27 22:58:01 -07:00
|
|
|
_e_desktop_edit_cb_icon_select_ok(void *data, E_Dialog *dia)
|
2006-07-28 06:42:03 -07:00
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
2006-09-26 06:51:31 -07:00
|
|
|
const char *file;
|
2012-11-30 13:25:30 -08:00
|
|
|
char *dir;
|
|
|
|
const char *icon_dir;
|
2006-07-28 06:42:03 -07:00
|
|
|
|
|
|
|
cfdata = data;
|
2007-06-29 23:43:12 -07:00
|
|
|
file = e_widget_fsel_selection_path_get(cfdata->editor->icon_fsel);
|
2012-11-30 13:25:30 -08:00
|
|
|
dir = ecore_file_dir_get(file);
|
2006-07-28 06:42:03 -07:00
|
|
|
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE(cfdata->icon);
|
2012-11-30 13:25:30 -08:00
|
|
|
|
|
|
|
/* TODO: Check for theme icon */
|
|
|
|
icon_dir = e_user_icon_dir_get();
|
|
|
|
if ((icon_dir) && (e_util_dir_check(icon_dir)) && (!e_util_strcmp(dir, icon_dir)))
|
|
|
|
{
|
|
|
|
cfdata->icon = strdup(ecore_file_file_get(file));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Eina_List *xdg_dirs, *l;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
|
|
|
xdg_dirs = efreet_data_dirs_get();
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(xdg_dirs, l, icon_dir)
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "%s/icons", icon_dir);
|
|
|
|
if (!e_util_dir_check(buf)) continue;
|
|
|
|
if (!e_util_strcmp(dir, buf))
|
|
|
|
{
|
|
|
|
cfdata->icon = strdup(ecore_file_file_get(file));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!cfdata->icon)
|
|
|
|
{
|
|
|
|
IFDUP(file, cfdata->icon);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* strip ext */
|
|
|
|
char *p;
|
|
|
|
p = strrchr(cfdata->icon, '.');
|
|
|
|
if (p)
|
|
|
|
{
|
|
|
|
/* TODO: Check if known extension */
|
|
|
|
*p = '\0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
E_FREE(dir);
|
2010-06-02 12:59:48 -07:00
|
|
|
e_widget_entry_text_set(cfdata->icon_entry, cfdata->icon);
|
2007-03-27 22:58:01 -07:00
|
|
|
|
|
|
|
_e_desktop_edit_cb_icon_select_cancel(data, dia);
|
2006-07-28 06:42:03 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-03-27 22:58:01 -07:00
|
|
|
_e_desktop_edit_cb_icon_select_cancel(void *data, E_Dialog *dia)
|
2006-07-28 06:42:03 -07:00
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
2006-07-19 06:24:50 -07:00
|
|
|
|
2006-07-28 06:42:03 -07:00
|
|
|
cfdata = data;
|
2007-06-29 23:43:12 -07:00
|
|
|
if (dia) e_util_defer_object_del(E_OBJECT(dia));
|
|
|
|
cfdata->editor->icon_fsel_dia = NULL;
|
2007-03-27 22:58:01 -07:00
|
|
|
_e_desktop_editor_icon_update(cfdata);
|
2005-12-05 14:20:34 -08:00
|
|
|
}
|
2006-09-16 13:59:40 -07:00
|
|
|
|
|
|
|
static void
|
2007-03-27 22:58:01 -07:00
|
|
|
_e_desktop_editor_icon_update(E_Config_Dialog_Data *cfdata)
|
2006-09-16 13:59:40 -07:00
|
|
|
{
|
2007-03-27 22:58:01 -07:00
|
|
|
Evas_Object *o;
|
2007-12-04 02:52:55 -08:00
|
|
|
|
2007-03-27 22:58:01 -07:00
|
|
|
if (!cfdata->editor->img_widget) return;
|
2010-06-02 12:59:48 -07:00
|
|
|
o = e_util_icon_theme_icon_add(cfdata->icon, 128, cfdata->editor->evas);
|
2006-10-03 20:34:06 -07:00
|
|
|
|
2007-03-27 22:58:01 -07:00
|
|
|
/* NB this takes care of freeing any previous icon object */
|
|
|
|
e_widget_button_icon_set(cfdata->editor->img_widget, o);
|
2010-04-27 14:15:34 -07:00
|
|
|
e_widget_change(cfdata->editor->img_widget);
|
2006-09-26 09:09:40 -07:00
|
|
|
}
|
2007-06-29 23:43:12 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desktop_edit_cb_exec_select_destroy(void *obj)
|
|
|
|
{
|
|
|
|
E_Dialog *dia = obj;
|
|
|
|
E_Config_Dialog_Data *cfdata = dia->data;
|
|
|
|
|
2008-07-18 03:05:25 -07:00
|
|
|
/* guess it should work like _e_desktop_edit_cb_icon_select_destroy */
|
|
|
|
/* e_object_unref(E_OBJECT(dia)); */
|
2007-06-29 23:43:12 -07:00
|
|
|
_e_desktop_edit_cb_exec_select_cancel(cfdata, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desktop_edit_cb_exec_select_ok(void *data, E_Dialog *dia)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
const char *file;
|
|
|
|
|
|
|
|
cfdata = data;
|
|
|
|
file = e_widget_fsel_selection_path_get(cfdata->editor->exec_fsel);
|
|
|
|
|
2013-02-04 05:58:47 -08:00
|
|
|
E_FREE(cfdata->exec);
|
2013-11-21 02:50:10 -08:00
|
|
|
cfdata->exec = eina_str_escape(file);
|
2013-11-21 02:52:20 -08:00
|
|
|
E_FREE(cfdata->try_exec);
|
|
|
|
IFDUP(cfdata->try_exec, cfdata->exec);
|
2007-06-29 23:43:12 -07:00
|
|
|
|
|
|
|
_e_desktop_edit_cb_exec_select_cancel(data, dia);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desktop_edit_cb_exec_select_cancel(void *data, E_Dialog *dia)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
|
|
|
|
cfdata = data;
|
|
|
|
if (dia) e_util_defer_object_del(E_OBJECT(dia));
|
|
|
|
cfdata->editor->exec_fsel_dia = NULL;
|
|
|
|
_e_desktop_editor_exec_update(cfdata);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_desktop_editor_exec_update(E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
2010-09-06 08:17:21 -07:00
|
|
|
if (!cfdata->editor->entry_widget_exec) return;
|
|
|
|
e_widget_entry_text_set(cfdata->editor->entry_widget_exec, cfdata->exec);
|
2007-06-29 23:43:12 -07:00
|
|
|
}
|
2012-07-17 03:32:01 -07:00
|
|
|
|