From 2a71889bf86463fb752bcbab248da47b25b4fd9a Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sun, 26 Jul 2015 10:22:32 +0200 Subject: [PATCH] PsppireDialogAction and subclasses - use function to set class activate and thus minimise deprecation warnings 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. --- src/ui/gui/psppire-dialog-action-1sks.c | 4 +--- src/ui/gui/psppire-dialog-action-binomial.c | 4 +--- src/ui/gui/psppire-dialog-action-chisquare.c | 4 +--- src/ui/gui/psppire-dialog-action-compute.c | 3 +-- src/ui/gui/psppire-dialog-action-correlation.c | 3 +-- src/ui/gui/psppire-dialog-action-count.c | 4 +--- src/ui/gui/psppire-dialog-action-crosstabs.c | 5 +---- src/ui/gui/psppire-dialog-action-descriptives.c | 2 +- src/ui/gui/psppire-dialog-action-examine.c | 2 +- src/ui/gui/psppire-dialog-action-factor.c | 2 +- src/ui/gui/psppire-dialog-action-flip.c | 4 +--- src/ui/gui/psppire-dialog-action-frequencies.c | 5 +---- src/ui/gui/psppire-dialog-action-indep-samps.c | 4 +--- src/ui/gui/psppire-dialog-action-k-related.c | 4 +--- src/ui/gui/psppire-dialog-action-kmeans.c | 4 +--- src/ui/gui/psppire-dialog-action-logistic.c | 4 +--- src/ui/gui/psppire-dialog-action-means.c | 2 +- src/ui/gui/psppire-dialog-action-oneway.c | 4 +--- src/ui/gui/psppire-dialog-action-paired.c | 6 ++---- src/ui/gui/psppire-dialog-action-rank.c | 2 +- src/ui/gui/psppire-dialog-action-regression.c | 4 +--- src/ui/gui/psppire-dialog-action-reliability.c | 4 +--- src/ui/gui/psppire-dialog-action-roc.c | 4 +--- src/ui/gui/psppire-dialog-action-runs.c | 4 +--- src/ui/gui/psppire-dialog-action-sort.c | 6 ++---- src/ui/gui/psppire-dialog-action-tt1s.c | 3 +-- src/ui/gui/psppire-dialog-action-two-sample.c | 4 +--- src/ui/gui/psppire-dialog-action-univariate.c | 4 +--- src/ui/gui/psppire-dialog-action-var-info.c | 4 +--- src/ui/gui/psppire-dialog-action.c | 7 +++++++ src/ui/gui/psppire-dialog-action.h | 7 +++++++ 31 files changed, 45 insertions(+), 78 deletions(-) diff --git a/src/ui/gui/psppire-dialog-action-1sks.c b/src/ui/gui/psppire-dialog-action-1sks.c index f71de4d88f..055d3e9f0c 100644 --- a/src/ui/gui/psppire-dialog-action-1sks.c +++ b/src/ui/gui/psppire-dialog-action-1sks.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-binomial.c b/src/ui/gui/psppire-dialog-action-binomial.c index 8c91ca3e05..6581b96c0d 100644 --- a/src/ui/gui/psppire-dialog-action-binomial.c +++ b/src/ui/gui/psppire-dialog-action-binomial.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-chisquare.c b/src/ui/gui/psppire-dialog-action-chisquare.c index 5ee3e87991..bca99ab575 100644 --- a/src/ui/gui/psppire-dialog-action-chisquare.c +++ b/src/ui/gui/psppire-dialog-action-chisquare.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-compute.c b/src/ui/gui/psppire-dialog-action-compute.c index 048c05de38..5fc63d5ded 100644 --- a/src/ui/gui/psppire-dialog-action-compute.c +++ b/src/ui/gui/psppire-dialog-action-compute.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-correlation.c b/src/ui/gui/psppire-dialog-action-correlation.c index 456ce15d32..29f6e20179 100644 --- a/src/ui/gui/psppire-dialog-action-correlation.c +++ b/src/ui/gui/psppire-dialog-action-correlation.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-count.c b/src/ui/gui/psppire-dialog-action-count.c index a439e1a764..edb44a065c 100644 --- a/src/ui/gui/psppire-dialog-action-count.c +++ b/src/ui/gui/psppire-dialog-action-count.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-crosstabs.c b/src/ui/gui/psppire-dialog-action-crosstabs.c index b0b08b5ce6..fa9f282ac6 100644 --- a/src/ui/gui/psppire-dialog-action-crosstabs.c +++ b/src/ui/gui/psppire-dialog-action-crosstabs.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-descriptives.c b/src/ui/gui/psppire-dialog-action-descriptives.c index 1b5b7a5781..04781ea8f3 100644 --- a/src/ui/gui/psppire-dialog-action-descriptives.c +++ b/src/ui/gui/psppire-dialog-action-descriptives.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-examine.c b/src/ui/gui/psppire-dialog-action-examine.c index 4a1dcd6cd5..bba35cf124 100644 --- a/src/ui/gui/psppire-dialog-action-examine.c +++ b/src/ui/gui/psppire-dialog-action-examine.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-factor.c b/src/ui/gui/psppire-dialog-action-factor.c index e1edf4a483..e8874449cc 100644 --- a/src/ui/gui/psppire-dialog-action-factor.c +++ b/src/ui/gui/psppire-dialog-action-factor.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-flip.c b/src/ui/gui/psppire-dialog-action-flip.c index 2581a2fad7..1b63856df5 100644 --- a/src/ui/gui/psppire-dialog-action-flip.c +++ b/src/ui/gui/psppire-dialog-action-flip.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-frequencies.c b/src/ui/gui/psppire-dialog-action-frequencies.c index 78400effcf..d0ae660a25 100644 --- a/src/ui/gui/psppire-dialog-action-frequencies.c +++ b/src/ui/gui/psppire-dialog-action-frequencies.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-indep-samps.c b/src/ui/gui/psppire-dialog-action-indep-samps.c index f91c03aa9c..8709b1da07 100644 --- a/src/ui/gui/psppire-dialog-action-indep-samps.c +++ b/src/ui/gui/psppire-dialog-action-indep-samps.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-k-related.c b/src/ui/gui/psppire-dialog-action-k-related.c index 9f1b588c5f..387dbd3048 100644 --- a/src/ui/gui/psppire-dialog-action-k-related.c +++ b/src/ui/gui/psppire-dialog-action-k-related.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-kmeans.c b/src/ui/gui/psppire-dialog-action-kmeans.c index bcd59889f5..18f7138cd6 100644 --- a/src/ui/gui/psppire-dialog-action-kmeans.c +++ b/src/ui/gui/psppire-dialog-action-kmeans.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-logistic.c b/src/ui/gui/psppire-dialog-action-logistic.c index 1908bd98c7..8da049f538 100644 --- a/src/ui/gui/psppire-dialog-action-logistic.c +++ b/src/ui/gui/psppire-dialog-action-logistic.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-means.c b/src/ui/gui/psppire-dialog-action-means.c index 807d3fc38b..9b20560a05 100644 --- a/src/ui/gui/psppire-dialog-action-means.c +++ b/src/ui/gui/psppire-dialog-action-means.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-oneway.c b/src/ui/gui/psppire-dialog-action-oneway.c index c817f71f15..6e66862c4b 100644 --- a/src/ui/gui/psppire-dialog-action-oneway.c +++ b/src/ui/gui/psppire-dialog-action-oneway.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-paired.c b/src/ui/gui/psppire-dialog-action-paired.c index c6e9612dd2..d08fc109aa 100644 --- a/src/ui/gui/psppire-dialog-action-paired.c +++ b/src/ui/gui/psppire-dialog-action-paired.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-rank.c b/src/ui/gui/psppire-dialog-action-rank.c index f4d59b7be2..eb7d7d20d1 100644 --- a/src/ui/gui/psppire-dialog-action-rank.c +++ b/src/ui/gui/psppire-dialog-action-rank.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-regression.c b/src/ui/gui/psppire-dialog-action-regression.c index 7a09132093..876a7651fa 100644 --- a/src/ui/gui/psppire-dialog-action-regression.c +++ b/src/ui/gui/psppire-dialog-action-regression.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-reliability.c b/src/ui/gui/psppire-dialog-action-reliability.c index aca739cf36..e53ce23cf1 100644 --- a/src/ui/gui/psppire-dialog-action-reliability.c +++ b/src/ui/gui/psppire-dialog-action-reliability.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-roc.c b/src/ui/gui/psppire-dialog-action-roc.c index 75e310ad02..578ef74777 100644 --- a/src/ui/gui/psppire-dialog-action-roc.c +++ b/src/ui/gui/psppire-dialog-action-roc.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-runs.c b/src/ui/gui/psppire-dialog-action-runs.c index d1cd70ce84..8649fbbe6d 100644 --- a/src/ui/gui/psppire-dialog-action-runs.c +++ b/src/ui/gui/psppire-dialog-action-runs.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-sort.c b/src/ui/gui/psppire-dialog-action-sort.c index 363ef08b03..1c5a9e0184 100644 --- a/src/ui/gui/psppire-dialog-action-sort.c +++ b/src/ui/gui/psppire-dialog-action-sort.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-tt1s.c b/src/ui/gui/psppire-dialog-action-tt1s.c index 70dbfabd31..0d00f06ea9 100644 --- a/src/ui/gui/psppire-dialog-action-tt1s.c +++ b/src/ui/gui/psppire-dialog-action-tt1s.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-two-sample.c b/src/ui/gui/psppire-dialog-action-two-sample.c index beab3ab634..74612d267a 100644 --- a/src/ui/gui/psppire-dialog-action-two-sample.c +++ b/src/ui/gui/psppire-dialog-action-two-sample.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-univariate.c b/src/ui/gui/psppire-dialog-action-univariate.c index 79bf5ee0d3..30b9526f72 100644 --- a/src/ui/gui/psppire-dialog-action-univariate.c +++ b/src/ui/gui/psppire-dialog-action-univariate.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-var-info.c b/src/ui/gui/psppire-dialog-action-var-info.c index d6b974f687..4e2d8ea039 100644 --- a/src/ui/gui/psppire-dialog-action-var-info.c +++ b/src/ui/gui/psppire-dialog-action-var-info.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action.c b/src/ui/gui/psppire-dialog-action.c index dfc934633d..7c399175dd 100644 --- a/src/ui/gui/psppire-dialog-action.c +++ b/src/ui/gui/psppire-dialog-action.c @@ -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; +} + diff --git a/src/ui/gui/psppire-dialog-action.h b/src/ui/gui/psppire-dialog-action.h index c0bab64e86..071bfaeea5 100644 --- a/src/ui/gui/psppire-dialog-action.h +++ b/src/ui/gui/psppire-dialog-action.h @@ -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__ */ -- 2.30.2