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,12 +242,20 @@ namespace LAview.Desktop {
public void templates_cursor_changed (Gtk.TreeView treeview) { public void templates_cursor_changed (Gtk.TreeView treeview) {
var indices = get_template_indices (); var indices = get_template_indices ();
if (indices.length != 0) { if (indices.length != 0) {
var doc_objects = AppCore.core.get_objects_list (indices[0]); try {
liststore_doc_objects.clear(); var doc_objects = AppCore.core.get_objects_list (indices[0]);
Gtk.TreeIter iter = Gtk.TreeIter(); liststore_doc_objects.clear();
foreach (var t in doc_objects) { Gtk.TreeIter iter = Gtk.TreeIter();
liststore_doc_objects.append (out iter); foreach (var t in doc_objects) {
liststore_doc_objects.set (iter, 0, t); 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.")); statusbar_show (_("Document analized, select an object and set it's properties."));

View File

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