mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Change GtkGroupAction and GtkActions
Change GtkGroupAction to GSimpleActionGroup and any remaining GtkActions to GAction. Also comment out any unsure changes that need further investigation.
This commit is contained in:
parent
8d3eb666d3
commit
6e29ae278f
@ -84,6 +84,7 @@ typedef struct GncEmbeddedWindowPrivate
|
||||
* This does not include any action provided by menu or content
|
||||
* plugins. */
|
||||
GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group; //FIXMEb added
|
||||
|
||||
/** The currently selected page. */
|
||||
GncPluginPage *page;
|
||||
@ -124,7 +125,7 @@ gnc_embedded_window_open_page (GncEmbeddedWindow *window,
|
||||
gtk_box_pack_end(GTK_BOX(window), page->notebook_page, TRUE, TRUE, 2);
|
||||
gnc_plugin_page_inserted (page);
|
||||
|
||||
gnc_plugin_page_merge_actions (page, window->ui_merge);
|
||||
//FIXMEb gnc_plugin_page_merge_actions (page, window->ui_merge);
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
@ -153,7 +154,7 @@ gnc_embedded_window_close_page (GncEmbeddedWindow *window,
|
||||
priv->page = NULL;
|
||||
gnc_plugin_page_removed (page);
|
||||
|
||||
gnc_plugin_page_unmerge_actions (page, window->ui_merge);
|
||||
//FIXMEb gnc_plugin_page_unmerge_actions (page, window->ui_merge);
|
||||
gtk_ui_manager_ensure_update (window->ui_merge);
|
||||
|
||||
gnc_plugin_page_destroy_widget (page);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -55,6 +55,15 @@ extern "C"
|
||||
|
||||
/* typedefs & structures */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const gchar *action_name;
|
||||
const gchar *icon_name;
|
||||
const gchar *label;
|
||||
const gchar *accelerator;
|
||||
const gchar *tooltip;
|
||||
} GncDisplayItem;
|
||||
|
||||
/** The instance data structure for a main window object. */
|
||||
typedef struct GncMainWindow
|
||||
{
|
||||
@ -241,10 +250,9 @@ void gnc_main_window_manual_merge_actions (GncMainWindow *window,
|
||||
*
|
||||
* @param n_entries The number of actions in the array.
|
||||
*
|
||||
* @param toggle_entries A pointer to an array of GtkToggleActionEntry.
|
||||
* These are the toggle actions that will be added to the user interface.
|
||||
* @param display_items A pointer to an array of GncDisplayItem.
|
||||
*
|
||||
* @param n_toggle_entries The number of toggle actions in the array.
|
||||
* @param n_display_items The number of display items in the array.
|
||||
*
|
||||
* @param filename The filename containing the user interface
|
||||
* definition that goes with this set of actions.
|
||||
@ -254,10 +262,10 @@ void gnc_main_window_manual_merge_actions (GncMainWindow *window,
|
||||
*/
|
||||
void gnc_main_window_merge_actions (GncMainWindow *window,
|
||||
const gchar *group_name,
|
||||
GtkActionEntry *entries,
|
||||
GActionEntry *entries,
|
||||
guint n_entries,
|
||||
GtkToggleActionEntry *toggle_entries,
|
||||
guint n_toggle_entries,
|
||||
GncDisplayItem *display_items,
|
||||
guint n_display_items,
|
||||
const gchar *filename,
|
||||
gpointer user_data);
|
||||
|
||||
@ -303,8 +311,8 @@ void gnc_main_window_actions_updated (GncMainWindow *window);
|
||||
* specified name. If the name cannot be found, then NULL will be
|
||||
* returned.
|
||||
*/
|
||||
GtkActionGroup *gnc_main_window_get_action_group (GncMainWindow *window,
|
||||
const gchar *group_name);
|
||||
GSimpleActionGroup *gnc_main_window_get_action_group (GncMainWindow *window,
|
||||
const gchar *group_name);
|
||||
|
||||
|
||||
/** Set the window where all progressbar updates should occur. This
|
||||
@ -424,7 +432,7 @@ void gnc_main_window_all_action_set_sensitive (const gchar *action_name, gboolea
|
||||
* specified name. If the name cannot be found, then NULL will be
|
||||
* returned.
|
||||
*/
|
||||
GtkAction *gnc_main_window_find_action (GncMainWindow *window, const gchar *name);
|
||||
GAction *gnc_main_window_find_action (GncMainWindow *window, const gchar *name);
|
||||
|
||||
/**
|
||||
* Shows all main windows.
|
||||
|
@ -407,19 +407,18 @@ gnc_history_update_action (GncMainWindow *window,
|
||||
gint index,
|
||||
const gchar *filename)
|
||||
{
|
||||
GtkActionGroup *action_group;
|
||||
GtkAction *action;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
GAction *action;
|
||||
gchar *action_name, *label_name, *tooltip, *old_filename;
|
||||
gint limit;
|
||||
|
||||
ENTER("window %p, index %d, filename %s", window, index,
|
||||
filename ? filename : "(null)");
|
||||
/* Get the action group */
|
||||
action_group =
|
||||
gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
|
||||
simple_action_group = gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);
|
||||
|
||||
action_name = g_strdup_printf("RecentFile%dAction", index);
|
||||
action = gtk_action_group_get_action (action_group, action_name);
|
||||
//FIXMEb action_name = g_strdup_printf ("RecentFile%dAction", index);
|
||||
// action = g_action_map_lookup_action (G_ACTION_MAP(simple_action_group), action_name);
|
||||
|
||||
limit = gnc_prefs_get_int (GNC_PREFS_GROUP_HISTORY,
|
||||
GNC_PREF_HISTORY_MAXFILES);
|
||||
@ -427,26 +426,26 @@ gnc_history_update_action (GncMainWindow *window,
|
||||
if (filename && (strlen(filename) > 0) && (index < limit))
|
||||
{
|
||||
/* set the menu label (w/accelerator) */
|
||||
label_name = gnc_history_generate_label(index, filename);
|
||||
tooltip = gnc_history_generate_tooltip(index, filename);
|
||||
g_object_set(G_OBJECT(action), "label", label_name,
|
||||
"tooltip", tooltip,
|
||||
"visible", TRUE,
|
||||
NULL);
|
||||
g_free(label_name);
|
||||
g_free(tooltip);
|
||||
label_name = gnc_history_generate_label (index, filename);
|
||||
tooltip = gnc_history_generate_tooltip (index, filename);
|
||||
//FIXMEb g_object_set(G_OBJECT(action), "label", label_name,
|
||||
// "tooltip", tooltip,
|
||||
// "visible", TRUE,
|
||||
// NULL);
|
||||
// g_free(label_name);
|
||||
// g_free(tooltip);
|
||||
|
||||
/* set the filename for the callback function */
|
||||
old_filename = g_object_get_data(G_OBJECT(action), FILENAME_STRING);
|
||||
if (old_filename)
|
||||
g_free(old_filename);
|
||||
g_object_set_data(G_OBJECT(action), FILENAME_STRING, g_strdup(filename));
|
||||
//FIXMEb old_filename = g_object_get_data(G_OBJECT(action), FILENAME_STRING);
|
||||
// if (old_filename)
|
||||
// g_free(old_filename);
|
||||
//FIXMEb g_object_set_data(G_OBJECT(action), FILENAME_STRING, g_strdup(filename));
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_action_set_visible(action, FALSE);
|
||||
//FIXMEb gtk_action_set_visible(action, FALSE);
|
||||
}
|
||||
g_free(action_name);
|
||||
// g_free (action_name);
|
||||
LEAVE("");
|
||||
}
|
||||
|
||||
|
@ -174,14 +174,14 @@ gnc_main_window_to_scm (GncMainWindow *window)
|
||||
* that had a menu selected.
|
||||
*/
|
||||
static void
|
||||
gnc_plugin_menu_additions_action_cb (GtkAction *action,
|
||||
gnc_plugin_menu_additions_action_cb (GAction *action,
|
||||
GncMainWindowActionData *data)
|
||||
{
|
||||
|
||||
g_return_if_fail(GTK_IS_ACTION(action));
|
||||
g_return_if_fail(data != NULL);
|
||||
g_return_if_fail (G_IS_SIMPLE_ACTION(action));
|
||||
g_return_if_fail (data != NULL);
|
||||
|
||||
gnc_extension_invoke_cb(data->data, gnc_main_window_to_scm(data->window));
|
||||
gnc_extension_invoke_cb (data->data, gnc_main_window_to_scm (data->window));
|
||||
}
|
||||
|
||||
|
||||
@ -410,8 +410,8 @@ gnc_menu_additions_menu_setup_one (ExtensionInfo *ext_info,
|
||||
*/
|
||||
static void
|
||||
gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin,
|
||||
GncMainWindow *window,
|
||||
GQuark type)
|
||||
GncMainWindow *window,
|
||||
GQuark type)
|
||||
{
|
||||
GncPluginMenuAdditionsPerWindow per_window;
|
||||
static GOnce accel_table_init = G_ONCE_INIT;
|
||||
@ -420,6 +420,8 @@ gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin,
|
||||
|
||||
ENTER(" ");
|
||||
|
||||
//FIXMEb
|
||||
#ifdef skip
|
||||
per_window.window = window;
|
||||
per_window.ui_manager = window->ui_merge;
|
||||
per_window.group = gtk_action_group_new ("MenuAdditions" );
|
||||
@ -446,6 +448,7 @@ gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin,
|
||||
per_window.group, per_window.merge_id);
|
||||
|
||||
g_slist_free(menu_list);
|
||||
#endif
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
@ -463,19 +466,19 @@ gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin,
|
||||
*/
|
||||
static void
|
||||
gnc_plugin_menu_additions_remove_from_window (GncPlugin *plugin,
|
||||
GncMainWindow *window,
|
||||
GQuark type)
|
||||
GncMainWindow *window,
|
||||
GQuark type)
|
||||
{
|
||||
GtkActionGroup *group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
|
||||
ENTER(" ");
|
||||
|
||||
/* Have to remove our actions manually. Its only automatic if the
|
||||
* actions name is installed into the plugin class. */
|
||||
group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
|
||||
simple_action_group = gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);
|
||||
|
||||
if (group && !window->just_plugin_prefs)
|
||||
gtk_ui_manager_remove_action_group(window->ui_merge, group);
|
||||
//FIXMEb if (group && !window->just_plugin_prefs)
|
||||
// gtk_ui_manager_remove_action_group(window->ui_merge, simple_action_group);
|
||||
|
||||
/* Note: This code does not clean up the per-callback data structures
|
||||
* that are created by the gnc_menu_additions_menu_setup_one()
|
||||
|
@ -97,7 +97,7 @@ typedef struct _GncPluginPagePrivate
|
||||
char *ui_description;
|
||||
|
||||
GtkBuilder *builder; //FIXMEb added
|
||||
GSimpleActionGroup *simple_action_group; //FIXMEb added
|
||||
GSimpleActionGroup *simple_action_group; //FIXMEb added
|
||||
|
||||
GList *books;
|
||||
|
||||
@ -295,7 +295,7 @@ gnc_plugin_page_unmerge_actions (GncPluginPage *page,
|
||||
}
|
||||
|
||||
|
||||
GtkAction *
|
||||
GAction *
|
||||
gnc_plugin_page_get_action (GncPluginPage *page, const gchar *name)
|
||||
{
|
||||
GncPluginPagePrivate *priv;
|
||||
@ -304,9 +304,9 @@ gnc_plugin_page_get_action (GncPluginPage *page, const gchar *name)
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
|
||||
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
|
||||
if (!priv->action_group)
|
||||
if (!priv->simple_action_group)
|
||||
return NULL;
|
||||
return gtk_action_group_get_action (priv->action_group, name);
|
||||
return g_action_map_lookup_action (G_ACTION_MAP(priv->simple_action_group), name);
|
||||
}
|
||||
|
||||
|
||||
@ -1092,16 +1092,16 @@ gnc_plugin_page_set_ui_description (GncPluginPage *page,
|
||||
}
|
||||
|
||||
|
||||
/* Retrieve the GtkUIManager object associated with this page. */
|
||||
GtkUIManager *
|
||||
gnc_plugin_page_get_ui_merge (GncPluginPage *page)
|
||||
/* Retrieve the GtkBuilder object associated with this page. */
|
||||
GtkBuilder *
|
||||
gnc_plugin_page_get_builder (GncPluginPage *page)
|
||||
{
|
||||
GncPluginPagePrivate *priv;
|
||||
|
||||
g_return_val_if_fail (GNC_IS_PLUGIN_PAGE(page), NULL);
|
||||
|
||||
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
|
||||
return priv->ui_merge;
|
||||
return priv->builder;
|
||||
}
|
||||
|
||||
|
||||
@ -1145,12 +1145,12 @@ GSimpleActionGroup *
|
||||
gnc_plugin_page_create_action_groupb (GncPluginPage *page, const gchar *group_name)
|
||||
{
|
||||
GncPluginPagePrivate *priv;
|
||||
GSimpleActionGroup *group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
|
||||
priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
|
||||
group = g_simple_action_group_new ();
|
||||
priv->simple_action_group = group;
|
||||
return group;
|
||||
simple_action_group = g_simple_action_group_new ();
|
||||
priv->simple_action_group = simple_action_group;
|
||||
return simple_action_group;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -525,12 +525,12 @@ void gnc_plugin_page_set_ui_description (GncPluginPage *page,
|
||||
const char *ui_filename);
|
||||
|
||||
|
||||
/** Retrieve the GtkUIManager object associated with this page.
|
||||
/** Retrieve the GtkBuilder object associated with this page.
|
||||
*
|
||||
* @param page The page whose UI information should be retrieved.
|
||||
*
|
||||
* @return A pointer to the GtkUIManager object for this page. */
|
||||
GtkUIManager *gnc_plugin_page_get_ui_merge (GncPluginPage *page);
|
||||
* @return A pointer to the GtkBuilder object for this page. */
|
||||
GtkBuilder *gnc_plugin_page_get_builder (GncPluginPage *page);
|
||||
|
||||
|
||||
/** Retrieve the GtkActionGroup object associated with this page.
|
||||
@ -568,7 +568,7 @@ GSimpleActionGroup * gnc_plugin_page_create_action_groupb (GncPluginPage *page,
|
||||
*
|
||||
* @return A pointer to the retuested GtkAction object or NULL.
|
||||
*/
|
||||
GtkAction *gnc_plugin_page_get_action (GncPluginPage *page, const gchar *name);
|
||||
GAction *gnc_plugin_page_get_action (GncPluginPage *page, const gchar *name);
|
||||
|
||||
/* Signals */
|
||||
void gnc_plugin_page_inserted (GncPluginPage *plugin_page);
|
||||
|
@ -130,7 +130,7 @@ gnc_plugin_add_to_window (GncPlugin *plugin,
|
||||
GQuark type)
|
||||
{
|
||||
GncPluginClass *klass;
|
||||
GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
|
||||
g_return_if_fail (GNC_IS_PLUGIN (plugin));
|
||||
klass = GNC_PLUGIN_GET_CLASS (plugin);
|
||||
@ -143,19 +143,18 @@ gnc_plugin_add_to_window (GncPlugin *plugin,
|
||||
if (klass->actions_name)
|
||||
{
|
||||
DEBUG ("%s: %d actions to merge with gui from %s",
|
||||
klass->actions_name, (klass->n_actions + klass->n_toggle_actions), klass->ui_filename);
|
||||
klass->actions_name, klass->n_actions, klass->ui_filename);
|
||||
gnc_main_window_merge_actions (window, klass->actions_name,
|
||||
klass->actions, klass->n_actions,
|
||||
klass->toggle_actions, klass->n_toggle_actions,
|
||||
klass->actionsb, klass->n_actionsb,
|
||||
klass->display_items, klass->n_display_items,
|
||||
klass->ui_filename, plugin);
|
||||
|
||||
|
||||
if (klass->important_actions)
|
||||
{
|
||||
action_group =
|
||||
gnc_main_window_get_action_group(window, klass->actions_name);
|
||||
gnc_plugin_set_important_actions(action_group,
|
||||
klass->important_actions);
|
||||
simple_action_group =
|
||||
gnc_main_window_get_action_group (window, klass->actions_name);
|
||||
//FIXMEb gnc_plugin_set_important_actions (simple_action_group,
|
||||
// klass->important_actions);
|
||||
}
|
||||
}
|
||||
|
||||
@ -231,18 +230,18 @@ gnc_plugin_get_name (GncPlugin *plugin)
|
||||
*
|
||||
* See gnc-plugin.h for documentation on the function arguments. */
|
||||
void
|
||||
gnc_plugin_init_short_names (GtkActionGroup *action_group,
|
||||
gnc_plugin_init_short_names (GSimpleActionGroup *simple_action_group,
|
||||
action_toolbar_labels *toolbar_labels)
|
||||
{
|
||||
GtkAction *action;
|
||||
GAction *action;
|
||||
gint i;
|
||||
|
||||
for (i = 0; toolbar_labels[i].action_name; i++)
|
||||
{
|
||||
/* Add a couple of short labels for the toolbar */
|
||||
action = gtk_action_group_get_action (action_group,
|
||||
toolbar_labels[i].action_name);
|
||||
gtk_action_set_short_label (action, _(toolbar_labels[i].label));
|
||||
//FIXMEb action = g_action_map_lookup_action (G_ACTION_MAP(simple_action_group),
|
||||
// toolbar_labels[i].action_name);
|
||||
// gtk_action_set_short_label (action, _(toolbar_labels[i].label));
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,16 +252,16 @@ gnc_plugin_init_short_names (GtkActionGroup *action_group,
|
||||
*
|
||||
* See gnc-plugin.h for documentation on the function arguments. */
|
||||
void
|
||||
gnc_plugin_set_important_actions (GtkActionGroup *action_group,
|
||||
gnc_plugin_set_important_actions (GSimpleActionGroup *simple_action_group,
|
||||
const gchar **name)
|
||||
{
|
||||
GtkAction *action;
|
||||
GAction *action;
|
||||
gint i;
|
||||
|
||||
for (i = 0; name[i]; i++)
|
||||
{
|
||||
action = gtk_action_group_get_action (action_group, name[i]);
|
||||
g_object_set (G_OBJECT(action), "is_important", TRUE, NULL);
|
||||
//FIXMEb action = g_action_map_lookup_action (G_ACTION_MAP(simple_action_group), name[i]);
|
||||
// g_object_set (G_OBJECT(action), "is_important", TRUE, NULL);
|
||||
}
|
||||
|
||||
/* If this trips, you've got too many "important" actions. That
|
||||
@ -312,7 +311,7 @@ gnc_plugin_update_actionsb (GSimpleActionGroup *simple_action_group,
|
||||
|
||||
for (i = 0; action_names[i]; i++)
|
||||
{
|
||||
action = g_simple_action_group_lookup (simple_action_group, action_names[i]);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP(simple_action_group), action_names[i]);
|
||||
if (action)
|
||||
{
|
||||
//FIXMEb g_object_set (G_OBJECT(action), property_name, value, NULL);
|
||||
|
@ -96,15 +96,6 @@ G_BEGIN_DECLS
|
||||
|
||||
/* typedefs & structures */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const gchar *action_name;
|
||||
const gchar *stock_id;
|
||||
const gchar *label;
|
||||
const gchar *accelerator;
|
||||
const gchar *tooltip;
|
||||
} GncDisplayItem;
|
||||
|
||||
/** The instance data structure for a menu-only plugin. */
|
||||
typedef struct
|
||||
{
|
||||
@ -267,7 +258,7 @@ typedef struct
|
||||
* @param toolbar_labels A pointer to a NULL terminated array of data
|
||||
* action_toolbar_labels items.
|
||||
*/
|
||||
void gnc_plugin_init_short_names (GtkActionGroup *action_group,
|
||||
void gnc_plugin_init_short_names (GSimpleActionGroup *simple_action_group,
|
||||
action_toolbar_labels *toolbar_labels);
|
||||
|
||||
|
||||
@ -282,7 +273,7 @@ void gnc_plugin_init_short_names (GtkActionGroup *action_group,
|
||||
* @param name A list of actions names to be marked important. This
|
||||
* list must be NULL terminated.
|
||||
*/
|
||||
void gnc_plugin_set_important_actions (GtkActionGroup *action_group,
|
||||
void gnc_plugin_set_important_actions (GSimpleActionGroup *simple_action_group,
|
||||
const gchar **names);
|
||||
|
||||
|
||||
|
@ -2727,11 +2727,11 @@ gnc_invoice_update_doclink_for_window (GncInvoice *invoice, const gchar *uri)
|
||||
|
||||
if (g_strcmp0 (uri, "") == 0) // deleted uri
|
||||
{
|
||||
GtkAction *uri_action;
|
||||
GAction *uri_action;
|
||||
|
||||
// update the menu actions
|
||||
uri_action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(iw->page), "BusinessLinkOpenAction");
|
||||
gtk_action_set_sensitive (uri_action, FALSE);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(uri_action), FALSE);
|
||||
|
||||
gtk_widget_hide (doclink_button);
|
||||
}
|
||||
|
@ -321,22 +321,24 @@ gnc_plugin_basic_commands_add_to_window (GncPlugin *plugin,
|
||||
GncMainWindow *window,
|
||||
GQuark type)
|
||||
{
|
||||
GtkActionGroup *action_group =
|
||||
gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
|
||||
gnc_plugin_update_actions(action_group,
|
||||
gnc_plugin_initially_insensitive_actions,
|
||||
"sensitive", FALSE);
|
||||
g_signal_connect(window, "page_changed",
|
||||
G_CALLBACK(gnc_plugin_basic_commands_main_window_page_changed),
|
||||
plugin);
|
||||
GSimpleActionGroup *simple_action_group =
|
||||
gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);
|
||||
|
||||
gnc_plugin_update_actionsb (simple_action_group,
|
||||
gnc_plugin_initially_insensitive_actions,
|
||||
"sensitive", FALSE);
|
||||
|
||||
g_signal_connect (window, "page_changed",
|
||||
G_CALLBACK(gnc_plugin_basic_commands_main_window_page_changed),
|
||||
plugin);
|
||||
}
|
||||
|
||||
/** Update the actions sensitivity
|
||||
*/
|
||||
static void update_inactive_actions (GncPluginPage *plugin_page)
|
||||
{
|
||||
GncMainWindow *window;
|
||||
GtkActionGroup *action_group;
|
||||
GncMainWindow *window;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
|
||||
// We are readonly - so we have to switch particular actions to inactive.
|
||||
gboolean is_readwrite = !qof_book_is_readonly(gnc_get_current_book());
|
||||
@ -348,13 +350,13 @@ static void update_inactive_actions (GncPluginPage *plugin_page)
|
||||
|
||||
window = GNC_MAIN_WINDOW(plugin_page->window);
|
||||
g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
|
||||
action_group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
|
||||
g_return_if_fail(GTK_IS_ACTION_GROUP(action_group));
|
||||
simple_action_group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
|
||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
||||
|
||||
/* Set the action's sensitivity */
|
||||
gnc_plugin_update_actions (action_group, readwrite_only_active_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, readwrite_only_active_actions,
|
||||
"sensitive", is_readwrite);
|
||||
gnc_plugin_update_actions (action_group, dirty_only_active_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, dirty_only_active_actions,
|
||||
"sensitive", is_dirty);
|
||||
}
|
||||
|
||||
|
@ -125,12 +125,12 @@ gnc_plugin_budget_new (void)
|
||||
static void
|
||||
page_changed (GncMainWindow *window, GncPluginPage *page, gpointer user_data)
|
||||
{
|
||||
GtkActionGroup *action_group =
|
||||
GSimpleActionGroup *simple_action_group =
|
||||
gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);
|
||||
//FIXMEb
|
||||
|
||||
if (qof_book_is_readonly (gnc_get_current_book()))
|
||||
gnc_plugin_update_actions (action_group, plugin_writeable_actions,
|
||||
"sensitive", FALSE);
|
||||
gnc_plugin_update_actionsb (simple_action_group, plugin_writeable_actions,
|
||||
"sensitive", FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -940,8 +940,8 @@ static const gchar *register_bus_txn_actions[] =
|
||||
static void
|
||||
gnc_plugin_business_update_menus (GncPluginPage *plugin_page)
|
||||
{
|
||||
GncMainWindow *window;
|
||||
GtkActionGroup *action_group;
|
||||
GncMainWindow *window;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
gboolean is_txn_register, is_bus_txn = FALSE, is_bus_doc = FALSE;
|
||||
|
||||
// We continue only if the current page is a plugin page
|
||||
@ -955,8 +955,8 @@ gnc_plugin_business_update_menus (GncPluginPage *plugin_page)
|
||||
is_txn_register = GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page);
|
||||
window = GNC_MAIN_WINDOW(plugin_page->window);
|
||||
g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
|
||||
action_group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
|
||||
g_return_if_fail(GTK_IS_ACTION_GROUP(action_group));
|
||||
simple_action_group = gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);
|
||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
||||
|
||||
if (is_txn_register)
|
||||
{
|
||||
@ -966,13 +966,13 @@ gnc_plugin_business_update_menus (GncPluginPage *plugin_page)
|
||||
is_bus_doc = (xaccTransGetTxnType (trans) == TXN_TYPE_INVOICE);
|
||||
}
|
||||
// Change visibility and also sensitivity according to whether we are in a txn register
|
||||
gnc_plugin_update_actions (action_group, register_txn_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, register_txn_actions,
|
||||
"sensitive", is_txn_register && !is_bus_txn && !is_bus_doc);
|
||||
gnc_plugin_update_actions (action_group, register_txn_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, register_txn_actions,
|
||||
"visible", is_txn_register && !is_bus_txn && !is_bus_doc);
|
||||
gnc_plugin_update_actions (action_group, register_bus_txn_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, register_bus_txn_actions,
|
||||
"sensitive", is_txn_register && is_bus_txn && !is_bus_doc);
|
||||
gnc_plugin_update_actions (action_group, register_bus_txn_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, register_bus_txn_actions,
|
||||
"visible", is_txn_register && is_bus_txn && !is_bus_doc);
|
||||
}
|
||||
|
||||
@ -1090,8 +1090,8 @@ static const gchar* readonly_inactive_actions[] =
|
||||
static void
|
||||
update_inactive_actions (GncPluginPage *plugin_page)
|
||||
{
|
||||
GncMainWindow *window;
|
||||
GtkActionGroup *action_group;
|
||||
GncMainWindow *window;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
|
||||
// We are readonly - so we have to switch particular actions to inactive.
|
||||
gboolean is_readwrite = !qof_book_is_readonly(gnc_get_current_book());
|
||||
@ -1106,12 +1106,12 @@ update_inactive_actions (GncPluginPage *plugin_page)
|
||||
|
||||
window = GNC_MAIN_WINDOW(plugin_page->window);
|
||||
g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
|
||||
action_group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
|
||||
g_return_if_fail(GTK_IS_ACTION_GROUP(action_group));
|
||||
simple_action_group = gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);
|
||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
||||
|
||||
/* Set the action's sensitivity */
|
||||
gnc_plugin_update_actions (action_group, readonly_inactive_actions,
|
||||
"sensitive", is_readwrite);
|
||||
gnc_plugin_update_actionsb (simple_action_group, readonly_inactive_actions,
|
||||
"sensitive", is_readwrite);
|
||||
}
|
||||
|
||||
/* This is the list of actions which are switched invisible or visible
|
||||
@ -1127,20 +1127,20 @@ static const char* extra_toolbar_actions[] =
|
||||
static void
|
||||
bind_toolbuttons_visibility (GncMainWindow *mainwindow)
|
||||
{
|
||||
GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
const char **iter;
|
||||
|
||||
g_return_if_fail(mainwindow);
|
||||
g_return_if_fail(GNC_IS_MAIN_WINDOW(mainwindow));
|
||||
|
||||
/* Get the action group */
|
||||
//FIXMEb action_group = gnc_main_window_get_action_group (mainwindow, PLUGIN_ACTIONS_NAME);
|
||||
// g_assert(action_group);
|
||||
simple_action_group = gnc_main_window_get_action_group (mainwindow, PLUGIN_ACTIONS_NAME);
|
||||
g_assert (simple_action_group);
|
||||
|
||||
// for (iter = extra_toolbar_actions; *iter; ++iter)
|
||||
//FIXMEb for (iter = extra_toolbar_actions; *iter; ++iter)
|
||||
// {
|
||||
/* Set the action's visibility */
|
||||
// GtkAction *action = gtk_action_group_get_action (action_group, *iter);
|
||||
// GAction *action = g_action_map_lookup_action (G_ACTION_MAP(simple_action_group), *iter);
|
||||
// gnc_prefs_bind (GNC_PREFS_GROUP_INVOICE, GNC_PREF_EXTRA_TOOLBUTTONS, G_OBJECT (action), "visible");
|
||||
// }
|
||||
}
|
||||
|
@ -465,7 +465,6 @@ gnc_plugin_page_account_tree_class_init (GncPluginPageAccountTreeClass *klass)
|
||||
static void
|
||||
gnc_plugin_page_account_tree_init (GncPluginPageAccountTree *plugin_page)
|
||||
{
|
||||
// GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
GncPluginPageAccountTreePrivate *priv;
|
||||
GncPluginPage *parent;
|
||||
@ -658,22 +657,22 @@ static void
|
||||
gnc_plugin_page_account_editing_started_cd (gpointer various, GncPluginPageRegister *page)
|
||||
{
|
||||
GncPluginPage *plugin_page = GNC_PLUGIN_PAGE(page);
|
||||
GtkAction *action = gnc_main_window_find_action (GNC_MAIN_WINDOW(plugin_page->window),
|
||||
GAction *action = gnc_main_window_find_action (GNC_MAIN_WINDOW(plugin_page->window),
|
||||
"EditDeleteAccountAction");
|
||||
|
||||
if (action != NULL)
|
||||
gtk_action_set_sensitive (action, FALSE);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_plugin_page_account_editing_finished_cb (gpointer various, GncPluginPageRegister *page)
|
||||
{
|
||||
GncPluginPage *plugin_page = GNC_PLUGIN_PAGE(page);
|
||||
GtkAction *action = gnc_main_window_find_action (GNC_MAIN_WINDOW(plugin_page->window),
|
||||
GAction *action = gnc_main_window_find_action (GNC_MAIN_WINDOW(plugin_page->window),
|
||||
"EditDeleteAccountAction");
|
||||
|
||||
if (action != NULL)
|
||||
gtk_action_set_sensitive (action, TRUE);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), TRUE);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
@ -840,7 +839,7 @@ gnc_plugin_page_account_tree_destroy_widget (GncPluginPage *plugin_page)
|
||||
static void update_inactive_actions(GncPluginPage *plugin_page)
|
||||
{
|
||||
GncPluginPageAccountTreePrivate *priv;
|
||||
GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
Account *account = NULL;
|
||||
gboolean allow_write = !qof_book_is_readonly(gnc_get_current_book());
|
||||
gboolean has_account = FALSE;
|
||||
@ -859,17 +858,17 @@ static void update_inactive_actions(GncPluginPage *plugin_page)
|
||||
}
|
||||
|
||||
/* Get the action group */
|
||||
action_group = gnc_plugin_page_get_action_group(plugin_page);
|
||||
g_return_if_fail(GTK_IS_ACTION_GROUP (action_group));
|
||||
simple_action_group = gnc_plugin_page_get_action_groupb (plugin_page);
|
||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP (simple_action_group));
|
||||
|
||||
/* Set the action's sensitivity */
|
||||
gnc_plugin_update_actions (action_group, readonly_inactive_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, readonly_inactive_actions,
|
||||
"sensitive", allow_write);
|
||||
gnc_plugin_update_actions (action_group, actions_requiring_account_rw,
|
||||
gnc_plugin_update_actionsb (simple_action_group, actions_requiring_account_rw,
|
||||
"sensitive", allow_write && has_account);
|
||||
gnc_plugin_update_actions (action_group, actions_requiring_account_always,
|
||||
gnc_plugin_update_actionsb (simple_action_group, actions_requiring_account_always,
|
||||
"sensitive", has_account);
|
||||
gnc_plugin_update_actions (action_group, actions_requiring_subaccounts_rw,
|
||||
gnc_plugin_update_actionsb (simple_action_group, actions_requiring_subaccounts_rw,
|
||||
"sensitive", allow_write && subaccounts);
|
||||
g_signal_emit (plugin_page, plugin_page_signals[ACCOUNT_SELECTED], 0, account);
|
||||
}
|
||||
|
@ -236,11 +236,8 @@ typedef enum allperiods_action
|
||||
|
||||
typedef struct GncPluginPageBudgetPrivate
|
||||
{
|
||||
GtkActionGroup *action_group;
|
||||
guint merge_id;
|
||||
GtkUIManager *ui_merge;
|
||||
GtkBuilder *builder;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
|
||||
GncBudgetView* budget_view;
|
||||
GtkTreeView *tree_view;
|
||||
@ -339,7 +336,6 @@ gnc_plugin_page_budget_class_init (GncPluginPageBudgetClass *klass)
|
||||
static void
|
||||
gnc_plugin_page_budget_init (GncPluginPageBudget *plugin_page)
|
||||
{
|
||||
// GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
GncPluginPageBudgetPrivate *priv;
|
||||
GncPluginPage *parent;
|
||||
@ -364,6 +360,7 @@ gnc_plugin_page_budget_init (GncPluginPageBudget *plugin_page)
|
||||
gnc_plugin_page_budget_actions,
|
||||
gnc_plugin_page_budget_n_actions,
|
||||
plugin_page);
|
||||
|
||||
//FIXMEb gnc_plugin_init_short_names (action_group, toolbar_labels);
|
||||
|
||||
if (qof_book_is_readonly (gnc_get_current_book()))
|
||||
@ -711,7 +708,7 @@ static void
|
||||
gppb_selection_changed_cb (GtkTreeSelection *selection,
|
||||
GncPluginPageBudget *page)
|
||||
{
|
||||
GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
GtkTreeView *view;
|
||||
GList *acct_list;
|
||||
gboolean sensitive;
|
||||
@ -732,8 +729,8 @@ gppb_selection_changed_cb (GtkTreeSelection *selection,
|
||||
g_list_free (acct_list);
|
||||
}
|
||||
|
||||
action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page));
|
||||
gnc_plugin_update_actions (action_group, actions_requiring_account,
|
||||
simple_action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page));
|
||||
gnc_plugin_update_actionsb (simple_action_group, actions_requiring_account,
|
||||
"sensitive", sensitive);
|
||||
}
|
||||
#endif
|
||||
|
@ -553,7 +553,6 @@ static void
|
||||
gnc_plugin_page_invoice_init (GncPluginPageInvoice *plugin_page)
|
||||
{
|
||||
GncPluginPage *parent;
|
||||
// GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
gboolean use_new;
|
||||
|
||||
@ -599,25 +598,25 @@ gnc_plugin_page_invoice_finalize (GObject *object)
|
||||
static void
|
||||
update_doclink_actions (GncPluginPage *plugin_page, gboolean has_uri)
|
||||
{
|
||||
GtkAction *uri_action;
|
||||
GAction *uri_action;
|
||||
|
||||
uri_action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(plugin_page), "BusinessLinkOpenAction");
|
||||
gtk_action_set_sensitive (uri_action, has_uri);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(uri_action), has_uri);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_plugin_page_invoice_action_update (GtkActionGroup *action_group,
|
||||
gnc_plugin_page_invoice_action_update (GSimpleActionGroup *simple_action_group,
|
||||
action_toolbar_labels *action_list,
|
||||
void (*gtkfunc)(gpointer, gpointer))
|
||||
{
|
||||
GtkAction *action;
|
||||
GAction *action;
|
||||
gint i;
|
||||
|
||||
for (i = 0; action_list[i].action_name; i++)
|
||||
{
|
||||
/* update the action */
|
||||
action = gtk_action_group_get_action (action_group,
|
||||
action_list[i].action_name);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP(simple_action_group),
|
||||
action_list[i].action_name);
|
||||
gtkfunc (action, _(action_list[i].label));
|
||||
}
|
||||
}
|
||||
@ -626,7 +625,7 @@ static void
|
||||
gnc_plugin_page_update_reset_layout_action (GncPluginPage *page)
|
||||
{
|
||||
GncPluginPageInvoicePrivate *priv;
|
||||
GtkAction *layout_action;
|
||||
GAction *layout_action;
|
||||
gboolean has_default = FALSE;
|
||||
|
||||
g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(page));
|
||||
@ -636,13 +635,13 @@ gnc_plugin_page_update_reset_layout_action (GncPluginPage *page)
|
||||
layout_action = gnc_plugin_page_get_action (page, "ViewResetLayoutAction");
|
||||
if (gnc_invoice_window_document_has_user_state (priv->iw))
|
||||
has_default = TRUE;
|
||||
gtk_action_set_sensitive (layout_action, has_default);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(layout_action), has_default);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_plugin_page_invoice_update_menus (GncPluginPage *page, gboolean is_posted, gboolean can_unpost)
|
||||
{
|
||||
GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
GncPluginPageInvoicePrivate *priv;
|
||||
GncInvoiceType invoice_type;
|
||||
GncInvoice *invoice;
|
||||
@ -713,28 +712,28 @@ gnc_plugin_page_invoice_update_menus (GncPluginPage *page, gboolean is_posted, g
|
||||
can_unpost = FALSE;
|
||||
}
|
||||
|
||||
action_group = gnc_plugin_page_get_action_group(page);
|
||||
gnc_plugin_update_actions (action_group, posted_actions,
|
||||
simple_action_group = gnc_plugin_page_get_action_groupb (page);
|
||||
gnc_plugin_update_actionsb (simple_action_group, posted_actions,
|
||||
"sensitive", is_posted);
|
||||
gnc_plugin_update_actions (action_group, unposted_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, unposted_actions,
|
||||
"sensitive", !is_posted);
|
||||
gnc_plugin_update_actions (action_group, can_unpost_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, can_unpost_actions,
|
||||
"sensitive", can_unpost);
|
||||
gnc_plugin_update_actions (action_group, invoice_book_readwrite_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, invoice_book_readwrite_actions,
|
||||
"sensitive", !is_readonly);
|
||||
|
||||
/* update the action labels */
|
||||
gnc_plugin_page_invoice_action_update (action_group, label_list, (void*)gtk_action_set_label);
|
||||
gnc_plugin_page_invoice_action_update (simple_action_group, label_list, (void*)gtk_action_set_label);
|
||||
/* update the action tooltips */
|
||||
gnc_plugin_page_invoice_action_update (action_group, tooltip_list, (void*)gtk_action_set_tooltip);
|
||||
gnc_plugin_page_invoice_action_update (simple_action_group, tooltip_list, (void*)gtk_action_set_tooltip);
|
||||
|
||||
// if there is no default layout do not enable reset action
|
||||
gnc_plugin_page_update_reset_layout_action (page);
|
||||
|
||||
/* update the layout action labels */
|
||||
gnc_plugin_page_invoice_action_update (action_group, label_layout_list, (void*)gtk_action_set_label);
|
||||
gnc_plugin_page_invoice_action_update (simple_action_group, label_layout_list, (void*)gtk_action_set_label);
|
||||
/* update the layout action tooltips */
|
||||
gnc_plugin_page_invoice_action_update (action_group, tooltip_layout_list, (void*)gtk_action_set_tooltip);
|
||||
gnc_plugin_page_invoice_action_update (simple_action_group, tooltip_layout_list, (void*)gtk_action_set_tooltip);
|
||||
|
||||
// update doclink buttons
|
||||
invoice = gnc_invoice_window_get_invoice (priv->iw);
|
||||
@ -1171,7 +1170,7 @@ gnc_plugin_page_invoice_cmd_sort_changed (GSimpleAction *simple,
|
||||
GncPluginPageInvoicePrivate *priv;
|
||||
invoice_sort_type_t value;
|
||||
|
||||
g_return_if_fail(GTK_IS_ACTION(simple));
|
||||
g_return_if_fail(G_IS_SIMPLE_ACTION(simple));
|
||||
g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
|
||||
|
||||
ENTER("action %p, plugin_page %p)", simple, plugin_page);
|
||||
@ -1335,7 +1334,7 @@ gnc_plugin_page_invoice_cmd_save_layout (GSimpleAction *simple,
|
||||
GncPluginPageInvoice *plugin_page = user_data;
|
||||
GncPluginPageInvoicePrivate *priv;
|
||||
GtkWindow *parent;
|
||||
GtkAction *layout_action;
|
||||
GAction *layout_action;
|
||||
|
||||
g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
|
||||
|
||||
@ -1345,7 +1344,7 @@ gnc_plugin_page_invoice_cmd_save_layout (GSimpleAction *simple,
|
||||
|
||||
layout_action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(plugin_page),
|
||||
"ViewResetLayoutAction");
|
||||
gtk_action_set_sensitive (layout_action, TRUE);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(layout_action), TRUE);
|
||||
|
||||
LEAVE(" ");
|
||||
}
|
||||
@ -1358,7 +1357,7 @@ gnc_plugin_page_invoice_cmd_reset_layout (GSimpleAction *simple,
|
||||
GncPluginPageInvoice *plugin_page = user_data;
|
||||
GncPluginPageInvoicePrivate *priv;
|
||||
GtkWindow *parent;
|
||||
GtkAction *layout_action;
|
||||
GAction *layout_action;
|
||||
|
||||
g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
|
||||
|
||||
@ -1368,7 +1367,7 @@ gnc_plugin_page_invoice_cmd_reset_layout (GSimpleAction *simple,
|
||||
|
||||
layout_action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(plugin_page),
|
||||
"ViewResetLayoutAction");
|
||||
gtk_action_set_sensitive (layout_action, FALSE);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(layout_action), FALSE);
|
||||
|
||||
LEAVE(" ");
|
||||
}
|
||||
@ -1381,7 +1380,6 @@ gnc_plugin_page_invoice_cmd_link (GSimpleAction *simple,
|
||||
GncPluginPageInvoice *plugin_page = user_data;
|
||||
GncPluginPageInvoicePrivate *priv;
|
||||
GtkWindow *parent;
|
||||
GtkAction *uri_action;
|
||||
GncInvoice *invoice;
|
||||
const gchar *uri;
|
||||
gchar *ret_uri;
|
||||
@ -1440,7 +1438,6 @@ gnc_plugin_page_invoice_cmd_link_remove (GSimpleAction *simple,
|
||||
GncPluginPageInvoice *plugin_page = user_data;
|
||||
GncPluginPageInvoicePrivate *priv;
|
||||
GtkWindow *parent;
|
||||
GtkAction *uri_action;
|
||||
GncInvoice *invoice;
|
||||
GtkWidget *doclink_button;
|
||||
|
||||
|
@ -339,13 +339,11 @@ GncPluginPage *
|
||||
gnc_plugin_page_owner_tree_new (GncOwnerType owner_type)
|
||||
{
|
||||
GncPluginPageOwnerTree *plugin_page;
|
||||
|
||||
GncPluginPageOwnerTreePrivate *priv;
|
||||
const GList *item;
|
||||
|
||||
GtkActionGroup *action_group;
|
||||
GtkAction *action;
|
||||
gint i;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
GAction *action;
|
||||
gint i;
|
||||
|
||||
g_return_val_if_fail( (owner_type != GNC_OWNER_UNDEFINED)
|
||||
&& (owner_type != GNC_OWNER_NONE), NULL);
|
||||
@ -370,13 +368,14 @@ gnc_plugin_page_owner_tree_new (GncOwnerType owner_type)
|
||||
priv->owner_type = owner_type;
|
||||
|
||||
/* Hide menu and toolbar items that are not relevant for the active owner list */
|
||||
action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(plugin_page));
|
||||
simple_action_group = gnc_plugin_page_get_action_groupb (GNC_PLUGIN_PAGE(plugin_page));
|
||||
for (i = 0; action_owners[i].action_name; i++)
|
||||
{
|
||||
action = gtk_action_group_get_action (action_group, action_owners[i].action_name);
|
||||
g_object_set (G_OBJECT(action),
|
||||
"visible", (priv->owner_type == action_owners[i].owner_type),
|
||||
NULL);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP(simple_action_group),
|
||||
action_owners[i].action_name);
|
||||
//FIXMEb g_object_set (G_OBJECT(action),
|
||||
// "visible", (priv->owner_type == action_owners[i].owner_type),
|
||||
// NULL);
|
||||
}
|
||||
|
||||
LEAVE("new %s tree page %p", gncOwnerTypeToQofIdType(owner_type), plugin_page);
|
||||
@ -436,7 +435,6 @@ gnc_plugin_page_owner_tree_class_init (GncPluginPageOwnerTreeClass *klass)
|
||||
static void
|
||||
gnc_plugin_page_owner_tree_init (GncPluginPageOwnerTree *plugin_page)
|
||||
{
|
||||
// GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
GncPluginPageOwnerTreePrivate *priv;
|
||||
GncPluginPage *parent;
|
||||
@ -492,7 +490,7 @@ gnc_plugin_page_owner_tree_finalize (GObject *object)
|
||||
|
||||
static void update_inactive_actions(GncPluginPage *plugin_page)
|
||||
{
|
||||
GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
gboolean is_sensitive = !qof_book_is_readonly(gnc_get_current_book());
|
||||
|
||||
// We are readonly - so we have to switch particular actions to inactive.
|
||||
@ -500,11 +498,11 @@ static void update_inactive_actions(GncPluginPage *plugin_page)
|
||||
g_return_if_fail(GNC_IS_PLUGIN_PAGE(plugin_page));
|
||||
|
||||
/* Get the action group */
|
||||
action_group = gnc_plugin_page_get_action_group(plugin_page);
|
||||
g_return_if_fail(GTK_IS_ACTION_GROUP (action_group));
|
||||
simple_action_group = gnc_plugin_page_get_action_groupb (plugin_page);
|
||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP (simple_action_group));
|
||||
|
||||
/* Set the action's sensitivity */
|
||||
gnc_plugin_update_actions (action_group, readonly_inactive_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, readonly_inactive_actions,
|
||||
"sensitive", is_sensitive);
|
||||
}
|
||||
|
||||
@ -873,7 +871,7 @@ static void
|
||||
gnc_plugin_page_owner_tree_selection_changed_cb (GtkTreeSelection *selection,
|
||||
GncPluginPageOwnerTree *page)
|
||||
{
|
||||
GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
GtkTreeView *view;
|
||||
GncOwner *owner = NULL;
|
||||
gboolean sensitive;
|
||||
@ -893,10 +891,10 @@ gnc_plugin_page_owner_tree_selection_changed_cb (GtkTreeSelection *selection,
|
||||
sensitive = (owner != NULL);
|
||||
}
|
||||
|
||||
action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(page));
|
||||
gnc_plugin_update_actions (action_group, actions_requiring_owner_always,
|
||||
simple_action_group = gnc_plugin_page_get_action_groupb (GNC_PLUGIN_PAGE(page));
|
||||
gnc_plugin_update_actionsb (simple_action_group, actions_requiring_owner_always,
|
||||
"sensitive", sensitive);
|
||||
gnc_plugin_update_actions (action_group, actions_requiring_owner_rw,
|
||||
gnc_plugin_update_actionsb (simple_action_group, actions_requiring_owner_rw,
|
||||
"sensitive", sensitive && is_readwrite);
|
||||
g_signal_emit (page, plugin_page_signals[OWNER_SELECTED], 0, owner);
|
||||
}
|
||||
|
@ -812,7 +812,6 @@ gnc_plugin_page_register_init (GncPluginPageRegister* plugin_page)
|
||||
{
|
||||
GncPluginPageRegisterPrivate* priv;
|
||||
GncPluginPage* parent;
|
||||
// GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
gboolean use_new;
|
||||
|
||||
@ -1006,7 +1005,7 @@ gnc_plugin_page_register_ui_update (gpointer various,
|
||||
{
|
||||
GncPluginPageRegisterPrivate* priv;
|
||||
SplitRegister* reg;
|
||||
GtkAction* action;
|
||||
GAction* action;
|
||||
gboolean expanded, voided, read_only = FALSE, read_only_reg = FALSE;
|
||||
Transaction* trans;
|
||||
GList* invoices;
|
||||
@ -1020,12 +1019,10 @@ gnc_plugin_page_register_ui_update (gpointer various,
|
||||
expanded = gnc_split_register_current_trans_expanded (reg);
|
||||
action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page),
|
||||
"SplitTransactionAction");
|
||||
gtk_action_set_sensitive (action, reg->style == REG_STYLE_LEDGER);
|
||||
g_signal_handlers_block_by_func
|
||||
(action, gnc_plugin_page_register_cmd_expand_transaction, page);
|
||||
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), expanded);
|
||||
g_signal_handlers_unblock_by_func
|
||||
(action, gnc_plugin_page_register_cmd_expand_transaction, page);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), reg->style == REG_STYLE_LEDGER);
|
||||
g_signal_handlers_block_by_func (action, gnc_plugin_page_register_cmd_expand_transaction, page);
|
||||
//FIXMEb gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), expanded);
|
||||
g_signal_handlers_unblock_by_func (action, gnc_plugin_page_register_cmd_expand_transaction, page);
|
||||
|
||||
/* If we are in a readonly book, or possibly a place holder
|
||||
* account register make any modifying action inactive */
|
||||
@ -1044,8 +1041,8 @@ gnc_plugin_page_register_ui_update (gpointer various,
|
||||
for (iter = readonly_inactive_actions; *iter; ++iter)
|
||||
{
|
||||
/* Set the action's sensitivity */
|
||||
GtkAction* action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), *iter);
|
||||
gtk_action_set_sensitive (action, TRUE);
|
||||
GAction* action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), *iter);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), TRUE);
|
||||
}
|
||||
main_window_update_page_set_read_only_icon (GNC_PLUGIN_PAGE(page), FALSE);
|
||||
|
||||
@ -1056,26 +1053,26 @@ gnc_plugin_page_register_ui_update (gpointer various,
|
||||
|
||||
action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page),
|
||||
"CutTransactionAction");
|
||||
gtk_action_set_sensitive (GTK_ACTION (action), !read_only & !voided);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !read_only & !voided);
|
||||
|
||||
action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page),
|
||||
"PasteTransactionAction");
|
||||
gtk_action_set_sensitive (GTK_ACTION (action), !read_only & !voided);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !read_only & !voided);
|
||||
|
||||
action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page),
|
||||
"DeleteTransactionAction");
|
||||
gtk_action_set_sensitive (GTK_ACTION (action), !read_only & !voided);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !read_only & !voided);
|
||||
|
||||
if (cursor_class == CURSOR_CLASS_SPLIT)
|
||||
{
|
||||
action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page),
|
||||
"DuplicateTransactionAction");
|
||||
gtk_action_set_sensitive (GTK_ACTION (action), !read_only & !voided);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !read_only & !voided);
|
||||
}
|
||||
|
||||
action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page),
|
||||
"RemoveTransactionSplitsAction");
|
||||
gtk_action_set_sensitive (GTK_ACTION (action), !read_only & !voided);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !read_only & !voided);
|
||||
|
||||
/* Set 'Void' and 'Unvoid' */
|
||||
if (read_only)
|
||||
@ -1083,14 +1080,14 @@ gnc_plugin_page_register_ui_update (gpointer various,
|
||||
|
||||
action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page),
|
||||
"VoidTransactionAction");
|
||||
gtk_action_set_sensitive (GTK_ACTION (action), !voided);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !voided);
|
||||
|
||||
if (read_only)
|
||||
voided = FALSE;
|
||||
|
||||
action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page),
|
||||
"UnvoidTransactionAction");
|
||||
gtk_action_set_sensitive (GTK_ACTION (action), voided);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), voided);
|
||||
}
|
||||
|
||||
/* Set 'Open and Remove Linked Documents' */
|
||||
@ -1099,7 +1096,7 @@ gnc_plugin_page_register_ui_update (gpointer various,
|
||||
if (trans)
|
||||
{
|
||||
uri = xaccTransGetDocLink (trans);
|
||||
gtk_action_set_sensitive (GTK_ACTION(action), (uri ? TRUE:FALSE));
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), (uri ? TRUE:FALSE));
|
||||
}
|
||||
/* Set 'ExecAssociatedInvoice'
|
||||
We can determine an invoice from a txn if either
|
||||
@ -1111,7 +1108,7 @@ gnc_plugin_page_register_ui_update (gpointer various,
|
||||
if (trans)
|
||||
{
|
||||
invoices = invoices_from_transaction (trans);
|
||||
gtk_action_set_sensitive (GTK_ACTION (action), (invoices != NULL));
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), (invoices != NULL));
|
||||
g_list_free (invoices);
|
||||
}
|
||||
|
||||
@ -1124,8 +1121,8 @@ gnc_plugin_page_register_ui_update (gpointer various,
|
||||
for (iter = readonly_inactive_actions; *iter; ++iter)
|
||||
{
|
||||
/* Set the action's sensitivity */
|
||||
GtkAction* action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), *iter);
|
||||
gtk_action_set_sensitive (action, FALSE);
|
||||
GAction* action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), *iter);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
|
||||
}
|
||||
main_window_update_page_set_read_only_icon (GNC_PLUGIN_PAGE(page), TRUE);
|
||||
}
|
||||
@ -1137,8 +1134,8 @@ gnc_plugin_page_register_ui_update (gpointer various,
|
||||
iter = tran_vs_split_actions;
|
||||
action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), *iter);
|
||||
label_iter = tran_action_labels;
|
||||
if (g_strcmp0 (gtk_action_get_label (action), _ (*label_iter)) == 0)
|
||||
curr_label_trans = TRUE;
|
||||
//FIXMEb if (g_strcmp0 (gtk_action_get_label (action), _ (*label_iter)) == 0)
|
||||
// curr_label_trans = TRUE;
|
||||
if ((cursor_class == CURSOR_CLASS_SPLIT) && curr_label_trans)
|
||||
{
|
||||
label_iter = split_action_labels;
|
||||
@ -1147,8 +1144,8 @@ gnc_plugin_page_register_ui_update (gpointer various,
|
||||
{
|
||||
/* Adjust the action's label and tooltip */
|
||||
action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), *iter);
|
||||
gtk_action_set_label (action, _ (*label_iter));
|
||||
gtk_action_set_tooltip (action, _ (*tooltip_iter));
|
||||
//FIXMEb gtk_action_set_label (action, _ (*label_iter));
|
||||
//FIXMEb gtk_action_set_tooltip (action, _ (*tooltip_iter));
|
||||
++label_iter;
|
||||
++tooltip_iter;
|
||||
}
|
||||
@ -1161,8 +1158,8 @@ gnc_plugin_page_register_ui_update (gpointer various,
|
||||
{
|
||||
/* Adjust the action's label and tooltip */
|
||||
action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), *iter);
|
||||
gtk_action_set_label (action, _ (*label_iter));
|
||||
gtk_action_set_tooltip (action, _ (*tooltip_iter));
|
||||
//FIXMEb gtk_action_set_label (action, _ (*label_iter));
|
||||
//FIXMEb gtk_action_set_tooltip (action, _ (*tooltip_iter));
|
||||
++label_iter;
|
||||
++tooltip_iter;
|
||||
}
|
||||
@ -1174,8 +1171,8 @@ static void
|
||||
gnc_plugin_page_register_ui_initial_state (GncPluginPageRegister* page)
|
||||
{
|
||||
GncPluginPageRegisterPrivate* priv ;
|
||||
GtkActionGroup* action_group;
|
||||
GtkAction* action;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
GAction *action;
|
||||
Account* account;
|
||||
SplitRegister* reg;
|
||||
GNCLedgerDisplayType ledger_type;
|
||||
@ -1184,18 +1181,18 @@ gnc_plugin_page_register_ui_initial_state (GncPluginPageRegister* page)
|
||||
|
||||
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
|
||||
account = gnc_plugin_page_register_get_account (page);
|
||||
action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE (page));
|
||||
gnc_plugin_update_actions (action_group, actions_requiring_account,
|
||||
simple_action_group = gnc_plugin_page_get_action_groupb (GNC_PLUGIN_PAGE (page));
|
||||
gnc_plugin_update_actionsb (simple_action_group, actions_requiring_account,
|
||||
"sensitive", is_readwrite && account != NULL);
|
||||
|
||||
gnc_plugin_update_actions (action_group, actions_requiring_priced_account,
|
||||
gnc_plugin_update_actionsb (simple_action_group, actions_requiring_priced_account,
|
||||
"visible", account &&
|
||||
gnc_prefs_is_extra_enabled () &&
|
||||
xaccAccountIsPriced (account));
|
||||
|
||||
/* Set "style" radio button */
|
||||
ledger_type = gnc_ledger_display_type (priv->ledger);
|
||||
gnc_plugin_update_actions (action_group, view_style_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, view_style_actions,
|
||||
"sensitive", ledger_type == LD_SINGLE);
|
||||
|
||||
reg = gnc_ledger_display_get_split_register (priv->ledger);
|
||||
@ -1211,20 +1208,19 @@ gnc_plugin_page_register_ui_initial_state (GncPluginPageRegister* page)
|
||||
// }
|
||||
|
||||
/* Either a match was found, or fell out with i = 0 */
|
||||
// action = gtk_action_group_get_action (action_group, radio_entries_2[i].name);
|
||||
//FIXMEb action = g_action_map_lookup_action (G_ACTION_MAP(simple_action_group), radio_entries_2[i].name);
|
||||
// g_signal_handlers_block_by_func (action,
|
||||
// gnc_plugin_page_register_cmd_style_changed, page);
|
||||
// gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
|
||||
//FIXMEb gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
|
||||
// g_signal_handlers_unblock_by_func (action,
|
||||
// gnc_plugin_page_register_cmd_style_changed, page);
|
||||
|
||||
/* Set "double line" toggle button */
|
||||
action = gtk_action_group_get_action (action_group,
|
||||
"ViewStyleDoubleLineAction");
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP(simple_action_group), "ViewStyleDoubleLineAction");
|
||||
g_signal_handlers_block_by_func (action,
|
||||
gnc_plugin_page_register_cmd_style_double_line, page);
|
||||
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
|
||||
reg->use_double_line);
|
||||
//FIXMEb gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
|
||||
// reg->use_double_line);
|
||||
g_signal_handlers_unblock_by_func (action,
|
||||
gnc_plugin_page_register_cmd_style_double_line, page);
|
||||
}
|
||||
@ -1701,7 +1697,7 @@ gnc_plugin_page_register_restore_edit_menu (GncPluginPage* page,
|
||||
GKeyFile* key_file,
|
||||
const gchar* group_name)
|
||||
{
|
||||
GtkAction* action;
|
||||
GAction* action;
|
||||
GError* error = NULL;
|
||||
gchar* style_name;
|
||||
gint i;
|
||||
@ -1848,7 +1844,7 @@ gnc_plugin_page_register_update_edit_menu (GncPluginPage* page, gboolean hide)
|
||||
{
|
||||
GncPluginPageRegisterPrivate* priv;
|
||||
GncPluginPageRegister* reg_page;
|
||||
GtkAction* action;
|
||||
GAction* action;
|
||||
gboolean can_copy = FALSE, can_cut = FALSE, can_paste = FALSE;
|
||||
gboolean has_selection;
|
||||
gboolean is_readwrite = !qof_book_is_readonly (gnc_get_current_book());
|
||||
@ -1862,14 +1858,14 @@ gnc_plugin_page_register_update_edit_menu (GncPluginPage* page, gboolean hide)
|
||||
can_paste = is_readwrite;
|
||||
|
||||
action = gnc_plugin_page_get_action (page, "EditCopyAction");
|
||||
gtk_action_set_sensitive (action, can_copy);
|
||||
gtk_action_set_visible (action, !hide || can_copy);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), can_copy);
|
||||
//FIXMEb gtk_action_set_visible (action, !hide || can_copy);
|
||||
action = gnc_plugin_page_get_action (page, "EditCutAction");
|
||||
gtk_action_set_sensitive (action, can_cut);
|
||||
gtk_action_set_visible (action, !hide || can_cut);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), can_cut);
|
||||
//FIXMEb gtk_action_set_visible (action, !hide || can_cut);
|
||||
action = gnc_plugin_page_get_action (page, "EditPasteAction");
|
||||
gtk_action_set_sensitive (action, can_paste);
|
||||
gtk_action_set_visible (action, !hide || can_paste);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), can_paste);
|
||||
//FIXMEb gtk_action_set_visible (action, !hide || can_paste);
|
||||
}
|
||||
|
||||
static gboolean is_scrubbing = FALSE;
|
||||
|
@ -433,7 +433,7 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
|
||||
GncPluginPageReport *report;
|
||||
GncPluginPageReportPrivate *priv;
|
||||
GtkWindow *topLvl;
|
||||
GtkAction *action;
|
||||
GAction *action;
|
||||
GtkWidget *webview;
|
||||
URLType type;
|
||||
char * id_name;
|
||||
@ -446,8 +446,8 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
|
||||
#ifndef WEBKIT1
|
||||
/* Hide the ExportPdf action for Webkit2 */
|
||||
action = gnc_plugin_page_get_action (page, "FilePrintPDFAction");
|
||||
gtk_action_set_sensitive (action, FALSE);
|
||||
gtk_action_set_visible (action, FALSE);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
|
||||
//FIXMEb gtk_action_set_visible (action, FALSE);
|
||||
#endif
|
||||
|
||||
report = GNC_PLUGIN_PAGE_REPORT(page);
|
||||
@ -580,10 +580,9 @@ gnc_plugin_page_report_setup( GncPluginPage *ppage )
|
||||
* called after a report is loaded into the gnc_html widget
|
||||
********************************************************************/
|
||||
static void
|
||||
//gnc_plugin_page_report_load_cb(gnc_html * html, URLType type,
|
||||
gnc_plugin_page_report_load_cb(GncHtml * html, URLType type,
|
||||
const gchar * location, const gchar * label,
|
||||
gpointer data)
|
||||
gnc_plugin_page_report_load_cb (GncHtml * html, URLType type,
|
||||
const gchar * location, const gchar * label,
|
||||
gpointer data)
|
||||
{
|
||||
GncPluginPageReport *report = GNC_PLUGIN_PAGE_REPORT(data);
|
||||
GncPluginPageReportPrivate *priv;
|
||||
@ -1055,17 +1054,17 @@ gnc_plugin_page_report_name_changed (GncPluginPage *page, const gchar *name)
|
||||
static void
|
||||
gnc_plugin_page_report_update_edit_menu (GncPluginPage *page, gboolean hide)
|
||||
{
|
||||
GtkAction *action;
|
||||
GAction *action;
|
||||
|
||||
action = gnc_plugin_page_get_action (page, "EditCopyAction");
|
||||
gtk_action_set_sensitive (action, TRUE);
|
||||
gtk_action_set_visible (action, TRUE);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), TRUE);
|
||||
//FIXMEb gtk_action_set_visible (action, TRUE);
|
||||
action = gnc_plugin_page_get_action (page, "EditCutAction");
|
||||
gtk_action_set_sensitive (action, FALSE);
|
||||
gtk_action_set_visible (action, !hide);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
|
||||
//FIXMEb gtk_action_set_visible (action, !hide);
|
||||
action = gnc_plugin_page_get_action (page, "EditPasteAction");
|
||||
gtk_action_set_sensitive (action, FALSE);
|
||||
gtk_action_set_visible (action, !hide);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
|
||||
//FIXMEb gtk_action_set_visible (action, !hide);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -1209,7 +1208,7 @@ gnc_plugin_page_report_constr_init(GncPluginPageReport *plugin_page, gint report
|
||||
{ "ReportReloadAction", gnc_plugin_page_report_reload_cb, nullptr, nullptr, nullptr },
|
||||
{ "ReportStopAction", gnc_plugin_page_report_stop_cb, nullptr, nullptr, nullptr },
|
||||
};
|
||||
guint num_report_actions = G_N_ELEMENTS( report_actions );
|
||||
guint num_report_actions = G_N_ELEMENTS(report_actions);
|
||||
|
||||
static GncDisplayItem report_display_items [] =
|
||||
{
|
||||
@ -1273,26 +1272,26 @@ gnc_plugin_page_report_constr_init(GncPluginPageReport *plugin_page, gint report
|
||||
/** The number of display items provided by this plugin. */
|
||||
guint num_report_display_items = G_N_ELEMENTS(report_display_items);
|
||||
|
||||
DEBUG( "property reportId=%d", reportId );
|
||||
DEBUG("property reportId=%d", reportId);
|
||||
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(plugin_page);
|
||||
priv->reportId = reportId;
|
||||
|
||||
gnc_plugin_page_report_setup( GNC_PLUGIN_PAGE(plugin_page) );
|
||||
gnc_plugin_page_report_setup( GNC_PLUGIN_PAGE(plugin_page));
|
||||
|
||||
/* Init parent declared variables */
|
||||
parent = GNC_PLUGIN_PAGE(plugin_page);
|
||||
use_new = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REPORT, GNC_PREF_USE_NEW);
|
||||
name = gnc_report_name( priv->initial_report );
|
||||
g_object_set(G_OBJECT(plugin_page),
|
||||
"page-name", name,
|
||||
"page-uri", "default:",
|
||||
"ui-description", "gnc-plugin-page-report.ui",
|
||||
"use-new-window", use_new,
|
||||
nullptr);
|
||||
g_free(name);
|
||||
name = gnc_report_name (priv->initial_report);
|
||||
g_object_set (G_OBJECT(plugin_page),
|
||||
"page-name", name,
|
||||
"page-uri", "default:",
|
||||
"ui-description", "gnc-plugin-page-report.ui",
|
||||
"use-new-window", use_new,
|
||||
nullptr);
|
||||
g_free (name);
|
||||
|
||||
/* change me when the system supports multiple books */
|
||||
gnc_plugin_page_add_book(parent, gnc_get_current_book());
|
||||
gnc_plugin_page_add_book (parent, gnc_get_current_book());
|
||||
|
||||
/* Create menu and toolbar information */
|
||||
simple_action_group = gnc_plugin_page_create_action_groupb (parent, "GncPluginPageReportActions");
|
||||
@ -1309,9 +1308,8 @@ gnc_plugin_page_report_constr_init(GncPluginPageReport *plugin_page, gint report
|
||||
// num_report_actions,
|
||||
// plugin_page );
|
||||
|
||||
//FIXMEb gnc_plugin_update_actions(action_group,
|
||||
// initially_insensitive_actions,
|
||||
// "sensitive", FALSE);
|
||||
gnc_plugin_update_actionsb (simple_action_group, initially_insensitive_actions,
|
||||
"sensitive", FALSE);
|
||||
|
||||
//FIXMEb gnc_plugin_init_short_names (action_group, toolbar_labels);
|
||||
|
||||
@ -1375,23 +1373,21 @@ close_handler (gpointer user_data)
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_plugin_page_report_set_fwd_button(GncPluginPageReport *report, int enabled)
|
||||
gnc_plugin_page_report_set_fwd_button (GncPluginPageReport *report, int enabled)
|
||||
{
|
||||
GtkAction *act;
|
||||
GAction *act;
|
||||
|
||||
act = gnc_plugin_page_get_action(GNC_PLUGIN_PAGE(report),
|
||||
"ReportForwAction" );
|
||||
gtk_action_set_sensitive(act, enabled);
|
||||
act = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(report), "ReportForwAction");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(act), enabled);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_plugin_page_report_set_back_button(GncPluginPageReport *report, int enabled)
|
||||
gnc_plugin_page_report_set_back_button (GncPluginPageReport *report, int enabled)
|
||||
{
|
||||
GtkAction *act;
|
||||
GAction *act;
|
||||
|
||||
act = gnc_plugin_page_get_action(GNC_PLUGIN_PAGE(report),
|
||||
"ReportBackAction" );
|
||||
gtk_action_set_sensitive(act, enabled);
|
||||
act = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(report), "ReportBackAction");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(act), enabled);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
@ -1779,10 +1775,10 @@ gnc_plugin_page_report_export_cb (GSimpleAction *simple,
|
||||
g_free (str);
|
||||
}
|
||||
else
|
||||
gnc_error_dialog (parent, "%s",
|
||||
_("This report must be upgraded to return a "
|
||||
"document object with export-string or "
|
||||
"export-error."));
|
||||
gnc_error_dialog (parent, "%s",
|
||||
_("This report must be upgraded to return a "
|
||||
"document object with export-string or "
|
||||
"export-error."));
|
||||
}
|
||||
result = TRUE;
|
||||
}
|
||||
@ -1991,9 +1987,9 @@ gnc_plugin_page_report_print_cb (GSimpleAction *simple,
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_plugin_page_report_exportpdf_cb(GSimpleAction *simple,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
gnc_plugin_page_report_exportpdf_cb (GSimpleAction *simple,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
GncPluginPageReport *report = (GncPluginPageReport*)user_data;
|
||||
GncPluginPageReportPrivate *priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
|
||||
@ -2009,19 +2005,19 @@ gnc_plugin_page_report_exportpdf_cb(GSimpleAction *simple,
|
||||
owner = (GncOwner*) gncInvoiceGetOwner(invoice);
|
||||
if (owner)
|
||||
{
|
||||
QofInstance *inst = qofOwnerGetOwner (owner);
|
||||
gchar *dirname = nullptr;
|
||||
qof_instance_get (inst, "export-pdf-dir", &dirname, nullptr);
|
||||
QofInstance *inst = qofOwnerGetOwner (owner);
|
||||
gchar *dirname = nullptr;
|
||||
qof_instance_get (inst, "export-pdf-dir", &dirname, nullptr);
|
||||
// Yes. In the kvp, look up the key for the Export-PDF output
|
||||
// directory. If it exists, prepend this to the job name so that
|
||||
// we can export to PDF.
|
||||
if (dirname && g_file_test(dirname,
|
||||
if (dirname && g_file_test (dirname,
|
||||
(GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
|
||||
{
|
||||
gchar *tmp = g_build_filename(dirname, job_name, nullptr);
|
||||
g_free(job_name);
|
||||
job_name = tmp;
|
||||
}
|
||||
{
|
||||
gchar *tmp = g_build_filename (dirname, job_name, nullptr);
|
||||
g_free (job_name);
|
||||
job_name = tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2035,29 +2031,27 @@ gnc_plugin_page_report_exportpdf_cb(GSimpleAction *simple,
|
||||
|
||||
if (owner)
|
||||
{
|
||||
/* As this is an invoice report with some owner, we will try
|
||||
* to look up the chosen output directory from the print
|
||||
* settings and store it again in the owner kvp.
|
||||
*/
|
||||
/* As this is an invoice report with some owner, we will try
|
||||
* to look up the chosen output directory from the print
|
||||
* settings and store it again in the owner kvp.
|
||||
*/
|
||||
GtkPrintSettings *print_settings = gnc_print_get_settings();
|
||||
if (print_settings &&
|
||||
gtk_print_settings_has_key(print_settings,
|
||||
GNC_GTK_PRINT_SETTINGS_EXPORT_DIR))
|
||||
if (print_settings && gtk_print_settings_has_key (print_settings,
|
||||
GNC_GTK_PRINT_SETTINGS_EXPORT_DIR))
|
||||
{
|
||||
const char* dirname = gtk_print_settings_get(print_settings,
|
||||
GNC_GTK_PRINT_SETTINGS_EXPORT_DIR);
|
||||
const char* dirname = gtk_print_settings_get (print_settings,
|
||||
GNC_GTK_PRINT_SETTINGS_EXPORT_DIR);
|
||||
// Only store the directory if it exists.
|
||||
if (g_file_test(dirname,
|
||||
if (g_file_test (dirname,
|
||||
(GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
|
||||
{
|
||||
QofInstance *inst = qofOwnerGetOwner(owner);
|
||||
gncOwnerBeginEdit(owner);
|
||||
qof_instance_set (inst, "export-pdf-dir", dirname);
|
||||
gncOwnerCommitEdit(owner);
|
||||
QofInstance *inst = qofOwnerGetOwner (owner);
|
||||
gncOwnerBeginEdit (owner);
|
||||
qof_instance_set (inst, "export-pdf-dir", dirname);
|
||||
gncOwnerCommitEdit (owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_free (job_name);
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,6 @@ gnc_plugin_page_sx_list_class_init (GncPluginPageSxListClass *klass)
|
||||
static void
|
||||
gnc_plugin_page_sx_list_init (GncPluginPageSxList *plugin_page)
|
||||
{
|
||||
// GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
GncPluginPage *parent;
|
||||
|
||||
@ -239,6 +238,7 @@ gnc_plugin_page_sx_list_init (GncPluginPageSxList *plugin_page)
|
||||
gnc_plugin_page_sx_list_actions,
|
||||
gnc_plugin_page_sx_list_n_actions,
|
||||
plugin_page);
|
||||
|
||||
/* gnc_plugin_init_short_names (action_group, toolbar_labels); */
|
||||
}
|
||||
|
||||
@ -313,18 +313,17 @@ static void
|
||||
gppsl_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data)
|
||||
{
|
||||
GncPluginPage *page;
|
||||
GtkAction *edit_action, *delete_action;
|
||||
GAction *edit_action, *delete_action;
|
||||
gboolean selection_state = TRUE;
|
||||
|
||||
page = GNC_PLUGIN_PAGE(user_data);
|
||||
edit_action = gnc_plugin_page_get_action (page, "SxListEditAction");
|
||||
delete_action = gnc_plugin_page_get_action (page, "SxListDeleteAction");
|
||||
selection_state
|
||||
= gtk_tree_selection_count_selected_rows (selection) == 0
|
||||
? FALSE
|
||||
: TRUE;
|
||||
gtk_action_set_sensitive (edit_action, selection_state);
|
||||
gtk_action_set_sensitive (delete_action, selection_state);
|
||||
selection_state = gtk_tree_selection_count_selected_rows (selection) == 0
|
||||
? FALSE
|
||||
: TRUE;
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(edit_action), selection_state);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(delete_action), selection_state);
|
||||
}
|
||||
|
||||
|
||||
@ -522,6 +521,14 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page)
|
||||
priv->instances = GNC_SX_INSTANCE_MODEL(gnc_sx_get_instances (&end, TRUE));
|
||||
}
|
||||
|
||||
{
|
||||
GAction *edit_action, *delete_action;
|
||||
edit_action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page), "SxListEditAction");
|
||||
delete_action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page), "SxListDeleteAction");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(edit_action), FALSE);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(delete_action), FALSE);
|
||||
}
|
||||
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
GtkTreePath *path = gtk_tree_path_new_first ();
|
||||
@ -544,6 +551,7 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page)
|
||||
"model-populated", (GCallback)gppsl_model_populated_cb, (gpointer)page);
|
||||
|
||||
gppsl_selection_changed_cb (selection, page);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
||||
g_signal_connect (G_OBJECT(priv->tree_view), "button-press-event",
|
||||
|
@ -4,5 +4,6 @@
|
||||
<gresource prefix="/org/gnucash">
|
||||
<file>gnucash.css</file>
|
||||
<file>gnucash-fallback.css</file>
|
||||
<file>ui/gnc-main-window.ui</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
@ -104,7 +104,7 @@ static GActionEntry gnc_plugin_actions [] =
|
||||
{ "Mt942ImportAction", gnc_plugin_ab_cmd_mt942_import, NULL, NULL, NULL },
|
||||
{ "DtausImportAction", gnc_plugin_ab_cmd_dtaus_import, NULL, NULL, NULL },
|
||||
{ "DtausImportSendAction", gnc_plugin_ab_cmd_dtaus_importsend, NULL, NULL, NULL },
|
||||
{ MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW, gnc_plugin_ab_cmd_view_logwindow, NULL, "TRUE", change_state_logwindow },
|
||||
{ MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW, gnc_plugin_ab_cmd_view_logwindow, NULL, "true", change_state_logwindow },
|
||||
};
|
||||
/** The number of actions provided by this plugin. */
|
||||
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
|
||||
@ -236,20 +236,20 @@ static void
|
||||
gnc_plugin_aqbanking_add_to_window(GncPlugin *plugin, GncMainWindow *window,
|
||||
GQuark type)
|
||||
{
|
||||
GtkAction *action;
|
||||
GAction *action;
|
||||
|
||||
gnc_main_window = window;
|
||||
|
||||
g_signal_connect(window, "page_added",
|
||||
G_CALLBACK(gnc_plugin_ab_main_window_page_added),
|
||||
plugin);
|
||||
g_signal_connect(window, "page_changed",
|
||||
G_CALLBACK(gnc_plugin_ab_main_window_page_changed),
|
||||
plugin);
|
||||
g_signal_connect (window, "page_added",
|
||||
G_CALLBACK(gnc_plugin_ab_main_window_page_added),
|
||||
plugin);
|
||||
g_signal_connect (window, "page_changed",
|
||||
G_CALLBACK(gnc_plugin_ab_main_window_page_changed),
|
||||
plugin);
|
||||
|
||||
action = gnc_main_window_find_action(window, MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW);
|
||||
action = gnc_main_window_find_action (window, MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW);
|
||||
|
||||
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), FALSE);
|
||||
//FIXMEb gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -307,7 +307,7 @@ gnc_plugin_ab_main_window_page_added(GncMainWindow *window, GncPluginPage *page,
|
||||
static void update_inactive_actions(GncPluginPage *plugin_page)
|
||||
{
|
||||
GncMainWindow *window;
|
||||
GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
|
||||
// We are readonly - so we have to switch particular actions to inactive.
|
||||
gboolean is_readwrite = !qof_book_is_readonly(gnc_get_current_book());
|
||||
@ -318,11 +318,11 @@ static void update_inactive_actions(GncPluginPage *plugin_page)
|
||||
|
||||
window = GNC_MAIN_WINDOW(plugin_page->window);
|
||||
g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
|
||||
action_group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
|
||||
g_return_if_fail(GTK_IS_ACTION_GROUP(action_group));
|
||||
simple_action_group = gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);
|
||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
||||
|
||||
/* Set the action's sensitivity */
|
||||
gnc_plugin_update_actions (action_group, readonly_inactive_actions,
|
||||
gnc_plugin_update_actionsb (simple_action_group, readonly_inactive_actions,
|
||||
"sensitive", is_readwrite);
|
||||
}
|
||||
|
||||
@ -357,40 +357,40 @@ gnc_plugin_ab_account_selected(GncPluginPage *plugin_page, Account *account,
|
||||
gpointer user_data)
|
||||
{
|
||||
GncMainWindow *window;
|
||||
GtkActionGroup *action_group;
|
||||
GSimpleActionGroup *simple_action_group;
|
||||
const gchar *bankcode = NULL;
|
||||
const gchar *accountid = NULL;
|
||||
|
||||
g_return_if_fail(GNC_IS_PLUGIN_PAGE(plugin_page));
|
||||
window = GNC_MAIN_WINDOW(plugin_page->window);
|
||||
g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
|
||||
action_group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
|
||||
g_return_if_fail(GTK_IS_ACTION_GROUP(action_group));
|
||||
simple_action_group = gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);
|
||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
||||
|
||||
if (account)
|
||||
{
|
||||
bankcode = gnc_ab_get_account_bankcode(account);
|
||||
accountid = gnc_ab_get_account_accountid(account);
|
||||
|
||||
gnc_plugin_update_actions(action_group, need_account_actions,
|
||||
"sensitive",
|
||||
(account && bankcode && *bankcode
|
||||
&& accountid && *accountid));
|
||||
gnc_plugin_update_actions(action_group, need_account_actions,
|
||||
"visible", TRUE);
|
||||
gnc_plugin_update_actionsb (simple_action_group, need_account_actions,
|
||||
"sensitive",
|
||||
(account && bankcode && *bankcode
|
||||
&& accountid && *accountid));
|
||||
gnc_plugin_update_actionsb (simple_action_group, need_account_actions,
|
||||
"visible", TRUE);
|
||||
#if (AQBANKING_VERSION_INT < 60400)
|
||||
gnc_plugin_update_actions(action_group, inactive_account_actions,
|
||||
"sensitive", FALSE);
|
||||
gnc_plugin_update_actions(action_group, inactive_account_actions,
|
||||
"visible", FALSE);
|
||||
gnc_plugin_update_actionsb (simple_action_group, inactive_account_actions,
|
||||
"sensitive", FALSE);
|
||||
gnc_plugin_update_actionsb (simple_action_group, inactive_account_actions,
|
||||
"visible", FALSE);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
gnc_plugin_update_actions(action_group, need_account_actions,
|
||||
"sensitive", FALSE);
|
||||
gnc_plugin_update_actions(action_group, need_account_actions,
|
||||
"visible", FALSE);
|
||||
gnc_plugin_update_actionsb (simple_action_group, need_account_actions,
|
||||
"sensitive", FALSE);
|
||||
gnc_plugin_update_actionsb (simple_action_group, need_account_actions,
|
||||
"visible", FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
@ -462,14 +462,14 @@ main_window_to_account(GncMainWindow *window)
|
||||
void
|
||||
gnc_plugin_aqbanking_set_logwindow_visible(gboolean logwindow_visible)
|
||||
{
|
||||
GtkAction *action;
|
||||
GAction *action;
|
||||
|
||||
action = gnc_main_window_find_action(gnc_main_window,
|
||||
MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW);
|
||||
action = gnc_main_window_find_action (gnc_main_window,
|
||||
MENU_TOGGLE_ACTION_AB_VIEW_LOGWINDOW);
|
||||
if (action)
|
||||
{
|
||||
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action),
|
||||
logwindow_visible);
|
||||
//FIXMEb gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action),
|
||||
// logwindow_visible);
|
||||
}
|
||||
}
|
||||
|
||||
|
542
gnucash/ui/gnc-main-window.ui
Normal file
542
gnucash/ui/gnc-main-window.ui
Normal file
@ -0,0 +1,542 @@
|
||||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
|
||||
<!-- menu starts here -->
|
||||
|
||||
<menu id="mainwin-menu">
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_File</attribute>
|
||||
<attribute name="action">mainwin.FileAction</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.FilePlaceholder0</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Import</attribute>
|
||||
<attribute name="action">mainwin.FileImportAction</attribute>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">ImportPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.FilePlaceholder1</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</submenu>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">SavePlaceholder</attribute>
|
||||
<attribute name="action">mainwin.FilePlaceholder2</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Print</attribute>
|
||||
<attribute name="action">mainwin.FilePrintAction</attribute>
|
||||
<attribute name="accel"><Primary>p</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Print the currently active page</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Pa_ge Setup...</attribute>
|
||||
<attribute name="action">mainwin.FilePageSetupAction</attribute>
|
||||
<attribute name="accel"><Primary><Shift>p</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Specify the page size and orientation for printing</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">PdfPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.FilePlaceholder3</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Export</attribute>
|
||||
<attribute name="action">mainwin.FileExportAction</attribute>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">ExportPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.FilePlaceholder4</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</submenu>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Proper_ties</attribute>
|
||||
<attribute name="action">mainwin.FilePropertiesAction</attribute>
|
||||
<attribute name="accel"><Alt>Return</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Edit the properties of the current file</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">RecentPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.FilePlaceholder5</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Close</attribute>
|
||||
<attribute name="action">mainwin.FileCloseAction</attribute>
|
||||
<attribute name="accel"><Primary>w</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Close the currently active page</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">mainwin.FileQuitAction</attribute>
|
||||
<attribute name="accel"><Primary>q</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Quit this application</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Edit</attribute>
|
||||
<attribute name="action">mainwin.EditAction</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.EditPlaceholder0</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Cu_t</attribute>
|
||||
<attribute name="action">mainwin.EditCutAction</attribute>
|
||||
<attribute name="accel"><Primary>x</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Cut the current selection and copy it to clipboard</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Copy</attribute>
|
||||
<attribute name="action">mainwin.EditCopyAction</attribute>
|
||||
<attribute name="accel"><Primary>c</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Copy the current selection to clipboard</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Paste</attribute>
|
||||
<attribute name="action">mainwin.EditPasteAction</attribute>
|
||||
<attribute name="accel"><Primary>v</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Paste the clipboard content at the cursor position</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.EditPlaceholder1</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.EditPlaceholder2</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">FindPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.EditPlaceholder3</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Pr_eferences</attribute>
|
||||
<attribute name="action">mainwin.EditPreferencesAction</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Edit the global preferences of GnuCash</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">StylePlaceholder</attribute>
|
||||
<attribute name="action">mainwin.EditPlaceholder4</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">TaxPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.EditPlaceholder5</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_View</attribute>
|
||||
<attribute name="action">mainwin.ViewAction</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.ViewPlaceholder0</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Toolbar</attribute>
|
||||
<attribute name="action">mainwin.ViewToolbarAction</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Show/hide the toolbar on this window</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Su_mmary Bar</attribute>
|
||||
<attribute name="action">mainwin.ViewSummaryAction</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Show/hide the summary bar on this window</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Stat_us Bar</attribute>
|
||||
<attribute name="action">mainwin.ViewStatusbarAction</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Show/hide the status bar on this window</attribute>
|
||||
</item>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">Tab P_osition</attribute>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">To_p</attribute>
|
||||
<attribute name="action">mainwin.ViewTabPositionAction</attribute>
|
||||
<attribute name="target" type="i">0</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Display the notebook tabs at the top of the window</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">B_ottom</attribute>
|
||||
<attribute name="action">mainwin.ViewTabPositionAction</attribute>
|
||||
<attribute name="target" type="i">1</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Display the notebook tabs at the bottom of the window</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Left</attribute>
|
||||
<attribute name="action">mainwin.ViewTabPositionAction</attribute>
|
||||
<attribute name="target" type="i">2</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Display the notebook tabs at the left of the window</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Right</attribute>
|
||||
<attribute name="action">mainwin.ViewTabPositionAction</attribute>
|
||||
<attribute name="target" type="i">3</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Display the notebook tabs at the right of the window</attribute>
|
||||
</item>
|
||||
</submenu>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.ViewPlaceholder1</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.ViewPlaceholder2</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">RefreshPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.ViewPlaceholder3</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">AccoutTreePlaceholder</attribute>
|
||||
<attribute name="action">mainwin.ViewPlaceholder4</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">Tra_nsaction</attribute>
|
||||
<attribute name="action">mainwin.TransactionAction</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.TransPlaceholder0</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Actions</attribute>
|
||||
<attribute name="action">mainwin.ActionsAction</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.ActionsPlaceholder0</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">OnlinePlaceholder</attribute>
|
||||
<attribute name="action">mainwin.ActionsPlaceholder1</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">SchedPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.ActionsPlaceholder2</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">BudgetPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.ActionsPlaceholder3</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.ActionsPlaceholder4</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.ActionsPlaceholder5</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.ActionsPlaceholder6</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Reset _Warnings...</attribute>
|
||||
<attribute name="action">mainwin.ActionsForgetWarningsAction</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Reset the state of all warning messages so they will be shown again</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Re_name Page</attribute>
|
||||
<attribute name="action">mainwin.ActionsRenamePageAction</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Rename this page</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Business</attribute>
|
||||
<attribute name="action">mainwin.BusinessAction</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.BusinessPlaceholder0</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Scheduled</attribute>
|
||||
<attribute name="action">mainwin.ScheduledAction</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.SchedulePlaceholder0</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Reports</attribute>
|
||||
<attribute name="action">mainwin.ReportsAction</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.ReportsPlaceholder0</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.ReportsPlaceholder1</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Tools</attribute>
|
||||
<attribute name="action">mainwin.ToolsAction</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">OnlinePlaceholder</attribute>
|
||||
<attribute name="action">mainwin.ToolsPlaceholder0</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">ToolsPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.ToolsPlaceholder1</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">JournalPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.ToolsPlaceholder2</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">E_xtensions</attribute>
|
||||
<attribute name="action">mainwin.ExtensionsAction</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.ExtensionsPlaceholder0</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Windows</attribute>
|
||||
<attribute name="action">mainwin.WindowsAction</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.WindowsPlaceholder0</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_New Window</attribute>
|
||||
<attribute name="action">mainwin.WindowNewAction</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Open a new top-level GnuCash window</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">New Window with _Page</attribute>
|
||||
<attribute name="action">mainwin.WindowMovePageAction</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Move the current page to a new top-level GnuCash window</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">WinPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.WindowsPlaceholder1</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Help</attribute>
|
||||
<attribute name="action">mainwin.HelpAction</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">Placeholder</attribute>
|
||||
<attribute name="action">mainwin.HelpPlaceholder0</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Tutorial and Concepts _Guide</attribute>
|
||||
<attribute name="action">mainwin.HelpTutorialAction</attribute>
|
||||
<attribute name="accel"><Primary>h</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Open the GnuCash Tutorial</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">ToDPlaceholder</attribute>
|
||||
<attribute name="action">mainwin.HelpPlaceholder1</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Contents</attribute>
|
||||
<attribute name="action">mainwin.HelpContentsAction</attribute>
|
||||
<attribute name="accel">F1</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Open the GnuCash Help</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="no">_About</attribute>
|
||||
<attribute name="action">mainwin.HelpAboutAction</attribute>
|
||||
<attribute name="tooltip" translatable="yes">About GnuCash</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
</menu>
|
||||
|
||||
<!-- menu ends here -->
|
||||
|
||||
|
||||
<menu id="mainwin-popup">
|
||||
<item>
|
||||
<attribute name="label" translatable="no">TestAction</attribute>
|
||||
<attribute name="action">mainwin.TestAction</attribute>
|
||||
</item>
|
||||
</menu>
|
||||
|
||||
|
||||
<object class="GtkToolbar" id="mainwin-toolbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="but1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="tooltip-text" translatable="yes">Save the current file</property>
|
||||
<property name="action-name">gnc-plugin-basic-commands-actions.FileSaveAction</property>
|
||||
<property name="label" translatable="yes">_Save</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="icon-name">document-save</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="but2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="tooltip-text" translatable="yes">Close the currently active page</property>
|
||||
<property name="action-name">mainwin.FileCloseAction</property>
|
||||
<property name="label" translatable="yes">_Close</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="icon-name">window-close</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorToolItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="but2a">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="tooltip-text" translatable="yes">Open the New Invoice dialog</property>
|
||||
<property name="label" translatable="no">ToolbarNewInvoiceAction</property>
|
||||
<property name="action-name">gnc-plugin-business-actions.ToolbarNewInvoiceAction</property>
|
||||
<property name="label" translatable="yes">New _Invoice...</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="icon-name">gnc-invoice-new</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorToolItem" id="extra_separator">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
</interface>
|
@ -54,6 +54,7 @@ function(make_gnucash_potfiles)
|
||||
${CMAKE_SOURCE_DIR}/*.keys.in ${CMAKE_SOURCE_DIR}/*.scm
|
||||
${CMAKE_SOURCE_DIR}/*.py ${CMAKE_SOURCE_DIR}/*/qofbookslots.h
|
||||
${CMAKE_SOURCE_DIR}/*/gnc-commodity.h
|
||||
${CMAKE_SOURCE_DIR}/*.ui
|
||||
)
|
||||
|
||||
# Only consider files in a selection of the source directories and
|
||||
|
Loading…
Reference in New Issue
Block a user