summaryrefslogtreecommitdiff
path: root/src/menu.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-06-02 13:45:00 +0200
committerDaniel Friesel <derf@finalrewind.org>2016-06-02 13:45:00 +0200
commit09c59148f8cdc1cb1cb83cb63f6edacec617a446 (patch)
tree36e759b0bd5d94fa4ef8817a746f43b6e6e9d5c4 /src/menu.c
parent315bac4637537654b4711867911458c3a6974c7e (diff)
parent36b09fa038a8b7996a12e45419c28821c5596308 (diff)
Merge branch 'guns-dirnav'
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c57
1 files changed, 48 insertions, 9 deletions
diff --git a/src/menu.c b/src/menu.c
index 9a83f08..ddb2db1 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -49,14 +49,39 @@ void feh_menu_cb(feh_menu * m, feh_menu_item * i, int action, unsigned short dat
void feh_menu_cb_opt_fullscreen(feh_menu * m, feh_menu_item * i);
enum {
- CB_CLOSE = 1, CB_EXIT, CB_RELOAD, CB_REMOVE, CB_DELETE, CB_RESET,
- CB_REMOVE_THUMB, CB_DELETE_THUMB, CB_BG_TILED, CB_BG_SCALED,
- CB_BG_CENTERED, CB_BG_FILLED, CB_BG_TILED_NOFILE,
- CB_BG_SCALED_NOFILE, CB_BG_CENTERED_NOFILE, CB_BG_FILLED_NOFILE,
- CB_SORT_FILENAME, CB_SORT_IMAGENAME, CB_SORT_FILESIZE, CB_SORT_RANDOMIZE,
- CB_SAVE_IMAGE, CB_SAVE_FILELIST, CB_FIT, CB_OPT_DRAW_FILENAME,
- CB_OPT_DRAW_ACTIONS, CB_OPT_KEEP_HTTP, CB_OPT_FREEZE_WINDOW,
- CB_OPT_FULLSCREEN, CB_EDIT_ROTATE, CB_OPT_AUTO_ZOOM, CB_OPT_KEEP_ZOOM_VP
+ CB_CLOSE = 1,
+ CB_EXIT,
+ CB_RELOAD,
+ CB_REMOVE,
+ CB_DELETE,
+ CB_RESET,
+ CB_REMOVE_THUMB,
+ CB_DELETE_THUMB,
+ CB_BG_TILED,
+ CB_BG_SCALED,
+ CB_BG_CENTERED,
+ CB_BG_FILLED,
+ CB_BG_TILED_NOFILE,
+ CB_BG_SCALED_NOFILE,
+ CB_BG_CENTERED_NOFILE,
+ CB_BG_FILLED_NOFILE,
+ CB_SORT_FILENAME,
+ CB_SORT_IMAGENAME,
+ CB_SORT_DIRNAME,
+ CB_SORT_MTIME,
+ CB_SORT_FILESIZE,
+ CB_SORT_RANDOMIZE,
+ CB_SAVE_IMAGE,
+ CB_SAVE_FILELIST,
+ CB_FIT,
+ CB_OPT_DRAW_FILENAME,
+ CB_OPT_DRAW_ACTIONS,
+ CB_OPT_KEEP_HTTP,
+ CB_OPT_FREEZE_WINDOW,
+ CB_OPT_FULLSCREEN,
+ CB_EDIT_ROTATE,
+ CB_OPT_AUTO_ZOOM,
+ CB_OPT_KEEP_ZOOM_VP
};
feh_menu *feh_menu_new(void)
@@ -923,7 +948,9 @@ void feh_menu_init_common()
feh_menu_add_entry(m, "By File Name", NULL, CB_SORT_FILENAME, 0, NULL);
feh_menu_add_entry(m, "By Image Name", NULL, CB_SORT_IMAGENAME, 0, NULL);
- if (opt.preload || (opt.sort > SORT_FILENAME))
+ feh_menu_add_entry(m, "By Directory Name", NULL, CB_SORT_DIRNAME, 0, NULL);
+ feh_menu_add_entry(m, "By Modification Date", NULL, CB_SORT_MTIME, 0, NULL);
+ if (opt.preload || (opt.sort > SORT_MTIME))
feh_menu_add_entry(m, "By File Size", NULL, CB_SORT_FILESIZE, 0, NULL);
feh_menu_add_entry(m, "Randomize", NULL, CB_SORT_RANDOMIZE, 0, NULL);
@@ -1252,6 +1279,18 @@ void feh_menu_cb(feh_menu * m, feh_menu_item * i, int action, unsigned short dat
slideshow_change_image(m->fehwin, SLIDE_FIRST, 1);
}
break;
+ case CB_SORT_DIRNAME:
+ filelist = gib_list_sort(filelist, feh_cmp_dirname);
+ if (opt.jump_on_resort) {
+ slideshow_change_image(m->fehwin, SLIDE_FIRST, 1);
+ }
+ break;
+ case CB_SORT_MTIME:
+ filelist = gib_list_sort(filelist, feh_cmp_mtime);
+ if (opt.jump_on_resort) {
+ slideshow_change_image(m->fehwin, SLIDE_FIRST, 1);
+ }
+ break;
case CB_SORT_FILESIZE:
filelist = gib_list_sort(filelist, feh_cmp_size);
if (opt.jump_on_resort) {