static const GTypeInfo dialog_info =
{
sizeof (PsppireDialogClass),
- (GBaseInitFunc) psppire_dialog_base_init,
+ (GBaseInitFunc) (void (*)(void)) psppire_dialog_base_init,
NULL, /* base_finalize */
- (GClassInitFunc) psppire_dialog_class_init,
+ (GClassInitFunc) (void (*)(void)) psppire_dialog_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (PsppireDialog),
0,
- (GInstanceInitFunc) psppire_dialog_init,
+ (GInstanceInitFunc) (void (*)(void)) psppire_dialog_init,
+ NULL /* value_table */
};
dialog_type = g_type_register_static (PSPPIRE_TYPE_WINDOW_BASE,
GParamSpec *sliding_spec ;
GParamSpec *help_page_spec ;
- help_page_spec =
- g_param_spec_string ("help-page",
+ help_page_spec =
+ g_param_spec_string ("help-page",
"Help Page",
"The section of the manual to load when the Help button is clicked",
NULL,
void
psppire_dialog_notify_change (PsppireDialog *dialog)
{
- if ( dialog->contents_are_valid )
+ if (dialog->contents_are_valid)
{
gboolean valid = dialog->contents_are_valid (dialog->validity_data);
}
-static void
-remove_notify_handlers (PsppireDialog *dialog, GObject *sel)
-{
- g_signal_handlers_disconnect_by_data (sel, dialog);
-}
-
-
/* Descend the widget tree, connecting appropriate signals to the
psppire_dialog_notify_change callback */
static void
{
PsppireDialog *dialog = data;
- if ( PSPPIRE_IS_BUTTONBOX (w))
+ if (PSPPIRE_IS_BUTTON_BOX (w))
return;
- if ( GTK_IS_CONTAINER (w))
+ if (GTK_IS_CONTAINER (w))
{
gtk_container_foreach (GTK_CONTAINER (w),
connect_notify_signal,
"user-modified-state-changed" signal. Instead, we have to try and
predict what widgets and signals are likely to exist in our dialogs. */
- if ( GTK_IS_TOGGLE_BUTTON (w))
+ if (GTK_IS_TOGGLE_BUTTON (w))
{
g_signal_connect_swapped (w, "toggled",
G_CALLBACK (psppire_dialog_notify_change),
dialog);
}
- if ( PSPPIRE_IS_SELECTOR (w))
+ if (PSPPIRE_IS_SELECTOR (w))
{
g_signal_connect_swapped (w, "selected",
G_CALLBACK (psppire_dialog_notify_change),
g_signal_connect_swapped (w, "de-selected",
G_CALLBACK (psppire_dialog_notify_change),
dialog);
+
+ psppire_selector_update_subjects (PSPPIRE_SELECTOR (w));
}
- if ( GTK_IS_EDITABLE (w))
+ if (GTK_IS_EDITABLE (w))
{
g_signal_connect_swapped (w, "changed",
G_CALLBACK (psppire_dialog_notify_change),
dialog);
}
- if ( GTK_IS_CELL_EDITABLE (w))
+ if (GTK_IS_CELL_EDITABLE (w))
{
g_signal_connect_swapped (w, "editing-done",
G_CALLBACK (psppire_dialog_notify_change),
dialog);
}
- if ( GTK_IS_TEXT_VIEW (w))
+ if (GTK_IS_TEXT_VIEW (w))
{
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (w));
dialog);
}
- if ( GTK_IS_TREE_VIEW (w))
+ if (GTK_IS_TREE_VIEW (w))
{
gint i = 0;
GtkTreeView *tv = GTK_TREE_VIEW (w);
GtkTreeViewColumn *col;
GtkTreeModel *model = gtk_tree_view_get_model (tv);
- if ( model)
+ if (model)
{
g_signal_connect_swapped (model, "row-changed",
G_CALLBACK (psppire_dialog_notify_change),
G_CALLBACK (psppire_dialog_notify_change),
dialog);
- g_signal_connect (dialog, "destroy", G_CALLBACK (remove_notify_handlers),
- model);
}
-
+
g_signal_connect_swapped (selection, "changed",
G_CALLBACK (psppire_dialog_notify_change),
dialog);
GList *start = renderers;
while (renderers)
{
- if ( GTK_IS_CELL_RENDERER_TOGGLE (renderers->data))
+ if (GTK_IS_CELL_RENDERER_TOGGLE (renderers->data))
g_signal_connect_swapped (renderers->data, "toggled",
G_CALLBACK (psppire_dialog_notify_change), dialog);
renderers = renderers->next;
if (title == NULL)
g_warning ("PsppireDialog %s has no title", gtk_widget_get_name (GTK_WIDGET (dialog)));
- if ( dialog->contents_are_valid != NULL )
+ if (dialog->contents_are_valid != NULL)
gtk_container_foreach (GTK_CONTAINER (gtk_bin_get_child(GTK_BIN(dialog))),
connect_notify_signal,
dialog);
g_signal_emit (dialog, signals [RESPONSE], 0, dialog->response);
+ g_free (title);
+
return dialog->response;
}