- 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, 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);
- this.update_password_button = new Button.with_label(_("Update Password"));
- this.update_password_button.clicked.connect(update_password_cb);
-
- 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, 18);
- 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 hbox = new HBox(false, 12);
- hbox.pack_start(vbox_left, false, false, 0);
- hbox.pack_start(vbox_right, true, true, 0);
+ top_table.attach(id_scrollwin, 0, num_cols - 1, row, num_rows - 1, fill_and_expand, fill_and_expand, 6, 0);
+
+ // Right below id_scrollwin:
+ remember_identity_binding = new CheckButton.with_label(_("Remember my identity choice for this service"));
+ remember_identity_binding.active = true;
+ top_table.attach(remember_identity_binding, 0, num_cols / 2, num_rows - 1, num_rows, fill_and_expand, fill_and_expand, 3, 0);
+
+ var add_button = new Button.with_label(_("Add"));
+ add_button.clicked.connect((w) => {add_identity_cb();});
+ top_table.attach(make_rigid(add_button), num_cols - button_width, num_cols, row, row + 1, fill, fill, 0, 0);
+ row++;
+
+ var import_button = new Button.with_label(_("Import"));
+ import_button.clicked.connect((w) => {import_identities_cb();});
+ top_table.attach(make_rigid(import_button), num_cols - button_width, num_cols, row, row + 1, fill, fill, 0, 0);
+ row++;
+
+ this.edit_button = new Button.with_label(_("Edit"));
+ edit_button.clicked.connect((w) => {edit_identity_cb(this.selected_card);});
+ edit_button.set_sensitive(false);
+ top_table.attach(make_rigid(edit_button), num_cols - button_width, num_cols, row, row + 1, fill, fill, 0, 0);
+ row++;
+
+ this.remove_button = new Button.with_label(_("Remove"));
+ remove_button.clicked.connect((w) => {remove_identity_cb(this.selected_card);});
+ remove_button.set_sensitive(false);
+ top_table.attach(make_rigid(remove_button), num_cols - button_width, num_cols, row, row + 1, fill, fill, 0, 0);
+ row++;
+
+ // push the send button down another row.
+ row++;
+ this.send_button = new Button.with_label(_("Send"));
+ send_button.clicked.connect((w) => {send_identity_cb(this.selected_card);});
+ // send_button.set_visible(false);
+ send_button.set_sensitive(false);
+ top_table.attach(make_rigid(send_button), num_cols - button_width, num_cols, row, row + 1, fill, fill, 0, 0);
+ row++;