public GLib.Queue<IdentityRequest> request_queue;
+ internal CheckButton remember_identity_binding = null;
+
private enum Columns
{
IDCARD_COL,
TreeIter iter;
IdCard id_card;
- var children = this.custom_vbox.get_children();
this.custom_vbox.clear();
if (filter.get_iter_first(out iter))
filter.refilter();
redraw_id_card_widgets();
set_prompting_service(request.service);
+ remember_identity_binding.show();
make_visible();
}
this.request_queue.push_tail(request);
public IdCard check_add_password(IdCard identity, IdentityRequest request, IdentityManagerModel model)
{
+ logger.trace(@"check_add_password");
IdCard retval = identity;
bool idcard_has_pw = (identity.password != null) && (identity.password != "");
bool request_has_pw = (request.password != null) && (request.password != "");
if ((identity != null) && (!identity.IsNoIdentity()))
parent_app.default_id_card = identity;
- request.return_identity(identity);
+ request.return_identity(identity, remember_identity_binding.active);
+
+ remember_identity_binding.active = false;
+ remember_identity_binding.hide();
}
// private void label_make_bold(Label label)
menubar.modify_bg(StateType.NORMAL, white);
#endif
main_vbox.pack_start(vbox_left, true, true, 0);
+
+ remember_identity_binding = new CheckButton.with_label(_("Remember my identity choice for this service"));
+ remember_identity_binding.active = false;
+ main_vbox.pack_start(remember_identity_binding, false, false, 6);
+
add(main_vbox);
main_vbox.show_all();
+
+ if (this.request_queue.length == 0)
+ remember_identity_binding.hide();
}
private void set_atk_name_description(Widget widget, string name, string description)
public delegate void ReturnIdentityCallback(IdentityRequest request);
public class IdentityRequest : Object {
+ static MoonshotLogger logger = get_logger("IdentityRequest");
+
public IdCard? id_card = null;
public bool complete = false;
public bool select_default = false;
return false;
}
- public void return_identity(IdCard? id_card) {
+ public void return_identity(IdCard? id_card, bool update_card = true) {
this.id_card = id_card;
this.complete = true;
/* update id_card service list */
- if (id_card != null && this.service != null && this.service != "")
+ if (update_card && id_card != null && this.service != null && this.service != "")
{
bool duplicate_service = false;
if (service == this.service)
duplicate_service = true;
}
+ logger.trace("return_identity: duplicate_service=" + duplicate_service.to_string());
if (duplicate_service == false)
{
- string[] services = new string[id_card.services.length + 1];
-
- for (int i = 0; i < id_card.services.length; i++)
- services[i] = id_card.services[i];
-
- services[id_card.services.length] = this.service;
- id_card.services = services;
+ id_card.add_service(this.service);
this.id_card = this.parent_app.model.update_card(id_card);
}
}
return_if_fail(callback != null);
+ logger.trace("return_identity: invoking callback");
callback(this);
}