[gnumeric] Add warning for missing plugins needed by all tools. [#590175]



commit 2ff95104afae87d40d97e9b32c8dd9f5534e46bb
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Sat Aug 1 15:56:10 2009 -0600

    Add warning for missing plugins needed by all tools. [#590175]
    
    2009-07-31 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* dialog-analysis-tools.c (dialog_*_tool): check for
    	  required plugins
    	* dialog-analysis-tool-chi-squared.c (dialog_chi_square_tool):
    	  ditto
    	* dialog-analysis-tool-frequency.c (dialog_frequency_tool):
    	  ditto
    	* dialog-analysis-tool-kaplan-meier.c (dialog_kaplan_meier_tool):
    	  ditto

 NEWS                                            |    2 +-
 src/dialogs/ChangeLog                           |   11 ++
 src/dialogs/dialog-analysis-tool-chi-squared.c  |    9 +-
 src/dialogs/dialog-analysis-tool-frequency.c    |   12 ++-
 src/dialogs/dialog-analysis-tool-kaplan-meier.c |   13 ++-
 src/dialogs/dialog-analysis-tools.c             |  117 +++++++++++++++--------
 6 files changed, 111 insertions(+), 53 deletions(-)
---
diff --git a/NEWS b/NEWS
index b1755f9..26d0cc5 100644
--- a/NEWS
+++ b/NEWS
@@ -19,7 +19,7 @@ Andreas:
 	* Export basic charts to ODF.
 	* Fix format labels in configurable text importer. [#590257]
 	* Add warning for missing plugins needed by tools. [#590175]
-	* Fix prercentage histogram . [#590375]
+	* Fix percentage histogram . [#590375]
 
 Jody:
 	* Fix col/row resize. [#588297]
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index eb853c8..d148de0 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,5 +1,16 @@
 2009-07-31 Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* dialog-analysis-tools.c (dialog_*_tool): check for 
+	  required plugins
+	* dialog-analysis-tool-chi-squared.c (dialog_chi_square_tool):
+	  ditto
+	* dialog-analysis-tool-frequency.c (dialog_frequency_tool):
+	  ditto
+	* dialog-analysis-tool-kaplan-meier.c (dialog_kaplan_meier_tool):
+	  ditto
+
+2009-07-31 Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* dialog-analysis-tools.c (dialog_fourier_tool): check for 
 	  required plugins and enable dao selector
 
diff --git a/src/dialogs/dialog-analysis-tool-chi-squared.c b/src/dialogs/dialog-analysis-tool-chi-squared.c
index 84e44d6..25a2089 100644
--- a/src/dialogs/dialog-analysis-tool-chi-squared.c
+++ b/src/dialogs/dialog-analysis-tool-chi-squared.c
@@ -197,11 +197,14 @@ dialog_chi_square_tool (WBCGtk *wbcg, Sheet *sheet, gboolean independence)
 {
         ChiSquaredIToolState *state;
 	char const *type;
+	char const * plugins[] = { "Gnumeric_fnstat",
+				   "Gnumeric_fnlookup",
+				   "Gnumeric_fnmath",
+				   NULL};
 
-	if (wbcg == NULL) {
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
-
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, CHI_SQUARED_I_KEY))
diff --git a/src/dialogs/dialog-analysis-tool-frequency.c b/src/dialogs/dialog-analysis-tool-frequency.c
index e5a1fc6..d429043 100644
--- a/src/dialogs/dialog-analysis-tool-frequency.c
+++ b/src/dialogs/dialog-analysis-tool-frequency.c
@@ -236,11 +236,15 @@ int
 dialog_frequency_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         FrequencyToolState *state;
-
-	if (wbcg == NULL) {
+	char const * plugins[] = { "Gnumeric_fnlookup",
+				   "Gnumeric_fninfo",
+				   "Gnumeric_fnstring",
+				   "Gnumeric_fnlogical",
+				   NULL};
+
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
-
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, FREQUENCY_KEY))
diff --git a/src/dialogs/dialog-analysis-tool-kaplan-meier.c b/src/dialogs/dialog-analysis-tool-kaplan-meier.c
index ef9f087..6286387 100644
--- a/src/dialogs/dialog-analysis-tool-kaplan-meier.c
+++ b/src/dialogs/dialog-analysis-tool-kaplan-meier.c
@@ -597,11 +597,16 @@ dialog_kaplan_meier_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         KaplanMeierToolState *state;
 	GtkWidget *widget;
-
-	if (wbcg == NULL) {
+	char const * plugins[] = { "Gnumeric_fnstat",
+				   "Gnumeric_fnlookup",
+				   "Gnumeric_fnmath",
+				   "Gnumeric_fninfo",
+				   "Gnumeric_fnlogical",
+				   NULL};
+
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
-
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, KAPLAN_MEIER_KEY))
diff --git a/src/dialogs/dialog-analysis-tools.c b/src/dialogs/dialog-analysis-tools.c
index b8c4d60..77bd0c0 100644
--- a/src/dialogs/dialog-analysis-tools.c
+++ b/src/dialogs/dialog-analysis-tools.c
@@ -665,11 +665,12 @@ int
 dialog_correlation_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         GenericToolState *state;
+	char const * plugins[] = { "Gnumeric_fnstat",
+				   NULL};
 
-	if (wbcg == NULL) {
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
-
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, CORRELATION_KEY))
@@ -784,11 +785,12 @@ int
 dialog_covariance_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         GenericToolState *state;
+	char const * plugins[] = { "Gnumeric_fnstat",
+				   NULL};
 
-	if (wbcg == NULL) {
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
-
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, COVARIANCE_KEY))
@@ -874,11 +876,13 @@ int
 dialog_ranking_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         GenericToolState *state;
+	char const * plugins[] = { "Gnumeric_fnstat",
+				   "Gnumeric_fnlookup",
+				   NULL};
 
-	if (wbcg == NULL) {
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
-
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, RANK_PERCENTILE_KEY))
@@ -969,14 +973,10 @@ dialog_fourier_tool (WBCGtk *wbcg, Sheet *sheet)
 				   "Gnumeric_fncomplex",
 				   NULL};
 
-	if (wbcg == NULL) {
-		return 1;
-	}
-
-	if (gnm_check_for_plugins_missing (plugins, NULL))
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
 
-
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, FOURIER_KEY))
 		return 0;
