From 8cd877f17cbd9dff57057d09779fa057d04f88e4 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 22 Jun 2015 18:29:28 +0200 Subject: [PATCH] Replace GtkFontSelectionDialog with GtkFontChooserDialog --- src/ui/gui/psppire-data-window.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index 126980c8bb..ae200940a7 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -698,25 +698,18 @@ static void fonts_activate (PsppireDataWindow *de) { GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (de)); - GtkWidget *dialog = gtk_font_selection_dialog_new (_("Font Selection")); + GtkWidget *dialog = gtk_font_chooser_dialog_new (NULL, GTK_WINDOW (toplevel)); GtkStyle *style = gtk_widget_get_style (GTK_WIDGET(de->data_editor)); PangoFontDescription *current_font = style->font_desc; - gchar *font_name = pango_font_description_to_string (current_font); - gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG (dialog), font_name); - - g_free (font_name); + gtk_font_chooser_set_font_desc (GTK_FONT_CHOOSER (dialog), current_font); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (toplevel)); if ( GTK_RESPONSE_OK == gtk_dialog_run (GTK_DIALOG (dialog)) ) { - const gchar *font = gtk_font_selection_dialog_get_font_name - (GTK_FONT_SELECTION_DIALOG (dialog)); - - PangoFontDescription* font_desc = - pango_font_description_from_string (font); + PangoFontDescription* font_desc = gtk_font_chooser_get_font_desc (GTK_FONT_CHOOSER (dialog)); psppire_data_editor_set_font (de->data_editor, font_desc); } -- 2.30.2