changeset 8901:c430e99bb147

[gaim-migrate @ 9670] Add a "Warning: Passwords are stored in plain text!" to the account editor when "Remember password" is checked. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 07 May 2004 03:57:30 +0000
parents 7a67c459ab8f
children cb3dd3a4c71c
files src/gtkaccount.c src/gtkutils.c src/gtkutils.h
diffstat 3 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkaccount.c	Fri May 07 03:25:00 2004 +0000
+++ b/src/gtkaccount.c	Fri May 07 03:57:30 2004 +0000
@@ -373,6 +373,8 @@
 	GtkWidget *frame;
 	GtkWidget *vbox;
 	GtkWidget *entry;
+	GtkWidget *label;
+	GdkColor color;
 	GList *user_splits;
 	GList *l, *l2;
 	char *username = NULL;
@@ -492,6 +494,15 @@
 					   FALSE, FALSE, 0);
 	gtk_widget_show(dialog->remember_pass_check);
 
+	/* The plain text password warning */
+	/* XXX - This color should be from the GTK theme and not hardcoded */
+	label = gtk_label_new_with_mnemonic(_("Warning: Passwords are stored in plain text!"));
+	gdk_color_parse("red", &color);
+	gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &color);
+	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+	g_signal_connect(G_OBJECT(dialog->remember_pass_check), "clicked",
+					 G_CALLBACK(gaim_gtk_toggle_showhide), label);
+
 	/* Auto-Login */
 	dialog->auto_login_check =
 		gtk_check_button_new_with_label(_("Auto-login"));
--- a/src/gtkutils.c	Fri May 07 03:25:00 2004 +0000
+++ b/src/gtkutils.c	Fri May 07 03:57:30 2004 +0000
@@ -261,6 +261,18 @@
 	}
 }
 
+void
+gaim_gtk_toggle_showhide(GtkWidget *widget, GtkWidget *to_toggle)
+{
+	if (to_toggle == NULL)
+		return;
+
+	if (GTK_WIDGET_VISIBLE(to_toggle))
+		gtk_widget_hide(to_toggle);
+	else
+		gtk_widget_show(to_toggle);
+}
+
 void gaim_separator(GtkWidget *menu)
 {
 	GtkWidget *menuitem;
--- a/src/gtkutils.h	Fri May 07 03:25:00 2004 +0000
+++ b/src/gtkutils.h	Fri May 07 03:57:30 2004 +0000
@@ -128,6 +128,14 @@
 void gtk_toggle_sensitive_array(GtkWidget *w, GPtrArray *data);
 
 /**
+ * Toggles the visibility of a widget.
+ *
+ * @param widget    @c NULL. Used for signal handlers.
+ * @param to_toggle The widget to toggle.
+ */
+void gaim_gtk_toggle_showhide(GtkWidget *widget, GtkWidget *to_toggle);
+
+/**
  * Adds a separator to a menu.
  *
  * @param menu The menu to add a separator to.