Commit 6212d9be authored by Jukka-Pekka Iivonen's avatar Jukka-Pekka Iivonen Committed by jpekka

Added `Help' button.

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

        * advanced-filter.glade, dialog-advanced-filter.c: Added `Help'
        button.

        * autocorrect.glade, dialog-autocorrect.c: Added `Help' button.
parent 872a8bd3
......@@ -16,6 +16,7 @@ Jody:
Jukka:
* Documented the advanced filter.
* Added Help-buttons for autocorrect and filter tools.
--------------------------------------------------------------------------
Gnumeric 0.74
......
2001-10-31 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* advanced-filter.glade, dialog-advanced-filter.c: Added `Help'
button.
* autocorrect.glade, dialog-autocorrect.c: Added `Help' button.
2001-10-31 Jody Goldberg <jgoldberg@home.com>
* dialog-formula-guru.c (dialog_formula_guru) : remove the debug spew.
......
......@@ -71,6 +71,16 @@
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</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>
......
......@@ -71,6 +71,16 @@
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</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>
......
......@@ -4,12 +4,13 @@
* Author:
* Jukka-Pekka Iivonen <iivonen@iki.fi>
*
* (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 <glib.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-help.h>
#include <glade/glade.h>
#include "gnumeric.h"
#include "sheet.h"
......@@ -64,7 +65,6 @@ filter (data_analysis_output_t *dao,
}
}
/* Filter tool.
*/
static gint
......@@ -147,6 +147,17 @@ new_workbook_toggled(GtkWidget *widget, filter_t *filter)
}
}
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
dialog_advanced_filter (WorkbookControlGUI *wbcg)
......@@ -161,7 +172,9 @@ dialog_advanced_filter (WorkbookControlGUI *wbcg)
GtkWidget *copy_to;
GtkWidget *unique_only;
GtkWidget *radiobutton;
Sheet *sheet;
GtkWidget *helpbutton;
Sheet *sheet;
gchar *helpfile = "filter.html";
gint v, error_flag;
gint list_col_b, list_col_e, list_row_b, list_row_e;
gint crit_col_b, crit_col_e, crit_row_b, crit_row_e;
......@@ -200,6 +213,9 @@ dialog_advanced_filter (WorkbookControlGUI *wbcg)
gtk_signal_connect (GTK_OBJECT (radiobutton), "toggled",
GTK_SIGNAL_FUNC (new_workbook_toggled),
&f);
helpbutton = glade_xml_get_widget(gui, "helpbutton");
gtk_signal_connect (GTK_OBJECT (helpbutton), "clicked",
GTK_SIGNAL_FUNC (dialog_help_cb), helpfile);
if (unique_only_flag)
gtk_toggle_button_set_active ((GtkToggleButton *)
......@@ -221,6 +237,9 @@ loop:
sheet = wb_control_cur_sheet (WORKBOOK_CONTROL (wbcg));
if (v == 2)
goto loop;
if (v == -1 || v == 1){
/* Canceled */
if (v != -1)
......
......@@ -2,15 +2,16 @@
* dialog-autocorrect.c:
*
* Author:
* Jukka-Pekka Iivonen <iivonen@iki.fi>
* Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
*
* (C) Copyright 2000 by Jukka-Pekka Iivonen <iivonen@iki.fi>
* (C) Copyright 2000, 2001 by Jukka-Pekka Iivonen <iivonen@iki.fi>
**/
#include <config.h>
#include <glib.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-help.h>
#include <glade/glade.h>
#include <ctype.h>
#include "gnumeric.h"
......@@ -359,6 +360,17 @@ exceptions_callback (GtkWidget *widget, autocorrect_t *p)
gtk_widget_show (p->dia);
}
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);
}
}
/*
* Widgets for "replace text when typed" have been set insensitive in
* autocorrect.glade until the feature is implemented. The widgets are:
......@@ -377,6 +389,8 @@ dialog_autocorrect (WorkbookControlGUI *wbcg)
GtkWidget *caps_lock;
GtkWidget *replace;
GtkWidget *entry;
GtkWidget *helpbutton;
gchar *helpfile = "autocorrect.html";
autocorrect_t p;
gint v;
......@@ -450,6 +464,10 @@ dialog_autocorrect (WorkbookControlGUI *wbcg)
gtk_signal_connect (GTK_OBJECT (replace), "toggled",
GTK_SIGNAL_FUNC (replace_toggled), NULL);
helpbutton = glade_xml_get_widget(gui, "helpbutton");
gtk_signal_connect (GTK_OBJECT (helpbutton), "clicked",
GTK_SIGNAL_FUNC (dialog_help_cb), helpfile);
/* Make <Ret> in entry fields invoke default */
entry = glade_xml_get_widget (gui, "entry1");
gtk_widget_set_sensitive (entry, FALSE);
......@@ -460,8 +478,12 @@ dialog_autocorrect (WorkbookControlGUI *wbcg)
GTK_EDITABLE (entry));
gtk_widget_set_sensitive (entry, FALSE);
loop:
v = gnumeric_dialog_run (wbcg, GNOME_DIALOG (dia));
if (v == 2)
goto loop;
if (v != 0) {
autocorrect_init_caps = old_init_caps;
autocorrect_first_letter = old_first_letter;
......
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