Fix data/object->preferences() calls.

This commit is contained in:
Kolan Sh 2018-06-22 11:09:30 +03:00
parent f062689584
commit 4b66489034
1 changed files with 24 additions and 24 deletions

View File

@ -105,36 +105,36 @@ namespace LAview.Desktop {
void call_data_preferences () { void call_data_preferences () {
var indices = get_data_indices (); var indices = get_data_indices ();
for (int i = indices.length; i > 0;) var i = indices[0];
foreach (var p in AppCore.core.data_plugins.entries) foreach (var p in AppCore.core.data_plugins.entries)
if (indices[--i] == 0) { if (i-- == 0) {
try { try {
p.value.preferences(dialog); p.value.preferences(dialog);
break; break;
} catch (Error err) { } catch (Error err) {
var msg = new MessageDialog (dialog, DialogFlags.MODAL, MessageType.ERROR, var msg = new MessageDialog (dialog, DialogFlags.MODAL, MessageType.ERROR,
ButtonsType.CLOSE, _("Error: ")+err.message); ButtonsType.CLOSE, _("Error: ")+err.message);
msg.response.connect ((response_id) => { msg.destroy (); } ); msg.response.connect ((response_id) => { msg.destroy (); } );
msg.show (); msg.show ();
}
} }
}
} }
void call_object_preferences () { void call_object_preferences () {
var indices = get_objects_indices (); var indices = get_objects_indices ();
for (int i = indices.length; i > 0;) var i = indices[0];
foreach (var p in AppCore.core.object_plugins.entries) foreach (var p in AppCore.core.object_plugins.entries)
if (indices[--i] == 0) { if (i-- == 0) {
try { try {
p.value.preferences(dialog); p.value.preferences(dialog);
break; break;
} catch (Error err) { } catch (Error err) {
var msg = new MessageDialog (dialog, DialogFlags.MODAL, MessageType.ERROR, var msg = new MessageDialog (dialog, DialogFlags.MODAL, MessageType.ERROR,
ButtonsType.CLOSE, _("Error: ")+err.message); ButtonsType.CLOSE, _("Error: ")+err.message);
msg.response.connect ((response_id) => { msg.destroy (); } ); msg.response.connect ((response_id) => { msg.destroy (); } );
msg.show (); msg.show ();
}
} }
}
} }
[CCode (instance_pos = -1)] [CCode (instance_pos = -1)]