Refactor the Help menu.
[pspp-builds.git] / src / ui / gui / helper.c
index 38110f5c1d7d18043b9b003856ce8dc5efbd4054..e25342ed0dc2a472a54db9c256bc3fa48642fed6 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2007, 2009  Free Software Foundation
+   Copyright (C) 2007, 2009, 2010  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
@@ -41,6 +41,7 @@
 
 #include "psppire-data-store.h"
 
+#include "gl/configmake.h"
 #include "xalloc.h"
 
 #include <gettext.h>
@@ -131,8 +132,7 @@ get_object_assert (GtkBuilder *builder, const gchar *name, GType type)
 
   if ( !o )
     g_critical ("Object \"%s\" could not be found\n", name);
-
-  if ( ! g_type_is_a (G_OBJECT_TYPE (o), type))
+  else if ( ! g_type_is_a (G_OBJECT_TYPE (o), type))
    {
      g_critical ("Object \"%s\" was expected to have type %s, but in fact has type %s", 
        name, g_type_name (type), G_OBJECT_TYPE_NAME (o));
@@ -230,22 +230,6 @@ connect_help (GtkBuilder *xml)
 }
 
 
-void
-reference_manual (GtkMenuItem *menu, gpointer data)
-{
-  GError *err = NULL;
-  gchar *cmd = g_strdup_printf ("yelp file://%s", relocate (DOCDIR "/pspp.xml"));
-
-  if ( ! g_spawn_command_line_async (cmd, &err) )
-    {
-      msg (ME, _("Cannot open reference manual: %s"), err->message);
-    }
-
-  g_free (cmd);
-  g_clear_error (&err);
-}
-
-
 /* Create a deep copy of SRC */
 GtkListStore *
 clone_list_store (const GtkListStore *src)
@@ -299,3 +283,12 @@ paste_syntax_in_new_window (const gchar *syntax)
 
   gtk_widget_show (se);
 }
+
+
+/* gtk_box_pack_start_defaults is deprecated.
+   Therefore we roll our own until a better solution is found */
+void
+psppire_box_pack_start_defaults (GtkBox *box, GtkWidget *widget)
+{
+  gtk_box_pack_start (box, widget, TRUE, TRUE, 0);
+}