aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/shot/e_mod_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-07-23 07:18:52 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-07-23 07:18:52 +0000
commit644a1c39f4756de666c290f272239e37d16c0699 (patch)
tree4eb3f5295ee00b99c749093f70a2c6b2bc7bfb03 /src/modules/shot/e_mod_main.c
parent7f9afaa54e5c5ab2b1e3ef88657cd01f28371174 (diff)
downloadenlightenment-644a1c39f4756de666c290f272239e37d16c0699.tar.gz
enlightenment-644a1c39f4756de666c290f272239e37d16c0699.tar.xz
enlightenment-644a1c39f4756de666c290f272239e37d16c0699.zip
patch from PrinceAMD to use date+time for shot filename.
SVN revision: 74306
Diffstat (limited to 'src/modules/shot/e_mod_main.c')
-rw-r--r--src/modules/shot/e_mod_main.c14
1 files 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 <time.h>
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);