Added a confirmation dialog for clearing a Trust Anchor.
authorDan Breslau <dbreslau@painless-security.com>
Wed, 26 Oct 2016 00:19:12 +0000 (20:19 -0400)
committerDan Breslau <dbreslau@painless-security.com>
Wed, 26 Oct 2016 00:19:12 +0000 (20:19 -0400)
Also made "Remember my choice for this service" the default.

Also fixed some localization issues.

src/moonshot-identity-dialog.vala
src/moonshot-identity-management-view.vala
src/moonshot-trust-anchor-dialog.vala

index 3ac1f63..68183ef 100644 (file)
@@ -242,20 +242,33 @@ class IdentityDialog : Dialog
 
         var ta_clear_button = new Button.with_label(_("Clear Trust Anchor"));
         ta_clear_button.clicked.connect((w) => {
-                clear_trust_anchor = true;
-
-                // Clearing the trust_anchor_box's children, and then re-packing
-                // a label into it, doesn't seem to work. Instead, let's clear out
-                // the table's children, and then re-insert a label into it.
-                var children = ta_table.get_children();
-                foreach (var child in children) {
-                    ta_table.remove(child);
-                }
+                var result = WarningDialog.confirm(this,
+                                                   Markup.printf_escaped(
+                                                       "<span font-weight='heavy'>" 
+                                                       + _("You are about to clear the trust anchor fingerprint for '%s'.") 
+                                                       + "</span>",
+                                                       id.display_name)
+                                                   + _("\n\nAre you sure you want to do this?"),
+                                                   "clear_trust_anchor");
 
-                ta_table.resize(1, ncolumns);
-                ta_label.set_text(ta_label_prefix + none);
-                ta_table.attach(ta_label, 0, 1, 0, 1, 
-                                fill_and_expand, fill_and_expand, 0, 0);
+                if (result)
+                {
+                    clear_trust_anchor = true;
+
+                    // Clearing the trust_anchor_box's children, and then re-packing
+                    // a label into it, doesn't seem to work. Instead, let's clear out
+                    // the table's children, and then re-insert a label into it.
+                    var children = ta_table.get_children();
+                    foreach (var child in children) {
+                        ta_table.remove(child);
+                    }
+
+                    ta_table.resize(1, ncolumns);
+                    ta_label.set_text(ta_label_prefix + none);
+                    ta_table.attach(ta_label, 0, 1, 0, 1, 
+                                    fill_and_expand, fill_and_expand, 0, 0);
+
+                }
             }
             );
 
@@ -478,9 +491,11 @@ class IdentityDialog : Dialog
             {
                 var result = WarningDialog.confirm(this,
                                                    Markup.printf_escaped(
-                                                       "<span font-weight='heavy'>You are about to remove the service '%s'.</span>",
+                                                       "<span font-weight='heavy'>"
+                                                       + _("You are about to remove the service\n'%s'.") 
+                                                       + "</span>",
                                                        selected_item.label)
-                                                   + "\n\nAre you sure you want to do this?",
+                                                   + _("\n\nAre you sure you want to do this?"),
                                                    "delete_service");
 
                 if (result)
index 1c1390f..371f5d7 100644 (file)
@@ -787,7 +787,7 @@ SUCH DAMAGE.
 
         // Right below id_scrollwin:
         remember_identity_binding = new CheckButton.with_label(_("Remember my identity choice for this service"));
-        remember_identity_binding.active = false;
+        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"));
index ac0124c..ee205a9 100644 (file)
@@ -158,7 +158,8 @@ class TrustAnchorDialog : Dialog
 
         string label_markup;
         if (card.trust_anchor.server_cert == "") {
-            label_markup = "<span font-weight='heavy'>" + _("You are using this identity for the first time with the following trust anchor:") + "</span>";
+            label_markup = "<span font-weight='heavy'>" 
+            + _("You are using this identity for the first time with the following trust anchor:") + "</span>";
         }
         else {
             // The server's fingerprint isn't what we're expecting this server to provide.