summary refs log tree commit diff stats
path: root/src/fe-gtk/servlistgui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-gtk/servlistgui.c')
-rw-r--r--src/fe-gtk/servlistgui.c58
1 files changed, 18 insertions, 40 deletions
diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c
index 4ebf8c19..53903f84 100644
--- a/src/fe-gtk/servlistgui.c
+++ b/src/fe-gtk/servlistgui.c
@@ -1038,6 +1038,22 @@ servlist_autojoinedit (ircnet *net, char *channel, gboolean add)
 }
 
 static void
+servlist_toggle_global_user (gboolean sensitive)
+{
+	gtk_widget_set_sensitive (edit_entry_nick, sensitive);
+	gtk_widget_set_sensitive (edit_label_nick, sensitive);
+
+	gtk_widget_set_sensitive (edit_entry_nick2, sensitive);
+	gtk_widget_set_sensitive (edit_label_nick2, sensitive);
+
+	gtk_widget_set_sensitive (edit_entry_user, sensitive);
+	gtk_widget_set_sensitive (edit_label_user, sensitive);
+
+	gtk_widget_set_sensitive (edit_entry_real, sensitive);
+	gtk_widget_set_sensitive (edit_label_real, sensitive);
+}
+
+static void
 servlist_autojoinedit_cb (GtkWidget *button, ircnet *net)
 {
 	servlist_autojoinedit (net, NULL, FALSE);
@@ -1164,35 +1180,7 @@ servlist_check_cb (GtkWidget *but, gpointer num_p)
 
 	if ((1 << num) == FLAG_USE_GLOBAL)
 	{
-		if (GTK_TOGGLE_BUTTON (but)->active)
-		{
-			gtk_widget_set_sensitive (edit_entry_nick, FALSE);
-			gtk_widget_set_sensitive (edit_label_nick, FALSE);
-
-			gtk_widget_set_sensitive (edit_entry_nick2, FALSE);
-			gtk_widget_set_sensitive (edit_label_nick2, FALSE);
-
-			gtk_widget_set_sensitive (edit_entry_user, FALSE);
-			gtk_widget_set_sensitive (edit_label_user, FALSE);
-
-			gtk_widget_set_sensitive (edit_entry_real, FALSE);
-			gtk_widget_set_sensitive (edit_label_real, FALSE);
-			
-		}
-		else
-		{
-			gtk_widget_set_sensitive (edit_entry_nick, TRUE);
-			gtk_widget_set_sensitive (edit_label_nick, TRUE);
-
-			gtk_widget_set_sensitive (edit_entry_nick2, TRUE);
-			gtk_widget_set_sensitive (edit_label_nick2, TRUE);
-
-			gtk_widget_set_sensitive (edit_entry_user, TRUE);
-			gtk_widget_set_sensitive (edit_label_user, TRUE);
-
-			gtk_widget_set_sensitive (edit_entry_real, TRUE);
-			gtk_widget_set_sensitive (edit_label_real, TRUE);
-		}
+		servlist_toggle_global_user (!GTK_TOGGLE_BUTTON (but)->active);
 	}
 }
 
@@ -1700,17 +1688,7 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
 
 	if (net->flags & FLAG_USE_GLOBAL)
 	{
-		gtk_widget_set_sensitive (edit_entry_nick, FALSE);
-		gtk_widget_set_sensitive (edit_label_nick, FALSE);
-
-		gtk_widget_set_sensitive (edit_entry_nick2, FALSE);
-		gtk_widget_set_sensitive (edit_label_nick2, FALSE);
-
-		gtk_widget_set_sensitive (edit_entry_user, FALSE);
-		gtk_widget_set_sensitive (edit_label_user, FALSE);
-
-		gtk_widget_set_sensitive (edit_entry_real, FALSE);
-		gtk_widget_set_sensitive (edit_label_real, FALSE);
+		servlist_toggle_global_user (FALSE);
 	}
 
 	gtk_widget_grab_focus (button10);