From c12f33aa4c0871174c0a035e46fa2e3c75822dc4 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Sun, 12 Jun 2016 15:01:39 -0400 Subject: servlistgui: Error if nicks left empty --- src/fe-gtk/servlistgui.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c index b64cf78c..6ef455fd 100644 --- a/src/fe-gtk/servlistgui.c +++ b/src/fe-gtk/servlistgui.c @@ -1570,7 +1570,15 @@ servlist_nick_changed_cb (GtkEntry *entry, gpointer userdata) const gchar *nick1 = gtk_entry_get_text (GTK_ENTRY (entry_nick1)); const gchar *nick2 = gtk_entry_get_text (GTK_ENTRY (entry_nick2)); - if (!rfc_casecmp (nick1, nick2)) + if (!nick1[0] || !nick2[0]) + { + entry = GTK_ENTRY(!nick1[0] ? entry_nick1 : entry_nick2); + gtk_entry_set_icon_from_stock (entry, GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_DIALOG_ERROR); + gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_SECONDARY, + _("You cannot have an empty nick name.")); + gtk_widget_set_sensitive (connect_btn, FALSE); + } + else if (!rfc_casecmp (nick1, nick2)) { gtk_entry_set_icon_from_stock (entry, GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_DIALOG_ERROR); gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_SECONDARY, -- cgit 1.4.1