X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Fmoonshot-identity-dialog.vala;h=dba74ca477e52c0645a1199224ead1cb7cdd92af;hb=53078345094f06a685445bcf67181c7e25736a76;hp=0ae737a2d49c3d6e30060f52e353968057e9690b;hpb=9e70ca46454122515d5af2daf10d7577732ed9b2;p=moonshot-ui.git
diff --git a/src/moonshot-identity-dialog.vala b/src/moonshot-identity-dialog.vala
index 0ae737a..dba74ca 100644
--- a/src/moonshot-identity-dialog.vala
+++ b/src/moonshot-identity-dialog.vala
@@ -46,16 +46,6 @@ class IdentityDialog : Dialog
private static Gdk.Color selected_color = make_color(0xd9 << 8, 0xf7 << 8, 65535);
private static Gdk.Color alt_color = make_color(0xf2 << 8, 0xf2 << 8, 0xf2 << 8);
- private static Gdk.Color make_color(uint16 red, uint16 green, uint16 blue)
- {
- Gdk.Color color = Gdk.Color();
- color.red = red;
- color.green = green;
- color.blue = blue;
-
- return color;
- }
-
private static MoonshotLogger logger = get_logger("IdentityDialog");
static const string displayname_labeltext = _("Display Name");
@@ -63,7 +53,6 @@ class IdentityDialog : Dialog
static const string username_labeltext = _("Username");
static const string password_labeltext = _("Password");
- private IdentityManagerView parent;
private Entry displayname_entry;
private Label displayname_label;
private Entry realm_entry;
@@ -121,7 +110,6 @@ class IdentityDialog : Dialog
this.set_title(title);
this.set_modal(true);
this.set_transient_for(parent);
- this.parent = parent;
this.add_buttons(_("OK"), ResponseType.OK, CANCEL, ResponseType.CANCEL);
Box content_area = (Box) this.get_content_area();
@@ -146,20 +134,23 @@ class IdentityDialog : Dialog
password_label = new Label(@"$password_labeltext:");
password_label.set_alignment(0, (float) 0.5);
+
+ remember_checkbutton = new CheckButton.with_label(_("Remember password"));
+ remember_checkbutton.active = card.store_password;
+
password_entry = new Entry();
password_entry.set_invisible_char('*');
password_entry.set_visibility(false);
- password_entry.set_text(card.password);
password_entry.set_width_chars(40);
+ password_entry.set_text(card.password);
- remember_checkbutton = new CheckButton.with_label(_("Remember password"));
message_label = new Label("");
message_label.set_visible(false);
set_atk_relation(displayname_label, displayname_entry, Atk.RelationType.LABEL_FOR);
set_atk_relation(realm_label, realm_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);
+ set_atk_relation(password_label, password_entry, Atk.RelationType.LABEL_FOR);
content_area.pack_start(message_label, false, false, 6);
add_as_vbox(content_area, displayname_label, displayname_entry);
@@ -265,14 +256,6 @@ class IdentityDialog : Dialog
}
}
- private void set_atk_relation(Widget widget, Widget target_widget, Atk.RelationType relationship)
- {
- var atk_widget = widget.get_accessible();
- var atk_target_widget = target_widget.get_accessible();
-
- atk_widget.add_relationship(relationship, atk_target_widget);
- }
-
private static void label_make_bold(Label label)
{
var font_desc = new Pango.FontDescription();
@@ -379,16 +362,13 @@ class IdentityDialog : Dialog
remove_button.clicked.connect((remove_button) =>
{
- var dialog = new Gtk.MessageDialog(this,
- Gtk.DialogFlags.DESTROY_WITH_PARENT,
- Gtk.MessageType.QUESTION,
- Gtk.ButtonsType.YES_NO,
- _("You are about to remove the service '%s'. Are you sure you want to do this?"),
- selected_item.label);
- var ret = dialog.run();
- dialog.destroy();
-
- if (ret == Gtk.ResponseType.YES)
+ var result = WarningDialog.confirm(this,
+ "You are about to remove the service '%s'."
+ .printf(selected_item.label)
+ + "\n\nAre you sure you want to do this?",
+ "delete_service");
+
+ if (result)
{
if (card != null) {
SList services = new SList();