Commit 4cc3daf4 authored by Andreas J. Guelzow 's avatar Andreas J. Guelzow

Add function help menu item. [#156777]

2010-06-09 Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* component/Gnumeric-embed.xml.in: add Function Help
	* src/GNOME_Gnumeric-gtk.xml.in: ditto
	* src/HILDON_Gnumeric-gtk.xml.in: ditto
	* src/wbc-gtk-actions.c (cb_help_function): new
	(permanent_actions): attach cb_help_function

2010-06-09 Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* function-select.glade: add close button
	* dialog-function-select.c (dialog_function_select_init):
	  show and hide the appropriate widgets depending on whether
	  we are in help mode
	(cb_dialog_function_select_ok_clicked): only called the
	  formula guru if we aren't in help mode
	(dialog_function_select): don't show the purposefully hidden
	  widgets
parent fc280b6a
2010-06-09 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* component/Gnumeric-embed.xml.in: add Function Help
* src/GNOME_Gnumeric-gtk.xml.in: ditto
* src/HILDON_Gnumeric-gtk.xml.in: ditto
* src/wbc-gtk-actions.c (cb_help_function): new
(permanent_actions): attach cb_help_function
2010-06-07 Andreas J. Guelzow <aguelzow@pyrshep.ca>
for Konstantin Tokarev
......
......@@ -13,6 +13,7 @@ Andreas:
* Ensure that names cannot be mistaken as cell references.
[#409997]
* Add search function to function selector. [#495776]
* Add function help menu item. [#156777]
Jean:
* Do not ungrab a not grabbed item. [#620369]
......
......@@ -264,6 +264,7 @@
</menu>
<menu name="Help" action="MenuHelp">
<menuitem action="HelpDocs"/>
<menuitem action="HelpFunctions"/>
<menuitem action="HelpWeb"/>
<menuitem action="HelpIRC"/>
<menuitem action="HelpBug"/>
......
......@@ -266,6 +266,7 @@
</menu>
<menu name="Help" action="MenuHelp">
<menuitem action="HelpDocs"/>
<menuitem action="HelpFunctions"/>
<menuitem action="HelpWeb"/>
<menuitem action="HelpIRC"/>
<menuitem action="HelpBug"/>
......
......@@ -260,6 +260,9 @@
<menu name="Help" action="MenuHelp">
<!--
<menuitem action="HelpDocs"/>
-->
<menuitem action="HelpFunctions"/>
<!--
<menuitem action="HelpWeb"/>
<menuitem action="HelpIRC"/>
<menuitem action="HelpBug"/>
......
2010-06-09 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* function-select.glade: add close button
* dialog-function-select.c (dialog_function_select_init):
show and hide the appropriate widgets depending on whether
we are in help mode
(cb_dialog_function_select_ok_clicked): only called the
formula guru if we aren't in help mode
(dialog_function_select): don't show the purposefully hidden
widgets
2010-06-09 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* dialog-function-select.c (cb_unref): new
......
......@@ -341,7 +341,8 @@ cb_dialog_function_select_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
GnmFunc const *func;
GtkTreeSelection *the_selection = gtk_tree_view_get_selection (state->treeview);
if (gtk_tree_selection_get_selected (the_selection, &model, &iter)) {
if (state->formula_guru_key != NULL &&
gtk_tree_selection_get_selected (the_selection, &model, &iter)) {
WBCGtk *wbcg = state->wbcg;
gtk_tree_model_get (model, &iter,
FUNCTION, &func,
......@@ -353,7 +354,6 @@ cb_dialog_function_select_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
return;
}
g_assert_not_reached ();
gtk_widget_destroy (state->dialog);
return;
}
......@@ -1014,6 +1014,9 @@ dialog_function_select_init (FunctionSelectState *state)
GtkTextIter where;
GtkTextBuffer *description;
GtkCellRenderer *cell;
GtkWidget *cancel_button;
GtkWidget *close_button;
gboolean help_mode;
g_object_set_data (G_OBJECT (state->dialog), FUNCTION_SELECT_DIALOG_KEY,
state);
......@@ -1033,7 +1036,6 @@ dialog_function_select_init (FunctionSelectState *state)
gtk_combo_box_set_row_separator_func
(state->cb, dialog_function_select_cat_row_separator,
state, NULL);
gtk_combo_box_set_active (state->cb, 0);
g_signal_connect (state->cb, "changed",
G_CALLBACK (dialog_function_select_cat_changed),
state);
......@@ -1129,9 +1131,11 @@ dialog_function_select_init (FunctionSelectState *state)
g_signal_connect (G_OBJECT (state->ok_button),
"clicked",
G_CALLBACK (cb_dialog_function_select_ok_clicked), state);
g_signal_connect (G_OBJECT
(glade_xml_get_widget (state->gui, "cancel_button")),
"clicked",
cancel_button = glade_xml_get_widget (state->gui, "cancel_button");
g_signal_connect (G_OBJECT (cancel_button), "clicked",
G_CALLBACK (cb_dialog_function_select_cancel_clicked), state);
close_button = glade_xml_get_widget (state->gui, "close_button");
g_signal_connect (G_OBJECT (close_button), "clicked",
G_CALLBACK (cb_dialog_function_select_cancel_clicked), state);
gnm_dialog_setup_destroy_handlers
......@@ -1146,6 +1150,19 @@ dialog_function_select_init (FunctionSelectState *state)
(G_OBJECT (state->dialog),
"state", state,
(GDestroyNotify) cb_dialog_function_select_destroy);
help_mode = (state->formula_guru_key == NULL);
gtk_widget_set_visible (close_button, help_mode);
gtk_widget_set_visible (glade_xml_get_widget
(state->gui, "help_button"),
!help_mode);
gtk_widget_set_visible (cancel_button, !help_mode);
gtk_widget_set_visible (state->ok_button, !help_mode);
gtk_widget_set_visible (glade_xml_get_widget
(state->gui, "title_label"),
!help_mode);
gtk_combo_box_set_active (state->cb, help_mode ? 2 : 0);
}
void
......@@ -1176,5 +1193,5 @@ dialog_function_select (WBCGtk *wbcg, char const *key)
gnumeric_keyed_dialog (state->wbcg, GTK_WINDOW (state->dialog),
FUNCTION_SELECT_KEY);
gtk_widget_show_all (state->dialog);
gtk_widget_show (state->dialog);
}
......@@ -14,7 +14,7 @@
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<widget class="GtkLabel" id="label4">
<widget class="GtkLabel" id="title_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Select a function to insert:</property>
......@@ -25,9 +25,6 @@
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<widget class="GtkVPaned" id="vpaned1">
<property name="visible">True</property>
......@@ -153,6 +150,9 @@
<property name="position">2</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
......@@ -172,6 +172,20 @@
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="close_button">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="cancel_button">
<property name="label">gtk-cancel</property>
......@@ -184,7 +198,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
......@@ -198,7 +212,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</widget>
......
......@@ -996,6 +996,7 @@ static GNM_ACTION_DEF (cb_data_show_detail) { hide_show_detail (wbcg, TRUE); }
static GNM_ACTION_DEF (cb_data_group) { group_ungroup_colrow (wbcg, TRUE); }
static GNM_ACTION_DEF (cb_data_ungroup) { group_ungroup_colrow (wbcg, FALSE); }
static GNM_ACTION_DEF (cb_help_function) { dialog_function_select (wbcg, NULL); }
static GNM_ACTION_DEF (cb_help_docs)
{
char *argv[] = { NULL, NULL, NULL };
......@@ -1825,6 +1826,9 @@ static GtkActionEntry const permanent_actions[] = {
{ "HelpDocs", GTK_STOCK_HELP, N_("_Contents"),
"F1", N_("Open a viewer for Gnumeric's documentation"),
G_CALLBACK (cb_help_docs) },
{ "HelpFunctions", NULL, N_("_Functions"),
NULL, N_("Functions help"),
G_CALLBACK (cb_help_function) },
{ "HelpWeb", NULL, N_("Gnumeric on the _Web"),
NULL, N_("Browse to Gnumeric's website"),
G_CALLBACK (cb_help_web) },
......
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