Add some main window function descriptions

pull/1456/head
Robert Fewell 4 years ago
parent 79285097ff
commit 959c870f03

@ -3516,18 +3516,18 @@ gnc_main_window_unmerge_actions (GncMainWindow *window,
}
GAction *
gnc_main_window_find_action (GncMainWindow *window, const gchar *name)
gnc_main_window_find_action (GncMainWindow *window, const gchar *action_name)
{
GncMainWindowPrivate *priv;
GAction *action = nullptr;
g_return_val_if_fail (GNC_IS_MAIN_WINDOW(window), nullptr);
g_return_val_if_fail (name != nullptr, nullptr);
g_return_val_if_fail (action_name != nullptr, nullptr);
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
action = g_action_map_lookup_action (G_ACTION_MAP(window),
name);
action_name);
return action;
}
@ -3535,17 +3535,17 @@ gnc_main_window_find_action (GncMainWindow *window, const gchar *name)
GAction *
gnc_main_window_find_action_in_group (GncMainWindow *window,
const gchar *group_name,
const gchar *name)
const gchar *action_name)
{
GAction *action = nullptr;
g_return_val_if_fail (GNC_IS_MAIN_WINDOW(window), nullptr);
g_return_val_if_fail (group_name != nullptr, nullptr);
g_return_val_if_fail (name != nullptr, nullptr);
g_return_val_if_fail (action_name != nullptr, nullptr);
auto action_group = gtk_widget_get_action_group (GTK_WIDGET(window), group_name);
if (action_group)
action = g_action_map_lookup_action (G_ACTION_MAP(window), name);
action = g_action_map_lookup_action (G_ACTION_MAP(window), action_name);
return action;
}
@ -3585,8 +3585,15 @@ gnc_main_window_toolbar_find_tool_item (GncMainWindow *window, const gchar *acti
GtkWidget *
gnc_main_window_menu_find_menu_item (GncMainWindow *window, const gchar *action_name)
{
GncMainWindowPrivate *priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
GtkWidget *menu_item = GTK_WIDGET(g_hash_table_lookup (priv->display_item_hash, action_name));
GncMainWindowPrivate *priv;
GtkWidget *menu_item;
g_return_val_if_fail (GNC_IS_MAIN_WINDOW(window), nullptr);
g_return_val_if_fail (action_name != nullptr, nullptr);
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
menu_item = GTK_WIDGET(g_hash_table_lookup (priv->display_item_hash, action_name));
priv->num_item_q++; //FIXMEb temp added
@ -3650,8 +3657,7 @@ gnc_main_window_init_short_names (GncMainWindow *window,
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
gnc_plugin_init_short_names (priv->toolbar,
toolbar_labels);
gnc_plugin_init_short_names (priv->toolbar, toolbar_labels);
}
@ -3661,7 +3667,7 @@ gnc_main_window_update_toolbar (GncMainWindow *window, GncPluginPage *page,
{
GncMainWindowPrivate *priv;
GtkBuilder *builder;
GAction *action = gnc_main_window_find_action (window, "ViewToolbarAction");
GAction *action;
g_return_if_fail (GNC_IS_MAIN_WINDOW(window));
g_return_if_fail (GNC_IS_PLUGIN_PAGE(page));
@ -3690,6 +3696,8 @@ gnc_main_window_update_toolbar (GncMainWindow *window, GncPluginPage *page,
g_free (toolbar_name);
}
action = gnc_main_window_find_action (window, "ViewToolbarAction");
// set visibility of toolbar
if (action)
{
@ -3697,7 +3705,6 @@ gnc_main_window_update_toolbar (GncMainWindow *window, GncPluginPage *page,
gtk_widget_set_visible (priv->toolbar, g_variant_get_boolean (state));
g_variant_unref (state);
}
// add tooltip redirect call backs
gnc_plugin_add_toolbar_tooltip_callbacks (priv->toolbar, priv->statusbar);
}

@ -209,7 +209,7 @@ main_window_update_page_set_read_only_icon (GncPluginPage *page,
* should be unique among all groups added to the window, and will be
* needed to remove the actions from this window.
*
* @param group A pointer to the GSimpleActionGroup.
* @param group A pointer to the GSimpleActionGroup.
*/
void gnc_main_window_manual_merge_actions (GncMainWindow *window,
const gchar *group_name,
@ -318,6 +318,14 @@ typedef struct
const char *short_label;
} GncToolBarShortNames; //FIXMEb added
/** Update the labels of the toolbar items with short names.
*
* @param window The window that conatins a tool bar to update.
*
* @param toolbar_labels A pointer to a NULL terminated array of data
* GncToolBarShortNames items.
*/
void gnc_main_window_init_short_names (GncMainWindow *window,
GncToolBarShortNames *toolbar_labels); //FIXMEb added
@ -446,21 +454,39 @@ gboolean gnc_main_window_all_finish_pending (void);
* this action. */
void gnc_main_window_all_action_set_sensitive (const gchar *action_name, gboolean sensitive);
/** Find action in main window.
/** Find the GAction in the main window.
*
* @param window The window which should be checked for the action.
*
* @param name The name of the command to be retrieved.
* @param action_name The name of the command to be retrieved.
*
* @return A pointer to a GtkAction that was added with the
* specified name. If the name cannot be found, then NULL will be
* returned.
*/
GAction *gnc_main_window_find_action (GncMainWindow *window, const gchar *name);
GAction *gnc_main_window_find_action (GncMainWindow *window,
const gchar *action_name);
GAction *gnc_main_window_find_action_in_group (GncMainWindow *window,
/** Find the GAction in a specific action group for window.
*
* @param window The window which should be checked for the action.
*
* @param group_name The name of the action group to search.
*
* @param name The name of the command to be retrieved.
*
* @return A pointer to the GAction if found or NULL will be returned.
*/
GAction *gnc_main_window_find_action_in_group (GncMainWindow *window,
const gchar *group_name,
const gchar *action_name); //FIXMEb added
/** Return the GMenuModel for the main window menu bar.
*
* @param window The window for the menu bar.
*
* @return The GMenuModel or NULL.
*/
GMenuModel *gnc_main_window_get_menu_model (GncMainWindow *window); //FIXMEb added
/** Update the main window menu with the placeholders listed in

Loading…
Cancel
Save