forked from enlightenment/enlightenment
Now you can add your own locations to the favorites list!
SVN revision: 25152
This commit is contained in:
parent
ee6d8162f6
commit
139a58c688
|
@ -25,6 +25,7 @@ struct _E_Widget_Data
|
||||||
Evas_Object *o_up_button;
|
Evas_Object *o_up_button;
|
||||||
Evas_Object *o_favorites_frame;
|
Evas_Object *o_favorites_frame;
|
||||||
Evas_Object *o_favorites_fm;
|
Evas_Object *o_favorites_fm;
|
||||||
|
Evas_Object *o_favorites_add;
|
||||||
Evas_Object *o_files_frame;
|
Evas_Object *o_files_frame;
|
||||||
Evas_Object *o_files_fm;
|
Evas_Object *o_files_fm;
|
||||||
Evas_Object *o_entry;
|
Evas_Object *o_entry;
|
||||||
|
@ -63,6 +64,34 @@ _e_wid_fsel_button_up(void *data1, void *data2)
|
||||||
e_widget_scrollframe_child_pos_set(wd->o_files_frame, 0, 0);
|
e_widget_scrollframe_child_pos_set(wd->o_files_frame, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_wid_fsel_favorites_add(void *data1, void *data2)
|
||||||
|
{
|
||||||
|
E_Widget_Data *wd;
|
||||||
|
const char *current_path;
|
||||||
|
char dest_path[PATH_MAX];
|
||||||
|
struct stat st;
|
||||||
|
int i = 1;
|
||||||
|
|
||||||
|
wd = data1;
|
||||||
|
current_path = e_fm2_real_path_get(wd->o_files_fm);
|
||||||
|
snprintf(dest_path, PATH_MAX, "%s/.e/e/fileman/favorites/%s",
|
||||||
|
getenv("HOME"), basename(current_path));
|
||||||
|
if (stat(dest_path, &st) < 0) symlink(current_path, dest_path);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while(stat(dest_path, &st) == 0)
|
||||||
|
{
|
||||||
|
snprintf(dest_path, PATH_MAX, "%s/.e/e/fileman/favorites/%s-%d",
|
||||||
|
getenv("HOME"),
|
||||||
|
basename(current_path), i);
|
||||||
|
i = i+1;
|
||||||
|
}
|
||||||
|
symlink(current_path, dest_path);
|
||||||
|
}
|
||||||
|
e_fm2_refresh(wd->o_favorites_fm);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_wid_fsel_favorites_files_changed(void *data, Evas_Object *obj, void *event_info)
|
_e_wid_fsel_favorites_files_changed(void *data, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
|
@ -226,6 +255,12 @@ e_widget_fsel_add(Evas *evas, const char *dev, const char *path, char *selected,
|
||||||
wd->o_table2 = o;
|
wd->o_table2 = o;
|
||||||
e_widget_sub_object_add(obj, o);
|
e_widget_sub_object_add(obj, o);
|
||||||
|
|
||||||
|
o = e_widget_button_add(evas, _("Add Current to Favorites"), "widget/add_fav",
|
||||||
|
_e_wid_fsel_favorites_add, wd, NULL);
|
||||||
|
wd->o_favorites_add = o;
|
||||||
|
e_widget_sub_object_add(obj, o);
|
||||||
|
e_widget_table_object_append(wd->o_table2, o, 0, 0, 1, 1, 0, 0, 1, 0);
|
||||||
|
|
||||||
o = e_widget_button_add(evas, _("Go up a Directory"), "widget/up_dir",
|
o = e_widget_button_add(evas, _("Go up a Directory"), "widget/up_dir",
|
||||||
_e_wid_fsel_button_up, wd, NULL);
|
_e_wid_fsel_button_up, wd, NULL);
|
||||||
wd->o_up_button = o;
|
wd->o_up_button = o;
|
||||||
|
@ -418,7 +453,8 @@ e_widget_fsel_add(Evas *evas, const char *dev, const char *path, char *selected,
|
||||||
|
|
||||||
e_widget_min_size_get(wd->o_table, &mw, &mh);
|
e_widget_min_size_get(wd->o_table, &mw, &mh);
|
||||||
e_widget_min_size_set(obj, mw, mh);
|
e_widget_min_size_set(obj, mw, mh);
|
||||||
|
|
||||||
|
evas_object_show(wd->o_favorites_add);
|
||||||
evas_object_show(wd->o_up_button);
|
evas_object_show(wd->o_up_button);
|
||||||
evas_object_show(wd->o_favorites_frame);
|
evas_object_show(wd->o_favorites_frame);
|
||||||
evas_object_show(wd->o_favorites_fm);
|
evas_object_show(wd->o_favorites_fm);
|
||||||
|
|
Loading…
Reference in New Issue