forked from enlightenment/enlightenment
allow to directly edit .desktop files
SVN revision: 51761
This commit is contained in:
parent
eebc1b3ee1
commit
586632efd1
|
@ -265,6 +265,7 @@ _e_desktop_edit_create_data(E_Config_Dialog *cfd)
|
||||||
cfdata->editor = cfd->data;
|
cfdata->editor = cfd->data;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* If we can't write to the file on it's current location,
|
||||||
* we always save to the user's applications dir.
|
* we always save to the user's applications dir.
|
||||||
* If the file is already there, then edit it directly. Otherwise, create
|
* If the file is already there, then edit it directly. Otherwise, create
|
||||||
* a new empty desktop entry there.
|
* a new empty desktop entry there.
|
||||||
|
@ -279,6 +280,10 @@ _e_desktop_edit_create_data(E_Config_Dialog *cfd)
|
||||||
char dir[PATH_MAX];
|
char dir[PATH_MAX];
|
||||||
const char *file;
|
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());
|
snprintf(dir, sizeof(dir), "%s/applications", efreet_data_home_get());
|
||||||
if (!strncmp(dir, cfdata->editor->desktop->orig_path, strlen(dir)))
|
if (!strncmp(dir, cfdata->editor->desktop->orig_path, strlen(dir)))
|
||||||
cfdata->desktop = efreet_desktop_uncached_new(cfdata->editor->desktop->orig_path);
|
cfdata->desktop = efreet_desktop_uncached_new(cfdata->editor->desktop->orig_path);
|
||||||
|
@ -297,6 +302,7 @@ _e_desktop_edit_create_data(E_Config_Dialog *cfd)
|
||||||
*/
|
*/
|
||||||
cfdata->desktop = efreet_desktop_uncached_new(path);
|
cfdata->desktop = efreet_desktop_uncached_new(path);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
desktop = cfdata->editor->desktop;
|
desktop = cfdata->editor->desktop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -328,6 +328,7 @@ static void _e_fm2_file_rename(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
static void _e_fm2_file_rename_delete_cb(void *obj);
|
static void _e_fm2_file_rename_delete_cb(void *obj);
|
||||||
static void _e_fm2_file_rename_yes_cb(char *text, void *data);
|
static void _e_fm2_file_rename_yes_cb(char *text, void *data);
|
||||||
static void _e_fm2_file_rename_no_cb(void *data);
|
static void _e_fm2_file_rename_no_cb(void *data);
|
||||||
|
static void _e_fm2_file_application_properties(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__);
|
||||||
static void _e_fm2_file_properties(void *data, E_Menu *m, E_Menu_Item *mi);
|
static void _e_fm2_file_properties(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
static void _e_fm2_file_properties_delete_cb(void *obj);
|
static void _e_fm2_file_properties_delete_cb(void *obj);
|
||||||
static void _e_fm2_file_do_rename(const char *text, E_Fm2_Icon *ic);
|
static void _e_fm2_file_do_rename(const char *text, E_Fm2_Icon *ic);
|
||||||
|
@ -8080,8 +8081,16 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!strcmp(ic->info.mime, "application/x-desktop"))
|
||||||
|
{
|
||||||
mi = e_menu_item_new(mn);
|
mi = e_menu_item_new(mn);
|
||||||
e_menu_item_label_set(mi, _("Properties"));
|
e_menu_item_label_set(mi, _("Application Properties"));
|
||||||
|
e_util_menu_item_theme_icon_set(mi, "configure");
|
||||||
|
e_menu_item_callback_set(mi, _e_fm2_file_application_properties, ic);
|
||||||
|
}
|
||||||
|
|
||||||
|
mi = e_menu_item_new(mn);
|
||||||
|
e_menu_item_label_set(mi, _("File Properties"));
|
||||||
e_util_menu_item_theme_icon_set(mi, "document-properties");
|
e_util_menu_item_theme_icon_set(mi, "document-properties");
|
||||||
e_menu_item_callback_set(mi, _e_fm2_file_properties, ic);
|
e_menu_item_callback_set(mi, _e_fm2_file_properties, ic);
|
||||||
|
|
||||||
|
@ -9195,6 +9204,28 @@ _e_fm_dbus_error_dialog(const char *title, const char *msg, const char *pstr)
|
||||||
e_dialog_show(dialog);
|
e_dialog_show(dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_fm2_file_application_properties(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
||||||
|
{
|
||||||
|
Efreet_Desktop *desktop;
|
||||||
|
E_Fm2_Icon *ic;
|
||||||
|
E_Manager *man;
|
||||||
|
E_Container *con;
|
||||||
|
char buf[PATH_MAX];
|
||||||
|
|
||||||
|
ic = data;
|
||||||
|
if (!_e_fm2_icon_realpath(ic, buf, sizeof(buf)))
|
||||||
|
return;
|
||||||
|
desktop = efreet_desktop_get(buf);
|
||||||
|
|
||||||
|
man = e_manager_current_get();
|
||||||
|
if (!man) return;
|
||||||
|
con = e_container_current_get(man);
|
||||||
|
if (!con) return;
|
||||||
|
|
||||||
|
e_desktop_edit(con, desktop);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_fm2_file_properties(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
_e_fm2_file_properties(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue