Closes #99: Date+time to the pdf file name.

This commit is contained in:
Kolan Sh 2016-01-25 00:47:47 +03:00
parent 8b99f682e2
commit 112daf68d0
1 changed files with 6 additions and 2 deletions

View File

@ -276,8 +276,12 @@ namespace LAview.Desktop {
// set current pdf file name or select an existance one
var template_name = AppCore.core.get_template_path_by_index (indices[0]);
template_name = File.new_for_path(template_name).get_basename ();
if (template_name.down().has_suffix(".lyx"))
template_name = template_name.splice (template_name.length-4, template_name.length, ".pdf");
if ( template_name.down().has_suffix(".lyx")
|| template_name.down().has_suffix(".tex")
) {
var date = Time.local (time_t()).format("-%Y.%m.%d_%H-%M-%S");
template_name = template_name.splice (template_name.length-4, template_name.length, date+".pdf");
}
if (File.new_for_path(template_name).query_exists())
chooser.set_filename (template_name);
else