Options dialog: add checkbox for startup tips
[pspp] / src / ui / gui / options-dialog.c
index c50048060212a0c9e847dfd88414966a4d98e5e3..1890f069f4481dd869fa4b0bdc745cf25b81d62a 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2017 Free Software Foundation
+   Copyright (C) 2017, 2021 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
@@ -45,6 +45,8 @@ struct options_dialog
   GtkWidget *maximize;
   GtkWidget *alert;
   GtkWidget *raise;
+
+  GtkWidget *show_tips;
 };
 
 GType
@@ -75,11 +77,14 @@ options_dialog (PsppireDataWindow *de)
   GtkWidget *dialog ;
 
   gboolean disp_labels = true;
+  gboolean show_tips = true;
 
   fd.xml = builder_new ("options.ui");
 
   dialog = get_widget_assert (fd.xml, "options-dialog");
 
+  fd.show_tips = get_widget_assert (fd.xml, "checkbutton-show-tips");
+
   fd.show_labels = get_widget_assert (fd.xml, "radiobutton-labels");
   fd.show_names  = get_widget_assert (fd.xml, "radiobutton-names");
 
@@ -105,6 +110,13 @@ options_dialog (PsppireDataWindow *de)
                                    !disp_labels);
     }
 
+  if (psppire_conf_get_boolean (fd.conf,
+                               "startup", "show-user-tips", &show_tips))
+    {
+      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fd.show_tips),
+                                   show_tips);
+    }
+
 
   int what = -1;
   psppire_conf_get_enum (fd.conf, "VariableLists", "sort-order",
@@ -182,6 +194,10 @@ options_dialog (PsppireDataWindow *de)
       psppire_conf_set_boolean (fd.conf, "OutputWindowAction", "alert",
                                gtk_toggle_button_get_active
                                (GTK_TOGGLE_BUTTON (fd.alert)));
+
+      psppire_conf_set_boolean (fd.conf, "startup", "show-user-tips",
+                               gtk_toggle_button_get_active
+                               (GTK_TOGGLE_BUTTON (fd.show_tips)));
     }
 
   g_object_unref (fd.xml);