After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 594788 - Adding option for user-defined date format for renaming files
Adding option for user-defined date format for renaming files
Status: RESOLVED FIXED
Product: gthumb
Classification: Other
Component: general
2.10.x
Other All
: Normal enhancement
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks:
 
 
Reported: 2009-09-10 19:14 UTC by Vladimir Domes
Modified: 2010-01-18 14:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
adding %date{} in rename function (1.94 KB, patch)
2010-01-12 09:40 UTC, Matthias Hawran
reviewed Details | Review
add help to ui (3.20 KB, patch)
2010-01-12 11:11 UTC, Matthias Hawran
none Details | Review
better format help (1.63 KB, patch)
2010-01-12 12:34 UTC, Matthias Hawran
none Details | Review
2 dates code (7.27 KB, patch)
2010-01-14 10:12 UTC, Matthias Hawran
none Details | Review

Description Vladimir Domes 2009-09-10 19:14:29 UTC
There is fixed date format for renaming  in GThumb.
In rename dialog window we can fill %d symbol for inserting date of picture in format YYYY-MM-DD--HH.mm.ss. But there isn't option for specifying formats like (for example without time): YYYY_MM_DD.


From my point of view solution of this problem/constraint can be implemented in three ways.

1. Add option to Preferences dialog for inserting user-defined format of %d symbol

2. Dividing symbol %d to symbols %Y, %M, %D, %H, %m, %S in rename dialog.

3. Both of previous: %d - user-defined + other symbols

Thanks very much. Renaming is last reason, why I have to use XnView in wine. In XnView is renaming almost perfect.
Comment 1 Matthias Hawran 2010-01-12 09:40:07 UTC
Created attachment 151233 [details] [review]
adding %date{} in rename function

Hi Vladimir,

I agree with the concept of your report.
However please note that the new 2.11.x serie is a complete rewrite.
%d does not exist anymore.

We've been discussing with Paolo about this on the mailing list (http://live.gnome.org/gthumb)
A %date{<strftime format>} is proposed.

I'm providing a patch.

All, please give me your feedback.
It's a first draft.

Probably there's some stripping to do to remove weird input characters.

Matthias
Comment 2 Matthias Hawran 2010-01-12 11:11:11 UTC
Created attachment 151242 [details] [review]
add help to ui

Here's a patch to add the help to the ui
Comment 3 Matthias Hawran 2010-01-12 12:34:54 UTC
Created attachment 151246 [details] [review]
better format help

Sorry my previous patch for ui was done too quickly.
Here's a new one with better format for the ui.
Comment 4 Matthias Hawran 2010-01-12 14:09:22 UTC
This bug status should be change to new
Comment 5 Michael Chudobiak 2010-01-12 15:07:03 UTC
We don't really worry about NEW versus UNCONFIRMED. But I'll change it anyway :-)

- Mike
Comment 6 Matthias Hawran 2010-01-12 15:21:16 UTC
Well you should ! ;-)

More seriously it's nice to make the distinction,
but of course it's a detail.

Thanks !
Comment 7 Paolo Bacchilega 2010-01-12 19:20:27 UTC
Review of attachment 151233 [details] [review]:

some comments on the patch:

1) %date seems ambiguous to me, I'd suggest to add %D for digitalization time and %M for modification time
2) there should be a default date format if no format is specified, for example %Y-%m-%d
Comment 8 Matthias Hawran 2010-01-13 09:19:22 UTC
Thanks for the comments Paolo.
I'll update the code accordingly.

However I need some help regarding digitalization time.
I don't seem to get any when calling gth_file_data_get_digitalization_time
even though my pictures have exif (I can see the exif in the properties panel)

gth_file_data_get_digitalization_time takes a GthFileData
must it somehow be initialized for the metadata ?
Comment 9 Paolo Bacchilega 2010-01-13 11:18:13 UTC
this is because in gth_browser_activate_action_edit_rename() instead of simply getting the file_data from the list we need to call _g_query_all_metadata_async to get the file_data list.
Comment 10 Matthias Hawran 2010-01-13 13:33:28 UTC
Ok, I see, but I'm not very confident on how to implement this, with the callback and all.
Comment 11 Matthias Hawran 2010-01-14 10:12:43 UTC
Created attachment 151384 [details] [review]
2 dates code

Here's a new patch:
date changes from %date{} to %M and %D
Both can take format input in {},
but have a default '%Y-%m-%d' format if none is provided.

The behavior is quite nice, have a try !

UI help is updated too.

Now I still need a correct call in gth_browser_activate_action_edit_rename()
to get the metadata.
Help appreciated :-)

Matthias
Comment 12 Paolo Bacchilega 2010-01-15 22:46:10 UTC
patches applied (thanks) + some changes:

*) added code to read all the metadata to make %D works correctly
*) renamed %attr as %A
*) unified the %D and %M code
*) changed the help strings
Comment 13 Matthias Hawran 2010-01-18 14:53:31 UTC
Cool.
Closing...