From 644a1c39f4756de666c290f272239e37d16c0699 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 23 Jul 2012 07:18:52 +0000 Subject: [PATCH] patch from PrinceAMD to use date+time for shot filename. SVN revision: 74306 --- src/modules/shot/e_mod_main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/modules/shot/e_mod_main.c b/src/modules/shot/e_mod_main.c index fe4a43291..7115c7639 100644 --- a/src/modules/shot/e_mod_main.c +++ b/src/modules/shot/e_mod_main.c @@ -1,5 +1,6 @@ #include "e.h" #include "e_mod_main.h" +#include static E_Module *shot_module = NULL; @@ -232,11 +233,20 @@ _win_save_cb(void *data __UNUSED__, void *data2 __UNUSED__) Evas_Object *o; Evas_Coord mw, mh; int mask = 0; - + time_t tt; + struct tm *tm; + char buf[PATH_MAX]; + + time(&tt); + tm = localtime(&tt); + if (quality == 100) + strftime(buf, sizeof(buf), "shot-%Y-%m-%d_%H-%M-%S.png", tm); + else + strftime(buf, sizeof(buf), "shot-%Y-%m-%d_%H-%M-%S.jpg", tm); fsel_dia = dia = e_dialog_new(scon, "E", "_e_shot_fsel"); e_dialog_title_set(dia, _("Select screenshot save location")); o = e_widget_fsel_add(dia->win->evas, "desktop", "/", - (quality == 100) ? "shot.png" : "shot.jpg", + buf, NULL, NULL, NULL, NULL, NULL, 1);