diff --git a/rtdata/languages/default b/rtdata/languages/default index ee08b0ba7..00c3089d7 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2121,6 +2121,8 @@ QUEUE_LOCATION_TEMPLATE_HELP_RANK_TITLE;Rank QUEUE_LOCATION_TEMPLATE_HELP_RANK_BODY;%r will be replaced by the photo's rank. If the photo is unranked, '0' is used. If the photo is in the trash, 'x' is used. QUEUE_LOCATION_TEMPLATE_HELP_SEQUENCE_TITLE;Position/sequence in queue QUEUE_LOCATION_TEMPLATE_HELP_SEQUENCE_BODY;%s1, ..., %s9 will be replaced by the photo's initial position in the queue at the time the queue is started. The number specifies the padding, e.g. %s3 results in '001'. +QUEUE_LOCATION_TEMPLATE_HELP_TIMESTAMP_TITLE;Date and time +QUEUE_LOCATION_TEMPLATE_HELP_TIMESTAMP_BODY;Three different date/time values may be used in templates:\n %tE"%Y-%m-%d" = when export started\n %tF"%Y-%m-%d" = when file was last saved\n %tP"%Y-%m-%d" = when photo was taken\nThe quoted string defines the format of the resulting date and/or time. The format string %tF"%Y-%m-%d" is just one example. The string can use all conversion specifiers defined for the g_date_time_format function (see https://docs.gtk.org/glib/method.DateTime.format.html).\n\nExample format strings: QUEUE_LOCATION_TEMPLATE_HELP_EXAMPLES_TITLE;Common examples QUEUE_LOCATION_TEMPLATE_HELP_EXAMPLES_BODY;If you want to save the output image alongside the source image, write:\n%p1/%f\n\nIf you want to save the output image in a folder named 'converted' located in the source photo's folder, write:\n%p1/converted/%f\n\nIf you want to save the output image in\n'/home/tom/photos/converted/2010-10-31', write:\n%p-3/converted/%P-4/%f QUEUE_LOCATION_TITLE;Output Location diff --git a/rtgui/batchqueuepanel.cc b/rtgui/batchqueuepanel.cc index a0587d442..9935da212 100644 --- a/rtgui/batchqueuepanel.cc +++ b/rtgui/batchqueuepanel.cc @@ -1,4 +1,3 @@ -#define CHECKPOINT printf("CHECKPOINT: %d\n", __LINE__); // FIXME: REMOVE /* * This file is part of RawTherapee. * @@ -365,6 +364,10 @@ void BatchQueuePanel::populateTemplateHelpBuffer(Glib::RefPtr b auto mainTitle = M("QUEUE_LOCATION_TEMPLATE_HELP_TITLE"); pos = buffer->insert_markup(pos, Glib::ustring::format("", mainTitle, "\n")); pos = buffer->insert_markup(pos, M("QUEUE_LOCATION_TEMPLATE_HELP_INTRO")); + + insertTopicHeading(M("QUEUE_LOCATION_TEMPLATE_HELP_EXAMPLES_TITLE")); + pos = buffer->insert_markup(pos, M("QUEUE_LOCATION_TEMPLATE_HELP_EXAMPLES_BODY")); + insertTopicHeading(M("QUEUE_LOCATION_TEMPLATE_HELP_PATHS_TITLE")); pos = buffer->insert_markup(pos, M("QUEUE_LOCATION_TEMPLATE_HELP_PATHS_INTRO")); pos = buffer->insert(pos, "\n"); @@ -441,12 +444,21 @@ void BatchQueuePanel::populateTemplateHelpBuffer(Glib::RefPtr b insertTopicHeading(M("QUEUE_LOCATION_TEMPLATE_HELP_SEQUENCE_TITLE")); pos = buffer->insert_markup(pos, M("QUEUE_LOCATION_TEMPLATE_HELP_SEQUENCE_BODY")); - insertTopicHeading(M("QUEUE_LOCATION_TEMPLATE_HELP_EXAMPLES_TITLE")); - pos = buffer->insert_markup(pos, M("QUEUE_LOCATION_TEMPLATE_HELP_EXAMPLES_BODY")); - /* FIXME: Still to do here: - Insert section for time/date specifiers - */ - options = savedOptions; + insertTopicHeading(M("QUEUE_LOCATION_TEMPLATE_HELP_TIMESTAMP_TITLE")); + pos = buffer->insert_markup(pos, M("QUEUE_LOCATION_TEMPLATE_HELP_TIMESTAMP_BODY")); + Glib::ustring dateTimeFormatExamples[] = { + "%Y-%m-%d", + "%Y%m%d_%H%M%S", + "%y/%b/%-d/" + }; + auto timeNow = Glib::DateTime::create_now_local(); + for (auto fmt : dateTimeFormatExamples) { + auto result = timeNow.format(fmt); + pos = buffer->insert_markup(pos, Glib::ustring::format("\n %tE\"", fmt, "\" = ", result, "")); + } + + pos = buffer->insert(pos, "\n"); + options = savedOptions; // Do not add any lines in this function below here } void BatchQueuePanel::addBatchQueueJobs(const std::vector& entries, bool head)