@@ -1182,11 +1182,13 @@ int
 dialog_descriptive_stat_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         DescriptiveStatState *state;
+	char const * plugins[] = {"Gnumeric_fnstat",
+				  "Gnumeric_fnmath",
+				  NULL};
 
-	if (wbcg == NULL) {
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
-
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, DESCRIPTIVE_STATS_KEY))
@@ -1547,10 +1549,15 @@ dialog_ttest_tool (WBCGtk *wbcg, Sheet *sheet, ttest_type test)
 {
         TTestState *state;
 	GtkDialog *dialog;
-
-	if (wbcg == NULL) {
+	char const * plugins[] = {"Gnumeric_fnstat",
+				  "Gnumeric_fnmath",
+				  "Gnumeric_fninfo",
+				  "Gnumeric_fnlogical",
+				  NULL};
+
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
 
 	/* Only pop up one copy per workbook */
 	dialog = gnumeric_dialog_raise_if_exists (wbcg, TTEST_KEY);
@@ -1739,11 +1746,12 @@ int
 dialog_ftest_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         FTestToolState *state;
+	char const * plugins[] = { "Gnumeric_fnstat",
+				   NULL};
 
-	if (wbcg == NULL) {
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
-
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, FTEST_KEY))
@@ -1986,11 +1994,13 @@ int
 dialog_sampling_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         SamplingState *state;
+	char const * plugins[] = { "Gnumeric_fnlookup",
+				   "Gnumeric_fnrandom",		   				   
+				   NULL};
 
-	if (wbcg == NULL) {
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
-
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, SAMPLING_KEY)) {
@@ -2269,11 +2279,16 @@ int
 dialog_regression_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         RegressionToolState *state;
+	char const * plugins[] = { "Gnumeric_fnstat",
+				   "Gnumeric_fnlookup",
+				   "Gnumeric_fnmath",
+				   "Gnumeric_fninfo",
+				   "Gnumeric_fnstring",
+				   NULL};
 
-	if (wbcg == NULL) {
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
-
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, REGRESSION_KEY))
@@ -2540,10 +2555,15 @@ int
 dialog_exp_smoothing_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         ExpSmoothToolState *state;
+	char const * plugins[] = { "Gnumeric_fnstat",
+				   "Gnumeric_fnlookup",
+				   "Gnumeric_fnmath",
+				   "Gnumeric_fnlogical",
+				   NULL};
 
-	if (wbcg == NULL) {
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, EXP_SMOOTHING_KEY))
@@ -2904,10 +2924,14 @@ int
 dialog_average_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         AverageToolState *state;
+	char const * plugins[] = { "Gnumeric_fnstat",
+				   "Gnumeric_fnlookup",
+				   "Gnumeric_fnmath",
+				   NULL};
 
-	if (wbcg == NULL) {
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, AVERAGE_KEY))
@@ -3167,11 +3191,14 @@ int
 dialog_histogram_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         HistogramToolState *state;
+	char const * plugins[] = {"Gnumeric_fnlogical",
+				  "Gnumeric_fnstat",
+				  "Gnumeric_fnlookup",
+				  NULL};
 
-	if (wbcg == NULL) {
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
-
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, HISTOGRAM_KEY))
@@ -3343,11 +3370,12 @@ int
 dialog_anova_single_factor_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         AnovaSingleToolState *state;
+	char const * plugins[] = { "Gnumeric_fnstat",
+				   NULL};
 
-	if (wbcg == NULL) {
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
-	}
-
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, ANOVA_SINGLE_KEY))
@@ -3569,8 +3597,15 @@ int
 dialog_anova_two_factor_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         AnovaTwoFactorToolState *state;
+	char const * plugins[] = { "Gnumeric_fnstat",
+				   "Gnumeric_fnlookup",
+				   "Gnumeric_fnmath",
+				   "Gnumeric_fninfo",
+				   "Gnumeric_fnlogical",
+				   NULL};
 
-	if (wbcg == NULL)
+	if ((wbcg == NULL) || 
+	    gnm_check_for_plugins_missing (plugins, wbcg_toplevel (wbcg)))
 		return 1;
 
 	/* Only pop up one copy per workbook */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]