# HG changeset patch # User Sadrul Habib Chowdhury # Date 1219788381 0 # Node ID 64a4069e504e419867774fb0f6e4391292898a44 # Parent 08c29b5b0ee83ab938ea11b3fe4d8b672487f7fe Do not allow setting empty shortcut for a custom smiley. Fixes <672525.16246.qm@web45411.mail.sp1.yahoo.com> reported by Jean La. diff -r 08c29b5b0ee8 -r 64a4069e504e pidgin/gtksmiley.c --- a/pidgin/gtksmiley.c Sun Aug 24 06:35:01 2008 +0000 +++ b/pidgin/gtksmiley.c Tue Aug 26 22:06:21 2008 +0000 @@ -224,6 +224,13 @@ 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 @@ 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;