servlistgui: Error if nicks left empty

This commit is contained in:
Patrick Griffis 2016-06-12 15:01:39 -04:00
parent a031a24cfd
commit c12f33aa4c
1 changed files with 9 additions and 1 deletions

View File

@ -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,