+ this.search_entry.set_width_chars(30);
+
+
+ this.custom_vbox = new CustomVBox(this, false, 2);
+
+ var viewport = new Viewport(null, null);
+ viewport.set_border_width(2);
+ viewport.set_shadow_type(ShadowType.NONE);
+ viewport.add(custom_vbox);
+ var id_scrollwin = new ScrolledWindow(null, null);
+ id_scrollwin.set_policy(PolicyType.NEVER, PolicyType.AUTOMATIC);
+ id_scrollwin.set_shadow_type(ShadowType.IN);
+ id_scrollwin.add_with_viewport(viewport);
+ this.prompting_service = new Label(_(""));
+ // left-align
+ prompting_service.set_alignment(0, (float )0.5);
+
+ var vbox_left = new VBox(false, 0);
+ // vbox_left.pack_start(search_entry, false, false, 6);
+ // vbox_left.pack_start(id_scrollwin, true, true, 6);
+
+ var search_hbox = new HBox(false, 6);
+ var search_label = new Label(_("Search:"));
+ search_label.set_alignment(1, (float) 0.5);
+ set_atk_relation(search_label, search_entry, Atk.RelationType.LABEL_FOR);
+ search_hbox.pack_end(search_entry, false, false, 0);
+ search_hbox.pack_end(search_label, false, false, 6);
+
+ var full_search_label = new Label(_("Search for an identity or service"));
+ full_search_label.set_alignment(1, 1);
+ var search_vbox = new VBox(false, 4);
+ search_vbox.pack_start(search_hbox, false, false, 0);
+ search_vbox.pack_start(full_search_label, false, false, 0);
+
+ var inner_left_vbox = new VBox(false, 6);
+ inner_left_vbox.pack_start(search_vbox, false, false, 6);
+ inner_left_vbox.pack_start(id_scrollwin, true, true, 0);
+
+ var id_and_button_box = new HBox(false, 6);
+ id_and_button_box.pack_start(inner_left_vbox, true, true, 6);
+ vbox_left.pack_start(id_and_button_box, true, true, 0);
+ vbox_left.pack_start(prompting_service, false, false, 6);
+ vbox_left.set_size_request(WINDOW_WIDTH, 0);
+
+ this.no_identity_title = new Label(_("No Identity: Send this identity to services which should not use Moonshot"));
+ no_identity_title.set_alignment(0, (float ) 0.5);
+ no_identity_title.set_line_wrap(true);
+ no_identity_title.show();
+
+ // var login_vbox_title = new Label(_("Login: "));
+ // label_make_bold(login_vbox_title);
+ // login_vbox_title.set_alignment(0, (float) 0.5);
+ // var issuer_label = new Label(_("Issuer:"));
+ // issuer_label.set_alignment(1, (float) 0.5);
+ // this.issuer_entry = new Entry();
+ // issuer_entry.set_can_focus(false);
+ // var username_label = new Label(_("Username:"));
+ // username_label.set_alignment(1, (float) 0.5);
+ // this.username_entry = new Entry();
+ // username_entry.set_can_focus(false);
+ // var password_label = new Label(_("Password:"));
+ // password_label.set_alignment(1, (float) 0.5);
+ // this.password_entry = new Entry();
+ // password_entry.set_invisible_char('*');
+ // password_entry.set_visibility(false);
+ // password_entry.set_sensitive(false);
+ // this.remember_checkbutton = new CheckButton.with_label(_("Remember password"));
+ // remember_checkbutton.set_sensitive(false);
+
+ // set_atk_relation(issuer_label, issuer_entry, Atk.RelationType.LABEL_FOR);
+ // set_atk_relation(username_label, username_entry, Atk.RelationType.LABEL_FOR);
+ // set_atk_relation(password_entry, password_entry, Atk.RelationType.LABEL_FOR);
+
+ // // Create the login_vbox. This starts off hidden, because the first card we
+ // // display, by default, is NO_IDENTITY.
+ // var login_table = new Table(5, 2, false);
+ // login_table.set_col_spacings(10);
+ // login_table.set_row_spacings(10);
+ // login_table.attach_defaults(issuer_label, 0, 1, 0, 1);
+ // login_table.attach_defaults(issuer_entry, 1, 2, 0, 1);
+ // login_table.attach_defaults(username_label, 0, 1, 1, 2);
+ // login_table.attach_defaults(username_entry, 1, 2, 1, 2);
+ // login_table.attach_defaults(password_label, 0, 1, 2, 3);
+ // login_table.attach_defaults(password_entry, 1, 2, 2, 3);
+ // login_table.attach_defaults(remember_checkbutton, 1, 2, 3, 4);
+ // login_table.attach_defaults(update_password_button, 0, 1, 4, 5);
+ // var login_vbox_alignment = new Alignment(0, 0, 0, 0);
+ // login_vbox_alignment.set_padding(0, 0, 12, 0);
+ // login_vbox_alignment.add(login_table);
+ // this.login_vbox = new VBox(false, 6);
+ // login_vbox.pack_start(login_vbox_title, false, true, 0);
+ // login_vbox.pack_start(login_vbox_alignment, false, true, 0);
+ // login_vbox.hide();
+
+ // var services_vbox_title = new Label(_("Services:"));
+ // label_make_bold(services_vbox_title);
+ // services_vbox_title.set_alignment(0, (float) 0.5);
+
+ // this.services_internal_vbox = new VBox(true, 6);
+
+ // var services_vbox_alignment = new Alignment(0, 0, 0, 1);
+ // services_vbox_alignment.set_padding(6, 6, 6, 6);
+ // services_vbox_alignment.add(services_internal_vbox);
+ // services_vscroll = new ScrolledWindow(null, null);
+ // services_vscroll.set_policy(PolicyType.NEVER, PolicyType.AUTOMATIC);
+ // services_vscroll.set_shadow_type(ShadowType.IN);
+ // services_vscroll.add_with_viewport(services_vbox_alignment);
+
+ // services_vbox = new VBox(false, 6);
+ this.vbox_right = new VBox(false, 6);
+ // services_vbox.pack_start(services_vbox_title, false, false, 0);
+ // services_vbox.pack_start(services_vscroll, true, true, 0);
+
+ // vbox_right.pack_start(no_identity_title, true, false, 0);
+ // vbox_right.pack_start(login_vbox, false, false, 0);
+ // vbox_right.pack_start(services_vbox, true, true, 0);
+
+ var add_button = new Button.with_label(_("Add"));
+ add_button.clicked.connect((w) => {add_identity_cb();});
+
+ this.edit_button = new Button.with_label(_("Edit"));
+ edit_button.clicked.connect((w) => {edit_identity_cb(custom_vbox.current_idcard.id_card);});
+ edit_button.set_sensitive(false);
+
+ this.remove_button = new Button.with_label(_("Remove"));
+ remove_button.clicked.connect((w) => {remove_identity_cb(custom_vbox.current_idcard);});
+ remove_button.set_sensitive(false);
+
+ var send_button = new Button.with_label(_("Send"));
+ send_button.clicked.connect((w) => {send_identity_cb(custom_vbox.current_idcard.id_card);});
+ send_button.set_visible(false);
+
+ var empty_box = new VBox(false, 0);
+ empty_box.set_size_request(0, 0);
+ vbox_right.pack_start(empty_box, false, false, 14);
+ vbox_right.pack_start(add_button, false, false, 6);
+ vbox_right.pack_start(edit_button, false, false, 6);
+ vbox_right.pack_start(remove_button, false, false, 6);
+ vbox_right.pack_start(send_button, false, false, 24);
+
+ //var hbox = new HBox(false, 12);
+ // hbox.pack_start(vbox_left, true, true, 0);
+ // hbox.pack_start(vbox_right, false, false, 0);
+ id_and_button_box.pack_start(vbox_right, false, false, 0);
+ var main_vbox = new VBox(false, 0);
+ main_vbox.set_border_width(12);