--- a/app/dialogs/about-dialog.c 2021-03-28 23:52:55.000000000 +0200 +++ b/app/dialogs/about-dialog.c 2022-02-25 02:02:24.229474625 +0100 @@ -286,199 +286,6 @@ about_dialog_add_update (GimpAboutDialog *dialog, GimpCoreConfig *config) { - GtkWidget *container; - GList *children; - GtkWidget *vbox; - - GtkWidget *frame; - GtkWidget *box; - GtkWidget *box2; - GtkWidget *label; - GtkWidget *button; - GtkWidget *button_image; - GtkWidget *button_label; - GDateTime *datetime; - gchar *date; - gchar *text; - - if (dialog->update_frame) - { - gtk_widget_destroy (dialog->update_frame); - dialog->update_frame = NULL; - } - - /* Get the dialog vbox. */ - container = gtk_dialog_get_content_area (GTK_DIALOG (dialog->dialog)); - children = gtk_container_get_children (GTK_CONTAINER (container)); - g_return_if_fail (GTK_IS_BOX (children->data)); - vbox = children->data; - g_list_free (children); - - /* The preferred localized date representation without the time. */ - datetime = g_date_time_new_from_unix_local (config->last_release_timestamp); - date = g_date_time_format (datetime, "%x"); - g_date_time_unref (datetime); - - /* The update frame. */ - frame = gtk_frame_new (NULL); - gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 2); - - box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_container_add (GTK_CONTAINER (frame), box); - - /* Button in the frame. */ - button = gtk_button_new (); - gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_container_add (GTK_CONTAINER (button), box2); - gtk_widget_show (box2); - - button_image = gtk_image_new_from_icon_name (NULL, GTK_ICON_SIZE_DIALOG); - gtk_box_pack_start (GTK_BOX (box2), button_image, FALSE, FALSE, 0); - gtk_widget_show (button_image); - - button_label = gtk_label_new (NULL); - gtk_box_pack_start (GTK_BOX (box2), button_label, FALSE, FALSE, 0); - gtk_container_child_set (GTK_CONTAINER (box2), button_label, "expand", TRUE, NULL); - gtk_widget_show (button_label); - - if (config->last_known_release != NULL) - { - /* There is a newer version. */ - gchar *comment = NULL; - - /* We want the frame to stand out. */ - label = gtk_label_new (NULL); - text = g_strdup_printf ("%s", - _("Update available!")); - gtk_label_set_markup (GTK_LABEL (label), text); - g_free (text); - gtk_widget_show (label); - gtk_frame_set_label_widget (GTK_FRAME (frame), label); - gtk_frame_set_label_align (GTK_FRAME (frame), 0.5, 0.5); - gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_OUT); - gtk_box_reorder_child (GTK_BOX (vbox), frame, 3); - - /* Button is an update link. */ - gtk_image_set_from_icon_name (GTK_IMAGE (button_image), - "software-update-available", - GTK_ICON_SIZE_DIALOG); - g_signal_connect (button, "clicked", - (GCallback) about_dialog_download_clicked, - "https://www.gimp.org/downloads/"); - - if (config->last_revision > 0) - { - /* This is actually a new revision of current version. */ - text = g_strdup_printf (_("Download GIMP %s revision %d (released on %s)\n"), - config->last_known_release, - config->last_revision, - date); - - /* Finally an optional release comment. */ - if (config->last_release_comment) - { - /* Translators: <> tags are Pango markup. Please keep these - * markups in your translation. */ - comment = g_strdup_printf (_("Release comment: %s"), config->last_release_comment); - } - } - else - { - text = g_strdup_printf (_("Download GIMP %s (released on %s)\n"), - config->last_known_release, date); - } - gtk_label_set_text (GTK_LABEL (button_label), text); - g_free (text); - g_free (date); - - if (comment) - { - label = gtk_label_new (NULL); - gtk_label_set_max_width_chars (GTK_LABEL (label), 80); - gtk_label_set_markup (GTK_LABEL (label), comment); - gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); - g_free (comment); - - gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0); - gtk_widget_show (label); - } - } - else - { - /* Button is a "Check for updates" action. */ - gtk_image_set_from_icon_name (GTK_IMAGE (button_image), - "view-refresh", - GTK_ICON_SIZE_MENU); - gtk_label_set_text (GTK_LABEL (button_label), _("Check for updates")); - g_signal_connect_swapped (button, "clicked", - (GCallback) gimp_update_check, config); - - } - - gtk_box_reorder_child (GTK_BOX (vbox), frame, 4); - - /* Last check date box. */ - box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_container_add (GTK_CONTAINER (box), box2); - gtk_widget_show (box2); - - /* Show a small "Check for updates" button only if the big one has - * been replaced by a download button. - */ - if (config->last_known_release != NULL) - { - button = gtk_button_new (); - button_image = gtk_image_new_from_icon_name ("view-refresh", GTK_ICON_SIZE_MENU); - gtk_container_add (GTK_CONTAINER (button), button_image); - gtk_widget_set_tooltip_text (button, _("Check for updates")); - gtk_box_pack_start (GTK_BOX (box2), button, FALSE, FALSE, 0); - g_signal_connect_swapped (button, "clicked", - (GCallback) gimp_update_check, config); - gtk_widget_show (button); - gtk_widget_show (button_image); - } - - if (config->check_update_timestamp > 0) - { - gchar *subtext; - gchar *time; - - datetime = g_date_time_new_from_unix_local (config->check_update_timestamp); - date = g_date_time_format (datetime, "%x"); - time = g_date_time_format (datetime, "%X"); - /* Translators: first string is the date in the locale's date - * representation (e.g., 12/31/99), second is the time in the - * locale's time representation (e.g., 23:13:48). - */ - subtext = g_strdup_printf (_("Last checked on %s at %s"), date, time); - g_date_time_unref (datetime); - g_free (date); - g_free (time); - - text = g_strdup_printf ("%s", subtext); - label = gtk_label_new (NULL); - gtk_label_set_markup (GTK_LABEL (label), text); - gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER); - gtk_box_pack_start (GTK_BOX (box2), label, FALSE, FALSE, 0); - gtk_container_child_set (GTK_CONTAINER (box2), label, "expand", TRUE, NULL); - gtk_widget_show (label); - g_free (text); - g_free (subtext); - } - - gtk_widget_show (box); - gtk_widget_show (frame); - - dialog->update_frame = frame; - g_object_add_weak_pointer (G_OBJECT (frame), (gpointer) &dialog->update_frame); - - /* Reconstruct the dialog when release info changes. */ - g_signal_connect (config, "notify::last-known-release", - (GCallback) about_dialog_last_release_changed, - dialog); } static void