static void nautilus_progress_info_widget_dispose (GObject *obj) { NautilusProgressInfoWidget *self = NAUTILUS_PROGRESS_INFO_WIDGET (obj); g_clear_object (&self->priv->info); G_OBJECT_CLASS (nautilus_progress_info_widget_parent_class)->dispose (obj); }
static void nautilus_progress_info_widget_dispose (GObject *obj) { NautilusProgressInfoWidget *self = NAUTILUS_PROGRESS_INFO_WIDGET (obj); if (self->priv->info != NULL) { g_signal_handlers_disconnect_by_data (self->priv->info, self); } g_clear_object (&self->priv->info); G_OBJECT_CLASS (nautilus_progress_info_widget_parent_class)->dispose (obj); }
static void nautilus_progress_info_widget_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { NautilusProgressInfoWidget *self = NAUTILUS_PROGRESS_INFO_WIDGET (object); switch (property_id) { case PROP_INFO: self->priv->info = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } }
static void nautilus_progress_info_widget_constructed (GObject *obj) { NautilusProgressInfoWidget *self = NAUTILUS_PROGRESS_INFO_WIDGET (obj); G_OBJECT_CLASS (nautilus_progress_info_widget_parent_class)->constructed (obj); g_signal_connect_swapped (self->priv->info, "changed", G_CALLBACK (update_data), self); g_signal_connect_swapped (self->priv->info, "progress-changed", G_CALLBACK (update_progress), self); g_signal_connect_swapped (self->priv->info, "finished", G_CALLBACK (info_finished), self); g_signal_connect_swapped (self->priv->info, "cancelled", G_CALLBACK (info_cancelled), self); update_data (self); update_progress (self); }
static void nautilus_progress_info_widget_constructed (GObject *obj) { GtkWidget *label, *progress_bar, *hbox, *box, *button, *image; NautilusProgressInfoWidget *self = NAUTILUS_PROGRESS_INFO_WIDGET (obj); G_OBJECT_CLASS (nautilus_progress_info_widget_parent_class)->constructed (obj); label = gtk_label_new ("status"); gtk_widget_set_size_request (label, 500, -1); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_line_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD_CHAR); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (self), label, TRUE, FALSE, 0); self->priv->status = label; hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); progress_bar = gtk_progress_bar_new (); self->priv->progress_bar = progress_bar; gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR (progress_bar), 0.05); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_box_pack_start(GTK_BOX (box), progress_bar, TRUE, FALSE, 0); gtk_box_pack_start(GTK_BOX (hbox), box, TRUE, TRUE, 0); image = gtk_image_new_from_icon_name ("gtk-cancel", GTK_ICON_SIZE_BUTTON); button = gtk_button_new (); gtk_container_add (GTK_CONTAINER (button), image); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE,FALSE, 0); g_signal_connect (button, "clicked", G_CALLBACK (cancel_clicked), self); gtk_box_pack_start (GTK_BOX (self), hbox, FALSE,FALSE, 0); label = gtk_label_new ("details"); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_box_pack_start (GTK_BOX (self), label, TRUE, FALSE, 0); self->priv->details = label; gtk_widget_show_all (GTK_WIDGET (self)); update_data (self); update_progress (self); g_signal_connect_swapped (self->priv->info, "changed", G_CALLBACK (update_data), self); g_signal_connect_swapped (self->priv->info, "progress-changed", G_CALLBACK (update_progress), self); g_signal_connect_swapped (self->priv->info, "finished", G_CALLBACK (info_finished), self); }