bug fix in font selection
authorChristoph Hohmann <reboot@gmx.ch>
Sun, 24 Jun 2001 14:14:56 +0000 (14:14 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sun, 24 Jun 2001 14:14:56 +0000 (14:14 +0000)
ChangeLog.claws
src/prefs_common.c

index 7cf42e8..7b85742 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-24 [christoph]
+
+       * src/prefs_common.c
+               bug fix in font selection
+
 2001-06-24 [alfons]
 
        * src/mainwindow.[ch]
index 411c919..3ff31a1 100644 (file)
@@ -183,6 +183,7 @@ static struct MessageColorButtons {
 
 static GtkWidget *quote_desc_win;
 static GtkWidget *font_sel_win;
+static guint font_sel_conn_id; 
 static GtkWidget *quote_color_win;
 static GtkWidget *color_dialog;
 
@@ -2723,11 +2724,6 @@ static void prefs_font_select(GtkButton *button, GtkEntry *entry)
                        (GTK_OBJECT(font_sel_win), "key_press_event",
                         GTK_SIGNAL_FUNC(prefs_font_selection_key_pressed),
                         NULL);
-               gtk_signal_connect
-                       (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button),
-                        "clicked",
-                        GTK_SIGNAL_FUNC(prefs_font_selection_ok),
-                        entry);
                gtk_signal_connect_object
                        (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->cancel_button),
                         "clicked",
@@ -2735,6 +2731,16 @@ static void prefs_font_select(GtkButton *button, GtkEntry *entry)
                         GTK_OBJECT(font_sel_win));
        }
 
+       if(font_sel_conn_id) {
+               gtk_signal_disconnect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button), font_sel_conn_id);
+       }
+       font_sel_conn_id = gtk_signal_connect
+               (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button),
+                "clicked",
+                GTK_SIGNAL_FUNC(prefs_font_selection_ok),
+                entry);
+       printf("%i\n", font_sel_conn_id);
+
        font_name = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
        gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(font_sel_win), font_name);
        g_free(font_name);