PsppireDialogAction and subclasses - use function to set class activate and thus...
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 26 Jul 2015 08:22:32 +0000 (10:22 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 26 Jul 2015 09:32:40 +0000 (11:32 +0200)
All subclasses of PsppireDialogAction needed to use GtkActionClass.  This widget however
is deprecated in recent Gtk versions.  Meaning that all instances of PsppireDialogAction
implementations would provoke a deprecation warning at compile time.

This change avoids that by providing a common function to set GtkActionClass->activate.
Thus, there is now only a single warning instead of many.

31 files changed:
src/ui/gui/psppire-dialog-action-1sks.c
src/ui/gui/psppire-dialog-action-binomial.c
src/ui/gui/psppire-dialog-action-chisquare.c
src/ui/gui/psppire-dialog-action-compute.c
src/ui/gui/psppire-dialog-action-correlation.c
src/ui/gui/psppire-dialog-action-count.c
src/ui/gui/psppire-dialog-action-crosstabs.c
src/ui/gui/psppire-dialog-action-descriptives.c
src/ui/gui/psppire-dialog-action-examine.c
src/ui/gui/psppire-dialog-action-factor.c
src/ui/gui/psppire-dialog-action-flip.c
src/ui/gui/psppire-dialog-action-frequencies.c
src/ui/gui/psppire-dialog-action-indep-samps.c
src/ui/gui/psppire-dialog-action-k-related.c
src/ui/gui/psppire-dialog-action-kmeans.c
src/ui/gui/psppire-dialog-action-logistic.c
src/ui/gui/psppire-dialog-action-means.c
src/ui/gui/psppire-dialog-action-oneway.c
src/ui/gui/psppire-dialog-action-paired.c
src/ui/gui/psppire-dialog-action-rank.c
src/ui/gui/psppire-dialog-action-regression.c
src/ui/gui/psppire-dialog-action-reliability.c
src/ui/gui/psppire-dialog-action-roc.c
src/ui/gui/psppire-dialog-action-runs.c
src/ui/gui/psppire-dialog-action-sort.c
src/ui/gui/psppire-dialog-action-tt1s.c
src/ui/gui/psppire-dialog-action-two-sample.c
src/ui/gui/psppire-dialog-action-univariate.c
src/ui/gui/psppire-dialog-action-var-info.c
src/ui/gui/psppire-dialog-action.c
src/ui/gui/psppire-dialog-action.h

index f71de4d88fcf36c2f4e0a6c0dadbe0b53e4cf7ac..055d3e9f0cfc8179ffbf08e8c3ed5c2b6b5c97fc 100644 (file)
@@ -145,9 +145,7 @@ psppire_dialog_action_1sks_activate (GtkAction *a)
 static void
 psppire_dialog_action_1sks_class_init (PsppireDialogAction1sksClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_1sks_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_1sks_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 8c91ca3e059ea587f2a80c2c3d5c4968b1106dd2..6581b96c0d1e6241b76315b03e255820373f6152 100644 (file)
@@ -167,9 +167,7 @@ generate_syntax (PsppireDialogAction *a)
 static void
 psppire_dialog_action_binomial_class_init (PsppireDialogActionBinomialClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_binomial_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_binomial_activate);
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 5ee3e879913ec8e1debd3b15578e9369eabc008d..bca99ab5750fd37fc9bb08e26059a1767041a64b 100644 (file)
@@ -187,9 +187,7 @@ psppire_dialog_action_chisquare_activate (GtkAction *a)
 static void
 psppire_dialog_action_chisquare_class_init (PsppireDialogActionChisquareClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_chisquare_activate;
+  psppire_dialog_action_set_activation (class,  psppire_dialog_action_chisquare_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 048c05de384843bd23e003e0a69ea5d291a7f4c1..5fc63d5dedf48314d4eb017714139ba27fe4cb0b 100644 (file)
@@ -529,9 +529,8 @@ psppire_dialog_action_compute_activate (GtkAction *a)
 static void
 psppire_dialog_action_compute_class_init (PsppireDialogActionComputeClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_compute_activate);
 
-  action_class->activate = psppire_dialog_action_compute_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 456ce15d324476d62c49986b9a64eb95824c23bd..29f6e20179c03cb148ffce4df909cb13d076f1b6 100644 (file)
@@ -117,9 +117,8 @@ psppire_dialog_action_correlation_activate (GtkAction *a)
 static void
 psppire_dialog_action_correlation_class_init (PsppireDialogActionCorrelationClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_correlation_activate);
 
-  action_class->activate = psppire_dialog_action_correlation_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index a439e1a764e6aa729ffda067cc683b3be24d0883..edb44a065c816edfea660089c28febdba7d98cb2 100644 (file)
@@ -181,9 +181,7 @@ psppire_dialog_action_count_activate (GtkAction *a)
 static void
 psppire_dialog_action_count_class_init (PsppireDialogActionCountClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_count_activate;
+  psppire_dialog_action_set_activation (class,psppire_dialog_action_count_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index b0b08b5ce6fd9356f58349e031098aa308fd891a..fa9f282ac60fe6e43d7e062707db03874585dba1 100644 (file)
@@ -378,10 +378,7 @@ generate_syntax (PsppireDialogAction *a)
 static void
 psppire_dialog_action_crosstabs_class_init (PsppireDialogActionCrosstabsClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_crosstabs_activate;
-
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_crosstabs_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 1b5b7a5781618738fece2f1f3beb9f7a8ba5b562..04781ea8f3ca193fa2ff3976c532dd0a034741f8 100644 (file)
@@ -234,7 +234,7 @@ psppire_dialog_action_descriptives_activate (GtkAction *a)
 static void
 psppire_dialog_action_descriptives_class_init (PsppireDialogActionDescriptivesClass *class)
 {
-  GTK_ACTION_CLASS (class)->activate = psppire_dialog_action_descriptives_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_descriptives_activate);
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 4a1dcd6cd5b4f0ec22d19dbebd8390af90aeb65f..bba35cf12427c6a067b0b36c23e6e3d4f48bcc0b 100644 (file)
@@ -263,7 +263,7 @@ psppire_dialog_action_examine_activate (GtkAction *a)
 static void
 psppire_dialog_action_examine_class_init (PsppireDialogActionExamineClass *class)
 {
-  GTK_ACTION_CLASS (class)->activate = psppire_dialog_action_examine_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_examine_activate);
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index e1edf4a4839303560d0cc8c544d15ee4b70fdae8..e8874449cc70afb209672d99c64986531a00ad4d 100644 (file)
@@ -371,7 +371,7 @@ psppire_dialog_action_factor_activate (GtkAction *a)
 static void
 psppire_dialog_action_factor_class_init (PsppireDialogActionFactorClass *class)
 {
-  GTK_ACTION_CLASS (class)->activate = psppire_dialog_action_factor_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_factor_activate);
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 2581a2fad7e53b7e8e73aecef1c48c7db194d956..1b63856df57f102747d371912551c5fb4c1788af 100644 (file)
@@ -114,9 +114,7 @@ psppire_dialog_action_flip_activate (GtkAction *a)
 static void
 psppire_dialog_action_flip_class_init (PsppireDialogActionFlipClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_flip_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_flip_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 78400effcf5dd33ab1c0005a7a334c70544565d9..d0ae660a256c7551bc2a84953baae7600e2f8f32 100644 (file)
@@ -498,10 +498,7 @@ generate_syntax (PsppireDialogAction * a)
 static void
 psppire_dialog_action_frequencies_class_init (PsppireDialogActionFrequenciesClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_frequencies_activate;
-
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_frequencies_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index f91c03aa9c53578ab486e4e4dba9fef55ca32ecc..8709b1da075ea9577b762abf4766a166c8eb42e8 100644 (file)
@@ -414,9 +414,7 @@ generate_syntax (PsppireDialogAction *a)
 static void
 psppire_dialog_action_indep_samps_class_init (PsppireDialogActionIndepSampsClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_indep_samps_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_indep_samps_activate);
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 9f1b588c5fa24dfbea60ada0cca17185f1d26ba2..387dbd30487dba35e85e99274bd6545572c6a83a 100644 (file)
@@ -135,9 +135,7 @@ psppire_dialog_action_k_related_activate (GtkAction *a)
 static void
 psppire_dialog_action_k_related_class_init (PsppireDialogActionKRelatedClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_k_related_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_k_related_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index bcd59889f51bae06bfaffcadb2769823a5ce5c06..18f7138cd6e4fc9acc9a74fd1a294d59a71f73b5 100644 (file)
@@ -107,9 +107,7 @@ psppire_dialog_action_kmeans_activate (GtkAction *a)
 static void
 psppire_dialog_action_kmeans_class_init (PsppireDialogActionKmeansClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_kmeans_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_kmeans_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 1908bd98c79c2532fecb0827ecec0f8ce16a4594..8da049f538b991b421ab6b163ff3067d72362f83 100644 (file)
@@ -191,9 +191,7 @@ generate_syntax (PsppireDialogAction *a)
 static void
 psppire_dialog_action_logistic_class_init (PsppireDialogActionLogisticClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_logistic_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_logistic_activate);
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 807d3fc38b9c6c9709c04884b4e279eebbfa0527..9b20560a05c100e036b24660ea2653bd04bc4b2e 100644 (file)
@@ -130,7 +130,7 @@ psppire_dialog_action_means_activate (GtkAction *a)
 static void
 psppire_dialog_action_means_class_init (PsppireDialogActionMeansClass *class)
 {
-  GTK_ACTION_CLASS (class)->activate = psppire_dialog_action_means_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_means_activate);
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index c817f71f152a983d8f9515b39cc2e4c15e924c96..6e66862c4b60754d4eab567a134dfb4fd846f58f 100644 (file)
@@ -275,9 +275,7 @@ psppire_dialog_action_oneway_activate (GtkAction *a)
 static void
 psppire_dialog_action_oneway_class_init (PsppireDialogActionOnewayClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_oneway_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_oneway_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index c6e9612dd2f6359cca1e3eb035abaaec19874958..d08fc109aa69ad021a6b7d909e8dc842d79d2173 100644 (file)
@@ -208,13 +208,11 @@ psppire_dialog_action_paired_finalize (GObject *o)
 static void
 psppire_dialog_action_paired_class_init (PsppireDialogActionPairedClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
   GObjectClass *object_class = G_OBJECT_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_paired_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_paired_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 
-   object_class->finalize = psppire_dialog_action_paired_finalize;
+  object_class->finalize = psppire_dialog_action_paired_finalize;
 }
 
 
index f4d59b7be2df5ee77866b7b2af09d2c0c07c14e5..eb7d7d20d1e88ad9b9d7bb3a371febe9325d3bae 100644 (file)
@@ -300,7 +300,7 @@ psppire_dialog_action_rank_activate (GtkAction *a)
 static void
 psppire_dialog_action_rank_class_init (PsppireDialogActionRankClass *class)
 {
-  GTK_ACTION_CLASS (class)->activate = psppire_dialog_action_rank_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_rank_activate);
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 7a09132093505321fcf1819f24132ffdc0a04096..876a7651fa1d7904e44413ef3b4c9ac2fe309cb6 100644 (file)
@@ -255,9 +255,7 @@ generate_syntax (PsppireDialogAction *a)
 static void
 psppire_dialog_action_regression_class_init (PsppireDialogActionRegressionClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_regression_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_regression_activate);
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index aca739cf363062746365a2063f657d98a36b8413..e53ce23cf102c6ecb9dc7422cf375a5d1c138383 100644 (file)
@@ -166,10 +166,8 @@ psppire_dialog_action_reliability_activate (GtkAction *a)
 static void
 psppire_dialog_action_reliability_class_init (PsppireDialogActionReliabilityClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
   PsppireDialogActionClass *pdac = PSPPIRE_DIALOG_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_reliability_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_reliability_activate);
 
   pdac->generate_syntax = generate_syntax;
 }
index 75e310ad02dce4a64262a1d7e87486188c077a66..578ef747771b59fb2ee097552ad7c16de7b9936a 100644 (file)
@@ -238,9 +238,7 @@ generate_syntax (PsppireDialogAction *a)
 static void
 psppire_dialog_action_roc_class_init (PsppireDialogActionRocClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_roc_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_roc_activate);
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index d1cd70ce84e350909a08644d4b5df380ddfc2762..8649fbbe6dd3c070aeefa3d2702daac8094a17a3 100644 (file)
@@ -157,9 +157,7 @@ psppire_dialog_action_runs_activate (GtkAction *a)
 static void
 psppire_dialog_action_runs_class_init (PsppireDialogActionRunsClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_runs_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_runs_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 363ef08b03d48a70f9e80ff0085e593b7b2907ca..1c5a9e01847101148fe299bd5a22f48a5b841f5c 100644 (file)
@@ -116,10 +116,8 @@ psppire_dialog_action_sort_activate (GtkAction *a)
 static void
 psppire_dialog_action_sort_class_init (PsppireDialogActionSortClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-  PsppireDialogActionClass *pdac = PSPPIRE_DIALOG_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_sort_activate;
+ PsppireDialogActionClass *pdac = PSPPIRE_DIALOG_ACTION_CLASS (class);
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_sort_activate);
 
   pdac->generate_syntax = generate_syntax;
 }
index 70dbfabd310c2676d7e7ab17c38a55d08b3e0681..0d00f06ea96135fc4fcea780d3d4767a30b29513 100644 (file)
@@ -145,11 +145,10 @@ psppire_dialog_action_tt1s_finalize (GObject *a)
 static void
 psppire_dialog_action_tt1s_class_init (PsppireDialogActionTt1sClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
   GObjectClass *object_class = G_OBJECT_CLASS (class);
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_tt1s_activate);
 
   object_class->finalize = psppire_dialog_action_tt1s_finalize;
-  action_class->activate = psppire_dialog_action_tt1s_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index beab3ab6345b0643a2427e761ef9467464a9f5c0..74612d267a8aaeef642a6a89934a6f1494fc2c29 100644 (file)
@@ -231,9 +231,7 @@ psppire_dialog_action_two_sample_activate (GtkAction *a)
 static void
 psppire_dialog_action_two_sample_class_init (PsppireDialogActionTwoSampleClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_two_sample_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_two_sample_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 79bf5ee0d3a332a90176d30843e09d16c4078a99..30b9526f728342d940c0f2b7250a484d500fa20c 100644 (file)
@@ -107,9 +107,7 @@ psppire_dialog_action_univariate_activate (GtkAction *a)
 static void
 psppire_dialog_action_univariate_class_init (PsppireDialogActionUnivariateClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_univariate_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_univariate_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index d6b974f6877975b9a2952cd93d76e3b38d67b552..4e2d8ea039cd8bd8623959aed52de07c44377b3c 100644 (file)
@@ -200,9 +200,7 @@ psppire_dialog_action_var_info_activate (GtkAction *a)
 static void
 psppire_dialog_action_var_info_class_init (PsppireDialogActionVarInfoClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_var_info_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_var_info_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index dfc934633d2706dc5158bcefae51acd1213c901c..7c399175dd5b89ce2f39cdc65b12a3ad78d81840 100644 (file)
@@ -188,3 +188,10 @@ psppire_dialog_action_set_refresh (PsppireDialogAction *pda,
   g_signal_connect_swapped (pda->dialog, "refresh", G_CALLBACK (refresh),  pda);
 }
 
+
+void 
+psppire_dialog_action_set_activation (gpointer class, activation activate)
+{
+  GTK_ACTION_CLASS (class)->activate = activate;
+}
+
index c0bab64e86e22200c73dcbba17da0fc7dfeb7223..071bfaeea5041cf611a9ed49f617fa2edac86efd 100644 (file)
@@ -96,6 +96,13 @@ void psppire_dialog_action_set_refresh (PsppireDialogAction *pda,
 void psppire_dialog_action_set_valid_predicate (PsppireDialogAction *act, 
                                                ContentsAreValid dialog_state_valid);
 
+typedef void (*activation) (GtkAction *);
+
+void psppire_dialog_action_set_activation (gpointer class, activation a);
+
+
+
+
 G_END_DECLS
 
 #endif /* __PSPPIRE_DIALOG_ACTION_H__ */