[gnumeric] CHeck for plugins required by Fourier tool [#590175]



commit d34b64bff34427ce5e59a09bdad7a27e7869f3ff
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Fri Jul 31 17:47:33 2009 -0600

    CHeck for plugins required by Fourier tool [#590175]
    
    2009-07-31 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* dialog-analysis-tools.c (dialog_fourier_tool): check for
    	  required plugins and enable dao selector
    
    2009-07-31 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/gui-util.h (gnm_check_for_plugins_missing): new
    	* src/gui-util.c (gnm_check_for_plugins_missing): new
    
    2009-07-31 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* analysis-tools.c (analysis_tool_fourier_engine_run): combine
    	  translatable text to allow for better translation

 ChangeLog                           |    5 +++++
 NEWS                                |    1 +
 src/dialogs/ChangeLog               |    5 +++++
 src/dialogs/dialog-analysis-tools.c |    8 +++++++-
 src/gui-util.c                      |   28 ++++++++++++++++++++++++++++
 src/gui-util.h                      |    2 ++
 src/tools/ChangeLog                 |    5 +++++
 src/tools/analysis-tools.c          |    4 ++--
 8 files changed, 55 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 26db0d0..df3fdc1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-31 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* src/gui-util.h (gnm_check_for_plugins_missing): new
+	* src/gui-util.c (gnm_check_for_plugins_missing): new
+
 2009-07-22  Jody Goldberg <jody gnome org>
 
 	* src/colrow.c (colrow_compute_pts_from_pixels) : seems like the
diff --git a/NEWS b/NEWS
index b75fa82..e77c86c 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ Andreas:
 	* Add some sheet object support to ODF export.
 	* Export basic charts to ODF.
 	* Fix format labels in configurable text importer. [#590257]
+	* Add warning for missing plugins needed by tools [#590175]
 
 Jody:
 	* Fix col/row resize. [#588297]
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 553ce14..eb853c8 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,5 +1,10 @@
 2009-07-31 Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* dialog-analysis-tools.c (dialog_fourier_tool): check for 
+	  required plugins and enable dao selector
+
+2009-07-31 Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* dialog-stf-format-page.c (cb_popup_menu_extend_format): also
 	  set the format label. Fixes #590257
 
diff --git a/src/dialogs/dialog-analysis-tools.c b/src/dialogs/dialog-analysis-tools.c
index 7eb5bdc..b8c4d60 100644
--- a/src/dialogs/dialog-analysis-tools.c
+++ b/src/dialogs/dialog-analysis-tools.c
@@ -965,11 +965,17 @@ int
 dialog_fourier_tool (WBCGtk *wbcg, Sheet *sheet)
 {
         GenericToolState *state;
+	char const * plugins[] = { "Gnumeric_fnTimeSeriesAnalysis",
+				   "Gnumeric_fncomplex",
+				   NULL};
 
 	if (wbcg == NULL) {
 		return 1;
 	}
 
+	if (gnm_check_for_plugins_missing (plugins, NULL))
+		return 1;
+
 
 	/* Only pop up one copy per workbook */
 	if (gnumeric_dialog_raise_if_exists (wbcg, FOURIER_KEY))
@@ -988,7 +994,7 @@ dialog_fourier_tool (WBCGtk *wbcg, Sheet *sheet)
 			      0))
 		return 0;
 
-	gnm_dao_set_put (GNM_DAO (state->gdao), FALSE, FALSE);
+	gnm_dao_set_put (GNM_DAO (state->gdao), TRUE, TRUE);
 	tool_update_sensitivity_cb (NULL, state);
 	tool_load_selection ((GenericToolState *)state, TRUE);
 
diff --git a/src/gui-util.c b/src/gui-util.c
index 116bfd9..43e7b18 100644
--- a/src/gui-util.c
+++ b/src/gui-util.c
@@ -1370,3 +1370,31 @@ gnm_canvas_get_position (FooCanvas *canvas, int *x, int *y, int px, int py)
 	*x = (int)pdx + wx - ox;
 	*y = (int)pdy + wy - oy;
 }
+
+
+gboolean 
+gnm_check_for_plugins_missing (char const **ids, GtkWindow *parent)
+{
+	for (; *ids != NULL; ids++) {
+		GOPlugin *pi = go_plugins_get_plugin_by_id (*ids);
+		if (pi == NULL) {
+			ErrorInfo *error;
+			error = error_info_new_printf 
+				(_("The plugin with id %s is required "
+				   "but cannot be found."), *ids);
+			gnumeric_error_info_dialog_show (parent,
+							 error);
+			return TRUE;
+		} else if (!go_plugin_is_active (pi)) {
+			ErrorInfo *error;
+			error = error_info_new_printf 
+				(_("The %s plugin is required "
+				   "but is not loaded."), 
+				 go_plugin_get_name (pi));
+			gnumeric_error_info_dialog_show (parent,
+							 error);
+			return TRUE;			
+		}
+	}
+	return FALSE;
+}
diff --git a/src/gui-util.h b/src/gui-util.h
index 9e76b9d..df13020 100644
--- a/src/gui-util.h
+++ b/src/gui-util.h
@@ -127,6 +127,8 @@ void gnm_dialog_setup_destroy_handlers (GtkDialog *dialog,
 void gnm_canvas_get_position (FooCanvas *canvas, int *x, int *y,
 			      int px, int py);
 
+gboolean gnm_check_for_plugins_missing (char const **ids, GtkWindow *parent);
+
 G_END_DECLS
 
 #endif /* _GNM_GUI_UTIL_H_ */
diff --git a/src/tools/ChangeLog b/src/tools/ChangeLog
index 9a871a4..aa7164d 100644
--- a/src/tools/ChangeLog
+++ b/src/tools/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-31 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* analysis-tools.c (analysis_tool_fourier_engine_run): combine
+	  translatable text to allow for better translation
+
 2009-07-01  Morten Welinder  <terra gnome org>
 
 	* auto-correct.c (autocorrect_init): Monitor the right
diff --git a/src/tools/analysis-tools.c b/src/tools/analysis-tools.c
index a4347fa..02873e6 100644
--- a/src/tools/analysis-tools.c
+++ b/src/tools/analysis-tools.c
@@ -4193,8 +4193,8 @@ analysis_tool_fourier_engine_run (data_analysis_output_t *dao,
 		int rows, n;
 
 		dao_set_italic (dao, 0, 1, 1, 2);
-		dao_set_cell (dao, 0, 2, _("Real"));
-		dao_set_cell (dao, 1, 2, _("Imaginary"));
+		set_cell_text_row (dao, 0, 2, _("/Real"
+						"/Imaginary"));
 		dao_set_merge (dao, 0, 1, 1, 1);
 		analysis_tools_write_label (val_org, dao, &info->base, 0, 1, col + 1);
 



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