pidgin: f86c7d91: Do not allow setting empty shortcut for ...

sadrul at pidgin.im sadrul at pidgin.im
Tue Aug 26 18:01:19 EDT 2008


-----------------------------------------------------------------
Revision: f86c7d91d43d251c7c0b224acfeeb534046f93d4
Ancestor: 6f34a34bf30cf4383a791cbed21f696dcf4d81d8
Author: sadrul at pidgin.im
Date: 2008-08-26T22:06:21
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f86c7d91d43d251c7c0b224acfeeb534046f93d4

Modified files:
        pidgin/gtksmiley.c

ChangeLog: 

Do not allow setting empty shortcut for a custom smiley.

Fixes <672525.16246.qm at web45411.mail.sp1.yahoo.com> reported by Jean La.

-------------- next part --------------
============================================================
--- pidgin/gtksmiley.c	4acb5ebc53607f0bf474c2e403232f1b1cc74d40
+++ pidgin/gtksmiley.c	23e08e5665b4f78928d54d8ee8f57f74dd2b2b6c
@@ -224,6 +224,13 @@ static void do_add(GtkWidget *widget, Pi
 	PurpleSmiley *emoticon;
 
 	entry = gtk_entry_get_text(GTK_ENTRY(s->smile));
+	if (!entry || !*entry) {
+		purple_notify_error(s->parent, _("Custom Smiley"),
+				_("More Data needed"),
+				_("Please provide a shortcut to associate with the smiley."));
+		return;
+	}
+
 	emoticon = purple_smileys_find_by_shortcut(entry);
 	if (emoticon && emoticon != s->smiley) {
 		purple_notify_error(s->parent, _("Custom Smiley"),
@@ -346,7 +353,7 @@ pidgin_smiley_edit(GtkWidget *widget, Pu
 	window = gtk_dialog_new_with_buttons(smiley ? _("Edit Smiley") : _("Add Smiley"),
 			widget ? GTK_WINDOW(widget) : NULL,
 			GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
-			GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,							 
+			GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 			smiley ? GTK_STOCK_SAVE : GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT,
 			NULL);
 	s->parent = window;


More information about the Commits mailing list