Merge branch '#124_auto_add_ex' into develop

This commit is contained in:
Kolan Sh 2016-09-21 15:15:01 +03:00
commit a79e1aff2f
1 changed files with 10 additions and 0 deletions

View File

@ -46,6 +46,16 @@ namespace LAview.Desktop {
void fill_liststore_templates () { void fill_liststore_templates () {
var templates = AppCore.core.get_templates_readable_names (); var templates = AppCore.core.get_templates_readable_names ();
// #124 if core doesn't contain any templates then try adding an example template
var ex_templ_path = Path.build_path (Path.DIR_SEPARATOR_S, AppDirs.common_dir.get_path(),
"share/laview-core-0/templates/example.lyx");
if (0 == templates.length && File.new_for_path(ex_templ_path).query_exists()) {
AppCore.core.add_template (ex_templ_path);
templates = AppCore.core.get_templates_readable_names ();
}
liststore_templates.clear(); liststore_templates.clear();
Gtk.TreeIter iter = Gtk.TreeIter(); Gtk.TreeIter iter = Gtk.TreeIter();
foreach (var t in templates) { foreach (var t in templates) {