Univariate Dialog: Fix help-page
[pspp] / src / ui / gui / psppire-dialog-action.c
index 70b89ea2867c2d2b8378bfde2a7f8a83ad394c84..32cfcc702d57b54257290b1a220788dffda26a47 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2012  Free Software Foundation
+   Copyright (C) 2012, 2016  Free Software Foundation
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -143,8 +143,8 @@ psppire_dialog_action_activate (PsppireDialogAction *act)
   set_toplevel (act);
 
   act->dict = PSPPIRE_DATA_WINDOW(act->toplevel)->dict;
-  
-  g_object_set (act->source, "model", act->dict, NULL);
+  if (act->source)
+    g_object_set (act->source, "model", act->dict, NULL);
 
   GSList *wl = g_object_get_data (G_OBJECT (act->toplevel), "widget-list");
   wl = g_slist_prepend (wl, act->dialog);
@@ -155,7 +155,8 @@ psppire_dialog_action_activate (PsppireDialogAction *act)
   if (GTK_ACTION_CLASS (psppire_dialog_action_parent_class)->activate)
     GTK_ACTION_CLASS (psppire_dialog_action_parent_class)->activate ( GTK_ACTION (act));
 
-  gtk_widget_grab_focus (act->source);
+  if (act->source)
+    gtk_widget_grab_focus (act->source);
 
   if (first_time)
     psppire_dialog_reload (PSPPIRE_DIALOG (act->dialog));
@@ -242,6 +243,6 @@ psppire_dialog_action_set_refresh (PsppireDialogAction *pda,
 void 
 psppire_dialog_action_set_activation (gpointer class, activation activate)
 {
-  GTK_ACTION_CLASS (class)->activate = activate;
+  GTK_ACTION_CLASS (class)->activate = (void (*)(GtkAction *)) activate;
 }