Merge branch '#99_pdf_date_time' into develop

This commit is contained in:
Kolan Sh 2016-01-25 00:48:17 +03:00
commit 64624a96b0
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