[seahorse] Set sane default length on keys



commit e02d3ecda17b82bfea5ce61739b54dd79b5de43b
Author: Adam Schreiber <sadam gnome org>
Date:   Sun Nov 29 17:30:55 2009 -0500

    Set sane default length on keys
    
    Set to 2048 bits unless > algo max

 pgp/seahorse-gpgme-generate.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/pgp/seahorse-gpgme-generate.c b/pgp/seahorse-gpgme-generate.c
index 30721e0..5fbafbe 100644
--- a/pgp/seahorse-gpgme-generate.c
+++ b/pgp/seahorse-gpgme-generate.c
@@ -345,6 +345,12 @@ on_gpgme_generate_algorithm_changed (GtkComboBox *combo, SeahorseWidget *swidget
     gtk_spin_button_set_range (GTK_SPIN_BUTTON (widget), 
                                available_algorithms[idx].min, 
                                available_algorithms[idx].max);
+
+    /* Set sane default key length */
+    if (2048 > available_algorithms[idx].max)
+        gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), available_algorithms[idx].max);
+    else
+        gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), 2048);
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]