Handle AppCore.core.get_objects_list exceptions.

This commit is contained in:
Kolan Sh 2016-02-12 13:36:14 +03:00
parent 514c36efd4
commit 755a69fd9e
2 changed files with 14 additions and 7 deletions

View File

@ -242,6 +242,7 @@ namespace LAview.Desktop {
public void templates_cursor_changed (Gtk.TreeView treeview) {
var indices = get_template_indices ();
if (indices.length != 0) {
try {
var doc_objects = AppCore.core.get_objects_list (indices[0]);
liststore_doc_objects.clear();
Gtk.TreeIter iter = Gtk.TreeIter();
@ -249,6 +250,13 @@ namespace LAview.Desktop {
liststore_doc_objects.append (out iter);
liststore_doc_objects.set (iter, 0, t);
}
} catch (Error err) {
var msg = new MessageDialog (window, DialogFlags.MODAL, MessageType.ERROR,
ButtonsType.CLOSE, _("Error")+@": $(err.message).");
msg.response.connect ((response_id) => { msg.destroy (); } );
msg.show ();
return;
}
}
statusbar_show (_("Document analized, select an object and set it's properties."));
}

View File

@ -51,7 +51,6 @@ namespace LAview.Desktop {
}
~LAviewDesktopApp () {
print ("~LAviewDesktopApp()\n");
Resources.terminate ();
AppCore.terminate ();
AppDirs.terminate ();