Commit 6e8bafe6 authored by Jukka-Pekka Iivonen's avatar Jukka-Pekka Iivonen Committed by jpekka

Added `Help' button to the tool selection dialog.

2001-10-31  Jukka-Pekka Iivonen  <jiivonen@hutcs.cs.hut.fi>

        * analysis-tools.glade, dialog-analysis-tools.c: Added `Help'
        button to the tool selection dialog.
parent 6212d9be
...@@ -16,7 +16,7 @@ Jody: ...@@ -16,7 +16,7 @@ Jody:
Jukka: Jukka:
* Documented the advanced filter. * Documented the advanced filter.
* Added Help-buttons for autocorrect and filter tools. * Added `Help' buttons for various tools.
-------------------------------------------------------------------------- --------------------------------------------------------------------------
Gnumeric 0.74 Gnumeric 0.74
......
2001-10-31 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi> 2001-10-31 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* analysis-tools.glade, dialog-analysis-tools.c: Added `Help'
button to the tool selection dialog.
* advanced-filter.glade, dialog-advanced-filter.c: Added `Help' * advanced-filter.glade, dialog-advanced-filter.c: Added `Help'
button. button.
......
...@@ -127,6 +127,16 @@ ...@@ -127,6 +127,16 @@
<can_focus>True</can_focus> <can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button> <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget> </widget>
<widget>
<class>GtkButton</class>
<name>helpbutton</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_HELP</stock_button>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget> </widget>
</widget> </widget>
</widget> </widget>
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
* dialog-analysis-tools.c: * dialog-analysis-tools.c:
* *
* Authors: * Authors:
* Jukka-Pekka Iivonen <iivonen@iki.fi> * Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* Andreas J. Guelzow <aguelzow@taliesin.ca> * Andreas J. Guelzow <aguelzow@taliesin.ca>
* *
* (C) Copyright 2000 by Jukka-Pekka Iivonen <iivonen@iki.fi> * (C) Copyright 2000, 2001 by Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
*/ */
#include <config.h> #include <config.h>
...@@ -3749,13 +3749,25 @@ selection_made (GtkWidget *clist, gint row, gint column, ...@@ -3749,13 +3749,25 @@ selection_made (GtkWidget *clist, gint row, gint column,
} }
} }
static void
dialog_help_cb(GtkWidget *button, gchar *helpfile)
{
if (helpfile != NULL) {
GnomeHelpMenuEntry help_ref;
help_ref.name = "gnumeric";
help_ref.path = helpfile;
gnome_help_display (NULL, &help_ref);
}
}
void void
dialog_data_analysis (WorkbookControlGUI *wbcg, Sheet *sheet) dialog_data_analysis (WorkbookControlGUI *wbcg, Sheet *sheet)
{ {
GladeXML *gui; GladeXML *gui;
GtkWidget *dialog; GtkWidget *dialog;
GtkWidget *tool_list; GtkWidget *tool_list;
GtkWidget *helpbutton;
gchar *helpfile = "analysis-tools.html";
int i, selection; int i, selection;
dialog_loop: dialog_loop:
...@@ -3769,7 +3781,11 @@ dialog_data_analysis (WorkbookControlGUI *wbcg, Sheet *sheet) ...@@ -3769,7 +3781,11 @@ dialog_data_analysis (WorkbookControlGUI *wbcg, Sheet *sheet)
return; return;
} }
tool_list = glade_xml_get_widget (gui, "clist1"); helpbutton = glade_xml_get_widget(gui, "helpbutton");
gtk_signal_connect (GTK_OBJECT (helpbutton), "clicked",
GTK_SIGNAL_FUNC (dialog_help_cb), helpfile);
tool_list = glade_xml_get_widget (gui, "clist1");
gtk_signal_connect (GTK_OBJECT(tool_list), "select_row", gtk_signal_connect (GTK_OBJECT(tool_list), "select_row",
GTK_SIGNAL_FUNC(selection_made), NULL); GTK_SIGNAL_FUNC(selection_made), NULL);
...@@ -3785,7 +3801,12 @@ dialog_data_analysis (WorkbookControlGUI *wbcg, Sheet *sheet) ...@@ -3785,7 +3801,12 @@ dialog_data_analysis (WorkbookControlGUI *wbcg, Sheet *sheet)
gtk_widget_grab_focus (GTK_WIDGET(tool_list)); gtk_widget_grab_focus (GTK_WIDGET(tool_list));
/* Run the dialog */ /* Run the dialog */
loop:
selection = gnumeric_dialog_run (wbcg, GNOME_DIALOG (dialog)); selection = gnumeric_dialog_run (wbcg, GNOME_DIALOG (dialog));
if (selection == 2)
goto loop;
gtk_object_unref (GTK_OBJECT (gui)); gtk_object_unref (GTK_OBJECT (gui));
if (selection == -1) if (selection == -1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment