X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog.c;h=4f3bb243132dbe8c85dd69c471ecc2dfebcab696;hb=5b2ed095a8aaa98adaea4922855edcbfb619c728;hp=918cae0ec1a1b305abe41383c6ad858c9b78e453;hpb=c8f16e229dede3bf3ec30c329cccc6924778553a;p=pspp diff --git a/src/ui/gui/psppire-dialog.c b/src/ui/gui/psppire-dialog.c index 918cae0ec1..4f3bb24313 100644 --- a/src/ui/gui/psppire-dialog.c +++ b/src/ui/gui/psppire-dialog.c @@ -70,14 +70,15 @@ psppire_dialog_get_type (void) 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, @@ -152,8 +153,8 @@ psppire_dialog_class_init (PsppireDialogClass *class) 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, @@ -287,7 +288,7 @@ psppire_dialog_new (void) 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); @@ -303,10 +304,10 @@ connect_notify_signal (GtkWidget *w, gpointer data) { 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, @@ -318,14 +319,14 @@ connect_notify_signal (GtkWidget *w, gpointer data) "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), @@ -334,25 +335,25 @@ connect_notify_signal (GtkWidget *w, gpointer data) 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)); @@ -361,7 +362,7 @@ connect_notify_signal (GtkWidget *w, gpointer data) dialog); } - if ( GTK_IS_TREE_VIEW (w)) + if (GTK_IS_TREE_VIEW (w)) { gint i = 0; GtkTreeView *tv = GTK_TREE_VIEW (w); @@ -370,7 +371,7 @@ connect_notify_signal (GtkWidget *w, gpointer data) 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), @@ -385,7 +386,7 @@ connect_notify_signal (GtkWidget *w, gpointer data) dialog); } - + g_signal_connect_swapped (selection, "changed", G_CALLBACK (psppire_dialog_notify_change), dialog); @@ -396,7 +397,7 @@ connect_notify_signal (GtkWidget *w, gpointer data) 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; @@ -416,7 +417,7 @@ psppire_dialog_run (PsppireDialog *dialog) 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); @@ -432,6 +433,8 @@ psppire_dialog_run (PsppireDialog *dialog) g_signal_emit (dialog, signals [RESPONSE], 0, dialog->response); + g_free (title); + return dialog->response; }