From 137cb363afbcbd0b9b3cf337db99fedb043a141e Mon Sep 17 00:00:00 2001 From: raveit65 Date: Sun, 8 Jan 2017 18:42:39 +0100 Subject: Fontviewer: refresh Install button appearance when model changes So that we can e.g. change it to "Installed" when the font is copied over to ~/.fonts. taken from: https://git.gnome.org/browse/gnome-font-viewer/commit/?id=94dbcc0 --- font-viewer/font-view.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/font-viewer/font-view.c b/font-viewer/font-view.c index f789bf2e..0b427a1d 100644 --- a/font-viewer/font-view.c +++ b/font-viewer/font-view.c @@ -287,6 +287,16 @@ font_install_finished_cb (GObject *source_object, } } +static void +font_model_config_changed_cb (FontViewModel *model, + gpointer user_data) +{ + FontViewApplication *self = user_data; + + if (self->font_file != NULL) + install_button_refresh_appearance (self, NULL); +} + static void install_button_clicked_cb (GtkButton *button, gpointer user_data) @@ -612,6 +622,8 @@ font_view_application_startup (GApplication *application) g_object_unref (menu); self->model = font_view_model_new (); + g_signal_connect (self->model, "config-changed", + G_CALLBACK (font_model_config_changed_cb), self); self->main_window = window = gtk_application_window_new (GTK_APPLICATION (application)); gtk_window_set_resizable (GTK_WINDOW (window), TRUE); -- cgit v1.2.1